diff --git a/.gitattributes b/.gitattributes index b7ca04d95ed..378b7ab94aa 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,7 +4,7 @@ /skill-stubs/*.md text eol=lf /skill-stubs/_shared/*.md text eol=lf /skills/*/SKILL.md text eol=lf -/src/cli/bundled-skill-guides.ts text eol=lf +/src/cli/skills/bundled-skill-guides.ts text eol=lf # SVG bytes feed embedded data URLs and asset hashes on every build host. *.svg text eol=lf # Compiler input line breaks must not depend on the checkout OS. diff --git a/.github/workflows/computer-e2e.yml b/.github/workflows/computer-e2e.yml index 369de291215..51ec40e85fe 100644 --- a/.github/workflows/computer-e2e.yml +++ b/.github/workflows/computer-e2e.yml @@ -48,7 +48,7 @@ on: - 'src/cli/**' - 'src/main/computer/**' - 'src/main/runtime/rpc/dispatcher.ts' - - 'src/main/runtime/rpc/errors.ts' + - 'src/main/runtime/rpc/responses/rpc-response.ts' - 'src/main/runtime/rpc/methods/computer/computer*.ts' - 'src/shared/computer-use-*.ts' - 'tests/e2e/computer-linux.e2e.ts' @@ -97,9 +97,8 @@ jobs: src/main/computer/macos-native/macos-native-provider-client.test.ts src/main/providers/windows-shell-preflight-runtime.windows.test.ts src/main/computer/desktop-script/actions/desktop-script-provider-actions.test.ts - src/cli/format.test.ts - src/cli/handlers/computer-action-validation.test.ts - src/cli/handlers/computer-state-formatting.test.ts + src/cli/output/command-result-output.test.ts + src/cli/computer/computer-state-formatting.test.ts src/cli/index.test.ts src/cli/runtime/envelope-schema.test.ts src/shared/remote-runtime/remote-runtime-client.test.ts diff --git a/.github/workflows/macos-updater-tests.yml b/.github/workflows/macos-updater-tests.yml index d050fb3db5c..6956a23e03d 100644 --- a/.github/workflows/macos-updater-tests.yml +++ b/.github/workflows/macos-updater-tests.yml @@ -11,8 +11,8 @@ on: - 'native/macos-shipit-scheduling/**' - 'config/scripts/macos-shipit-scheduling*' - 'config/electron-builder.config.cjs' - - 'src/main/startup/main-process-quit*' - - 'src/main/window/main-window-state-lifecycle*' + - 'src/main/startup/quit/main-process-quit*' + - 'src/main/window/main-window/main-window-state-lifecycle*' - 'src/main/window/dashboard-popout-window*' - 'src/packages/process-host/**' - 'src/main/runtime/agent-session/lifecycle/structured-agent-cli-writers*' @@ -55,8 +55,8 @@ jobs: src/main/updater/mac-install/updater.mac-install.test.ts src/main/updater/updater.headless-serve-install.test.ts src/main/updater/mac-install/updater-mac-quit-guard.test.ts - src/main/startup/main-process-quit-update-veto.test.ts - src/main/window/main-window-state-lifecycle.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' diff --git a/.github/workflows/mobile.yml b/.github/workflows/mobile.yml index ae12bf8460f..fed925e9b9f 100644 --- a/.github/workflows/mobile.yml +++ b/.github/workflows/mobile.yml @@ -34,7 +34,7 @@ on: - 'src/main/runtime/agent-session/agent-session-unsaved-*.ts' # The phone/host contract program's unmocked desktop sources and its declaration owner's inputs. - 'src/main/runtime/integrations/github/runtime-github-repository-query-commands.ts' - - 'src/main/github/issue-field-options.ts' + - 'src/main/github/issues/issue-field-options.ts' - 'config/tsconfig.test.mobile-host-declarations.json' - 'config/tsconfig.node.json' - 'src/types/build-constants.d.ts' @@ -54,7 +54,55 @@ on: - 'src/main/codex/structured/journal/codex-goal-journal-rows.ts' - 'src/main/codex/__fixtures__/codex-hook-outcomes.jsonl' - 'src/main/ai-vault/session-scanner-*.ts' - - 'src/main/ai-vault/ai-vault-scan-cancellation.ts' + - 'src/main/ai-vault/discovery/agent-session-directories.ts' + - 'src/main/ai-vault/discovery/session-file-discovery.ts' + - 'src/main/ai-vault/discovery/session-json-file.ts' + - 'src/main/ai-vault/discovery/session-path-absence.ts' + - 'src/main/ai-vault/discovery/session-scanner-agent-sources.ts' + - 'src/main/ai-vault/discovery/session-scanner-candidates.ts' + - 'src/main/ai-vault/discovery/session-scanner-directory-reader.test.ts' + - 'src/main/ai-vault/discovery/session-scanner-discovery-pipeline.test.ts' + - 'src/main/ai-vault/discovery/session-scanner-discovery.ts' + - 'src/main/ai-vault/discovery/session-scanner-roots.ts' + - 'src/main/ai-vault/discovery/session-scanner-source-discovery.ts' + - 'src/main/ai-vault/parsing/session-json-object.ts' + - 'src/main/ai-vault/parsing/session-record-fields.ts' + - 'src/main/ai-vault/parsing/session-record-time.ts' + - 'src/main/ai-vault/parsing/session-scanner-accumulator.ts' + - 'src/main/ai-vault/parsing/session-scanner-agent-parser.ts' + - 'src/main/ai-vault/parsing/session-scanner-candidate-parse.ts' + - 'src/main/ai-vault/parsing/session-scanner-core-parser-wsl-stall.test.ts' + - 'src/main/ai-vault/parsing/session-scanner-injected-title.test.ts' + - 'src/main/ai-vault/parsing/session-scanner-jsonl-reader.test.ts' + - 'src/main/ai-vault/parsing/session-scanner-jsonl-reader.ts' + - 'src/main/ai-vault/parsing/session-scanner-messages.test.ts' + - 'src/main/ai-vault/parsing/session-scanner-messages.ts' + - 'src/main/ai-vault/parsing/session-scanner-parse-wsl-stall.test.ts' + - 'src/main/ai-vault/parsing/session-scanner-record-budget.test.ts' + - 'src/main/ai-vault/parsing/session-scanner-recoverable-empty.test.ts' + - 'src/main/ai-vault/parsing/session-scanner-text-normalization.ts' + - 'src/main/ai-vault/parsing/session-scanner-token-values.ts' + - 'src/main/ai-vault/parsing/session-scanner-unlimited-dedup.test.ts' + - 'src/main/ai-vault/prompts/session-scanner-first-user-prompt-capture.ts' + - 'src/main/ai-vault/prompts/session-scanner-first-user-prompt.test.ts' + - 'src/main/ai-vault/prompts/session-scanner-first-user-prompt.ts' + - 'src/main/ai-vault/scanner-fixtures/session-scanner-incremental-fixtures.ts' + - 'src/main/ai-vault/scanner-fixtures/session-scanner-prime-agent-fixtures.ts' + - 'src/main/ai-vault/scanner-fixtures/session-scanner-test-fixtures.ts' + - 'src/main/ai-vault/scanners/copilot/session-scanner-copilot-parser.ts' + - 'src/main/ai-vault/scanners/opencode/session-scanner-opencode-parser.ts' + - 'src/main/ai-vault/scope/session-scanner-scope-discovery.ts' + - 'src/main/ai-vault/scope/session-scanner-scope-inventory.test.ts' + - 'src/main/ai-vault/scope/session-scanner-scope-inventory.ts' + - 'src/main/ai-vault/scope/session-scanner-scope-only.test.ts' + - 'src/main/ai-vault/scope/session-scanner-scope-walk.test.ts' + - 'src/main/ai-vault/scope/session-scanner-scope-walk.ts' + - 'src/main/ai-vault/scope/session-scanner-scope.test.ts' + - 'src/main/ai-vault/session-scanner.ts' + - 'src/shared/error-message.ts' + - 'src/shared/surrogate-safe-text-slice.ts' + - 'src/shared/trimmed-string.ts' + - 'src/main/ai-vault/scan-lifecycle/ai-vault-scan-cancellation.ts' - 'src/main/ai-vault/scan-service/session-scanner-service-env.ts' - 'src/main/ai-vault/scanners/grok/session-scanner-grok-user-text.ts' - 'src/main/provider-process/provider-json-record.ts' @@ -122,7 +170,7 @@ on: - 'src/main/runtime/agent-session/agent-session-unsaved-*.ts' # The phone/host contract program's unmocked desktop sources and its declaration owner's inputs. - 'src/main/runtime/integrations/github/runtime-github-repository-query-commands.ts' - - 'src/main/github/issue-field-options.ts' + - 'src/main/github/issues/issue-field-options.ts' - 'config/tsconfig.test.mobile-host-declarations.json' - 'config/tsconfig.node.json' - 'src/types/build-constants.d.ts' @@ -142,7 +190,55 @@ on: - 'src/main/codex/structured/journal/codex-goal-journal-rows.ts' - 'src/main/codex/__fixtures__/codex-hook-outcomes.jsonl' - 'src/main/ai-vault/session-scanner-*.ts' - - 'src/main/ai-vault/ai-vault-scan-cancellation.ts' + - 'src/main/ai-vault/discovery/agent-session-directories.ts' + - 'src/main/ai-vault/discovery/session-file-discovery.ts' + - 'src/main/ai-vault/discovery/session-json-file.ts' + - 'src/main/ai-vault/discovery/session-path-absence.ts' + - 'src/main/ai-vault/discovery/session-scanner-agent-sources.ts' + - 'src/main/ai-vault/discovery/session-scanner-candidates.ts' + - 'src/main/ai-vault/discovery/session-scanner-directory-reader.test.ts' + - 'src/main/ai-vault/discovery/session-scanner-discovery-pipeline.test.ts' + - 'src/main/ai-vault/discovery/session-scanner-discovery.ts' + - 'src/main/ai-vault/discovery/session-scanner-roots.ts' + - 'src/main/ai-vault/discovery/session-scanner-source-discovery.ts' + - 'src/main/ai-vault/parsing/session-json-object.ts' + - 'src/main/ai-vault/parsing/session-record-fields.ts' + - 'src/main/ai-vault/parsing/session-record-time.ts' + - 'src/main/ai-vault/parsing/session-scanner-accumulator.ts' + - 'src/main/ai-vault/parsing/session-scanner-agent-parser.ts' + - 'src/main/ai-vault/parsing/session-scanner-candidate-parse.ts' + - 'src/main/ai-vault/parsing/session-scanner-core-parser-wsl-stall.test.ts' + - 'src/main/ai-vault/parsing/session-scanner-injected-title.test.ts' + - 'src/main/ai-vault/parsing/session-scanner-jsonl-reader.test.ts' + - 'src/main/ai-vault/parsing/session-scanner-jsonl-reader.ts' + - 'src/main/ai-vault/parsing/session-scanner-messages.test.ts' + - 'src/main/ai-vault/parsing/session-scanner-messages.ts' + - 'src/main/ai-vault/parsing/session-scanner-parse-wsl-stall.test.ts' + - 'src/main/ai-vault/parsing/session-scanner-record-budget.test.ts' + - 'src/main/ai-vault/parsing/session-scanner-recoverable-empty.test.ts' + - 'src/main/ai-vault/parsing/session-scanner-text-normalization.ts' + - 'src/main/ai-vault/parsing/session-scanner-token-values.ts' + - 'src/main/ai-vault/parsing/session-scanner-unlimited-dedup.test.ts' + - 'src/main/ai-vault/prompts/session-scanner-first-user-prompt-capture.ts' + - 'src/main/ai-vault/prompts/session-scanner-first-user-prompt.test.ts' + - 'src/main/ai-vault/prompts/session-scanner-first-user-prompt.ts' + - 'src/main/ai-vault/scanner-fixtures/session-scanner-incremental-fixtures.ts' + - 'src/main/ai-vault/scanner-fixtures/session-scanner-prime-agent-fixtures.ts' + - 'src/main/ai-vault/scanner-fixtures/session-scanner-test-fixtures.ts' + - 'src/main/ai-vault/scanners/copilot/session-scanner-copilot-parser.ts' + - 'src/main/ai-vault/scanners/opencode/session-scanner-opencode-parser.ts' + - 'src/main/ai-vault/scope/session-scanner-scope-discovery.ts' + - 'src/main/ai-vault/scope/session-scanner-scope-inventory.test.ts' + - 'src/main/ai-vault/scope/session-scanner-scope-inventory.ts' + - 'src/main/ai-vault/scope/session-scanner-scope-only.test.ts' + - 'src/main/ai-vault/scope/session-scanner-scope-walk.test.ts' + - 'src/main/ai-vault/scope/session-scanner-scope-walk.ts' + - 'src/main/ai-vault/scope/session-scanner-scope.test.ts' + - 'src/main/ai-vault/session-scanner.ts' + - 'src/shared/error-message.ts' + - 'src/shared/surrogate-safe-text-slice.ts' + - 'src/shared/trimmed-string.ts' + - 'src/main/ai-vault/scan-lifecycle/ai-vault-scan-cancellation.ts' - 'src/main/ai-vault/scan-service/session-scanner-service-env.ts' - 'src/main/ai-vault/scanners/grok/session-scanner-grok-user-text.ts' - 'src/main/provider-process/provider-json-record.ts' diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4ff1830475a..afa721690d0 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -853,8 +853,8 @@ jobs: src/main/pty/shell-startup/zsh-startup-hook-user-config-equivalence.live-shell.test.ts \ src/main/runtime/terminal/wait/tui-idle-zsh-preexec-hook-order.live-shell.test.ts \ src/main/runtime/agent-session/environment/structured-session-cli-login-shell.live-shell.test.ts \ - src/main/startup/shell-probe-terminal-detach.live-shell.test.ts \ - src/main/startup/shell-probe-lifetime.live-shell.test.ts \ + src/main/startup/shell-environment/shell-probe-terminal-detach.live-shell.test.ts \ + src/main/startup/shell-environment/shell-probe-lifetime.live-shell.test.ts \ src/renderer/src/components/terminal-pane/pty-connection/emulation/fish-color-scheme-child-stdin.node-pty.test.ts \ src/shared/fish-wsl-cwd-report.node-pty.test.ts \ src/main/wsl/filesystem/wsl-sh-cwd-report.node-pty.test.ts \ @@ -1117,7 +1117,6 @@ jobs: src/main/browser/cookies/browser-google-cookie-clear.electron.test.ts src/main/browser/guest-lifecycle/popups/presentation/popup-origin-chrome.electron.test.ts src/main/browser/guest-lifecycle/navigation/browser-link-materialization.electron.test.ts - src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-compatibility.electron.test.ts src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-native-compatibility.electron.test.ts src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-background-compatibility.electron.test.ts src/main/browser/extensions/api-runtime/browser-extension-api.electron.test.ts diff --git a/.github/workflows/preflight-cli-platforms.yml b/.github/workflows/preflight-cli-platforms.yml index ba38aee2ea6..566c3a27418 100644 --- a/.github/workflows/preflight-cli-platforms.yml +++ b/.github/workflows/preflight-cli-platforms.yml @@ -47,8 +47,8 @@ jobs: src/main/ipc/preflight-runnable-local-cli.test.ts src/main/ipc/preflight-wsl-agent-detection.test.ts src/main/ipc/preflight-windows-path-refresh.repro.test.ts - src/main/startup/hydrate-shell-path.windows.test.ts - src/main/startup/login-shell-environment.test.ts + src/main/startup/shell-environment/hydrate-shell-path.windows.test.ts + src/main/startup/shell-environment/login-shell-environment.test.ts src/packages/process-host/src/process-tree-termination.test.ts src/packages/process-host/src/run-process.test.ts src/packages/process-host/src/run-process-termination-failure.test.ts diff --git a/.oxlintrc.json b/.oxlintrc.json index 9601fee85cc..a2f65ca794b 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -308,7 +308,7 @@ "ignorePatterns": [ "src/main/acp/generated/acp-protocol.generated.ts", "src/shared/rpc-contract/rpc-params-catalog.generated.ts", - "src/cli/bundled-skill-guides.ts", + "src/cli/skills/bundled-skill-guides.ts", "resources/plugins/declarative/*.mjs", "**/node_modules", "**/dist", diff --git a/cloud/apps/relay-edge/spike/lib.ts b/cloud/apps/relay-edge/spike/lib.ts index 2572a4703f0..4c226454227 100644 --- a/cloud/apps/relay-edge/spike/lib.ts +++ b/cloud/apps/relay-edge/spike/lib.ts @@ -6,7 +6,7 @@ import { SignJWT, exportJWK, generateKeyPair, importJWK, type JWK } from 'jose' import nacl from 'tweetnacl' import WebSocket from 'ws' import { RelayControlClient } from '../../../../src/main/runtime/mobile-cloud-relay/relay-control-client' -import { CloudRelayTransport } from '../../../../src/main/runtime/rpc/relay-transport' +import { CloudRelayTransport } from '../../../../src/main/runtime/rpc/transports/relay-transport' export const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms)) diff --git a/cloud/apps/relay-edge/spike/run-all-harness.ts b/cloud/apps/relay-edge/spike/run-all-harness.ts index 6b9956a0c5c..d4928f8784c 100644 --- a/cloud/apps/relay-edge/spike/run-all-harness.ts +++ b/cloud/apps/relay-edge/spike/run-all-harness.ts @@ -3,7 +3,7 @@ import { execSync } from 'node:child_process' import WebSocket from 'ws' import { RelayControlClient } from '../../../../src/main/runtime/mobile-cloud-relay/relay-control-client' -import { CloudRelayTransport } from '../../../../src/main/runtime/rpc/relay-transport' +import { CloudRelayTransport } from '../../../../src/main/runtime/rpc/transports/relay-transport' export const PORT = 8787 export const ORIGIN = `http://127.0.0.1:${PORT}` diff --git a/cloud/apps/relay-edge/test/harness-mvp-object.ts b/cloud/apps/relay-edge/test/harness-mvp-object.ts index 69530b07307..c47386b9be5 100644 --- a/cloud/apps/relay-edge/test/harness-mvp-object.ts +++ b/cloud/apps/relay-edge/test/harness-mvp-object.ts @@ -6,7 +6,7 @@ import { SignJWT, type KeyLike } from 'jose' import nacl from 'tweetnacl' import WebSocket from 'ws' import { RelayControlClient } from '../../../../src/main/runtime/mobile-cloud-relay/relay-control-client' -import { CloudRelayTransport } from '../../../../src/main/runtime/rpc/relay-transport' +import { CloudRelayTransport } from '../../../../src/main/runtime/rpc/transports/relay-transport' export const PORT = 8789 export const REMOTE = process.env.MVP_URL?.replace(/\/$/, '') diff --git a/cloud/apps/relay-edge/test/harness-roundtrip.ts b/cloud/apps/relay-edge/test/harness-roundtrip.ts index 123c485a339..04b44f2ab85 100644 --- a/cloud/apps/relay-edge/test/harness-roundtrip.ts +++ b/cloud/apps/relay-edge/test/harness-roundtrip.ts @@ -9,7 +9,7 @@ import { SignJWT, type KeyLike } from 'jose' import nacl from 'tweetnacl' import WebSocket from 'ws' import { RelayControlClient } from '../../../../src/main/runtime/mobile-cloud-relay/relay-control-client' -import { CloudRelayTransport } from '../../../../src/main/runtime/rpc/relay-transport' +import { CloudRelayTransport } from '../../../../src/main/runtime/rpc/transports/relay-transport' import { RelayPhoneHelloSchema } from '../../../../src/shared/remote-runtime/relay/mobile-relay-phone-protocol' export const DIRECTOR_APP = process.env.DIRECTOR_APP ?? '' diff --git a/cloud/apps/relay-edge/test/mvp.ts b/cloud/apps/relay-edge/test/mvp.ts index d0f915a7fb2..8b1b66b858e 100644 --- a/cloud/apps/relay-edge/test/mvp.ts +++ b/cloud/apps/relay-edge/test/mvp.ts @@ -16,7 +16,7 @@ import nacl from 'tweetnacl' import pg from 'pg' import WebSocket from 'ws' import { RelayControlClient } from '../../../../src/main/runtime/mobile-cloud-relay/relay-control-client' -import { CloudRelayTransport } from '../../../../src/main/runtime/rpc/relay-transport' +import { CloudRelayTransport } from '../../../../src/main/runtime/rpc/transports/relay-transport' import { RelayPhoneHelloSchema } from '../../../../src/shared/remote-runtime/relay/mobile-relay-phone-protocol' const PORT = 8788 diff --git a/cloud/apps/relay/src/assignment/migrations/migration-recovery-postgres.test.ts b/cloud/apps/relay/src/assignment/migrations/migration-recovery-postgres.test.ts index 1cb85261395..5d6a099ddc4 100644 --- a/cloud/apps/relay/src/assignment/migrations/migration-recovery-postgres.test.ts +++ b/cloud/apps/relay/src/assignment/migrations/migration-recovery-postgres.test.ts @@ -6,7 +6,6 @@ import { type RelayAssignmentMigration } from '../assignment-store.js' import { openRelayDatabase, type RelayDatabase } from '../../database/database.js' -import { readRegisteredMigrationInventory } from './registered-migration-inventory.js' const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL const describePostgres = databaseUrl ? describe : describe.skip @@ -245,39 +244,6 @@ describePostgres('PostgreSQL migration recovery', () => { ) } - it('reaps an abandoned registered migration onto its healthy target', async () => { - const input = await fixture() - await input.store.releaseActivity(input.identity, input.sourceControlId) - await input.store.releaseActivity(input.identity, input.targetControlId) - input.advance( - ASSIGNMENT_LIMITS.migrationLeaseMs + STRANDED_MIGRATION_ABANDON_MS + 1 - ) - - await expect(input.store.abortExpiredEvacuations()).resolves.toBe(1) - expect( - await database.query( - `SELECT assignment.cell_id, assignment.assignment_epoch, - migration.completed_at, migration.aborted_at - FROM relay_assignments assignment - JOIN relay_assignment_migrations migration - ON migration.user_id = assignment.user_id - AND migration.relay_host_id = assignment.relay_host_id - AND migration.assignment_epoch = assignment.assignment_epoch - WHERE assignment.user_id = ? AND assignment.relay_host_id = ?`, - [input.identity.userId, input.identity.relayHostId] - ) - ).toEqual([ - { - cell_id: input.cells.failed.id, - assignment_epoch: '2', - completed_at: String( - 100 + ASSIGNMENT_LIMITS.migrationLeaseMs + STRANDED_MIGRATION_ABANDON_MS + 1 - ), - aborted_at: null - } - ]) - }) - it('reaps immediately after the retired source has a durable completed fence', async () => { const input = await fixture() await input.store.releaseActivity(input.identity, input.sourceControlId) @@ -309,171 +275,6 @@ describePostgres('PostgreSQL migration recovery', () => { ]) }) - it('reaps immediately after the retired source has an adopted legacy fence', async () => { - const input = await fixture() - await input.store.releaseActivity(input.identity, input.sourceControlId) - await input.store.releaseActivity(input.identity, input.targetControlId) - input.advancePastHeartbeat() - await input.store.adoptLegacyCellFence( - input.cells.source.id, - input.cellIncarnation - ) - await input.store.commitLegacyCellFenceAdoption( - input.cells.source.id, - input.cellIncarnation - ) - input.advance(ASSIGNMENT_LIMITS.migrationLeaseMs + 1) - - expect( - ( - await readRegisteredMigrationInventory( - database, - 100 + 45_001 + ASSIGNMENT_LIMITS.migrationLeaseMs + 1 - ) - ).abandoned - ).toBe(1) - - await expect(input.store.abortExpiredEvacuations()).resolves.toBe(1) - expect( - await database.query( - `SELECT assignment.cell_id, assignment.assignment_epoch, - migration.completed_at, migration.aborted_at - FROM relay_assignments assignment - JOIN relay_assignment_migrations migration - ON migration.user_id = assignment.user_id - AND migration.relay_host_id = assignment.relay_host_id - AND migration.assignment_epoch = assignment.assignment_epoch - WHERE assignment.user_id = ? AND assignment.relay_host_id = ?`, - [input.identity.userId, input.identity.relayHostId] - ) - ).toEqual([ - { - cell_id: input.cells.failed.id, - assignment_epoch: '2', - completed_at: String(100 + 45_001 + ASSIGNMENT_LIMITS.migrationLeaseMs + 1), - aborted_at: null - } - ]) - }) - - it('does not reap after temporary legacy adoption without durable commit', async () => { - const input = await fixture() - await input.store.releaseActivity(input.identity, input.sourceControlId) - await input.store.releaseActivity(input.identity, input.targetControlId) - input.advancePastHeartbeat() - await input.store.adoptLegacyCellFence( - input.cells.source.id, - input.cellIncarnation - ) - input.advance(ASSIGNMENT_LIMITS.migrationLeaseMs + 1) - - expect( - ( - await readRegisteredMigrationInventory( - database, - 100 + 45_001 + ASSIGNMENT_LIMITS.migrationLeaseMs + 1 - ) - ).abandoned - ).toBe(0) - await expect(input.store.abortExpiredEvacuations()).resolves.toBe(0) - input.advance(STRANDED_MIGRATION_ABANDON_MS) - await expect(input.store.abortExpiredEvacuations()).resolves.toBe(1) - }) - - it('invalidates an adopted legacy fence when the source heartbeats', async () => { - const input = await fixture() - await input.store.releaseActivity(input.identity, input.sourceControlId) - await input.store.releaseActivity(input.identity, input.targetControlId) - input.advancePastHeartbeat() - await input.store.adoptLegacyCellFence( - input.cells.source.id, - input.cellIncarnation - ) - await input.store.commitLegacyCellFenceAdoption( - input.cells.source.id, - input.cellIncarnation - ) - input.advance(ASSIGNMENT_LIMITS.migrationLeaseMs + 1) - await input.heartbeat(input.cells.source) - - expect( - await database.query( - `SELECT cell_id FROM relay_cell_legacy_fence_adoptions WHERE cell_id = ?`, - [input.cells.source.id] - ) - ).toEqual([]) - await expect(input.store.abortExpiredEvacuations()).resolves.toBe(0) - input.advance(STRANDED_MIGRATION_ABANDON_MS) - await expect(input.store.abortExpiredEvacuations()).resolves.toBe(1) - }) - - it('invalidates an adopted legacy fence when the source restarts', async () => { - const input = await fixture() - await input.store.releaseActivity(input.identity, input.sourceControlId) - await input.store.releaseActivity(input.identity, input.targetControlId) - input.advancePastHeartbeat() - await input.store.adoptLegacyCellFence( - input.cells.source.id, - input.cellIncarnation - ) - await input.store.commitLegacyCellFenceAdoption( - input.cells.source.id, - input.cellIncarnation - ) - input.advance(ASSIGNMENT_LIMITS.migrationLeaseMs + 1) - await input.store.recordCellHeartbeat({ - cellId: input.cells.source.id, - cellUrl: input.cells.source.url, - cellIncarnation: '99999999-9999-4999-8999-999999999999', - startedAt: 51, - ready: true, - observedRequests: 0 - }) - - expect( - await database.query( - `SELECT cell_id FROM relay_cell_legacy_fence_adoptions WHERE cell_id = ?`, - [input.cells.source.id] - ) - ).toEqual([]) - await expect(input.store.abortExpiredEvacuations()).resolves.toBe(0) - input.advance(STRANDED_MIGRATION_ABANDON_MS) - await expect(input.store.abortExpiredEvacuations()).resolves.toBe(1) - }) - - it('serializes legacy adoption with a returning source heartbeat', async () => { - const input = await fixture() - await input.store.releaseActivity(input.identity, input.sourceControlId) - await input.store.releaseActivity(input.identity, input.targetControlId) - input.advancePastHeartbeat() - await input.store.adoptLegacyCellFence( - input.cells.source.id, - input.cellIncarnation - ) - - const [commit, heartbeatResult] = await Promise.allSettled([ - input.store.commitLegacyCellFenceAdoption( - input.cells.source.id, - input.cellIncarnation - ), - input.heartbeat(input.cells.source) - ]) - expect(heartbeatResult.status).toBe('fulfilled') - if (commit.status === 'rejected') { - expect(commit.reason).toMatchObject({ message: 'legacy_cell_fence_not_active' }) - } - expect( - await database.query( - `SELECT cell_id FROM relay_cell_legacy_fence_adoptions WHERE cell_id = ?`, - [input.cells.source.id] - ) - ).toEqual([]) - input.advance( - ASSIGNMENT_LIMITS.migrationLeaseMs + STRANDED_MIGRATION_ABANDON_MS + 1 - ) - await expect(input.store.abortExpiredEvacuations()).resolves.toBe(1) - }) - it('restores the 24-hour guard when the fenced source heartbeats again', async () => { const input = await fixture() await input.store.releaseActivity(input.identity, input.sourceControlId) @@ -495,83 +296,6 @@ describePostgres('PostgreSQL migration recovery', () => { await expect(input.store.abortExpiredEvacuations()).resolves.toBe(1) }) - it('restores the 24-hour guard when the fenced source restarts', async () => { - const input = await fixture() - await input.store.releaseActivity(input.identity, input.sourceControlId) - await input.store.releaseActivity(input.identity, input.targetControlId) - input.advancePastHeartbeat() - await completeSourceFence(input) - input.advance(ASSIGNMENT_LIMITS.migrationLeaseMs + 1) - await input.store.recordCellHeartbeat({ - cellId: input.cells.source.id, - cellUrl: input.cells.source.url, - cellIncarnation: '99999999-9999-4999-8999-999999999999', - startedAt: 51, - ready: true, - observedRequests: 0 - }) - - await expect(input.store.abortExpiredEvacuations()).resolves.toBe(0) - expect( - await database.query( - `SELECT completed_at, aborted_at FROM relay_assignment_migrations - WHERE user_id = ? AND relay_host_id = ?`, - [input.identity.userId, input.identity.relayHostId] - ) - ).toEqual([{ completed_at: null, aborted_at: null }]) - input.advance(STRANDED_MIGRATION_ABANDON_MS) - await expect(input.store.abortExpiredEvacuations()).resolves.toBe(1) - }) - - it('serializes fenced cleanup with a returning source heartbeat', async () => { - const input = await fixture() - await input.store.releaseActivity(input.identity, input.sourceControlId) - await input.store.releaseActivity(input.identity, input.targetControlId) - input.advancePastHeartbeat() - await completeSourceFence(input) - input.advance(ASSIGNMENT_LIMITS.migrationLeaseMs + 1) - - const [cleanup, heartbeatResult] = await Promise.allSettled([ - input.store.abortExpiredEvacuations(), - input.heartbeat(input.cells.source) - ]) - expect(cleanup.status).toBe('fulfilled') - expect(heartbeatResult.status).toBe('fulfilled') - if (cleanup.status !== 'fulfilled') throw cleanup.reason - if (heartbeatResult.status !== 'fulfilled') throw heartbeatResult.reason - expect([0, 1]).toContain(cleanup.value) - const migrations = await database.query( - `SELECT completed_at, aborted_at FROM relay_assignment_migrations - WHERE user_id = ? AND relay_host_id = ?`, - [input.identity.userId, input.identity.relayHostId] - ) - if (cleanup.value === 1) { - expect(migrations[0]?.completed_at).not.toBeNull() - } else { - expect(migrations).toEqual([{ completed_at: null, aborted_at: null }]) - input.advance(STRANDED_MIGRATION_ABANDON_MS) - await expect(input.store.abortExpiredEvacuations()).resolves.toBe(1) - } - }) - - it('keeps a freshly retired source protected without a durable fence', async () => { - const input = await fixture() - await input.store.releaseActivity(input.identity, input.sourceControlId) - await input.store.releaseActivity(input.identity, input.targetControlId) - input.advance(ASSIGNMENT_LIMITS.migrationLeaseMs + 1) - - await expect(input.store.abortExpiredEvacuations()).resolves.toBe(0) - expect( - await database.query( - `SELECT completed_at, aborted_at FROM relay_assignment_migrations - WHERE user_id = ? AND relay_host_id = ?`, - [input.identity.userId, input.identity.relayHostId] - ) - ).toEqual([{ completed_at: null, aborted_at: null }]) - input.advance(STRANDED_MIGRATION_ABANDON_MS) - await expect(input.store.abortExpiredEvacuations()).resolves.toBe(1) - }) - it('rolls an abandoned disabled target back to its source', async () => { const input = await fixture() await input.store.releaseActivity(input.identity, input.sourceControlId) @@ -606,96 +330,6 @@ describePostgres('PostgreSQL migration recovery', () => { ]) }) - it('serializes cleanup against supersession without reporting a false target', async () => { - const input = await fixture() - await input.store.releaseActivity(input.identity, input.sourceControlId) - await input.store.releaseActivity(input.identity, input.targetControlId) - await input.store.setCellEnabled(input.cells.failed.id, false) - input.advance( - ASSIGNMENT_LIMITS.migrationLeaseMs + STRANDED_MIGRATION_ABANDON_MS + 1 - ) - await input.heartbeat(input.cells.source) - await input.heartbeat(input.cells.replacement) - await input.store.attestCellFence(input.cells.failed.id, input.cellIncarnation) - - const [cleanup, supersession] = await Promise.allSettled([ - input.store.abortExpiredEvacuations(), - input.store.supersedeRegisteredCellEvacuations( - input.cells.source.id, - input.cells.failed.id, - input.cells.replacement.id, - 100 - ) - ]) - expect(cleanup.status).toBe('fulfilled') - if (cleanup.status !== 'fulfilled') throw cleanup.reason - if (supersession.status === 'fulfilled') { - expect([0, 1]).toContain(supersession.value) - const assignment = await database.query( - `SELECT cell_id FROM relay_assignments WHERE user_id = ?`, - [input.identity.userId] - ) - expect(assignment).toEqual([{ - cell_id: - supersession.value === 1 - ? input.cells.replacement.id - : input.cells.source.id - }]) - if (supersession.value === 0) expect(cleanup.value).toBeGreaterThanOrEqual(1) - } else { - expect(cleanup.value).toBeGreaterThanOrEqual(1) - expect(supersession.reason).toMatchObject({ message: 'migration_already_superseded' }) - expect( - await database.query( - `SELECT cell_id FROM relay_assignments WHERE user_id = ?`, - [input.identity.userId] - ) - ).toEqual([{ cell_id: input.cells.source.id }]) - } - }) - - it('completes a registered migration from a dead source idempotently', async () => { - const input = await fixture() - await input.store.releaseActivity(input.identity, input.sourceControlId) - input.advancePastHeartbeat() - await input.heartbeat(input.cells.failed) - await input.store.attestCellFence( - input.cells.source.id, - input.cellIncarnation - ) - const completion = { - assignmentEpoch: input.migration.assignmentEpoch, - sourceCellId: input.cells.source.id, - targetCellId: input.cells.failed.id - } - - await expect( - input.store.cellEvacuationStatus( - input.cells.source.id, - input.cells.failed.id, - true - ) - ).resolves.toMatchObject({ inProgress: 0, completed: 1 }) - await expect( - input.store.completeEvacuationFromDeadSource(input.identity, completion) - ).resolves.toMatchObject({ changed: false }) - expect(await reservations(input.cells)).toEqual({ source: 0, failed: 1, replacement: 0 }) - }) - - it('requires fence evidence for dead-source completion', async () => { - const input = await fixture() - await input.store.releaseActivity(input.identity, input.sourceControlId) - - await expect( - input.store.completeEvacuationFromDeadSource(input.identity, { - assignmentEpoch: input.migration.assignmentEpoch, - sourceCellId: input.cells.source.id, - targetCellId: input.cells.failed.id - }) - ).rejects.toThrow('cell_fence_attestation_missing') - expect(await reservations(input.cells)).toEqual({ source: 0, failed: 2, replacement: 0 }) - }) - it('supersedes a registered migration with exact accounting and idempotency', async () => { const input = await fixture() await database.query( @@ -760,359 +394,6 @@ describePostgres('PostgreSQL migration recovery', () => { ]) }) - it('reconciles durable cell accounting before aggregate supersession', async () => { - const input = await fixture() - await input.store.setCellEnabled(input.cells.failed.id, false) - input.advancePastHeartbeat() - await input.heartbeat(input.cells.source) - await input.heartbeat(input.cells.replacement) - await input.store.attestCellFence( - input.cells.failed.id, - input.cellIncarnation - ) - await database.query( - `UPDATE relay_cells - SET reserved_requests = CASE WHEN cell_id = ? THEN 1 ELSE 0 END - WHERE cell_id IN (?, ?)`, - [input.cells.replacement.id, input.cells.source.id, input.cells.replacement.id] - ) - - await expect( - input.store.supersedeRegisteredCellEvacuations( - input.cells.source.id, - input.cells.failed.id, - input.cells.replacement.id, - 100 - ) - ).resolves.toBe(1) - expect(await reservations(input.cells)).toEqual({ - source: 1, - failed: 0, - replacement: 2 - }) - }) - - it('rebuilds an expired registered migration lease before supersession', async () => { - const input = await fixture() - await pinMigration(input, input.migration.assignmentEpoch) - await clearActivities(input) - await database.query( - `UPDATE relay_assignment_migrations SET expires_at = 0 - WHERE user_id = ? AND relay_host_id = ? AND assignment_epoch = ?`, - [input.identity.userId, input.identity.relayHostId, input.migration.assignmentEpoch] - ) - await fenceFailedCell(input) - - await expect(supersedeAggregate(input)).resolves.toBe(1) - expect(await reservations(input.cells)).toEqual({ - source: 0, - failed: 0, - replacement: 1 - }) - expect( - await database.query( - `SELECT assignment_epoch, source_request_units, target_reserved_units, aborted_at - FROM relay_assignment_migrations WHERE user_id = ? ORDER BY assignment_epoch`, - [input.identity.userId] - ) - ).toEqual([ - { - assignment_epoch: '2', - source_request_units: '1', - target_reserved_units: '2', - aborted_at: '45101' - }, - { - assignment_epoch: '3', - source_request_units: '0', - target_reserved_units: '1', - aborted_at: null - } - ]) - }) - - it('retires an obsolete row without discarding replacement activity', async () => { - const input = await fixture() - await pinMigration(input, input.migration.assignmentEpoch) - await fenceFailedCell(input) - await input.store.supersedeRegisteredEvacuation(input.identity, { - assignmentEpoch: input.migration.assignmentEpoch, - sourceCellId: input.cells.source.id, - currentTargetCellId: input.cells.failed.id, - replacementTargetCellId: input.cells.replacement.id - }) - await database.query( - `UPDATE relay_assignment_migrations SET aborted_at = NULL - WHERE user_id = ? AND relay_host_id = ? AND assignment_epoch = ?`, - [input.identity.userId, input.identity.relayHostId, input.migration.assignmentEpoch] - ) - const activityBefore = await assignmentActivities(input) - - await expect(supersedeAggregate(input)).resolves.toBe(1) - expect(await assignmentActivities(input)).toEqual(activityBefore) - expect(await reservations(input.cells)).toEqual({ - source: 1, - failed: 0, - replacement: 2 - }) - expect( - await database.query( - `SELECT assignment_epoch, aborted_at FROM relay_assignment_migrations - WHERE user_id = ? ORDER BY assignment_epoch`, - [input.identity.userId] - ) - ).toEqual([ - { assignment_epoch: '2', aborted_at: '45101' }, - { assignment_epoch: '3', aborted_at: null } - ]) - }) - - it('anchors a newer dormant failed-cell epoch and preserves drain evidence', async () => { - const input = await fixture() - const drainAttemptId = await pinMigration(input, input.migration.assignmentEpoch) - await clearActivities(input) - await database.query( - `UPDATE relay_assignments SET assignment_epoch = 4 - WHERE user_id = ? AND relay_host_id = ?`, - [input.identity.userId, input.identity.relayHostId] - ) - await database.query( - `UPDATE relay_assignment_migrations SET expires_at = 0 - WHERE user_id = ? AND relay_host_id = ? AND assignment_epoch = ?`, - [input.identity.userId, input.identity.relayHostId, input.migration.assignmentEpoch] - ) - await fenceFailedCell(input) - - await expect(supersedeAggregate(input)).resolves.toBe(1) - expect(await reservations(input.cells)).toEqual({ - source: 0, - failed: 0, - replacement: 1 - }) - expect( - await database.query( - `SELECT assignment_epoch, source_request_units, target_reserved_units, aborted_at - FROM relay_assignment_migrations WHERE user_id = ? ORDER BY assignment_epoch`, - [input.identity.userId] - ) - ).toEqual([ - { - assignment_epoch: '2', - source_request_units: '1', - target_reserved_units: '2', - aborted_at: '45101' - }, - { - assignment_epoch: '4', - source_request_units: '0', - target_reserved_units: '1', - aborted_at: '45101' - }, - { - assignment_epoch: '5', - source_request_units: '0', - target_reserved_units: '1', - aborted_at: null - } - ]) - expect( - await database.query( - `SELECT assignment_epoch, drain_attempt_id, source_request_units, - target_reserved_units - FROM relay_post_drain_migration_pins - WHERE user_id = ? ORDER BY assignment_epoch`, - [input.identity.userId] - ) - ).toEqual([ - { - assignment_epoch: '2', - drain_attempt_id: drainAttemptId, - source_request_units: '1', - target_reserved_units: '2' - }, - { - assignment_epoch: '4', - drain_attempt_id: drainAttemptId, - source_request_units: '0', - target_reserved_units: '1' - }, - { - assignment_epoch: '5', - drain_attempt_id: drainAttemptId, - source_request_units: '0', - target_reserved_units: '1' - } - ]) - }) - - it('uses an existing current-epoch migration once when retiring an older row', async () => { - const input = await fixture() - await pinMigration(input, input.migration.assignmentEpoch) - await clearActivities(input) - await database.query( - `UPDATE relay_assignments SET assignment_epoch = 4 - WHERE user_id = ? AND relay_host_id = ?`, - [input.identity.userId, input.identity.relayHostId] - ) - await database.query( - `INSERT INTO relay_assignment_migrations - (user_id, relay_host_id, source_cell_id, target_cell_id, - previous_epoch, assignment_epoch, source_request_units, - target_reserved_units, expires_at, target_registered_at, - completed_at, aborted_at, created_at, updated_at) - VALUES (?, ?, ?, ?, 2, 4, 0, 1, 0, 100, NULL, NULL, 100, 100)`, - [ - input.identity.userId, - input.identity.relayHostId, - input.cells.source.id, - input.cells.failed.id - ] - ) - await database.query( - `INSERT INTO relay_assignment_migration_incarnations - (user_id, relay_host_id, assignment_epoch, source_cell_incarnation, - target_cell_incarnation) - VALUES (?, ?, 4, ?, ?)`, - [ - input.identity.userId, - input.identity.relayHostId, - input.cellIncarnation, - input.cellIncarnation - ] - ) - await pinMigration(input, 4) - await fenceFailedCell(input) - - await expect(supersedeAggregate(input)).resolves.toBe(1) - expect( - await database.query( - `SELECT assignment_epoch, aborted_at FROM relay_assignment_migrations - WHERE user_id = ? ORDER BY assignment_epoch`, - [input.identity.userId] - ) - ).toEqual([ - { assignment_epoch: '2', aborted_at: '45101' }, - { assignment_epoch: '4', aborted_at: '45101' }, - { assignment_epoch: '5', aborted_at: null } - ]) - expect(await reservations(input.cells)).toEqual({ - source: 0, - failed: 0, - replacement: 1 - }) - }) - - it('rejects a newer failed-cell epoch with ambiguous activity', async () => { - const input = await fixture() - await database.query( - `UPDATE relay_assignments SET assignment_epoch = 4 - WHERE user_id = ? AND relay_host_id = ?`, - [input.identity.userId, input.identity.relayHostId] - ) - await fenceFailedCell(input) - - await expect(supersedeAggregate(input)).rejects.toThrow( - 'migration_activity_topology_mismatch' - ) - expect( - await database.query( - `SELECT assignment_epoch, aborted_at FROM relay_assignment_migrations - WHERE user_id = ?`, - [input.identity.userId] - ) - ).toEqual([{ assignment_epoch: '2', aborted_at: null }]) - expect(await reservations(input.cells)).toEqual({ - source: 1, - failed: 2, - replacement: 0 - }) - }) - - it('leaves lease repair retryable when supersession later fails', async () => { - const input = await fixture(1) - await database.query( - `DELETE FROM relay_assignment_activity_leases - WHERE user_id = ? AND relay_host_id = ? AND activity_kind = 'migration'`, - [input.identity.userId, input.identity.relayHostId] - ) - await database.query( - `UPDATE relay_assignments SET migration_leases = 0 - WHERE user_id = ? AND relay_host_id = ?`, - [input.identity.userId, input.identity.relayHostId] - ) - await database.query( - `UPDATE relay_cells SET reserved_requests = reserved_requests - 1 - WHERE cell_id = ?`, - [input.cells.failed.id] - ) - await database.query( - `UPDATE relay_assignment_migrations SET expires_at = 0 - WHERE user_id = ? AND relay_host_id = ? AND assignment_epoch = ?`, - [input.identity.userId, input.identity.relayHostId, input.migration.assignmentEpoch] - ) - await fenceFailedCell(input) - - await expect(supersedeAggregate(input)).rejects.toThrow( - 'relay_capacity_exhausted' - ) - expect( - await database.query( - `SELECT activity_id FROM relay_assignment_activity_leases - WHERE user_id = ? AND activity_kind = 'migration'`, - [input.identity.userId] - ) - ).toEqual([{ activity_id: 'migration:2' }]) - expect( - await database.query( - `SELECT aborted_at FROM relay_assignment_migrations - WHERE user_id = ? AND assignment_epoch = 2`, - [input.identity.userId] - ) - ).toEqual([{ aborted_at: null }]) - - await database.query( - `UPDATE relay_cells SET capacity_requests = 2 WHERE cell_id = ?`, - [input.cells.replacement.id] - ) - await expect(supersedeAggregate(input)).resolves.toBe(1) - expect(await reservations(input.cells)).toEqual({ - source: 1, - failed: 0, - replacement: 2 - }) - }) - - it('serializes concurrent supersession retries without duplicating capacity', async () => { - const input = await fixture() - await input.store.setCellEnabled(input.cells.failed.id, false) - input.advancePastHeartbeat() - await input.heartbeat(input.cells.source) - await input.heartbeat(input.cells.replacement) - await input.store.attestCellFence( - input.cells.failed.id, - input.cellIncarnation - ) - const supersession = { - assignmentEpoch: input.migration.assignmentEpoch, - sourceCellId: input.cells.source.id, - currentTargetCellId: input.cells.failed.id, - replacementTargetCellId: input.cells.replacement.id - } - - const results = await Promise.all([ - input.store.supersedeRegisteredEvacuation(input.identity, supersession), - input.store.supersedeRegisteredEvacuation(input.identity, supersession) - ]) - expect(results[0]).toEqual(results[1]) - expect(await reservations(input.cells)).toEqual({ source: 1, failed: 0, replacement: 2 }) - expect( - await database.query( - `SELECT COUNT(*) AS count FROM relay_assignment_migrations WHERE user_id = ?`, - [input.identity.userId] - ) - ).toEqual([{ count: '2' }]) - }) - it('fails a competing aggregate supersession instead of reporting the wrong target', async () => { const input = await fixture() const alternate = { @@ -1205,153 +486,6 @@ describePostgres('PostgreSQL migration recovery', () => { ).toEqual([{ assignment_epoch: '2', aborted_at: null }]) }) - it('rolls back supersession when migration request-unit shape drifted', async () => { - const input = await fixture() - await input.store.setCellEnabled(input.cells.failed.id, false) - input.advancePastHeartbeat() - await input.heartbeat(input.cells.source) - await input.heartbeat(input.cells.replacement) - await input.store.attestCellFence(input.cells.failed.id, input.cellIncarnation) - await database.query( - `UPDATE relay_assignment_activity_leases - SET request_units = request_units + 1 - WHERE user_id = ? AND activity_kind = 'migration'`, - [input.identity.userId] - ) - await database.query( - `UPDATE relay_cells SET reserved_requests = reserved_requests + 1 WHERE cell_id = ?`, - [input.cells.failed.id] - ) - - await expect( - input.store.supersedeRegisteredEvacuation(input.identity, { - assignmentEpoch: input.migration.assignmentEpoch, - sourceCellId: input.cells.source.id, - currentTargetCellId: input.cells.failed.id, - replacementTargetCellId: input.cells.replacement.id - }) - ).rejects.toThrow('migration_activity_lease_shape_mismatch') - expect(await reservations(input.cells)).toEqual({ source: 1, failed: 3, replacement: 0 }) - expect( - await database.query( - `SELECT cell_id, assignment_epoch FROM relay_assignments WHERE user_id = ?`, - [input.identity.userId] - ) - ).toEqual([{ cell_id: input.cells.failed.id, assignment_epoch: '2' }]) - }) - - it('rolls back supersession when locked cell reservation accounting drifted', async () => { - const input = await fixture() - await input.store.setCellEnabled(input.cells.failed.id, false) - input.advancePastHeartbeat() - await input.heartbeat(input.cells.source) - await input.heartbeat(input.cells.replacement) - await input.store.attestCellFence(input.cells.failed.id, input.cellIncarnation) - await database.query( - `UPDATE relay_cells SET reserved_requests = 1 WHERE cell_id = ?`, - [input.cells.replacement.id] - ) - - await expect( - input.store.supersedeRegisteredEvacuation(input.identity, { - assignmentEpoch: input.migration.assignmentEpoch, - sourceCellId: input.cells.source.id, - currentTargetCellId: input.cells.failed.id, - replacementTargetCellId: input.cells.replacement.id - }) - ).rejects.toThrow('migration_cell_reservation_accounting_mismatch') - expect(await reservations(input.cells)).toEqual({ source: 1, failed: 2, replacement: 1 }) - expect( - await database.query( - `SELECT assignment_epoch, aborted_at FROM relay_assignment_migrations - WHERE user_id = ?`, - [input.identity.userId] - ) - ).toEqual([{ assignment_epoch: '2', aborted_at: null }]) - }) - - async function fenceFailedCell(input: RecoveryFixture): Promise { - await input.store.setCellEnabled(input.cells.failed.id, false) - input.advancePastHeartbeat() - await input.heartbeat(input.cells.source) - await input.heartbeat(input.cells.replacement) - await input.store.attestCellFence( - input.cells.failed.id, - input.cellIncarnation - ) - } - - async function supersedeAggregate(input: RecoveryFixture): Promise { - return await input.store.supersedeRegisteredCellEvacuations( - input.cells.source.id, - input.cells.failed.id, - input.cells.replacement.id, - 100 - ) - } - - async function clearActivities(input: RecoveryFixture): Promise { - await database.query( - `DELETE FROM relay_assignment_activity_leases - WHERE user_id = ? AND relay_host_id = ?`, - [input.identity.userId, input.identity.relayHostId] - ) - await database.query( - `UPDATE relay_assignments SET reserved_controls = 0, reserved_splices = 0, - reserved_invites = 0, pending_installs = 0, pending_confirmations = 0, - migration_leases = 0 - WHERE user_id = ? AND relay_host_id = ?`, - [input.identity.userId, input.identity.relayHostId] - ) - await database.query( - `UPDATE relay_cells SET reserved_requests = 0 - WHERE cell_id IN (?, ?, ?)`, - [input.cells.source.id, input.cells.failed.id, input.cells.replacement.id] - ) - } - - async function pinMigration( - input: RecoveryFixture, - assignmentEpoch: number - ): Promise { - const drainAttemptId = `${input.identity.userId}-drain-${assignmentEpoch}` - await database.query( - `INSERT INTO relay_post_drain_migration_pins - (user_id, relay_host_id, assignment_epoch, drain_attempt_id, - source_cell_id, source_cell_incarnation, target_cell_id, - target_cell_incarnation, source_request_units, target_reserved_units, - pinned_at) - SELECT migration.user_id, migration.relay_host_id, - migration.assignment_epoch, ?, migration.source_cell_id, - incarnation.source_cell_incarnation, migration.target_cell_id, - incarnation.target_cell_incarnation, migration.source_request_units, - migration.target_reserved_units, 100 - FROM relay_assignment_migrations migration - JOIN relay_assignment_migration_incarnations incarnation - ON incarnation.user_id = migration.user_id - AND incarnation.relay_host_id = migration.relay_host_id - AND incarnation.assignment_epoch = migration.assignment_epoch - WHERE migration.user_id = ? AND migration.relay_host_id = ? - AND migration.assignment_epoch = ?`, - [ - drainAttemptId, - input.identity.userId, - input.identity.relayHostId, - assignmentEpoch - ] - ) - return drainAttemptId - } - - async function assignmentActivities(input: RecoveryFixture): Promise { - return await database.query( - `SELECT activity_id, activity_kind, cell_id, request_units - FROM relay_assignment_activity_leases - WHERE user_id = ? AND relay_host_id = ? ORDER BY activity_id`, - [input.identity.userId, input.identity.relayHostId] - ) - } - async function reservations(cells: RecoveryFixture['cells']): Promise> { const rows = await database.query( `SELECT cell_id, reserved_requests FROM relay_cells diff --git a/cloud/apps/relay/src/assignment/regional-rehome/regional-rehome-store.test.ts b/cloud/apps/relay/src/assignment/regional-rehome/regional-rehome-store.test.ts index 9b14e2a4764..7a66cba3a91 100644 --- a/cloud/apps/relay/src/assignment/regional-rehome/regional-rehome-store.test.ts +++ b/cloud/apps/relay/src/assignment/regional-rehome/regional-rehome-store.test.ts @@ -1,22 +1,12 @@ import { describe, expect, it } from 'vitest' -import { readAssignmentInventorySnapshot } from '../assignment-inventory-snapshot.js' -import { REGIONAL_REHOME_ARRIVAL_WINDOW_MS } from './regional-rehome-abort-reason.js' import { RelayAssignmentStore as BaseRelayAssignmentStore, - type RegionalRehomeAttempt, - REGIONAL_REHOME_QUARANTINE_FAILURES, - REGIONAL_REHOME_QUARANTINE_MS + type RegionalRehomeAttempt } from '../assignment-store.js' import { openInMemoryRelayDatabase, - type RelayDatabase, - type RelayLockOptions + type RelayDatabase } from '../../database/database.js' -import { - REGIONAL_REHOME_SQL_FAILURES_LIMIT, - REGIONAL_REHOME_SQL_FAILURES_PER_CELL_LIMIT, - REGIONAL_REHOME_SQL_FAILURES_SUSTAIN_MS -} from './regional-rehome-safety.js' import type { RegionalRehomeSafetySnapshot } from '../../observability/relay-observability.js' const source = { @@ -35,129 +25,11 @@ const target = { connectionHardCap: 1_000 as const, connectionUnobservedBound: 60 } -// Bystander participates only in fleet safety. -const bystander = { ...source, id: 'us-c2', url: 'https://us-c2.relay.example.test' } const sourceIncarnation = '11111111-1111-4111-8111-111111111111' const targetIncarnation = '22222222-2222-4222-8222-222222222222' -const bystanderIncarnation = '33333333-3333-4333-8333-333333333333' describe('regional rehome assignment state', () => { - it('defaults optional correction off even with enabled durable control', async () => { - const context = await setup() - await activatePreferredSource(context, { userId: 'cohort', relayHostId: 'abcdefghijklmnop' }) - const defaultStore = new IdleRehomeTestStore(context.database, context.now, { - requireLiveCells: true - }) - expect(await defaultStore.tryIdleRehome()).toBeNull() - expect( - await context.database.query('SELECT attempt_id FROM relay_region_rehome_attempts') - ).toEqual([]) - expect(await context.store.tryIdleRehome()).not.toBeNull() - await context.database.close() - }) - - it('counts pre-existing generic migrations against the eight-migration cap', async () => { - const context = await setup() - await activatePreferredSource(context, { userId: 'cap', relayHostId: 'abcdefghijklmnop' }) - for (let i = 0; i < 8; i++) { - await context.database.query( - `INSERT INTO relay_assignment_migrations - (user_id, relay_host_id, source_cell_id, target_cell_id, previous_epoch, assignment_epoch, - source_request_units, target_reserved_units, expires_at, created_at, updated_at) - VALUES (?, ?, ?, ?, 1, 2, 1, 1, ?, ?, ?)`, - [ - 'generic', - `synthetic-migration-${i}`, - source.id, - target.id, - context.now() + 60_000, - context.now(), - context.now() - ] - ) - } - expect(await context.store.tryIdleRehome()).toBeNull() - await context.database.query( - `UPDATE relay_assignment_migrations SET completed_at = ? - WHERE user_id = 'generic' AND relay_host_id = 'synthetic-migration-0'`, - [context.now()] - ) - expect(await context.store.tryIdleRehome()).not.toBeNull() - const open = await context.database - .query(`SELECT COUNT(*) AS count FROM relay_assignment_migrations - WHERE completed_at IS NULL AND aborted_at IS NULL`) - expect(Number(open[0]?.count)).toBe(8) - await context.database.close() - }) - - it('does not let legacy hints certify a move', async () => { - const context = await setup() - await activatePreferredSource(context, { userId: 'legacy', relayHostId: 'abcdefghijklmnop' }) - await context.database.query('DELETE FROM relay_region_decisions') - expect(await context.store.tryIdleRehome()).toBeNull() - await context.database.close() - }) - - it('refreshes later open attempts when an older attempt occupies the first page', async () => { - const context = await setup() - await activatePreferredSource(context, { userId: 'page-1', relayHostId: 'abcdefghijklmnop' }) - const first = await context.store.tryIdleRehome() - context.advance(10_000) - await freshHeartbeats(context) - await activatePreferredSource(context, { userId: 'page-2', relayHostId: 'abcdefghijklmnop' }) - const second = await context.store.tryIdleRehome() - expect(second).not.toBeNull() - context.advance(1_000) - expect(await context.store.refreshRegionalRehomeLeases(1)).toBe(1) - context.advance(1_000) - expect(await context.store.refreshRegionalRehomeLeases(1)).toBe(1) - const rows = await context.database.query( - `SELECT attempt_id, updated_at FROM relay_region_rehome_attempts - WHERE attempt_id = ?`, - [second!.attemptId] - ) - expect(Number(rows[0]?.updated_at)).toBe(context.now()) - await context.database.close() - }) - - it('uses a generation-bound durable kill switch', async () => { - const context = await setup() - expect(await context.store.inspectRegionalRehomeControl()).toMatchObject({ - generation: 1, - enabled: true, - ratePerMinute: 10 - }) - expect(await context.store.disableRegionalRehomeControl()).toBe(true) - expect(await context.store.inspectRegionalRehomeControl()).toMatchObject({ - generation: 2, - enabled: false - }) - await expect( - context.store.applyRegionalRehomeControl({ - expectedGeneration: 1, - enabled: true, - notBefore: context.now(), - ratePerMinute: 10, - preferenceMaxAgeMs: 24 * 60 * 60_000, - hostCooldownMs: 7 * 24 * 60 * 60_000, - drainGraceMs: 60_000 - }) - ).rejects.toThrow('regional_rehome_generation_mismatch') - await expect( - context.store.applyRegionalRehomeControl({ - expectedGeneration: 2, - enabled: true, - notBefore: context.now(), - ratePerMinute: 10, - preferenceMaxAgeMs: 24 * 60 * 60_000, - hostCooldownMs: 7 * 24 * 60 * 60_000, - drainGraceMs: 60_000 - }) - ).resolves.toMatchObject({ generation: 3, enabled: true }) - await context.database.close() - }) - it('moves one live preferred host and completes without disabling its source cell', async () => { const context = await setup() const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } @@ -220,563 +92,6 @@ describe('regional rehome assignment state', () => { await context.database.close() }) - it('requires an advertised source capability', async () => { - const context = await setup({ sourceProtocol: 0 }) - await activatePreferredSource(context, { - userId: 'user-1', - relayHostId: 'abcdefghijklmnop' - }) - expect(await context.store.tryIdleRehome()).toBeNull() - expect(await context.database.query(`SELECT * FROM relay_assignment_migrations`)).toEqual([]) - await context.database.close() - }) - - it('claims through the measured healthy baseline of pool micro-waits and churn', async () => { - const context = await setup() - const baseline = { - observedAt: context.now(), - sqlFailures: 0, - reconnects: 42, - controlActivityRecoveryFailures: 0, - databasePoolWaiting: 2, - databasePoolWaitersMax: 2, - databasePoolWaitMsMax: 1 - } - await heartbeat(context.store, source, sourceIncarnation, 3, 2, baseline) - await heartbeat(context.store, target, targetIncarnation, 3, 2, baseline) - await activatePreferredSource(context, { - userId: 'user-1', - relayHostId: 'abcdefghijklmnop' - }) - - expect(await context.store.tryIdleRehome()).toMatchObject({ - sourceCellId: source.id, - targetCellId: target.id - }) - expect(await context.store.inspectRegionalRehomeControl()).toMatchObject({ - enabled: true - }) - await context.database.close() - }) - - it('latches off on a per-cell reconnect storm even when the fleet sum is low', async () => { - const context = await setup() - await activatePreferredSource(context, { - userId: 'user-1', - relayHostId: 'abcdefghijklmnop' - }) - const safety: RegionalRehomeSafetySnapshot = { - observedAt: context.now(), - sqlFailures: 0, - reconnects: 0, - controlActivityRecoveryFailures: 0, - databasePoolWaiting: 0, - databasePoolWaitersMax: 0, - databasePoolWaitMsMax: 0 - } - const [candidate] = await context.store.selectIdleRegionalRehomeCandidates(safety) - expect(candidate).toBeDefined() - await context.database.query( - `UPDATE relay_cell_rehome_safety SET reconnects = 251 WHERE cell_id = ?`, - [source.id] - ) - - const warnings = collectDisableWarnings() - try { - expect(await context.store.commitIdleRegionalRehome(candidate!, safety)).toEqual({ - outcome: 'deferred', - reason: 'fleet-safety' - }) - } finally { - warnings.restore() - } - expect(await context.store.inspectRegionalRehomeControl()).toMatchObject({ - generation: 2, - enabled: false - }) - expect(warnings.entries).toMatchObject([ - { reason: 'elevated_reconnects', maxReconnects: 251, controlGeneration: 2 } - ]) - await context.database.close() - }) - - it('defers on target pool pressure without disabling, and claims once it clears', async () => { - const context = await setup() - await activatePreferredSource(context, { - userId: 'user-1', - relayHostId: 'abcdefghijklmnop' - }) - const safety: RegionalRehomeSafetySnapshot = { - observedAt: context.now(), - sqlFailures: 0, - reconnects: 0, - controlActivityRecoveryFailures: 0, - databasePoolWaiting: 0, - databasePoolWaitersMax: 0, - databasePoolWaitMsMax: 0 - } - const [candidate] = await context.store.selectIdleRegionalRehomeCandidates(safety) - expect(candidate).toBeDefined() - await context.database.query( - `UPDATE relay_cell_rehome_safety SET database_pool_waiters_max = 17 WHERE cell_id = ?`, - [target.id] - ) - - const warnings = collectDisableWarnings() - try { - expect(await context.store.commitIdleRegionalRehome(candidate!, safety)).toEqual({ - outcome: 'deferred', - reason: 'candidate-ineligible' - }) - } finally { - warnings.restore() - } - // A scan-to-commit pool breach must skip without permanently disabling the worker. - expect(await context.store.inspectRegionalRehomeControl()).toMatchObject({ - generation: 1, - enabled: true - }) - expect(warnings.entries).toEqual([]) - - await context.database.query( - `UPDATE relay_cell_rehome_safety SET database_pool_waiters_max = 0 WHERE cell_id = ?`, - [target.id] - ) - expect(await context.store.tryIdleRehome()).toMatchObject({ - userId: 'user-1', - sourceCellId: source.id, - targetCellId: target.id - }) - await context.database.close() - }) - - it('keeps selecting candidates while an unrelated cell is over the pool bar', async () => { - // Fleet Math.max once let one narrow client pool empty every page. - const context = await setup() - await activatePreferredSource(context, { - userId: 'user-1', - relayHostId: 'abcdefghijklmnop' - }) - await context.store.reconcileCells([source, target, bystander]) - await heartbeat(context.store, bystander, bystanderIncarnation, 3, 2, { - observedAt: context.now(), - sqlFailures: 0, - reconnects: 0, - controlActivityRecoveryFailures: 0, - databasePoolWaiting: 150, - databasePoolWaitersMax: 150, - databasePoolWaitMsMax: 2_005 - }) - - const safety: RegionalRehomeSafetySnapshot = { - observedAt: context.now(), - sqlFailures: 0, - reconnects: 0, - controlActivityRecoveryFailures: 0, - databasePoolWaiting: 0, - databasePoolWaitersMax: 0, - databasePoolWaitMsMax: 0 - } - expect(await context.store.selectIdleRegionalRehomeCandidates(safety)).toMatchObject([ - { sourceCellId: source.id, targetCellId: target.id } - ]) - await context.database.close() - }) - - it('claims through ambient per-cell sql retry noise', async () => { - const context = await setup() - await activatePreferredSource(context, { - userId: 'user-1', - relayHostId: 'abcdefghijklmnop' - }) - await context.database.query( - `UPDATE relay_cell_rehome_safety SET sql_failures = ${REGIONAL_REHOME_SQL_FAILURES_PER_CELL_LIMIT}` - ) - - expect(await context.store.tryIdleRehome()).not.toBeNull() - await context.database.close() - }) - - it('moves a live host on an asia-east2 cell back to its preferred us-central1 cell', async () => { - const context = await setup() - const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - await activateReversePreferredSource(context, identity) - - const attempt = await context.store.tryIdleRehome() - expect(attempt).toMatchObject({ - userId: identity.userId, - relayHostId: identity.relayHostId, - preferredRegion: 'us-central1', - sourceCellId: target.id, - sourceCellIncarnation: targetIncarnation, - targetCellId: source.id, - targetCellIncarnation: sourceIncarnation, - previousEpoch: 1, - assignmentEpoch: 2, - sendAttempts: 1 - }) - expect( - await context.database.query( - `SELECT preferred_region, source_cell_id, target_cell_id - FROM relay_region_rehome_attempts` - ) - ).toEqual([ - { - preferred_region: 'us-central1', - source_cell_id: target.id, - target_cell_id: source.id - } - ]) - expect(await context.store.resolve(identity)).toMatchObject({ cellId: source.id }) - await context.database.close() - }) - - it('drops a candidate at scan time when no cell in the preferred region is usable', async () => { - const context = await setup() - await activatePreferredSource(context, { - userId: 'user-1', - relayHostId: 'abcdefghijklmnop' - }) - // Exclude certain skips during selection or they consume candidate-page slots. - await context.database.query(`UPDATE relay_cells SET enabled = 0 WHERE cell_id = ?`, [ - target.id - ]) - - const warnings = collectEventWarnings('orca_relay_regional_rehome_candidates_skipped') - try { - expect(await context.store.tryIdleRehome()).toBeNull() - } finally { - warnings.restore() - } - expect(warnings.entries).toEqual([]) - expect( - await context.database.query(`SELECT next_dispatch_at FROM relay_region_rehome_worker_state`) - ).toEqual([{ next_dispatch_at: 0 }]) - expect(await context.database.query(`SELECT * FROM relay_assignment_migrations`)).toEqual([]) - await context.database.close() - }) - - it('does not migrate when the last target is lost between selection and commit', async () => { - const database = await openInMemoryRelayDatabase() - const context = await setup({ - database, - wrap: (delegate) => - hookAfterCandidateScan(delegate, async (transaction) => { - await transaction.query(`UPDATE relay_cells SET enabled = 0 WHERE cell_id = ?`, [ - target.id - ]) - }) - }) - await activatePreferredSource(context, { - userId: 'user-1', - relayHostId: 'abcdefghijklmnop' - }) - - expect(await context.store.tryIdleRehome()).toBeNull() - - expect(await context.store.inspectRegionalRehomeControl()).toMatchObject({ - generation: 1, - enabled: true - }) - expect(await database.query(`SELECT * FROM relay_assignment_migrations`)).toEqual([]) - await database.close() - }) - - it('leaves a host alone until its cooldown expires, then moves it back', async () => { - const context = await setup({ hostCooldownMs: 3 * 24 * 60 * 60_000 }) - const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - const targetControl = await completeRehomeToTarget(context, identity) - // Pass dispatch interval so only cooldown prevents another claim. - context.advance(10_000) - await activateReversePreferredSource(context, identity) - - const warnings = collectEventWarnings('orca_relay_regional_rehome_candidates_skipped') - try { - expect(await context.store.tryIdleRehome()).toBeNull() - } finally { - warnings.restore() - } - expect(warnings.entries).toEqual([]) - expect(await context.store.resolve(identity)).toMatchObject({ cellId: target.id }) - - context.advance(3 * 24 * 60 * 60_000) - await freshHeartbeats(context) - await context.store.renewControlActivity(identity, { - activityId: targetControl, - cellId: target.id, - expiresAt: context.now() + 90_000 - }) - await activateReversePreferredSource(context, identity) - - const attempt = await context.store.tryIdleRehome() - expect(attempt).toMatchObject({ - preferredRegion: 'us-central1', - sourceCellId: target.id, - targetCellId: source.id - }) - await context.database.close() - }) - - it('rejects a host whose attempt lands between the scan and the claim', async () => { - const database = await openInMemoryRelayDatabase() - const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - const context = await setup({ - database, - wrap: (delegate) => - hookAfterCandidateScan(delegate, async (transaction) => { - await transaction.query( - `INSERT INTO relay_region_rehome_attempts - (attempt_id, user_id, relay_host_id, preferred_region, source_cell_id, - source_cell_incarnation, target_cell_id, target_cell_incarnation, - previous_epoch, assignment_epoch, drain_grace_ms, send_attempts, - created_at, updated_at) - VALUES ('raced', ?, ?, 'asia-east2', ?, ?, ?, ?, 0, 1, 0, 0, ?, ?)`, - [ - identity.userId, - identity.relayHostId, - source.id, - sourceIncarnation, - target.id, - targetIncarnation, - context.now(), - context.now() - ] - ) - }) - }) - await activatePreferredSource(context, identity) - - expect(await context.store.tryIdleRehome()).toBeNull() - - expect(await database.query(`SELECT * FROM relay_assignment_migrations`)).toEqual([]) - await database.close() - }) - - it('does not scan a candidate whose preferred region has no drainable cell', async () => { - // Without drain protocol the target could never rehome hosts back out; exclude before inventory scans. - const context = await setup({ targetProtocol: 0 }) - await activatePreferredSource(context, { - userId: 'user-1', - relayHostId: 'abcdefghijklmnop' - }) - - const warnings = collectEventWarnings('orca_relay_regional_rehome_candidates_skipped') - try { - expect(await context.store.tryIdleRehome()).toBeNull() - } finally { - warnings.restore() - } - expect(warnings.entries).toEqual([]) - expect( - await context.database.query(`SELECT next_dispatch_at FROM relay_region_rehome_worker_state`) - ).toEqual([{ next_dispatch_at: 0 }]) - expect(await context.database.query(`SELECT * FROM relay_assignment_migrations`)).toEqual([]) - await context.database.close() - }) - - it('skips an unclean cell without latching the control off', async () => { - const context = await setup() - await activatePreferredSource(context, { - userId: 'user-1', - relayHostId: 'abcdefghijklmnop' - }) - await activatePreferredSource(context, { - userId: 'user-2', - relayHostId: 'ponmlkjihgfedcba' - }) - // Per-cell bar can skip a candidate while fleet safety keeps the worker enabled. - await context.database.query( - `UPDATE relay_cell_rehome_safety SET sql_failures = ${REGIONAL_REHOME_SQL_FAILURES_PER_CELL_LIMIT + 1} WHERE cell_id = ?`, - [target.id] - ) - - expect(await context.store.tryIdleRehome()).toBeNull() - expect(await context.store.inspectRegionalRehomeControl()).toMatchObject({ - generation: 1, - enabled: true - }) - - expect( - await context.database.query(`SELECT next_dispatch_at FROM relay_region_rehome_worker_state`) - ).toEqual([{ next_dispatch_at: 0 }]) - expect(await context.database.query(`SELECT * FROM relay_assignment_migrations`)).toEqual([]) - await context.database.close() - }) - - it('pauses the claim without latching when a sql spike lands between selection and commit', async () => { - const context = await setup() - await activatePreferredSource(context, { - userId: 'user-1', - relayHostId: 'abcdefghijklmnop' - }) - const safety: RegionalRehomeSafetySnapshot = { - observedAt: context.now(), - sqlFailures: 0, - reconnects: 0, - controlActivityRecoveryFailures: 0, - databasePoolWaiting: 0, - databasePoolWaitersMax: 0, - databasePoolWaitMsMax: 0 - } - const [candidate] = await context.store.selectIdleRegionalRehomeCandidates(safety) - expect(candidate).toBeDefined() - await context.database.query( - `UPDATE relay_cell_rehome_safety SET sql_failures = ${REGIONAL_REHOME_SQL_FAILURES_LIMIT + 1} WHERE cell_id = ?`, - [target.id] - ) - - expect(await context.store.commitIdleRegionalRehome(candidate!, safety)).toEqual({ - outcome: 'deferred', - reason: 'fleet-safety' - }) - expect(await context.store.inspectRegionalRehomeControl()).toMatchObject({ - generation: 1, - enabled: true - }) - expect( - await context.database.query( - `SELECT consecutive_failures FROM relay_region_rehome_worker_state` - ) - ).toEqual([{ consecutive_failures: 0 }]) - expect(await context.database.query(`SELECT * FROM relay_assignment_migrations`)).toEqual([]) - await context.database.close() - }) - - it('rides out a single-stall sql spike without latching the control off', async () => { - const context = await setup() - // 10-06 06:16Z: one stall put the fleet sum at 396 for about a minute. - for (let elapsed = 0; elapsed <= 90_000; elapsed += 6_000) { - await sqlFailuresHeartbeats(context, 396) - expect(await context.store.selectIdleRegionalRehomeCandidates(cleanSafety(context))).toEqual( - [] - ) - context.advance(6_000) - } - await sqlFailuresHeartbeats(context, 0) - await activatePreferredSource(context, { userId: 'user-1', relayHostId: 'abcdefghijklmnop' }) - expect( - await context.store.selectIdleRegionalRehomeCandidates(cleanSafety(context)) - ).toHaveLength(1) - // The next stall, ~610 s later, starts its own breach rather than extending the last one. - context.advance(500_000) - for (let elapsed = 0; elapsed <= 90_000; elapsed += 6_000) { - await sqlFailuresHeartbeats(context, 396) - await context.store.selectIdleRegionalRehomeCandidates(cleanSafety(context)) - context.advance(6_000) - } - expect(await context.store.inspectRegionalRehomeControl()).toMatchObject({ - generation: 1, - enabled: true - }) - await context.database.close() - }) - - it('latches the control off when the sql breach outlasts a stall', async () => { - const context = await setup() - await activatePreferredSource(context, { userId: 'user-1', relayHostId: 'abcdefghijklmnop' }) - const warnings = collectEventWarnings('orca_relay_regional_rehome_safety_disabled') - try { - for (let elapsed = 0; elapsed < REGIONAL_REHOME_SQL_FAILURES_SUSTAIN_MS; elapsed += 6_000) { - await sqlFailuresHeartbeats(context, REGIONAL_REHOME_SQL_FAILURES_LIMIT + 1) - await context.store.selectIdleRegionalRehomeCandidates(cleanSafety(context)) - context.advance(6_000) - } - expect(await context.store.inspectRegionalRehomeControl()).toMatchObject({ enabled: true }) - await sqlFailuresHeartbeats(context, REGIONAL_REHOME_SQL_FAILURES_LIMIT + 1) - expect(await context.store.selectIdleRegionalRehomeCandidates(cleanSafety(context))).toEqual( - [] - ) - } finally { - warnings.restore() - } - expect(await context.store.inspectRegionalRehomeControl()).toMatchObject({ - generation: 2, - enabled: false - }) - expect(warnings.entries).toMatchObject([ - { reason: 'sql_failures', controlGeneration: 2, sustainedMs: 150_000 } - ]) - await context.database.close() - }) - - it('still latches on a non-sql reason that fails alongside a sql spike', async () => { - const context = await setup() - await activatePreferredSource(context, { userId: 'user-1', relayHostId: 'abcdefghijklmnop' }) - const [candidate] = await context.store.selectIdleRegionalRehomeCandidates(cleanSafety(context)) - expect(candidate).toBeDefined() - await context.database.query( - `UPDATE relay_cell_rehome_safety - SET sql_failures = ${REGIONAL_REHOME_SQL_FAILURES_LIMIT + 1}, control_activity_recovery_failures = 1 - WHERE cell_id = ?`, - [target.id] - ) - expect(await context.store.commitIdleRegionalRehome(candidate!, cleanSafety(context))).toEqual({ - outcome: 'deferred', - reason: 'fleet-safety' - }) - expect(await context.store.inspectRegionalRehomeControl()).toMatchObject({ - generation: 2, - enabled: false - }) - await context.database.close() - }) - - it('refreshes only the migration leases while source splices drain', async () => { - const context = await setup() - const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - await activatePreferredSource(context, identity) - await context.store.acquireActivity(identity, { - activityId: 'splice:source', - kind: 'splice', - cellId: source.id - }) - await context.store.tryIdleRehome() - const before = await context.database.query( - `SELECT activity_id, expires_at FROM relay_assignment_activity_leases - WHERE user_id = ? AND relay_host_id = ? ORDER BY activity_id`, - [identity.userId, identity.relayHostId] - ) - context.advance(60_000) - expect(await context.store.refreshRegionalRehomeLeases()).toBe(1) - const after = await context.database.query( - `SELECT activity_id, expires_at FROM relay_assignment_activity_leases - WHERE user_id = ? AND relay_host_id = ? ORDER BY activity_id`, - [identity.userId, identity.relayHostId] - ) - const beforeById = new Map(before.map((row) => [row.activity_id, row.expires_at])) - const afterById = new Map(after.map((row) => [row.activity_id, row.expires_at])) - expect(Number(afterById.get('migration:2'))).toBeGreaterThan( - Number(beforeById.get('migration:2')) - ) - expect(Number(afterById.get('control-pending:2'))).toBeGreaterThan( - Number(beforeById.get('control-pending:2')) - ) - expect(afterById.get('splice:source')).toBe(beforeById.get('splice:source')) - await context.database.close() - }) - - it('stops refreshing an unregistered target and lets normal rollback retire it', async () => { - const context = await setup() - const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - await activatePreferredSource(context, identity) - await context.store.tryIdleRehome() - context.advance(6 * 60_000) - expect(await context.store.refreshRegionalRehomeLeases()).toBe(0) - await heartbeat(context.store, source, sourceIncarnation, 3, 2) - expect(await context.store.abortExpiredEvacuations()).toBe(1) - expect(await context.store.reapRegionalRehomeAttempts()).toBe(0) - expect(await context.store.resolve(identity)).toMatchObject({ - cellId: source.id, - assignmentEpoch: 3 - }) - expect( - await context.database.query( - `SELECT completed_at, aborted_at FROM relay_region_rehome_attempts` - ) - ).toEqual([{ completed_at: null, aborted_at: context.now() }]) - await context.database.close() - }) - it('does not roll an unregistered target back to a stale regional source', async () => { const context = await setup() const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } @@ -797,286 +112,6 @@ describe('regional rehome assignment state', () => { await context.database.close() }) - // Two contended candidates expose an erroneous break; the redrain lane reaches inventory through its separate fleet-safety read. - it('completes a candidate behind two contended ones', async () => { - const probe = new CellInventoryLockProbe() - const context = await setup({ wrap: (database) => probe.wrap(database) }) - const identities = [ - { userId: 'user-1', relayHostId: 'abcdefghijklmnop' }, - { userId: 'user-2', relayHostId: 'ponmlkjihgfedcba' }, - { userId: 'user-3', relayHostId: 'aaaabbbbccccdddd' } - ] - for (const identity of identities) { - // Dispatch is rate limited, so each claim needs its own interval. - context.advance(60_000) - await freshHeartbeats(context) - const sourceControl = await activatePreferredSource(context, identity) - const attempt = await context.store.tryIdleRehome() - await context.store.activateControl(identity, { - cellId: target.id, - assignmentEpoch: 2, - generation: 1 - }) - await context.store.markMigrationTargetRegistered(identity, { - cellId: target.id, - assignmentEpoch: 2 - }) - await context.store.releaseActivity(identity, sourceControl) - } - probe.reset() - probe.failNoWaitTimes = 2 - const busy = collectEventWarnings('orca_relay_sweep_cell_inventory_busy') - - let completed: number - try { - completed = await context.store.completeReadyRegionalRehomes() - } finally { - busy.restore() - } - - expect(completed).toBe(1) - expect(busy.entries).toEqual([ - { - event: 'orca_relay_sweep_cell_inventory_busy', - sweep: 'complete-ready-regional-rehomes', - skipped: 2 - } - ]) - await context.database.close() - }) - - // Only inventory contention is ordinary; other failures must propagate and count against dispatch. - - // One inventory failure abandons the transaction’s whole candidate page, so count all candidates skipped. - - it('skips a completion tick on a contended cell inventory without quarantining it', async () => { - const probe = new CellInventoryLockProbe() - const context = await setup({ wrap: (database) => probe.wrap(database) }) - const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - const sourceControl = await activatePreferredSource(context, identity) - const attempt = await context.store.tryIdleRehome() - await context.store.activateControl(identity, { - cellId: target.id, - assignmentEpoch: 2, - generation: 1 - }) - await context.store.markMigrationTargetRegistered(identity, { - cellId: target.id, - assignmentEpoch: 2 - }) - await context.store.releaseActivity(identity, sourceControl) - probe.reset() - probe.failNoWait = true - const busy = collectEventWarnings('orca_relay_sweep_cell_inventory_busy') - const failures = collectCandidateFailureWarnings() - - let completed: number - try { - completed = await context.store.completeReadyRegionalRehomes() - } finally { - failures.restore() - busy.restore() - } - - expect(completed).toBe(0) - expect(probe.locks).not.toEqual([]) - expect(probe.locks.every((options) => options?.failIfUnavailable === true)).toBe(true) - expect(failures.entries).toEqual([]) - expect(busy.entries).toEqual([ - { - event: 'orca_relay_sweep_cell_inventory_busy', - sweep: 'complete-ready-regional-rehomes', - skipped: 1 - } - ]) - - probe.failNoWait = false - expect(await context.store.completeReadyRegionalRehomes()).toBe(1) - await context.database.close() - }) - - // Inventory contention is temporary; quarantining it would hide healthy attempts from LIMIT pages for 15min. - it('skips an abort tick on a contended cell inventory without quarantining it', async () => { - const probe = new CellInventoryLockProbe() - const context = await setup({ wrap: (database) => probe.wrap(database) }) - const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - const sourceControl = await activatePreferredSource(context, identity) - const attempt = await context.store.tryIdleRehome() - const targetControl = await context.store.activateControl(identity, { - cellId: target.id, - assignmentEpoch: 2, - generation: 1 - }) - await context.store.markMigrationTargetRegistered(identity, { - cellId: target.id, - assignmentEpoch: 2 - }) - await context.store.releaseActivity(identity, sourceControl) - await context.store.releaseActivity(identity, targetControl) - context.advance(24 * 60 * 60_000) - await heartbeat(context.store, source, sourceIncarnation, 3, 2) - probe.reset() - probe.failNoWait = true - const busy = collectEventWarnings('orca_relay_sweep_cell_inventory_busy') - const failures = collectCandidateFailureWarnings() - - let aborted: number - try { - aborted = await context.store.abortExpiredRegionalRehomes() - } finally { - failures.restore() - busy.restore() - } - - expect(aborted).toBe(0) - expect(probe.locks).not.toEqual([]) - expect(probe.locks.every((options) => options?.failIfUnavailable === true)).toBe(true) - expect(failures.entries).toEqual([]) - expect(busy.entries).toEqual([ - { - event: 'orca_relay_sweep_cell_inventory_busy', - sweep: 'abort-expired-regional-rehomes', - skipped: 1 - } - ]) - - probe.failNoWait = false - expect(await context.store.abortExpiredRegionalRehomes()).toBe(1) - await context.database.close() - }) - - it('rolls a host that never reached its target back to the source at the arrival window', async () => { - const context = await setup() - const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - const sourceControl = await activatePreferredSource(context, identity) - expect(await context.store.tryIdleRehome()).not.toBeNull() - await context.store.releaseActivity(identity, sourceControl) - await context.store.markMigrationTargetRegistered(identity, { - cellId: target.id, - assignmentEpoch: 2 - }) - - context.advance(REGIONAL_REHOME_ARRIVAL_WINDOW_MS - 1) - await freshHeartbeats(context) - expect(await context.store.abortUnarrivedRegionalRehomes()).toBe(0) - - context.advance(1) - await freshHeartbeats(context) - expect(await context.store.abortUnarrivedRegionalRehomes()).toBe(1) - expect(await context.store.resolve(identity)).toMatchObject({ - cellId: source.id, - assignmentEpoch: 3 - }) - expect(await context.store.abortUnarrivedRegionalRehomes()).toBe(0) - await context.database.close() - }) - - it('leaves the durable switch alone when it rolls back an unarrived host', async () => { - const context = await setup() - const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - const sourceControl = await activatePreferredSource(context, identity) - expect(await context.store.tryIdleRehome()).not.toBeNull() - await context.store.releaseActivity(identity, sourceControl) - await context.store.markMigrationTargetRegistered(identity, { - cellId: target.id, - assignmentEpoch: 2 - }) - const before = await context.store.inspectRegionalRehomeControl() - context.advance(REGIONAL_REHOME_ARRIVAL_WINDOW_MS) - await freshHeartbeats(context) - - expect(await context.store.abortUnarrivedRegionalRehomes()).toBe(1) - - expect(await context.store.inspectRegionalRehomeControl()).toMatchObject({ - generation: before.generation, - enabled: true - }) - const [attempt] = await context.database.query( - 'SELECT abort_reason FROM relay_region_rehome_attempts' - ) - expect(attempt!.abort_reason).toBe('host_not_arrived') - const preview = await context.store.previewRegionalRehomeEligibility() - expect(preview.abortedLast24Hours).toEqual({ host_not_arrived: 1 }) - expect( - (await readAssignmentInventorySnapshot(context.database, context.now())).regionalRehomes - ).toMatchObject({ abortedLast24Hours: 1, hostNotArrivedLast24Hours: 1 }) - await context.database.close() - }) - - it('leaves a host that did reach its target for the completion sweep', async () => { - const context = await setup() - const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - const sourceControl = await activatePreferredSource(context, identity) - expect(await context.store.tryIdleRehome()).not.toBeNull() - // Age alone cannot abort an attempt whose target already owns the host. - context.advance(REGIONAL_REHOME_ARRIVAL_WINDOW_MS) - await freshHeartbeats(context) - await context.store.activateControl(identity, { - cellId: target.id, - assignmentEpoch: 2, - generation: 1, - cellIncarnation: targetIncarnation - }) - await context.store.markMigrationTargetRegistered(identity, { - cellId: target.id, - assignmentEpoch: 2 - }) - await context.store.releaseActivity(identity, sourceControl) - - expect(await context.store.abortUnarrivedRegionalRehomes()).toBe(0) - expect(await context.store.completeReadyRegionalRehomes()).toBe(1) - expect(await context.store.resolve(identity)).toMatchObject({ cellId: target.id }) - await context.database.close() - }) - - it('names the 24-hour latch in its own abort reason', async () => { - const context = await setup() - const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - const sourceControl = await activatePreferredSource(context, identity) - expect(await context.store.tryIdleRehome()).not.toBeNull() - await context.store.releaseActivity(identity, sourceControl) - context.advance(24 * 60 * 60_000) - await heartbeat(context.store, source, sourceIncarnation, 3, 2) - - expect(await context.store.abortExpiredRegionalRehomes()).toBe(1) - - const [attempt] = await context.database.query( - 'SELECT abort_reason FROM relay_region_rehome_attempts' - ) - expect(attempt!.abort_reason).toBe('max_refresh_expired') - expect(await context.store.inspectRegionalRehomeControl()).toMatchObject({ enabled: false }) - await context.database.close() - }) - - it('rolls back an inactive registered target only after the 24-hour bound', async () => { - const context = await setup() - const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - const sourceControl = await activatePreferredSource(context, identity) - const attempt = await context.store.tryIdleRehome() - const targetControl = await context.store.activateControl(identity, { - cellId: target.id, - assignmentEpoch: 2, - generation: 1 - }) - await context.store.markMigrationTargetRegistered(identity, { - cellId: target.id, - assignmentEpoch: 2 - }) - await context.store.releaseActivity(identity, sourceControl) - await context.store.releaseActivity(identity, targetControl) - context.advance(24 * 60 * 60_000 - 1) - await freshHeartbeats(context) - expect(await context.store.abortExpiredRegionalRehomes()).toBe(0) - context.advance(1) - await heartbeat(context.store, source, sourceIncarnation, 3, context.now()) - expect(await context.store.abortExpiredRegionalRehomes()).toBe(1) - expect(await context.store.resolve(identity)).toMatchObject({ - cellId: source.id, - assignmentEpoch: 3 - }) - await context.database.close() - }) - it('completes healthy candidates past a poisoned attempt and logs it', async () => { const context = await setup() const poisoned = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } @@ -1132,115 +167,6 @@ describe('regional rehome assignment state', () => { await context.database.close() }) - it('quarantines a repeatedly failing candidate and redacts free-form errors', async () => { - const context = await setup() - const poisoned = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - const source1 = await activatePreferredSource(context, poisoned) - const attempt = await context.store.tryIdleRehome() - await context.store.activateControl(poisoned, { - cellId: target.id, - assignmentEpoch: attempt!.assignmentEpoch, - generation: 1 - }) - await context.store.markMigrationTargetRegistered(poisoned, { - cellId: target.id, - assignmentEpoch: attempt!.assignmentEpoch - }) - await context.store.releaseActivity(poisoned, source1) - await context.database.query( - `UPDATE relay_assignments SET assignment_epoch = assignment_epoch + 5 - WHERE user_id = ?`, - [poisoned.userId] - ) - const warnings = collectCandidateFailureWarnings() - try { - for (let round = 0; round < REGIONAL_REHOME_QUARANTINE_FAILURES; round++) { - expect(await context.store.completeReadyRegionalRehomes()).toBe(0) - } - expect(warnings.entries).toHaveLength(REGIONAL_REHOME_QUARANTINE_FAILURES) - expect(await context.store.completeReadyRegionalRehomes()).toBe(0) - expect(warnings.entries).toHaveLength(REGIONAL_REHOME_QUARANTINE_FAILURES) - context.advance(REGIONAL_REHOME_QUARANTINE_MS + 1) - await context.store.completeReadyRegionalRehomes() - expect(warnings.entries).toHaveLength(REGIONAL_REHOME_QUARANTINE_FAILURES + 1) - expect( - warnings.entries.every((entry) => entry.reason === 'regional_rehome_assignment_mismatch') - ).toBe(true) - context.advance(REGIONAL_REHOME_QUARANTINE_MS + 1) - const database = context.database - const original = database.transaction.bind(database) - database.transaction = () => { - throw new Error('postgresql://secret@database.invalid/relay') - } - try { - await context.store.completeReadyRegionalRehomes() - } finally { - database.transaction = original - } - const last = warnings.entries.at(-1)! - expect(last.reason).toBe('redacted') - expect(JSON.stringify(last)).not.toContain('secret') - } finally { - warnings.restore() - } - await context.database.close() - }) - - it('aborts healthy expired candidates past a poisoned attempt', async () => { - const context = await setup() - const poisoned = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - const healthy = { userId: 'user-2', relayHostId: 'ponmlkjihgfedcba' } - const poisonedSource = await activatePreferredSource(context, poisoned) - const healthySource = await activatePreferredSource(context, healthy) - const first = await context.store.tryIdleRehome() - context.advance(6_000) - const second = await context.store.tryIdleRehome() - for (const [identity, attempt, sourceControl] of [ - [poisoned, first, poisonedSource], - [healthy, second, healthySource] - ] as const) { - const targetControl = await context.store.activateControl(identity, { - cellId: target.id, - assignmentEpoch: attempt!.assignmentEpoch, - generation: 1 - }) - await context.store.markMigrationTargetRegistered(identity, { - cellId: target.id, - assignmentEpoch: attempt!.assignmentEpoch - }) - await context.store.releaseActivity(identity, sourceControl) - await context.store.releaseActivity(identity, targetControl) - } - await context.database.query( - `UPDATE relay_assignments SET assignment_epoch = assignment_epoch + 5 - WHERE user_id = ?`, - [poisoned.userId] - ) - context.advance(24 * 60 * 60_000) - await freshHeartbeats(context) - const warnings = collectCandidateFailureWarnings() - try { - expect(await context.store.abortExpiredRegionalRehomes()).toBe(1) - } finally { - warnings.restore() - } - expect(warnings.entries).toEqual([ - { - event: 'orca_relay_regional_rehome_candidate_failed', - operation: 'abort', - attemptId: first!.attemptId, - reason: 'regional_rehome_assignment_mismatch' - } - ]) - expect( - await context.database.query( - `SELECT aborted_at FROM relay_region_rehome_attempts WHERE attempt_id = ?`, - [second!.attemptId] - ) - ).toEqual([{ aborted_at: context.now() }]) - await context.database.close() - }) - it('keeps dual-control accounting when the drained host re-resolves mid-rehome', async () => { const context = await setup() const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } @@ -1286,146 +212,10 @@ describe('regional rehome assignment state', () => { await context.database.close() }) - it('grants a host whose counter was skewed without duplicating its control', async () => { - const context = await setup() - const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - const sourceControl = await activatePreferredSource(context, identity) - const attempt = await context.store.tryIdleRehome() - await context.store.activateControl(identity, { - cellId: target.id, - assignmentEpoch: attempt!.assignmentEpoch, - generation: 1 - }) - await context.store.releaseActivity(identity, sourceControl) - // Damage already written by a pre-fix sticky grant. - await context.database.query( - `UPDATE relay_assignments SET reserved_controls = 0 - WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - - await context.store.assign(identity, 'asia-east2') - expect( - await context.database.query( - `SELECT activity_id FROM relay_assignment_activity_leases - WHERE user_id = ? AND relay_host_id = ? AND activity_kind = 'control'`, - [identity.userId, identity.relayHostId] - ) - ).toEqual([{ activity_id: `control:${target.id}:1` }]) - expect(await cellReservations(context)).toEqual({ [source.id]: 0, [target.id]: 2 }) - await context.database.close() - }) - - it('repairs a skewed control counter before completing the rehome', async () => { - const context = await setup() - const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - const sourceControl = await activatePreferredSource(context, identity) - const attempt = await context.store.tryIdleRehome() - await context.store.activateControl(identity, { - cellId: target.id, - assignmentEpoch: attempt!.assignmentEpoch, - generation: 1 - }) - await context.store.markMigrationTargetRegistered(identity, { - cellId: target.id, - assignmentEpoch: attempt!.assignmentEpoch - }) - await context.store.releaseActivity(identity, sourceControl) - // Damage already written by a pre-fix sticky grant. - await context.database.query( - `UPDATE relay_assignments SET reserved_controls = 0 - WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - - expect(await context.store.completeReadyRegionalRehomes()).toBe(1) - expect(await controlAccounting(context, identity)).toEqual({ - reservedControls: 1, - controlLeases: 1 - }) - expect( - await context.database.query( - `SELECT migration_leases FROM relay_assignments - WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - ).toEqual([{ migration_leases: 0 }]) - await context.database.close() - }) - - it('never repairs past a migration lease whose shape is wrong', async () => { - const context = await setup() - const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' } - const sourceControl = await activatePreferredSource(context, identity) - const attempt = await context.store.tryIdleRehome() - await context.store.activateControl(identity, { - cellId: target.id, - assignmentEpoch: attempt!.assignmentEpoch, - generation: 1 - }) - await context.store.markMigrationTargetRegistered(identity, { - cellId: target.id, - assignmentEpoch: attempt!.assignmentEpoch - }) - await context.store.releaseActivity(identity, sourceControl) - await context.database.query( - `UPDATE relay_assignments SET reserved_controls = 0 - WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - await context.database.query( - `UPDATE relay_assignment_migrations SET target_reserved_units = 9 - WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - - const warnings = collectCandidateFailureWarnings() - try { - expect(await context.store.completeReadyRegionalRehomes()).toBe(0) - } finally { - warnings.restore() - } - expect(warnings.entries).toEqual([ - { - event: 'orca_relay_regional_rehome_candidate_failed', - operation: 'complete', - attemptId: attempt!.attemptId, - reason: 'migration_activity_lease_shape_mismatch' - } - ]) - expect(await controlAccounting(context, identity)).toEqual({ - reservedControls: 0, - controlLeases: 1 - }) - await context.database.close() - }) }) type Context = Awaited> -function collectDisableWarnings() { - const entries: Record[] = [] - const original = console.warn - console.warn = (line: unknown, ...rest: unknown[]) => { - try { - const parsed = JSON.parse(line as string) as Record - if (parsed.event === 'orca_relay_regional_rehome_safety_disabled') { - entries.push(parsed) - return - } - } catch { - // fall through to the real console for non-JSON lines - } - original(line, ...rest) - } - return { - entries, - restore: () => { - console.warn = original - } - } -} - async function setup( options: { sourceProtocol?: number @@ -1466,29 +256,6 @@ async function setup( } } -function collectEventWarnings(event: string) { - const entries: Record[] = [] - const original = console.warn - console.warn = (line: unknown, ...rest: unknown[]) => { - try { - const parsed = JSON.parse(line as string) as Record - if (parsed.event === event) { - entries.push(parsed) - return - } - } catch { - // fall through to the real console for non-JSON lines - } - original(line, ...rest) - } - return { - entries, - restore: () => { - console.warn = original - } - } -} - function collectCandidateFailureWarnings( events: string[] = ['orca_relay_regional_rehome_candidate_failed'] ) { @@ -1543,47 +310,6 @@ async function cellReservations(context: Context): Promise [String(row.cell_id), Number(row.reserved_requests)])) } -async function freshHeartbeats(context: Context): Promise { - const safety = { - observedAt: context.now(), - sqlFailures: 0, - reconnects: 0, - controlActivityRecoveryFailures: 0, - databasePoolWaiting: 0, - databasePoolWaitersMax: 0, - databasePoolWaitMsMax: 0 - } - // The clock doubles as a strictly-increasing connection inclusion watermark. - await heartbeat(context.store, source, sourceIncarnation, 3, context.now(), safety) - await heartbeat(context.store, target, targetIncarnation, 3, context.now(), safety) -} - -function cleanSafety(context: Context): RegionalRehomeSafetySnapshot { - return { - observedAt: context.now(), - sqlFailures: 0, - reconnects: 0, - controlActivityRecoveryFailures: 0, - databasePoolWaiting: 0, - databasePoolWaitersMax: 0, - databasePoolWaitMsMax: 0 - } -} - -// Splits the fleet sum across both cells, each under the per-cell bar's scale. -async function sqlFailuresHeartbeats(context: Context, fleetSqlFailures: number): Promise { - const half = Math.floor(fleetSqlFailures / 2) - const safety = cleanSafety(context) - await heartbeat(context.store, source, sourceIncarnation, 3, context.now(), { - ...safety, - sqlFailures: half - }) - await heartbeat(context.store, target, targetIncarnation, 3, context.now(), { - ...safety, - sqlFailures: fleetSqlFailures - half - }) -} - async function activatePreferredSource( context: Context, identity: { userId: string; relayHostId: string } @@ -1618,88 +344,6 @@ async function activatePreferredSource( return control } -// Hook after scan inside the claim transaction makes scan/claim races deterministic. -function hookAfterCandidateScan( - database: RelayDatabase, - hook: (transaction: RelayDatabase) => Promise -): RelayDatabase { - let fired = false - const decorate = (delegate: RelayDatabase): RelayDatabase => ({ - dialect: delegate.dialect, - query: async (sql, params) => { - const rows = await delegate.query(sql, params) - if (!fired && sql.includes('SELECT d.user_id, d.relay_host_id')) { - fired = true - await hook(delegate) - } - return rows - }, - queryLocked: async (sql, params, lockOptions) => - await delegate.queryLocked(sql, params, lockOptions), - transaction: async (operation, transactionOptions) => - await delegate.transaction( - async (transaction) => await operation(decorate(transaction)), - transactionOptions - ), - close: async () => undefined - }) - return decorate(database) -} - -async function completeRehomeToTarget( - context: Context, - identity: { userId: string; relayHostId: string } -): Promise { - const sourceControl = await activatePreferredSource(context, identity) - const attempt = await context.store.tryIdleRehome() - const targetControl = await context.store.activateControl(identity, { - cellId: target.id, - assignmentEpoch: attempt!.assignmentEpoch, - generation: 1 - }) - await context.store.markMigrationTargetRegistered(identity, { - cellId: target.id, - assignmentEpoch: attempt!.assignmentEpoch - }) - await context.store.releaseActivity(identity, sourceControl) - await context.store.completeReadyRegionalRehomes() - return targetControl -} - -async function activateReversePreferredSource( - context: Context, - identity: { userId: string; relayHostId: string } -): Promise { - const assignment = await context.store.assign(identity, undefined, 'asia-east2') - const control = await context.store.activateControl(identity, { - cellId: target.id, - assignmentEpoch: assignment.assignmentEpoch, - generation: 1, - idleRegionalRehome: true, - cellIncarnation: targetIncarnation - }) - await context.store.assign(identity, 'us-central1') - const issued = await context.store.exchangeRegionCorrection( - identity, - { v: 1, action: 'issue-window' }, - assignment.assignmentEpoch - ) - await context.store.exchangeRegionCorrection( - identity, - { - v: 1, - action: 'report', - generation: issued.window!.generation, - assignmentEpoch: assignment.assignmentEpoch, - policyVersion: 1, - outcome: 'conclusive', - measurements: { 'us-central1': 50, 'asia-east2': 150 } - }, - assignment.assignmentEpoch - ) - return control -} - async function activateSource( context: Context, identity: { userId: string; relayHostId: string } @@ -1752,51 +396,6 @@ async function heartbeat( }) } -class CellInventoryLockProbe { - readonly locks: (RelayLockOptions | undefined)[] = [] - failNoWait = false - // Contends the first N candidates only, so the sweep must carry on past them. - failNoWaitTimes = 0 - failWith: Error | null = null - - reset(): void { - this.locks.length = 0 - } - - wrap(database: RelayDatabase): RelayDatabase { - const probe = this - const decorate = (delegate: RelayDatabase): RelayDatabase => ({ - dialect: delegate.dialect, - query: async (sql, params) => await delegate.query(sql, params), - queryLocked: async (sql, params, options) => { - // The idle commit's only cell lock is its target row, so it counts too. - if ( - sql.trim() === 'SELECT * FROM relay_cells ORDER BY cell_id ASC' || - sql.includes('FROM relay_cells cell') - ) { - probe.locks.push(options) - if (probe.failWith) throw probe.failWith - if (options?.failIfUnavailable && probe.failNoWaitTimes > 0) { - probe.failNoWaitTimes-- - throw new Error('database_lock_unavailable') - } - if (probe.failNoWait && options?.failIfUnavailable) { - throw new Error('database_lock_unavailable') - } - } - return await delegate.queryLocked(sql, params, options) - }, - transaction: async (operation, options) => - await delegate.transaction( - async (transaction) => await operation(decorate(transaction)), - options - ), - close: async () => undefined - }) - return decorate(database) - } -} - class IdleRehomeTestStore extends BaseRelayAssignmentStore { private readonly fixtureDatabase: RelayDatabase private readonly fixtureNow: () => number diff --git a/cloud/apps/relay/src/assignment/reserve-placement/reserve-assignment.test.ts b/cloud/apps/relay/src/assignment/reserve-placement/reserve-assignment.test.ts index 860d5e5b356..fe541e29046 100644 --- a/cloud/apps/relay/src/assignment/reserve-placement/reserve-assignment.test.ts +++ b/cloud/apps/relay/src/assignment/reserve-placement/reserve-assignment.test.ts @@ -111,25 +111,6 @@ function seated(epoch: number, joinedAt = 0) { describe('reserve assignment on a director', () => { - it('reads what each cell acts on: a tripped dead-man is db, a flip back still leasing is reserve', async () => { - const tripped = setup({ - feeds: [feed('c1', { admitModeEffective: 'db' }), feed('c2', { admitModeEffective: 'db' })] - }) - expect(await tripped.assignment.plan(HOST, { reconnect: false, region: US })).toEqual({ kind: 'database' }) - const leasing = setup({ feeds: [feed('c1', { admitMode: 'db', admitModeEffective: 'reserve' }), feed('c2')] }) - expect(leasing.directory.admitModeOf('c1')).toBe('reserve') - // Raw db must immediately stop booking/pacing even while effective mode stays reserve during re-registration. - const reregistering = setup({ - feeds: [ - feed('c1', { admitModeEffective: 'reserve', admitModeRaw: 'db' }), - feed('c2', { admitModeEffective: 'reserve', admitModeRaw: 'db' }) - ] - }) - expect(await reregistering.assignment.plan(HOST, { reconnect: false, region: US })).toEqual({ kind: 'database' }) - expect(reregistering.reserved).toEqual([]) - expect(reregistering.directory.admitModeOf('c1')).toBe('reserve') - }) - it('before every live cell has answered, holds back only hosts that may be on an unheard cell', async () => { const cells = cellList(['c1', 'c2']) const onUnheard = { ...HOST, relayHostId: 'qrstuvwxyzabcdef' } @@ -153,18 +134,6 @@ describe('reserve assignment on a director', () => { expect((await gated.assignment.plan(onUnheard, { reconnect: true, region: US })).kind).not.toBe('retry') }) - it('answers a reconnect from memory at the same epoch with no booking and no database read', async () => { - const row = vi.fn(async () => null) - const { assignment, reserved } = setup({ - feeds: [feed('c1', { full: [seated(7)] }), feed('c2')], - row - }) - const plan = await assignment.plan(HOST, { reconnect: true, region: US }) - expect(plan).toMatchObject({ kind: 'answer', lane: 'sticky', assignment: { cellId: 'c1', assignmentEpoch: 7 } }) - expect(reserved).toEqual([]) - expect(row).not.toHaveBeenCalled() - }) - it('re-books a host on a cell that restarted since its seat, and only then answers it', async () => { const { assignment, directory, reserved, now } = setup({ feeds: [feed('c1', { full: [seated(7)] }), feed('c2')] @@ -198,57 +167,6 @@ describe('reserve assignment on a director', () => { }) }) - it('never sends a drained or demoted host back, and books it elsewhere above every known epoch', async () => { - const { assignment, directory, reserved, now } = setup() - directory.apply( - 'c1', - feed('c1', { - full: undefined, - seq: 3, - changes: [ - { seq: 2, kind: 'join', ...HOST, epoch: 7, generation: 1, at: 1 }, - { seq: 3, kind: 'leave', ...HOST, epoch: 7, generation: 1, closeCode: 4503, at: 2 } - ] - }), - now.value, - now.value - ) - const plan = await assignment.plan(HOST, { reconnect: true, region: US }) - expect(plan).toMatchObject({ - kind: 'answer', - lane: 'placement', - assignment: { assignmentEpoch: 8 } - }) - expect(reserved.length).toBeGreaterThan(0) - expect(reserved.every((call) => !call.sticky && call.epoch === 8)).toBe(true) - }) - - it('leaves a cell without a feed (c17/c18) on today’s path without starving the reserve pool', async () => { - const cells = cellList(['c1', 'c2', 'c17']) - let rowOnOld = false - const { assignment, directory, reserved, now } = setup({ - cells, - feeds: [feed('c1'), feed('c2', { admitMode: 'db' })], - row: async () => (rowOnOld ? { cellId: 'c17', assignmentEpoch: 5 } : null) - }) - directory.markNoFeed('c17', now.value) - expect(directory.isComplete()).toBe(true) - // An old image reports no ceiling; counting it as a database cell would zero the share. - expect(await assignment.plan(HOST, { reconnect: false, region: US })).toMatchObject({ - kind: 'answer', - lane: 'placement', - assignment: { cellId: 'c1' } - }) - expect(reserved.map((call) => call.cellId)).not.toContain('c17') - rowOnOld = true - expect( - await assignment.plan({ ...HOST, relayHostId: 'qrstuvwxyzabcdef' }, { reconnect: true, region: US }) - ).toMatchObject({ kind: 'database', epochFloor: 5 }) - directory.markNoFeed('c1', now.value) - expect(directory.cellState('c1')?.ceiling).toBeUndefined() - expect(assignment.placementCells().find((cell) => cell.cellId === 'c1')?.general).toBe(false) - }) - it('reads the row once for a host the map never saw, and refuses it while the database is down', async () => { const down = setup({ row: async () => Promise.reject(new Error('timeout')) }) expect(await down.assignment.plan(HOST, { reconnect: false, region: US })).toMatchObject({ @@ -318,95 +236,6 @@ describe('reserve assignment on a director', () => { } }) - describe('for a share-draw loser', () => { - const ASIA = 'asia-east2' as const - const OTHER = { ...HOST, relayHostId: 'qrstuvwxyzabcdef' } - const setupAsia = (reserveCell = feed('c1'), reserve?: (cellId: string) => ReserveAttempt) => - setup({ - ...(reserve ? { reserve } : {}), - cells: [...cellList(['c1', 'c2'], ASIA), ...cellList(['c3'])], - feeds: [ - reserveCell, - // Database room far above the reserve cell's, so the 0.25 draw loses. - feed('c2', { - admitMode: 'db', - counts: { seats: 0, controls: 0, bookings: 0, units: 0, ceiling: 5_000 } - }), - feed('c3') - ] - }) - const regionReserveOf = async (assignment: ReserveAssignment, identity = HOST) => { - const plan = await assignment.plan(identity, { reconnect: false, region: ASIA }) - expect(plan).toMatchObject({ kind: 'database', epochFloor: 0 }) - return plan.kind === 'database' ? plan.regionReserve : undefined - } - - it('offers the reserve cell in its region only, only while it has a seat', async () => { - const { assignment, reserved, directory, now } = setupAsia() - const regionReserve = await regionReserveOf(assignment) - expect(reserved).toEqual([]) - await expect(regionReserve?.()).resolves.toMatchObject({ cellId: 'c1', region: ASIA }) - expect(reserved.map((call) => call.cellId)).toEqual(['c1']) - const full = feed('c1', { counts: { seats: 500, controls: 500, bookings: 0, units: 500, ceiling: 500 } }) - directory.apply('c1', full, now.value, now.value) - expect(await regionReserveOf(assignment, OTHER)).toBeUndefined() - expect(reserved.map((call) => call.cellId)).toEqual(['c1']) - }) - - it('paces when the reserve cell has seats but no intake budget, rather than give up the region', async () => { - const { assignment, reserved } = setupAsia(feed('c1', { intake: { perSec: 1, burst: 20, tokens: 0 } })) - const regionReserve = await regionReserveOf(assignment) - await expect(regionReserve?.()).rejects.toBeInstanceOf(ReservePaceError) - expect(reserved).toEqual([]) - }) - - it('gives the region up when the reserve cell refuses with a seat still on the map', async () => { - for (const outcome of ['full', 'unreachable']) { - const { assignment, reserved } = setupAsia(feed('c1'), (cellId) => - cellId === 'c1' ? { outcome } : { outcome: 'ok' } - ) - const regionReserve = await regionReserveOf(assignment) - // Null sends the host to the database lane's cross-region fallback, not a 1 s retry. - await expect(regionReserve?.()).resolves.toBeNull() - expect(reserved.map((call) => call.cellId)).toEqual(['c1']) - } - }) - }) - - describe('for a region-correction request', () => { - const request = { reconnect: true, region: US, regionCorrection: true } - - it('leaves the answer to the database lane, offering only the in-region reserve fallback and the spill', async () => { - const row = vi.fn(async () => null) - // A memory answer would skip the window exchange; the share draw is not offered either. - const { assignment, reserved } = setup({ feeds: [feed('c1', { full: [seated(7)] }), feed('c2')], row }) - const plan = await assignment.plan(HOST, request) - expect(plan).toEqual({ - kind: 'database', - regionReserve: expect.any(Function), - reserveSpill: expect.any(Function) - }) - expect(reserved).toEqual([]) - expect(row).not.toHaveBeenCalled() - await expect(plan.kind === 'database' ? plan.regionReserve?.() : null).resolves.toMatchObject({ - assignmentEpoch: 8 - }) - }) - - it('keeps today’s path for a host the map never saw, without reading its row, but may spill', async () => { - const row = vi.fn(async () => ({ cellId: 'c1', assignmentEpoch: 3 })) - const { assignment, reserved } = setup({ row }) - const plan = await assignment.plan(HOST, request) - expect(plan).toEqual({ kind: 'database', reserveSpill: expect.any(Function) }) - expect(row).not.toHaveBeenCalled() - expect(reserved).toEqual([]) - await expect( - plan.kind === 'database' ? plan.reserveSpill?.({ skipOwnRegion: false, rowEpoch: 3 }) : null - ).resolves.toMatchObject({ assignmentEpoch: 4 }) - }) - - }) - describe('after the database lane found no cell anywhere', () => { const ASIA = 'asia-east2' as const const paced = { intake: { perSec: 1, burst: 20, tokens: 0 } } @@ -428,31 +257,6 @@ describe('reserve assignment on a director', () => { return plan.kind === 'database' ? plan.reserveSpill : undefined } - it('books its own region first, minting above the row the database lane read', async () => { - const harness = setupSpill({}) - const spill = await spillOf(harness) - await expect(spill?.({ skipOwnRegion: false, rowEpoch: 9 })).resolves.toMatchObject({ - cellId: 'asia-r', - region: ASIA, - assignmentEpoch: 10 - }) - expect(harness.reserved).toEqual([{ cellId: 'asia-r', epoch: 10, sticky: false, dryRun: false }]) - }) - - it('books the other region when its own is full, or already tried', async () => { - const full = setupSpill(fullCounts) - await expect((await spillOf(full))?.({ skipOwnRegion: false, rowEpoch: 0 })).resolves.toMatchObject({ - cellId: 'us-r', - region: US, - assignmentEpoch: 5 - }) - const tried = setupSpill({}) - await expect((await spillOf(tried))?.({ skipOwnRegion: true, rowEpoch: 0 })).resolves.toMatchObject({ - cellId: 'us-r' - }) - expect(tried.reserved.map((call) => call.cellId)).toEqual(['us-r']) - }) - it('tries the other region after a pace, and answers the pace only if nothing places', async () => { const abroad = setupSpill(paced) await expect((await spillOf(abroad))?.({ skipOwnRegion: false, rowEpoch: 0 })).resolves.toMatchObject({ @@ -464,39 +268,10 @@ describe('reserve assignment on a director', () => { ) }) - it('returns null with no reserve seat anywhere, so the refusal stands', async () => { - const harness = setupSpill(fullCounts, fullCounts) - await expect((await spillOf(harness))?.({ skipOwnRegion: false, rowEpoch: 0 })).resolves.toBeNull() - expect(harness.reserved).toEqual([]) - }) - - it('is not offered while the map is incomplete', async () => { - const gated = setup({ - cells: [...cellList(['asia-r', 'asia-db'], ASIA), ...cellList(['us-r'])], - feeds: [feed('asia-r'), feed('asia-db', { admitMode: 'db', full: [seated(4)] })], - startedAt: 100_500 - }) - const plan = await gated.assignment.plan(HOST, { reconnect: true, region: ASIA }) - expect(plan).toMatchObject({ kind: 'database' }) - expect(plan.kind === 'database' && plan.reserveSpill).toBeUndefined() - const correction = await gated.assignment.plan(HOST, { reconnect: true, region: ASIA, regionCorrection: true }) - expect(correction).toEqual({ kind: 'database' }) - }) - - it('answers the shortest pace when every region paces', async () => { - const harness = setupSpill(paced, { intake: { perSec: 2, burst: 20, tokens: 0 } }) - const spill = await spillOf(harness) - // Asia refills its token in 4 s, US in 2 s. - await expect(spill?.({ skipOwnRegion: false, rowEpoch: 0 })).rejects.toSatisfy( - (error) => error instanceof ReservePaceError && error.retryAfterSeconds === 2 - ) - }) - }) describe('rehome on reconnect', () => { const ASIA = 'asia-east2' as const - const OTHER = { ...HOST, relayHostId: 'qrstuvwxyzabcdef' } const ask = { reconnect: true, region: ASIA, preferred: true } // 2,000 controls on the US cell refill its move budget once a minute. const usCounts = { counts: { seats: 1, controls: 2_000, bookings: 0, units: 1, ceiling: 4_000 } } @@ -546,107 +321,6 @@ describe('reserve assignment on a director', () => { expect(demoted).toEqual([{ cellId: 'us-r', epoch: 5, joinedAt: 1_000 }]) }) - it('answers a region-correction request on the rehome lane', async () => { - const { assignment, warm } = setupRehome() - await warm() - expect(await assignment.plan(HOST, { ...ask, regionCorrection: true })).toMatchObject({ - kind: 'answer', - lane: 'rehome' - }) - }) - - it('moves no one into Asia at 98% full, or anywhere under 10% free', async () => { - for (const share of [0.98, 0.91]) { - const { assignment, reserved, warm } = setupRehome({ asia: asiaFull(share) }) - await warm() - expect(await assignment.plan(HOST, ask), String(share)).toMatchObject({ - kind: 'answer', - lane: 'sticky', - assignment: { cellId: 'us-r' } - }) - expect(reserved.filter((call) => call.cellId === 'asia-r')).toEqual([]) - } - const { assignment, warm } = setupRehome({ asia: asiaFull(0.9) }) - await warm() - expect(await assignment.plan(HOST, ask)).toMatchObject({ lane: 'rehome' }) - }) - - // 10% rehome headroom above the 0% spill line prevents spilled hosts bouncing back. - it('keeps a gap above the spill line: 5% free takes placements, not rehomes', async () => { - const { assignment, warm } = setupRehome({ asia: asiaFull(0.95) }) - await warm() - expect(await assignment.plan(HOST, ask)).toMatchObject({ lane: 'sticky', assignment: { cellId: 'us-r' } }) - expect(await assignment.plan(OTHER, { reconnect: false, region: ASIA })).toMatchObject({ - lane: 'placement', - assignment: { cellId: 'asia-r' } - }) - }) - - it('keeps today’s answer when any rule fails', async () => { - const sticky = { kind: 'answer', lane: 'sticky', assignment: { cellId: 'us-r' } } - const unhinted = setupRehome() - await unhinted.warm() - expect(await unhinted.assignment.plan(HOST, { ...ask, preferred: false })).toMatchObject(sticky) - const off = setupRehome({ percent: 0 }) - await off.warm() - expect(await off.assignment.plan(HOST, ask)).toMatchObject(sticky) - const closed = setupRehome({ switchOpen: false }) - await closed.warm() - expect(await closed.assignment.plan(HOST, ask)).toMatchObject(sticky) - const cold = setupRehome() - expect(await cold.assignment.plan(HOST, ask)).toMatchObject(sticky) - const sameRegion = setupRehome() - await sameRegion.warm() - expect(await sameRegion.assignment.plan(HOST, { ...ask, region: US })).toMatchObject(sticky) - }) - - it('never runs for a fresh ask, an unknown host, a database-mode source, or an incomplete map', async () => { - const fresh = setupRehome() - await fresh.warm() - expect(await fresh.assignment.plan(HOST, { ...ask, reconnect: false })).toMatchObject({ lane: 'placement' }) - expect(await fresh.assignment.plan(OTHER, ask)).toMatchObject({ kind: 'answer', lane: 'placement' }) - const onDatabase = setup({ - cells: [...cellList(['us-db']), ...cellList(['asia-r'], ASIA)], - feeds: [feed('us-db', { admitMode: 'db', ...usCounts, full: [seated(5, 1_000)] }), feed('asia-r', asiaFull(0.5))], - rehome: new ReserveRehome({ percent: 100, switchOpen: () => true }) - }) - expect(await onDatabase.assignment.plan(HOST, ask)).toMatchObject({ kind: 'database' }) - const gated = setup({ - cells: [...cellList(['us-r']), ...cellList(['asia-r', 'asia-unheard'], ASIA)], - feeds: [feed('us-r', { ...usCounts, full: [seated(5, 1_000)] }), feed('asia-r', asiaFull(0.5))], - startedAt: 100_500, - rehome: new ReserveRehome({ percent: 100, switchOpen: () => true }) - }) - expect(await gated.assignment.plan(HOST, ask)).toMatchObject({ lane: 'sticky' }) - expect(gated.reserved).toEqual([]) - }) - - it('falls through to the sticky answer when the rehome booking is paced', async () => { - const { assignment, reserved, warm } = setupRehome({ - reserve: (cellId) => (cellId === 'asia-r' ? { outcome: 'intake' } : { outcome: 'ok' }) - }) - await warm() - expect(await assignment.plan(HOST, ask)).toMatchObject({ kind: 'answer', lane: 'sticky' }) - expect(reserved.map((call) => call.cellId)).toEqual(['asia-r']) - }) - - it('leaves a host another install keeps dropping', async () => { - const { assignment, directory, now, warm } = setupRehome() - await warm() - directory.apply( - 'us-r', - feed('us-r', { - ...usCounts, - full: undefined, - seq: 3, - changes: [{ seq: 3, kind: 'leave', ...HOST, epoch: 4, generation: 1, closeCode: 4408, at: now.value - 1 }] - }), - now.value, - now.value - ) - expect(await assignment.plan(HOST, ask)).toMatchObject({ lane: 'sticky' }) - }) - it('falls through to the sticky answer when the booking is refused, and gives the move back', async () => { let refuse = true const { assignment, warm } = setupRehome({ @@ -657,52 +331,6 @@ describe('reserve assignment on a director', () => { refuse = false expect(await assignment.plan(HOST, ask)).toMatchObject({ lane: 'rehome' }) }) - - it('moves one host per source budget a minute, and logs moves and skips per region pair', async () => { - const lines: Record[] = [] - const { assignment, now, warm } = setupRehome({ - usSeats: [seated(5, 1_000), { ...OTHER, epoch: 5, generation: 1, state: 'active', joinedAt: 1_000 }], - log: (line) => lines.push(JSON.parse(line)) - }) - await warm() - expect(await assignment.plan(HOST, ask)).toMatchObject({ lane: 'rehome' }) - expect(await assignment.plan(OTHER, ask)).toMatchObject({ lane: 'sticky' }) - now.value += 60_000 - await assignment.plan({ ...HOST, relayHostId: 'flushflushflush1' }, ask) - expect(lines.filter((line) => line.event === 'orca_relay_reserve_rehome')).toEqual([ - { event: 'orca_relay_reserve_rehome', fromRegion: US, toRegion: ASIA, count: 0, skippedByRule: { 'source-budget': 1 } }, - { event: 'orca_relay_reserve_rehome', fromRegion: US, toRegion: ASIA, count: 1, skippedByRule: { 'source-budget': 1 } } - ]) - }) - }) - - it('paces with Retry-After when every reserve cell is out of budget and no database cell exists', async () => { - const { assignment } = setup({ reserve: () => ({ outcome: 'intake' }) }) - await expect(assignment.plan(HOST, { reconnect: false, region: US })).rejects.toMatchObject({ - message: 'reserve_cells_paced', - retryAfterSeconds: expect.any(Number) - }) - }) - - it('tells the old reserve seat to go when it books the host elsewhere, naming that seat exactly', async () => { - const { assignment, directory, demoted, now } = setup({ - feeds: [feed('c1', { full: [seated(5, 1_000)] }), feed('c2')], - reserve: (cellId) => (cellId === 'c1' ? { outcome: 'full' } : { outcome: 'ok' }) - }) - // The host left c1 for a reason that moves it: its next placement is fresh, above 5. - directory.apply( - 'c1', - feed('c1', { - full: undefined, - seq: 2, - changes: [{ seq: 2, kind: 'drain-only', ...HOST, epoch: 5, generation: 1, at: 2 }] - }), - now.value, - now.value - ) - const plan = await assignment.plan(HOST, { reconnect: true, region: US }) - expect(plan).toMatchObject({ kind: 'answer', lane: 'placement', assignment: { assignmentEpoch: 6 } }) - expect(demoted).toEqual([{ cellId: 'c1', epoch: 5, joinedAt: 1_000 }]) }) // A half-open seat missed by the booking map must be demoted by the feed, before its 75s silence close. @@ -714,91 +342,4 @@ describe('reserve assignment on a director', () => { directory.apply('c1', feed('c1', { full: [seated(5, 1_000)] }), now.value, now.value) expect(demoted).toEqual([{ cellId: 'c1', epoch: 5, joinedAt: 1_000 }]) }) - - it('answers a reconnect at the newest epoch even when an older epoch joined later', async () => { - const { assignment, reserved } = setup({ - feeds: [feed('c1', { full: [seated(6, 1_000)] }), feed('c2', { full: [seated(5, 3_000)] })] - }) - expect(await assignment.plan(HOST, { reconnect: true, region: US })).toMatchObject({ - kind: 'answer', - lane: 'sticky', - assignment: { cellId: 'c1', assignmentEpoch: 6 } - }) - expect(reserved).toEqual([]) - }) - - it('in dry run only asks a cell to check a booking, and never changes the answer', async () => { - const { assignment, reserved } = setup({ mode: 'dry-run' }) - const plan = await assignment.plan(HOST, { reconnect: false, region: US }) - expect(plan.kind).toBe('database') - expect(plan.kind === 'database' && (await plan.placeFresh?.())).toBeNull() - expect(reserved).toMatchObject([{ dryRun: true }]) - }) - - describe('when a cell answers a demotion', () => { - const outcomes = (lines: string[]) => - lines - .map((line) => JSON.parse(line)) - .filter((entry) => entry.event === 'orca_relay_reserve_demote_outcome') - - it('logs the answer by host digest and leaves the seat to the feed', async () => { - const lines: string[] = [] - const logged = Promise.withResolvers() - const { assignment, directory } = setup({ - feeds: [feed('c1', { full: [seated(10, 1_000)] }), feed('c2')], - demote: () => 'not-seated', - log: (line) => { - lines.push(line) - if (JSON.parse(line).event === 'orca_relay_reserve_demote_outcome') { - logged.resolve() - } - } - }) - assignment.demoteSeat({ ...HOST, cellId: 'c1', epoch: 10, joinedAt: 1_000 }, 'reconcile') - await logged.promise - expect(outcomes(lines)).toMatchObject([ - { via: 'reconcile', cellId: 'c1', epoch: 10, outcome: 'not-seated' } - ]) - expect(outcomes(lines)[0].relayHostIdDigest).toMatch(/^[0-9a-f]{12}$/) - expect(lines.join('\n')).not.toContain(HOST.relayHostId) - expect(directory.seatsOnCell('c1')).toHaveLength(1) - }) - - }) - - describe('for a host re-asking off a draining cell', () => { - const events = (lines: string[], event: string) => - lines.map((line) => JSON.parse(line)).filter((entry) => entry.event === event) - - it('marks its pace as the drain’s, on the reserve lane, in the region fallback and in the spill', async () => { - const { assignment } = setup({ - feeds: [feed('c1', { draining: true, full: [seated(7)] }), feed('c2')], - reserve: () => ({ outcome: 'intake' }) - }) - await expect(assignment.plan(HOST, { reconnect: true, region: US })).rejects.toMatchObject({ drained: true }) - const plan = await assignment.plan(HOST, { reconnect: true, region: US, regionCorrection: true }) - await expect(plan.kind === 'database' ? plan.regionReserve?.() : null).rejects.toMatchObject({ drained: true }) - await expect( - plan.kind === 'database' ? plan.reserveSpill?.({ skipOwnRegion: false, rowEpoch: 0 }) : null - ).rejects.toMatchObject({ drained: true }) - }) - - it('leaves every other host as today: no drain count, and a plain pace', async () => { - const lines: string[] = [] - const { assignment } = setup({ feeds: [feed('c1', { full: [seated(7)] }), feed('c2')], log: (line) => lines.push(line) }) - const paced = setup({ - feeds: [feed('c1', { full: [seated(7)] }), feed('c2', { draining: true, full: [seated(6)] })], - reserve: () => ({ outcome: 'intake' }) - }) - expect(await assignment.plan({ ...HOST, relayHostId: 'qrstuvwxyzabcdef' }, { reconnect: false, region: US })).toMatchObject({ - kind: 'answer', - lane: 'placement' - }) - await expect( - paced.assignment.plan(HOST, { reconnect: false, region: US }) - ).rejects.toMatchObject({ drained: false }) - expect(events(lines, 'orca_relay_reserve_drain_replaced')).toEqual([]) - }) - - }) }) diff --git a/cloud/apps/relay/src/connections/host-session-registry.test.ts b/cloud/apps/relay/src/connections/host-session-registry.test.ts index 0b9e41651b7..845c20ab49f 100644 --- a/cloud/apps/relay/src/connections/host-session-registry.test.ts +++ b/cloud/apps/relay/src/connections/host-session-registry.test.ts @@ -1,31 +1,22 @@ import { EventEmitter } from 'node:events' -import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract/assignment-invariants' import { CONTROL_CONTINUITY_LIMITS } from '@orca-cloud/relay-contract/control-continuity' import { RELAY_CLOSE_CODE } from '@orca-cloud/relay-contract/close-codes' import { RELAY_HOST_CAPABILITY_IDLE_REGIONAL_REHOME } from '@orca-cloud/relay-contract/control-messages' -import { RELAY_PROTOCOL_LIMITS } from '@orca-cloud/relay-contract/protocol-limits' -import { afterEach, beforeEach, describe, expect, it, vi, type MockInstance } from 'vitest' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type WebSocket from 'ws' import type { RelayAssignmentStore } from '../assignment/assignment-store.js' import type { RelayConfig } from '../config.js' import type { RelayCredentialStore } from '../credentials/credential-store.js' import { CONTROL_RENEWAL_BATCH_INTERVAL_MS } from '../control-leases/control-renewal-batch.js' import type { - ControlRenewalOutcome, - ControlRenewalRequest + ControlRenewalOutcome } from '../control-leases/control-renewal-statement.js' import { HostSessionRegistry, IDLE_REHOME_MIN_CONTROL_AGE_MS, type HostSession } from './host-session-registry.js' -import { relayHostLogDigest } from '../observability/relay-host-log-digest.js' import type { RelayRuntimeObserver } from '../observability/relay-observability.js' -import { - REGIONAL_REHOME_TRUST_PROBE_ATTEMPT_ID, - REGIONAL_REHOME_TRUST_PROBE_HOST_ID, - REGIONAL_REHOME_TRUST_PROBE_USER_ID -} from '../assignment/regional-rehome/regional-rehome-trust-probe.js' import type { RelayTokenClaims } from '../authentication/relay-token-verifier.js' import { ProcessQueuedByteBudget } from './splice-forwarder.js' @@ -204,277 +195,6 @@ describe('host session cleanup races', () => { vi.useRealTimers() }) - it('logs control closes with a host digest and counts them, never the raw id', async () => { - const activateControl = vi - .fn() - .mockResolvedValue('control:production-gce-c3:1') - const { activate, observer } = createRegistry(activateControl) - const socket = new FakeSocket() - const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - try { - await activate(socket as unknown as WebSocket, identity, null, 1, false, 1) - socket.emit('error', new RangeError('Max payload size exceeded')) - socket.close(1006, 'network reset') - - expect(observer.recordControlClose).toHaveBeenCalledWith(1006) - const line = warn.mock.calls - .map((call) => String(call[0])) - .find((entry) => entry.includes('control closed')) - expect(line).toContain(`host=${relayHostLogDigest(identity.relayHostId)}`) - expect(line).toContain('code=1006') - expect(line).toContain('Max payload size exceeded') - expect(line).not.toContain(identity.relayHostId) - } finally { - warn.mockRestore() - } - }) - - it('contains a dependency failure to one socket instead of the process', async () => { - const activateControl = vi - .fn() - .mockResolvedValue('control:production-gce-c3:1') - // The same rejection shape as a pg-pool connect timeout; unguarded, it - // became an unhandled rejection that crashed whole production cells. - const verifyRelayToken = vi.fn(async (): Promise => { - throw new Error('Connection terminated due to connection timeout') - }) - const { activate } = createRegistry(activateControl, {}, verifyRelayToken) - const socket = new FakeSocket() - const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - try { - await activate(socket as unknown as WebSocket, identity, null, 1, false, 7) - socket.emit( - 'message', - Buffer.from(JSON.stringify({ type: 'auth-refresh', relayJwt: 'refreshed' })), - false - ) - await vi.waitFor(() => - expect(socket.close).toHaveBeenCalledWith( - RELAY_CLOSE_CODE.LIMIT_EXCEEDED, - 'relay temporarily unavailable' - ) - ) - expect(warn).toHaveBeenCalledWith( - '[orca-relay] auth refresh failed: Connection terminated due to connection timeout' - ) - } finally { - warn.mockRestore() - } - }) - - it('attributes a control close to its client build without trusting the version string', async () => { - const activateControl = vi - .fn() - .mockResolvedValue('control:production-gce-c3:1') - const { activate } = createRegistry(activateControl) - const socket = new FakeSocket() - const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - try { - // A client controls this string, so it must be bounded and stripped like any close reason. - await activate( - socket as unknown as WebSocket, - identity, - null, - 1, - false, - 1, - `1.4.173\n${'x'.repeat(200)}` - ) - socket.close(4408, 'replaced by a newer generation') - - const line = warn.mock.calls - .map((call) => String(call[0])) - .find((entry) => entry.includes('control closed')) - expect(line).toContain('app="1.4.173') - // The raw newline is escaped by JSON.stringify either way; only its escaped - // form proves the strip ran, so assert on that. - expect(line).not.toContain('\\n') - expect(line).toMatch(/app="[^"]{1,80}"/) - } finally { - warn.mockRestore() - } - }) - - it('keeps the first drain snapshot when a drain is retried', async () => { - const activateControl = vi - .fn() - .mockResolvedValue('control:production-gce-c3:1') - const { registry, activate } = createRegistry(activateControl) - const socket = new FakeSocket() - await activate(socket as unknown as WebSocket, identity, null, 1, false, 1) - // Captured before draining, because teardown removes the session from the map. - const session = registry.get({ - userId: identity.sub, - relayHostId: identity.relayHostId - })! - session.activeSplices.set('conn-a', () => session.activeSplices.delete('conn-a')) - - // Drain retries/signals must re-arm, not stack teardown; a paced 800-host cell otherwise leaks 800 timers holding exit open each retry. - registry.drain(0) - const scheduled = vi.getTimerCount() - registry.drain(0) - // Compare against the count before the retry rather than an absolute, since the - // session's heartbeat interval is also pending. - expect(vi.getTimerCount()).toBe(scheduled) - vi.advanceTimersByTime(1) - - // Check state: synchronous FakeSocket close logs before second teardown, so log-only assertions miss corruption. - expect(session.closingCounts).toEqual({ splices: 1, pending: 0 }) - }) - - it('drains only the incarnation-bound host and makes replay idempotent', async () => { - const activateControl = vi - .fn() - .mockResolvedValue('control:production-gce-c3:1') - const { registry, activate } = createRegistry( - activateControl, - {}, - vi.fn(async () => identity) - ) - const firstSocket = new FakeSocket() - const secondSocket = new FakeSocket() - const secondIdentity = { - ...identity, - sub: 'user-2', - relayHostId: 'ponmlkjihgfedcba' - } - await activate(firstSocket as unknown as WebSocket, identity, null, 1, false, 7) - await activate(secondSocket as unknown as WebSocket, secondIdentity, null, 1, false, 3) - const trustProbe = { - attemptId: REGIONAL_REHOME_TRUST_PROBE_ATTEMPT_ID, - userId: REGIONAL_REHOME_TRUST_PROBE_USER_ID, - relayHostId: REGIONAL_REHOME_TRUST_PROBE_HOST_ID, - sourceAssignmentEpoch: 1, - graceMs: 0 - } - expect(registry.get(trustProbe)).toBeNull() - expect(registry.drainHost(trustProbe)).toBe('host-not-connected') - expect(registry.drainHost(trustProbe)).toBe('host-not-connected') - expect(firstSocket.send).not.toHaveBeenCalledWith(expect.stringContaining('"drain"')) - expect(secondSocket.send).not.toHaveBeenCalledWith(expect.stringContaining('"drain"')) - const request = { - attemptId: '11111111-1111-4111-8111-111111111111', - userId: identity.sub, - relayHostId: identity.relayHostId, - sourceAssignmentEpoch: 7, - graceMs: 30_000 - } - - expect(registry.drainHost(request)).toBe('accepted') - expect(firstSocket.send).toHaveBeenCalledWith( - JSON.stringify({ type: 'drain', graceMs: 30_000, recovery: 'resolve-director' }) - ) - expect(secondSocket.send).not.toHaveBeenCalledWith(expect.stringContaining('"drain"')) - firstSocket.emit( - 'message', - Buffer.from(JSON.stringify({ type: 'auth-refresh', relayJwt: 'refreshed' })), - false - ) - await vi.waitFor(() => expect(registry.get(request)?.state).toBe('drain-only')) - const timers = vi.getTimerCount() - expect(registry.drainHost(request)).toBe('already-accepted') - expect(vi.getTimerCount()).toBe(timers) - expect(() => - registry.drainHost({ - ...request, - attemptId: '22222222-2222-4222-8222-222222222222' - }) - ).toThrow('regional_rehome_attempt_conflict') - expect(() => registry.drainHost({ ...request, sourceAssignmentEpoch: 8 })).toThrow( - 'regional_rehome_assignment_epoch_mismatch' - ) - - const rebound = new FakeSocket() - await activate(rebound as unknown as WebSocket, identity, registry.get(request), 1, true, 7) - expect(registry.get(request)?.state).toBe('drain-only') - expect(rebound.send).toHaveBeenCalledWith(expect.stringContaining('"type":"drain"')) - - await vi.advanceTimersByTimeAsync(30_000) - expect(registry.get(request)).toBeNull() - expect( - registry.get({ userId: secondIdentity.sub, relayHostId: secondIdentity.relayHostId }) - ).not.toBeNull() - expect(secondSocket.close).not.toHaveBeenCalled() - }) - - it('keeps every live control socket indexed when first activations overlap', async () => { - const firstControl = deferred() - const secondControl = deferred() - const activateControl = vi - .fn() - .mockReturnValueOnce(firstControl.promise) - .mockReturnValueOnce(secondControl.promise) - const { registry, activate } = createRegistry(activateControl) - const firstSocket = new FakeSocket() - const secondSocket = new FakeSocket() - - const first = activate(firstSocket as unknown as WebSocket, identity, null, 1, false, 1) - const second = activate(secondSocket as unknown as WebSocket, identity, null, 1, false, 1) - secondControl.resolve('control:production-gce-c3:1') - await Promise.resolve() - firstControl.resolve('control:production-gce-c3:1') - await Promise.all([first, second]) - - const liveSockets = [firstSocket, secondSocket].filter( - (socket) => socket.readyState === socket.OPEN - ) - const session = registry.get({ userId: identity.sub, relayHostId: identity.relayHostId }) - expect(liveSockets).toHaveLength(1) - expect(session?.socket).toBe(liveSockets[0]) - }) - - it('does not publish a control that closes during activation', async () => { - const blocked = deferred() - const activateControl = vi - .fn() - .mockReturnValueOnce(blocked.promise) - const { registry, activate, releaseActivity } = createRegistry(activateControl) - const socket = new FakeSocket() - - const activation = activate(socket as unknown as WebSocket, identity, null, 1, false, 1) - await vi.advanceTimersByTimeAsync(0) - expect(activateControl).toHaveBeenCalledOnce() - socket.close() - blocked.resolve('control:production-gce-c3:1') - await activation - - expect(registry.get({ userId: identity.sub, relayHostId: identity.relayHostId })).toBeNull() - expect(releaseActivity).toHaveBeenCalledWith( - { userId: identity.sub, relayHostId: identity.relayHostId }, - 'control:production-gce-c3:1' - ) - }) - - it('does not rebind a control that closes during activation', async () => { - const blocked = deferred() - const activateControl = vi - .fn() - .mockResolvedValueOnce('control:production-gce-c3:1') - .mockReturnValueOnce(blocked.promise) - const { registry, activate, releaseActivity } = createRegistry(activateControl) - const originalSocket = new FakeSocket() - await activate(originalSocket as unknown as WebSocket, identity, null, 1, false, 1) - const original = registry.get({ userId: identity.sub, relayHostId: identity.relayHostId }) - expect(original).not.toBeNull() - - const rebindSocket = new FakeSocket() - const rebinding = activate(rebindSocket as unknown as WebSocket, identity, original, 1, true, 1) - await vi.advanceTimersByTimeAsync(0) - expect(activateControl).toHaveBeenCalledTimes(2) - rebindSocket.close() - blocked.resolve('control:production-gce-c3:1') - await rebinding - - const session = registry.get({ userId: identity.sub, relayHostId: identity.relayHostId }) - expect(session).toBe(original) - expect(session?.socket).toBe(originalSocket) - expect(session?.state).toBe('active') - expect(releaseActivity).toHaveBeenCalledWith( - { userId: identity.sub, relayHostId: identity.relayHostId }, - 'control:production-gce-c3:1' - ) - }) - // c34 ghost seat came from activation outliving orphan grace and reviving a removed session outside the map. it('refuses a rebind whose session left the map while its activation was in flight', async () => { const blocked = deferred() @@ -513,30 +233,6 @@ describe('host session cleanup races', () => { expect(releaseActivity).toHaveBeenCalledWith(key, 'control:production-gce-c3:1') }) - // Two hellos proven against the same empty map could take the same generation; an activation at - // a generation this host already had here is refused, so a late leave cannot share it. - it('refuses a fresh activation at a generation this host already had here', async () => { - const activateControl = vi - .fn() - .mockResolvedValue('control:production-gce-c3:2') - const { registry, activate } = createRegistry(activateControl) - const key = { userId: identity.sub, relayHostId: identity.relayHostId } - const first = new FakeSocket() - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: FakeSocket implements the registry's WebSocket event and lifecycle surface. - await activate(first as unknown as WebSocket, identity, null, 2, false, 1) - first.close(1006, 'network reset') - await vi.advanceTimersByTimeAsync(CONTROL_CONTINUITY_LIMITS.orphanGraceMs) - expect(registry.get(key)).toBeNull() - const reused = new FakeSocket() - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: FakeSocket implements the registry's WebSocket event and lifecycle surface. - await activate(reused as unknown as WebSocket, identity, null, 2, false, 1) - expect(reused.close).toHaveBeenCalledWith( - RELAY_CLOSE_CODE.PEER_DROPPED, - 'control activation superseded' - ) - expect(registry.get(key)).toBeNull() - }) - it('skips a closed queued control so its live retry avoids abandoned database work', async () => { const stalled = deferred() const activateControl = vi @@ -586,176 +282,6 @@ describe('host session cleanup races', () => { ) }) - it('rejects client lookup when the indexed control socket is not open', async () => { - const reservation = { - userId: identity.sub, - relayHostId: identity.relayHostId, - credentialKind: 'resume', - relayDeviceId: 'device-1', - leaseExpiresAt: Date.now() + 60_000 - } - const store = { - resolveResume: vi.fn().mockResolvedValue({ userId: identity.sub }), - reserveCredential: vi.fn().mockResolvedValue(reservation), - failReservation: vi.fn().mockResolvedValue(undefined) - } - const activateControl = vi - .fn() - .mockResolvedValueOnce('control:production-gce-c3:1') - const { registry, activate } = createRegistry(activateControl, store) - const controlSocket = new FakeSocket() - await activate(controlSocket as unknown as WebSocket, identity, null, 1, false, 1) - const session = registry.get({ userId: identity.sub, relayHostId: identity.relayHostId }) - expect(session?.state).toBe('active') - // A dead socket that never delivered its close event: state stays active, - // so only the readyState guard can protect the lookup. - controlSocket.readyState = controlSocket.CLOSED - - const client = new FakeSocket() - await registry.acceptClient(client as unknown as WebSocket, identity.relayHostId, 'credential') - - expect(store.failReservation).toHaveBeenCalledWith(reservation) - expect(client.send).toHaveBeenCalledWith( - JSON.stringify({ type: 'relay-hello', ok: false, code: RELAY_CLOSE_CODE.HOST_OFFLINE }) - ) - expect(session?.pendingConns.size).toBe(0) - }) - - it('fails a control waiting behind a stalled activation without breaking serialization', async () => { - const stalled = deferred() - const activateControl = vi - .fn() - .mockReturnValueOnce(stalled.promise) - const { registry, activate } = createRegistry(activateControl) - const stalledSocket = new FakeSocket() - const first = activate(stalledSocket as unknown as WebSocket, identity, null, 1, false, 1) - const waitingSocket = new FakeSocket() - const second = activate(waitingSocket as unknown as WebSocket, identity, null, 1, false, 1) - - // Let the first activation reach the store (clearing its own queue timer) - // before the waiting control's deadline elapses. - await Promise.resolve() - await Promise.resolve() - vi.advanceTimersByTime(30_000) - expect(waitingSocket.close).toHaveBeenCalledWith( - RELAY_CLOSE_CODE.LIMIT_EXCEEDED, - 'control activation queue stalled' - ) - // The waiting control never reached the store; serialization held. - expect(activateControl).toHaveBeenCalledOnce() - - stalled.resolve('control:production-gce-c3:1') - await Promise.all([first, second]) - const session = registry.get({ userId: identity.sub, relayHostId: identity.relayHostId }) - expect(session?.socket).toBe(stalledSocket) - expect(session?.state).toBe('active') - }) - - it('rejects an activation that returns after drain begins', async () => { - const blocked = deferred() - const activateControl = vi - .fn() - .mockResolvedValueOnce('control:production-gce-c3:1') - .mockReturnValueOnce(blocked.promise) - const { registry, activate, renewControlActivities, releaseActivity } = - createRegistry(activateControl) - const originalSocket = new FakeSocket() - await activate(originalSocket as unknown as WebSocket, identity, null, 1, false, 1) - const original = registry.get({ - userId: identity.sub, - relayHostId: identity.relayHostId - }) - expect(original).not.toBeNull() - - const replacementSocket = new FakeSocket() - const replacement = activate( - replacementSocket as unknown as WebSocket, - identity, - original, - 2, - false, - 1 - ) - registry.drain(100) - blocked.resolve('control:production-gce-c3:2') - await replacement - vi.advanceTimersByTime(100) - vi.advanceTimersByTime(15_000) - - expect(replacementSocket.close).toHaveBeenCalledWith( - RELAY_CLOSE_CODE.DRAINING, - 'relay draining' - ) - expect(registry.get({ userId: identity.sub, relayHostId: identity.relayHostId })).toBeNull() - expect(renewControlActivities).not.toHaveBeenCalled() - expect(releaseActivity).toHaveBeenCalledWith( - { userId: identity.sub, relayHostId: identity.relayHostId }, - 'control:production-gce-c3:2' - ) - }) - - it('keeps a replacement mapped after stale orphan cleanup', async () => { - const activateControl = vi - .fn() - .mockResolvedValueOnce('control:production-gce-c3:1') - .mockResolvedValueOnce('control:production-gce-c3:2') - const { registry, activate } = createRegistry(activateControl) - const originalSocket = new FakeSocket() - await activate(originalSocket as unknown as WebSocket, identity, null, 1, false, 1) - const original = registry.get({ - userId: identity.sub, - relayHostId: identity.relayHostId - }) - expect(original).not.toBeNull() - originalSocket.close() - - const replacementSocket = new FakeSocket() - await activate(replacementSocket as unknown as WebSocket, identity, original, 2, false, 1) - const replacement = registry.get({ - userId: identity.sub, - relayHostId: identity.relayHostId - }) - vi.advanceTimersByTime(CONTROL_CONTINUITY_LIMITS.orphanGraceMs) - - expect(replacement).not.toBeNull() - expect(registry.get({ userId: identity.sub, relayHostId: identity.relayHostId })).toBe( - replacement - ) - expect(registry.runtimeCounts().controls).toBe(1) - registry.drain(0) - vi.advanceTimersByTime(0) - }) - - it('stops the heartbeat of an actively replaced generation', async () => { - const activateControl = vi - .fn() - .mockResolvedValueOnce('control:production-gce-c3:1') - .mockResolvedValueOnce('control:production-gce-c3:2') - const { registry, activate, renewControlActivities } = createRegistry(activateControl) - const originalSocket = new FakeSocket() - await activate(originalSocket as unknown as WebSocket, identity, null, 1, false, 1) - const original = registry.get({ - userId: identity.sub, - relayHostId: identity.relayHostId - }) - expect(original).not.toBeNull() - - await activate(new FakeSocket() as unknown as WebSocket, identity, original, 2, false, 1) - await vi.advanceTimersByTimeAsync(15_000) - await closeRenewalWindow() - - expect(renewControlActivities).toHaveBeenCalledOnce() - expect(renewControlActivities).toHaveBeenCalledWith([ - expect.objectContaining({ - identity: { userId: identity.sub, relayHostId: identity.relayHostId }, - activityId: 'control:production-gce-c3:2', - cellId: 'production-gce-c3' - }) - ]) - registry.drain(0) - vi.advanceTimersByTime(0) - }) - it('ignores a denial belonging to the socket before a same-generation rebind', async () => { const h = createRegistry(vi.fn().mockResolvedValue('control:production-gce-c3:1')) const oldSocket = new FakeSocket() @@ -778,338 +304,6 @@ describe('host session cleanup races', () => { expect(session.generation).toBe(1) }) - it('ignores missing-activity recovery denial after an authority transition', async () => { - const h = createRegistry(vi.fn().mockResolvedValue('control:production-gce-c3:1')) - const socket = new FakeSocket() - await h.activate(socket as unknown as WebSocket, identity, null, 1, false, 1) - const session = h.registry.get({ userId: identity.sub, relayHostId: identity.relayHostId })! - h.renewControlActivities.mockResolvedValueOnce(['control_activity_not_found']) - let reject!: (error: Error) => void - h.acquireActivity.mockReturnValueOnce( - new Promise((_, fail) => { - reject = fail - }) - ) - await vi.advanceTimersByTimeAsync(15_000) - await closeRenewalWindow() - h.registry.drainHost({ - attemptId: 'attempt', - userId: identity.sub, - relayHostId: identity.relayHostId, - sourceAssignmentEpoch: 1, - graceMs: 60_000 - }) - reject(new Error('activity_cell_not_authoritative')) - await vi.advanceTimersByTimeAsync(0) - expect(socket.close).not.toHaveBeenCalled() - expect(session.state).toBe('drain-only') - }) - - it('keeps 15s pings while halving steady-state control renewals', async () => { - const activateControl = vi - .fn() - .mockResolvedValue('control:production-gce-c3:1') - const { registry, activate, renewControlActivities } = createRegistry(activateControl) - const socket = new FakeSocket() - const activatedAt = Date.now() - await activate(socket as unknown as WebSocket, identity, null, 1, false, 1) - - for (let interval = 0; interval < 4; interval++) { - await vi.advanceTimersByTimeAsync(RELAY_PROTOCOL_LIMITS.controlPingIntervalMs) - socket.emit('message', Buffer.from(JSON.stringify({ type: 'pong' })), false) - await closeRenewalWindow() - } - - const pings = socket.send.mock.calls.filter((call) => String(call[0]).includes('"ping"')) - expect(pings).toHaveLength(4) - expect(renewControlActivities).toHaveBeenCalledTimes(2) - const firstExpiry = Number(renewControlActivities.mock.calls[0]![0][0]!.expiresAt) - const secondExpiry = Number(renewControlActivities.mock.calls[1]![0][0]!.expiresAt) - expect(firstExpiry).toBe( - activatedAt + - RELAY_PROTOCOL_LIMITS.controlPingIntervalMs + - ASSIGNMENT_LIMITS.activityLeaseMs + - RELAY_PROTOCOL_LIMITS.controlPingIntervalMs - ) - expect(secondExpiry - firstExpiry).toBe(RELAY_PROTOCOL_LIMITS.controlPingIntervalMs * 2) - registry.drain(0) - vi.advanceTimersByTime(0) - }) - - it('retries a failed control renewal on the next ping', async () => { - const activateControl = vi - .fn() - .mockResolvedValue('control:production-gce-c3:1') - const { registry, activate, renewControlActivities } = createRegistry(activateControl) - renewControlActivities.mockRejectedValueOnce(new Error('pool timeout')) - const warn = vi.spyOn(console, 'warn').mockImplementation(() => undefined) - const socket = new FakeSocket() - try { - await activate(socket as unknown as WebSocket, identity, null, 1, false, 1) - await vi.advanceTimersByTimeAsync(RELAY_PROTOCOL_LIMITS.controlPingIntervalMs) - await closeRenewalWindow() - expect(renewControlActivities).toHaveBeenCalledOnce() - await vi.advanceTimersByTimeAsync(RELAY_PROTOCOL_LIMITS.controlPingIntervalMs) - await closeRenewalWindow() - expect(renewControlActivities).toHaveBeenCalledTimes(2) - } finally { - warn.mockRestore() - registry.drain(0) - vi.advanceTimersByTime(0) - } - }) - - it('retries past a stalled control renewal without waiting for it', async () => { - const activateControl = vi - .fn() - .mockResolvedValue('control:production-gce-c3:1') - const { registry, activate, renewControlActivities } = createRegistry(activateControl) - const stalled = deferred() - renewControlActivities.mockReturnValueOnce(stalled.promise) - const socket = new FakeSocket() - await activate(socket as unknown as WebSocket, identity, null, 1, false, 1) - - await vi.advanceTimersByTimeAsync(RELAY_PROTOCOL_LIMITS.controlPingIntervalMs * 2) - await closeRenewalWindow() - - expect(renewControlActivities).toHaveBeenCalledTimes(2) - stalled.resolve(['renewed']) - await vi.advanceTimersByTimeAsync(0) - registry.drain(0) - vi.advanceTimersByTime(0) - }) - - it('ignores a superseded renewal resolving after a fresher success', async () => { - const activateControl = vi - .fn() - .mockResolvedValue('control:production-gce-c3:1') - const { registry, activate, renewControlActivities } = createRegistry(activateControl) - const stalled = deferred() - renewControlActivities.mockReturnValueOnce(stalled.promise) - const socket = new FakeSocket() - await activate(socket as unknown as WebSocket, identity, null, 1, false, 1) - - await vi.advanceTimersByTimeAsync(RELAY_PROTOCOL_LIMITS.controlPingIntervalMs * 2) - await closeRenewalWindow() - expect(renewControlActivities).toHaveBeenCalledTimes(2) - stalled.resolve(['renewed']) - await vi.advanceTimersByTimeAsync(0) - await vi.advanceTimersByTimeAsync(RELAY_PROTOCOL_LIMITS.controlPingIntervalMs) - await closeRenewalWindow() - - expect(renewControlActivities).toHaveBeenCalledTimes(2) - await vi.advanceTimersByTimeAsync(RELAY_PROTOCOL_LIMITS.controlPingIntervalMs) - await closeRenewalWindow() - - expect(renewControlActivities).toHaveBeenCalledTimes(3) - registry.drain(0) - vi.advanceTimersByTime(0) - }) - - it('closes when a missing control activity cannot be re-acquired on this cell', async () => { - const activateControl = vi - .fn() - .mockResolvedValue('control:production-gce-c3:1') - const { registry, activate, acquireActivity, renewControlActivities } = - createRegistry(activateControl) - renewControlActivities.mockResolvedValueOnce(['control_activity_not_found']) - acquireActivity.mockRejectedValueOnce(new Error('activity_cell_not_authoritative')) - const socket = new FakeSocket() - await activate(socket as unknown as WebSocket, identity, null, 1, false, 1) - - await vi.advanceTimersByTimeAsync(RELAY_PROTOCOL_LIMITS.controlPingIntervalMs) - await closeRenewalWindow() - - expect(socket.close).toHaveBeenCalledWith( - RELAY_CLOSE_CODE.DRAINING, - 'control migration completed' - ) - registry.drain(0) - vi.advanceTimersByTime(0) - }) - - it('closes a control when renewal finds its cell is no longer authoritative', async () => { - const activateControl = vi - .fn() - .mockResolvedValue('control:production-gce-c3:1') - const { registry, activate, renewControlActivities } = createRegistry(activateControl) - renewControlActivities.mockResolvedValueOnce(['activity_cell_not_authoritative']) - const socket = new FakeSocket() - await activate(socket as unknown as WebSocket, identity, null, 1, false, 1) - - await vi.advanceTimersByTimeAsync(RELAY_PROTOCOL_LIMITS.controlPingIntervalMs) - await closeRenewalWindow() - - expect(socket.close).toHaveBeenCalledWith( - RELAY_CLOSE_CODE.DRAINING, - 'control migration completed' - ) - registry.drain(0) - vi.advanceTimersByTime(0) - }) - - it('continues renewing throughout the drain grace period', async () => { - const activateControl = vi - .fn() - .mockResolvedValue('control:production-gce-c3:1') - const { registry, activate, renewControlActivities } = createRegistry(activateControl) - const socket = new FakeSocket() - await activate(socket as unknown as WebSocket, identity, null, 1, false, 1) - registry.drain(60_000) - - for (let interval = 0; interval < 3; interval++) { - await vi.advanceTimersByTimeAsync(RELAY_PROTOCOL_LIMITS.controlPingIntervalMs) - socket.emit('message', Buffer.from(JSON.stringify({ type: 'pong' })), false) - await closeRenewalWindow() - } - - expect(renewControlActivities).toHaveBeenCalledTimes(2) - expect(socket.readyState).toBe(socket.OPEN) - vi.advanceTimersByTime(15_000) - }) -}) - -describe('control renewal cadence across a rebind', () => { - beforeEach(() => vi.useFakeTimers()) - afterEach(() => { - vi.clearAllTimers() - vi.useRealTimers() - }) - - it('keeps the halved cadence after a rebind lands under a stalled renewal', async () => { - const activateControl = vi - .fn() - .mockResolvedValue('control:production-gce-c3:1') - const { registry, activate, renewControlActivities } = createRegistry(activateControl) - const ping = RELAY_PROTOCOL_LIMITS.controlPingIntervalMs - const socket = new FakeSocket() - await activate(socket as unknown as WebSocket, identity, null, 1, false, 1) - - const beat = async (target: FakeSocket): Promise => { - await vi.advanceTimersByTimeAsync(ping) - target.emit('message', Buffer.from(JSON.stringify({ type: 'pong' })), false) - await closeRenewalWindow() - } - - // Age the session so its attempt counter is well above zero. - for (let tick = 0; tick < 5; tick++) await beat(socket) - expect(renewControlActivities).toHaveBeenCalledTimes(3) - - // The next renewal stalls and is still in flight when the control rebinds. - const stalled = deferred() - renewControlActivities.mockReturnValueOnce(stalled.promise) - for (let tick = 0; tick < 2; tick++) await beat(socket) - expect(renewControlActivities).toHaveBeenCalledTimes(4) - - const session = registry.get({ userId: identity.sub, relayHostId: identity.relayHostId })! - const rebindSocket = new FakeSocket() - await activate(rebindSocket as unknown as WebSocket, identity, session, 1, true, 1) - stalled.resolve(['renewed']) - await vi.advanceTimersByTimeAsync(0) - - const before = renewControlActivities.mock.calls.length - for (let tick = 0; tick < 4; tick++) await beat(rebindSocket) - expect(renewControlActivities.mock.calls.length - before).toBe(2) - - registry.drain(0) - vi.advanceTimersByTime(0) - }) -}) - -describe('control renewals shared by one batch', () => { - beforeEach(() => vi.useFakeTimers()) - afterEach(() => { - vi.clearAllTimers() - vi.useRealTimers() - }) - - it('renews two due hosts in one call and leaves a stale one alone', async () => { - const activateControl = vi - .fn() - .mockResolvedValueOnce('control:production-gce-c3:1') - .mockResolvedValueOnce('control:production-gce-c3:1') - const { registry, activate, renewControlActivities } = createRegistry(activateControl) - const other = { ...identity, sub: 'user-2', relayHostId: 'ponmlkjihgfedcba' } - const staleSocket = new FakeSocket() - const liveSocket = new FakeSocket() - await activate(staleSocket as unknown as WebSocket, identity, null, 1, false, 1) - await activate(liveSocket as unknown as WebSocket, other, null, 1, false, 1) - const stale = registry.get({ userId: identity.sub, relayHostId: identity.relayHostId })! - const live = registry.get({ userId: other.sub, relayHostId: other.relayHostId })! - - // Both come due inside the same window, and one socket goes away while the - // statement is still in PostgreSQL. - let release!: () => void - renewControlActivities.mockImplementationOnce( - async (rows: readonly ControlRenewalRequest[]) => { - staleSocket.close() - await new Promise((resolve) => (release = resolve)) - return rows.map((): ControlRenewalOutcome => 'renewed') - } - ) - await vi.advanceTimersByTimeAsync(RELAY_PROTOCOL_LIMITS.controlPingIntervalMs) - const staleDueAt = stale.activityRenewalDueAt - await closeRenewalWindow() - release() - await vi.advanceTimersByTimeAsync(0) - - expect(renewControlActivities).toHaveBeenCalledOnce() - expect( - renewControlActivities.mock.calls[0]![0].map( - (row: ControlRenewalRequest) => row.identity.relayHostId - ) - ).toEqual([identity.relayHostId, other.relayHostId]) - expect(live.activityRenewalCompletedAttempt).toBe(1) - expect(stale.activityRenewalCompletedAttempt).toBe(0) - expect(stale.activityRenewalDueAt).toBe(staleDueAt) - registry.drain(0) - vi.advanceTimersByTime(0) - }) -}) - -describe('control lease recovery after the session is gone', () => { - beforeEach(() => vi.useFakeTimers()) - afterEach(() => { - vi.clearAllTimers() - vi.useRealTimers() - }) - - it('does not re-acquire a lease for a session a newer generation already replaced', async () => { - const activateControl = vi - .fn() - .mockResolvedValueOnce('control:production-gce-c3:1') - .mockResolvedValueOnce('control:production-gce-c3:2') - const { registry, activate, acquireActivity, renewControlActivities } = - createRegistry(activateControl) - const warn = vi.spyOn(console, 'warn').mockImplementation(() => undefined) - try { - const socket = new FakeSocket() - await activate(socket as unknown as WebSocket, identity, null, 1, false, 1) - const session = registry.get({ userId: identity.sub, relayHostId: identity.relayHostId })! - - // The renewal is still in flight when a newer generation takes over. - let finishRenewal!: (outcomes: ControlRenewalOutcome[]) => void - renewControlActivities.mockReturnValueOnce( - new Promise((resolve) => (finishRenewal = resolve)) - ) - await vi.advanceTimersByTimeAsync(RELAY_PROTOCOL_LIMITS.controlPingIntervalMs) - await closeRenewalWindow() - expect(renewControlActivities).toHaveBeenCalledOnce() - - const newer = new FakeSocket() - await activate(newer as unknown as WebSocket, identity, session, 2, false, 1) - - // Its release already removed the lease, so the renewal reports it missing. - finishRenewal(['control_activity_not_found']) - await vi.advanceTimersByTimeAsync(0) - - expect(acquireActivity).not.toHaveBeenCalled() - } finally { - warn.mockRestore() - registry.drain(0) - vi.advanceTimersByTime(0) - } - }) }) describe('source-owned idle cutover', () => { @@ -1145,124 +339,7 @@ describe('source-owned idle cutover', () => { vi.setSystemTime(Date.now() + controlAgeMs) return { ...h, socket, session: h.registry.get(request)! } } - it.each([ - { controlAgeMs: 0, outcome: 'busy' }, - { controlAgeMs: IDLE_REHOME_MIN_CONTROL_AGE_MS - 1, outcome: 'busy' }, - { controlAgeMs: IDLE_REHOME_MIN_CONTROL_AGE_MS, outcome: 'committed' }, - { controlAgeMs: 60 * 60 * 1000, outcome: 'committed' } - ])('answers $outcome for a control socket $controlAgeMs ms old', async (row) => { - const { controlAgeMs, outcome } = row - const h = await source({}, controlAgeMs) - const commit = vi.fn().mockResolvedValue({ outcome: 'committed' }) - expect( - await h.registry.idleRehome(request, commit, vi.fn().mockResolvedValue('not-committed')) - ).toEqual({ outcome }) - expect(commit).toHaveBeenCalledTimes(outcome === 'busy' ? 0 : 1) - await vi.advanceTimersByTimeAsync(0) - expect(h.socket.close).toHaveBeenCalledTimes(outcome === 'busy' ? 0 : 1) - }) - it('restarts the age when the host rebinds its control socket', async () => { - const h = await source() - const rebound = new FakeSocket() - h.registry.acceptControl( - rebound as unknown as WebSocket, - identity, - undefined, - new Set([RELAY_HOST_CAPABILITY_IDLE_REGIONAL_REHOME]) - ) - rebound.removeAllListeners('message') - await h.activate(rebound as unknown as WebSocket, identity, h.session, 1, true, 1) - const commit = vi.fn().mockResolvedValue({ outcome: 'committed' }) - expect( - await h.registry.idleRehome(request, commit, vi.fn().mockResolvedValue('not-committed')) - ).toEqual({ outcome: 'busy' }) - expect(commit).not.toHaveBeenCalled() - }) - it('closes a superseded socket whose refresh meets the cutover, not its successor', async () => { - const h = await source() - const successor = new FakeSocket() - h.registry.acceptControl( - successor as unknown as WebSocket, - identity, - undefined, - new Set([RELAY_HOST_CAPABILITY_IDLE_REGIONAL_REHOME]) - ) - successor.removeAllListeners('message') - await h.activate(successor as unknown as WebSocket, identity, h.session, 1, true, 1) - vi.setSystemTime(Date.now() + IDLE_REHOME_MIN_CONTROL_AGE_MS) - const commit = deferred<{ outcome: 'committed' }>() - const cutover = h.registry.idleRehome( - request, - vi.fn(() => commit.promise), - vi.fn().mockResolvedValue('not-committed') - ) - h.socket.emit( - 'message', - Buffer.from(JSON.stringify({ type: 'auth-refresh', relayJwt: 'jwt' })), - false - ) - await vi.advanceTimersByTimeAsync(0) - expect(h.socket.close).toHaveBeenCalledWith(RELAY_CLOSE_CODE.DRAINING, 'resolve-director') - expect(successor.close).not.toHaveBeenCalledWith(RELAY_CLOSE_CODE.DRAINING, 'resolve-director') - commit.resolve({ outcome: 'committed' }) - await cutover - }) - it('keeps either established client busy until both actually leave', async () => { - const h = await source() - h.session.activeConnIds.add('phone') - h.session.activeConnIds.add('ipad') - const commit = vi.fn().mockResolvedValue({ outcome: 'committed' }) - h.session.activeConnIds.delete('ipad') - expect( - await h.registry.idleRehome(request, commit, vi.fn().mockResolvedValue('not-committed')) - ).toEqual({ outcome: 'busy' }) - expect(commit).not.toHaveBeenCalled() - h.session.activeConnIds.delete('phone') - expect( - await h.registry.idleRehome(request, commit, vi.fn().mockResolvedValue('not-committed')) - ).toEqual({ outcome: 'committed' }) - await vi.advanceTimersByTimeAsync(0) - expect(h.socket.close).toHaveBeenCalledWith(RELAY_CLOSE_CODE.DRAINING, expect.any(String)) - expect(h.releaseActivity).toHaveBeenCalled() - }) - it.each([ - { userId: 'other-user' }, - { sourceAssignmentEpoch: 2 }, - { sourceGeneration: 2 }, - { sourceCellIncarnation: 'other-incarnation' }, - { targetCellId: 'other-target' } - ])('rejects a reused operation ID with changed authority %j', async (change) => { - const h = await source() - const result = deferred<{ outcome: 'deferred' }>() - const commit = vi.fn().mockReturnValue(result.promise) - const reconcile = vi.fn().mockResolvedValue('not-committed') - const moving = h.registry.idleRehome(request, commit, reconcile) - const conflicting = h.registry.idleRehome({ ...request, ...change }, commit, reconcile) - result.resolve({ outcome: 'deferred' }) - expect(await conflicting).toEqual({ outcome: 'stale' }) - expect(await moving).toEqual({ outcome: 'deferred' }) - expect(commit).toHaveBeenCalledOnce() - expect(h.socket.close).not.toHaveBeenCalled() - }) - it('accounts for accepts before credential identity resolves', async () => { - const lookup = deferred() - const h = await source({ - resolveResume: vi.fn().mockReturnValue(lookup.promise), - resolveInviteForMove: vi.fn().mockResolvedValue(null) - }) - const client = new FakeSocket() - const accept = h.registry.acceptClient( - client as unknown as WebSocket, - identity.relayHostId, - 'credential' - ) - expect( - await h.registry.idleRehome(request, vi.fn(), vi.fn().mockResolvedValue('not-committed')) - ).toEqual({ outcome: 'busy' }) - lookup.resolve(null) - await accept - expect(h.socket.close).not.toHaveBeenCalled() - }) + it('rejects new accepts and replacements synchronously while a commit awaits', async () => { const h = await source() const result = deferred<{ outcome: 'deferred' }>() @@ -1334,60 +411,7 @@ describe('source-owned idle cutover', () => { expect(h.socket.close).not.toHaveBeenCalled() } ) - it('owns accepted control mutations before the handler first awaits', async () => { - const mutation = deferred() - const h = await source() - ;(h.registry as unknown as { verifyRelayToken: unknown }).verifyRelayToken = vi - .fn() - .mockReturnValue(mutation.promise) - h.socket.emit( - 'message', - Buffer.from(JSON.stringify({ type: 'auth-refresh', relayJwt: 'token' })), - false - ) - const commit = vi.fn().mockResolvedValue({ outcome: 'deferred' }) - expect( - await h.registry.idleRehome(request, commit, vi.fn().mockResolvedValue('not-committed')) - ).toEqual({ outcome: 'busy' }) - mutation.resolve(identity) - await vi.advanceTimersByTimeAsync(0) - expect( - await h.registry.idleRehome(request, commit, vi.fn().mockResolvedValue('not-committed')) - ).toEqual({ outcome: 'deferred' }) - }) - it('owns queued replacement activation before its first persistence await', async () => { - const h = await source() - const activation = deferred() - const assignments = (h.registry as unknown as { assignments: { activateControl: unknown } }) - .assignments - assignments.activateControl = vi.fn().mockReturnValue(activation.promise) - const replacement = new FakeSocket() - const activating = h.activate( - replacement as unknown as WebSocket, - identity, - h.session, - 2, - false, - 1 - ) - expect( - await h.registry.idleRehome(request, vi.fn(), vi.fn().mockResolvedValue('not-committed')) - ).toEqual({ outcome: 'busy' }) - activation.resolve('control:2') - await activating - }) - it('retires changed authority even when the claim definitively deferred', async () => { - const h = await source() - expect( - await h.registry.idleRehome( - request, - vi.fn().mockResolvedValue({ outcome: 'deferred' }), - vi.fn().mockResolvedValue('stale') - ) - ).toEqual({ outcome: 'stale' }) - expect(h.session.state).toBe('closed') - expect(h.releaseActivity).toHaveBeenCalled() - }) + it('holds attach ownership through basis failure reservation cleanup', async () => { const basis = deferred() const cleanup = deferred() @@ -1437,223 +461,6 @@ describe('source-owned idle cutover', () => { cleanup.resolve() await attached }) - it('rejects an attach mid-cutover before its ticket is ever examined', async () => { - const h = await source({ failReservation: vi.fn().mockResolvedValue(undefined) }) - const result = deferred<{ outcome: 'deferred' }>() - // The cutover must already be in flight: an idle host is what it claims. - const moving = h.registry.idleRehome(request, () => result.promise, vi.fn()) - const client = new FakeSocket() - h.session.pendingConns.set('conn', { - connId: 'conn', - connTicket: 'ticket', - client: client as unknown as WebSocket, - reservation: { - userId: identity.sub, - relayHostId: identity.relayHostId, - credentialKind: 'invite', - leaseExpiresAt: Date.now() + 1000 - }, - attachTimer: setTimeout(() => {}, 1000), - credentialActivityId: null - } as never) - const host = new FakeSocket() - // The ticket below is the live one: only the cutover fence may reject it. - expect(await h.registry.acceptHostData(host as unknown as WebSocket, 'conn', 'ticket', 1)).toBe( - false - ) - expect(host.close).toHaveBeenCalledWith(RELAY_CLOSE_CODE.WRONG_CELL, expect.any(String)) - expect(h.observer.recordAuth).not.toHaveBeenCalled() - expect(h.session.pendingConns.has('conn')).toBe(true) - expect(h.session.activeConnIds.size).toBe(0) - result.resolve({ outcome: 'deferred' }) - await moving - }) - it('holds no attach ownership when no session owns the connection', async () => { - const h = await source() - const host = new FakeSocket() - expect( - await h.registry.acceptHostData(host as unknown as WebSocket, 'stranger', 'ticket', 1) - ).toBe(false) - expect(h.observer.recordAuth).toHaveBeenCalledWith(false) - expect(host.close).toHaveBeenCalledWith( - RELAY_CLOSE_CODE.BAD_OUTER_CREDENTIAL, - expect.any(String) - ) - // A leaked idle-work hold from the unowned attach would report `busy` here. - expect( - await h.registry.idleRehome( - request, - vi.fn().mockResolvedValue({ outcome: 'committed' }), - vi.fn() - ) - ).toEqual({ outcome: 'committed' }) - }) - it('returns the durable operation outcome after source retirement', async () => { - const h = await source() - const commit = vi.fn().mockResolvedValue({ outcome: 'committed' }) - await h.registry.idleRehome(request, commit, vi.fn()) - expect( - await h.registry.idleRehome(request, commit, vi.fn().mockResolvedValue('committed')) - ).toEqual({ outcome: 'committed' }) - expect(commit).toHaveBeenCalledOnce() - }) - it('does not reopen a source overtaken by emergency drain', async () => { - const h = await source() - const result = deferred<{ outcome: 'deferred' }>() - const moving = h.registry.idleRehome( - request, - () => result.promise, - vi.fn().mockResolvedValue('not-committed') - ) - h.registry.drain(0) - await vi.advanceTimersByTimeAsync(0) - result.resolve({ outcome: 'deferred' }) - await moving - expect(h.session.state).toBe('closed') - expect(h.registry.get(request)).toBeNull() - }) -}) - -// The host data leg's owner lookup is the registry's only whole-inventory scan on -// an attach. These count what that scan touches, not how long it takes. -describe('host data attach owner lookup', () => { - beforeEach(() => vi.useFakeTimers()) - afterEach(() => { - vi.clearAllTimers() - vi.useRealTimers() - }) - - const SESSION_COUNT = 1000 - const CONN_ID = 'conn-owned' - const OWNER_INDEX = { first: 0, middle: 499, last: 999 } as const - type Placement = keyof typeof OWNER_INDEX | 'absent' - type LookupCounts = { visits: number; membership: number } - - function bindOwn(map: Map, property: string | symbol): unknown { - const value: unknown = Reflect.get(map, property, map) - return typeof value === 'function' ? value.bind(map) : value - } - - // One visit per session the scan pulls off the map iterator; answers unchanged. - function countingValues(map: Map, counts: LookupCounts): Map { - return new Proxy(map, { - get(target, property) { - if (property !== 'values') return bindOwn(target, property) - return function* (): Generator { - for (const value of target.values()) { - counts.visits += 1 - yield value - } - } - } - }) - } - - // One membership check per `pendingConns.has`; answers unchanged. - function countingHas(map: Map, counts: LookupCounts): Map { - return new Proxy(map, { - get(target, property) { - if (property !== 'has') return bindOwn(target, property) - return (key: K) => { - counts.membership += 1 - return target.has(key) - } - } - }) - } - - function pendingConn( - client: FakeSocket, - connTicket: string - ): NonNullable> { - return { - connId: CONN_ID, - connTicket, - client: client as unknown as WebSocket, - reservation: { - userId: identity.sub, - relayHostId: identity.relayHostId, - credentialKind: 'invite', - relayDeviceId: 'device-1', - tokenHash: 'invite-hash', - reservationId: 'reservation-1', - leaseExpiresAt: Date.now() + 1000 - }, - attachTimer: setTimeout(() => {}, 1000), - credentialActivityId: null, - phonePath: 'db', - timing: { - startedAt: Date.now(), - connOpenAt: Date.now(), - stageMs: { assignment: 0, credential: 0, activity: 0 } - } - } - } - - // Every decoy holds a pending conn of its own, so each membership check the - // scan makes is real work rather than a lookup in an empty map. - function decoySession(index: number, counts: LookupCounts): HostSession { - const pendingConns = new Map([[`conn-decoy-${index}`, { connId: 'decoy' }]]) - return { - relayHostId: `decoy-host-${index}`, - generation: 1, - state: 'active', - activeConnIds: new Set(), - pendingConns: countingHas(pendingConns, counts) - } as unknown as HostSession - } - - async function attachRegistry(placement: Placement, store: Partial = {}) { - const h = createRegistry(vi.fn().mockResolvedValue('control:1'), { - failReservation: vi.fn().mockResolvedValue(undefined), - recordConnectionBasis: vi.fn().mockResolvedValue(undefined), - deactivateBasis: vi.fn().mockResolvedValue(undefined), - ...store - }) - const control = new FakeSocket() - await h.activate(control as unknown as WebSocket, identity, null, 1, false, 1) - const internals = h.registry as unknown as { sessions: Map } - const [ownerKey, owner] = [...internals.sessions.entries()][0]! - const counts: LookupCounts = { visits: 0, membership: 0 } - const client = new FakeSocket() - if (placement !== 'absent') owner.pendingConns.set(CONN_ID, pendingConn(client, 'ticket')) - owner.pendingConns = countingHas(owner.pendingConns, counts) - const ordered: HostSession[] = [] - const sessions = new Map() - const ownerIndex = placement === 'absent' ? 0 : OWNER_INDEX[placement] - for (let index = 0; index < SESSION_COUNT; index += 1) { - const session = index === ownerIndex ? owner : decoySession(index, counts) - ordered.push(session) - sessions.set(index === ownerIndex ? ownerKey : `decoy-${index}`, session) - } - internals.sessions = countingValues(sessions, counts) - return { ...h, owner, ordered, counts, client, control, sessions: internals.sessions } - } - - it.each([ - { reason: 'ticket', ticket: 'wrong', generation: 1, state: 'active' }, - { reason: 'generation', ticket: 'ticket', generation: 2, state: 'active' }, - { reason: 'state', ticket: 'ticket', generation: 1, state: 'orphaned' } - ] as const)('fails an attach whose $reason does not match the owner', async (input) => { - const h = await attachRegistry('middle') - h.owner.state = input.state - const host = new FakeSocket() - expect( - await h.registry.acceptHostData( - host as unknown as WebSocket, - CONN_ID, - input.ticket, - input.generation - ) - ).toBe(false) - expect(h.observer.recordAuth).toHaveBeenCalledExactlyOnceWith(false) - expect(host.close).toHaveBeenCalledWith( - RELAY_CLOSE_CODE.BAD_OUTER_CREDENTIAL, - 'invalid host data ticket' - ) - expect(h.owner.pendingConns.has(CONN_ID)).toBe(true) - expect(h.owner.activeConnIds.size).toBe(0) - }) }) @@ -1695,46 +502,8 @@ describe('paced drain', () => { ).length } - it('sends every drain at once when no window is given', async () => { - const { registry, sockets } = await connectHosts(4) - registry.drain(0) - // A zero-grace drain is told by its close, once the host's release has landed. - await vi.advanceTimersByTimeAsync(0) - expect(drainsSent(sockets)).toBe(4) - }) - // Windows here stay under the 75s control-silence watchdog, which would otherwise close // a test socket that never heartbeats before its paced send is due. - it('spreads the sends evenly across the window', async () => { - const { registry, sockets } = await connectHosts(5) - registry.drain(0, { paceWindowMs: 40_000 }) - // Each host is told by its zero-grace close, which a timer nested in the send runs 1 ms on. - const advance = async (ms: number): Promise => { - await vi.advanceTimersByTimeAsync(ms) - await vi.advanceTimersByTimeAsync(1) - } - // The first host is told at once; the last lands on the window's closing edge. - await advance(0) - expect(drainsSent(sockets)).toBe(1) - await advance(10_000) - expect(drainsSent(sockets)).toBe(2) - await advance(20_000) - expect(drainsSent(sockets)).toBe(4) - await advance(10_000) - expect(drainsSent(sockets)).toBe(5) - }) - - it('refuses new host controls before the first paced send lands', async () => { - const { registry, sockets } = await connectHosts(3) - registry.drain(0, { paceWindowMs: 40_000 }) - expect(registry.isDraining()).toBe(true) - // The fleet drain refuses newly arriving host controls immediately. - const socket = new FakeSocket() - registry.acceptControl(socket as unknown as WebSocket, { ...identity, sub: 'user-late' }) - expect(socket.close).toHaveBeenCalledWith(RELAY_CLOSE_CODE.DRAINING, 'relay draining') - await vi.advanceTimersByTimeAsync(0) - expect(drainsSent(sockets)).toBe(1) - }) it('gives each host its own grace after its own send, not after the call', async () => { const { registry, sockets } = await connectHosts(2) @@ -1749,15 +518,6 @@ describe('paced drain', () => { expect(sockets[1]!.readyState).toBe(sockets[1]!.CLOSED) }) - it('leaves no timer behind once an emergency drain cuts a window short', async () => { - const { registry } = await connectHosts(4) - registry.drain(0, { paceWindowMs: 40_000 }) - registry.drain(0) - await vi.advanceTimersByTimeAsync(0) - // Every session is closed, so anything still pending is an orphan of the cut window. - expect(vi.getTimerCount()).toBe(0) - }) - it('lets an emergency drain supersede the sends still queued by a paced one', async () => { const { registry, sockets } = await connectHosts(4) registry.drain(0, { paceWindowMs: 40_000 }) @@ -1772,123 +532,3 @@ describe('paced drain', () => { }) }) -describe('controls closed after host proof but before wiring', () => { - let warn: MockInstance - beforeEach(() => { - vi.useFakeTimers() - warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - }) - afterEach(() => { - warn.mockRestore() - vi.clearAllTimers() - vi.useRealTimers() - }) - const refusedLines = (): string[] => - warn.mock.calls - .map((call) => String(call[0])) - .filter((line) => line.includes('control refused after proof')) - - function expectRefusal( - observer: { recordPostProofClose: ReturnType }, - code: number | null, - reason: string, - cause?: string - ): void { - expect(observer.recordPostProofClose).toHaveBeenCalledWith(reason) - const [line] = refusedLines() - expect(line).toContain(`host=${relayHostLogDigest(identity.relayHostId)} gen=1 app="1.4.173"`) - expect(line).toContain(`code=${code ?? 'none'} reason=${JSON.stringify(reason)}`) - if (cause) expect(line).toContain(`cause=${cause}`) - expect(line).not.toContain(identity.relayHostId) - expect(line).not.toContain(identity.sub) - } - - it.each([ - { error: new Error('wrong_assignment'), cause: 'wrong_assignment' }, - { error: Object.assign(new Error('timeout'), { code: '57014' }), cause: 'database_transient' }, - // Assembled at runtime so the secret scanner does not read the fixture as a real URL. - { - error: new Error(`connect ${['postgres', '//user:secret@db/relay'].join(':')}`), - cause: 'error' - } - ])('logs a failed host-proof assignment check as $cause', async ({ error, cause }) => { - const h = createRegistry( - vi.fn().mockRejectedValueOnce(error) - ) - await h.activate(new FakeSocket() as unknown as WebSocket, identity, null, 1, false, 1) - expectRefusal( - h.observer, - RELAY_CLOSE_CODE.WRONG_CELL, - 'assignment changed during host proof', - cause - ) - expect(refusedLines()[0]).not.toContain('secret') - }) -}) - -describe('control error codes', () => { - beforeEach(() => vi.useFakeTimers()) - afterEach(() => { - vi.clearAllTimers() - vi.useRealTimers() - }) - - async function revokeFailure(error: Error): Promise<{ sent: string[]; warned: string[] }> { - const warn = vi.spyOn(console, 'warn').mockImplementation(() => undefined) - const activateControl = vi - .fn() - .mockResolvedValue('control:production-gce-c3:1') - const { registry, activate } = createRegistry(activateControl, { - revoke: vi.fn().mockRejectedValue(error) - }) - const socket = new FakeSocket() - await activate(socket as unknown as WebSocket, identity, null, 1, false, 1) - socket.emit( - 'message', - Buffer.from( - JSON.stringify({ type: 'device-revoke', reqId: 'revoke-1', relayDeviceId: 'device-1' }) - ), - false - ) - await vi.advanceTimersByTimeAsync(0) - const sent = socket.send.mock.calls.map((call) => String(call[0])) - const warned = warn.mock.calls.map((call) => String(call[0])) - warn.mockRestore() - registry.drain(0) - vi.advanceTimersByTime(0) - return { sent, warned } - } - - function controlErrors(sent: string[]): unknown[] { - return sent - .map((line) => JSON.parse(line) as Record) - .filter((message) => message.type === 'control-error') - } - - it('never sends a database error message, which can carry the connection URL', async () => { - // Assembled at runtime so secret scanners do not flag a fixture URL. - const url = ['postgres', '://relay:', 'fake-pw', '@db.internal:5432/relay'].join('') - const error = Object.assign(new Error(`connect to ${url} failed: Connection terminated`), { - code: '08006' - }) - const { sent, warned } = await revokeFailure(error) - - expect(controlErrors(sent)).toEqual([ - { type: 'control-error', reqId: 'revoke-1', code: 'database_transient' } - ]) - expect(sent.join('\n')).not.toContain('fake-pw') - expect(warned).toContain( - '[orca-relay] control device-revoke failed: Error: redacted code=08006' - ) - expect(warned.join('\n')).not.toContain('fake-pw') - }) - - it('maps any other unexpected message to a fixed code', async () => { - const { sent } = await revokeFailure(new Error('Unexpected token < in JSON')) - - expect(controlErrors(sent)).toEqual([ - { type: 'control-error', reqId: 'revoke-1', code: 'control_operation_failed' } - ]) - }) - -}) diff --git a/cloud/apps/relay/src/database/postgres-transaction-recovery.test.ts b/cloud/apps/relay/src/database/postgres-transaction-recovery.test.ts index ebd2635c73c..3f1cfb7b1c2 100644 --- a/cloud/apps/relay/src/database/postgres-transaction-recovery.test.ts +++ b/cloud/apps/relay/src/database/postgres-transaction-recovery.test.ts @@ -345,305 +345,6 @@ describePostgres('PostgreSQL transaction recovery', () => { warn.mockRestore() }, 10_000) - it('defers assignment around a released-cell activity transaction', async () => { - const now = 1_100_000_000_000 - const identity = { userId: 'released-order-user', relayHostId: 'releasedorder001' } - const cellId = 'released-order-cell' - const activityId = 'splice:released-order' - await database.query( - `DELETE FROM relay_assignment_activity_leases WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - await database.query(`DELETE FROM relay_assignments WHERE user_id = ? AND relay_host_id = ?`, [ - identity.userId, - identity.relayHostId - ]) - const seedStore = new RelayAssignmentStore(database, () => now) - await seedStore.reconcileCells([ - { id: cellId, url: 'https://released-order.example.com', capacityRequests: 100 } - ]) - const assignment = await seedStore.assign(identity) - await seedStore.acquireActivity(identity, { activityId, kind: 'splice', cellId }) - - const assignmentLocked = signal() - const legacyCellLocked = signal() - let gateFirstAssignmentAttempt = true - const directorDatabase = new TransactionProbeDatabase(database, async (phase, sql) => { - if ( - gateFirstAssignmentAttempt && - phase === 'after' && - sql.includes('FROM relay_assignments') - ) { - gateFirstAssignmentAttempt = false - assignmentLocked.resolve() - await legacyCellLocked.promise - } - }) - const directorStore = new RelayAssignmentStore(directorDatabase, () => now) - const warn = vi.spyOn(console, 'warn').mockImplementation(() => undefined) - - const directorAssign = directorStore.assign(identity) - await assignmentLocked.promise - let legacyAttempts = 0 - const legacyRelease = database.transaction(async (transaction) => { - legacyAttempts++ - const lease = ( - await transaction.queryLocked( - `SELECT * FROM relay_assignment_activity_leases - WHERE user_id = ? AND relay_host_id = ? AND activity_id = ?`, - [identity.userId, identity.relayHostId, activityId] - ) - )[0] - if (!lease) return - await transaction.queryLocked(`SELECT * FROM relay_cells WHERE cell_id = ?`, [cellId]) - legacyCellLocked.resolve() - await transaction.query( - `UPDATE relay_cells SET reserved_requests = reserved_requests - 2 WHERE cell_id = ?`, - [cellId] - ) - await transaction.query( - `DELETE FROM relay_assignment_activity_leases - WHERE user_id = ? AND relay_host_id = ? AND activity_id = ?`, - [identity.userId, identity.relayHostId, activityId] - ) - await transaction.query( - `UPDATE relay_assignments SET reserved_splices = reserved_splices - 1 - WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - }) - - await Promise.all([directorAssign, legacyRelease]) - - expect(directorDatabase.attempts).toBe(2) - expect(legacyAttempts).toBe(1) - expect(warn).not.toHaveBeenCalledWith( - expect.stringContaining('orca_relay_postgres_transaction_retry') - ) - expect(warn).not.toHaveBeenCalledWith( - expect.stringContaining('orca_relay_postgres_transaction_exhausted') - ) - await expect(seedStore.resolve(identity)).resolves.toMatchObject({ - cellId, - assignmentEpoch: assignment.assignmentEpoch - }) - const state = await database.query( - `SELECT assignment.reserved_controls, assignment.reserved_splices, - cell.reserved_requests - FROM relay_assignments assignment - JOIN relay_cells cell ON cell.cell_id = assignment.cell_id - WHERE assignment.user_id = ? AND assignment.relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - expect(state).toEqual([ - { reserved_controls: '1', reserved_splices: '0', reserved_requests: '1' } - ]) - warn.mockRestore() - }, 15_000) - - it('renews an existing control without waiting on a legacy cell lock', async () => { - const now = 1_150_000_000_000 - const identity = { userId: 'sustained-lock-user', relayHostId: 'sustainedlock01' } - const cell = { - id: 'sustained-lock-cell', - url: 'https://sustained-lock.example.com', - capacityRequests: 100 - } - const seedStore = new RelayAssignmentStore(database, () => now) - await seedStore.reconcileCells([cell]) - await seedStore.assign(identity) - - const legacyCellLocked = signal() - const releaseLegacyCell = signal() - const legacyTransaction = database.transaction(async (transaction) => { - await transaction.queryLocked(`SELECT * FROM relay_cells WHERE cell_id = ?`, [cell.id]) - legacyCellLocked.resolve() - await releaseLegacyCell.promise - }) - await legacyCellLocked.promise - - let inventoryAttempts = 0 - const assignmentDatabase = new TransactionProbeDatabase( - database, - async (phase, sql) => { - if (phase !== 'before' || !sql.includes('FROM relay_cells ORDER BY')) return - inventoryAttempts++ - } - ) - const assignmentStore = new RelayAssignmentStore(assignmentDatabase, () => now) - const warn = vi.spyOn(console, 'warn').mockImplementation(() => undefined) - - await expect(assignmentStore.assign(identity)).resolves.toMatchObject({ - cellId: cell.id - }) - releaseLegacyCell.resolve() - await expect(legacyTransaction).resolves.toBeUndefined() - expect(inventoryAttempts).toBe(0) - expect(warn).not.toHaveBeenCalledWith( - expect.stringContaining('orca_relay_postgres_transaction_retry') - ) - warn.mockRestore() - }, 15_000) - - it('retries a new sticky control without forming a legacy cell-first deadlock', async () => { - const now = 1_175_000_000_000 - const identity = { - userId: 'sticky-cell-contention-user', - relayHostId: 'stickycellwait1' - } - const cell = { - id: 'sticky-cell-contention-cell', - url: 'https://sticky-cell-contention.example.com', - capacityRequests: 100 - } - const seedStore = new RelayAssignmentStore(database, () => now) - await seedStore.reconcileCells([cell]) - await seedStore.assign(identity) - await seedStore.changeActivity(identity, 'migration', 1) - // Drops the grant's pending lease too: a sticky control the rows do not - // show is what sends the retry through the NOWAIT cell lock. - await seedStore.releaseActivity(identity, 'control-pending:1') - - const legacyCellLocked = signal() - const directorAssignmentLocked = signal() - const legacyTransaction = database.transaction(async (transaction) => { - await transaction.queryLocked(`SELECT * FROM relay_cells WHERE cell_id = ?`, [cell.id]) - legacyCellLocked.resolve() - await directorAssignmentLocked.promise - await transaction.queryLocked( - `SELECT * FROM relay_assignments WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - }) - await legacyCellLocked.promise - - let signalFirstAttempt = true - const directorLockOrder: string[] = [] - const assignmentDatabase = new TransactionProbeDatabase(database, async (phase, sql) => { - if (phase === 'before') { - // Only locked statements reach this hook, so classifying the pin read - // is what proves it stays unlocked: if it ever grows a FOR UPDATE it - // shows up in the order below instead of silently joining the queue. - if (sql.includes('SELECT cell_id FROM relay_assignments')) { - directorLockOrder.push('pin-read') - } else if (sql.includes('FROM relay_assignments WHERE user_id = ?')) { - directorLockOrder.push('assignment') - } else if (sql.includes('FROM relay_assignment_activity_leases')) { - directorLockOrder.push('activity') - } else if (sql.includes('FROM relay_cells ORDER BY')) { - directorLockOrder.push('cell-inventory') - } else if (sql.includes('FROM relay_cells WHERE cell_id IN')) { - directorLockOrder.push('cell-rows') - } else if (sql.includes('FROM relay_cells WHERE cell_id = ?')) { - directorLockOrder.push('cell') - } - } - if ( - signalFirstAttempt && - phase === 'after' && - sql.includes('FROM relay_assignments WHERE user_id = ?') - ) { - signalFirstAttempt = false - directorAssignmentLocked.resolve() - } - }) - const store = new RelayAssignmentStore(assignmentDatabase, () => now) - - await expect(store.assign(identity)).resolves.toMatchObject({ - cellId: cell.id, - assignmentEpoch: 1 - }) - await expect(legacyTransaction).resolves.toBeUndefined() - expect(assignmentDatabase.attempts).toBe(2) - // The retry still takes a cell row before the assignment row — the order - // that avoids the legacy cycle — but only the pinned row, never the - // inventory. - expect(directorLockOrder).toEqual([ - 'assignment', - 'activity', - 'cell', - 'cell-rows', - 'assignment', - 'activity' - ]) - const state = await database.query( - `SELECT assignment.reserved_controls, assignment.migration_leases, - cell.reserved_requests - FROM relay_assignments assignment - JOIN relay_cells cell ON cell.cell_id = assignment.cell_id - WHERE assignment.user_id = ? AND assignment.relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - expect(state).toEqual([ - { reserved_controls: '1', migration_leases: '1', reserved_requests: '2' } - ]) - }, 15_000) - - it('serializes normalized assignment and activity release without a retry', async () => { - const now = 1_200_000_000_000 - const identity = { userId: 'normalized-order-user', relayHostId: 'normalizedorder1' } - const cellId = 'normalized-order-cell' - const activityId = 'splice:normalized-order' - await database.query( - `DELETE FROM relay_assignment_activity_leases WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - await database.query(`DELETE FROM relay_assignments WHERE user_id = ? AND relay_host_id = ?`, [ - identity.userId, - identity.relayHostId - ]) - const seedStore = new RelayAssignmentStore(database, () => now) - await seedStore.reconcileCells([ - { id: cellId, url: 'https://normalized-order.example.com', capacityRequests: 100 } - ]) - await seedStore.assign(identity) - await seedStore.acquireActivity(identity, { activityId, kind: 'splice', cellId }) - - const assignmentLocked = signal() - const releaseReachedAssignment = signal() - const continueAssignment = signal() - let gateFirstAssignmentAttempt = true - const assignDatabase = new TransactionProbeDatabase(database, async (phase, sql) => { - if ( - gateFirstAssignmentAttempt && - phase === 'after' && - sql.includes('FROM relay_assignments') - ) { - gateFirstAssignmentAttempt = false - assignmentLocked.resolve() - await continueAssignment.promise - } - }) - const releaseDatabase = new TransactionProbeDatabase(database, async (phase, sql) => { - if (phase === 'before' && sql.includes('FROM relay_assignments')) { - releaseReachedAssignment.resolve() - } - }) - const assignStore = new RelayAssignmentStore(assignDatabase, () => now) - const releaseStore = new RelayAssignmentStore(releaseDatabase, () => now) - - const assign = assignStore.assign(identity) - await assignmentLocked.promise - const release = releaseStore.releaseActivity(identity, activityId) - await releaseReachedAssignment.promise - continueAssignment.resolve() - await Promise.all([assign, release]) - - expect(assignDatabase.attempts).toBe(1) - expect(releaseDatabase.attempts).toBe(1) - const state = await database.query( - `SELECT assignment.reserved_controls, assignment.reserved_splices, - cell.reserved_requests - FROM relay_assignments assignment - JOIN relay_cells cell ON cell.cell_id = assignment.cell_id - WHERE assignment.user_id = ? AND assignment.relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - expect(state).toEqual([ - { reserved_controls: '1', reserved_splices: '0', reserved_requests: '1' } - ]) - }, 15_000) - it('takes the shared cell lock only for the final atomic activity write', async () => { const now = 1_250_000_000_000 const cell = { @@ -734,84 +435,6 @@ describePostgres('PostgreSQL transaction recovery', () => { ]) }, 15_000) - it('reconciles drift under the assignment-first lock order while activity waits', async () => { - const now = 1_300_000_000_000 - const cells = [ - { id: 'reconcile-cell-a', url: 'https://reconcile-a.example.com', capacityRequests: 100 }, - { id: 'reconcile-cell-b', url: 'https://reconcile-b.example.com', capacityRequests: 100 } - ] - const identities = Array.from({ length: 12 }, (_, index) => ({ - userId: `reconcile-user-${index}`, - relayHostId: `reconcilehost${String(index).padStart(4, '0')}` - })) - const seedStore = new RelayAssignmentStore(database, () => now) - await seedStore.reconcileCells(cells) - for (const identity of identities) await seedStore.assign(identity) - await database.query( - `UPDATE relay_assignments SET reserved_controls = 7, reserved_splices = 5 - WHERE user_id LIKE 'reconcile-user-%'` - ) - await database.query( - `UPDATE relay_cells SET reserved_requests = 42 - WHERE cell_id IN (?, ?)`, - ['reconcile-cell-a', 'reconcile-cell-b'] - ) - - const assignmentsLocked = signal() - const activityReachedAssignment = signal() - const continueReconciliation = signal() - let gateReconciliation = true - const reconcileDatabase = new TransactionProbeDatabase(database, async (phase, sql) => { - if ( - gateReconciliation && - phase === 'after' && - sql.includes('SELECT assignment.* FROM relay_assignments assignment') - ) { - gateReconciliation = false - assignmentsLocked.resolve() - await continueReconciliation.promise - } - }) - const activityDatabase = new TransactionProbeDatabase(database, async (phase, sql) => { - if (phase === 'before' && sql.includes('FROM relay_assignments WHERE user_id')) { - activityReachedAssignment.resolve() - } - }) - const reconcileStore = new RelayAssignmentStore(reconcileDatabase, () => now) - const activityStore = new RelayAssignmentStore(activityDatabase, () => now) - - const reconciliation = reconcileStore.cellEvacuationStatus( - 'reconcile-cell-a', - 'reconcile-cell-b', - true - ) - await assignmentsLocked.promise - const activity = activityStore.acquireActivity(identities[0]!, { - activityId: 'splice:reconcile', - kind: 'splice', - cellId: 'reconcile-cell-a' - }) - await activityReachedAssignment.promise - continueReconciliation.resolve() - await Promise.all([reconciliation, activity]) - - expect(reconcileDatabase.attempts).toBe(1) - expect(activityDatabase.attempts).toBe(1) - const reservations = await database.query( - `SELECT cell.cell_id, cell.reserved_requests, - COALESCE(SUM(lease.request_units), 0) AS lease_units - FROM relay_cells cell - LEFT JOIN relay_assignment_activity_leases lease ON lease.cell_id = cell.cell_id - WHERE cell.cell_id IN (?, ?) - GROUP BY cell.cell_id, cell.reserved_requests ORDER BY cell.cell_id`, - ['reconcile-cell-a', 'reconcile-cell-b'] - ) - expect(reservations).toEqual([ - { cell_id: 'reconcile-cell-a', reserved_requests: '8', lease_units: '8' }, - { cell_id: 'reconcile-cell-b', reserved_requests: '6', lease_units: '6' } - ]) - }, 15_000) - it('keeps a unit placed between reconciliation reading leases and locking cells', async () => { const now = 1_350_000_000_000 const cells = [ @@ -945,529 +568,4 @@ describePostgres('PostgreSQL transaction recovery', () => { ).resolves.toMatchObject({ inProgress: 0 }) }, 15_000) - it('defers completion instead of deadlocking with a legacy cell-first lock', async () => { - const now = 1_500_000_000_000 - const identity = { - userId: 'completion-contention-user', - relayHostId: 'completionwait01' - } - const sourceCell = { - id: 'completion-contention-source', - url: 'https://completion-contention-source.example.com', - capacityRequests: 100 - } - const targetCell = { - id: 'completion-contention-target', - url: 'https://completion-contention-target.example.com', - capacityRequests: 100 - } - const store = new RelayAssignmentStore(database, () => now, { - requireLiveCells: true - }) - await store.reconcileCells([sourceCell, targetCell]) - await store.recordCellHeartbeat({ - cellId: sourceCell.id, - cellUrl: sourceCell.url, - cellIncarnation: '11111111-1111-4111-8111-111111111111', - startedAt: now - 100, - ready: true, - observedRequests: 0 - }) - await store.recordCellHeartbeat({ - cellId: targetCell.id, - cellUrl: targetCell.url, - cellIncarnation: '22222222-2222-4222-8222-222222222222', - startedAt: now - 100, - ready: true, - observedRequests: 0 - }) - const assignment = await store.assign(identity) - const sourceControl = await store.activateControl(identity, { - cellId: sourceCell.id, - assignmentEpoch: assignment.assignmentEpoch, - generation: 1 - }) - const migration = await store.startEvacuation(identity, targetCell.id) - await store.activateControl(identity, { - cellId: targetCell.id, - assignmentEpoch: migration.assignmentEpoch, - generation: 1 - }) - await store.markMigrationTargetRegistered(identity, { - cellId: targetCell.id, - assignmentEpoch: migration.assignmentEpoch - }) - await store.releaseActivity(identity, sourceControl) - await store.setCellEnabled(sourceCell.id, false) - - const legacyCellLocked = signal() - const completionAssignmentLocked = signal() - const legacyTransaction = database.transaction(async (transaction) => { - await transaction.queryLocked(`SELECT * FROM relay_cells WHERE cell_id = ?`, [ - sourceCell.id - ]) - legacyCellLocked.resolve() - await completionAssignmentLocked.promise - await transaction.queryLocked( - `SELECT * FROM relay_assignments WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - }) - await legacyCellLocked.promise - - let signalCompletion = true - const completionDatabase = new TransactionProbeDatabase( - database, - async (phase, sql) => { - if ( - signalCompletion && - phase === 'after' && - sql.includes('FROM relay_assignments WHERE user_id') - ) { - signalCompletion = false - completionAssignmentLocked.resolve() - } - } - ) - const completionStore = new RelayAssignmentStore(completionDatabase, () => now, { - requireLiveCells: true - }) - const warn = vi.spyOn(console, 'warn').mockImplementation(() => undefined) - - await expect(completionStore.completeReadyEvacuations()).resolves.toBe(0) - await expect(legacyTransaction).resolves.toBeUndefined() - expect(warn).not.toHaveBeenCalledWith( - expect.stringContaining('orca_relay_postgres_transaction_retry') - ) - await expect(store.completeReadyEvacuations()).resolves.toBe(1) - }, 15_000) - - it('normalizes persistent dead-source inventory contention', async () => { - let now = 1_550_000_000_000 - const identity = { - userId: 'dead-source-contention-user', - relayHostId: 'deadsourcewait01' - } - const secondIdentity = { - userId: identity.userId, - relayHostId: 'deadsourcewait02' - } - const sourceCell = { - id: 'dead-source-contention-source', - url: 'https://dead-source-contention-source.example.com', - capacityRequests: 100 - } - const targetCell = { - id: 'dead-source-contention-target', - url: 'https://dead-source-contention-target.example.com', - capacityRequests: 100 - } - const sourceIncarnation = '11111111-1111-4111-8111-111111111111' - const targetIncarnation = '22222222-2222-4222-8222-222222222222' - const store = new RelayAssignmentStore(database, () => now, { - requireLiveCells: true - }) - await store.reconcileCells([sourceCell, targetCell]) - await store.setCellEnabled(targetCell.id, false) - await store.recordCellHeartbeat({ - cellId: sourceCell.id, - cellUrl: sourceCell.url, - cellIncarnation: sourceIncarnation, - startedAt: now - 100, - ready: true, - observedRequests: 0 - }) - await store.recordCellHeartbeat({ - cellId: targetCell.id, - cellUrl: targetCell.url, - cellIncarnation: targetIncarnation, - startedAt: now - 100, - ready: true, - observedRequests: 0 - }) - const assignment = await store.assign(identity) - const sourceControl = await store.activateControl(identity, { - cellId: sourceCell.id, - assignmentEpoch: assignment.assignmentEpoch, - generation: 1 - }) - await store.setCellEnabled(targetCell.id, true) - const migration = await store.startEvacuation(identity, targetCell.id) - await store.activateControl(identity, { - cellId: targetCell.id, - assignmentEpoch: migration.assignmentEpoch, - generation: 1 - }) - await store.markMigrationTargetRegistered(identity, { - cellId: targetCell.id, - assignmentEpoch: migration.assignmentEpoch - }) - await store.releaseActivity(identity, sourceControl) - const secondAssignment = await store.assign(secondIdentity) - expect(secondAssignment.cellId).toBe(sourceCell.id) - const secondSourceControl = await store.activateControl(secondIdentity, { - cellId: sourceCell.id, - assignmentEpoch: secondAssignment.assignmentEpoch, - generation: 1 - }) - const secondMigration = await store.startEvacuation(secondIdentity, targetCell.id) - await store.activateControl(secondIdentity, { - cellId: targetCell.id, - assignmentEpoch: secondMigration.assignmentEpoch, - generation: 1 - }) - await store.markMigrationTargetRegistered(secondIdentity, { - cellId: targetCell.id, - assignmentEpoch: secondMigration.assignmentEpoch - }) - await store.releaseActivity(secondIdentity, secondSourceControl) - await store.setCellEnabled(sourceCell.id, false) - now += 45_001 - await store.recordCellHeartbeat({ - cellId: targetCell.id, - cellUrl: targetCell.url, - cellIncarnation: targetIncarnation, - startedAt: now - 45_101, - ready: true, - observedRequests: 0 - }) - await store.attestCellFence(sourceCell.id, sourceIncarnation) - - const legacyCellLocked = signal() - const completionAssignmentLocked = signal() - const legacyTransaction = database.transaction(async (transaction) => { - await transaction.queryLocked(`SELECT * FROM relay_cells WHERE cell_id = ?`, [ - sourceCell.id - ]) - legacyCellLocked.resolve() - await completionAssignmentLocked.promise - await transaction.queryLocked( - `SELECT * FROM relay_assignments WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - }) - await legacyCellLocked.promise - - let signalCompletion = true - const fallbackInventoryLocked = signal() - const freshAssignmentLocked = signal() - const persistentInventoryLocked = signal() - let releasePersistentInventory = false - const completionDatabase = new TransactionProbeDatabase( - database, - async (phase, sql) => { - if ( - signalCompletion && - phase === 'after' && - sql.includes('FROM relay_assignments WHERE user_id') - ) { - signalCompletion = false - completionAssignmentLocked.resolve() - } else if ( - phase === 'after' && - sql.trim() === 'SELECT * FROM relay_cells ORDER BY cell_id ASC' - ) { - fallbackInventoryLocked.resolve() - await freshAssignmentLocked.promise - } - } - ) - const completionStore = new RelayAssignmentStore(completionDatabase, () => now, { - requireLiveCells: true - }) - const freshAssignmentTransaction = database.transaction(async (transaction) => { - await fallbackInventoryLocked.promise - await transaction.queryLocked( - `SELECT * FROM relay_assignments WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - freshAssignmentLocked.resolve() - await transaction.queryLocked(`SELECT * FROM relay_cells ORDER BY cell_id ASC`) - persistentInventoryLocked.resolve() - while (!releasePersistentInventory) { - await new Promise((resolve) => setTimeout(resolve, 250)) - await transaction.query(`SELECT 1`) - } - }) - - const completion = completionStore.cellEvacuationStatus( - sourceCell.id, - targetCell.id, - true - ) - await persistentInventoryLocked.promise - await expect( - completion - ).resolves.toMatchObject({ inProgress: 2, completed: 0, blocked: 2 }) - await expect(legacyTransaction).resolves.toBeUndefined() - releasePersistentInventory = true - await expect(freshAssignmentTransaction).resolves.toBeUndefined() - await expect( - store.cellEvacuationStatus(sourceCell.id, targetCell.id, true) - ).resolves.toMatchObject({ inProgress: 0, completed: 2, blocked: 0 }) - }, 25_000) - - it('defers expired lease cleanup around a legacy cell-first lock', async () => { - const now = 1_600_000_000_000 - const identity = { - userId: 'lease-contention-user', - relayHostId: 'leasecontention1' - } - const cell = { - id: 'lease-contention-cell', - url: 'https://lease-contention-cell.example.com', - capacityRequests: 100 - } - const store = new RelayAssignmentStore(database, () => now) - await store.reconcileCells([cell]) - await store.assign(identity) - await database.query( - `UPDATE relay_assignment_activity_leases SET expires_at = ? - WHERE user_id = ? AND relay_host_id = ?`, - [now - 1, identity.userId, identity.relayHostId] - ) - - const legacyCellLocked = signal() - const cleanupAssignmentLocked = signal() - const legacyTransaction = database.transaction(async (transaction) => { - await transaction.queryLocked(`SELECT * FROM relay_cells WHERE cell_id = ?`, [cell.id]) - legacyCellLocked.resolve() - await cleanupAssignmentLocked.promise - await transaction.queryLocked( - `SELECT * FROM relay_assignments WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - }) - await legacyCellLocked.promise - - let signalCleanup = true - const cleanupDatabase = new TransactionProbeDatabase(database, async (phase, sql) => { - if ( - signalCleanup && - phase === 'after' && - sql.includes('FROM relay_assignments WHERE user_id') - ) { - signalCleanup = false - cleanupAssignmentLocked.resolve() - } - }) - const cleanupStore = new RelayAssignmentStore(cleanupDatabase, () => now) - const warn = vi.spyOn(console, 'warn').mockImplementation(() => undefined) - - await expect(cleanupStore.releaseExpiredActivityLeases()).resolves.toBe(0) - await expect(legacyTransaction).resolves.toBeUndefined() - expect(cleanupDatabase.attempts).toBe(1) - expect(warn).not.toHaveBeenCalledWith( - expect.stringContaining('orca_relay_postgres_transaction_retry') - ) - await expect(store.releaseExpiredActivityLeases()).resolves.toBe(1) - }, 15_000) - - it('skips an expired lease when another director owns its assignment lock', async () => { - const now = 1_650_000_000_000 - const identity = { - userId: 'lease-assignment-contention-user', - relayHostId: 'leaseassignment1' - } - const cell = { - id: 'lease-assignment-contention-cell', - url: 'https://lease-assignment-contention-cell.example.com', - capacityRequests: 100 - } - const store = new RelayAssignmentStore(database, () => now) - await store.reconcileCells([cell]) - await store.assign(identity) - await database.query( - `UPDATE relay_assignment_activity_leases SET expires_at = ? - WHERE user_id = ? AND relay_host_id = ?`, - [now - 1, identity.userId, identity.relayHostId] - ) - - const assignmentLocked = signal() - const releaseAssignment = signal() - const legacyTransaction = database.transaction(async (transaction) => { - await transaction.queryLocked( - `SELECT * FROM relay_assignments WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - assignmentLocked.resolve() - await releaseAssignment.promise - }) - await assignmentLocked.promise - - const cleanupDatabase = new TransactionProbeDatabase(database, async () => undefined) - const cleanupStore = new RelayAssignmentStore(cleanupDatabase, () => now) - const warn = vi.spyOn(console, 'warn').mockImplementation(() => undefined) - - await expect(cleanupStore.releaseExpiredActivityLeases()).resolves.toBe(0) - expect(cleanupDatabase.attempts).toBe(1) - expect(warn).not.toHaveBeenCalledWith( - expect.stringContaining('orca_relay_postgres_transaction_retry') - ) - warn.mockRestore() - - releaseAssignment.resolve() - await expect(legacyTransaction).resolves.toBeUndefined() - await expect(store.releaseExpiredActivityLeases()).resolves.toBe(1) - }, 15_000) - - it('defers aggregate expiry cleanup around a legacy cell-first lock', async () => { - const now = 1_700_000_000_000 - const identity = { - userId: 'aggregate-contention-user', - relayHostId: 'aggregatewait01' - } - const cell = { - id: 'aggregate-contention-cell', - url: 'https://aggregate-contention-cell.example.com', - capacityRequests: 100 - } - const store = new RelayAssignmentStore(database, () => now) - await store.reconcileCells([cell]) - await store.assign(identity) - await database.query( - `DELETE FROM relay_assignment_activity_leases - WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - await database.query( - `UPDATE relay_assignments SET lease_expires_at = ? - WHERE user_id = ? AND relay_host_id = ?`, - [now - 1, identity.userId, identity.relayHostId] - ) - - const legacyCellLocked = signal() - const cleanupAssignmentsLocked = signal() - const legacyTransaction = database.transaction(async (transaction) => { - await transaction.queryLocked(`SELECT * FROM relay_cells WHERE cell_id = ?`, [cell.id]) - legacyCellLocked.resolve() - await cleanupAssignmentsLocked.promise - await transaction.queryLocked( - `SELECT * FROM relay_assignments WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - }) - await legacyCellLocked.promise - - let signalCleanup = true - const cleanupDatabase = new TransactionProbeDatabase(database, async (phase, sql) => { - if ( - signalCleanup && - phase === 'after' && - sql.includes('FROM relay_assignments WHERE lease_expires_at') - ) { - signalCleanup = false - cleanupAssignmentsLocked.resolve() - } - }) - const cleanupStore = new RelayAssignmentStore(cleanupDatabase, () => now) - const warn = vi.spyOn(console, 'warn').mockImplementation(() => undefined) - - await expect(cleanupStore.releaseExpiredActivity()).resolves.toBe(0) - await expect(legacyTransaction).resolves.toBeUndefined() - expect(cleanupDatabase.attempts).toBe(1) - expect(warn).not.toHaveBeenCalledWith( - expect.stringContaining('orca_relay_postgres_transaction_retry') - ) - await expect(store.releaseExpiredActivity()).resolves.toBe(1) - }, 15_000) - - it('defers aggregate expiry before waiting on a legacy assignment row', async () => { - const now = 1_700_000_000_000 - const identity = { - userId: 'aggregate-contention-user', - relayHostId: 'aggregatewait01' - } - const cell = { - id: 'aggregate-contention-cell', - url: 'https://aggregate-contention-cell.example.com', - capacityRequests: 100 - } - const store = new RelayAssignmentStore(database, () => now) - await store.reconcileCells([cell]) - await store.assign(identity) - await database.query( - `DELETE FROM relay_assignment_activity_leases - WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - await database.query( - `UPDATE relay_assignments SET lease_expires_at = ? - WHERE user_id = ? AND relay_host_id = ?`, - [now - 1, identity.userId, identity.relayHostId] - ) - - const legacyAssignmentLocked = signal() - const releaseLegacyAssignment = signal() - const legacyTransaction = database.transaction(async (transaction) => { - await transaction.queryLocked( - `SELECT * FROM relay_assignments WHERE user_id = ? AND relay_host_id = ?`, - [identity.userId, identity.relayHostId] - ) - legacyAssignmentLocked.resolve() - await releaseLegacyAssignment.promise - }) - await legacyAssignmentLocked.promise - - const timedOut = Symbol('timed-out') - const cleanup = store.releaseExpiredActivity() - const result = await Promise.race([ - cleanup, - new Promise((resolve) => { - setTimeout(() => resolve(timedOut), 750) - }) - ]) - releaseLegacyAssignment.resolve() - await legacyTransaction - if (result === timedOut) await cleanup - - expect(result).toBe(0) - await expect(store.releaseExpiredActivity()).resolves.toBe(1) - }, 15_000) - - it('keeps concurrent dormant reassignments capacity-consistent', async () => { - const now = 1_000_000_000_000 - const serializedDatabase = new TransactionProbeDatabase(database, async () => undefined) - const store = new RelayAssignmentStore(serializedDatabase, () => now) - await database.query( - `DELETE FROM relay_assignment_activity_leases WHERE user_id LIKE 'postgres-user-%'` - ) - await database.query(`DELETE FROM relay_assignments WHERE user_id LIKE 'postgres-user-%'`) - await database.query(`DELETE FROM relay_cells WHERE cell_id IN (?, ?, ?)`, [ - 'cell-a', - 'cell-b', - 'cell-c' - ]) - await store.reconcileCells([ - { id: 'cell-a', url: 'https://cell-a.example.com', capacityRequests: 100 }, - { id: 'cell-b', url: 'https://cell-b.example.com', capacityRequests: 100 }, - { id: 'cell-c', url: 'https://cell-c.example.com', capacityRequests: 100 } - ]) - const identities = Array.from({ length: 30 }, (_, index) => ({ - userId: `postgres-user-${index}`, - relayHostId: `postgreshost${String(index).padStart(5, '0')}` - })) - await Promise.all(identities.map(async (identity) => await store.assign(identity))) - - await database.query(`DELETE FROM relay_assignment_activity_leases`) - await database.query( - `UPDATE relay_assignments SET lease_expires_at = ?, last_activity_at = ?, - reserved_controls = 0, reserved_splices = 0, reserved_invites = 0, - pending_installs = 0, pending_confirmations = 0, migration_leases = 0`, - [0, 0] - ) - await database.query(`UPDATE relay_cells SET reserved_requests = 0`) - - await Promise.all(identities.map(async (identity) => await store.assign(identity))) - - const reservations = await database.query( - `SELECT cell_id, reserved_requests FROM relay_cells ORDER BY cell_id` - ) - expect(reservations).toEqual([ - { cell_id: 'cell-a', reserved_requests: '10' }, - { cell_id: 'cell-b', reserved_requests: '10' }, - { cell_id: 'cell-c', reserved_requests: '10' } - ]) - }, 10_000) - }) diff --git a/cloud/packages/connector-contract/src/contract.test.ts b/cloud/packages/connector-contract/src/contract.test.ts index 4da1296a902..35900489850 100644 --- a/cloud/packages/connector-contract/src/contract.test.ts +++ b/cloud/packages/connector-contract/src/contract.test.ts @@ -50,35 +50,4 @@ describe('hello and replies', () => { expect(hello.features).toEqual(['answer', 'future-feature']) expect(hello.sources).toEqual(['slack', 'future-source']) }) - - it('caps a hello at maxHelloProjects projects with short display strings', () => { - const project = (name: string) => ({ - placeId: 'pl_1', - name, - kind: 'folder', - where: { kind: 'local' } - }) - const hello = (projects: unknown[]) => - ConnectorHelloRequestSchema.safeParse({ - v: 1, - contract: 1, - orcaVersion: '1.4.230', - platform: 'linux', - runtime: 'desktop', - hostName: 'build-box', - agents: ['claude'], - promptKinds: [], - features: [], - sources: ['slack'], - projects - }).success - const longest = 'x'.repeat(CONNECTOR_LIMITS.maxDisplayTextLength) - expect( - hello(Array.from({ length: CONNECTOR_LIMITS.maxHelloProjects }, () => project(longest))) - ).toBe(true) - expect(hello([project(`${longest}x`)])).toBe(false) - expect( - hello(Array.from({ length: CONNECTOR_LIMITS.maxHelloProjects + 1 }, () => project('orca'))) - ).toBe(false) - }) }) diff --git a/cloud/packages/relay-contract/src/contract.test.ts b/cloud/packages/relay-contract/src/contract.test.ts index 2c663b4388a..08c40c72f2d 100644 --- a/cloud/packages/relay-contract/src/contract.test.ts +++ b/cloud/packages/relay-contract/src/contract.test.ts @@ -1,6 +1,4 @@ import { describe, expect, it } from 'vitest' -import { HostHelloAckSchema } from './control-messages.js' -import { isTrustedNewerMove, RelayMovedSchema } from './director-messages.js' import { buildHostChallengePlaintext, buildHostProofMacInput, @@ -8,29 +6,6 @@ import { } from './host-proof-transcript.js' describe('relay protocol contract', () => { - - it('accepts moves only from the configured director at a strictly newer epoch', () => { - const move = RelayMovedSchema.parse({ - v: 1, - cellUrl: 'https://relay-c2.onorca.dev', - assignmentEpoch: 4 - }) - const base = { - configuredDirectorOrigin: 'https://relay.onorca.dev', - currentAssignmentEpoch: 3, - move - } - expect(isTrustedNewerMove({ ...base, sourceOrigin: 'https://relay.onorca.dev' })).toBe(true) - expect(isTrustedNewerMove({ ...base, sourceOrigin: move.cellUrl })).toBe(false) - expect( - isTrustedNewerMove({ - ...base, - sourceOrigin: 'https://relay.onorca.dev', - currentAssignmentEpoch: 4 - }) - ).toBe(false) - }) - it('locks the complete host key-possession transcript', () => { const transcript = buildHostProofTranscript({ relayOrigin: 'https://relay.onorca.dev', @@ -89,29 +64,3 @@ describe('relay protocol contract', () => { ).toThrow('challengeNonce must be 24 bytes') }) }) - -describe('pending connection details capability', () => { - it('reads a pending entry with or without the stated kind and device', () => { - const ack = { - v: 1 as const, - generation: 3, - controlResumeSecret: 'R'.repeat(43), - leaseExpiresAt: 1_800_000_000_000, - activeConnIds: [] - } - const identifiers = { connId: 'conn-1', connTicket: 'T'.repeat(43) } - expect(HostHelloAckSchema.safeParse({ ...ack, pendingConns: [identifiers] }).success).toBe(true) - expect( - HostHelloAckSchema.safeParse({ - ...ack, - pendingConns: [{ ...identifiers, kind: 'resume', relayDeviceId: 'device-1' }] - }).success - ).toBe(true) - expect( - HostHelloAckSchema.safeParse({ - ...ack, - pendingConns: [{ ...identifiers, reservationId: 'injected' }] - }).success - ).toBe(false) - }) -}) diff --git a/cloud/packages/relay-contract/src/idle-regional-rehome.test.ts b/cloud/packages/relay-contract/src/idle-regional-rehome.test.ts index 7303596c7d0..be9ee717221 100644 --- a/cloud/packages/relay-contract/src/idle-regional-rehome.test.ts +++ b/cloud/packages/relay-contract/src/idle-regional-rehome.test.ts @@ -2,22 +2,9 @@ import { describe, expect, it } from 'vitest' import { IdleRegionalRehomeResponseSchema } from './idle-regional-rehome.js' describe('idle regional rehome response', () => { - it('accepts a source cell that has never heard of the reason field', () => { - expect(IdleRegionalRehomeResponseSchema.parse({ v: 1, outcome: 'deferred' })).toEqual({ - v: 1, - outcome: 'deferred' - }) - }) - it('reads a reason it does not know as absent instead of failing the response', () => { expect( IdleRegionalRehomeResponseSchema.parse({ v: 1, outcome: 'deferred', reason: 'from-a-newer-cell' }) ).toEqual({ v: 1, outcome: 'deferred' }) }) - - it('drops a field added after this decoder shipped', () => { - expect( - IdleRegionalRehomeResponseSchema.parse({ v: 1, outcome: 'committed', movedAt: 17 }) - ).toEqual({ v: 1, outcome: 'committed' }) - }) }) diff --git a/cloud/packages/relay-contract/src/persistence-invariants.test.ts b/cloud/packages/relay-contract/src/persistence-invariants.test.ts index 204c8ce0062..c94ed8d2bc1 100644 --- a/cloud/packages/relay-contract/src/persistence-invariants.test.ts +++ b/cloud/packages/relay-contract/src/persistence-invariants.test.ts @@ -1,53 +1,9 @@ import { describe, expect, it } from 'vitest' -import { hasAdmissionCapacity } from './admission-budgets.js' import { decideResumeCommit, TokenFamilySchema } from './persistence-invariants.js' const HASH = 'abcdefghijklmnopqrstuvwxyzABCDEFGH012345678' describe('relay persistence invariants', () => { - it('admits pre-auth sockets only outside every reserved budget', () => { - expect( - hasAdmissionCapacity({ - totalRequests: 649, - preAuthConnections: 44, - sourcePreAuthConnections: 3 - }) - ).toBe(true) - expect( - hasAdmissionCapacity({ - totalRequests: 650, - preAuthConnections: 0, - sourcePreAuthConnections: 0 - }) - ).toBe(false) - expect( - hasAdmissionCapacity({ - totalRequests: 0, - preAuthConnections: 45, - sourcePreAuthConnections: 0 - }) - ).toBe(false) - expect( - hasAdmissionCapacity({ totalRequests: 0, preAuthConnections: 0, sourcePreAuthConnections: 4 }) - ).toBe(false) - expect( - hasAdmissionCapacity({ - totalRequests: 2_899, - preAuthConnections: 0, - sourcePreAuthConnections: 0, - totalRequestCeiling: 2_900 - }) - ).toBe(true) - expect( - hasAdmissionCapacity({ - totalRequests: 2_900, - preAuthConnections: 0, - sourcePreAuthConnections: 0, - totalRequestCeiling: 2_900 - }) - ).toBe(false) - }) - it('makes commit-time current, grace, retired, expired, and revoked outcomes exact', () => { const family = TokenFamilySchema.parse({ currentVersion: 3, diff --git a/config/build-plugins/bootstrap-fatal-exit-banner.ts b/config/build-plugins/bootstrap-fatal-exit-banner.ts index 8a8359da9db..36120dd2637 100644 --- a/config/build-plugins/bootstrap-fatal-exit-banner.ts +++ b/config/build-plugins/bootstrap-fatal-exit-banner.ts @@ -1,4 +1,4 @@ -import { BOOTSTRAP_FATAL_EXIT_GUARD_KEY } from '../../src/main/startup/bootstrap-fatal-exit-guard' +import { BOOTSTRAP_FATAL_EXIT_GUARD_KEY } from '../../src/main/startup/process-failure/bootstrap-fatal-exit-guard' export const BOOTSTRAP_FATAL_LOG_ENV_VAR = 'ORCA_BOOTSTRAP_FATAL_LOG' export const BOOTSTRAP_FATAL_LOG_FILE_NAME = 'bootstrap-fatal.log' const BOOTSTRAP_FATAL_LOG_MAX_BYTES = 262_144 diff --git a/config/build-plugins/cli-main-entry-names.ts b/config/build-plugins/cli-main-entry-names.ts index a5489423531..4285cbae0d9 100644 --- a/config/build-plugins/cli-main-entry-names.ts +++ b/config/build-plugins/cli-main-entry-names.ts @@ -11,7 +11,9 @@ export const CLI_MAIN_ENTRY_NAMES = [ 'filesystem/macos-tree-clone', 'orcad/orcad-stale-lock-reclaim', 'orcad/orcad-host-identity-reset', - 'plugins/plugin-authoring-checks', + 'plugins/plugin-artifact-validation', + 'plugins/plugin-content-hash', + 'plugins/plugin-catalog-release-entry', // `orca vm env doctor` runs its checks in the CLI process. 'environment-doctor/environment-doctor', 'environment-doctor/environment-doctor-host', @@ -25,5 +27,5 @@ export const CLI_MAIN_ENTRY_NAMES = [ 'persistence/profile-state/recovery/profile-state-recovery-command', 'persistence/profile-state/legacy-json/profile-state-export-path', 'persistence/profile-state/legacy-json/profile-state-recovery', - 'startup/http1-compatibility-marker' + 'startup/network-compatibility/http1-compatibility-marker' ] as const diff --git a/config/docker/cli-launch-contract/run-cli-case.sh b/config/docker/cli-launch-contract/run-cli-case.sh index 3293601f22f..9ec52f8db61 100755 --- a/config/docker/cli-launch-contract/run-cli-case.sh +++ b/config/docker/cli-launch-contract/run-cli-case.sh @@ -32,18 +32,11 @@ fi case "$case_name" in # The bundled launcher must stay in Electron's node mode. - nofuse-userns-bundled-help) command=("$launcher" --help) ;; - nofuse-userns-bundled-version) command=("$launcher" --version) ;; nofuse-userns-bundled-status) command=("$launcher" status) ;; - nofuse-userns-bundled-skills) command=("$launcher" skills --help) ;; - nofuse-userns-bundled-worktree) command=("$launcher" worktree list) ;; # Direct binaries must hand off before Ozone initializes. nofuse-nosandbox-direct-binary-skills) command=("$extracted_root/orca-ide" --no-sandbox skills --help) ;; - nofuse-nosandbox-direct-binary-gui) - command=("$extracted_root/orca-ide" --no-sandbox) - ;; stale-display-nosandbox-direct-binary-gui) command=("$extracted_root/orca-ide" --no-sandbox) ;; @@ -62,15 +55,6 @@ if ((status == 124)); then exit 94 fi -if [[ "$case_name" == nofuse-userns-bundled-version ]]; then - version_file="$extracted_root/resources/app.asar.unpacked/out/package.json" - expected_version=$(sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$version_file") - if [[ -z "$expected_version" || "$output" != "$expected_version" ]]; then - output="VERSION_MISMATCH expected=${expected_version:-missing} got=$output" - status=93 - fi -fi - # Shell signal exits are reported as 128 plus the signal number. if ((status >= 128)); then echo "CRASHED status=$status case=$case_name" diff --git a/config/electron-builder.config.cjs b/config/electron-builder.config.cjs index 2df9f8177df..1c5b06c5ed3 100644 --- a/config/electron-builder.config.cjs +++ b/config/electron-builder.config.cjs @@ -348,14 +348,16 @@ module.exports = { 'out/main/filesystem/macos-tree-clone.js', 'out/main/orca-profiles/profile-index-store.js', 'out/main/persistence/profile-state/**', - 'out/main/plugins/plugin-authoring-checks.js', + 'out/main/plugins/plugin-artifact-validation.js', + 'out/main/plugins/plugin-content-hash.js', + 'out/main/plugins/plugin-catalog-release-entry.js', 'out/main/environment-doctor/environment-doctor.js', 'out/main/environment-doctor/environment-doctor-host.js', // `orca plugin test` and `orca plugin check` load the runtime, kit and hooks in Node. 'resources/plugins/declarative/*.mjs', 'out/main/skills/bundled-skill-install/bundled-skill-local-host.js', 'out/main/skills/bundled-skill-install/bundled-skill-installation.js', - 'out/main/startup/http1-compatibility-marker.js', + 'out/main/startup/network-compatibility/http1-compatibility-marker.js', 'out/main/daemon-entry.js', 'out/main/session-scanner-service-entry.js', 'out/main/wsl-transcript-fs-process-entry.js', diff --git a/config/flaky-test-pattern-baseline.txt b/config/flaky-test-pattern-baseline.txt index ce332f797be..8d55d06937e 100644 --- a/config/flaky-test-pattern-baseline.txt +++ b/config/flaky-test-pattern-baseline.txt @@ -20,7 +20,7 @@ 1 test-no-in-test-import-actual:src/main/speech/openai-api-key-store.test.ts 5 test-no-in-test-import-actual:src/main/ssh/config/ssh-config-loader-regression.test.ts 2 test-no-in-test-import-actual:src/main/ssh/connection/ssh-connection-auth-fallback.test.ts -1 test-no-in-test-import-actual:src/main/window/dropped-path-preparation.test.ts +1 test-no-in-test-import-actual:src/main/window/file-drop/dropped-path-preparation.test.ts 2 test-no-in-test-import-actual:src/main/workspace-hooks/hooks-runner.test.ts 1 test-no-in-test-import-actual:src/main/workspaces/removal/local-worktree-removal-recovery.test.ts 1 test-no-in-test-import-actual:src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-hook-idle-arbitration.test.ts @@ -46,14 +46,13 @@ 1 test-no-polling-loop:src/main/pty/process-retirement/posix-pty-process-groups.integration.test.ts 1 test-no-polling-loop:src/main/pty/process-retirement/windows-live-tree-kill.win32.test.ts 1 test-no-polling-loop:src/main/runtime/orchestration/mailbox/terminal-pointer/orchestration-codex-real-pty.integration.test.ts -1 test-no-polling-loop:src/main/runtime/rpc/methods/agent-launch/agent-launch-restart-replay.test.ts 1 test-no-polling-loop:src/main/runtime/rpc/server/remote-runtime-request-connection.integration.test.ts 3 test-no-polling-loop:src/main/skills/install/skill-bundle-process-termination.integration.test.ts 2 test-no-polling-loop:src/main/skills/runtime-upload/skill-upload-process-restart.integration.test.ts 1 test-no-polling-loop:src/main/ssh/connection/ssh-connection-host-key-store-wiring.test.ts 1 test-no-polling-loop:src/main/ssh/legacy-relay/endpoints/ssh-relay-endpoint-incumbent-shell.integration.test.ts -2 test-no-polling-loop:src/main/startup/gpu-lifecycle-install-dir-acl-guard.test.ts -1 test-no-polling-loop:src/main/startup/run-electron-vite-dev.test.ts +2 test-no-polling-loop:src/main/startup/gpu-recovery/gpu-lifecycle-install-dir-acl-guard.test.ts +1 test-no-polling-loop:config/scripts/development/launch/run-electron-vite-dev.test.ts 2 test-no-polling-loop:src/main/windows/windows-host-job.win32.test.ts 1 test-no-polling-loop:src/main/windows/windows-pty-job.win32.test.ts 1 test-no-polling-loop:src/main/worker-thread-child-process/worker-thread-child-process.test.ts @@ -186,18 +185,12 @@ 5 test-no-real-time-wait:src/main/pty/process-retirement/windows-live-tree-kill.win32.test.ts 1 test-no-real-time-wait:src/main/runtime/agent-session/structured-agent-session-legacy-send-behind-command.test.ts 3 test-no-real-time-wait:src/main/runtime/orchestration/mailbox/terminal-pointer/orchestration-codex-real-pty.integration.test.ts -1 test-no-real-time-wait:src/main/runtime/rpc/methods/agent-launch/agent-launch-restart-replay.test.ts 1 test-no-real-time-wait:src/main/runtime/rpc/server/remote-runtime-request-connection.integration.test.ts -1 test-no-real-time-wait:src/main/runtime/rpc/server/runtime-rpc-long-poll-transport.test.ts -1 test-no-real-time-wait:src/main/runtime/rpc/terminal-subscribe-admission.test.ts -1 test-no-real-time-wait:src/main/runtime/rpc/terminal-subscribe-mounted-pane.test.ts -3 test-no-real-time-wait:src/main/runtime/rpc/terminal-subscribe-reconnect-rebind.test.ts -1 test-no-real-time-wait:src/main/runtime/rpc/ws-transport.test.ts +1 test-no-real-time-wait:src/main/runtime/rpc/terminal/terminal-subscribe-mounted-pane.test.ts 1 test-no-real-time-wait:src/main/runtime/terminal/recovery/layout-command-pane-starts-layout-owner.test.ts 1 test-no-real-time-wait:src/main/runtime/terminal/recovery/restored-pane-start-cli-handles.test.ts 1 test-no-real-time-wait:src/main/runtime/terminal/wait/launched-agent-crash-guard.live-shell.test.ts 1 test-no-real-time-wait:src/main/runtime/terminal/wait/launched-agent-shell-handoff-readiness.test.ts -2 test-no-real-time-wait:src/main/runtime/terminal/wait/tui-idle-name-only-real-pty.integration.test.ts 1 test-no-real-time-wait:src/main/runtime/workspaces/removal/owned-session-teardown-policy.test.ts 3 test-no-real-time-wait:src/main/runtime/workspaces/removal/worktree-teardown-unstopped-pty.test.ts 1 test-no-real-time-wait:src/main/skills/cloud/skill-cloud-direct-upload.test.ts @@ -205,12 +198,10 @@ 2 test-no-real-time-wait:src/main/skills/runtime-upload/skill-upload-process-restart.integration.test.ts 1 test-no-real-time-wait:src/main/ssh/connection/ssh-connection-host-key-store-wiring.test.ts 1 test-no-real-time-wait:src/main/ssh/legacy-relay/endpoints/ssh-relay-endpoint-incumbent-shell.integration.test.ts -2 test-no-real-time-wait:src/main/startup/gpu-lifecycle-install-dir-acl-guard.test.ts -3 test-no-real-time-wait:src/main/startup/run-electron-vite-dev.test.ts -2 test-no-real-time-wait:src/main/startup/windows-install-dir-acl-recovery.test.ts +2 test-no-real-time-wait:src/main/startup/gpu-recovery/gpu-lifecycle-install-dir-acl-guard.test.ts +3 test-no-real-time-wait:config/scripts/development/launch/run-electron-vite-dev.test.ts 1 test-no-real-time-wait:src/main/updater/lifecycle/serve-supervisor-install-park.test.ts -1 test-no-real-time-wait:src/main/updater/updater.quit-and-install.test.ts -1 test-no-real-time-wait:src/main/window/main-window-updater-deferred-setup.test.ts +1 test-no-real-time-wait:src/main/updater/lifecycle/main-window-updater-deferred-setup.test.ts 3 test-no-real-time-wait:src/main/windows/windows-host-job.win32.test.ts 1 test-no-real-time-wait:src/main/windows/windows-process-tree-command-line-patch.test.ts 2 test-no-real-time-wait:src/main/windows/windows-pty-job.win32.test.ts @@ -303,7 +294,7 @@ 1 test-no-real-time-wait:tests/e2e/markdown-table-row-backspace.spec.ts 1 test-no-real-time-wait:tests/e2e/native-chat-history-prepend-anchor.spec.ts 3 test-no-real-time-wait:tests/e2e/notification-sound-replay.spec.ts -5 test-no-real-time-wait:tests/e2e/orchestration-idle-mail-delivery.spec.ts +4 test-no-real-time-wait:tests/e2e/orchestration-idle-mail-delivery.spec.ts 1 test-no-real-time-wait:tests/e2e/orchestration-idle-mail-restore.spec.ts 4 test-no-real-time-wait:tests/e2e/paced-terminal-typing.ts 1 test-no-real-time-wait:tests/e2e/paired-client-hosted-browser-double-restart.spec.ts @@ -414,7 +405,6 @@ 2 test-no-wall-clock:src/main/ai-vault/scanners/cursor/session-scanner-cursor-chat-meta.test.ts 1 test-no-wall-clock:src/main/ai-vault/scanners/devin/session-scanner-devin-db.test.ts 2 test-no-wall-clock:src/main/ai-vault/scanners/grok/session-scanner-grok-parser.test.ts -1 test-no-wall-clock:src/main/ai-vault/scanners/kimi/session-scanner-kimi-parser.test.ts 1 test-no-wall-clock:src/main/ai-vault/scanners/opencode/reader-transport/session-scanner-opencode-sqlite-process.test.ts 2 test-no-wall-clock:src/main/ai-vault/scanners/opencode/session-scanner-opencode-parser.test.ts 2 test-no-wall-clock:src/main/antigravity/posix-hook-invocation.test.ts @@ -437,19 +427,15 @@ 2 test-no-wall-clock:src/main/external-conversations/external-conversation-cancel-settlement.test.ts 3 test-no-wall-clock:src/main/external-conversations/external-conversation-cancel.test.ts 2 test-no-wall-clock:src/main/git/command-runner/host-routing/git-command-resolution-windows-checkout.test.ts -2 test-no-wall-clock:src/main/git/command-runner/hosted-cli/runner-gh-account-binding.test.ts +1 test-no-wall-clock:src/main/git/command-runner/hosted-cli/runner-gh-account-binding.test.ts 1 test-no-wall-clock:src/main/git/refs/maintenance/pack-refs-lock-ownership.test.ts 2 test-no-wall-clock:src/main/git/refs/maintenance/repo-ref-maintenance-real-git.test.ts 1 test-no-wall-clock:src/main/git/source-control/blob-absence-real-git.test.ts 2 test-no-wall-clock:src/main/git/worktrees/catalog/worktree-created-description-real-git.test.ts -3 test-no-wall-clock:src/main/github/pr-refresh-coordinator-active-visible-priority.test.ts -8 test-no-wall-clock:src/main/github/pr-refresh-coordinator-alias-coalescing.test.ts -5 test-no-wall-clock:src/main/github/pr-refresh-coordinator-completion-order.test.ts -3 test-no-wall-clock:src/main/github/pr-refresh-coordinator-foreground-pacing.test.ts -3 test-no-wall-clock:src/main/github/pr-refresh-coordinator-refresh-events.test.ts -4 test-no-wall-clock:src/main/github/pr-refresh-coordinator-visibility-policy.test.ts -3 test-no-wall-clock:src/main/github/pr-refresh-coordinator-visible-follow-up.test.ts -4 test-no-wall-clock:src/main/github/pr-refresh-queue-growth-bound.test.ts +3 test-no-wall-clock:src/main/github/pull-requests/refresh/pr-refresh-coordinator-active-visible-priority.test.ts +8 test-no-wall-clock:src/main/github/pull-requests/refresh/pr-refresh-coordinator-alias-coalescing.test.ts +3 test-no-wall-clock:src/main/github/pull-requests/refresh/pr-refresh-coordinator-completion-order.test.ts +2 test-no-wall-clock:src/main/github/pull-requests/refresh/pr-refresh-queue-growth-bound.test.ts 2 test-no-wall-clock:src/main/grok/grok-hook-stdin-no-eof.test.ts 3 test-no-wall-clock:src/main/ipc/runtime-environments/runtime-environment-request-connections.test.ts 1 test-no-wall-clock:src/main/ipc/terminal-render-desync-evidence.test.ts @@ -499,14 +485,13 @@ 1 test-no-wall-clock:src/main/runtime/push/push-unpair-persistence.test.ts 1 test-no-wall-clock:src/main/runtime/rpc/methods/agent-launch/agent-launch-prestart-failure.test.ts 1 test-no-wall-clock:src/main/runtime/rpc/methods/agent-launch/agent-launch-replay.test.ts -2 test-no-wall-clock:src/main/runtime/rpc/methods/agent-launch/agent-launch-restart-replay.test.ts 1 test-no-wall-clock:src/main/runtime/rpc/methods/orchestration/federation/federation-output.test.ts 2 test-no-wall-clock:src/main/runtime/rpc/methods/orchestration/worker/fleet-status-observed-identity.test.ts 1 test-no-wall-clock:src/main/runtime/rpc/methods/orchestration/worker/worker-interactive-wait.test.ts 1 test-no-wall-clock:src/main/runtime/rpc/methods/orchestration/worker/worker-output.test.ts 2 test-no-wall-clock:src/main/runtime/rpc/server/remote-runtime-request-connection.integration.test.ts 2 test-no-wall-clock:src/main/runtime/rpc/server/runtime-rpc-pairing-mode-persistence.test.ts -7 test-no-wall-clock:src/main/runtime/rpc/server/runtime-rpc-relay-pairing.test.ts +6 test-no-wall-clock:src/main/runtime/rpc/server/runtime-rpc-relay-pairing.test.ts 1 test-no-wall-clock:src/main/runtime/session-construction/agent-session/orca-runtime-agent-session-operation.test.ts 1 test-no-wall-clock:src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts 1 test-no-wall-clock:src/main/runtime/terminal/adoption/terminal-subscriber-driven-daemon-attach.test.ts @@ -515,7 +500,6 @@ 3 test-no-wall-clock:src/main/runtime/terminal/query/orca-runtime-codex-idle-title-chat-address.test.ts 1 test-no-wall-clock:src/main/runtime/terminal/recovery/terminal-pane-recovery-liveness-gate.test.ts 16 test-no-wall-clock:src/main/runtime/terminal/wait/tui-idle-hook-lane-runtime.test.ts -4 test-no-wall-clock:src/main/runtime/terminal/wait/tui-idle-name-only-real-pty.integration.test.ts 1 test-no-wall-clock:src/main/runtime/workspaces/process-listing/runtime-worktree-structured-agent-rows-liveness.test.ts 1 test-no-wall-clock:src/main/runtime/workspaces/removal/owned-session-teardown-policy.test.ts 6 test-no-wall-clock:src/main/skills/install/skill-bundle-process-termination.integration.test.ts @@ -528,12 +512,9 @@ 2 test-no-wall-clock:src/main/skills/transaction-state/skill-transaction-startup-recovery.test.ts 4 test-no-wall-clock:src/main/sqlite/sync-database.test.ts 4 test-no-wall-clock:src/main/ssh/remote-exec/ssh-remote-commands.test.ts -2 test-no-wall-clock:src/main/star-nag/service-direct-star.test.ts -3 test-no-wall-clock:src/main/star-nag/service-threshold-prompt.test.ts -1 test-no-wall-clock:src/main/startup/gpu-lifecycle-install-dir-acl-guard.test.ts -1 test-no-wall-clock:src/main/startup/login-shell-environment.test.ts -2 test-no-wall-clock:src/main/startup/run-electron-vite-dev.test.ts -13 test-no-wall-clock:src/main/startup/windows-install-dir-acl-recovery.test.ts +2 test-no-wall-clock:config/scripts/development/launch/run-electron-vite-dev.test.ts +1 test-no-wall-clock:src/main/startup/shell-environment/login-shell-environment.test.ts +2 test-no-wall-clock:src/main/startup/windows-install-permissions/windows-install-dir-acl-recovery.test.ts 4 test-no-wall-clock:src/main/updater/lifecycle/serve-supervisor-install-park.test.ts 1 test-no-wall-clock:src/main/window/desktop-integration/macos-press-and-hold-default.defaults-domain.test.ts 2 test-no-wall-clock:src/main/windows/windows-host-job.win32.test.ts @@ -547,7 +528,6 @@ 3 test-no-wall-clock:src/renderer/src/components/activity/activity-auto-mark-read-loop.react185.test.tsx 2 test-no-wall-clock:src/renderer/src/components/artifacts/ArtifactCollection.test.tsx 1 test-no-wall-clock:src/renderer/src/components/browser-pane/assemble-chrome/browser-workspace-pane.adoption-chrome.test.tsx -3 test-no-wall-clock:src/renderer/src/components/native-chat/conversation/turns/NativeChatResolvedView.turn-status.test.tsx 2 test-no-wall-clock:src/renderer/src/components/native-chat/tools/tasks/NativeChatStructuredSessionStatus.test.tsx 1 test-no-wall-clock:src/renderer/src/components/sidebar/workspace-card/review/use-workspace-reference-details.test.tsx 1 test-no-wall-clock:src/renderer/src/components/sidebar/worktree-list/listing/WorktreeList.lineage-agent-expansion-coupling.test.tsx @@ -578,9 +558,9 @@ 4 test-no-wall-clock:tests/e2e/cross-version-wire/release-checkout.unit.test.ts 2 test-no-wall-clock:tests/e2e/cross-version-wire/release-source-retention.unit.test.ts 1 test-no-wall-clock:tests/e2e/host-cold-park-remote-subscriber.unit.test.ts -1 test-timeout-needs-reason:src/cli/agent-launch-process.test.ts +1 test-timeout-needs-reason:src/cli/agents/agent-launch-process.test.ts 1 test-timeout-needs-reason:src/cli/runtime/serve-pid1-init-reaper.test.ts -1 test-timeout-needs-reason:src/cli/skills-install.test.ts +1 test-timeout-needs-reason:src/cli/skills/skills-install.test.ts 2 test-timeout-needs-reason:src/main/acp/journal/acp-structured-broken-stream.test.ts 4 test-timeout-needs-reason:src/main/agent-hooks/server/testing/http/server-transport-interference.test.ts 1 test-timeout-needs-reason:src/main/agent-hooks/wsl-relay/testing/wsl-hook-relay-live.integration.test.ts @@ -598,7 +578,6 @@ 1 test-timeout-needs-reason:src/main/browser/guest-lifecycle/find/browser-find-frame-traversal.electron.test.ts 1 test-timeout-needs-reason:src/main/browser/identity/wire-probes/browser-session-ua-wire-identity-cross-context.electron.test.ts 1 test-timeout-needs-reason:src/main/browser/identity/wire-probes/browser-session-ua-wire-identity.electron.test.ts -1 test-timeout-needs-reason:src/main/claude/child-process/claude-agent-sdk-exit-proof.test.ts 2 test-timeout-needs-reason:src/main/codex/app-server/codex-app-server-teardown.integration.test.ts 1 test-timeout-needs-reason:src/main/codex/hooks/installation/hook-service-legacy-cleanup.test.ts 1 test-timeout-needs-reason:src/main/codex/structured/catalog/codex-model-catalog-probe.test.ts @@ -641,20 +620,17 @@ 1 test-timeout-needs-reason:src/main/runtime/mobile-cloud-relay/mobile-relay-e2ee.integration.test.ts 1 test-timeout-needs-reason:src/main/runtime/rpc/server/orchestration-cli-subprocess.test.ts 2 test-timeout-needs-reason:src/main/runtime/rpc/server/remote-runtime-request-connection.integration.test.ts -1 test-timeout-needs-reason:src/main/runtime/rpc/ws-transport.test.ts 1 test-timeout-needs-reason:src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts 1 test-timeout-needs-reason:src/main/runtime/terminal/launch/qoder-mobile-resume-adoption.test.ts 2 test-timeout-needs-reason:src/main/runtime/terminal/wait/launched-agent-crash-guard.live-shell.test.ts -3 test-timeout-needs-reason:src/main/runtime/terminal/wait/terminal-interactive-wait-visibility.test.ts +2 test-timeout-needs-reason:src/main/runtime/terminal/wait/terminal-interactive-wait-visibility.test.ts 1 test-timeout-needs-reason:src/main/runtime/terminal/wait/terminal-wait-name-only-idle.test.ts 4 test-timeout-needs-reason:src/main/runtime/terminal/wait/tui-idle-hook-lane-runtime.test.ts -3 test-timeout-needs-reason:src/main/runtime/terminal/wait/tui-idle-name-only-real-pty.integration.test.ts 1 test-timeout-needs-reason:src/main/skills/install/skill-bundle-process-termination.integration.test.ts 1 test-timeout-needs-reason:src/main/sqlite/sync-database-concurrent-backup.test.ts 2 test-timeout-needs-reason:src/main/ssh/connection/ssh-connection-sftp-wire.test.ts 2 test-timeout-needs-reason:src/main/ssh/system-transport/forwarding/system-ssh-forward-process-real-openssh.test.ts -2 test-timeout-needs-reason:src/main/startup/single-instance-lock-exit.electron.test.ts -1 test-timeout-needs-reason:src/main/window/renderer-publication-throttle.electron.test.ts +1 test-timeout-needs-reason:src/main/window/visibility/renderer-publication-throttle.electron.test.ts 1 test-timeout-needs-reason:src/main/windows/windows-administrator-restart.win32.test.ts 1 test-timeout-needs-reason:src/main/windows/windows-host-job.win32.test.ts 1 test-timeout-needs-reason:src/main/windows/windows-msys-job.win32.test.ts @@ -725,7 +701,7 @@ 1 test-timeout-needs-reason:tests/e2e/markdown-review-selection-performance.spec.ts 1 test-timeout-needs-reason:tests/e2e/mobile-subscribe-idle-hidden-pane-fit.spec.ts 1 test-timeout-needs-reason:tests/e2e/orcad-serve-open-url-on-desktop.spec.ts -10 test-timeout-needs-reason:tests/e2e/orchestration-idle-mail-delivery.spec.ts +9 test-timeout-needs-reason:tests/e2e/orchestration-idle-mail-delivery.spec.ts 1 test-timeout-needs-reason:tests/e2e/orchestration-idle-mail-restore.spec.ts 1 test-timeout-needs-reason:tests/e2e/orchestration-legacy-worker-missing-terminal-recovery.spec.ts 1 test-timeout-needs-reason:tests/e2e/orchestration-worker-settlement-release-cli.spec.ts diff --git a/config/knip.json b/config/knip.json index e10d9e14c28..865e36e3823 100644 --- a/config/knip.json +++ b/config/knip.json @@ -57,7 +57,7 @@ "src/**/*-electron-fixture.ts", "src/**/*-test-fixture.ts", "src/**/*.test-fixture.{ts,tsx}", - "src/main/runtime/rpc/rpc-params-type-parity.ts", + "src/main/runtime/rpc/dispatch/rpc-params-type-parity.ts", "src/main/runtime/rpc/methods/client-state/ui-state-schema-parity-checks.ts", "src/renderer/src/components/editor/monaco-internal-test-module-types.ts", "mobile/**/*.{ts,tsx}", diff --git a/config/main-blocking-atomics-baseline.txt b/config/main-blocking-atomics-baseline.txt index 298e39caca6..54e5085bb4c 100644 --- a/config/main-blocking-atomics-baseline.txt +++ b/config/main-blocking-atomics-baseline.txt @@ -1,6 +1,6 @@ # Legacy synchronous atomics uses per file; counts may only go DOWN. # Only explicit worker/utility entry files are exempt; their imports remain guarded. 1 src/main/runtime/rpc/server/pairing/device-registry-disk-merge.ts -1 src/main/startup/ensure-virtual-display.ts +1 src/main/startup/linux-display/ensure-virtual-display.ts 1 src/shared/windows-retry-file-operations.ts 1 src/shared/windows-transient-lock-removal.ts diff --git a/config/main-blocking-compression-baseline.txt b/config/main-blocking-compression-baseline.txt index 8585ee8cfe2..9b41ba5a702 100644 --- a/config/main-blocking-compression-baseline.txt +++ b/config/main-blocking-compression-baseline.txt @@ -1,7 +1,7 @@ # Legacy synchronous compression uses per file; counts may only go DOWN. # Only explicit worker/utility entry files are exempt; their imports remain guarded. 1 src/main/browser/extensions/actions/browser-extension-action-icon.ts -1 src/main/runtime/rpc/mobile-e2ee-v2-compressed-frame.ts +1 src/main/runtime/rpc/mobile/e2ee/mobile-e2ee-v2-compressed-frame.ts 1 src/main/ssh/remote-exec/ssh-posix-command-wrapper.ts 2 src/main/ssh/remote-exec/ssh-remote-powershell.ts 1 src/shared/remote-runtime/e2ee/node/paired-e2ee-node-compressed-frame.ts diff --git a/config/main-sync-fs-baseline.txt b/config/main-sync-fs-baseline.txt index 973e8ec997f..03d03095267 100644 --- a/config/main-sync-fs-baseline.txt +++ b/config/main-sync-fs-baseline.txt @@ -119,7 +119,6 @@ 1 src/main/codex-accounts/managed-homes/guest-codex-account-homes.ts 6 src/main/codex-accounts/managed-homes/host-codex-managed-home-ownership.ts 2 src/main/codex-accounts/runtime-home/legacy-host/legacy-shared-auth-migration.ts -21 src/main/codex-accounts/legacy-wsl-auth-drain/legacy-wsl-runtime-auth-drain-recovery-script-harness.ts 36 src/main/codex-accounts/legacy-wsl-auth-drain/legacy-wsl-runtime-auth-drain-script-harness.ts 6 src/main/codex-accounts/legacy-wsl-auth-drain/legacy-wsl-runtime-auth-drain-script-interference-shims.ts 1 src/main/codex-accounts/credentials/managed-codex-auth-readiness.ts @@ -489,8 +488,8 @@ 3 src/main/runtime/rpc/server/pairing/e2ee-keypair.ts 3 src/main/runtime/rpc/server/runtime-metadata.ts 2 src/main/runtime/rpc/server/runtime-rpc-socket-metadata.ts -5 src/main/runtime/rpc/unix-socket-transport.ts -3 src/main/runtime/rpc/ws-fallback-port-store.ts +5 src/main/runtime/rpc/transports/unix-socket-transport.ts +3 src/main/runtime/rpc/transports/websocket/ws-fallback-port-store.ts 2 src/main/runtime/terminal/launch/claude-agent-teams-shim-env.ts 1 src/main/runtime/workspaces/persisted-surfaces/crew-operations.ts 1 src/main/server/serve-pairing-output.ts @@ -516,24 +515,24 @@ 3 src/main/ssh/system-transport/file-transfer/system-ssh-sftp-transfer.ts 3 src/main/ssh/system-transport/ssh-control-socket.ts 3 src/main/ssh/system-transport/system-ssh-binary.ts -3 src/main/startup/cli-launch-redirect.ts +3 src/main/startup/cli-launch/cli-launch-redirect.ts 2 src/main/startup/configure-process.ts -4 src/main/startup/gpu-fallback-marker.ts -2 src/main/startup/http1-compatibility-marker.ts -5 src/main/startup/http1-compatibility-profile-state.ts -1 src/main/startup/linux-dev-shm-policy.ts -4 src/main/startup/linux-realtime-scheduling-guard.ts -1 src/main/startup/linux-rttime-limit.ts -2 src/main/startup/profile-state-recovery-preflight.ts -1 src/main/startup/startup-diagnostics.ts -1 src/main/startup/windows-app-data-path.ts -5 src/main/startup/windows-install-dir-acl-poison-marker.ts -1 src/main/startup/windows-install-dir-acl-probe.ts -1 src/main/startup/windows-install-dir-package-acl-grant.ts -4 src/main/startup/windows-install-dir-package-acl-repair.ts -3 src/main/startup/windows-renderer-runtime-files.ts -3 src/main/startup/windows-user-data-acl.ts -6 src/main/startup/x-display-artifacts.ts +4 src/main/startup/gpu-recovery/gpu-fallback-marker.ts +2 src/main/startup/network-compatibility/http1-compatibility-marker.ts +5 src/main/startup/network-compatibility/http1-compatibility-profile-state.ts +1 src/main/startup/linux-runtime/linux-dev-shm-policy.ts +4 src/main/startup/linux-runtime/linux-realtime-scheduling-guard.ts +1 src/main/startup/linux-runtime/linux-rttime-limit.ts +2 src/main/startup/profile-startup/profile-state-recovery-preflight.ts +1 src/main/startup/diagnostics/startup-diagnostics.ts +1 src/main/startup/windows-startup/windows-app-data-path.ts +5 src/main/startup/windows-install-permissions/windows-install-dir-acl-poison-marker.ts +1 src/main/startup/windows-install-permissions/windows-install-dir-acl-probe.ts +1 src/main/startup/windows-install-permissions/windows-install-dir-package-acl-grant.ts +4 src/main/startup/windows-install-permissions/windows-install-dir-package-acl-repair.ts +3 src/main/startup/windows-startup/windows-renderer-runtime-files.ts +3 src/main/startup/windows-startup/windows-user-data-acl.ts +6 src/main/startup/linux-display/x-display-artifacts.ts 2 src/main/stats/stats-file-loader.ts 2 src/main/text-generation/source-control-prompt-files.ts 1 src/main/updater/lifecycle/windows-update-install-directory.ts diff --git a/config/main-sync-spawn-baseline.txt b/config/main-sync-spawn-baseline.txt index b68e85af822..94bb779f5fe 100644 --- a/config/main-sync-spawn-baseline.txt +++ b/config/main-sync-spawn-baseline.txt @@ -9,7 +9,6 @@ 1 src/main/browser/network/egress/browser-route-egress-electron-launch.ts 1 src/main/browser/routing/partitions/browser-route-partition-binding-store.ts 1 src/main/claude-accounts/runtime-auth-service.ts -2 src/main/codex-accounts/legacy-wsl-auth-drain/legacy-wsl-runtime-auth-drain-recovery-script-harness.ts 2 src/main/codex-accounts/legacy-wsl-auth-drain/legacy-wsl-runtime-auth-drain-script-harness.ts 1 src/main/codex-accounts/runtime-home/routing/runtime-home-service-home-routing.ts 1 src/main/codex-accounts/runtime-home/wsl/runtime-home-service-wsl.ts @@ -37,8 +36,8 @@ 1 src/main/pty/shell-startup/pwsh.ts 2 src/main/pty/shell-startup/zsh-startup-hook-pty-harness.ts 1 src/main/runtime/integrations/skill/runtime-skill-install-authority.ts -2 src/main/startup/cli-launch-redirect.ts -1 src/main/startup/linux-secret-service-probe.ts +2 src/main/startup/cli-launch/cli-launch-redirect.ts +1 src/main/startup/linux-runtime/linux-secret-service-probe.ts 2 src/main/window/desktop-integration/macos-press-and-hold-default.ts 1 src/main/workspace-hooks/worktree-runner-script.ts 3 src/main/wsl/discovery/distro-catalog.ts diff --git a/config/nsis/orca-installer-hooks.nsh b/config/nsis/orca-installer-hooks.nsh index 9ac82b88a25..3a43eb35b4f 100644 --- a/config/nsis/orca-installer-hooks.nsh +++ b/config/nsis/orca-installer-hooks.nsh @@ -69,7 +69,7 @@ ; WSL host sees nothing here. These are the folders Electron's userData (app.getName()) can be, as the ; deleteAppData step lists them; a custom --user-data-dir can't be known here. ; Sync the flags with WSL_HOLDER_UNINSTALL_FLAG and WSL_SERVER_UNINSTALL_FLAG in - ; src/main/startup/wsl-holder-uninstall-preflight.ts. + ; src/main/startup/uninstall/wsl-holder-uninstall-preflight.ts. ${if} $installMode == "all" SetShellVarContext current ${endIf} @@ -114,7 +114,7 @@ ; app, but once that folder is removed every agent fails a hook per event, so the last Orca for ; this user takes the entries out. Another install, or an unreadable registry, keeps them. ; Best effort: the exit code never blocks uninstall. - ; Sync the flag with AGENT_HOOKS_UNINSTALL_FLAG in src/main/startup/agent-hooks-uninstall-preflight.ts. + ; Sync the flag with AGENT_HOOKS_UNINSTALL_FLAG in src/main/startup/uninstall/agent-hooks-uninstall-preflight.ts. !insertmacro ORCA_OTHER_INSTALL_STATE $1 ${if} $1 == "none" nsExec::Exec '"$INSTDIR\${APP_EXECUTABLE_FILENAME}" --orca-uninstall-remove-agent-hooks' diff --git a/config/process-host-direct-import-baseline.txt b/config/process-host-direct-import-baseline.txt index 199c287e0c6..c9e41a2ffa6 100644 --- a/config/process-host-direct-import-baseline.txt +++ b/config/process-host-direct-import-baseline.txt @@ -1,8 +1,8 @@ # Existing production source files importing child_process at runtime outside @orca/process-host. # Migration debt: this list may only shrink; new callers use the package public API. -src/cli/handlers/core.ts -src/cli/handlers/interactive-login-interruption.ts +src/cli/runtime/cli-lifecycle-handlers.ts +src/cli/accounts/interactive-login-interruption.ts src/cli/runtime/launch.ts src/main/agent-hooks/installation/locking/managed-hook-owner-identity.ts src/main/ai-vault/scan-service/session-scanner-service-spawn.ts @@ -11,7 +11,6 @@ src/main/automations/precheck-runner.ts src/main/browser/agent-browser/helper-process/agent-browser-bridge-execution.ts src/main/browser/agent-browser/helper-process/agent-browser-bridge-raw-process.ts src/main/browser/network/egress/browser-route-egress-electron-launch.ts -src/main/codex-accounts/legacy-wsl-auth-drain/legacy-wsl-runtime-auth-drain-recovery-script-harness.ts src/main/codex-accounts/legacy-wsl-auth-drain/legacy-wsl-runtime-auth-drain-script-harness.ts src/main/codex-accounts/service.ts src/main/computer/desktop-script/desktop-script-provider-bridge.ts @@ -36,7 +35,7 @@ src/main/git/command-runner/process-capture/spawn-command-capture.ts src/main/git/command-runner/process-capture/spawned-command-tree-kill.ts src/main/git/command-runner/host-routing/wsl-aware-spawn.ts src/main/git/command-runner/host-routing/wsl-git-read-environment.ts -src/main/github/gh-utils.ts +src/main/github/execution/github-legacy-command.ts src/main/workspace-hooks/hooks.ts src/main/ipc/developer-permissions.ts src/main/ipc/filesystem/watcher-process/child-lifecycle/parcel-watcher-child-launch.ts @@ -57,7 +56,6 @@ src/main/network/macos-tailscale-dns-diagnostic.ts src/main/plugins/workers/parent-process/plugin-host-process.ts src/main/plugins/catalog/plugin-private-marketplace-ssh-shim.cjs src/main/ports/port-scan-command-execution.ts -src/main/providers/macos-login-session-pty-probe.ts src/main/providers/process-cwd.ts src/main/pty/process-retirement/pty-descendant-fresh-table.ts src/main/rate-limits/providers/gemini/gemini-cli-oauth-extractor.ts @@ -67,7 +65,7 @@ src/main/ssh/system-transport/ssh-proxy-command.ts src/main/ssh/system-transport/system-ssh-command.ts src/main/ssh/system-transport/forwarding/system-ssh-dynamic-forward-process.ts src/main/ssh/system-transport/file-transfer/system-ssh-file-transfer.ts -src/main/startup/ensure-virtual-display.ts +src/main/startup/linux-display/ensure-virtual-display.ts src/main/pty/process-retirement/windows-process-tree-kill.ts src/main/pty/shell-startup/zsh-startup-hook-pty-harness.ts src/shared/ephemeral-vm-recipe-process.ts diff --git a/config/recurring-timer-baseline.txt b/config/recurring-timer-baseline.txt index cbb8de22d67..f6061f98094 100644 --- a/config/recurring-timer-baseline.txt +++ b/config/recurring-timer-baseline.txt @@ -3,7 +3,7 @@ # collector (file-wide). Not counted: destructuring off a global object, a self-rescheduling setTimeout (it must back off or pause while hidden). # This is a RATCHET: counts may only go DOWN. # Prune after removing intervals: pnpm check:recurring-timer-ratchet --prune -1 src/cli/handlers/orchestration/check-keepalive.ts +1 src/cli/orchestration/messages/check-keepalive.ts 1 src/cli/runtime/mac-app-update-bundle.ts 1 src/cli/runtime/serve-supervised-service.ts 1 src/main/agent-hooks/server/server-opencode-binder.ts @@ -51,10 +51,10 @@ 1 src/main/runtime/mobile-cloud-relay/desktop-relay-service.ts 3 src/main/runtime/mobile-cloud-relay/relay-control-liveness.ts 1 src/main/runtime/rpc/methods/orchestration/messaging/check-run.ts -1 src/main/runtime/rpc/mobile-socket-wiring.ts -1 src/main/runtime/rpc/remote-runtime-server-heartbeat.ts +1 src/main/runtime/rpc/mobile/mobile-socket-wiring.ts +1 src/main/runtime/rpc/transports/websocket/remote-runtime-server-heartbeat.ts 1 src/main/runtime/rpc/server/runtime-metadata-ownership-watch.ts -1 src/main/runtime/rpc/unix-socket-transport.ts +1 src/main/runtime/rpc/transports/unix-socket-transport.ts 1 src/main/runtime/sidebar-inputs/paired-server-rows-producer.ts 1 src/main/runtime/terminal/input/agent-prompt-permission-hold.ts 1 src/main/runtime/terminal/output/terminal-derived-agent-facts.ts @@ -64,8 +64,8 @@ 1 src/main/ssh/port-forwarding/ssh-tcp-forwarding-probe.ts 1 src/main/ssh/protocol/ssh-channel-multiplexer.ts 1 src/main/startup/configure-process.ts -1 src/main/startup/event-loop-stall-probe.ts -1 src/main/startup/synthetic-title-runtime.ts +1 src/main/startup/diagnostics/event-loop-stall-probe.ts +1 src/main/startup/main-window/synthetic-title-runtime.ts 1 src/main/telemetry/wsl-usage-reporter.ts 1 src/main/wsl/host-lifecycle/wsl-hosts-policy-live-update.ts 1 src/main/wsl/orcad/wsl-orcad-connect-stop-fence.ts diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index ba48998b834..1ee9c681616 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -454,29 +454,25 @@ "providers": ["local", "daemon", "ssh", "wsl", "remote-runtime", "mobile-relay"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Audit3666 removes30 authored/36 finite mobile cases, including7 whole drivers. It retires direct consent/channel/token/header-payload/fingerprint/route-object inventories, background legacy-dismissal filtering, the two-row520-entry watermark retention workload, reentrant write-batch example, font-before-ready projection, and legacy-segmenter/scrollback/wrap selection examples. Actual policy, parsing, hashing, tray matching, serialization and xterm buffers execute in these tests; their stated alarms are deliberately lost without replacement. Twelve unchanged authored/19 finite cases retain compact browser geometry regressions, an independent fingerprint-to-host protocol vector, serialized watermark/reload isolation, OSC52 live/replay gating, queue boundaries/reset/generation, disposed font completion and Unicode cell mapping. Pairing classification2/2 was already approved by3657 and receives no3666 delta or credit. Static review only; no runtime, native, provider, browser rendering, OS, remote, mobile/folder parity or new historical fault evidence. Previous account (preserved verbatim): Audit3663 removes the complete mobile scan-error message suite (two authored/two finite callbacks). Its4URL assertion loop is one registration. Accept loss of Orca new/legacy Android-download URL classification and other-page invalid-code translated-key mapping. Real URL parsing/classification runs, but the only output observed is an identity-translator key. No camera scan, pairing offer admission, connection or device/UI action is exercised. No equivalent replacement or physical/mobile/mixed-version result claimed. Preserve all historical evidence and metadata bytes. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. The broad mobile runner loses retired-name sequencing and PR action samples while retaining the editor-lifetime and original PR action keeper; commit-message generation is unchanged. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. The broad mobile command loses the entire three-case mocked diff-review controller suite and the stale layout-sequence comparator sample. Keep only the direct layout-versus-scrollback counter distinction; the unchanged dictation retry hook retains complete recording replay. No rendered app, native capture, actual process death or remote execution is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad mobile discovery loses whole prompt-presentation, Jira-URL and folder-source-repository suites. The prompt suite exercised presentation projections; it did not provide native mobile prompt acknowledgment acceptance. Existing direct prompt-controller selectors are unchanged. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. The stale-leaf-liveness suite and its exact command/testFiles selector are removed; its fake terminal refusal/liveness alarms are intentionally lost. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The entire mocked mobile failure-banner suite and its sole send/previous-banner/new-notice ordering alarm are retired. Its filenames are removed from active selectors. Desktop prompt roots and the independent unchanged terminal wire-codec receipt remain at their stated scopes; no mobile send/recovery proof is claimed. Audit2251 narrows agent-paste-draft.test.ts from 25 authored cases (26 literal cases) to four. Retained cases cover buffered readiness on PTY binding, separate spawn/composer lifetimes, real per-PTY paste/Enter serialization against a competing paste, and frame closure/no Enter after a rejected content chunk. Intentionally lost alarms include agent marker and fallback examples, direct-write failure/rejection, missing-PTY and Codex process-only timeout paths, exact nonprimary-PTY routing, full large-body chunk reconstruction, escaping/CRLF samples, internal laziness/yield work assertions, oversized preflight refusal, and exact configured delay/budget counts. No equivalent replacement, new execution, real PTY/provider delivery, rendered/native UI, deployment, measured performance or cross-platform result is claimed. Historical prior account (preserved verbatim): Mobile owner-layout policy retires whole tests and mixed registrations without equivalent replacement coverage. Retained callbacks and reduced selectors need fresh execution at their stated scope; prior measurements do not validate them. Affected sources: mobile/src/session/mobile-prompt-controller.test.ts, tests/e2e/native-chat-ssh-delivery.unit.test.ts, mobile/src/session/native-chat/use-mobile-native-chat-controller.test.ts, mobile/src/session/native-chat/input/use-mobile-native-chat-cancel-ask.test.ts, mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts, mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.test.ts. Historical scope: Audit2003: Remove agent-prompt absence routing, throwing/live/missing-probe and cached-probe-count examples from the stale-leaf source. Controller-proven absence, unknown-liveness admission, obsolete-absence clearing and same-ID respawn fences remain at a supplied provider/row seam. Preserve the independent wire-codec receipt only in its original scope. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove partial-runtime terminal-send guard/status/floor/query projection and argument-inventory samples. Retained RPC viewport admission, authenticated-client spoof refusal, text admission and stale-binding fences remain bounded mock-boundary behavior. The unchanged wire-codec receipt remains valid only for its original command; it does not validate this reduced RPC selector. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1908 removes the complete prompt-presentation hook and literal interactive-protocol mapping suites and narrows the interactive card and prompt-card input suites. Lost alarms include replacement approval A settling after answered B; collapse/expand composer ownership and partial-answer presentation; identical new waits after an unmounted view; collapsed transcript re-reads; answered/dismissed status-backed persistence and retirement; and literal answer-to-PTY byte arrays. The retained stale-PTY acknowledgment, cancellation/answer retry, and answered-approval remount/rebind assertions remain meaningful but are not equivalent replacement coverage. No fresh reduced-selector result, physical provider, rendered/native-focus, mixed-version deployment, soak, or measured-budget validation is claimed. The unchanged wire-codec receipt remains valid only for its exact command. Historical prior account (preserved verbatim): Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1471 removes the entire interactive-send hook suite. Its mock-writer routing, cancellation-handle, option-digit, interrupt, supplied settlement and inference-argument alarms are retired. No actual PTY bytes, replacement question lifetime or agent delivery were exercised. No equivalent replacement or fresh execution of the reduced reliability selector is claimed; historical receipts retain their original scope. Audit1468 removes the entire runtime-send suite. Its mock PTY clear/body/Enter byte-order, nominal timing, queue cancellation/serialization, attachment escaping, key-group pacing and deferred acceptance callback alarms are intentionally retired. No actual receiving agent or physical terminal delivery was exercised. No equivalent replacement or fresh execution of the reduced reliability selector is claimed; historical receipts retain their original scope. Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally reduces src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts: Loses configured retry gap and single-Enter agent selection alarms alongside forbidden timer-count checks. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1383 changes referenced sources; no new execution result validates reduced selectors. Retained unchanged receipts apply only to unchanged commands. Historical coverage: Audits1340 and1348 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audit1316 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Production mobile controller, parser, presentation, overlay, view, question, permission and composer run with native surfaces mocked on macOS. Desktop selector groups traverse the real observed-write queue, verified helper, IPC chunker, SSH provider and transport callbacks; paired sends traverse the real dispatcher and runtime writer into that provider. Local/daemon contracts and released-version terminal codecs are covered. Provider labels describe contracts, not physical deployments; physical WSL/Linux/Windows remain gaps. Audit885 removes the isolated observed-send mock-call suite; no replacement-equivalence claim is made. Audit1107 removes the small healthy ordinary SSH-send byte/callback sample. Its exact clear/body/Enter sample alarm is lost; retained slow-answer, cancellation and simulated older-host sequence checks are not claimed as equivalent replacement coverage. The SSH delivery fixture uses controlled fake provider settlement, and its paired path uses the real runtime/dispatcher without a physical SSH or paired wire transport. Audit1278 removes the mobile Stop display/disabled/placeholder suite; its local Stop presentation, repeat-stop and dispatch-visibility alarms are intentionally lost. No equivalent replacement or runtime stopping proof is claimed. Audit1292: The blind OpenCode readiness warning and late launch success/failure content-plus-submit write samples are removed. Their mocked readiness/inspection/delivery alarms are lost; no real PTY delivery or equivalent replacement coverage is claimed. Audit1294 removes mobile/src/session/native-chat/input/mobile-native-chat-permission-send.test.ts. Its mock-only request/capability/private-state/copy alarms are intentionally lost. Remaining tests are not equivalent replacement coverage. Narrowed commands require fresh parent-owned validation; no new runtime, platform or physical mobile evidence is claimed. Audit1302: src/main/ipc/pty/ipc/write-input-acceptance.test.ts: Provider registry and write acceptance/refusal/unverifiable receipts are supplied by fixture; local/daemon/WSL/SSH labels use the same fake provider. Chunking/settlement/remount cases inspect delegated calls or canned receipts without actual provider acceptance/acknowledgement. Lose chunk/refusal/pending/remount and raw-pane routing alarms; no equivalent replacement. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1303 intentionally removes supplied-state/mock-callback component and hook examples in mobile/src/session/native-chat/input/use-mobile-native-chat-ask-dismiss.test.ts, mobile/src/session/native-chat/input/MobileNativeChatPromptCard.test.tsx. Their exact retired alarms are not equivalent to retained coverage; no new runtime, physical phone or deployed mixed-version evidence is claimed. Audit1310 removes the supplied-geometry/direct-callback chat history-paging suite. Its prepend/scroll-position examples are intentionally lost; no real rendered anchoring, equivalent replacement or physical phone proof is claimed. Narrowed commands need fresh validation. Audit1315 removes/narrows mobile/src/session/native-chat/MobileNativeChatView.composer-lock.test.ts, mobile/src/session/native-chat/MobileNativeChatView.prompt-presentation.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1316: src/renderer/src/lib/agent-followup-delivery.test.ts removed. Interpreter wrapper/live child/shell readiness and final readiness recheck delivery mock samples lose alarms. No equivalent replacement coverage is claimed. Audit1322 removes/narrows mobile/src/session/native-chat/MobileNativeChatView.tail-follow.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1341 scope1334 removes/narrows mobile/src/session/native-chat/mobile-native-chat-send.test.ts, mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1341 scope1335 removes/narrows mobile/src/session/native-chat/use-mobile-native-chat-controller.test.ts, mobile/src/session/mobile-prompt-controller.test.ts, mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1340: src/main/daemon/daemon-pty-write-settlement-recovery.test.ts removed. Ambiguous handoff settlement remains unverifiable when listener throws. No equivalent replacement coverage is claimed. Audit1348: src/main/ipc/pty/ipc/write-input-chunk-yield.test.ts removed. Check-phase yielding and no-yield single-chunk scheduling work. No equivalent replacement coverage is claimed. Audit1352: focused Linux unit selections validated on source head b638e07d395b76af3ba6b03761a1a0fe7e5e026e. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1360: focused Linux unit selections validated on source head 415c9cffc2d10024131ec4b6721767a22195de6d. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1383: src/main/ipc/pty/ipc/write-input-user-input.test.ts reduced. Lose admission provenance spy, direct local Escape write outcome matrix and separate client-side SSH no-evidence control. Provider writes mocked; retained tests protect observation order/facts only. No equivalent replacement coverage is claimed. Audit1401: src/main/ipc/pty/ipc/write-input-user-input.test.ts reduced. Loses local-only post-accept observation and refused/unverifiable settlement delivery alarms. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1402: src/renderer/src/components/native-chat/native-chat-runtime-send-launch-draft.test.ts removed. Intentionally loses clear-confirmation/body/submit and maximal-clear ordering, queued text/image send ordering, ordinary cursor-spanning draft replacement and oversized refusal/queue settlement alarms. No equivalent replacement or real terminal delivery claim. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1426 removes NativeChatComposer.test.tsx. Local pane-remount, draft/cancel/confirmation sequencing and manual IME callback alarms are lost. No equivalent replacement coverage or provider delivery is claimed; historical receipts retain their original scope and the reduced selector has no new execution result. Audit2450 removes the MobileNativeChatView failure-banner callback-only example whose old banner is supplied unchanged by its props. Retain fatal-read gating and the ordering test that preserves a new delivery notice. The removed false-send/old-banner combination has no equivalent replacement; prior raw receipts and budgets retain their original source scope. No new soak, platform, performance or red/green claim.", + "coverageNotes": "Audit3984 retires all four remaining viewport-fixture suites (14 authored/15 finite cases) and the fixture after composing the sender-host deletion. Accepted source-alarm losses include live-region/disclosure continuity, task/question/approval history and revision handling, stale turn status, prompt-dismissal remount/rebind, and pending-send cancellation when approval arrives between body and Enter. No equivalent replacement or fresh runtime validation is claimed. Audits3764/3766 retire16 authored/27 expanded mobile cases, including entire HTML-image syntax, Mermaid routing, table styles, file-query encoding, workspace naming and fresh-Git-status adapter suites. Accepted losses include image width/icon filtering, partial-heading streaming, mocked Mermaid key/identity checks, generated table widths/counts, selected-text caret placement, tiny Base64 chunk encoding, twelve query-path roundtrips, locale-import fallback, apostrophe slugging, fresh-status fallback and an intermediate reviewed marker. These are deliberate removals for marginal value; remaining tests are not equivalent replacements. Earlier receipts are historical and do not validate these deleted/reduced drivers. Audit3748 intentionally removes ten authored/ten finite registrations from the surviving media-handle-registry.test.ts driver selected by this full-mobile command. Retired real alarms: nominal minted handle uniqueness/metadata and dimensions; ordinary range/EOF/overread/empty-file/direct chunk-clamp samples; nominal successful release, expired-release false, exact millisecond TTL boundary and ordinary releaseAll replay. Deterministic registry code runs; these examples are removed on marginal value without replacement or fresh execution claims. Seven owner cases retain cap refusal/disposal and sweep-before-admission, nonempty EOF and unknown/released/expired refusal, read TTL refresh, idempotent explicit release and continuation after discard failure. Existing commands, assertions, unrelated wire receipt and timing remain; the driver survives. Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered mobile Vitest command. Its mobile/src include patterns admit the partial live-input-commit and native-media drivers:5 authored/5 finite removals. Accepted losses: two Android-labeled replay samples after mocked composition conversion, an immediate Backspace absence check that does not wait for pending commit or prove local edit, and released-handle/double-release adapter examples. Real hook, registry and adapter logic run; no equivalent replacement or native Android/iOS exercise is claimed. Both drivers and selector stay. The unchanged wire-specific dated receipt does not validate these reduced mobile sources. Audit3666 removes30 authored/36 finite mobile cases, including7 whole drivers. It retires direct consent/channel/token/header-payload/fingerprint/route-object inventories, background legacy-dismissal filtering, the two-row520-entry watermark retention workload, reentrant write-batch example, font-before-ready projection, and legacy-segmenter/scrollback/wrap selection examples. Actual policy, parsing, hashing, tray matching, serialization and xterm buffers execute in these tests; their stated alarms are deliberately lost without replacement. Twelve unchanged authored/19 finite cases retain compact browser geometry regressions, an independent fingerprint-to-host protocol vector, serialized watermark/reload isolation, OSC52 live/replay gating, queue boundaries/reset/generation, disposed font completion and Unicode cell mapping. Pairing classification2/2 was already approved by3657 and receives no3666 delta or credit. Static review only; no runtime, native, provider, browser rendering, OS, remote, mobile/folder parity or new historical fault evidence. Previous account (preserved verbatim): Audit3663 removes the complete mobile scan-error message suite (two authored/two finite callbacks). Its4URL assertion loop is one registration. Accept loss of Orca new/legacy Android-download URL classification and other-page invalid-code translated-key mapping. Real URL parsing/classification runs, but the only output observed is an identity-translator key. No camera scan, pairing offer admission, connection or device/UI action is exercised. No equivalent replacement or physical/mobile/mixed-version result claimed. Preserve all historical evidence and metadata bytes. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. The broad mobile runner loses retired-name sequencing and PR action samples while retaining the editor-lifetime and original PR action keeper; commit-message generation is unchanged. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. The broad mobile command loses the entire three-case mocked diff-review controller suite and the stale layout-sequence comparator sample. Keep only the direct layout-versus-scrollback counter distinction; the unchanged dictation retry hook retains complete recording replay. No rendered app, native capture, actual process death or remote execution is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad mobile discovery loses whole prompt-presentation, Jira-URL and folder-source-repository suites. The prompt suite exercised presentation projections; it did not provide native mobile prompt acknowledgment acceptance. Existing direct prompt-controller selectors are unchanged. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. The stale-leaf-liveness suite and its exact command/testFiles selector are removed; its fake terminal refusal/liveness alarms are intentionally lost. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The entire mocked mobile failure-banner suite and its sole send/previous-banner/new-notice ordering alarm are retired. Its filenames are removed from active selectors. Desktop prompt roots and the independent unchanged terminal wire-codec receipt remain at their stated scopes; no mobile send/recovery proof is claimed. Audit2251 narrows agent-paste-draft.test.ts from 25 authored cases (26 literal cases) to four. Retained cases cover buffered readiness on PTY binding, separate spawn/composer lifetimes, real per-PTY paste/Enter serialization against a competing paste, and frame closure/no Enter after a rejected content chunk. Intentionally lost alarms include agent marker and fallback examples, direct-write failure/rejection, missing-PTY and Codex process-only timeout paths, exact nonprimary-PTY routing, full large-body chunk reconstruction, escaping/CRLF samples, internal laziness/yield work assertions, oversized preflight refusal, and exact configured delay/budget counts. No equivalent replacement, new execution, real PTY/provider delivery, rendered/native UI, deployment, measured performance or cross-platform result is claimed. Historical prior account (preserved verbatim): Mobile owner-layout policy retires whole tests and mixed registrations without equivalent replacement coverage. Retained callbacks and reduced selectors need fresh execution at their stated scope; prior measurements do not validate them. Affected sources: mobile/src/session/mobile-prompt-controller.test.ts, tests/e2e/native-chat-ssh-delivery.unit.test.ts, mobile/src/session/native-chat/use-mobile-native-chat-controller.test.ts, mobile/src/session/native-chat/input/use-mobile-native-chat-cancel-ask.test.ts, mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts, mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.test.ts. Historical scope: Audit2003: Remove agent-prompt absence routing, throwing/live/missing-probe and cached-probe-count examples from the stale-leaf source. Controller-proven absence, unknown-liveness admission, obsolete-absence clearing and same-ID respawn fences remain at a supplied provider/row seam. Preserve the independent wire-codec receipt only in its original scope. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove partial-runtime terminal-send guard/status/floor/query projection and argument-inventory samples. Retained RPC viewport admission, authenticated-client spoof refusal, text admission and stale-binding fences remain bounded mock-boundary behavior. The unchanged wire-codec receipt remains valid only for its original command; it does not validate this reduced RPC selector. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1908 removes the complete prompt-presentation hook and literal interactive-protocol mapping suites and narrows the interactive card and prompt-card input suites. Lost alarms include replacement approval A settling after answered B; collapse/expand composer ownership and partial-answer presentation; identical new waits after an unmounted view; collapsed transcript re-reads; answered/dismissed status-backed persistence and retirement; and literal answer-to-PTY byte arrays. The retained stale-PTY acknowledgment, cancellation/answer retry, and answered-approval remount/rebind assertions remain meaningful but are not equivalent replacement coverage. No fresh reduced-selector result, physical provider, rendered/native-focus, mixed-version deployment, soak, or measured-budget validation is claimed. The unchanged wire-codec receipt remains valid only for its exact command. Historical prior account (preserved verbatim): Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1471 removes the entire interactive-send hook suite. Its mock-writer routing, cancellation-handle, option-digit, interrupt, supplied settlement and inference-argument alarms are retired. No actual PTY bytes, replacement question lifetime or agent delivery were exercised. No equivalent replacement or fresh execution of the reduced reliability selector is claimed; historical receipts retain their original scope. Audit1468 removes the entire runtime-send suite. Its mock PTY clear/body/Enter byte-order, nominal timing, queue cancellation/serialization, attachment escaping, key-group pacing and deferred acceptance callback alarms are intentionally retired. No actual receiving agent or physical terminal delivery was exercised. No equivalent replacement or fresh execution of the reduced reliability selector is claimed; historical receipts retain their original scope. Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally reduces src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts: Loses configured retry gap and single-Enter agent selection alarms alongside forbidden timer-count checks. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1383 changes referenced sources; no new execution result validates reduced selectors. Retained unchanged receipts apply only to unchanged commands. Historical coverage: Audits1340 and1348 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audit1316 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Production mobile controller, parser, presentation, overlay, view, question, permission and composer run with native surfaces mocked on macOS. Desktop selector groups traverse the real observed-write queue, verified helper, IPC chunker, SSH provider and transport callbacks; paired sends traverse the real dispatcher and runtime writer into that provider. Local/daemon contracts and released-version terminal codecs are covered. Provider labels describe contracts, not physical deployments; physical WSL/Linux/Windows remain gaps. Audit885 removes the isolated observed-send mock-call suite; no replacement-equivalence claim is made. Audit1107 removes the small healthy ordinary SSH-send byte/callback sample. Its exact clear/body/Enter sample alarm is lost; retained slow-answer, cancellation and simulated older-host sequence checks are not claimed as equivalent replacement coverage. The SSH delivery fixture uses controlled fake provider settlement, and its paired path uses the real runtime/dispatcher without a physical SSH or paired wire transport. Audit1278 removes the mobile Stop display/disabled/placeholder suite; its local Stop presentation, repeat-stop and dispatch-visibility alarms are intentionally lost. No equivalent replacement or runtime stopping proof is claimed. Audit1292: The blind OpenCode readiness warning and late launch success/failure content-plus-submit write samples are removed. Their mocked readiness/inspection/delivery alarms are lost; no real PTY delivery or equivalent replacement coverage is claimed. Audit1294 removes mobile/src/session/native-chat/input/mobile-native-chat-permission-send.test.ts. Its mock-only request/capability/private-state/copy alarms are intentionally lost. Remaining tests are not equivalent replacement coverage. Narrowed commands require fresh parent-owned validation; no new runtime, platform or physical mobile evidence is claimed. Audit1302: src/main/ipc/pty/ipc/write-input-acceptance.test.ts: Provider registry and write acceptance/refusal/unverifiable receipts are supplied by fixture; local/daemon/WSL/SSH labels use the same fake provider. Chunking/settlement/remount cases inspect delegated calls or canned receipts without actual provider acceptance/acknowledgement. Lose chunk/refusal/pending/remount and raw-pane routing alarms; no equivalent replacement. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1303 intentionally removes supplied-state/mock-callback component and hook examples in mobile/src/session/native-chat/input/use-mobile-native-chat-ask-dismiss.test.ts, mobile/src/session/native-chat/input/MobileNativeChatPromptCard.test.tsx. Their exact retired alarms are not equivalent to retained coverage; no new runtime, physical phone or deployed mixed-version evidence is claimed. Audit1310 removes the supplied-geometry/direct-callback chat history-paging suite. Its prepend/scroll-position examples are intentionally lost; no real rendered anchoring, equivalent replacement or physical phone proof is claimed. Narrowed commands need fresh validation. Audit1315 removes/narrows mobile/src/session/native-chat/MobileNativeChatView.composer-lock.test.ts, mobile/src/session/native-chat/MobileNativeChatView.prompt-presentation.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1316: src/renderer/src/lib/agent-followup-delivery.test.ts removed. Interpreter wrapper/live child/shell readiness and final readiness recheck delivery mock samples lose alarms. No equivalent replacement coverage is claimed. Audit1322 removes/narrows mobile/src/session/native-chat/MobileNativeChatView.tail-follow.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1341 scope1334 removes/narrows mobile/src/session/native-chat/mobile-native-chat-send.test.ts, mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1341 scope1335 removes/narrows mobile/src/session/native-chat/use-mobile-native-chat-controller.test.ts, mobile/src/session/mobile-prompt-controller.test.ts, mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1340: src/main/daemon/daemon-pty-write-settlement-recovery.test.ts removed. Ambiguous handoff settlement remains unverifiable when listener throws. No equivalent replacement coverage is claimed. Audit1348: src/main/ipc/pty/ipc/write-input-chunk-yield.test.ts removed. Check-phase yielding and no-yield single-chunk scheduling work. No equivalent replacement coverage is claimed. Audit1352: focused Linux unit selections validated on source head b638e07d395b76af3ba6b03761a1a0fe7e5e026e. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1360: focused Linux unit selections validated on source head 415c9cffc2d10024131ec4b6721767a22195de6d. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1383: src/main/ipc/pty/ipc/write-input-user-input.test.ts reduced. Lose admission provenance spy, direct local Escape write outcome matrix and separate client-side SSH no-evidence control. Provider writes mocked; retained tests protect observation order/facts only. No equivalent replacement coverage is claimed. Audit1401: src/main/ipc/pty/ipc/write-input-user-input.test.ts reduced. Loses local-only post-accept observation and refused/unverifiable settlement delivery alarms. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1402: src/renderer/src/components/native-chat/native-chat-runtime-send-launch-draft.test.ts removed. Intentionally loses clear-confirmation/body/submit and maximal-clear ordering, queued text/image send ordering, ordinary cursor-spanning draft replacement and oversized refusal/queue settlement alarms. No equivalent replacement or real terminal delivery claim. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1426 removes NativeChatComposer.test.tsx. Local pane-remount, draft/cancel/confirmation sequencing and manual IME callback alarms are lost. No equivalent replacement coverage or provider delivery is claimed; historical receipts retain their original scope and the reduced selector has no new execution result. Audit2450 removes the MobileNativeChatView failure-banner callback-only example whose old banner is supplied unchanged by its props. Retain fatal-read gating and the ordering test that preserves a new delivery notice. The removed false-send/old-banner combination has no equivalent replacement; prior raw receipts and budgets retain their original source scope. No new soak, platform, performance or red/green claim.", "motivatingLinks": ["https://github.com/stablyai/orca/pull/25761"], "invariant": "A prompt occurrence leaves the input region only when an accepted reply answers it (a current host's provider acknowledgment, or an older host's whole-write acceptance as before) or the user collapses it to a strip above the composer, which writes nothing and keeps the card mounted with its partial answer; status-backed occurrences are told apart by the host wait's start, so view toggles and remounts preserve them while real clear/replacement supersedes them, and a transcript-only one is dropped when the view stops observing it; obsolete results cannot change replacements; selector groups wait for complete writes before pacing; refusal or unknown handoff never causes replay; a card retires an unsubmitted composer send without writing under it or losing its text, and the hidden composer cannot send or interrupt; Collapse or Escape folds a card without writing, never during an in-flight answer, and a new occurrence shows expanded again; the phone blocks only Send while a card is expanded and shows one card per occurrence; cancellation stops unsent groups and active dictation can stop.", - "oracle": "Audit3666 removes30 authored/36 finite mobile cases, including7 whole drivers. It retires direct consent/channel/token/header-payload/fingerprint/route-object inventories, background legacy-dismissal filtering, the two-row520-entry watermark retention workload, reentrant write-batch example, font-before-ready projection, and legacy-segmenter/scrollback/wrap selection examples. Actual policy, parsing, hashing, tray matching, serialization and xterm buffers execute in these tests; their stated alarms are deliberately lost without replacement. Twelve unchanged authored/19 finite cases retain compact browser geometry regressions, an independent fingerprint-to-host protocol vector, serialized watermark/reload isolation, OSC52 live/replay gating, queue boundaries/reset/generation, disposed font completion and Unicode cell mapping. Pairing classification2/2 was already approved by3657 and receives no3666 delta or credit. Static review only; no runtime, native, provider, browser rendering, OS, remote, mobile/folder parity or new historical fault evidence. Previous oracle (preserved verbatim): Audit3663 removes the complete mobile scan-error message suite (two authored/two finite callbacks). Its4URL assertion loop is one registration. Accept loss of Orca new/legacy Android-download URL classification and other-page invalid-code translated-key mapping. Real URL parsing/classification runs, but the only output observed is an identity-translator key. No camera scan, pairing offer admission, connection or device/UI action is exercised. No equivalent replacement or physical/mobile/mixed-version result claimed. Preserve all historical evidence and metadata bytes. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. The broad mobile runner loses retired-name sequencing and PR action samples while retaining the editor-lifetime and original PR action keeper; commit-message generation is unchanged. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. The broad mobile command loses the entire three-case mocked diff-review controller suite and the stale layout-sequence comparator sample. Keep only the direct layout-versus-scrollback counter distinction; the unchanged dictation retry hook retains complete recording replay. No rendered app, native capture, actual process death or remote execution is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad mobile discovery loses whole prompt-presentation, Jira-URL and folder-source-repository suites. The prompt suite exercised presentation projections; it did not provide native mobile prompt acknowledgment acceptance. Existing direct prompt-controller selectors are unchanged. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. The stale-leaf-liveness suite and its exact command/testFiles selector are removed; its fake terminal refusal/liveness alarms are intentionally lost. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The entire mocked mobile failure-banner suite and its sole send/previous-banner/new-notice ordering alarm are retired. Its filenames are removed from active selectors. Desktop prompt roots and the independent unchanged terminal wire-codec receipt remain at their stated scopes; no mobile send/recovery proof is claimed. Audit2251 narrows agent-paste-draft.test.ts from 25 authored cases (26 literal cases) to four. Retained cases cover buffered readiness on PTY binding, separate spawn/composer lifetimes, real per-PTY paste/Enter serialization against a competing paste, and frame closure/no Enter after a rejected content chunk. Intentionally lost alarms include agent marker and fallback examples, direct-write failure/rejection, missing-PTY and Codex process-only timeout paths, exact nonprimary-PTY routing, full large-body chunk reconstruction, escaping/CRLF samples, internal laziness/yield work assertions, oversized preflight refusal, and exact configured delay/budget counts. No equivalent replacement, new execution, real PTY/provider delivery, rendered/native UI, deployment, measured performance or cross-platform result is claimed. Historical prior account (preserved verbatim): Mobile owner-layout policy retires whole tests and mixed registrations without equivalent replacement coverage. Retained callbacks and reduced selectors need fresh execution at their stated scope; prior measurements do not validate them. Historical oracle: Audit2003: Remove agent-prompt absence routing, throwing/live/missing-probe and cached-probe-count examples from the stale-leaf source. Controller-proven absence, unknown-liveness admission, obsolete-absence clearing and same-ID respawn fences remain at a supplied provider/row seam. Preserve the independent wire-codec receipt only in its original scope. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove partial-runtime terminal-send guard/status/floor/query projection and argument-inventory samples. Retained RPC viewport admission, authenticated-client spoof refusal, text admission and stale-binding fences remain bounded mock-boundary behavior. The unchanged wire-codec receipt remains valid only for its original command; it does not validate this reduced RPC selector. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1908 removes the complete prompt-presentation hook and literal interactive-protocol mapping suites and narrows the interactive card and prompt-card input suites. Lost alarms include replacement approval A settling after answered B; collapse/expand composer ownership and partial-answer presentation; identical new waits after an unmounted view; collapsed transcript re-reads; answered/dismissed status-backed persistence and retirement; and literal answer-to-PTY byte arrays. The retained stale-PTY acknowledgment, cancellation/answer retry, and answered-approval remount/rebind assertions remain meaningful but are not equivalent replacement coverage. No fresh reduced-selector result, physical provider, rendered/native-focus, mixed-version deployment, soak, or measured-budget validation is claimed. The unchanged wire-codec receipt remains valid only for its exact command. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Retained unchanged-selector receipts are the only current execution evidence. Reduced-source assertions await validation. Historical prior oracle: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): After acknowledged phone replies with stale host status, the exact card disappears and Send is enabled; unknown, refused or unverifiable-settlement replies retain enabled choices, while an older host's accepted reply dismisses like an acknowledged one; a same-occurrence view toggle retains pending acknowledgment and real replacements discard it. A slow 32 KiB SSH answer completes all chunks before Enter; cancellation preserves issued bytes but omits remaining groups. Paired settlement invokes the actual provider and lost callbacks remain unknown; older hosts deliver ordinary messages, launch and selector groups once and their accepted answers dismiss as before. An answered card stays hidden across a view remount; a collapsed card is a strip that frees the composer and expands back; an identical question in a new wait shows again; a composer send caught by a new card keeps its bubble without submitting or clearing the line under it. Audit2450 removes the MobileNativeChatView failure-banner callback-only example whose old banner is supplied unchanged by its props. Retain fatal-read gating and the ordering test that preserves a new delivery notice. The removed false-send/old-banner combination has no equivalent replacement; prior raw receipts and budgets retain their original source scope. No new soak, platform, performance or red/green claim.", + "oracle": "Audits3764/3766 retire16 authored/27 expanded mobile cases, including entire HTML-image syntax, Mermaid routing, table styles, file-query encoding, workspace naming and fresh-Git-status adapter suites. Accepted losses include image width/icon filtering, partial-heading streaming, mocked Mermaid key/identity checks, generated table widths/counts, selected-text caret placement, tiny Base64 chunk encoding, twelve query-path roundtrips, locale-import fallback, apostrophe slugging, fresh-status fallback and an intermediate reviewed marker. These are deliberate removals for marginal value; remaining tests are not equivalent replacements. Earlier receipts are historical and do not validate these deleted/reduced drivers. Audit3748 intentionally removes ten authored/ten finite registrations from the surviving media-handle-registry.test.ts driver selected by this full-mobile command. Retired real alarms: nominal minted handle uniqueness/metadata and dimensions; ordinary range/EOF/overread/empty-file/direct chunk-clamp samples; nominal successful release, expired-release false, exact millisecond TTL boundary and ordinary releaseAll replay. Deterministic registry code runs; these examples are removed on marginal value without replacement or fresh execution claims. Seven owner cases retain cap refusal/disposal and sweep-before-admission, nonempty EOF and unknown/released/expired refusal, read TTL refresh, idempotent explicit release and continuation after discard failure. Existing commands, assertions, unrelated wire receipt and timing remain; the driver survives. Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered mobile Vitest command. Its mobile/src include patterns admit the partial live-input-commit and native-media drivers:5 authored/5 finite removals. Accepted losses: two Android-labeled replay samples after mocked composition conversion, an immediate Backspace absence check that does not wait for pending commit or prove local edit, and released-handle/double-release adapter examples. Real hook, registry and adapter logic run; no equivalent replacement or native Android/iOS exercise is claimed. Both drivers and selector stay. The unchanged wire-specific dated receipt does not validate these reduced mobile sources. Audit3666 removes30 authored/36 finite mobile cases, including7 whole drivers. It retires direct consent/channel/token/header-payload/fingerprint/route-object inventories, background legacy-dismissal filtering, the two-row520-entry watermark retention workload, reentrant write-batch example, font-before-ready projection, and legacy-segmenter/scrollback/wrap selection examples. Actual policy, parsing, hashing, tray matching, serialization and xterm buffers execute in these tests; their stated alarms are deliberately lost without replacement. Twelve unchanged authored/19 finite cases retain compact browser geometry regressions, an independent fingerprint-to-host protocol vector, serialized watermark/reload isolation, OSC52 live/replay gating, queue boundaries/reset/generation, disposed font completion and Unicode cell mapping. Pairing classification2/2 was already approved by3657 and receives no3666 delta or credit. Static review only; no runtime, native, provider, browser rendering, OS, remote, mobile/folder parity or new historical fault evidence. Previous oracle (preserved verbatim): Audit3663 removes the complete mobile scan-error message suite (two authored/two finite callbacks). Its4URL assertion loop is one registration. Accept loss of Orca new/legacy Android-download URL classification and other-page invalid-code translated-key mapping. Real URL parsing/classification runs, but the only output observed is an identity-translator key. No camera scan, pairing offer admission, connection or device/UI action is exercised. No equivalent replacement or physical/mobile/mixed-version result claimed. Preserve all historical evidence and metadata bytes. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. The broad mobile runner loses retired-name sequencing and PR action samples while retaining the editor-lifetime and original PR action keeper; commit-message generation is unchanged. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. The broad mobile command loses the entire three-case mocked diff-review controller suite and the stale layout-sequence comparator sample. Keep only the direct layout-versus-scrollback counter distinction; the unchanged dictation retry hook retains complete recording replay. No rendered app, native capture, actual process death or remote execution is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad mobile discovery loses whole prompt-presentation, Jira-URL and folder-source-repository suites. The prompt suite exercised presentation projections; it did not provide native mobile prompt acknowledgment acceptance. Existing direct prompt-controller selectors are unchanged. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. The stale-leaf-liveness suite and its exact command/testFiles selector are removed; its fake terminal refusal/liveness alarms are intentionally lost. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The entire mocked mobile failure-banner suite and its sole send/previous-banner/new-notice ordering alarm are retired. Its filenames are removed from active selectors. Desktop prompt roots and the independent unchanged terminal wire-codec receipt remain at their stated scopes; no mobile send/recovery proof is claimed. Audit2251 narrows agent-paste-draft.test.ts from 25 authored cases (26 literal cases) to four. Retained cases cover buffered readiness on PTY binding, separate spawn/composer lifetimes, real per-PTY paste/Enter serialization against a competing paste, and frame closure/no Enter after a rejected content chunk. Intentionally lost alarms include agent marker and fallback examples, direct-write failure/rejection, missing-PTY and Codex process-only timeout paths, exact nonprimary-PTY routing, full large-body chunk reconstruction, escaping/CRLF samples, internal laziness/yield work assertions, oversized preflight refusal, and exact configured delay/budget counts. No equivalent replacement, new execution, real PTY/provider delivery, rendered/native UI, deployment, measured performance or cross-platform result is claimed. Historical prior account (preserved verbatim): Mobile owner-layout policy retires whole tests and mixed registrations without equivalent replacement coverage. Retained callbacks and reduced selectors need fresh execution at their stated scope; prior measurements do not validate them. Historical oracle: Audit2003: Remove agent-prompt absence routing, throwing/live/missing-probe and cached-probe-count examples from the stale-leaf source. Controller-proven absence, unknown-liveness admission, obsolete-absence clearing and same-ID respawn fences remain at a supplied provider/row seam. Preserve the independent wire-codec receipt only in its original scope. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove partial-runtime terminal-send guard/status/floor/query projection and argument-inventory samples. Retained RPC viewport admission, authenticated-client spoof refusal, text admission and stale-binding fences remain bounded mock-boundary behavior. The unchanged wire-codec receipt remains valid only for its original command; it does not validate this reduced RPC selector. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1908 removes the complete prompt-presentation hook and literal interactive-protocol mapping suites and narrows the interactive card and prompt-card input suites. Lost alarms include replacement approval A settling after answered B; collapse/expand composer ownership and partial-answer presentation; identical new waits after an unmounted view; collapsed transcript re-reads; answered/dismissed status-backed persistence and retirement; and literal answer-to-PTY byte arrays. The retained stale-PTY acknowledgment, cancellation/answer retry, and answered-approval remount/rebind assertions remain meaningful but are not equivalent replacement coverage. No fresh reduced-selector result, physical provider, rendered/native-focus, mixed-version deployment, soak, or measured-budget validation is claimed. The unchanged wire-codec receipt remains valid only for its exact command. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Retained unchanged-selector receipts are the only current execution evidence. Reduced-source assertions await validation. Historical prior oracle: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): After acknowledged phone replies with stale host status, the exact card disappears and Send is enabled; unknown, refused or unverifiable-settlement replies retain enabled choices, while an older host's accepted reply dismisses like an acknowledged one; a same-occurrence view toggle retains pending acknowledgment and real replacements discard it. A slow 32 KiB SSH answer completes all chunks before Enter; cancellation preserves issued bytes but omits remaining groups. Paired settlement invokes the actual provider and lost callbacks remain unknown; older hosts deliver ordinary messages, launch and selector groups once and their accepted answers dismiss as before. An answered card stays hidden across a view remount; a collapsed card is a strip that frees the composer and expands back; an identical question in a new wait shows again; a composer send caught by a new card keeps its bubble without submitting or clearing the line under it. Audit2450 removes the MobileNativeChatView failure-banner callback-only example whose old banner is supplied unchanged by its props. Retain fatal-read gating and the ordering test that preserves a new delivery notice. The removed false-send/old-banner combination has no equivalent replacement; prior raw receipts and budgets retain their original source scope. No new soak, platform, performance or red/green claim.", "commands": [ - "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/prompts/NativeChatInteractiveCard.test.tsx src/renderer/src/components/native-chat/prompts/NativeChatResolvedView.prompt-card-input.test.tsx src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.prompt-card-composer.test.tsx src/renderer/src/components/native-chat/conversation/turns/NativeChatResolvedView.turn-status.test.tsx src/renderer/src/runtime/hosted-terminals/inspection/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft-submit-retry.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/pty-write-ipc-validation.test.ts src/main/runtime/terminal/input/runtime-terminal-writer.test.ts src/main/runtime/rpc/terminal-send.test.ts --maxWorkers=2", + "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/prompts/NativeChatInteractiveCard.test.tsx src/renderer/src/runtime/hosted-terminals/inspection/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft-submit-retry.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/pty-write-ipc-validation.test.ts src/main/runtime/terminal/input/runtime-terminal-writer.test.ts --maxWorkers=2", "ORCA_BACKGROUND_LAUNCH=1 mobile/node_modules/.bin/vitest run --config mobile/vitest.config.ts mobile/src/session/native-chat/input/mobile-prompt-controller.test.ts --maxWorkers=2", "ORCA_BACKGROUND_LAUNCH=1 pnpm test tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts --maxWorkers=1", - "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/prompts/NativeChatInteractiveCard.test.tsx src/renderer/src/components/native-chat/prompts/NativeChatResolvedView.prompt-card-input.test.tsx src/renderer/src/components/native-chat/conversation/turns/NativeChatResolvedView.turn-status.test.tsx src/renderer/src/runtime/hosted-terminals/inspection/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft-submit-retry.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/pty-write-ipc-validation.test.ts --maxWorkers=2", + "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/prompts/NativeChatInteractiveCard.test.tsx src/renderer/src/runtime/hosted-terminals/inspection/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft-submit-retry.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/pty-write-ipc-validation.test.ts --maxWorkers=2", "ORCA_BACKGROUND_LAUNCH=1 mobile/node_modules/.bin/vitest run --config mobile/vitest.config.ts --maxWorkers=2" ], "testFiles": [ "src/renderer/src/components/native-chat/prompts/NativeChatInteractiveCard.test.tsx", - "src/renderer/src/components/native-chat/prompts/NativeChatResolvedView.prompt-card-input.test.tsx", - "src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.prompt-card-composer.test.tsx", - "src/renderer/src/components/native-chat/conversation/turns/NativeChatResolvedView.turn-status.test.tsx", "src/renderer/src/runtime/hosted-terminals/inspection/runtime-terminal-inspection.test.ts", "src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft.test.ts", "src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft-submit-retry.test.ts", "src/main/ipc/pty/ipc/write-input-user-input.test.ts", "src/main/ipc/pty/pty-write-ipc-validation.test.ts", "src/main/runtime/terminal/input/runtime-terminal-writer.test.ts", - "src/main/runtime/rpc/terminal-send.test.ts", "mobile/src/session/native-chat/input/mobile-prompt-controller.test.ts", "tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts" ], @@ -499,19 +495,6 @@ "keeps structured answer controls after a thrown send" ] }, - { - "file": "src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.prompt-card-composer.test.tsx", - "assertions": [ - "keeps an in-flight message visible and never submits it into the approval", - "routes no typing to the hidden composer until the card is answered" - ] - }, - { - "file": "src/renderer/src/components/native-chat/prompts/NativeChatResolvedView.prompt-card-input.test.tsx", - "assertions": [ - "keeps an answered approval hidden across a chat view remount and a PTY rebind" - ] - }, { "file": "src/main/runtime/terminal/input/runtime-terminal-writer.test.ts", "assertions": [ @@ -550,6 +533,11 @@ "evidence": "No fresh reduced-source performance measurement is claimed. Historical account: Historical prior-selector budget; changed selectors have no fresh measurement. Historical account for the pre-audit test set; removed work-count alarms and changed selectors have no fresh measurement. Historical account for the pre-audit test set; removed work-count alarms and changed selectors have no fresh measurement. No polling, subprocess, startup await, new status producer or dismissal timer. Reuses the existing bounded per-tab committed observation and per-PTY queue; waits for each group before its existing pacing timer. Duplicate-cancel and yielding chunk tests bound writes. Optional paired proof reuses provider settlement only for requesting clients; legacy requests keep their raw path." }, "knownGaps": [ + "Audit3984 retires all four remaining viewport-fixture suites (14 authored/15 finite cases) and the fixture after composing the sender-host deletion. Accepted source-alarm losses include live-region/disclosure continuity, task/question/approval history and revision handling, stale turn status, prompt-dismissal remount/rebind, and pending-send cancellation when approval arrives between body and Enter. No equivalent replacement or fresh runtime validation is claimed.", + "Audit3984 retired assertionRefs, preserved verbatim as historical values; not active coverage: [{\"file\":\"src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.prompt-card-composer.test.tsx\",\"assertions\":[\"keeps an in-flight message visible and never submits it into the approval\",\"routes no typing to the hidden composer until the card is answered\"]},{\"file\":\"src/renderer/src/components/native-chat/prompts/NativeChatResolvedView.prompt-card-input.test.tsx\",\"assertions\":[\"keeps an answered approval hidden across a chat view remount and a PTY rebind\"]}]", + "Audits3764/3766 retire16 authored/27 expanded mobile cases, including entire HTML-image syntax, Mermaid routing, table styles, file-query encoding, workspace naming and fresh-Git-status adapter suites. Accepted losses include image width/icon filtering, partial-heading streaming, mocked Mermaid key/identity checks, generated table widths/counts, selected-text caret placement, tiny Base64 chunk encoding, twelve query-path roundtrips, locale-import fallback, apostrophe slugging, fresh-status fallback and an intermediate reviewed marker. These are deliberate removals for marginal value; remaining tests are not equivalent replacements. Earlier receipts are historical and do not validate these deleted/reduced drivers.", + "Audit3748 intentionally removes ten authored/ten finite registrations from the surviving media-handle-registry.test.ts driver selected by this full-mobile command. Retired real alarms: nominal minted handle uniqueness/metadata and dimensions; ordinary range/EOF/overread/empty-file/direct chunk-clamp samples; nominal successful release, expired-release false, exact millisecond TTL boundary and ordinary releaseAll replay. Deterministic registry code runs; these examples are removed on marginal value without replacement or fresh execution claims. Seven owner cases retain cap refusal/disposal and sweep-before-admission, nonempty EOF and unknown/released/expired refusal, read TTL refresh, idempotent explicit release and continuation after discard failure. Existing commands, assertions, unrelated wire receipt and timing remain; the driver survives.", + "Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered mobile Vitest command. Its mobile/src include patterns admit the partial live-input-commit and native-media drivers:5 authored/5 finite removals. Accepted losses: two Android-labeled replay samples after mocked composition conversion, an immediate Backspace absence check that does not wait for pending commit or prove local edit, and released-handle/double-release adapter examples. Real hook, registry and adapter logic run; no equivalent replacement or native Android/iOS exercise is claimed. Both drivers and selector stay. The unchanged wire-specific dated receipt does not validate these reduced mobile sources.", "Audit3666 removes30 authored/36 finite mobile cases, including7 whole drivers. It retires direct consent/channel/token/header-payload/fingerprint/route-object inventories, background legacy-dismissal filtering, the two-row520-entry watermark retention workload, reentrant write-batch example, font-before-ready projection, and legacy-segmenter/scrollback/wrap selection examples. Actual policy, parsing, hashing, tray matching, serialization and xterm buffers execute in these tests; their stated alarms are deliberately lost without replacement. Twelve unchanged authored/19 finite cases retain compact browser geometry regressions, an independent fingerprint-to-host protocol vector, serialized watermark/reload isolation, OSC52 live/replay gating, queue boundaries/reset/generation, disposed font completion and Unicode cell mapping. Pairing classification2/2 was already approved by3657 and receives no3666 delta or credit. Static review only; no runtime, native, provider, browser rendering, OS, remote, mobile/folder parity or new historical fault evidence.", "Audit3663 removes the complete mobile scan-error message suite (two authored/two finite callbacks). Its4URL assertion loop is one registration. Accept loss of Orca new/legacy Android-download URL classification and other-page invalid-code translated-key mapping. Real URL parsing/classification runs, but the only output observed is an identity-translator key. No camera scan, pairing offer admission, connection or device/UI action is exercised. No equivalent replacement or physical/mobile/mixed-version result claimed. Preserve all historical evidence and metadata bytes.", "Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded.", @@ -607,7 +595,8 @@ "Complete prior testFiles before exact deleted selectors were pruned: [\"src/renderer/src/components/native-chat/prompts/NativeChatInteractiveCard.test.tsx\",\"src/renderer/src/components/native-chat/prompts/NativeChatResolvedView.prompt-card-input.test.tsx\",\"src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.prompt-card-composer.test.tsx\",\"src/renderer/src/components/native-chat/conversation/turns/NativeChatResolvedView.turn-status.test.tsx\",\"src/renderer/src/runtime/hosted-terminals/inspection/runtime-terminal-inspection.test.ts\",\"src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft.test.ts\",\"src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft-submit-retry.test.ts\",\"src/main/ipc/pty/ipc/write-input-user-input.test.ts\",\"src/main/ipc/pty/pty-write-ipc-validation.test.ts\",\"src/main/runtime/terminal/input/runtime-terminal-writer.test.ts\",\"src/main/runtime/rpc/terminal-send.test.ts\",\"src/main/runtime/terminal/input/terminal-send-stale-leaf-liveness.test.ts\",\"mobile/src/session/native-chat/input/mobile-prompt-controller.test.ts\",\"tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts\"]", "Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad mobile discovery loses whole prompt-presentation, Jira-URL and folder-source-repository suites. The prompt suite exercised presentation projections; it did not provide native mobile prompt acknowledgment acceptance. Existing direct prompt-controller selectors are unchanged. All prior notes, assertion references and complete dated receipts retain their original historical scopes.", "Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. The broad mobile command loses the entire three-case mocked diff-review controller suite and the stale layout-sequence comparator sample. Keep only the direct layout-versus-scrollback counter distinction; the unchanged dictation retry hook retains complete recording replay. No rendered app, native capture, actual process death or remote execution is claimed. All prior notes and archived receipts retain original scopes.", - "Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. The broad mobile runner loses retired-name sequencing and PR action samples while retaining the editor-lifetime and original PR action keeper; commit-message generation is unchanged. Earlier notes, complete dated receipts and archived gaps retain their original scopes." + "Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. The broad mobile runner loses retired-name sequencing and PR action samples while retaining the editor-lifetime and original PR action keeper; commit-message generation is unchanged. Earlier notes, complete dated receipts and archived gaps retain their original scopes.", + "Audit3911 removes terminal-send.test.ts and accepts loss of its supplied client/query-reply refusal, oversized ASCII error-redaction, and oversized emoji byte-limit guard alarms. Remaining tests do not replace these three deleted cases; archived evidence remains historical." ], "promotionCriteria": [ "Record change-reverted red/green evidence and repeatable remote rendered approval/question/dictation journeys.", @@ -1310,10 +1299,10 @@ "providers": ["local", "remote-runtime"], "coveredPlatforms": [], "coveredProviders": [], - "coverageNotes": "Audit1670 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: Actual startOrcad entry with mocked daemon/RPC startup boundaries; real controller, push service, and persisted device registry. Gateway send is stubbed.", + "coverageNotes": "Audit3738 removes the explicit-registration seven-day lease example from desktop-push-service.test.ts. Its register/registry expiry arithmetic was real, but the ordinary dispatch omitted notificationSeq/notificationEpoch and returned null before target enumeration/send, so it did not prove delivery leaves a lease unchanged. The exact expiry and explicit-renewal alarm is intentionally retired without replacement. This gate already has no active commands, testFiles, assertionRefs or evidenceRuns; prior lease oracle text is historical intent, not a current retained execution claim. Audit1670 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: Actual startOrcad entry with mocked daemon/RPC startup boundaries; real controller, push service, and persisted device registry. Gateway send is stubbed.", "motivatingLinks": ["https://github.com/stablyai/orca/pull/19204"], "invariant": "Headless startup installs and disposes push delivery; desktop notification categories remain authoritative, the three-minute away policy is preserved, and host activity cannot extend the seven-day mobile lease.", - "oracle": "Require registration after RPC identity initialization and shutdown cleanup; idle 179/180/0 yields false/true/false in retained event metadata and exactly one gateway push. Legacy socket subscriptions preserve notification filtering, while opted-in push clients can request dismissal reconciliation. Desktop categories remain authoritative. Persisted lease expires exactly at seven days and only explicit registration renews it.", + "oracle": "Audit3738 removes the explicit-registration seven-day lease example from desktop-push-service.test.ts. Its register/registry expiry arithmetic was real, but the ordinary dispatch omitted notificationSeq/notificationEpoch and returned null before target enumeration/send, so it did not prove delivery leaves a lease unchanged. The exact expiry and explicit-renewal alarm is intentionally retired without replacement. This gate already has no active commands, testFiles, assertionRefs or evidenceRuns; prior lease oracle text is historical intent, not a current retained execution claim. Require registration after RPC identity initialization and shutdown cleanup; idle 179/180/0 yields false/true/false in retained event metadata and exactly one gateway push. Legacy socket subscriptions preserve notification filtering, while opted-in push clients can request dismissal reconciliation. Desktop categories remain authoritative. Persisted lease expires exactly at seven days and only explicit registration renews it.", "commands": [], "testFiles": [], "assertionRefs": [], @@ -1336,6 +1325,7 @@ }, "promotionCriteria": ["Collect repeated CI runs without unexplained failures."], "knownGaps": [ + "Audit3738 removes the explicit-registration seven-day lease example from desktop-push-service.test.ts. Its register/registry expiry arithmetic was real, but the ordinary dispatch omitted notificationSeq/notificationEpoch and returned null before target enumeration/send, so it did not prove delivery leaves a lease unchanged. The exact expiry and explicit-renewal alarm is intentionally retired without replacement. This gate already has no active commands, testFiles, assertionRefs or evidenceRuns; prior lease oracle text is historical intent, not a current retained execution claim.", "Audit1670 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.", "Does not prove APNs silent background wakeup or actual operating-system idle transitions.", "Rendererless agent/bell event generation remains outside the documented feature contract.", @@ -2192,13 +2182,13 @@ "providers": ["local-daemon", "ssh-daemon", "paired-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": ["local-daemon"], - "coverageNotes": "Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Real TerminalHost, Session, and subprocess wrapper with injected native I/O failures and mocked OS signals. Local non-daemon and SSH-relay implementations are unaffected; daemon consumers on SSH, WSL, paired runtimes, and mobile retain host-owned semantics. Live Linux/Windows/WSL and remote runs remain gaps. No git or folder-workspace assumptions. The fault-injection suite also runs with simulated darwin/linux/win32 platform branches; these do not constitute native OS coverage. Native macOS coverage now proves shell exit and PTY master-fd closure, input/output round trips, and teardown of a paused producer for both graceful and immediate cleanup. Windows single-close/job escalation and pre-listener output/status are fault-injected contracts. Audit1302: src/main/daemon/terminal-host-teardown-recreate.test.ts: Fake subprocess handles synthesize exits via real40ms/30s timers or manual exit callback, with descendant retirement mocked away; assertions inspect isNew/refusal/spawn counts. No real subprocess/PTY teardown/recreation or owned-tree retention boundary. Lose artificial teardown/attach/shutdown/cancellation scheduling alarms; no equivalent replacement. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim.", + "coverageNotes": "Audit 3959 retires the whole session.test.ts driver (27 authored / 33 finite cases): startup/echo filtering, readiness input gates, ownership confirmation, detach authority, and termination retry/exit ordering alarms are intentionally lost. No equivalent replacement or fresh runtime validation is claimed. Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Real TerminalHost, Session, and subprocess wrapper with injected native I/O failures and mocked OS signals. Local non-daemon and SSH-relay implementations are unaffected; daemon consumers on SSH, WSL, paired runtimes, and mobile retain host-owned semantics. Live Linux/Windows/WSL and remote runs remain gaps. No git or folder-workspace assumptions. The fault-injection suite also runs with simulated darwin/linux/win32 platform branches; these do not constitute native OS coverage. Native macOS coverage now proves shell exit and PTY master-fd closure, input/output round trips, and teardown of a paused producer for both graceful and immediate cleanup. Windows single-close/job escalation and pre-listener output/status are fault-injected contracts. Audit1302: src/main/daemon/terminal-host-teardown-recreate.test.ts: Fake subprocess handles synthesize exits via real40ms/30s timers or manual exit callback, with descendant retirement mocked away; assertions inspect isNew/refusal/spawn counts. No real subprocess/PTY teardown/recreation or owned-tree retention boundary. Lose artificial teardown/attach/shutdown/cancellation scheduling alarms; no equivalent replacement. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim.", "motivatingLinks": ["docs/terminal-daemon-session-leak-investigation.md"], "invariant": "I/O errors must not establish physical exit or disable termination of an owned PTY. Session and native handle disposal require the exit event.", "oracle": "Inject write and resize failures, require graceful and forced signals to reach the native owner, keep producer resume available, suppress repeated failed I/O, deliver output and exit, and suppress signals after exit. Across 32 create/close cycles per failure, retain each session before exit and release its native handle and emulator exactly once afterwards. Mark physical exit before notifying listeners; reentrant kill/forceKill/signal from those listeners must never signal the retired PID. A native POSIX test performs input/output and resize, pauses the producer, injects each I/O failure, then gracefully or immediately closes 16 real shells; require ESRCH for each child PID and EBADF for each PTY master fd.", "commands": [ "pnpm test src/main/daemon/pty-subprocess/testing/pty-subprocess-io-failure-cleanup.test.ts", - "pnpm test src/main/daemon/pty-subprocess/testing/pty-subprocess-io-failure-cleanup.test.ts src/main/daemon/pty-subprocess/testing/pty-subprocess-handle-lifecycle.test.ts src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts src/main/daemon/terminal-host/testing/terminal-session-teardown.test.ts src/main/daemon/sessions/testing/session.test.ts", + "pnpm test src/main/daemon/pty-subprocess/testing/pty-subprocess-io-failure-cleanup.test.ts src/main/daemon/pty-subprocess/testing/pty-subprocess-handle-lifecycle.test.ts src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts src/main/daemon/terminal-host/testing/terminal-session-teardown.test.ts", "pnpm test src/main/daemon/pty-subprocess/testing/pty-subprocess-io-failure-native.test.ts" ], "testFiles": [ @@ -2206,7 +2196,6 @@ "src/main/daemon/pty-subprocess/testing/pty-subprocess-handle-lifecycle.test.ts", "src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts", "src/main/daemon/terminal-host/testing/terminal-session-teardown.test.ts", - "src/main/daemon/sessions/testing/session.test.ts", "src/main/daemon/pty-subprocess/testing/pty-subprocess-io-failure-native.test.ts" ], "assertionRefs": [ @@ -2637,7 +2626,7 @@ "providers": ["local", "local-daemon", "ssh-daemon", "ssh-relay", "paired-runtime"], "coveredPlatforms": ["macos", "linux"], "coveredProviders": ["local", "local-daemon", "ssh-relay", "paired-runtime"], - "coverageNotes": "Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Real macOS node-pty integration covers zsh 5.9 .zshenv/.zprofile and bash 3.2 profile replacement shells, including exec -a names, same-shell and child-process silent reads, a blocking zle-line-init hook, non-shell readline replacements, and a non-shell image renamed zsh. A real Fish PTY proves marker stripping is byte-exact and does not render bracketed-paste control text. Ubuntu 20.04/Bash 5.0 and Ubuntu 24.04/Bash 5.2 containers cover scalar and array PROMPT_COMMAND composition, including real zoxide on 24.04. Deterministic owner contracts cover local, daemon, and SSH relay identity/readiness composition plus provider-owned delivery; explicit terminal-paste remains renderer-owned. Live isolated journeys cover a macOS headed desktop owner with paired web client, headless orca serve with paired web client, and a Docker Linux OpenSSH/Bash target with one readiness-time reconnect. Linux desktop, WSL/Windows, live zsh-over-SSH, and physical remote hosts remain gaps.", + "coverageNotes": "Audit 3959 retires the whole session.test.ts driver (27 authored / 33 finite cases): startup/echo filtering, readiness input gates, ownership confirmation, detach authority, and termination retry/exit ordering alarms are intentionally lost. No equivalent replacement or fresh runtime validation is claimed. Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Real macOS node-pty integration covers zsh 5.9 .zshenv/.zprofile and bash 3.2 profile replacement shells, including exec -a names, same-shell and child-process silent reads, a blocking zle-line-init hook, non-shell readline replacements, and a non-shell image renamed zsh. A real Fish PTY proves marker stripping is byte-exact and does not render bracketed-paste control text. Ubuntu 20.04/Bash 5.0 and Ubuntu 24.04/Bash 5.2 containers cover scalar and array PROMPT_COMMAND composition, including real zoxide on 24.04. Deterministic owner contracts cover local, daemon, and SSH relay identity/readiness composition plus provider-owned delivery; explicit terminal-paste remains renderer-owned. Live isolated journeys cover a macOS headed desktop owner with paired web client, headless orca serve with paired web client, and a Docker Linux OpenSSH/Bash target with one readiness-time reconnect. Linux desktop, WSL/Windows, live zsh-over-SSH, and physical remote hosts remain gaps.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/13767", "https://linear.app/stably/issue/STA-4067", @@ -2650,8 +2639,8 @@ "invariant": "Shell startup scanning preserves every non-Orca output byte in order across arbitrary PTY chunk boundaries. Bash scalar and supported array PROMPT_COMMAND values preserve user bytes, hook order, and foreground exit status while emitting exactly one OSC 133 A/C/D lifecycle without syntax errors. Before user startup files run, the wrapper publishes its shell PID. If a later exec discards the ready marker, proof-based recovery releases queued startup input only after the launched shell's actual executable image with that exact PID owns the PTY foreground, emits its post-hook line-editor enable sequence, and exposes zle/readline termios; startup reads, line-init hooks, child foreground processes, and non-shell readline replacements cannot trigger that proof. The existing bounded compatibility timeout may enqueue input without proof, but must not publish readiness, lose or duplicate that input across reconnect, or execute it before the replacement shell can accept it.", "oracle": "Audit1683 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Split Fish output immediately after the ready marker and after the following ESC introducer; local and daemon owners must emit the exact ESC [ ? 2004 h bytes and headless xterm must not render literal control text. Run the real generated wrappers under node-pty with disposable zsh, bash, and Fish startup files. Exercise Bash scalar and array PROMPT_COMMAND values with empty, repeated, escaped, whitespace, control-byte, odd-backslash, status-mutating, DEBUG-trap, zoxide, and RHEL-style hooks; require exact A,C,D:0,A,C,D:1,A,C ordering and byte preservation. Plain and exec -a replacement shells must receive one queued command at their first completed line editor without waiting for the 15-second timeout. The identical oracle must time out without the startup identity and prompt fallback. Same-shell reads, child-process reads, a blocking zle-line-init hook, sqlite3, and sqlite3 renamed zsh must not trigger prompt fallback. Relay owner coverage must use the same lossless scanner composition and release through the same prompt contract.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/shell-readiness/testing/repro-13767-shell-ready-marker-lost-to-exec.test.ts src/main/daemon/shell-readiness/testing/bash-prompt-command-composition.test.ts src/main/pty/shell-startup/line-editor-ready-output-scanner.test.ts src/main/pty/shell-startup/shell-startup-identity-scanner.test.ts src/main/pty/shell-startup/shell-startup-output-scanner.test.ts src/shared/terminal/pty/native-process/pty-slave-line-discipline-echo.test.ts src/shared/terminal/pty/native-process/shell-process-readiness.test.ts src/main/daemon/sessions/testing/session.test.ts src/main/daemon/shell-readiness/testing/shell-ready.test.ts src/main/providers/local-pty/local-pty-shell-ready-marker-scan.test.ts src/main/providers/local-pty/local-pty-shell-ready-startup-command.test.ts src/main/providers/local-pty/local-pty-shell-ready-wrapper-generation.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/shell-readiness/testing/repro-13767-shell-ready-marker-lost-to-exec.test.ts src/main/pty/shell-startup/line-editor-ready-output-scanner.test.ts src/main/pty/shell-startup/shell-startup-identity-scanner.test.ts src/main/pty/shell-startup/shell-startup-output-scanner.test.ts src/shared/terminal/pty/native-process/pty-slave-line-discipline-echo.test.ts src/shared/terminal/pty/native-process/shell-process-readiness.test.ts src/main/daemon/sessions/testing/session.test.ts src/main/daemon/shell-readiness/testing/shell-ready.test.ts src/main/providers/local-pty/local-pty-shell-ready-marker-scan.test.ts src/main/providers/local-pty/local-pty-shell-ready-startup-command.test.ts src/main/providers/local-pty/local-pty-shell-ready-wrapper-generation.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/shell-readiness/testing/repro-13767-shell-ready-marker-lost-to-exec.test.ts src/main/daemon/shell-readiness/testing/bash-prompt-command-composition.test.ts src/main/pty/shell-startup/line-editor-ready-output-scanner.test.ts src/main/pty/shell-startup/shell-startup-identity-scanner.test.ts src/main/pty/shell-startup/shell-startup-output-scanner.test.ts src/shared/terminal/pty/native-process/pty-slave-line-discipline-echo.test.ts src/shared/terminal/pty/native-process/shell-process-readiness.test.ts src/main/daemon/shell-readiness/testing/shell-ready.test.ts src/main/providers/local-pty/local-pty-shell-ready-marker-scan.test.ts src/main/providers/local-pty/local-pty-shell-ready-startup-command.test.ts src/main/providers/local-pty/local-pty-shell-ready-wrapper-generation.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/shell-readiness/testing/repro-13767-shell-ready-marker-lost-to-exec.test.ts src/main/pty/shell-startup/line-editor-ready-output-scanner.test.ts src/main/pty/shell-startup/shell-startup-identity-scanner.test.ts src/main/pty/shell-startup/shell-startup-output-scanner.test.ts src/shared/terminal/pty/native-process/pty-slave-line-discipline-echo.test.ts src/shared/terminal/pty/native-process/shell-process-readiness.test.ts src/main/daemon/shell-readiness/testing/shell-ready.test.ts src/main/providers/local-pty/local-pty-shell-ready-marker-scan.test.ts src/main/providers/local-pty/local-pty-shell-ready-startup-command.test.ts src/main/providers/local-pty/local-pty-shell-ready-wrapper-generation.test.ts", "pnpm exec vitest run --config config/vitest.config.ts --maxWorkers=1 src/main/daemon/shell-readiness/testing/shell-ready.test.ts src/main/pty/shell-startup/shell-startup-output-scanner.test.ts", "ORCA_E2E_WEB_CLIENT=1 SKIP_BUILD=1 pnpm exec playwright test tests/e2e/paired-startup-exec-readiness.spec.ts --config tests/playwright.config.ts --project electron-headless --project electron-headful --workers=1" ], @@ -2663,7 +2652,6 @@ "src/main/pty/shell-startup/shell-startup-output-scanner.test.ts", "src/shared/terminal/pty/native-process/pty-slave-line-discipline-echo.test.ts", "src/shared/terminal/pty/native-process/shell-process-readiness.test.ts", - "src/main/daemon/sessions/testing/session.test.ts", "src/main/daemon/shell-readiness/testing/shell-ready.test.ts", "src/main/providers/local-pty/local-pty-shell-ready-marker-scan.test.ts", "src/main/providers/local-pty/local-pty-shell-ready-startup-command.test.ts", @@ -3272,7 +3260,7 @@ "id": "desktop-relay.assignment-backpressure", "title": "Desktop relay drain recovery cannot amplify a director outage", "maturity": "experimental", - "protection": "partial", + "protection": "none", "owner": "desktop-runtime", "layer": "main-relay-state-machine", "surfaces": [ @@ -3282,50 +3270,16 @@ ], "platforms": ["macos", "linux", "windows"], "providers": ["cloud-relay"], - "coveredPlatforms": ["macos"], - "coveredProviders": ["cloud-relay"], - "coverageNotes": "Deterministic main-process tests cover duplicate drain notifications, full-jitter backoff, Retry-After during initial setup and drain recovery, successful recovery, and broker-close cleanup. Packaged desktop, mixed-version fleets, GFE, and production Cloud SQL remain live-test gaps.", + "coveredPlatforms": [], + "coveredProviders": [], + "coverageNotes": "D42 RPC owner layout has no unchanged passed current receipt for this gate; no fresh execution or replacement coverage claimed. Historical prior account (preserved): Deterministic main-process tests cover duplicate drain notifications, full-jitter backoff, Retry-After during initial setup and drain recovery, successful recovery, and broker-close cleanup. Packaged desktop, mixed-version fleets, GFE, and production Cloud SQL remain live-test gaps.", "motivatingLinks": ["https://github.com/stablyai/orca-cloud/actions/runs/30223521062"], "invariant": "One relay host may have at most one assignment attempt or retry timer per recovery path. Sustained director failure must increase the retry window up to five minutes, a bounded Retry-After must be respected during initial setup and drain recovery, shutdown must cancel pending work, and recovery must activate the authoritative assigned origin.", "oracle": "Inject duplicate drain events, deterministic randomness, fake time, repeated assignment failures, a 30-second Retry-After during initial setup and drain recovery, broker close, and eventual director recovery. Count every assignment call, require 500 ms then 1,000 ms retry windows, reject duplicate fanout, require no pre-hint retry or post-close work, and prove the recovered cell becomes authoritative.", - "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/mobile-cloud-relay/relay-session-broker.test.ts src/main/runtime/mobile-cloud-relay/relay-http-client.test.ts src/main/runtime/mobile-cloud-relay/relay-auth-coordinator-recovery.test.ts --reporter=dot" - ], - "testFiles": [ - "src/main/runtime/mobile-cloud-relay/relay-session-broker.test.ts", - "src/main/runtime/mobile-cloud-relay/relay-http-client.test.ts", - "src/main/runtime/mobile-cloud-relay/relay-auth-coordinator-recovery.test.ts" - ], - "assertionRefs": [ - { - "file": "src/main/runtime/mobile-cloud-relay/relay-session-broker.test.ts", - "assertions": [ - "duplicate drain notifications share one exponentially backed-off retry schedule", - "Retry-After suppresses early assignment requests", - "broker close prevents retry resurrection", - "a later successful assignment activates the new origin" - ] - }, - { - "file": "src/main/runtime/mobile-cloud-relay/relay-http-client.test.ts", - "assertions": ["assignment overload preserves a bounded Retry-After hint"] - }, - { - "file": "src/main/runtime/mobile-cloud-relay/relay-auth-coordinator-recovery.test.ts", - "assertions": ["initial relay setup does not retry before Retry-After expires"] - } - ], - "evidenceRuns": [ - { - "date": "2026-07-26", - "runner": "local", - "platform": "macos", - "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/mobile-cloud-relay/relay-session-broker.test.ts src/main/runtime/mobile-cloud-relay/relay-http-client.test.ts src/main/runtime/mobile-cloud-relay/relay-auth-coordinator-recovery.test.ts --reporter=dot", - "result": "passed", - "durationSeconds": 0.49, - "summary": "Three focused relay files passed with 25 assertions." - } - ], + "commands": [], + "testFiles": [], + "assertionRefs": [], + "evidenceRuns": [], "runtimeBudget": { "p95Seconds": 5, "scope": "focused desktop relay state-machine tests" @@ -3350,7 +3304,9 @@ "knownGaps": [ "No packaged desktop or physical phone was exercised.", "The deterministic seam does not measure production GFE, carrier NAT, DNS, TLS, or Cloud SQL behavior.", - "Legacy desktop versions remain dependent on server-side overload protection." + "Legacy desktop versions remain dependent on server-side overload protection.", + "D42 RPC owner layout retires this complete dated receipt because its source/command scope changed. It does not validate relocated/reduced selectors. Native complete receipt verbatim:\n{\n \"date\": \"2026-07-26\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/mobile-cloud-relay/relay-session-broker.test.ts src/main/runtime/mobile-cloud-relay/relay-http-client.test.ts src/main/runtime/mobile-cloud-relay/relay-auth-coordinator-recovery.test.ts --reporter=dot\",\n \"result\": \"passed\",\n \"durationSeconds\": 0.49,\n \"summary\": \"Three focused relay files passed with 25 assertions.\"\n }", + "D42 RPC owner layout archives complete native active selector/coverage fields because no unchanged passed current receipt remains. These native fields are historical scope, not current execution:\n{\n \"commands\": [\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/mobile-cloud-relay/relay-session-broker.test.ts src/main/runtime/mobile-cloud-relay/relay-http-client.test.ts src/main/runtime/mobile-cloud-relay/relay-auth-coordinator-recovery.test.ts --reporter=dot\"\n ],\n \"testFiles\": [\n \"src/main/runtime/mobile-cloud-relay/relay-session-broker.test.ts\",\n \"src/main/runtime/mobile-cloud-relay/relay-http-client.test.ts\",\n \"src/main/runtime/mobile-cloud-relay/relay-auth-coordinator-recovery.test.ts\"\n ],\n \"assertionRefs\": [\n {\n \"file\": \"src/main/runtime/mobile-cloud-relay/relay-session-broker.test.ts\",\n \"assertions\": [\n \"duplicate drain notifications share one exponentially backed-off retry schedule\",\n \"Retry-After suppresses early assignment requests\",\n \"broker close prevents retry resurrection\",\n \"a later successful assignment activates the new origin\"\n ]\n },\n {\n \"file\": \"src/main/runtime/mobile-cloud-relay/relay-http-client.test.ts\",\n \"assertions\": [\n \"assignment overload preserves a bounded Retry-After hint\"\n ]\n },\n {\n \"file\": \"src/main/runtime/mobile-cloud-relay/relay-auth-coordinator-recovery.test.ts\",\n \"assertions\": [\n \"initial relay setup does not retry before Retry-After expires\"\n ]\n }\n ],\n \"protection\": \"partial\",\n \"maturity\": \"experimental\",\n \"coveredPlatforms\": [\n \"macos\"\n ],\n \"coveredProviders\": [\n \"cloud-relay\"\n ]\n}" ], "demotionRule": "Keep experimental or demote if assignment calls overlap, duplicate drain events bypass backoff, Retry-After is ignored, close resurrects work, or mixed-version request rate exceeds the reviewed director budget." }, @@ -3564,15 +3520,16 @@ ], "platforms": ["macos", "linux", "windows"], "providers": ["local", "orca-server"], - "coveredPlatforms": ["macos"], + "coveredPlatforms": ["linux"], "coveredProviders": ["local", "orca-server"], - "coverageNotes": "Audit1931 (sources1928/1929): Partial real local-loopback multi-client suite loses supplied device-metadata attribution, direct worktree-local navigation, focused terminal-create projection and crossed-two-server inventory alarms. Retire the worktree-local alias and the stale host-originated reveal-to-all alias: no surviving callback backs that positive reveal claim; the retained host-create callback instead excludes paired observers. Keep the five exact caller-only create, explicit all-surface, reconnect non-replay, headless caller-only and follow-intent aliases. No equivalent replacement or external remote-host journey is assigned. 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): A real two-client integration harness pairs two authenticated devices to one OrcaRuntimeService over WebSockets with E2EE and drives worktree.create through the real RPC dispatcher, in both headed-notifier and headless orca-serve shapes. The headless case is a modeled `orca serve` runtime shape — no notifier, no attached window — not a CLI bootstrap, and the in-process reveal non-regression calls createManagedWorktree directly. A headed Electron journey runs the desktop app as the remote server with two independently paired web clients in separate partitions and asserts each client's rendered active worktree. Windows and Linux are covered by the platform-neutral contract only; the reported field topology was a Windows server with mixed-OS clients. Audit1313: src/main/runtime/rpc/methods/worktree-create-navigation.test.ts: Fake runtime creation/show/dedupe under real RPC decoder only inspects forwarded navigation option matrices, with duplicate desktop case. Lose runtime/mobile/legacy CLI/follow/all navigation authority wiring; no rendered reveal. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim.", + "coverageNotes": "Audit3924 fresh local Linux evidence covers only the unchanged in-process paired-WebSocket integration suite (9 tests passed), not rendered Electron, actual headless CLI bootstrap, live remote/mobile or other platforms. Audit3918: Remove the standalone paired-client selection example; its distinct-device-id and initial selection alarms are intentionally lost. Retain the manually selected create-and-observe and host-folder journeys without claiming equivalent replacement, composer auto-navigation, folder-picker selection delivery, actual external-agent execution, live remote/mobile or cross-platform validation. The changed Electron selector has no fresh execution receipt. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial real local-loopback multi-client suite loses supplied device-metadata attribution, direct worktree-local navigation, focused terminal-create projection and crossed-two-server inventory alarms. Retire the worktree-local alias and the stale host-originated reveal-to-all alias: no surviving callback backs that positive reveal claim; the retained host-create callback instead excludes paired observers. Keep the five exact caller-only create, explicit all-surface, reconnect non-replay, headless caller-only and follow-intent aliases. No equivalent replacement or external remote-host journey is assigned. 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): A real two-client integration harness pairs two authenticated devices to one OrcaRuntimeService over WebSockets with E2EE and drives worktree.create through the real RPC dispatcher, in both headed-notifier and headless orca-serve shapes. The headless case is a modeled `orca serve` runtime shape — no notifier, no attached window — not a CLI bootstrap, and the in-process reveal non-regression calls createManagedWorktree directly. A headed Electron journey runs the desktop app as the remote server with two independently paired web clients in separate partitions and asserts each client's rendered active worktree. Windows and Linux are covered by the platform-neutral contract only; the reported field topology was a Windows server with mixed-OS clients. Audit1313: src/main/runtime/rpc/methods/worktree-create-navigation.test.ts: Fake runtime creation/show/dedupe under real RPC decoder only inspects forwarded navigation option matrices, with duplicate desktop case. Lose runtime/mobile/legacy CLI/follow/all navigation authority wiring; no rendered reveal. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim.", "motivatingLinks": ["https://github.com/stablyai/orca/issues/11027"], "invariant": "View intent belongs to the connection that requested it. With no explicit navigation target, a workspace create arriving over a paired desktop/web client connection activates only that caller; it must not emit an activateWorktree client event to sibling connections or drive the host renderer. An explicit navigation of host/clients/all remains an allowed, tested follow intent. Shared model state — repo/worktree catalogs, terminals, agent output — must keep propagating to every client unchanged. In-process and CLI creates keep notifying the host and all clients so a headless server's only viewer still gets its reveal.", - "oracle": "Audit1931 (sources1928/1929): Partial real local-loopback multi-client suite loses supplied device-metadata attribution, direct worktree-local navigation, focused terminal-create projection and crossed-two-server inventory alarms. Retire the worktree-local alias and the stale host-originated reveal-to-all alias: no surviving callback backs that positive reveal claim; the retained host-create callback instead excludes paired observers. Keep the five exact caller-only create, explicit all-surface, reconnect non-replay, headless caller-only and follow-intent aliases. No equivalent replacement or external remote-host journey is assigned. 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): notifyActivateWorktree takes its navigation target as a required parameter, so a create call site that forgets to forward it is a compile error rather than a silent fallback to broadcasting — mutation testing confirmed all six call sites (folder, git, and remote/SSH branches, startup and no-startup each) are killed by typecheck. Behaviorally: two paired clients subscribe to runtime.clientEvents. Client A creates a workspace with activate:true; a reposChanged fence emitted after the create must be the next frame each client sees, proving no activation frame was interleaved, while worktreesChanged still arrives on both streams. The host notifier's activateWorktree is asserted not called and the host's mirrored selection is unchanged. Repeated ordinary worktree.activate calls by A are the negative control. The same file asserts the in-process create still reaches host and clients, headed and headless. The Electron journey asserts the observer's data-rendered-active-worktree-id is unchanged while the created workspace still appears in its sidebar.", + "oracle": "Audit3918: Remove the standalone paired-client selection example; its distinct-device-id and initial selection alarms are intentionally lost. Retain the manually selected create-and-observe and host-folder journeys without claiming equivalent replacement, composer auto-navigation, folder-picker selection delivery, actual external-agent execution, live remote/mobile or cross-platform validation. The changed Electron selector has no fresh execution receipt. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial real local-loopback multi-client suite loses supplied device-metadata attribution, direct worktree-local navigation, focused terminal-create projection and crossed-two-server inventory alarms. Retire the worktree-local alias and the stale host-originated reveal-to-all alias: no surviving callback backs that positive reveal claim; the retained host-create callback instead excludes paired observers. Keep the five exact caller-only create, explicit all-surface, reconnect non-replay, headless caller-only and follow-intent aliases. No equivalent replacement or external remote-host journey is assigned. 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): notifyActivateWorktree takes its navigation target as a required parameter, so a create call site that forgets to forward it is a compile error rather than a silent fallback to broadcasting — mutation testing confirmed all six call sites (folder, git, and remote/SSH branches, startup and no-startup each) are killed by typecheck. Behaviorally: two paired clients subscribe to runtime.clientEvents. Client A creates a workspace with activate:true; a reposChanged fence emitted after the create must be the next frame each client sees, proving no activation frame was interleaved, while worktreesChanged still arrives on both streams. The host notifier's activateWorktree is asserted not called and the host's mirrored selection is unchanged. Repeated ordinary worktree.activate calls by A are the negative control. The same file asserts the in-process create still reaches host and clients, headed and headless. The Electron journey asserts the observer's data-rendered-active-worktree-id is unchanged while the created workspace still appears in its sidebar.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/client/navigation/multi-client-navigation-isolation.integration.test.ts", - "pnpm run test:e2e:multi-client-navigation -- tests/e2e/multi-client-navigation-isolation.spec.ts" + "pnpm run test:e2e:multi-client-navigation -- tests/e2e/multi-client-navigation-isolation.spec.ts", + "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/main/runtime/client/navigation/multi-client-navigation-isolation.integration.test.ts --maxWorkers=2" ], "testFiles": [ "src/main/runtime/client/navigation/multi-client-navigation-isolation.integration.test.ts", @@ -3592,20 +3549,19 @@ { "file": "tests/e2e/multi-client-navigation-isolation.spec.ts", "assertions": [ - "keeps a paired client workspace create-with-agent off the other client and the host", - "keeps two paired browser clients and the host on independent worktrees" + "keeps a paired client workspace create-with-agent off the other client and the host" ] } ], "evidenceRuns": [ { - "date": "2026-08-18", + "date": "2026-11-12", "runner": "local", - "platform": "macos", - "command": "pnpm run test:e2e:multi-client-navigation -- tests/e2e/multi-client-navigation-isolation.spec.ts", + "platform": "linux", + "command": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/main/runtime/client/navigation/multi-client-navigation-isolation.integration.test.ts --maxWorkers=2", "result": "passed", - "durationSeconds": 80, - "summary": "Headed Orca desktop server with two paired web clients: the observer stayed on its own worktree while the creator's workspace appeared in its sidebar. With the fix disabled the same journey failed with the observer rendering the created workspace." + "durationSeconds": 4.79, + "summary": "9 tests passed in the existing multi-client-navigation-isolation.integration.test.ts suite. In-process real paired WebSocket/runtime contracts only; no rendered Electron, CLI bootstrap, physical PTY/provider, live remote/mobile, macOS or Windows validation." } ], "runtimeBudget": { @@ -3614,11 +3570,11 @@ }, "flakeHistory": { "status": "unknown", - "evidence": "New contracts. The integration file is fence-ordered rather than timing-based and passed repeatedly locally; the Electron journey passed twice locally on macOS. CI and soak history have not started." + "evidence": "Audit3918: Historical evidence for the original source only; no fresh validation of the reduced Electron selector. New contracts. The integration file is fence-ordered rather than timing-based and passed repeatedly locally; the Electron journey passed twice locally on macOS. CI and soak history have not started." }, "redGreenEvidence": { "status": "complete", - "evidence": "Both layers were observed red on origin/main 4ec6bbf588 before any fix: the observer client received ['worktreesChanged', 'activateWorktree'] instead of the fence, and the Electron observer's data-rendered-active-worktree-id resolved to the workspace the other client had just created. Both went green with the caller scoping and red again when only resolveRuntimeNavigationTarget's clientKind input was removed." + "evidence": "Audit3918: Historical evidence for the original source only; no fresh validation of the reduced Electron selector. Both layers were observed red on origin/main 4ec6bbf588 before any fix: the observer client received ['worktreesChanged', 'activateWorktree'] instead of the fence, and the Electron observer's data-rendered-active-worktree-id resolved to the workspace the other client had just created. Both went green with the caller scoping and red again when only resolveRuntimeNavigationTarget's clientKind input was removed." }, "performanceBudget": { "required": false, @@ -3630,6 +3586,7 @@ "Extend the oracle to mobile observers and to a client with two windows open on one connection." ], "knownGaps": [ + "Audit3918: Remove the standalone paired-client selection example; its distinct-device-id and initial selection alarms are intentionally lost. Retain the manually selected create-and-observe and host-folder journeys without claiming equivalent replacement, composer auto-navigation, folder-picker selection delivery, actual external-agent execution, live remote/mobile or cross-platform validation. The changed Electron selector has no fresh execution receipt. Retired complete dated receipt verbatim:\n{\n \"date\": \"2026-08-18\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm run test:e2e:multi-client-navigation -- tests/e2e/multi-client-navigation-isolation.spec.ts\",\n \"result\": \"passed\",\n \"durationSeconds\": 80,\n \"summary\": \"Headed Orca desktop server with two paired web clients: the observer stayed on its own worktree while the creator's workspace appeared in its sidebar. With the fix disabled the same journey failed with the observer rendering the created workspace.\"\n }", "Audit2141: Remove only the in-memory fake-store restart callback from src/main/runtime/client/navigation/multi-client-navigation-isolation.integration.test.ts. Its copied persistence-object alarm is intentionally lost without replacement. All eight actual paired-WebSocket callbacks and five active assertion aliases remain byte-identical. Existing Electron receipt is unchanged and validates only its original source/journey; no fresh validation of the reduced integration selector, disk persistence, live remote/mobile, or cross-platform result is claimed.", "No live Windows or Linux server run yet; the reported field topology was a Windows 11 server.", "Mobile observers are covered only by the platform-neutral clientKind contract, not by a live phone journey.", @@ -3666,17 +3623,17 @@ "providers": ["local", "daemon", "ssh"], "coveredPlatforms": ["linux"], "coveredProviders": [], - "coverageNotes": "Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. The whole main-window attach-services suite is removed: runtime/window attach, notifier wiring, reload/teardown and permission-handler mock orchestration alarms are intentionally lost. Prune its exact deleted command selectors, testFiles entries and notifier assertionRef where present; complete prior selectors/ref are archived. Unrelated dated receipts remain exact and retain their original scope; no fresh reduced-selector, native-window or remote execution is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit2271: Linux coverage is limited to the unchanged serve-signal-exit-diagnostic supervisor selector and the late-handoff-after-child-exit assertion recorded below. It does not cover desktop promotion, renderer continuity, persistent PTYs or native updater behavior. No current local, daemon or SSH provider execution is established; coveredProviders is empty. Historical macOS/provider scope remains only in preserved prior accounts and archived receipts. Audit2252 removes the entire handassembled serve promotion/renderer hydration suite. Retired alarms: queued and repeated activation coalescing, duplicate serve suppression, unavailable-provider diagnostic, and zero resume/replacement accounting on independently supplied renderer state. The fixture never joined actual daemon-to-renderer delivery. These exact alarms have no equivalent replacement assigned. Remaining gate selectors keep their existing narrower scope; historical dated receipts remain verbatim and do not validate this changed selector set. No fresh runtime, native/provider, live remote/mobile, cross-platform or performance result is claimed. Archived removed active entries verbatim: commands: \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/serve-desktop-promotion-session-continuity.test.ts\"\ntestFiles: \"src/renderer/src/lib/serve-desktop-promotion-session-continuity.test.ts\"\nassertionRefs: {\n \"file\": \"src/renderer/src/lib/serve-desktop-promotion-session-continuity.test.ts\",\n \"assertions\": [\n \"a forced desktop relaunch reaching the headless lock owner opens exactly one window, and only after the persistent provider settles\",\n \"a duplicate `orca serve` launch never promotes the headless owner\",\n \"the renderer promoted inside the serve process resumes zero agents while daemon panes survive, before and after those panes rebind their PTYs\",\n \"no replacement resume tab, startup command, or automatic-resume claim is created, and every surviving session record is left untouched\"\n ]\n } Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2020: Retire CLI supervisor outcome, local-open promotion and paired-open projection alarms; launch retains only the two referenced stream-framing cases. Remaining CLI refusal/timeout cases do not replace headless-promotion coverage. Preserve both independent dated receipts at their original commands. Reduced selectors have no fresh result or equivalent replacement claim. Historical prior account (preserved verbatim): Audit1589 removes mock-only CLI forwarding, canned provisioning/catalog/error projections and private inventories without equivalent replacement coverage. Retained cases exercise actual local markdown/paste/reconciliation, stream framing/backpressure/output-drain, temporary directory cleanup and persisted handoff with injected host/provider/process boundaries. No real Jira, provisioning, remote launch, native pipe/process-tree authority or deployed provider catalog proof. Assertion references use the surviving handoff registration titles; changed-selector historical receipts are retired and unaffected receipts remain unchanged. Historical scope before this audit: Deterministic unit coverage exercises activation gating, single-instance ownership, local/remote CLI status, headless binding persistence, local daemon identity, SSH identity transfer, the promoted renderer's agent-resume accounting, and the macOS serve update handoff from staged installer through atomic bundle replacement and target-version readiness. Supervisor settlement coverage prevents a late handoff-completion failure from rearming termination after the replacement child exits. A macOS Electron journey covers headless promotion and persistent PTY identity. A disposable locally signed Electron canary exercised real ShipIt and a temporary LaunchAgent with the compiled production supervisor; full packaged Orca and Linux/Windows serve updates remain uncollected. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "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. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. The whole main-window attach-services suite is removed: runtime/window attach, notifier wiring, reload/teardown and permission-handler mock orchestration alarms are intentionally lost. Prune its exact deleted command selectors, testFiles entries and notifier assertionRef where present; complete prior selectors/ref are archived. Unrelated dated receipts remain exact and retain their original scope; no fresh reduced-selector, native-window or remote execution is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit2271: Linux coverage is limited to the unchanged serve-signal-exit-diagnostic supervisor selector and the late-handoff-after-child-exit assertion recorded below. It does not cover desktop promotion, renderer continuity, persistent PTYs or native updater behavior. No current local, daemon or SSH provider execution is established; coveredProviders is empty. Historical macOS/provider scope remains only in preserved prior accounts and archived receipts. Audit2252 removes the entire handassembled serve promotion/renderer hydration suite. Retired alarms: queued and repeated activation coalescing, duplicate serve suppression, unavailable-provider diagnostic, and zero resume/replacement accounting on independently supplied renderer state. The fixture never joined actual daemon-to-renderer delivery. These exact alarms have no equivalent replacement assigned. Remaining gate selectors keep their existing narrower scope; historical dated receipts remain verbatim and do not validate this changed selector set. No fresh runtime, native/provider, live remote/mobile, cross-platform or performance result is claimed. Archived removed active entries verbatim: commands: \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/serve-desktop-promotion-session-continuity.test.ts\"\ntestFiles: \"src/renderer/src/lib/serve-desktop-promotion-session-continuity.test.ts\"\nassertionRefs: {\n \"file\": \"src/renderer/src/lib/serve-desktop-promotion-session-continuity.test.ts\",\n \"assertions\": [\n \"a forced desktop relaunch reaching the headless lock owner opens exactly one window, and only after the persistent provider settles\",\n \"a duplicate `orca serve` launch never promotes the headless owner\",\n \"the renderer promoted inside the serve process resumes zero agents while daemon panes survive, before and after those panes rebind their PTYs\",\n \"no replacement resume tab, startup command, or automatic-resume claim is created, and every surviving session record is left untouched\"\n ]\n } Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2020: Retire CLI supervisor outcome, local-open promotion and paired-open projection alarms; launch retains only the two referenced stream-framing cases. Remaining CLI refusal/timeout cases do not replace headless-promotion coverage. Preserve both independent dated receipts at their original commands. Reduced selectors have no fresh result or equivalent replacement claim. Historical prior account (preserved verbatim): Audit1589 removes mock-only CLI forwarding, canned provisioning/catalog/error projections and private inventories without equivalent replacement coverage. Retained cases exercise actual local markdown/paste/reconciliation, stream framing/backpressure/output-drain, temporary directory cleanup and persisted handoff with injected host/provider/process boundaries. No real Jira, provisioning, remote launch, native pipe/process-tree authority or deployed provider catalog proof. Assertion references use the surviving handoff registration titles; changed-selector historical receipts are retired and unaffected receipts remain unchanged. Historical scope before this audit: Deterministic unit coverage exercises activation gating, single-instance ownership, local/remote CLI status, headless binding persistence, local daemon identity, SSH identity transfer, the promoted renderer's agent-resume accounting, and the macOS serve update handoff from staged installer through atomic bundle replacement and target-version readiness. Supervisor settlement coverage prevents a late handoff-completion failure from rearming termination after the replacement child exits. A macOS Electron journey covers headless promotion and persistent PTY identity. A disposable locally signed Electron canary exercised real ShipIt and a temporary LaunchAgent with the compiled production supervisor; full packaged Orca and Linux/Windows serve updates remain uncollected. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/8457", "https://github.com/stablyai/orca/issues/9563" ], "invariant": "A safely promotable headless serve process is the single app owner. Desktop activation preserves its daemon-backed sessions. On macOS, a CLI-supervised serve update keeps the node-mode parent alive across ShipIt's atomic bundle swap, restarts with the original serve arguments only after the target bundle is present, and clears handoff state only after that target version reports runtime readiness. Once a supervised child exits or fails to start, no late handoff completion may signal it or arm force-kill escalation. Unsupported or failed handoffs leave the current serving owner intact or recover it once without an install retry loop.", - "oracle": "Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. The whole main-window attach-services suite is removed: runtime/window attach, notifier wiring, reload/teardown and permission-handler mock orchestration alarms are intentionally lost. Prune its exact deleted command selectors, testFiles entries and notifier assertionRef where present; complete prior selectors/ref are archived. Unrelated dated receipts remain exact and retain their original scope; no fresh reduced-selector, native-window or remote execution is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit2252: The removed synthetic lock/gate/hydration fixture supplies no current promotion continuity oracle. Existing other selectors retain only their own independent scope; changed selector execution is pending. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2020: Retire CLI supervisor outcome, local-open promotion and paired-open projection alarms; launch retains only the two referenced stream-framing cases. Remaining CLI refusal/timeout cases do not replace headless-promotion coverage. Preserve both independent dated receipts at their original commands. Reduced selectors have no fresh result or equivalent replacement claim. 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: Unit tests coalesce early activation, preserve daemon and SSH identity, and reproduce the update race with a staged target, old serving child, persistent CLI parent, atomic .app replacement, and replacement readiness message. They assert the parent does not exit for launchd to respawn the old app, the native updater does not launch an interactive GUI, the replacement version is verified before handoff completion, mismatches become durable failures without retries, and unsupported/preflight-failed installs do not invoke native quit or PTY cleanup. Force handoff completion to fail after the replacement child exits and require zero later child signals and zero escalation timers. A joined lock-owner/activation/hydration contract asserts that a forced relaunch opens exactly one window and that the renderer promoted inside the serve process launches zero agent resumes, creates no replacement tab or startup command, and leaves every surviving session record untouched. The Electron journey independently verifies headless promotion retains owner/runtime/daemon/PTY identity and terminal I/O.", + "oracle": "Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. The whole main-window attach-services suite is removed: runtime/window attach, notifier wiring, reload/teardown and permission-handler mock orchestration alarms are intentionally lost. Prune its exact deleted command selectors, testFiles entries and notifier assertionRef where present; complete prior selectors/ref are archived. Unrelated dated receipts remain exact and retain their original scope; no fresh reduced-selector, native-window or remote execution is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit2252: The removed synthetic lock/gate/hydration fixture supplies no current promotion continuity oracle. Existing other selectors retain only their own independent scope; changed selector execution is pending. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2020: Retire CLI supervisor outcome, local-open promotion and paired-open projection alarms; launch retains only the two referenced stream-framing cases. Remaining CLI refusal/timeout cases do not replace headless-promotion coverage. Preserve both independent dated receipts at their original commands. Reduced selectors have no fresh result or equivalent replacement claim. 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: Unit tests coalesce early activation, preserve daemon and SSH identity, and reproduce the update race with a staged target, old serving child, persistent CLI parent, atomic .app replacement, and replacement readiness message. They assert the parent does not exit for launchd to respawn the old app, the native updater does not launch an interactive GUI, the replacement version is verified before handoff completion, mismatches become durable failures without retries, and unsupported/preflight-failed installs do not invoke native quit or PTY cleanup. Force handoff completion to fail after the replacement child exits and require zero later child signals and zero escalation timers. A joined lock-owner/activation/hydration contract asserts that a forced relaunch opens exactly one window and that the renderer promoted inside the serve process launches zero agent resumes, creates no replacement tab or startup command, and leaves every surviving session record untouched. The Electron journey independently verifies headless promotion retains owner/runtime/daemon/PTY identity and terminal I/O.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/cli/runtime/launch.test.ts src/main/updater/serve-update-handoff.test.ts src/main/updater/updater.headless-serve-install.test.ts src/main/updater/mac-install/updater.mac-install.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/cli/runtime/serve-signal-exit-diagnostic.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/startup/serve-desktop-activation.test.ts src/cli/runtime-client.test.ts src/cli/runtime/websocket-transport.test.ts src/main/runtime/construction/orca-runtime.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/startup/serve-launch/serve-desktop-activation.test.ts src/cli/runtime/client.test.ts src/cli/runtime/websocket-transport.test.ts src/main/runtime/construction/orca-runtime.test.ts", "pnpm exec electron-vite build --mode e2e", "pnpm run test:e2e -- tests/e2e/headless-serve-desktop-activation.spec.ts --workers=1" ], @@ -3685,8 +3642,8 @@ "src/main/updater/serve-update-handoff.test.ts", "src/cli/runtime/launch.test.ts", "src/cli/runtime/serve-signal-exit-diagnostic.test.ts", - "src/main/startup/serve-desktop-activation.test.ts", - "src/cli/runtime-client.test.ts", + "src/main/startup/serve-launch/serve-desktop-activation.test.ts", + "src/cli/runtime/client.test.ts", "src/cli/runtime/websocket-transport.test.ts", "src/main/runtime/construction/orca-runtime.test.ts", "tests/e2e/headless-serve-desktop-activation.spec.ts" @@ -3724,7 +3681,7 @@ ] }, { - "file": "src/main/startup/serve-desktop-activation.test.ts", + "file": "src/main/startup/serve-launch/serve-desktop-activation.test.ts", "assertions": [ "early activation requests coalesce until the persistent provider is ready", "a blocked provider drops pending activation and never opens a window" @@ -3772,6 +3729,10 @@ "Add an Electron SSH promotion journey in addition to the deterministic identity-transfer unit contract." ], "knownGaps": [ + "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.", + "Audit3814 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle from a Codex ready prompt even when stale startup lines remain :: Stale MCP startup lines must not block a later Codex ready header.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle when a stale Codex prompt is followed by the ready header :: A Codex ready header following a stale resume prompt must satisfy tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for an idle Cursor lane past its dismissed trust dialog (#8210) :: Later Cursor idle banner overrides retained trust dialog.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not block a mid-run Cursor lane on its dismissed trust dialog (#8210) :: Dismissed trust dialog must not report blocked for later busy Cursor; wait times out.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not classify unrelated press-enter prompts as Codex blocked prompts :: Unidentified press-enter text must time out rather than be classified Codex blocked.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for quiet background PTY agents without OSC titles :: Quiet Codex background terminal without OSC title eventually resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: sends agent prompts as bracketed paste before submit :: Driving prompt escapes embedded paste-end ESC, writes one framed paste then CR, and counts bytes.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: settles a foreground Codex prompt when launch metadata has not arrived :: Codex inferred from foreground without launch metadata waits for composer marker/quiescence before one CR.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: gives a late Codex render marker a fresh quiescence window :: Marker arriving at7.9s re-arms fresh quiet window instead of submitting at initial cap.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: writes large agent prompt paste frames atomically before delayed submit :: A prompt larger than input chunk budget is a single paste write before delayed CR with exact byte count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects oversized terminal.send text before provider writes :: Oversized ordinary terminal.send rejects input-too-large before any provider write.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects focusing an exited background terminal session :: focusTerminal refuses terminal_exited before invoking background reveal.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: pastes the same bytes the desktop draft paste sent for the prompt :: Launch-ready prompt normalizes CR/LF and renders embedded ESC visibly identically to desktop bracketed paste.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: keeps a prompt into a running agent behind the render settle, as before :: Driving prompt remains held through7s repaint activity then submits once by9s.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reports a queued PTY focus as not navigated when its notifier disappears :: Queued PTY focus and completed active reveal report not navigated after notifier removal; no second reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: does not invoke a stale graph-leaf focus notifier after queued PTY work :: Queued graph-leaf focus must not invoke old notifier after preceding PTY reveal and notifier removal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: paginates retained terminal output with explicit limits and truncation metadata :: Preview120lines, fractional limits,50/200 pages, retained2000line truncation and future-cursor metadata stay consistent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: falls back to renderer visible screen when uncursored TUI tail is blank :: Substantial blank uncursored tail uses mounted renderer visible screen with zero scrollback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reads and shows the runtime-owned alternate-screen grid without serialization :: Actual runtime alternate-screen grid provides read/show content without renderer/provider serialization.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: classifies older provider alternate-screen snapshots from ANSI :: Older provider without alternateScreen metadata classifies ANSI alternate entry and returns Remote Vim screen.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: honors the last ANSI screen transition when older provider metadata is absent :: Last ANSI alternate exit overrides earlier entry when explicit provider mode metadata is absent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: rejects a full provider screen frame after live output advances :: Live output arriving during second full-screen capture causes screen-unavailable rather than stale full frame.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: shares one provider snapshot between concurrent read and show calls :: Concurrent read/show share one successful provider snapshot and both receive Shared TUI content.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps cursor reads provider-free on restored alternate-screen PTYs :: Restored alternate-screen cursor transcript reads never acquire provider snapshot.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: backs off after a provider snapshot failure instead of retrying for show :: Failed provider capture is cached/backed off so later show does not retry.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: falls back once to a mounted renderer when a known alternate provider fails :: A known-alternate failed provider capture falls back exactly once to newly mounted renderer.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: bounds provider visible frames for read and show responses :: Provider visible read/show use six bounded lines and300character preview.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps renderer-fallback composer drafts separate from terminal output :: Renderer fallback strips dim composer draft from terminal output and exposes draft separately.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: does not use renderer visible-screen fallback for a short blank shell tail :: Two blank shell lines must not trigger renderer screen fallback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: trims terminal tail character budget without per-line array shifts :: Tail builder trims to256KiB with correct retained suffix and no Array.shift calls.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains ANSI-only status redraws instead of appending every frame :: Repeated erase/redraw replaces preview until newline then publishes one completed cursor row.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains split multi-line ANSI footer redraw state across chunks :: CUU state across chunks retains corrected footer rows and publishes new cursor entries.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not let stale lower rows hide earlier corrected footer rows from cursor reads :: Earlier corrected footer row must not be hidden by stale lower rows in cursor reads.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: bounds completed transcript entries from a single multi-line redraw chunk :: Single redraw chunk bounds completed transcript to2000retained lines and correct oldest/next/latest cursors.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains multi-line ANSI redraws when the last footer row stays partial :: Partial final redrawn row appears in preview but cursor sees it only after newline.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not retain split ANSI controls as visible terminal preview text :: Split color/mode escapes never leak preview fragments; long split OSC title truncates at MAX_OSC_TITLE_CHARS.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains same-line redraw cursor position across split full-line erase chunks :: Full-line erase preserves column across chunks so XY follows three spaces rather than old ABC.\nsrc/main/runtime/orca-runtime-tests/conpty-stream-read.spec.ts :: fills the requested line count even when blank rows sit below the prompt :: Blank rows below a ConPTY prompt must not consume the requested nonempty-line count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: does not retain split ST-terminated string controls as preview text :: Split ST-terminated Kitty/string controls must remain excluded from preview text.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects split OSC titles before retaining terminal previews :: Split BEL OSC title must update working title/status without leaking into preview.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects ST-terminated OSC titles split before the final backslash :: ST OSC split before final backslash must update title without leaking framing.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: preserves a trailing escape after a completed OSC title :: Completed OSC followed by pending ESC must preserve the next idle-title transition.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: seeds newly synced leaves from PTY pending ANSI state :: A newly synced graph leaf inherits pending ANSI so a split color fragment cannot leak.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: bounds retained partial terminal output before preview reads :: Partial terminal state stays capped at 4000, preserves retained array identity, and preview truncation/cursor output remains correct.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: submits the mail pointer to Cursor Agent only after the paste-burst delay :: Cursor mailbox pointer Enter must wait through the paste-burst delay; this is a real input-timing alarm intentionally retired.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts :: adopts a v1.4.150-shaped agent, setup, and shell orphan as one topology transaction :: Stale incarnation refuses without topology change; three agent/setup/shell lanes adopt atomically with layout/group/revision and preserved read/input/resize; exact replay is idempotent and competing owner refuses.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: retires the exact worker when it exits after renderer reveal :: Exact worker exit after reveal retires that worker and its surface.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: re-reveals a recovered worker after the renderer graph epoch changes :: Changed renderer graph epoch invalidates reveal receipt and forces another reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: defers recovery when the renderer omits the exact reveal identity :: Missing exact reveal identity defers recovery after two attempts.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: reconciles a same-id process replacement before headless adoption :: A process replacement before headless adoption must fence off stale ownership.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retires provider resume only after authoritative inventory proves the legacy PTY exited :: Authoritative owning-host inventory overrides false local hasPty, avoids SSH scanning, retires exited provider resume/surface, adopts live workers without headless reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retries inventory and unknown liveness without revealing a ghost worker :: Inventory failure and unknown liveness must retry without ghost reveal, eventually adopt, and stop retrying.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: refuses a live reserved pane before issuing a handle or revealing it :: A requireFreshPane launch receiving a live reserved owner must reject before handle/reveal/kill, and release its claim. No equivalent replacement claimed.", + "Audit3806 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: skips a listener unsubscribed mid-fan-out even with mobile exclusions active :: A listener removed by an earlier listener during one fanout is not called, including with a side-effect-excluded mobile listener present.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: retains bytes emitted before a fresh daemon spawn resolves :: Bytes and title arriving before an initial zero/reset provider response survive in the serialized headless buffer with their counted sequence.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits command-finished facts with best-effort exit codes across chunk splits :: A split OSC133 D exit code becomes130 and a missing code becomes null in ordered command-finished facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits pr-link facts once per URL with batch attribution :: A split GitHub PR URL yields42 rather than4, emits42/43 once each, and carries PTY/worktree/tab attribution.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits 2031-subscribe facts across chunk splits :: Split ESC[?20 then31h emits exactly one2031-subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: restores a provisional 2031 subscribe when daemon scan authority returns :: Returning daemon scan authority with partial scan seed and pending2031 subscription restores exactly one subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers the tracked title over the renderer snapshot lastTitle :: A synthetic live Cursor title overrides stale renderer lastTitle while preserving renderer snapshot source.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers provider history over a partial headless mirror for requested snapshots :: Authoritative requested snapshots return supplied provider frame/history/seq rather than a partial headless mirror, requesting5000rows.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: tracks live alternate-screen transitions after a provider snapshot :: Provider alternateScreen true is accepted, then live1049l/1049h update isTerminalAlternateScreen false/true.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: translates reset provider snapshots without retaining the old title :: A reset provider snapshot translates new local seq into the runtime domain and replaces Old process title with New process.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits the chunk agentStatus events before its side-effect batch :: Agent status callback precedes side-effect batch callback for one coalesced OSC9999/title/bell chunk.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: still emits a throwing chunk’s facts under its own seq, not the next chunk’s :: A tracker throw still flushes first chunk title facts under its own seq, and second chunk does not inherit those facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: seeds the lazily created tracker from the daemon-snapshot title :: A lazy tracker hydrated from renderer snapshot title Codex working emits agent-idle on later Codex done.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits command-code-working facts only after the banner arms the scrape :: Unarmed Thinking text emits no facts; a Command Code0.27.3 banner then hardcoded colored spinner text emits attributed command-code-working with the submitted prompt.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits a command-code-done fact when the idle composer returns :: After hardcoded banner/working text, returned idle composer emits command-code-done with the earlier submitted prompt.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: resizes the headless mirror after an accepted desktop PTY resize :: An external accepted resize produces the resized dimensions and same status-frame lines as a separately driven reference emulator.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: replaces suffix-only headless state with the recovered renderer snapshot :: Replacing suffix-only state removes old suffix, retains renderer history plus later output/cwd, and returns the live47x40PTY grid.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: stamps SSH connection identity on runtime terminal status :: A synthetic mounted-leaf OSC9999 status after registerPty carries the supplied SSH connectionId.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: does not retain WSL context when a PTY id is reused :: After exit and same-ID new null distro context, OSC7 file://server/share/repo uses UNC server path rather than old Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: preserves immutable context while a live daemon attach is unresolved :: preparePtyExecutionContext with preserveExisting refuses a supplied Debian replacement and subsequent OSC7 keeps original Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts :: projects frame-independent live state through main buffer snapshots :: Main-buffer snapshot puts focus-report/cursor-visibility modes in frameRestoreAnsi, excludes STATIC-FRAME there and includes it in data.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.ts :: continues terminal agent status fanout when a callback throws :: Throwing on the first status callback does not prevent second payload delivery and logs contextual error.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: returns a title-only replay snapshot and never historical attention :: Lose replay:true/title-only fact projection despite earlierbell and unknownPTYnull. No actual delivered-history notification or reattach behavior was exercised. No equivalent replacement claimed.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects a handle rebind while a controller-less status check yields :: A handle rebound while the null-controller status continuation yields must throw terminal_handle_stale.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects confirmation evidence when the owning PTY exits :: A pending strong confirmation resolving after owning PTY exit must reject terminal_exited.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-03.spec.ts :: keeps ordinary terminal send suffix failures on the existing not-writable contract :: Ordinary send writes text but refused CR must throw terminal_not_writable with beforeWrite twice and afterWrite once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell the execution host cannot apply instead of spawning its default :: Requested Windows shell on POSIX must refuse before spawning a default shell.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: quotes the agent startup command for the requested shell, not the host default :: Requested cmd shell must override PowerShell default quoting for agent startup command.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: keeps restored receipts outside a targeted worktree scan :: Targeted scan removes the moved-worktree receipt while preserving another worktree receipt.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: observes setup command completion without waiting for its interactive shell to exit :: Nonzero completion marker 17 resolves while interactive shell remains running.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: falls back to setup terminal exit when no completion signal is available :: Setup completion observer without token falls back to actual exit code 9.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: cancels setup completion observation when the caller aborts :: Abort rejects with the original reason and unsubscribes once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps observing after an uncertain setup terminal status :: Unknown exit waiter result must leave observation pending until completion marker arrives.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh omits a record :: Controller inventory omission disconnects the record but preserves its retained transcript.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh times out :: Hung inventory timeout leaves connected record and retained transcript intact.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle for adopted background PTY handles from the renderer title :: An adopted background handle resolves tui-idle from ready Codex renderer title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves live-leaf tui-idle from an OpenCode native title :: A live leaf resolves tui-idle from an OpenCode native title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from a Codex ready prompt preview :: A supplied Codex prompt preview resolves tui-idle without an actual agent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from an Antigravity prompt before the model line :: A supplied Antigravity prompt before model line resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell with no workspace instead of creating a default-shell tab :: Workspace-less explicit shell must reject before renderer default-tab request or spawn. This real guard/wiring alarm is deliberately retired.", + "Audit3798 per-case accepted losses:\nsrc/main/runtime/orca-runtime-tests/paired-settings.spec.ts :: awaits navigation-only updates from paired clients (%s) :: Updating only claudeSubagentNavigationEnabled waits for the actual controller call to the supplied pending Claude-view reconcile for both on/off values.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: drops a client page record even when its close command cannot be issued :: A removed workspace loses its runtime client-page record and headless browser projection despite close delivery_required rejection, and emits the asynchronous warning.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: leaves client-hosted pages alone when another host still owns the same worktree id :: Removing runtime:env-b metadata with local ownership leaves the local same-ID client page unchanged and issues no close command.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: marks live bindings again when reopening after a promoted window closes :: A reopened window marks its still-registered live worktree in activeWorktreeIdsOnShutdown after the first promoted window closes.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: preserves live SSH session identities when promoting a headless runtime :: Headless-to-desktop promotion records active worktree, SSH connection and remoteSessionIdsByTabId from the supplied surviving SSH PTY/session.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores a surviving renderer when its reload is cancelled :: A sole ready renderer reload cancelled under its current renderer fence returns true and becomes ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores headless authority when desktop promotion navigation is cancelled :: A cancelled desktop promotion with headless recovery returns false while headless authority remains ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: moves a desktop graph to unavailable when its reload times out :: A ready desktop graph without a headless fallback becomes unavailable at the reload deadline and retains its window/epoch.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: recovers a failed headless promotion and accepts a later renderer generation :: A promotion failure restores ready headless authority; a later valid same-window graph publishes ready desktop authority.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: clears a failed pane recovery so a later reconnect can retry :: After relay_reconnecting rejection, the pending recovery lock clears and the same pane/handle can call createTerminal a second time and return its supplied replacement.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: still preserves a CLI agent leaf when the reloaded renderer has not rebound its PTY :: An empty graph published during renderer reload preserves a preallocated live CLI PTY as one listable terminal before renderer rebind.\nsrc/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts :: keeps a no-incarnation handle across an in-graph pane remint :: Within one graph lifetime an unversioned PTY reminted onto another leaf retains its issued handle and resolves its old exit waiter after onPtyExit.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: matches explicit-id cwd PTYs when the resolved worktree cache is incomplete :: An explicit target absent from a fresh incomplete resolved cache adopts only its cwd PTY, rejects nested cwd PTY and does not rescan Git.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: ignores cwd-only controller PTYs for malformed explicit worktree IDs :: Malformed id:repo-1:: returns no terminals, does not adopt cwd-only controller PTY and avoids Git rescanning.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: refuses an SSH-backed create for mobile/runtime callers instead of creating locally :: Loss of this public unserved SSH create error-class/no-local-add/no-local-list alarm.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: records an app-selected parent workspace as a manual action :: Loss of the local runtime folder-parent manual origin, active-workspace source and explicit confidence projection alarm; no claim that SSH or cleanup coverage replaces it.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: browses runtime server directories before projects are added :: Loss of this public runtime alarm for browse availability before registration, directories-first lexical ordering and native path flavor.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: lists drive roots for a server-root browse :: Loss of the Windows public slash-root drive enumeration smoke and presence of the temporary directory drive.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations-part-02.spec.ts :: creates a missing runtime parent before creating the project directory :: Loss of this runtime createRepo recursive missing-parent/child existence and registered-path alarm.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: preserves selected project %s when a hosted parent is known :: Loss of both parent-selected and origin-selected normal fork-link projection/persisted upstream alarms plus exact single-probe count.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: links a current enterprise remote despite unavailable metadata and a retained %s :: Loss of normal current-enterprise-origin linking with stale automatic GitHub avatar or protected file image, unchanged icon assertion, and serialized project identity under unavailable metadata.", "Audit2271: Retire the deleted serve-desktop-promotion-session-continuity suite receipt from structured evidenceRuns. The exact dated original object is preserved below as historical text, including its prior claims; it supplies no current promotion/renderer continuity or equivalent replacement evidence. The replacement structured receipt covers only the unchanged serve-signal-exit-diagnostic selector and its late-handoff-after-child-exit supervisor assertion. No promoted-renderer, persistent-PTY, native Electron, provider, remote or platform execution equivalence is assigned. Historical retired receipt verbatim:\n{\n \"date\": \"2026-08-05\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/serve-desktop-promotion-session-continuity.test.ts\",\n \"result\": \"passed\",\n \"durationSeconds\": 2,\n \"summary\": \"Six tests passed joining the serve lock owner, the activation gate, and the promoted renderer's resume accounting. Red evidence: reverting the hidden-pane ownership predicate launched two duplicate codex resume tabs; additionally zeroing the live-PTY check made both hydration passes red; removing the duplicate-serve argv guard opened a window for `--serve`; always marking the gate ready removed the fail-closed diagnostic; refusing to open a window dropped both promotion assertions.\"\n }", "Audit2145 accepts removal of canned runtime metadata/guard/forwarding, fake in-memory persistence, private work-count and wrapper-duplication tests from the construction/orca-runtime.test.ts aggregate, plus the two automation run-context guards from runtime-workspace-launch-contracts.test.ts. Retained race, framing, physical completion and ownership callbacks remain byte-identical. Existing commands remain valid selectors; historical receipts stay unchanged and provide no fresh validation or replacement coverage for the reduced suites.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/main/runtime/construction/orca-runtime.test.ts: remove only literal registration import/call pairs await import('../orca-runtime-tests/worktree-setup-and-startup.spec'), await import('../orca-runtime-tests/gitlab-and-pr-bases.spec'); no additional authored credit. src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts: routes tab switch and capture start by explicit page id; accepts focus on tab switch without altering bridge args (focus is main-side concern); keeps terminal cwd resolution fail-soft when the provider is unavailable. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts: drops the bounded scan cache when orphan-cleanup removal completes; clears optimistic reconcile tokens when a CLI worktree removal succeeds; emits drift without mutating when the fetched base fast-forwards created HEAD; emits base_changed without mutation when the fetched base rewrote history; skips stale-token reconciles without mutating or emitting stale status; emits unknown without mutation when fetch fails or the base ref is missing. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts: routes runtime preserved-branch force-delete through the selected WSL project runtime; replies to a waiting client with the error of a delete that fails after acceptance; treats forced runtime deletion of an already-missing unregistered worktree as cleanup; treats normal runtime deletion of an already-missing unregistered worktree as cleanup. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts: warns that a missing-repo removal only forgot the workspace; restores runtime watchers when CLI worktree deletion fails after teardown; does not re-spend the drain budget on a removal after a wedged install was abandoned; routes runtime worktree removal through the selected WSL project runtime; force-deletes a branch that was preserved by runtime worktree removal. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts: records GitLab pasted-project recents only after successful runtime lookup; threads explicit origin preference through runtime WSL PR base resolution; resolves local GitLab fork MR bases from the target project MR head ref; captures the fork MR head from a dedicated ref, not the shared FETCH_HEAD; keeps the durable MR head when the head fetch fails but the local ref resolves; routes runtime GitLab fork MR base git calls through the selected WSL project runtime. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts: passes SSH connection ids through GitLab task operations; routes runtime GitLab issue, MR, work-item, and todo actions through the selected WSL project runtime; routes runtime GitLab MR details, review-management, job, and pasted URL actions through the selected WSL project runtime; normalizes runtime GitLab issue list arguments like the desktop IPC path. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts: does not warn when setup is explicitly skipped for CLI-created worktrees; puts the agent a create starts in the first default tab, as the window does; keeps the 8s main-runtime startup readiness budget for agents without an override; gives OpenCode the 20s main-runtime startup readiness budget; launches explicit startup agents with prompts for CLI-created worktrees. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts: returns a setup launch payload for CLI-created worktrees when hooks are explicitly enabled; does not hand the window a setup main never tried to start; passes the selected Windows setup shell into runtime runner generation; follows normal setup policy for CLI-created worktrees without activating them; uses returned WSL setup shell metadata when runtime spawns setup; uses the shell-aware setup runner for windowless creates without a startup command; reports the in-process setup hook as running when nothing can launch the runner. src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts: coalesces two clients sleeping the same host worktree; stops exactly the expected live PTYs for a worktree; explains a refused workspace close instead of throwing the raw refusal enum. src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts: marks the desktop-active worktree as isActive; includes SSH-backed worktrees in the mobile worktree summary; caches repeated malformed path misses before normalizing them again. src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts: keeps title-only foreground work ahead of monitoring in another pane; keeps a local hook row while a connected PTY still backs its pane; keeps an OSC row via its connected PTY after the pane binding is cleared. src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts: resolves files through a source-visible linked-checkout worktree; marks saved session tabs with live PTYs as host sidebar activity; attributes live legacy PTYs from saved layout bindings when their panes are hidden; marks saved browser tabs as host sidebar activity like desktop; falls back to the path-keyed GitHub cache entry; includes folder workspaces in compact worktree summaries for mobile; attaches inline agent rows from the latest OSC 9999 status; projects monitoring over a title-derived working status. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts: pushes to an idle pane when the only live waiter filters out the message type; resolves a registered waiter without PTY-injecting when the leaf is already idle; keeps already-idle status after tui-idle wait for immediate message delivery; resolves message waiters when notifyMessageArrived is called; does not resolve type-filtered message waiters for unrelated message types; removes message waiter abort listeners after message arrival; resolves message waiters on timeout when no message arrives. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts: delivers pending mail via notifyMessageArrived when the recipient is already idle; does not keep retrying when every pending row was already pointed; repoints pending rows restored with a live-idle coordinator. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts: rolls back a half-created terminal whose surface never publishes. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts: rejects startup prompts for agents that require post-ready stdin; uses portable Unix quoting for mobile agent launch commands in WSL project runtimes; keeps PowerShell quoting for mobile agent launch commands in Windows host runtimes; uses cmd.exe quoting for mobile agent launch commands in local Windows host runtimes; publishes headless mobile session agent identity with synthesized PTY status; rejects disabled mobile session agent launches before spawning; validates mobile terminal insertion anchors before resolving agent launch commands. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts: coalesces a reconnect close burst onto one authoritative PTY inventory; keeps an explicit user close destructive while the PTY is live; builds mobile session agent launch commands on the runtime host; injects mobile quick-command prompts into the host-built agent startup command. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts: closes persisted headless terminal parents before any prior list call; tears down a serve-owned headless tab on close while a renderer is attached so it cannot resurrect; defers a renderer-published pending tab to the renderer instead of tearing it down; returns a delegated close outcome with no selection tombstone when the renderer owns the outcome; tears down a runtime pending shell the renderer never adopted on close. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts: materializes a plain shell when the pending tab has no launch agent; hydrates legacy persisted terminal tabs without layout entries; reads and indexes the full agent-status snapshot once per mobile projection; kills persisted SSH PTYs when closing hydrated headless tabs before pane metadata is restored; materializes hydrated pending headless terminals with the persisted session identity. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts: hydrates a persisted SSH-owned pane before an attached renderer publishes its graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts: publishes the desktop's tab name over the live agent title, and the live title without one; uses fresh neutral PTY titles over stale mobile snapshot and OSC titles; operates PTY-backed mobile session terminals without a renderer graph; reuses pane close for live PTYs that do not own a renderer tab; lists PTY-backed mobile session terminals without a renderer graph; shows and resolves active PTY-backed mobile session terminals without a renderer graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts: creates mobile session terminals for folder workspaces in a headless runtime server; spawns fresh headless SSH mobile session terminals instead of reattaching synthetic local ids; hydrates headless mobile session terminals from the host workspace session; keeps live headless mobile session terminals when a desktop renderer publishes without them; publishes laptop-created remote runtime split terminals to phone session tabs. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts: does not report headless wake degradation without sleeping records; does not wake slept agents for non-mobile session-only activation; does not rewrite unread metadata when a mobile activation finds the worktree already read; returns unread:false from worktree.ps after a mobile activation clears the flag; materializes pending mobile session terminals without focusing desktop clients; closes browser mobile session tabs when addressed by browser workspace id. src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts: resolves mobile terminal surfaces by exact split leaf; closes the matching mobile terminal UUID leaf without closing the whole tab; closes the whole mobile terminal tab when addressed by parent tab id; activates the active split leaf when addressed by parent tab id; clears unread metadata on mobile worktree activation without focusing desktop clients; wakes slept agents on the host renderer when a phone activates a worktree. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts: publishes the hook provider session on a headless mobile tab so native chat can address the transcript; recovers the agent type from the hook row when the pane was launched without an agent hint; reads one agent-status snapshot per projection, not one per terminal tab; waits for unknown-launch foreground owner before publishing Pi-compatible mobile status; keeps Pi-compatible mobile session status as Pi for an unknown-launch foreground pi PTY; keeps renderer-vetted mobile agent status for custom-titled terminals. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts: publishes terminal surface agent status for paired web clients; preserves authoritative OMP identity for Pi-compatible remote terminal snapshots; normalizes a remote OMP title without republishing omitted launch identity; skips the foreground-process probe when the PTY launch agent is already known; probes the foreground process only on a status transition for unknown launch agents; passes the client signal and the slept-worktree refusal to the spawn. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts: does not use stale runtime-created PTY status when a neutral PTY title exists; recognizes runtime-created Codex PTY handles from the ready prompt; recognizes runtime-created Antigravity PTY handles from the ready prompt; recognizes live leaf Antigravity terminals from the ready prompt; recognizes a later Antigravity header with a prompt but no model line; keeps mobile terminal surfaces visible while their leaf handle is pending. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts: lets Claude agents management titles clear stale runtime-created title status; does not recognize live Claude agents panes from a Claude foreground process; does not let stale tab-level agent titles override current neutral pane titles; lists live terminals with fresh pane titles over stale tab titles; lets adopted neutral pane titles use non-shell foreground fallback; lets adopted neutral pane titles retry wrapper foregrounds until recognized; authorizes settled CLI prompts only after positive %s foreground identity; does not recognize arbitrary foreground TUIs as running agents; lets live neutral pane titles retry wrapper foregrounds until recognized; lets current Claude agents PTY titles override stale runtime-created OSC titles; does not let stale Claude agents OSC titles suppress current PTY title activity. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts: keeps preallocated terminal handles valid across renderer reloads; preserves runtime-created PTY process identity after graph unavailable; keeps prompt bindings fenced across runtime restarts without provider incarnation; recognizes runtime-created PTY handles with agent launch titles; does not treat a bare Cursor Agent native title as a running agent session; uses stale runtime-created PTY status when there is no title or foreground evidence. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts: keeps orphaned list and show writability aligned with the send gate. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts: cancels a coalesced SSH worker recovery retry when its provider disconnects. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts: retries renderer reveal before clearing an adopted legacy worker sleeping record. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts: recovers exported ORCA_TERMINAL_HANDLE from discovered live PTY sessions. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts: applies ANSI erase-from-start line controls in retained previews; applies ANSI stripping for private or intermediate CSI line controls; applies ANSI stripping for unsupported erase-line modes; reveals an agent terminal under the pane the caller reserved; keeps a fresh %s pane host-owned when a desktop window is available; keeps desktop publication %s separate from the reserved host spawn; mints its own pane when the reserved leaf is malformed, and reports the one it used; starts an agent terminal with the model the caller picked; starts an agent terminal without a model flag when no pick was made; attributes a startup-agent launch named %s as %s; attributes a fresh agent session the host builds as unknown; leaves a bare agent command the user typed out of launch attribution. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts: trims oversized terminal output bursts without per-line array shifts; builds terminal previews without mapping the full retained tail; keeps recent PTY replay output capped without needing previous data for large chunks; applies terminal redraw controls before retaining previews; applies ANSI terminal redraw controls before retaining previews; retains multi-line ANSI footer redraws instead of appending old frames; keeps the cursor column when erasing full lines in multi-line redraws; applies ANSI split redraw controls without leaking raw params. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts: returns renderer visible screen lines through terminal.read RPC JSON result; separates composer drafts from provider-owned terminal screens. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts: reports an in-flight PTY focus as not navigated when its notifier disappears; reports graph-leaf focus as not navigated without a host notifier; grounds the provider mode tracker before a later chunk, in the emulator order; grounds an in-flight provider snapshot capture so it cannot publish the pre-reset screen; waits for terminal exit and resolves with the exit status; keeps terminal read payloads bounded while retained output remains pageable; trims terminal read preview character budget without per-line array shifts. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts: submits a silent Claude composer once after the bounded render fallback; chunks large terminal.send text before provider writes; yields chunked terminal input through immediates between writes; yields while validating accepted large terminal.send text before provider writes; reveals a background terminal session when focusing its handle; replays captured launch config when focusing a background agent session; reveals background terminal sessions with the freshest PTY title; renames background terminal handles without requiring a visible tab; keeps a background terminal handle stable while reveal adoption is racing. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts: resolves tui-idle when a stale Codex prompt is followed by Antigravity readiness; returns an agent-neutral blocked wait result for update prompts; returns an agent-neutral blocked wait result for workspace trust prompts; returns an agent-neutral blocked wait result for cwd selection prompts; returns a blocked wait result for Codex model migration prompts; returns a blocked wait result for Codex startup hook review prompts; returns an agent-neutral blocked wait result for generic interactive prompts; splits text and enter writes for background terminal handles; types the lead line for %s: %s; submits through the agent-specific PTY timing policy for %s. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts: waits for exit on background terminal handles; keeps retained PTY transcript memory when controller refresh fails; resolves tui-idle from an Antigravity ready prompt preview; resolves Antigravity ready prompts with newline-heavy pasted tails without splitting; resolves live-leaf tui-idle from an Antigravity ready prompt preview. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts: spawns the available Qoder command for a captured same-session resume: %s; does not use the local Windows shell setting for remote Windows bare agent creates; matches canonical bare agent commands when a command override is configured; keeps non-bare agent command terminal creates unchanged; keeps disabled bare agent command terminal creates unchanged; injects runtime hook receiver env into terminal sessions; creates background terminal sessions for a $label; creates background terminal sessions for a $label; enables Claude Agent Teams only for direct Claude launches when configured in-process; reveals Claude Agent Teams launches with the rewritten launch config; preserves Claude Agent Teams for sequenced Claude launches. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts: creates visible terminal sessions without asking the renderer to focus a tab; asks the pty controller for the requested shell instead of a startup command; knows the agent a flagged launch command names before any process read; retires a flagged command pane identity when the command exits; retires only receipted restored PTY authority on command completion and exit; forgets synthetic handles when disconnected PTY records are pruned. src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts: returns OSC titles from headless main terminal snapshots; adopts renderer-seeded titles into headless main terminal snapshots; returns cwd metadata from seeded headless main terminal snapshots; adopts OSC7 host metadata from seeded headless terminal scrollback; falls back to the renderer snapshot for hidden-output recovery without headless state; keeps an empty headless snapshot authoritative for hidden-output recovery; advances the absolute output sequence across a daemon stream gap; emits explicit OSC 9999 agent status from runtime PTY data. src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts: falls back to the provider snapshot for a restored PTY with no mounted renderer; falls back to the available mirror when authoritative provider history is unavailable; keeps an empty renderer snapshot when the provider has no retained content; keeps restored provider history authoritative after later live output; uses provider alternate-screen state while a partial model is unsafe; prefers the tracked title over the headless emulator lastTitle; keeps the cursor-agent literal in record-fallback snapshots only without a tracker title; touches mobile snapshots once for decorative spinner ticks, again on idle. src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts: creates a same-repo PR branch override from a resolved head SHA and matching push target; skips broad remote fetch for an existing full-SHA PR base; creates a selected Bitbucket PR branch override from a matching remote branch; suffixes an existing PR when a matching push target lacks selected PR metadata; suffixes a matching push target branch when selected PR metadata has no PR number; suffixes a matching push target branch when the existing PR is different; suffixes a selected PR remote conflict when the PR lookup fails; checks out an unused runtime PR branch only when it is at the resolved head SHA; suffixes only the runtime worktree path when an exact PR branch checkout path exists. src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts: returns runtime local base update suggestions from addWorktree; creates a runtime local worktree from a usable persisted local branch base; does not create a runtime local worktree when the refresh fails and no local base ref exists; creates a branchNameOverride worktree from the selected matching remote base ref. tests/e2e/claude-agent-row-view.unit.test.ts: updates a mounted compact workflow description through the subscribed production parent; bounds upstream active-SSH visits for $population records, fallback=$fallback; derives %s destinations without requiring type or a workflow child ID; terminates a $path parent $status with no third request or intermediate toast; does not recover a first child %s. tests/e2e/cross-version-wire/agent-permission-legacy-spawn.unit.test.ts: keeps exact legacy ordering when structured creation cannot express afterTabId; can create a terminal without selecting the target worktree; preserves the legacy fresh-agent path when host authority is unavailable. tests/e2e/paired-instant-browser-tab.spec.ts: shows a paired browser tab before its create RPC resolves, then keeps it as one tab; adopts a paired browser tab without rebuilding its chrome. tests/e2e/session-tabs-decorative-title-fanout.unit.test.ts: bounds host publication and renderer application across remote worktrees; globally caps decorative freshness while every working status stays fresh. tests/e2e/session-tabs/mobile-session-active-performance.unit.test.ts: bounds saved-order publication selection at N and 10N without rematerializing navigation; bounds admitted placement reconciliation during supported reads at N and 10N; bounds selection input visits at 50 and 500 rows, including unavailable-target projection; keeps publication scoped to a changed worktree and shared by listeners at N and 10N; bounds preserved-chat merge and runtime-owned hydration at N and 10N (legacy=%s); bounds actual native retirement and shared delivery work at N and 10N. tests/e2e/session-tabs/mobile-session-active-publication.unit.test.ts: does not substitute a preserved row for an unavailable explicit legacy selection; resolves main-layout group selection %s (omitted group=%s). tests/e2e/structured-agent-session-launch-admission.unit.test.ts: opens a direct caller's terminal with the caller's own CLI arguments on a decline; opens the chat on the server that admitted it; opens only the terminal when this machine declines, without a notice; opens a new agent tab's terminal with the typed prompt when the caller names none; opens the chat, not a terminal, when this machine cannot resolve a new workspace yet; keeps its terminal fallback, as before. tests/e2e/structured-attention-prompt-relay.unit.test.ts: settles once per relayed prompt, not on every later status update. tests/e2e/structured-attention-read-retirement.unit.test.ts: Mark read on a chat never opened withdraws the prompt alert it surfaced; Mark read on a chat hidden since an earlier view covers the newer prompt it surfaced; reads a newly accepted visible prompt without sending an RPC for text-only updates. tests/e2e/structured-chat-tab-lifetime-cost.unit.test.ts: counts real raw stores, unrelated window publications and captured cleanup at %i chats; counts complete supplied-member sweep and separate final retirement at S=%i N=%i. tests/e2e/structured-session-workspace-authority.unit.test.ts: bounds actual target reveal across %i repo roots and metadata aliases. tests/e2e/terminal-agent-pane-launch.unit.test.ts: starts the host's planned command once, at the pane's size, and says it started; plans a pane whose prompt the window submits without the startup update prompt; preserves caller shell-ready delivery only for a connection-scoped adapter ($connectionId); starts no shell on plan failure (original failure: $returnLaunchFailure); cannot confirm a start whose provider answer was lost. tests/e2e/terminal-parked-memory.spec.ts: releases renderer terminal memory when hidden tabs park. tests/e2e/terminal-shortcuts.spec.ts: @headful Codex-like background output stays visible without disabling WebGL in auto mode; Shift with Russian layout text reaches the PTY as Cyrillic under kitty keyboard reporting. tests/e2e/terminal-split-activation-latency.spec.ts: records attributed CWD, spawn, bind, fixture-ready, input, and echo phases. tests/e2e/terminal-split-activation-latency-phases.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-split-activation-latency-main-probe.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-split-activation-latency-artifact.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-split-activation-latency-report.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-tab-switch-visual-restore.spec.ts: restores skipped hidden Grok output on light tab resume. tests/e2e/web-runtime-session-terminal-host-authority.unit.test.ts: delivers independent %s effort through the real prepared web callback; keeps same-ID local and runtime worktrees on the selected runtime owner; creates paired web agents through host authority so activation is mirrored; delivers generated continuation context after host-authoritative creation; seeds the chat composer for a draft that rode in on the launch command. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/construction/orca-runtime.test.ts, src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts, src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts, src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts, src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts, tests/e2e/claude-agent-row-view.unit.test.ts, tests/e2e/cross-version-wire/agent-permission-legacy-spawn.unit.test.ts, tests/e2e/paired-instant-browser-tab.spec.ts, tests/e2e/session-tabs-decorative-title-fanout.unit.test.ts, tests/e2e/session-tabs/mobile-session-active-performance.unit.test.ts, tests/e2e/session-tabs/mobile-session-active-publication.unit.test.ts, tests/e2e/structured-agent-session-launch-admission.unit.test.ts, tests/e2e/structured-attention-prompt-relay.unit.test.ts, tests/e2e/structured-attention-read-retirement.unit.test.ts, tests/e2e/structured-chat-tab-lifetime-cost.unit.test.ts, tests/e2e/structured-session-workspace-authority.unit.test.ts, tests/e2e/terminal-agent-pane-launch.unit.test.ts, tests/e2e/terminal-parked-memory.spec.ts, tests/e2e/terminal-shortcuts.spec.ts, tests/e2e/terminal-split-activation-latency.spec.ts, tests/e2e/terminal-split-activation-latency-phases.ts, tests/e2e/terminal-split-activation-latency-main-probe.ts, tests/e2e/terminal-split-activation-latency-artifact.ts, tests/e2e/terminal-split-activation-latency-report.ts, tests/e2e/terminal-tab-switch-visual-restore.spec.ts, tests/e2e/web-runtime-session-terminal-host-authority.unit.test.ts. Unresolved local/computed edges remain explicit debt.", @@ -3799,7 +3760,9 @@ "Module layout policy correction: retire the two remaining worktree-ps-agent-row-dismissal.spec.ts registrations. The remint/dismissal/exit case computed expected snapshotVersion increments from a production snapshot and used real-clock vi.waitFor; the legacy OSC case derived its expected paneKey from the production layout-owner switch. The runtime registrar no longer imports this file. These public projection scenarios have no replacement coverage or fresh execution claimed; all historical receipts and earlier loss notes retain their original source scope.", "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. Original scope text is retained as the exact suffix of coverageNotes/oracle; historical evidence is unchanged.", "Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. The whole main-window attach-services suite is removed: runtime/window attach, notifier wiring, reload/teardown and permission-handler mock orchestration alarms are intentionally lost. Prune its exact deleted command selectors, testFiles entries and notifier assertionRef where present; complete prior selectors/ref are archived. Unrelated dated receipts remain exact and retain their original scope; no fresh reduced-selector, native-window or remote execution is claimed. All earlier notes and dated/archived evidence retain original scopes.", - "Exact prior command before deleted attach-main-window-services selector removal: \"pnpm exec vitest run --config config/vitest.config.ts src/cli/runtime/launch.test.ts src/main/updater/serve-update-handoff.test.ts src/main/updater/updater.headless-serve-install.test.ts src/main/updater/mac-install/updater.mac-install.test.ts src/main/window/attach-main-window-services.test.ts\"" + "Exact prior command before deleted attach-main-window-services selector removal: \"pnpm exec vitest run --config config/vitest.config.ts src/cli/runtime/launch.test.ts src/main/updater/serve-update-handoff.test.ts src/main/updater/updater.headless-serve-install.test.ts src/main/updater/mac-install/updater.mac-install.test.ts src/main/window/attach-main-window-services.test.ts\"", + "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.", + "Audit3946 reduces src/main/updater/mac-install/updater.mac-install.test.ts from16 to3 authored cases, deliberately retiring13 narrow desktop-Mac staging/ordinary-quit/rejection/timeout/blocker projections. Lose pre-download staging ordering, normal-quit/native-readiness distinction, initial pre-ready blocker handling, sanitized handoff logging,15s readiness escape, injected sidecar recovery, enumeration-failure handling, ordinary quit after refusal, simpler probe/cleanup/retry guards, and required-cleanup failure escape. Retain only native-ready deferred cleanup ownership, delayed blocker-description refusal→retry, and competing actions during a retry; these mocked Electron/native/process boundaries provide no equivalent replacement for every retired alarm or native ShipIt proof. All3 survivors remain darwin-only and skip on Linux; no fresh macOS/native run or narrowed-selector receipt is claimed. This gate command still names the existing suite. Original dated receipts and other gate evidence retain their exact original scope and do not validate the reduced case set." ], "demotionRule": "Quarantine the Electron journey only with a linked product or harness defect; demote if activation changes the owner/runtime/daemon/PTY identity, loses prior output, opens before provider readiness, or fails to honor a committed quit." }, @@ -3819,16 +3782,16 @@ "providers": ["local", "daemon", "ssh", "paired-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": ["local", "daemon", "paired-runtime"], - "coverageNotes": "Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. The whole main-window attach-services suite is removed: runtime/window attach, notifier wiring, reload/teardown and permission-handler mock orchestration alarms are intentionally lost. Prune its exact deleted command selectors, testFiles entries and notifier assertionRef where present; complete prior selectors/ref are archived. Unrelated dated receipts remain exact and retain their original scope; no fresh reduced-selector, native-window or remote execution is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. 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): Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Deterministic lifecycle, IPC, window-notification, and runtime ownership tests cover generation replacement, stale callbacks, same-frame old-document publication, blocked external navigation, cancelled renderer navigation, concurrent provisional starts, process loss, timeout cleanup, headless fallback, and competing windows. Isolated macOS Electron validation covers cancelled navigation, forced renderer recovery, and headless serve promotion with live daemon-backed PTY identity and I/O. Linux, Windows, WSL, SSH promotion, and mixed-version desktop/server live runs remain uncollected; the renderer generation stays local to Electron IPC and does not change the remote wire. The renderer scheduling fixture now retains in-flight coalescing only, and payload partitioning retains publication-failure and main-dropped-worktree retry. Immediate publication, stale SSH cleanup, reconnect resync and isolated partition membership alarms were removed; other lifecycle evidence does not establish equivalent coverage. 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. Audit1400: src/renderer/src/runtime/sync-runtime-graph-scheduling.test.ts removed. Removes whole coalescing call-count suite; no newest-state delivery or replacement claim. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "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. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. The whole main-window attach-services suite is removed: runtime/window attach, notifier wiring, reload/teardown and permission-handler mock orchestration alarms are intentionally lost. Prune its exact deleted command selectors, testFiles entries and notifier assertionRef where present; complete prior selectors/ref are archived. Unrelated dated receipts remain exact and retain their original scope; no fresh reduced-selector, native-window or remote execution is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. 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): Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Deterministic lifecycle, IPC, window-notification, and runtime ownership tests cover generation replacement, stale callbacks, same-frame old-document publication, blocked external navigation, cancelled renderer navigation, concurrent provisional starts, process loss, timeout cleanup, headless fallback, and competing windows. Isolated macOS Electron validation covers cancelled navigation, forced renderer recovery, and headless serve promotion with live daemon-backed PTY identity and I/O. Linux, Windows, WSL, SSH promotion, and mixed-version desktop/server live runs remain uncollected; the renderer generation stays local to Electron IPC and does not change the remote wire. The renderer scheduling fixture now retains in-flight coalescing only, and payload partitioning retains publication-failure and main-dropped-worktree retry. Immediate publication, stale SSH cleanup, reconnect resync and isolated partition membership alarms were removed; other lifecycle evidence does not establish equivalent coverage. 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. Audit1400: src/renderer/src/runtime/sync-runtime-graph-scheduling.test.ts removed. Removes whole coalescing call-count suite; no newest-state delivery or replacement claim. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.\nWindow folder cleanup retires the mock-call-only navigation fence suite and the per-generation warning-count case. Retained sender results and existing rendered checks keep their own original scope; no equivalent replacement or fresh execution is claimed here.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/14066", "https://linear.app/stably/issue/STA-4016", "https://github.com/stablyai/orca/pull/14070" ], "invariant": "Every genuine renderer graph reload revision settles exactly once, while a blocked external navigation that preserves the current document never starts a revision. A cancelled renderer-document navigation restores authority only when that same renderer survived; cancellation after an earlier document committed remains fenced until publication or timeout. Replacing a reload cancels only the prior revision; its timer and callbacks cannot settle a newer revision. A desktop reload succeeds only from a publication carrying a new renderer-document generation, while a failed headless promotion may recover only from its originating window. Timeout, renderer loss, and close reach a terminal graph state, and successful desktop publication permanently retires headless sentinel fallback until a new headless runtime is established.", - "oracle": "Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. The whole main-window attach-services suite is removed: runtime/window attach, notifier wiring, reload/teardown and permission-handler mock orchestration alarms are intentionally lost. Prune its exact deleted command selectors, testFiles entries and notifier assertionRef where present; complete prior selectors/ref are archived. Unrelated dated receipts remain exact and retain their original scope; no fresh reduced-selector, native-window or remote execution is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. 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): Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Start a blocked external main-frame navigation and require the current renderer graph and notification path to remain authoritative. Start a same-renderer navigation, cancel it before commit, and require the renderer canary and ready authority to survive; coalesce overlapping provisional starts into one fence, and keep an earlier committed reload fenced if a later navigation is cancelled. Drive two genuine reloads half a timeout apart and require the first deadline to leave the second revision reloading while the second deadline alone makes it unavailable. During the second revision publish from the prior renderer document through the still-current main frame and require rejection without graph mutation or timeout cancellation. Restore headless authority after failed promotion, publish from a competing window, and require rejection while the sentinel remains authoritative. Then force a real renderer crash and separately promote an isolated headless serve owner; require runtime graph readiness, stable runtime/main/daemon/PTY identities, recovered visible terminal output, and post-recovery input/output.", + "oracle": "Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. The whole main-window attach-services suite is removed: runtime/window attach, notifier wiring, reload/teardown and permission-handler mock orchestration alarms are intentionally lost. Prune its exact deleted command selectors, testFiles entries and notifier assertionRef where present; complete prior selectors/ref are archived. Unrelated dated receipts remain exact and retain their original scope; no fresh reduced-selector, native-window or remote execution is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. 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): Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Start a blocked external main-frame navigation and require the current renderer graph and notification path to remain authoritative. Start a same-renderer navigation, cancel it before commit, and require the renderer canary and ready authority to survive; coalesce overlapping provisional starts into one fence, and keep an earlier committed reload fenced if a later navigation is cancelled. Drive two genuine reloads half a timeout apart and require the first deadline to leave the second revision reloading while the second deadline alone makes it unavailable. During the second revision publish from the prior renderer document through the still-current main frame and require rejection without graph mutation or timeout cancellation. Restore headless authority after failed promotion, publish from a competing window, and require rejection while the sentinel remains authoritative. Then force a real renderer crash and separately promote an isolated headless serve owner; require runtime graph readiness, stable runtime/main/daemon/PTY identities, recovered visible terminal output, and post-recovery input/output.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/session-graph/runtime-graph-reload-lifecycle.test.ts src/main/window/runtime-renderer-notification-sender.test.ts src/main/window/renderer-document-navigation.test.ts src/main/ipc/runtime.test.ts src/main/runtime/construction/orca-runtime.test.ts src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-payload-partition.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/session-graph/runtime-graph-reload-lifecycle.test.ts src/main/window/renderer-relays/runtime-renderer-notification-sender.test.ts src/main/ipc/runtime.test.ts src/main/runtime/construction/orca-runtime.test.ts src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-payload-partition.test.ts", "pnpm exec electron-vite build --mode e2e", "SKIP_BUILD=1 pnpm exec playwright test tests/e2e/renderer-blocked-navigation-graph-authority.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", "SKIP_BUILD=1 pnpm exec playwright test e2e/renderer-crash-recovery-terminal-input.spec.ts tests/e2e/renderer-crash-recovery-terminal-input.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", @@ -3836,8 +3799,7 @@ ], "testFiles": [ "src/main/runtime/session-graph/runtime-graph-reload-lifecycle.test.ts", - "src/main/window/runtime-renderer-notification-sender.test.ts", - "src/main/window/renderer-document-navigation.test.ts", + "src/main/window/renderer-relays/runtime-renderer-notification-sender.test.ts", "src/main/ipc/runtime.test.ts", "src/main/runtime/construction/orca-runtime.test.ts", "src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-payload-partition.test.ts", @@ -3855,20 +3817,12 @@ ] }, { - "file": "src/main/window/runtime-renderer-notification-sender.test.ts", + "file": "src/main/window/renderer-relays/runtime-renderer-notification-sender.test.ts", "assertions": [ - "renderer failure is contained once per load generation", + "disposed-frame failures are contained and send admission remains closed until a valid renderer document returns", "late events cannot revive a closed sender" ] }, - { - "file": "src/main/window/renderer-document-navigation.test.ts", - "assertions": [ - "blocked external navigation does not start a renderer generation", - "only the packaged renderer file or development origin starts a renderer generation", - "concurrent provisional starts share one reload fence and cancel only after every attempt fails" - ] - }, { "file": "tests/e2e/renderer-blocked-navigation-graph-authority.spec.ts", "assertions": [ @@ -3946,6 +3900,10 @@ "Add live SSH or WSL promotion evidence if provider-specific graph restoration diverges." ], "knownGaps": [ + "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.", + "Audit3814 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle from a Codex ready prompt even when stale startup lines remain :: Stale MCP startup lines must not block a later Codex ready header.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle when a stale Codex prompt is followed by the ready header :: A Codex ready header following a stale resume prompt must satisfy tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for an idle Cursor lane past its dismissed trust dialog (#8210) :: Later Cursor idle banner overrides retained trust dialog.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not block a mid-run Cursor lane on its dismissed trust dialog (#8210) :: Dismissed trust dialog must not report blocked for later busy Cursor; wait times out.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not classify unrelated press-enter prompts as Codex blocked prompts :: Unidentified press-enter text must time out rather than be classified Codex blocked.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for quiet background PTY agents without OSC titles :: Quiet Codex background terminal without OSC title eventually resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: sends agent prompts as bracketed paste before submit :: Driving prompt escapes embedded paste-end ESC, writes one framed paste then CR, and counts bytes.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: settles a foreground Codex prompt when launch metadata has not arrived :: Codex inferred from foreground without launch metadata waits for composer marker/quiescence before one CR.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: gives a late Codex render marker a fresh quiescence window :: Marker arriving at7.9s re-arms fresh quiet window instead of submitting at initial cap.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: writes large agent prompt paste frames atomically before delayed submit :: A prompt larger than input chunk budget is a single paste write before delayed CR with exact byte count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects oversized terminal.send text before provider writes :: Oversized ordinary terminal.send rejects input-too-large before any provider write.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects focusing an exited background terminal session :: focusTerminal refuses terminal_exited before invoking background reveal.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: pastes the same bytes the desktop draft paste sent for the prompt :: Launch-ready prompt normalizes CR/LF and renders embedded ESC visibly identically to desktop bracketed paste.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: keeps a prompt into a running agent behind the render settle, as before :: Driving prompt remains held through7s repaint activity then submits once by9s.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reports a queued PTY focus as not navigated when its notifier disappears :: Queued PTY focus and completed active reveal report not navigated after notifier removal; no second reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: does not invoke a stale graph-leaf focus notifier after queued PTY work :: Queued graph-leaf focus must not invoke old notifier after preceding PTY reveal and notifier removal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: paginates retained terminal output with explicit limits and truncation metadata :: Preview120lines, fractional limits,50/200 pages, retained2000line truncation and future-cursor metadata stay consistent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: falls back to renderer visible screen when uncursored TUI tail is blank :: Substantial blank uncursored tail uses mounted renderer visible screen with zero scrollback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reads and shows the runtime-owned alternate-screen grid without serialization :: Actual runtime alternate-screen grid provides read/show content without renderer/provider serialization.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: classifies older provider alternate-screen snapshots from ANSI :: Older provider without alternateScreen metadata classifies ANSI alternate entry and returns Remote Vim screen.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: honors the last ANSI screen transition when older provider metadata is absent :: Last ANSI alternate exit overrides earlier entry when explicit provider mode metadata is absent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: rejects a full provider screen frame after live output advances :: Live output arriving during second full-screen capture causes screen-unavailable rather than stale full frame.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: shares one provider snapshot between concurrent read and show calls :: Concurrent read/show share one successful provider snapshot and both receive Shared TUI content.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps cursor reads provider-free on restored alternate-screen PTYs :: Restored alternate-screen cursor transcript reads never acquire provider snapshot.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: backs off after a provider snapshot failure instead of retrying for show :: Failed provider capture is cached/backed off so later show does not retry.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: falls back once to a mounted renderer when a known alternate provider fails :: A known-alternate failed provider capture falls back exactly once to newly mounted renderer.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: bounds provider visible frames for read and show responses :: Provider visible read/show use six bounded lines and300character preview.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps renderer-fallback composer drafts separate from terminal output :: Renderer fallback strips dim composer draft from terminal output and exposes draft separately.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: does not use renderer visible-screen fallback for a short blank shell tail :: Two blank shell lines must not trigger renderer screen fallback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: trims terminal tail character budget without per-line array shifts :: Tail builder trims to256KiB with correct retained suffix and no Array.shift calls.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains ANSI-only status redraws instead of appending every frame :: Repeated erase/redraw replaces preview until newline then publishes one completed cursor row.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains split multi-line ANSI footer redraw state across chunks :: CUU state across chunks retains corrected footer rows and publishes new cursor entries.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not let stale lower rows hide earlier corrected footer rows from cursor reads :: Earlier corrected footer row must not be hidden by stale lower rows in cursor reads.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: bounds completed transcript entries from a single multi-line redraw chunk :: Single redraw chunk bounds completed transcript to2000retained lines and correct oldest/next/latest cursors.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains multi-line ANSI redraws when the last footer row stays partial :: Partial final redrawn row appears in preview but cursor sees it only after newline.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not retain split ANSI controls as visible terminal preview text :: Split color/mode escapes never leak preview fragments; long split OSC title truncates at MAX_OSC_TITLE_CHARS.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains same-line redraw cursor position across split full-line erase chunks :: Full-line erase preserves column across chunks so XY follows three spaces rather than old ABC.\nsrc/main/runtime/orca-runtime-tests/conpty-stream-read.spec.ts :: fills the requested line count even when blank rows sit below the prompt :: Blank rows below a ConPTY prompt must not consume the requested nonempty-line count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: does not retain split ST-terminated string controls as preview text :: Split ST-terminated Kitty/string controls must remain excluded from preview text.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects split OSC titles before retaining terminal previews :: Split BEL OSC title must update working title/status without leaking into preview.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects ST-terminated OSC titles split before the final backslash :: ST OSC split before final backslash must update title without leaking framing.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: preserves a trailing escape after a completed OSC title :: Completed OSC followed by pending ESC must preserve the next idle-title transition.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: seeds newly synced leaves from PTY pending ANSI state :: A newly synced graph leaf inherits pending ANSI so a split color fragment cannot leak.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: bounds retained partial terminal output before preview reads :: Partial terminal state stays capped at 4000, preserves retained array identity, and preview truncation/cursor output remains correct.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: submits the mail pointer to Cursor Agent only after the paste-burst delay :: Cursor mailbox pointer Enter must wait through the paste-burst delay; this is a real input-timing alarm intentionally retired.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts :: adopts a v1.4.150-shaped agent, setup, and shell orphan as one topology transaction :: Stale incarnation refuses without topology change; three agent/setup/shell lanes adopt atomically with layout/group/revision and preserved read/input/resize; exact replay is idempotent and competing owner refuses.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: retires the exact worker when it exits after renderer reveal :: Exact worker exit after reveal retires that worker and its surface.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: re-reveals a recovered worker after the renderer graph epoch changes :: Changed renderer graph epoch invalidates reveal receipt and forces another reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: defers recovery when the renderer omits the exact reveal identity :: Missing exact reveal identity defers recovery after two attempts.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: reconciles a same-id process replacement before headless adoption :: A process replacement before headless adoption must fence off stale ownership.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retires provider resume only after authoritative inventory proves the legacy PTY exited :: Authoritative owning-host inventory overrides false local hasPty, avoids SSH scanning, retires exited provider resume/surface, adopts live workers without headless reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retries inventory and unknown liveness without revealing a ghost worker :: Inventory failure and unknown liveness must retry without ghost reveal, eventually adopt, and stop retrying.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: refuses a live reserved pane before issuing a handle or revealing it :: A requireFreshPane launch receiving a live reserved owner must reject before handle/reveal/kill, and release its claim. No equivalent replacement claimed.", + "Audit3806 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: skips a listener unsubscribed mid-fan-out even with mobile exclusions active :: A listener removed by an earlier listener during one fanout is not called, including with a side-effect-excluded mobile listener present.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: retains bytes emitted before a fresh daemon spawn resolves :: Bytes and title arriving before an initial zero/reset provider response survive in the serialized headless buffer with their counted sequence.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits command-finished facts with best-effort exit codes across chunk splits :: A split OSC133 D exit code becomes130 and a missing code becomes null in ordered command-finished facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits pr-link facts once per URL with batch attribution :: A split GitHub PR URL yields42 rather than4, emits42/43 once each, and carries PTY/worktree/tab attribution.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits 2031-subscribe facts across chunk splits :: Split ESC[?20 then31h emits exactly one2031-subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: restores a provisional 2031 subscribe when daemon scan authority returns :: Returning daemon scan authority with partial scan seed and pending2031 subscription restores exactly one subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers the tracked title over the renderer snapshot lastTitle :: A synthetic live Cursor title overrides stale renderer lastTitle while preserving renderer snapshot source.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers provider history over a partial headless mirror for requested snapshots :: Authoritative requested snapshots return supplied provider frame/history/seq rather than a partial headless mirror, requesting5000rows.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: tracks live alternate-screen transitions after a provider snapshot :: Provider alternateScreen true is accepted, then live1049l/1049h update isTerminalAlternateScreen false/true.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: translates reset provider snapshots without retaining the old title :: A reset provider snapshot translates new local seq into the runtime domain and replaces Old process title with New process.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits the chunk agentStatus events before its side-effect batch :: Agent status callback precedes side-effect batch callback for one coalesced OSC9999/title/bell chunk.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: still emits a throwing chunk’s facts under its own seq, not the next chunk’s :: A tracker throw still flushes first chunk title facts under its own seq, and second chunk does not inherit those facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: seeds the lazily created tracker from the daemon-snapshot title :: A lazy tracker hydrated from renderer snapshot title Codex working emits agent-idle on later Codex done.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits command-code-working facts only after the banner arms the scrape :: Unarmed Thinking text emits no facts; a Command Code0.27.3 banner then hardcoded colored spinner text emits attributed command-code-working with the submitted prompt.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits a command-code-done fact when the idle composer returns :: After hardcoded banner/working text, returned idle composer emits command-code-done with the earlier submitted prompt.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: resizes the headless mirror after an accepted desktop PTY resize :: An external accepted resize produces the resized dimensions and same status-frame lines as a separately driven reference emulator.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: replaces suffix-only headless state with the recovered renderer snapshot :: Replacing suffix-only state removes old suffix, retains renderer history plus later output/cwd, and returns the live47x40PTY grid.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: stamps SSH connection identity on runtime terminal status :: A synthetic mounted-leaf OSC9999 status after registerPty carries the supplied SSH connectionId.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: does not retain WSL context when a PTY id is reused :: After exit and same-ID new null distro context, OSC7 file://server/share/repo uses UNC server path rather than old Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: preserves immutable context while a live daemon attach is unresolved :: preparePtyExecutionContext with preserveExisting refuses a supplied Debian replacement and subsequent OSC7 keeps original Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts :: projects frame-independent live state through main buffer snapshots :: Main-buffer snapshot puts focus-report/cursor-visibility modes in frameRestoreAnsi, excludes STATIC-FRAME there and includes it in data.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.ts :: continues terminal agent status fanout when a callback throws :: Throwing on the first status callback does not prevent second payload delivery and logs contextual error.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: returns a title-only replay snapshot and never historical attention :: Lose replay:true/title-only fact projection despite earlierbell and unknownPTYnull. No actual delivered-history notification or reattach behavior was exercised. No equivalent replacement claimed.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects a handle rebind while a controller-less status check yields :: A handle rebound while the null-controller status continuation yields must throw terminal_handle_stale.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects confirmation evidence when the owning PTY exits :: A pending strong confirmation resolving after owning PTY exit must reject terminal_exited.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-03.spec.ts :: keeps ordinary terminal send suffix failures on the existing not-writable contract :: Ordinary send writes text but refused CR must throw terminal_not_writable with beforeWrite twice and afterWrite once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell the execution host cannot apply instead of spawning its default :: Requested Windows shell on POSIX must refuse before spawning a default shell.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: quotes the agent startup command for the requested shell, not the host default :: Requested cmd shell must override PowerShell default quoting for agent startup command.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: keeps restored receipts outside a targeted worktree scan :: Targeted scan removes the moved-worktree receipt while preserving another worktree receipt.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: observes setup command completion without waiting for its interactive shell to exit :: Nonzero completion marker 17 resolves while interactive shell remains running.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: falls back to setup terminal exit when no completion signal is available :: Setup completion observer without token falls back to actual exit code 9.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: cancels setup completion observation when the caller aborts :: Abort rejects with the original reason and unsubscribes once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps observing after an uncertain setup terminal status :: Unknown exit waiter result must leave observation pending until completion marker arrives.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh omits a record :: Controller inventory omission disconnects the record but preserves its retained transcript.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh times out :: Hung inventory timeout leaves connected record and retained transcript intact.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle for adopted background PTY handles from the renderer title :: An adopted background handle resolves tui-idle from ready Codex renderer title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves live-leaf tui-idle from an OpenCode native title :: A live leaf resolves tui-idle from an OpenCode native title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from a Codex ready prompt preview :: A supplied Codex prompt preview resolves tui-idle without an actual agent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from an Antigravity prompt before the model line :: A supplied Antigravity prompt before model line resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell with no workspace instead of creating a default-shell tab :: Workspace-less explicit shell must reject before renderer default-tab request or spawn. This real guard/wiring alarm is deliberately retired.", + "Audit3798 per-case accepted losses:\nsrc/main/runtime/orca-runtime-tests/paired-settings.spec.ts :: awaits navigation-only updates from paired clients (%s) :: Updating only claudeSubagentNavigationEnabled waits for the actual controller call to the supplied pending Claude-view reconcile for both on/off values.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: drops a client page record even when its close command cannot be issued :: A removed workspace loses its runtime client-page record and headless browser projection despite close delivery_required rejection, and emits the asynchronous warning.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: leaves client-hosted pages alone when another host still owns the same worktree id :: Removing runtime:env-b metadata with local ownership leaves the local same-ID client page unchanged and issues no close command.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: marks live bindings again when reopening after a promoted window closes :: A reopened window marks its still-registered live worktree in activeWorktreeIdsOnShutdown after the first promoted window closes.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: preserves live SSH session identities when promoting a headless runtime :: Headless-to-desktop promotion records active worktree, SSH connection and remoteSessionIdsByTabId from the supplied surviving SSH PTY/session.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores a surviving renderer when its reload is cancelled :: A sole ready renderer reload cancelled under its current renderer fence returns true and becomes ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores headless authority when desktop promotion navigation is cancelled :: A cancelled desktop promotion with headless recovery returns false while headless authority remains ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: moves a desktop graph to unavailable when its reload times out :: A ready desktop graph without a headless fallback becomes unavailable at the reload deadline and retains its window/epoch.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: recovers a failed headless promotion and accepts a later renderer generation :: A promotion failure restores ready headless authority; a later valid same-window graph publishes ready desktop authority.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: clears a failed pane recovery so a later reconnect can retry :: After relay_reconnecting rejection, the pending recovery lock clears and the same pane/handle can call createTerminal a second time and return its supplied replacement.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: still preserves a CLI agent leaf when the reloaded renderer has not rebound its PTY :: An empty graph published during renderer reload preserves a preallocated live CLI PTY as one listable terminal before renderer rebind.\nsrc/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts :: keeps a no-incarnation handle across an in-graph pane remint :: Within one graph lifetime an unversioned PTY reminted onto another leaf retains its issued handle and resolves its old exit waiter after onPtyExit.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: matches explicit-id cwd PTYs when the resolved worktree cache is incomplete :: An explicit target absent from a fresh incomplete resolved cache adopts only its cwd PTY, rejects nested cwd PTY and does not rescan Git.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: ignores cwd-only controller PTYs for malformed explicit worktree IDs :: Malformed id:repo-1:: returns no terminals, does not adopt cwd-only controller PTY and avoids Git rescanning.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: refuses an SSH-backed create for mobile/runtime callers instead of creating locally :: Loss of this public unserved SSH create error-class/no-local-add/no-local-list alarm.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: records an app-selected parent workspace as a manual action :: Loss of the local runtime folder-parent manual origin, active-workspace source and explicit confidence projection alarm; no claim that SSH or cleanup coverage replaces it.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: browses runtime server directories before projects are added :: Loss of this public runtime alarm for browse availability before registration, directories-first lexical ordering and native path flavor.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: lists drive roots for a server-root browse :: Loss of the Windows public slash-root drive enumeration smoke and presence of the temporary directory drive.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations-part-02.spec.ts :: creates a missing runtime parent before creating the project directory :: Loss of this runtime createRepo recursive missing-parent/child existence and registered-path alarm.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: preserves selected project %s when a hosted parent is known :: Loss of both parent-selected and origin-selected normal fork-link projection/persisted upstream alarms plus exact single-probe count.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: links a current enterprise remote despite unavailable metadata and a retained %s :: Loss of normal current-enterprise-origin linking with stale automatic GitHub avatar or protected file image, unchanged icon assertion, and serialized project identity under unavailable metadata.", "Audit2145 accepts removal of canned runtime metadata/guard/forwarding, fake in-memory persistence, private work-count and wrapper-duplication tests from the construction/orca-runtime.test.ts aggregate, plus the two automation run-context guards from runtime-workspace-launch-contracts.test.ts. Retained race, framing, physical completion and ownership callbacks remain byte-identical. Existing commands remain valid selectors; historical receipts stay unchanged and provide no fresh validation or replacement coverage for the reduced suites.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/main/runtime/construction/orca-runtime.test.ts: remove only literal registration import/call pairs await import('../orca-runtime-tests/worktree-setup-and-startup.spec'), await import('../orca-runtime-tests/gitlab-and-pr-bases.spec'); no additional authored credit. src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts: routes tab switch and capture start by explicit page id; accepts focus on tab switch without altering bridge args (focus is main-side concern); keeps terminal cwd resolution fail-soft when the provider is unavailable. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts: drops the bounded scan cache when orphan-cleanup removal completes; clears optimistic reconcile tokens when a CLI worktree removal succeeds; emits drift without mutating when the fetched base fast-forwards created HEAD; emits base_changed without mutation when the fetched base rewrote history; skips stale-token reconciles without mutating or emitting stale status; emits unknown without mutation when fetch fails or the base ref is missing. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts: routes runtime preserved-branch force-delete through the selected WSL project runtime; replies to a waiting client with the error of a delete that fails after acceptance; treats forced runtime deletion of an already-missing unregistered worktree as cleanup; treats normal runtime deletion of an already-missing unregistered worktree as cleanup. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts: warns that a missing-repo removal only forgot the workspace; restores runtime watchers when CLI worktree deletion fails after teardown; does not re-spend the drain budget on a removal after a wedged install was abandoned; routes runtime worktree removal through the selected WSL project runtime; force-deletes a branch that was preserved by runtime worktree removal. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts: records GitLab pasted-project recents only after successful runtime lookup; threads explicit origin preference through runtime WSL PR base resolution; resolves local GitLab fork MR bases from the target project MR head ref; captures the fork MR head from a dedicated ref, not the shared FETCH_HEAD; keeps the durable MR head when the head fetch fails but the local ref resolves; routes runtime GitLab fork MR base git calls through the selected WSL project runtime. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts: passes SSH connection ids through GitLab task operations; routes runtime GitLab issue, MR, work-item, and todo actions through the selected WSL project runtime; routes runtime GitLab MR details, review-management, job, and pasted URL actions through the selected WSL project runtime; normalizes runtime GitLab issue list arguments like the desktop IPC path. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts: does not warn when setup is explicitly skipped for CLI-created worktrees; puts the agent a create starts in the first default tab, as the window does; keeps the 8s main-runtime startup readiness budget for agents without an override; gives OpenCode the 20s main-runtime startup readiness budget; launches explicit startup agents with prompts for CLI-created worktrees. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts: returns a setup launch payload for CLI-created worktrees when hooks are explicitly enabled; does not hand the window a setup main never tried to start; passes the selected Windows setup shell into runtime runner generation; follows normal setup policy for CLI-created worktrees without activating them; uses returned WSL setup shell metadata when runtime spawns setup; uses the shell-aware setup runner for windowless creates without a startup command; reports the in-process setup hook as running when nothing can launch the runner. src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts: coalesces two clients sleeping the same host worktree; stops exactly the expected live PTYs for a worktree; explains a refused workspace close instead of throwing the raw refusal enum. src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts: marks the desktop-active worktree as isActive; includes SSH-backed worktrees in the mobile worktree summary; caches repeated malformed path misses before normalizing them again. src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts: keeps title-only foreground work ahead of monitoring in another pane; keeps a local hook row while a connected PTY still backs its pane; keeps an OSC row via its connected PTY after the pane binding is cleared. src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts: resolves files through a source-visible linked-checkout worktree; marks saved session tabs with live PTYs as host sidebar activity; attributes live legacy PTYs from saved layout bindings when their panes are hidden; marks saved browser tabs as host sidebar activity like desktop; falls back to the path-keyed GitHub cache entry; includes folder workspaces in compact worktree summaries for mobile; attaches inline agent rows from the latest OSC 9999 status; projects monitoring over a title-derived working status. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts: pushes to an idle pane when the only live waiter filters out the message type; resolves a registered waiter without PTY-injecting when the leaf is already idle; keeps already-idle status after tui-idle wait for immediate message delivery; resolves message waiters when notifyMessageArrived is called; does not resolve type-filtered message waiters for unrelated message types; removes message waiter abort listeners after message arrival; resolves message waiters on timeout when no message arrives. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts: delivers pending mail via notifyMessageArrived when the recipient is already idle; does not keep retrying when every pending row was already pointed; repoints pending rows restored with a live-idle coordinator. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts: rolls back a half-created terminal whose surface never publishes. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts: rejects startup prompts for agents that require post-ready stdin; uses portable Unix quoting for mobile agent launch commands in WSL project runtimes; keeps PowerShell quoting for mobile agent launch commands in Windows host runtimes; uses cmd.exe quoting for mobile agent launch commands in local Windows host runtimes; publishes headless mobile session agent identity with synthesized PTY status; rejects disabled mobile session agent launches before spawning; validates mobile terminal insertion anchors before resolving agent launch commands. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts: coalesces a reconnect close burst onto one authoritative PTY inventory; keeps an explicit user close destructive while the PTY is live; builds mobile session agent launch commands on the runtime host; injects mobile quick-command prompts into the host-built agent startup command. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts: closes persisted headless terminal parents before any prior list call; tears down a serve-owned headless tab on close while a renderer is attached so it cannot resurrect; defers a renderer-published pending tab to the renderer instead of tearing it down; returns a delegated close outcome with no selection tombstone when the renderer owns the outcome; tears down a runtime pending shell the renderer never adopted on close. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts: materializes a plain shell when the pending tab has no launch agent; hydrates legacy persisted terminal tabs without layout entries; reads and indexes the full agent-status snapshot once per mobile projection; kills persisted SSH PTYs when closing hydrated headless tabs before pane metadata is restored; materializes hydrated pending headless terminals with the persisted session identity. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts: hydrates a persisted SSH-owned pane before an attached renderer publishes its graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts: publishes the desktop's tab name over the live agent title, and the live title without one; uses fresh neutral PTY titles over stale mobile snapshot and OSC titles; operates PTY-backed mobile session terminals without a renderer graph; reuses pane close for live PTYs that do not own a renderer tab; lists PTY-backed mobile session terminals without a renderer graph; shows and resolves active PTY-backed mobile session terminals without a renderer graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts: creates mobile session terminals for folder workspaces in a headless runtime server; spawns fresh headless SSH mobile session terminals instead of reattaching synthetic local ids; hydrates headless mobile session terminals from the host workspace session; keeps live headless mobile session terminals when a desktop renderer publishes without them; publishes laptop-created remote runtime split terminals to phone session tabs. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts: does not report headless wake degradation without sleeping records; does not wake slept agents for non-mobile session-only activation; does not rewrite unread metadata when a mobile activation finds the worktree already read; returns unread:false from worktree.ps after a mobile activation clears the flag; materializes pending mobile session terminals without focusing desktop clients; closes browser mobile session tabs when addressed by browser workspace id. src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts: resolves mobile terminal surfaces by exact split leaf; closes the matching mobile terminal UUID leaf without closing the whole tab; closes the whole mobile terminal tab when addressed by parent tab id; activates the active split leaf when addressed by parent tab id; clears unread metadata on mobile worktree activation without focusing desktop clients; wakes slept agents on the host renderer when a phone activates a worktree. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts: publishes the hook provider session on a headless mobile tab so native chat can address the transcript; recovers the agent type from the hook row when the pane was launched without an agent hint; reads one agent-status snapshot per projection, not one per terminal tab; waits for unknown-launch foreground owner before publishing Pi-compatible mobile status; keeps Pi-compatible mobile session status as Pi for an unknown-launch foreground pi PTY; keeps renderer-vetted mobile agent status for custom-titled terminals. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts: publishes terminal surface agent status for paired web clients; preserves authoritative OMP identity for Pi-compatible remote terminal snapshots; normalizes a remote OMP title without republishing omitted launch identity; skips the foreground-process probe when the PTY launch agent is already known; probes the foreground process only on a status transition for unknown launch agents; passes the client signal and the slept-worktree refusal to the spawn. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts: does not use stale runtime-created PTY status when a neutral PTY title exists; recognizes runtime-created Codex PTY handles from the ready prompt; recognizes runtime-created Antigravity PTY handles from the ready prompt; recognizes live leaf Antigravity terminals from the ready prompt; recognizes a later Antigravity header with a prompt but no model line; keeps mobile terminal surfaces visible while their leaf handle is pending. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts: lets Claude agents management titles clear stale runtime-created title status; does not recognize live Claude agents panes from a Claude foreground process; does not let stale tab-level agent titles override current neutral pane titles; lists live terminals with fresh pane titles over stale tab titles; lets adopted neutral pane titles use non-shell foreground fallback; lets adopted neutral pane titles retry wrapper foregrounds until recognized; authorizes settled CLI prompts only after positive %s foreground identity; does not recognize arbitrary foreground TUIs as running agents; lets live neutral pane titles retry wrapper foregrounds until recognized; lets current Claude agents PTY titles override stale runtime-created OSC titles; does not let stale Claude agents OSC titles suppress current PTY title activity. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts: keeps preallocated terminal handles valid across renderer reloads; preserves runtime-created PTY process identity after graph unavailable; keeps prompt bindings fenced across runtime restarts without provider incarnation; recognizes runtime-created PTY handles with agent launch titles; does not treat a bare Cursor Agent native title as a running agent session; uses stale runtime-created PTY status when there is no title or foreground evidence. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts: keeps orphaned list and show writability aligned with the send gate. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts: cancels a coalesced SSH worker recovery retry when its provider disconnects. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts: retries renderer reveal before clearing an adopted legacy worker sleeping record. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts: recovers exported ORCA_TERMINAL_HANDLE from discovered live PTY sessions. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts: applies ANSI erase-from-start line controls in retained previews; applies ANSI stripping for private or intermediate CSI line controls; applies ANSI stripping for unsupported erase-line modes; reveals an agent terminal under the pane the caller reserved; keeps a fresh %s pane host-owned when a desktop window is available; keeps desktop publication %s separate from the reserved host spawn; mints its own pane when the reserved leaf is malformed, and reports the one it used; starts an agent terminal with the model the caller picked; starts an agent terminal without a model flag when no pick was made; attributes a startup-agent launch named %s as %s; attributes a fresh agent session the host builds as unknown; leaves a bare agent command the user typed out of launch attribution. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts: trims oversized terminal output bursts without per-line array shifts; builds terminal previews without mapping the full retained tail; keeps recent PTY replay output capped without needing previous data for large chunks; applies terminal redraw controls before retaining previews; applies ANSI terminal redraw controls before retaining previews; retains multi-line ANSI footer redraws instead of appending old frames; keeps the cursor column when erasing full lines in multi-line redraws; applies ANSI split redraw controls without leaking raw params. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts: returns renderer visible screen lines through terminal.read RPC JSON result; separates composer drafts from provider-owned terminal screens. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts: reports an in-flight PTY focus as not navigated when its notifier disappears; reports graph-leaf focus as not navigated without a host notifier; grounds the provider mode tracker before a later chunk, in the emulator order; grounds an in-flight provider snapshot capture so it cannot publish the pre-reset screen; waits for terminal exit and resolves with the exit status; keeps terminal read payloads bounded while retained output remains pageable; trims terminal read preview character budget without per-line array shifts. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts: submits a silent Claude composer once after the bounded render fallback; chunks large terminal.send text before provider writes; yields chunked terminal input through immediates between writes; yields while validating accepted large terminal.send text before provider writes; reveals a background terminal session when focusing its handle; replays captured launch config when focusing a background agent session; reveals background terminal sessions with the freshest PTY title; renames background terminal handles without requiring a visible tab; keeps a background terminal handle stable while reveal adoption is racing. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts: resolves tui-idle when a stale Codex prompt is followed by Antigravity readiness; returns an agent-neutral blocked wait result for update prompts; returns an agent-neutral blocked wait result for workspace trust prompts; returns an agent-neutral blocked wait result for cwd selection prompts; returns a blocked wait result for Codex model migration prompts; returns a blocked wait result for Codex startup hook review prompts; returns an agent-neutral blocked wait result for generic interactive prompts; splits text and enter writes for background terminal handles; types the lead line for %s: %s; submits through the agent-specific PTY timing policy for %s. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts: waits for exit on background terminal handles; keeps retained PTY transcript memory when controller refresh fails; resolves tui-idle from an Antigravity ready prompt preview; resolves Antigravity ready prompts with newline-heavy pasted tails without splitting; resolves live-leaf tui-idle from an Antigravity ready prompt preview. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts: spawns the available Qoder command for a captured same-session resume: %s; does not use the local Windows shell setting for remote Windows bare agent creates; matches canonical bare agent commands when a command override is configured; keeps non-bare agent command terminal creates unchanged; keeps disabled bare agent command terminal creates unchanged; injects runtime hook receiver env into terminal sessions; creates background terminal sessions for a $label; creates background terminal sessions for a $label; enables Claude Agent Teams only for direct Claude launches when configured in-process; reveals Claude Agent Teams launches with the rewritten launch config; preserves Claude Agent Teams for sequenced Claude launches. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts: creates visible terminal sessions without asking the renderer to focus a tab; asks the pty controller for the requested shell instead of a startup command; knows the agent a flagged launch command names before any process read; retires a flagged command pane identity when the command exits; retires only receipted restored PTY authority on command completion and exit; forgets synthetic handles when disconnected PTY records are pruned. src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts: returns OSC titles from headless main terminal snapshots; adopts renderer-seeded titles into headless main terminal snapshots; returns cwd metadata from seeded headless main terminal snapshots; adopts OSC7 host metadata from seeded headless terminal scrollback; falls back to the renderer snapshot for hidden-output recovery without headless state; keeps an empty headless snapshot authoritative for hidden-output recovery; advances the absolute output sequence across a daemon stream gap; emits explicit OSC 9999 agent status from runtime PTY data. src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts: falls back to the provider snapshot for a restored PTY with no mounted renderer; falls back to the available mirror when authoritative provider history is unavailable; keeps an empty renderer snapshot when the provider has no retained content; keeps restored provider history authoritative after later live output; uses provider alternate-screen state while a partial model is unsafe; prefers the tracked title over the headless emulator lastTitle; keeps the cursor-agent literal in record-fallback snapshots only without a tracker title; touches mobile snapshots once for decorative spinner ticks, again on idle. src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts: creates a same-repo PR branch override from a resolved head SHA and matching push target; skips broad remote fetch for an existing full-SHA PR base; creates a selected Bitbucket PR branch override from a matching remote branch; suffixes an existing PR when a matching push target lacks selected PR metadata; suffixes a matching push target branch when selected PR metadata has no PR number; suffixes a matching push target branch when the existing PR is different; suffixes a selected PR remote conflict when the PR lookup fails; checks out an unused runtime PR branch only when it is at the resolved head SHA; suffixes only the runtime worktree path when an exact PR branch checkout path exists. src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts: returns runtime local base update suggestions from addWorktree; creates a runtime local worktree from a usable persisted local branch base; does not create a runtime local worktree when the refresh fails and no local base ref exists; creates a branchNameOverride worktree from the selected matching remote base ref. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/construction/orca-runtime.test.ts, src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts, src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts, src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts, src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts. Unresolved local/computed edges remain explicit debt.", "Audit2095 current-parent preparation2126 (approved2092/2093 removals; source refresh2109/independent2112): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-03.spec.ts: rejects exact terminal stop for multiple expected PTYs before stopping anything; omits stale renderer leaves when fresh PTY liveness is required; omits unbound renderer placeholders when fresh PTY liveness is required; captures the event method before the nested sleep receipt changes it; returns the close receipt without requiring a PTY stop; uses the same stop result as an empty explicit stop. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-04.spec.ts: builds a compact worktree summary from persisted and live runtime state; reads the linked-PR state from the renderer repoId-keyed GitHub cache; carries persisted worktree host ownership in mobile summaries; emits only instance- and boundary-validated lineage parents in mobile summaries; resolves WSL platforms only for repos represented in mobile summaries; omits worktrees hidden by the host visibility policy from mobile summaries; applies linked-checkout source visibility to mobile summaries. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review-part-02.spec.ts: routes runtime GitHub PR details and actions through the selected WSL project runtime; passes SSH connection context through hosted review creation flows; routes local WSL project hosted review flows through runtime git options; treats SSH worktree drift as unknown without local git probes. src/main/runtime/orca-runtime-tests/terminal-listing.spec.ts: emits one mobile session terminal tab per live PTY even if two tabs resolve to it; resolves projected split authority from the parent layout PTY binding; keeps explicit-id terminal lists from resolving all worktrees; keeps explicit-id cold-cache terminal lists from classifying unrelated same-repo worktrees; keeps unknown bare terminal-list ids on the no-scan exact-id path; matches explicit-id cwd PTYs for folder workspace instance IDs; routes PTY output through the PTY leaf index in large terminal graphs. src/main/runtime/orca-runtime-tests/window-authority.spec.ts: claims the first window as authoritative and ignores later windows; transfers authority from the headless sentinel to the first real window; relays terminal browser launches only while headless owns the graph; marks live headless PTYs for renderer reattach before desktop promotion; reports the activation gate state while no desktop window is available; bumps the epoch and enters reloading when the authoritative window reloads; can mark the graph ready for the authoritative window; drops back to unavailable and clears authority when the window disappears; hands the graph back to headless when a promoted serve window closes (#27292); keeps a crashed promoted serve renderer on its own window while the window is open; stays unavailable during initial loads before a graph is published. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-04.spec.ts, src/main/runtime/orca-runtime-tests/hooks-and-hosted-review-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-listing.spec.ts, src/main/runtime/orca-runtime-tests/window-authority.spec.ts. Unresolved local/computed edges remain explicit debt.", @@ -3971,7 +3929,8 @@ "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. Original scope text is retained as the exact suffix of coverageNotes/oracle; historical evidence is unchanged.", "Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. The whole main-window attach-services suite is removed: runtime/window attach, notifier wiring, reload/teardown and permission-handler mock orchestration alarms are intentionally lost. Prune its exact deleted command selectors, testFiles entries and notifier assertionRef where present; complete prior selectors/ref are archived. Unrelated dated receipts remain exact and retain their original scope; no fresh reduced-selector, native-window or remote execution is claimed. All earlier notes and dated/archived evidence retain original scopes.", "Exact prior command before deleted attach-main-window-services selector removal: \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/session-graph/runtime-graph-reload-lifecycle.test.ts src/main/window/runtime-renderer-notification-sender.test.ts src/main/window/renderer-document-navigation.test.ts src/main/ipc/runtime.test.ts src/main/window/attach-main-window-services.test.ts src/main/runtime/construction/orca-runtime.test.ts src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-payload-partition.test.ts\"", - "Exact retired testFiles selector: \"src/main/window/attach-main-window-services.test.ts\"" + "Exact retired testFiles selector: \"src/main/window/attach-main-window-services.test.ts\"", + "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." ], "demotionRule": "Demote if a reload revision settles more than once, a stale document or competing window can publish, a timer survives settlement, desktop failure stays indefinitely reloading, headless fallback returns after successful promotion, or either isolated Electron journey loses runtime or PTY identity." }, @@ -4061,10 +4020,10 @@ "providers": ["remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": ["remote-runtime"], - "coverageNotes": "Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous account (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous account (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous account (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous account (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous account (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous 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): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous account (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Independently remove one authored/finite Playwright closed-gate app-boot inventory: accept loss of real renderer/preload/main refusal composition, saved-host row and Add/Move hiding/Remove visibility alarms. Keep the unchanged scripted-move rendered dialog lifecycle/reload case. It runs no real WSL migration, host connection, file copy or automation restoration. No selector or Playwright participation cleanup is required because the spec remains. Previous 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. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result 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. Broad root-unit discovery loses whole cross-client workspace-sync, terminal-preview, picker-skill-hint and close-routing suites plus reduced worker-stop, remote-owned-record, scanner, mobile-bundle and daemon-health samples. Separate E2E discovery also loses the paired mobile/desktop mirror journey and two unit drivers. Retained callback/table/outer-loop/guard bytes are exact; retained checks do not replace the removed alarms. No app, native device, mixed-version, remote or cross-platform execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. 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. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. 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. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. 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 broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. 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. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Deterministic main-IPC contract tests cover disconnect-driven close delivery, exactly-once close, per-subscription teardown isolation against a failing socket close and a throwing liveness probe, containment of a throwing renderer send on the unguarded host-close path, and continued suppression of stale payloads from a retired transport. A headed paired-server journey (real Orca host plus a separate paired Orca desktop client) covers hidden-but-mounted reveal, cold-parked reveal, and cold-parked reveal across a disconnect/reconnect. Live Linux and Windows paired-server evidence and real sleep/wake transport loss remain uncollected.", + "coverageNotes": "Audit3788 retires10 authored/11 expanded cases across six changed drivers, including the entire screencast pending-frame-retry and usage-source-cache-streaming suites. Deliberate losses are false-refused last-frame retry/once-only delivery, ordinary stable-pane reattachment, cleared-chat Dispatch completion, terminal-declared chat-caller refusal, at-rest worker liveness projection, nested depth/cap policy, small unsigned6/sealed7 plain-format and verified-bit examples, generic malformed-ISIZE footer refusal examples, and synthetic10k/100k chunk-size/work-count budgets in gzip and general cache I/O. These include real state/disk/RPC outcomes consciously retired for marginal value; retained E2EE-backlog, receipt/custody/uncertain-ack, integrity/migration and staging-cleanup cases are not equivalent replacements. The footer test did not prove early rejection or bounded allocation; staging cleanup did not seed unrelated files. No replacement or fresh native/remote/performance execution is claimed. Earlier raw selectors and dated receipts remain historical. Audit3779 retires17 authored/17 expanded registrations across six changed drivers, including the entire shared-Codex-home and prompt-telemetry suites. Accepted losses are shared-home wrapper noninterference/opt-out preservation, mocked metric count/provenance filters, SSH activity labeling/clearing and handover idle timing, VM ownership/capability/status projections and asleep-worktree refusal, a link-only external conversation replay sample, and two narrow input-credit noninterference/expiry examples. Retain the direct exact-tab/single-use input-credit case. These bounded real disk/state/routing alarms are intentionally retired for marginal value without equivalent replacement or fresh execution claims; earlier receipts remain historical. Audit3772 retires18 authored/27 expanded cases, including whole Codex service opt-out, RPC capability-parser, creator-provenance, short-ciphertext and readiness-null suites. Accepted losses include service ledger/symlink/mode cleanup, user TOML substring preservation, old-hash cleanup, description pass-through, malformed-file/pending-hash examples, coordinator write/probe counts, capability array bounds, positive creator projections, early short-payload refusal and readiness helper null shape. Two redundant Codex exit-cause rows are also retired; Pi shares their direct-idle path only in this empty-output immediate-exit fixture, and future agent-config drift coverage is lost. Real bounded filesystem/parser/runtime alarms are deliberately retired for marginal value; no equivalent replacements or fresh execution are claimed. Earlier receipts retain their historical scope. Audits3754/3755 intentionally remove9 authored/9 finite registrations: the entire one-case usage-source-cache-streaming.test.ts driver and8 cases from the surviving computer-action-validation.test.ts driver. This gate retains an unfiltered root Vitest command; UNIT_INCLUDE admits both source paths. Accepted losses are the real encoder output chunk-size/work-count alarm on repetitive10k/100k ownership payloads through a mocked durable sink, plus CLI diagnostic precedence, fractional window-id rejection, action-call-site window-target exclusivity, plain-text click-count recovery copy, incomplete click/drag targeting, mouse/modifier/direction allowlist samples and inline/stdin text exclusivity. These CLI cases exercise real argument/handler validation before mocked runtime calls; they are deliberately retired for marginal value, not declared tautologies. Retained cache I/O and CLI cases are not equivalent replacements for these alarms. Existing historical raw receipts remain unchanged and do not validate the deleted or reduced drivers. No fresh execution claim is made. Audits3758/3763 intentionally remove9 authored/11 finite registrations from6 changed drivers, including the entire pane-title-notification, window-linear-notices and worktree-card-lifecycle-effects suites. This gate retains an unfiltered root Vitest command admitting these paths. Accepted losses are same-account linked-row success-notice fanout, sidebar-switch channel forwarding, Linear-only notification forwarding/non-terminal-consumer selection/closed-window detach, destroyed-window refusal and first-send-failure suspension through the pane-title adapter, the100-card synthetic focus/poll absence sample, stored-source local folder badge refresh, unobserved-row badge refusal, and immediate reposChanged lineage invalidation. These exercise real owners with controlled ports; they are retired for marginal value, without equivalent replacement claims. The no-badge-work fixture does not seed its title-promised collection-only cache. Preserved historical receipts do not validate deleted or reduced drivers; no fresh execution is claimed. Audit3759 retires the entire one-case Tailwind compiler/scanner smoke. Accept loss of the direct CSS production/test/spec source-exclusion and rescan alarm; no replacement or current execution is claimed. Audit3752 independently approves audit3749: retire five authored/five finite watcher-process registrations, retaining18 raw-exact registrations. Accept loss of healthy shared-pool joint recovery, last-pending-failure idle retirement/respawn, late VITEST fallback release, missing-entry fail-closed selection and independent-supervisor fuse locality alarms. These are real bounded host-policy alarms intentionally retired for low marginal value; no equivalent replacement is asserted. Remaining driver selections exercise controlled FakeChild supervisor lifecycle, cancellation, physical-exit fencing, recovery and fuse behavior. This source review supplies no fresh native/process/platform/remote/SSH execution; historical receipts retain original source and selector scopes. Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered root Vitest command. Current UNIT_INCLUDE admits the partial push-service, metadata-dialog and two config/scripts browser drivers:10 authored/16 finite removals. Accepted losses: actual retry30s/60s progression and register bucket/refill wiring, explicit seven-day lease arithmetic (its notification lacked seq/epoch and never reached send), equal-name edit latch/save payload, real image/font/meta-refresh/form/popup browser refusal controls, and broad rich-markdown bridge/command/edit-select smoke. Actual production state, callback routing and browser enforcement run in these cases; these alarms are deliberately retired on marginal value. All drivers and selectors survive. Existing unrelated receipts remain historical evidence for their unchanged selectors, not proof of the reduced cases. Audit3732 removes 2 authored/3 finite registrations from two partial suites: nominal custom/Kimi local naming success and deferred context usage row presentation. Real losses: custom/Kimi successful extraction through conversation-name sanitization and agentLabel composition; separate ordered counted/deferred lists and exact percentage/token formatting. No replacement or equivalent coverage claimed. Retain 11 authored/13 finite raw-exact registrations for bounded naming instruction/refusal/cancellation, menu dismissal focus ownership and hover/composer Escape/timer cleanup. Source-only bounded value review, no runtime/CI/native/remote/mobile/folder workspace or global completion credit. Previous account (preserved verbatim): Audit3733 removes2authored/2finite terminal input checks: fixed custom-cap error/secret fixture and three-emoji cap5refusal whose6UTF16units already trip length fast guard (no UTF8-dependent boundary). Accept exact non-disclosure/oversized-refusal alarm losses; no replacement/equivalence claim. Retain13/13scalar/pending input, OSC state and cron DST/cadence outcomes after bounded material reads. Source-only zero runtime/novelty credit; original historical reasons preserved. Previous account (preserved verbatim): Audit3729 removes1authored/3finite by deleting whole CLI runtime pairing advisory-close suite. Accept losing post-real-close injected EIO preservation of native/script/unreadable pairing, env identity/preservation and exact close/release assertions; no actual failed-close leak or replacement coverage claimed. Two retained URL grammar/identity suites11authored16finite raw unchanged. Bounded source/owner/caller value review, zero novelty/runtime credit; other seven3724deferred closures remain. Historical receipts preserve original limits. Previous account (preserved verbatim): Audit3724 removes3authored/3finite checks by deleting two whole suites: TUI clear burst-size singleton and terminal-file-URL target two-case wrapper suite. Deliberate losses: derived widest burst<64byte alarm, UNC authority+line-column anchor composition, and malformed-percent null refusal. Real production algorithms execute in those tests; no mocked-output tautology, equivalent replacement, actual Claude/file-navigation delivery or universal safety-irrelevance claim. TUI58byte bound and URI examples have low marginal value as standalone suites. Actual1262/1264/1742KEEP superseded explicitly. Remaining14drivers83authored136finite raw unchanged. Bounded source-only review; ten closures deferred, four bounded keep judgments repeated with zero new semantic-frontier credit. No runtime/CI/native/remote/mobile/folder/global completion claim; historical receipts retain original scope. Previous account (preserved verbatim): Audit3723 removes 4 authored/4 finite registrations in two whole suites: keybinding cache freeze/token spellings and host-dependent Orca command name examples. Real losses include returned-object freeze, repeated Mod+P key, Space/PageDown/NumpadSubtract mapping, unknown/empty/prototype-token rejection, and headless Linux versus Windows-server/WSL command choice. No equivalent or replacement coverage claimed. Retain 12 authored/21 finite raw-exact registrations exercising generated scaffold validation, artifact failures, shipped editor/hook/worker/panel tests, actual generated typing compilation, independent CLI root routing and intent-name precedence. Source-only bounded audit; no runtime, CI, native, remote, mobile, folder workspace or global completion credit. Previous account (preserved verbatim): Audit3720 removes17authored/23finite checks: whole main catalog-date adapter2 and shared date-helper7, seven renderer nominal ranking/cap/no-date/composition cases, and one browser registration expanding to seven forced-container/DOM-child boundary cases. Deliberate real losses: community oldest-date UTC forwarding, official/undated omission, date sorting/window/invalid/future/skew/clamp and default/override cap; nominal ranking/cap and combined Featured/Newly-added outputs; real CSS459/460,719/720,1055/1056breakpoint, five-card partial-row and720px two-card first-row alarms. Browser cases really measure rendered geometry but force width/remove DOM children; no fake-pixel or tautology rationale. No replacement/equivalent coverage claimed. Retain14authored/19finite raw-exact registrations across4drivers: adversarial featured category/order/tie and installability, date order/window selection, actual PluginManager failure/escaping/duplicate-card suppression, real browser viewport/odd-count geometry/phone catalog visibility, syntax ingress/depth/include/printability and68dlong-bracket auto-close fill-in. No tests/browser/native/UI/provider/remote/mobile/folder/CI/global execution or completion credit. Previous account (preserved verbatim): Audit3717 removes6 authored/6finite checks in two whole thin-adapter/presentation suites. Deliberate real losses: ordinary recipe repository-URL withholding and provisioned-root credential scrubbing/forwarding; repository label lockstep suffix expansion, host-scoped map identity/collision grouping, Windows crosshost paths and WSL distro suffixes. Actual provision options, label/sort consumers and host/scrubber delegates inspected; no replacement/equivalence claim. Retain40 authored/84finite registrations raw exact in14 drivers with bounded owner/context review. Prior KEEP superseded for removed suites; no runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3714 removes8 authored/39finite checks: whole CLI selector-recovery, task display-text and ANSI grammar suites plus two name joiner/blank tables. Deliberate real losses: selector flag/value/identity and mutation recovery merge/serialization; exact task suffix, transcript fallback, input immutability, cache reuse and edited blocks; independent failed-escape/resumption and OSC/DCS/BEL/ST/C1/nested/unfinished stripping outputs; meaningful-language joiner preservation and invisible/blank-name rejection. These are real bounded alarms, removed as narrow supplied-error examples, helper/token inventories and repeated internal-work fixtures. Prior2936,1195/1196,1214/1215 and1082 KEEP superseded; no replacement or equivalent coverage claimed. Keep9authored/9finite raw-exact registrations in5surviving drivers: screenshot export/failure filesystem behavior, CLI local tree query, event-local reply provenance, vault role-sensitive content and four hostile/UTF16/dangling/tag-name regressions. No native/UI/provider/remote/mobile/folder/runtime/CI/global completion credit. Previous account (preserved verbatim): Audit3711 retires2authored/4finite cases by deleting whole clipboard-image-temp-file signature-to-name inventory (HEIC/TIFF/unrecognised bytes) and workspace-last-active switch-on supplied visit/reason singleton, plus its now-orphan test fixture. This intentionally loses real generated-filename suffix/extensionless alarms and real newer-visit archived7day versus inactive30day filtering/older-visit identity alarms. Filesystem writing and production reason pruning really execute; no equivalent replacement or universal absence of safety relevance is claimed. The clipboard test does not inspect written bytes, native delivery or decode; the visit test supplies candidate/timestamps and does not exercise persisted visit routing or actual removal.20authored/20finite cases remain unchanged across4bounded Git/sidecar/removal drivers. No new runner/test/module evaluation or runtime result; historical notes and receipts remain historical. Previous account (preserved verbatim): Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous account (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous account (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous account (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous account (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous account (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous 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): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous account (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Independently remove one authored/finite Playwright closed-gate app-boot inventory: accept loss of real renderer/preload/main refusal composition, saved-host row and Add/Move hiding/Remove visibility alarms. Keep the unchanged scripted-move rendered dialog lifecycle/reload case. It runs no real WSL migration, host connection, file copy or automation restoration. No selector or Playwright participation cleanup is required because the spec remains. Previous 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. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result 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. Broad root-unit discovery loses whole cross-client workspace-sync, terminal-preview, picker-skill-hint and close-routing suites plus reduced worker-stop, remote-owned-record, scanner, mobile-bundle and daemon-health samples. Separate E2E discovery also loses the paired mobile/desktop mirror journey and two unit drivers. Retained callback/table/outer-loop/guard bytes are exact; retained checks do not replace the removed alarms. No app, native device, mixed-version, remote or cross-platform execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. 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. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. 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. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. 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 broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. 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. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Deterministic main-IPC contract tests cover disconnect-driven close delivery, exactly-once close, per-subscription teardown isolation against a failing socket close and a throwing liveness probe, containment of a throwing renderer send on the unguarded host-close path, and continued suppression of stale payloads from a retired transport. A headed paired-server journey (real Orca host plus a separate paired Orca desktop client) covers hidden-but-mounted reveal, cold-parked reveal, and cold-parked reveal across a disconnect/reconnect. Live Linux and Windows paired-server evidence and real sleep/wake transport loss remain uncollected.", "motivatingLinks": ["tests/e2e/paired-remote-terminal-parked-reveal-interactivity.spec.ts"], "invariant": "Every renderer-held runtime subscription receives exactly one terminal close event when its transport is retired, including when the retirement advanced the transport generation first, and a single failing teardown never abandons that environment's remaining subscriptions nor escapes into the transport that reported the close. Payload frames from a retired transport stay suppressed. A revealed remote terminal therefore reattaches over a live multiplex connection: its buffer restores, typed input reaches the host PTY, the echo paints without a tab flip, and the PTY converges on the revealed pane grid.", - "oracle": "Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous oracle (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous oracle (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous oracle (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous oracle (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous oracle (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous oracle (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous oracle (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): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous oracle (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Previous oracle (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. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result 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. Broad root-unit discovery loses whole cross-client workspace-sync, terminal-preview, picker-skill-hint and close-routing suites plus reduced worker-stop, remote-owned-record, scanner, mobile-bundle and daemon-health samples. Separate E2E discovery also loses the paired mobile/desktop mirror journey and two unit drivers. Retained callback/table/outer-loop/guard bytes are exact; retained checks do not replace the removed alarms. No app, native device, mixed-version, remote or cross-platform execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. 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. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. 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. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. 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 broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. 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. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): The main IPC contract test subscribes terminal.multiplex through the real handler, disconnects the environment, and asserts the renderer received exactly one {type: close} subscription event. Two isolation tests subscribe a second stream to the same environment and make the first one fail -- in its socket close, and in the liveness probe inside notifyClosed -- then assert the disconnect does not throw, both transports closed, and every close the renderer could still receive was delivered. A third drives a host-initiated close through the transport callback, which is the one notifyClosed call site with no surrounding guard, with a renderer send that throws, and asserts it cannot escape into the WebSocket close handler. A fourth test asserts that after retirement a late response frame is not forwarded and a late transport close does not re-send. The paired-server journey runs three reveal scenarios against one real host and one real paired desktop client, and for each records buffer restore, host-side receipt of the typed marker through an out-of-band host sink file, live paint without a tab flip, and PTY-versus-pane grid convergence.", + "oracle": "Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3788 retires10 authored/11 expanded cases across six changed drivers, including the entire screencast pending-frame-retry and usage-source-cache-streaming suites. Deliberate losses are false-refused last-frame retry/once-only delivery, ordinary stable-pane reattachment, cleared-chat Dispatch completion, terminal-declared chat-caller refusal, at-rest worker liveness projection, nested depth/cap policy, small unsigned6/sealed7 plain-format and verified-bit examples, generic malformed-ISIZE footer refusal examples, and synthetic10k/100k chunk-size/work-count budgets in gzip and general cache I/O. These include real state/disk/RPC outcomes consciously retired for marginal value; retained E2EE-backlog, receipt/custody/uncertain-ack, integrity/migration and staging-cleanup cases are not equivalent replacements. The footer test did not prove early rejection or bounded allocation; staging cleanup did not seed unrelated files. No replacement or fresh native/remote/performance execution is claimed. Earlier raw selectors and dated receipts remain historical. Audit3779 retires17 authored/17 expanded registrations across six changed drivers, including the entire shared-Codex-home and prompt-telemetry suites. Accepted losses are shared-home wrapper noninterference/opt-out preservation, mocked metric count/provenance filters, SSH activity labeling/clearing and handover idle timing, VM ownership/capability/status projections and asleep-worktree refusal, a link-only external conversation replay sample, and two narrow input-credit noninterference/expiry examples. Retain the direct exact-tab/single-use input-credit case. These bounded real disk/state/routing alarms are intentionally retired for marginal value without equivalent replacement or fresh execution claims; earlier receipts remain historical. Audit3772 retires18 authored/27 expanded cases, including whole Codex service opt-out, RPC capability-parser, creator-provenance, short-ciphertext and readiness-null suites. Accepted losses include service ledger/symlink/mode cleanup, user TOML substring preservation, old-hash cleanup, description pass-through, malformed-file/pending-hash examples, coordinator write/probe counts, capability array bounds, positive creator projections, early short-payload refusal and readiness helper null shape. Two redundant Codex exit-cause rows are also retired; Pi shares their direct-idle path only in this empty-output immediate-exit fixture, and future agent-config drift coverage is lost. Real bounded filesystem/parser/runtime alarms are deliberately retired for marginal value; no equivalent replacements or fresh execution are claimed. Earlier receipts retain their historical scope. Audits3754/3755 intentionally remove9 authored/9 finite registrations: the entire one-case usage-source-cache-streaming.test.ts driver and8 cases from the surviving computer-action-validation.test.ts driver. This gate retains an unfiltered root Vitest command; UNIT_INCLUDE admits both source paths. Accepted losses are the real encoder output chunk-size/work-count alarm on repetitive10k/100k ownership payloads through a mocked durable sink, plus CLI diagnostic precedence, fractional window-id rejection, action-call-site window-target exclusivity, plain-text click-count recovery copy, incomplete click/drag targeting, mouse/modifier/direction allowlist samples and inline/stdin text exclusivity. These CLI cases exercise real argument/handler validation before mocked runtime calls; they are deliberately retired for marginal value, not declared tautologies. Retained cache I/O and CLI cases are not equivalent replacements for these alarms. Existing historical raw receipts remain unchanged and do not validate the deleted or reduced drivers. No fresh execution claim is made. Audits3758/3763 intentionally remove9 authored/11 finite registrations from6 changed drivers, including the entire pane-title-notification, window-linear-notices and worktree-card-lifecycle-effects suites. This gate retains an unfiltered root Vitest command admitting these paths. Accepted losses are same-account linked-row success-notice fanout, sidebar-switch channel forwarding, Linear-only notification forwarding/non-terminal-consumer selection/closed-window detach, destroyed-window refusal and first-send-failure suspension through the pane-title adapter, the100-card synthetic focus/poll absence sample, stored-source local folder badge refresh, unobserved-row badge refusal, and immediate reposChanged lineage invalidation. These exercise real owners with controlled ports; they are retired for marginal value, without equivalent replacement claims. The no-badge-work fixture does not seed its title-promised collection-only cache. Preserved historical receipts do not validate deleted or reduced drivers; no fresh execution is claimed. Audit3759 retires the entire one-case Tailwind compiler/scanner smoke. Accept loss of the direct CSS production/test/spec source-exclusion and rescan alarm; no replacement or current execution is claimed. Audit3752 independently approves audit3749: retire five authored/five finite watcher-process registrations, retaining18 raw-exact registrations. Accept loss of healthy shared-pool joint recovery, last-pending-failure idle retirement/respawn, late VITEST fallback release, missing-entry fail-closed selection and independent-supervisor fuse locality alarms. These are real bounded host-policy alarms intentionally retired for low marginal value; no equivalent replacement is asserted. Remaining driver selections exercise controlled FakeChild supervisor lifecycle, cancellation, physical-exit fencing, recovery and fuse behavior. This source review supplies no fresh native/process/platform/remote/SSH execution; historical receipts retain original source and selector scopes. Previous oracle (preserved verbatim): Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered root Vitest command. Current UNIT_INCLUDE admits the partial push-service, metadata-dialog and two config/scripts browser drivers:10 authored/16 finite removals. Accepted losses: actual retry30s/60s progression and register bucket/refill wiring, explicit seven-day lease arithmetic (its notification lacked seq/epoch and never reached send), equal-name edit latch/save payload, real image/font/meta-refresh/form/popup browser refusal controls, and broad rich-markdown bridge/command/edit-select smoke. Actual production state, callback routing and browser enforcement run in these cases; these alarms are deliberately retired on marginal value. All drivers and selectors survive. Existing unrelated receipts remain historical evidence for their unchanged selectors, not proof of the reduced cases. Audit3732 removes 2 authored/3 finite registrations from two partial suites: nominal custom/Kimi local naming success and deferred context usage row presentation. Real losses: custom/Kimi successful extraction through conversation-name sanitization and agentLabel composition; separate ordered counted/deferred lists and exact percentage/token formatting. No replacement or equivalent coverage claimed. Retain 11 authored/13 finite raw-exact registrations for bounded naming instruction/refusal/cancellation, menu dismissal focus ownership and hover/composer Escape/timer cleanup. Source-only bounded value review, no runtime/CI/native/remote/mobile/folder workspace or global completion credit. Previous oracle (preserved verbatim): Audit3733 removes2authored/2finite terminal input checks: fixed custom-cap error/secret fixture and three-emoji cap5refusal whose6UTF16units already trip length fast guard (no UTF8-dependent boundary). Accept exact non-disclosure/oversized-refusal alarm losses; no replacement/equivalence claim. Retain13/13scalar/pending input, OSC state and cron DST/cadence outcomes after bounded material reads. Source-only zero runtime/novelty credit; original historical reasons preserved. Previous oracle (preserved verbatim): Audit3729 removes1authored/3finite by deleting whole CLI runtime pairing advisory-close suite. Accept losing post-real-close injected EIO preservation of native/script/unreadable pairing, env identity/preservation and exact close/release assertions; no actual failed-close leak or replacement coverage claimed. Two retained URL grammar/identity suites11authored16finite raw unchanged. Bounded source/owner/caller value review, zero novelty/runtime credit; other seven3724deferred closures remain. Historical receipts preserve original limits. Previous oracle (preserved verbatim): Audit3724 removes3authored/3finite checks by deleting two whole suites: TUI clear burst-size singleton and terminal-file-URL target two-case wrapper suite. Deliberate losses: derived widest burst<64byte alarm, UNC authority+line-column anchor composition, and malformed-percent null refusal. Real production algorithms execute in those tests; no mocked-output tautology, equivalent replacement, actual Claude/file-navigation delivery or universal safety-irrelevance claim. TUI58byte bound and URI examples have low marginal value as standalone suites. Actual1262/1264/1742KEEP superseded explicitly. Remaining14drivers83authored136finite raw unchanged. Bounded source-only review; ten closures deferred, four bounded keep judgments repeated with zero new semantic-frontier credit. No runtime/CI/native/remote/mobile/folder/global completion claim; historical receipts retain original scope. Previous oracle (preserved verbatim): Audit3723 removes 4 authored/4 finite registrations in two whole suites: keybinding cache freeze/token spellings and host-dependent Orca command name examples. Real losses include returned-object freeze, repeated Mod+P key, Space/PageDown/NumpadSubtract mapping, unknown/empty/prototype-token rejection, and headless Linux versus Windows-server/WSL command choice. No equivalent or replacement coverage claimed. Retain 12 authored/21 finite raw-exact registrations exercising generated scaffold validation, artifact failures, shipped editor/hook/worker/panel tests, actual generated typing compilation, independent CLI root routing and intent-name precedence. Source-only bounded audit; no runtime, CI, native, remote, mobile, folder workspace or global completion credit. Previous oracle (preserved verbatim): Audit3720 removes17authored/23finite checks: whole main catalog-date adapter2 and shared date-helper7, seven renderer nominal ranking/cap/no-date/composition cases, and one browser registration expanding to seven forced-container/DOM-child boundary cases. Deliberate real losses: community oldest-date UTC forwarding, official/undated omission, date sorting/window/invalid/future/skew/clamp and default/override cap; nominal ranking/cap and combined Featured/Newly-added outputs; real CSS459/460,719/720,1055/1056breakpoint, five-card partial-row and720px two-card first-row alarms. Browser cases really measure rendered geometry but force width/remove DOM children; no fake-pixel or tautology rationale. No replacement/equivalent coverage claimed. Retain14authored/19finite raw-exact registrations across4drivers: adversarial featured category/order/tie and installability, date order/window selection, actual PluginManager failure/escaping/duplicate-card suppression, real browser viewport/odd-count geometry/phone catalog visibility, syntax ingress/depth/include/printability and68dlong-bracket auto-close fill-in. No tests/browser/native/UI/provider/remote/mobile/folder/CI/global execution or completion credit. Previous oracle (preserved verbatim): Audit3717 removes6 authored/6finite checks in two whole thin-adapter/presentation suites. Deliberate real losses: ordinary recipe repository-URL withholding and provisioned-root credential scrubbing/forwarding; repository label lockstep suffix expansion, host-scoped map identity/collision grouping, Windows crosshost paths and WSL distro suffixes. Actual provision options, label/sort consumers and host/scrubber delegates inspected; no replacement/equivalence claim. Retain40 authored/84finite registrations raw exact in14 drivers with bounded owner/context review. Prior KEEP superseded for removed suites; no runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous oracle (preserved verbatim): Audit3714 removes8 authored/39finite checks: whole CLI selector-recovery, task display-text and ANSI grammar suites plus two name joiner/blank tables. Deliberate real losses: selector flag/value/identity and mutation recovery merge/serialization; exact task suffix, transcript fallback, input immutability, cache reuse and edited blocks; independent failed-escape/resumption and OSC/DCS/BEL/ST/C1/nested/unfinished stripping outputs; meaningful-language joiner preservation and invisible/blank-name rejection. These are real bounded alarms, removed as narrow supplied-error examples, helper/token inventories and repeated internal-work fixtures. Prior2936,1195/1196,1214/1215 and1082 KEEP superseded; no replacement or equivalent coverage claimed. Keep9authored/9finite raw-exact registrations in5surviving drivers: screenshot export/failure filesystem behavior, CLI local tree query, event-local reply provenance, vault role-sensitive content and four hostile/UTF16/dangling/tag-name regressions. No native/UI/provider/remote/mobile/folder/runtime/CI/global completion credit. Previous oracle (preserved verbatim): Audit3711 retires2authored/4finite cases by deleting whole clipboard-image-temp-file signature-to-name inventory (HEIC/TIFF/unrecognised bytes) and workspace-last-active switch-on supplied visit/reason singleton, plus its now-orphan test fixture. This intentionally loses real generated-filename suffix/extensionless alarms and real newer-visit archived7day versus inactive30day filtering/older-visit identity alarms. Filesystem writing and production reason pruning really execute; no equivalent replacement or universal absence of safety relevance is claimed. The clipboard test does not inspect written bytes, native delivery or decode; the visit test supplies candidate/timestamps and does not exercise persisted visit routing or actual removal.20authored/20finite cases remain unchanged across4bounded Git/sidecar/removal drivers. No new runner/test/module evaluation or runtime result; historical notes and receipts remain historical. Previous oracle (preserved verbatim): Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous oracle (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous oracle (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous oracle (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous oracle (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous oracle (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous oracle (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous oracle (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): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous oracle (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Previous oracle (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. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result 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. Broad root-unit discovery loses whole cross-client workspace-sync, terminal-preview, picker-skill-hint and close-routing suites plus reduced worker-stop, remote-owned-record, scanner, mobile-bundle and daemon-health samples. Separate E2E discovery also loses the paired mobile/desktop mirror journey and two unit drivers. Retained callback/table/outer-loop/guard bytes are exact; retained checks do not replace the removed alarms. No app, native device, mixed-version, remote or cross-platform execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. 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. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. 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. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. 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 broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. 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. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): The main IPC contract test subscribes terminal.multiplex through the real handler, disconnects the environment, and asserts the renderer received exactly one {type: close} subscription event. Two isolation tests subscribe a second stream to the same environment and make the first one fail -- in its socket close, and in the liveness probe inside notifyClosed -- then assert the disconnect does not throw, both transports closed, and every close the renderer could still receive was delivered. A third drives a host-initiated close through the transport callback, which is the one notifyClosed call site with no surrounding guard, with a renderer send that throws, and asserts it cannot escape into the WebSocket close handler. A fourth test asserts that after retirement a late response frame is not forwarded and a late transport close does not re-send. The paired-server journey runs three reveal scenarios against one real host and one real paired desktop client, and for each records buffer restore, host-side receipt of the typed marker through an out-of-band host sink file, live paint without a tab flip, and PTY-versus-pane grid convergence.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts", "pnpm exec playwright test tests/e2e/paired-remote-terminal-parked-reveal-interactivity.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1" @@ -4132,6 +4091,24 @@ "Add real sleep/wake and network-loss transport drops alongside the explicit disconnect trigger." ], "knownGaps": [ + "Audit3814 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle from a Codex ready prompt even when stale startup lines remain :: Stale MCP startup lines must not block a later Codex ready header.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle when a stale Codex prompt is followed by the ready header :: A Codex ready header following a stale resume prompt must satisfy tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for an idle Cursor lane past its dismissed trust dialog (#8210) :: Later Cursor idle banner overrides retained trust dialog.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not block a mid-run Cursor lane on its dismissed trust dialog (#8210) :: Dismissed trust dialog must not report blocked for later busy Cursor; wait times out.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not classify unrelated press-enter prompts as Codex blocked prompts :: Unidentified press-enter text must time out rather than be classified Codex blocked.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for quiet background PTY agents without OSC titles :: Quiet Codex background terminal without OSC title eventually resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: sends agent prompts as bracketed paste before submit :: Driving prompt escapes embedded paste-end ESC, writes one framed paste then CR, and counts bytes.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: settles a foreground Codex prompt when launch metadata has not arrived :: Codex inferred from foreground without launch metadata waits for composer marker/quiescence before one CR.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: gives a late Codex render marker a fresh quiescence window :: Marker arriving at7.9s re-arms fresh quiet window instead of submitting at initial cap.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: writes large agent prompt paste frames atomically before delayed submit :: A prompt larger than input chunk budget is a single paste write before delayed CR with exact byte count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects oversized terminal.send text before provider writes :: Oversized ordinary terminal.send rejects input-too-large before any provider write.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects focusing an exited background terminal session :: focusTerminal refuses terminal_exited before invoking background reveal.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: pastes the same bytes the desktop draft paste sent for the prompt :: Launch-ready prompt normalizes CR/LF and renders embedded ESC visibly identically to desktop bracketed paste.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: keeps a prompt into a running agent behind the render settle, as before :: Driving prompt remains held through7s repaint activity then submits once by9s.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reports a queued PTY focus as not navigated when its notifier disappears :: Queued PTY focus and completed active reveal report not navigated after notifier removal; no second reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: does not invoke a stale graph-leaf focus notifier after queued PTY work :: Queued graph-leaf focus must not invoke old notifier after preceding PTY reveal and notifier removal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: paginates retained terminal output with explicit limits and truncation metadata :: Preview120lines, fractional limits,50/200 pages, retained2000line truncation and future-cursor metadata stay consistent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: falls back to renderer visible screen when uncursored TUI tail is blank :: Substantial blank uncursored tail uses mounted renderer visible screen with zero scrollback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reads and shows the runtime-owned alternate-screen grid without serialization :: Actual runtime alternate-screen grid provides read/show content without renderer/provider serialization.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: classifies older provider alternate-screen snapshots from ANSI :: Older provider without alternateScreen metadata classifies ANSI alternate entry and returns Remote Vim screen.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: honors the last ANSI screen transition when older provider metadata is absent :: Last ANSI alternate exit overrides earlier entry when explicit provider mode metadata is absent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: rejects a full provider screen frame after live output advances :: Live output arriving during second full-screen capture causes screen-unavailable rather than stale full frame.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: shares one provider snapshot between concurrent read and show calls :: Concurrent read/show share one successful provider snapshot and both receive Shared TUI content.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps cursor reads provider-free on restored alternate-screen PTYs :: Restored alternate-screen cursor transcript reads never acquire provider snapshot.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: backs off after a provider snapshot failure instead of retrying for show :: Failed provider capture is cached/backed off so later show does not retry.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: falls back once to a mounted renderer when a known alternate provider fails :: A known-alternate failed provider capture falls back exactly once to newly mounted renderer.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: bounds provider visible frames for read and show responses :: Provider visible read/show use six bounded lines and300character preview.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps renderer-fallback composer drafts separate from terminal output :: Renderer fallback strips dim composer draft from terminal output and exposes draft separately.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: does not use renderer visible-screen fallback for a short blank shell tail :: Two blank shell lines must not trigger renderer screen fallback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: trims terminal tail character budget without per-line array shifts :: Tail builder trims to256KiB with correct retained suffix and no Array.shift calls.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains ANSI-only status redraws instead of appending every frame :: Repeated erase/redraw replaces preview until newline then publishes one completed cursor row.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains split multi-line ANSI footer redraw state across chunks :: CUU state across chunks retains corrected footer rows and publishes new cursor entries.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not let stale lower rows hide earlier corrected footer rows from cursor reads :: Earlier corrected footer row must not be hidden by stale lower rows in cursor reads.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: bounds completed transcript entries from a single multi-line redraw chunk :: Single redraw chunk bounds completed transcript to2000retained lines and correct oldest/next/latest cursors.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains multi-line ANSI redraws when the last footer row stays partial :: Partial final redrawn row appears in preview but cursor sees it only after newline.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not retain split ANSI controls as visible terminal preview text :: Split color/mode escapes never leak preview fragments; long split OSC title truncates at MAX_OSC_TITLE_CHARS.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains same-line redraw cursor position across split full-line erase chunks :: Full-line erase preserves column across chunks so XY follows three spaces rather than old ABC.\nsrc/main/runtime/orca-runtime-tests/conpty-stream-read.spec.ts :: fills the requested line count even when blank rows sit below the prompt :: Blank rows below a ConPTY prompt must not consume the requested nonempty-line count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: does not retain split ST-terminated string controls as preview text :: Split ST-terminated Kitty/string controls must remain excluded from preview text.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects split OSC titles before retaining terminal previews :: Split BEL OSC title must update working title/status without leaking into preview.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects ST-terminated OSC titles split before the final backslash :: ST OSC split before final backslash must update title without leaking framing.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: preserves a trailing escape after a completed OSC title :: Completed OSC followed by pending ESC must preserve the next idle-title transition.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: seeds newly synced leaves from PTY pending ANSI state :: A newly synced graph leaf inherits pending ANSI so a split color fragment cannot leak.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: bounds retained partial terminal output before preview reads :: Partial terminal state stays capped at 4000, preserves retained array identity, and preview truncation/cursor output remains correct.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: submits the mail pointer to Cursor Agent only after the paste-burst delay :: Cursor mailbox pointer Enter must wait through the paste-burst delay; this is a real input-timing alarm intentionally retired.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts :: adopts a v1.4.150-shaped agent, setup, and shell orphan as one topology transaction :: Stale incarnation refuses without topology change; three agent/setup/shell lanes adopt atomically with layout/group/revision and preserved read/input/resize; exact replay is idempotent and competing owner refuses.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: retires the exact worker when it exits after renderer reveal :: Exact worker exit after reveal retires that worker and its surface.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: re-reveals a recovered worker after the renderer graph epoch changes :: Changed renderer graph epoch invalidates reveal receipt and forces another reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: defers recovery when the renderer omits the exact reveal identity :: Missing exact reveal identity defers recovery after two attempts.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: reconciles a same-id process replacement before headless adoption :: A process replacement before headless adoption must fence off stale ownership.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retires provider resume only after authoritative inventory proves the legacy PTY exited :: Authoritative owning-host inventory overrides false local hasPty, avoids SSH scanning, retires exited provider resume/surface, adopts live workers without headless reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retries inventory and unknown liveness without revealing a ghost worker :: Inventory failure and unknown liveness must retry without ghost reveal, eventually adopt, and stop retrying.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: refuses a live reserved pane before issuing a handle or revealing it :: A requireFreshPane launch receiving a live reserved owner must reject before handle/reveal/kill, and release its claim. No equivalent replacement claimed.", + "Audit3806 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: skips a listener unsubscribed mid-fan-out even with mobile exclusions active :: A listener removed by an earlier listener during one fanout is not called, including with a side-effect-excluded mobile listener present.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: retains bytes emitted before a fresh daemon spawn resolves :: Bytes and title arriving before an initial zero/reset provider response survive in the serialized headless buffer with their counted sequence.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits command-finished facts with best-effort exit codes across chunk splits :: A split OSC133 D exit code becomes130 and a missing code becomes null in ordered command-finished facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits pr-link facts once per URL with batch attribution :: A split GitHub PR URL yields42 rather than4, emits42/43 once each, and carries PTY/worktree/tab attribution.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits 2031-subscribe facts across chunk splits :: Split ESC[?20 then31h emits exactly one2031-subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: restores a provisional 2031 subscribe when daemon scan authority returns :: Returning daemon scan authority with partial scan seed and pending2031 subscription restores exactly one subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers the tracked title over the renderer snapshot lastTitle :: A synthetic live Cursor title overrides stale renderer lastTitle while preserving renderer snapshot source.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers provider history over a partial headless mirror for requested snapshots :: Authoritative requested snapshots return supplied provider frame/history/seq rather than a partial headless mirror, requesting5000rows.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: tracks live alternate-screen transitions after a provider snapshot :: Provider alternateScreen true is accepted, then live1049l/1049h update isTerminalAlternateScreen false/true.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: translates reset provider snapshots without retaining the old title :: A reset provider snapshot translates new local seq into the runtime domain and replaces Old process title with New process.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits the chunk agentStatus events before its side-effect batch :: Agent status callback precedes side-effect batch callback for one coalesced OSC9999/title/bell chunk.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: still emits a throwing chunk’s facts under its own seq, not the next chunk’s :: A tracker throw still flushes first chunk title facts under its own seq, and second chunk does not inherit those facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: seeds the lazily created tracker from the daemon-snapshot title :: A lazy tracker hydrated from renderer snapshot title Codex working emits agent-idle on later Codex done.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits command-code-working facts only after the banner arms the scrape :: Unarmed Thinking text emits no facts; a Command Code0.27.3 banner then hardcoded colored spinner text emits attributed command-code-working with the submitted prompt.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits a command-code-done fact when the idle composer returns :: After hardcoded banner/working text, returned idle composer emits command-code-done with the earlier submitted prompt.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: resizes the headless mirror after an accepted desktop PTY resize :: An external accepted resize produces the resized dimensions and same status-frame lines as a separately driven reference emulator.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: replaces suffix-only headless state with the recovered renderer snapshot :: Replacing suffix-only state removes old suffix, retains renderer history plus later output/cwd, and returns the live47x40PTY grid.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: stamps SSH connection identity on runtime terminal status :: A synthetic mounted-leaf OSC9999 status after registerPty carries the supplied SSH connectionId.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: does not retain WSL context when a PTY id is reused :: After exit and same-ID new null distro context, OSC7 file://server/share/repo uses UNC server path rather than old Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: preserves immutable context while a live daemon attach is unresolved :: preparePtyExecutionContext with preserveExisting refuses a supplied Debian replacement and subsequent OSC7 keeps original Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts :: projects frame-independent live state through main buffer snapshots :: Main-buffer snapshot puts focus-report/cursor-visibility modes in frameRestoreAnsi, excludes STATIC-FRAME there and includes it in data.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.ts :: continues terminal agent status fanout when a callback throws :: Throwing on the first status callback does not prevent second payload delivery and logs contextual error.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: returns a title-only replay snapshot and never historical attention :: Lose replay:true/title-only fact projection despite earlierbell and unknownPTYnull. No actual delivered-history notification or reattach behavior was exercised. No equivalent replacement claimed.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects a handle rebind while a controller-less status check yields :: A handle rebound while the null-controller status continuation yields must throw terminal_handle_stale.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects confirmation evidence when the owning PTY exits :: A pending strong confirmation resolving after owning PTY exit must reject terminal_exited.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-03.spec.ts :: keeps ordinary terminal send suffix failures on the existing not-writable contract :: Ordinary send writes text but refused CR must throw terminal_not_writable with beforeWrite twice and afterWrite once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell the execution host cannot apply instead of spawning its default :: Requested Windows shell on POSIX must refuse before spawning a default shell.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: quotes the agent startup command for the requested shell, not the host default :: Requested cmd shell must override PowerShell default quoting for agent startup command.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: keeps restored receipts outside a targeted worktree scan :: Targeted scan removes the moved-worktree receipt while preserving another worktree receipt.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: observes setup command completion without waiting for its interactive shell to exit :: Nonzero completion marker 17 resolves while interactive shell remains running.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: falls back to setup terminal exit when no completion signal is available :: Setup completion observer without token falls back to actual exit code 9.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: cancels setup completion observation when the caller aborts :: Abort rejects with the original reason and unsubscribes once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps observing after an uncertain setup terminal status :: Unknown exit waiter result must leave observation pending until completion marker arrives.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh omits a record :: Controller inventory omission disconnects the record but preserves its retained transcript.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh times out :: Hung inventory timeout leaves connected record and retained transcript intact.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle for adopted background PTY handles from the renderer title :: An adopted background handle resolves tui-idle from ready Codex renderer title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves live-leaf tui-idle from an OpenCode native title :: A live leaf resolves tui-idle from an OpenCode native title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from a Codex ready prompt preview :: A supplied Codex prompt preview resolves tui-idle without an actual agent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from an Antigravity prompt before the model line :: A supplied Antigravity prompt before model line resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell with no workspace instead of creating a default-shell tab :: Workspace-less explicit shell must reject before renderer default-tab request or spawn. This real guard/wiring alarm is deliberately retired.", + "Audit3798 per-case accepted losses:\nsrc/main/runtime/orca-runtime-tests/paired-settings.spec.ts :: awaits navigation-only updates from paired clients (%s) :: Updating only claudeSubagentNavigationEnabled waits for the actual controller call to the supplied pending Claude-view reconcile for both on/off values.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: drops a client page record even when its close command cannot be issued :: A removed workspace loses its runtime client-page record and headless browser projection despite close delivery_required rejection, and emits the asynchronous warning.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: leaves client-hosted pages alone when another host still owns the same worktree id :: Removing runtime:env-b metadata with local ownership leaves the local same-ID client page unchanged and issues no close command.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: marks live bindings again when reopening after a promoted window closes :: A reopened window marks its still-registered live worktree in activeWorktreeIdsOnShutdown after the first promoted window closes.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: preserves live SSH session identities when promoting a headless runtime :: Headless-to-desktop promotion records active worktree, SSH connection and remoteSessionIdsByTabId from the supplied surviving SSH PTY/session.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores a surviving renderer when its reload is cancelled :: A sole ready renderer reload cancelled under its current renderer fence returns true and becomes ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores headless authority when desktop promotion navigation is cancelled :: A cancelled desktop promotion with headless recovery returns false while headless authority remains ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: moves a desktop graph to unavailable when its reload times out :: A ready desktop graph without a headless fallback becomes unavailable at the reload deadline and retains its window/epoch.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: recovers a failed headless promotion and accepts a later renderer generation :: A promotion failure restores ready headless authority; a later valid same-window graph publishes ready desktop authority.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: clears a failed pane recovery so a later reconnect can retry :: After relay_reconnecting rejection, the pending recovery lock clears and the same pane/handle can call createTerminal a second time and return its supplied replacement.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: still preserves a CLI agent leaf when the reloaded renderer has not rebound its PTY :: An empty graph published during renderer reload preserves a preallocated live CLI PTY as one listable terminal before renderer rebind.\nsrc/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts :: keeps a no-incarnation handle across an in-graph pane remint :: Within one graph lifetime an unversioned PTY reminted onto another leaf retains its issued handle and resolves its old exit waiter after onPtyExit.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: matches explicit-id cwd PTYs when the resolved worktree cache is incomplete :: An explicit target absent from a fresh incomplete resolved cache adopts only its cwd PTY, rejects nested cwd PTY and does not rescan Git.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: ignores cwd-only controller PTYs for malformed explicit worktree IDs :: Malformed id:repo-1:: returns no terminals, does not adopt cwd-only controller PTY and avoids Git rescanning.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: refuses an SSH-backed create for mobile/runtime callers instead of creating locally :: Loss of this public unserved SSH create error-class/no-local-add/no-local-list alarm.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: records an app-selected parent workspace as a manual action :: Loss of the local runtime folder-parent manual origin, active-workspace source and explicit confidence projection alarm; no claim that SSH or cleanup coverage replaces it.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: browses runtime server directories before projects are added :: Loss of this public runtime alarm for browse availability before registration, directories-first lexical ordering and native path flavor.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: lists drive roots for a server-root browse :: Loss of the Windows public slash-root drive enumeration smoke and presence of the temporary directory drive.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations-part-02.spec.ts :: creates a missing runtime parent before creating the project directory :: Loss of this runtime createRepo recursive missing-parent/child existence and registered-path alarm.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: preserves selected project %s when a hosted parent is known :: Loss of both parent-selected and origin-selected normal fork-link projection/persisted upstream alarms plus exact single-probe count.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: links a current enterprise remote despite unavailable metadata and a retained %s :: Loss of normal current-enterprise-origin linking with stale automatic GitHub avatar or protected file image, unchanged icon assertion, and serialized project identity under unavailable metadata.", + "Audit3788 retires10 authored/11 expanded cases across six changed drivers, including the entire screencast pending-frame-retry and usage-source-cache-streaming suites. Deliberate losses are false-refused last-frame retry/once-only delivery, ordinary stable-pane reattachment, cleared-chat Dispatch completion, terminal-declared chat-caller refusal, at-rest worker liveness projection, nested depth/cap policy, small unsigned6/sealed7 plain-format and verified-bit examples, generic malformed-ISIZE footer refusal examples, and synthetic10k/100k chunk-size/work-count budgets in gzip and general cache I/O. These include real state/disk/RPC outcomes consciously retired for marginal value; retained E2EE-backlog, receipt/custody/uncertain-ack, integrity/migration and staging-cleanup cases are not equivalent replacements. The footer test did not prove early rejection or bounded allocation; staging cleanup did not seed unrelated files. No replacement or fresh native/remote/performance execution is claimed. Earlier raw selectors and dated receipts remain historical.", + "Audit3779 retires17 authored/17 expanded registrations across six changed drivers, including the entire shared-Codex-home and prompt-telemetry suites. Accepted losses are shared-home wrapper noninterference/opt-out preservation, mocked metric count/provenance filters, SSH activity labeling/clearing and handover idle timing, VM ownership/capability/status projections and asleep-worktree refusal, a link-only external conversation replay sample, and two narrow input-credit noninterference/expiry examples. Retain the direct exact-tab/single-use input-credit case. These bounded real disk/state/routing alarms are intentionally retired for marginal value without equivalent replacement or fresh execution claims; earlier receipts remain historical.", + "Audit3772 retires18 authored/27 expanded cases, including whole Codex service opt-out, RPC capability-parser, creator-provenance, short-ciphertext and readiness-null suites. Accepted losses include service ledger/symlink/mode cleanup, user TOML substring preservation, old-hash cleanup, description pass-through, malformed-file/pending-hash examples, coordinator write/probe counts, capability array bounds, positive creator projections, early short-payload refusal and readiness helper null shape. Two redundant Codex exit-cause rows are also retired; Pi shares their direct-idle path only in this empty-output immediate-exit fixture, and future agent-config drift coverage is lost. Real bounded filesystem/parser/runtime alarms are deliberately retired for marginal value; no equivalent replacements or fresh execution are claimed. Earlier receipts retain their historical scope.", + "Audits3754/3755 intentionally remove9 authored/9 finite registrations: the entire one-case usage-source-cache-streaming.test.ts driver and8 cases from the surviving computer-action-validation.test.ts driver. This gate retains an unfiltered root Vitest command; UNIT_INCLUDE admits both source paths. Accepted losses are the real encoder output chunk-size/work-count alarm on repetitive10k/100k ownership payloads through a mocked durable sink, plus CLI diagnostic precedence, fractional window-id rejection, action-call-site window-target exclusivity, plain-text click-count recovery copy, incomplete click/drag targeting, mouse/modifier/direction allowlist samples and inline/stdin text exclusivity. These CLI cases exercise real argument/handler validation before mocked runtime calls; they are deliberately retired for marginal value, not declared tautologies. Retained cache I/O and CLI cases are not equivalent replacements for these alarms. Existing historical raw receipts remain unchanged and do not validate the deleted or reduced drivers. No fresh execution claim is made. Audits3758/3763 intentionally remove9 authored/11 finite registrations from6 changed drivers, including the entire pane-title-notification, window-linear-notices and worktree-card-lifecycle-effects suites. This gate retains an unfiltered root Vitest command admitting these paths. Accepted losses are same-account linked-row success-notice fanout, sidebar-switch channel forwarding, Linear-only notification forwarding/non-terminal-consumer selection/closed-window detach, destroyed-window refusal and first-send-failure suspension through the pane-title adapter, the100-card synthetic focus/poll absence sample, stored-source local folder badge refresh, unobserved-row badge refusal, and immediate reposChanged lineage invalidation. These exercise real owners with controlled ports; they are retired for marginal value, without equivalent replacement claims. The no-badge-work fixture does not seed its title-promised collection-only cache. Preserved historical receipts do not validate deleted or reduced drivers; no fresh execution is claimed. Audit3759 retires the entire one-case Tailwind compiler/scanner smoke. Accept loss of the direct CSS production/test/spec source-exclusion and rescan alarm; no replacement or current execution is claimed.", + "Audit3752 independently approves audit3749: retire five authored/five finite watcher-process registrations, retaining18 raw-exact registrations. Accept loss of healthy shared-pool joint recovery, last-pending-failure idle retirement/respawn, late VITEST fallback release, missing-entry fail-closed selection and independent-supervisor fuse locality alarms. These are real bounded host-policy alarms intentionally retired for low marginal value; no equivalent replacement is asserted. Remaining driver selections exercise controlled FakeChild supervisor lifecycle, cancellation, physical-exit fencing, recovery and fuse behavior. This source review supplies no fresh native/process/platform/remote/SSH execution; historical receipts retain original source and selector scopes.", + "Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered root Vitest command. Current UNIT_INCLUDE admits the partial push-service, metadata-dialog and two config/scripts browser drivers:10 authored/16 finite removals. Accepted losses: actual retry30s/60s progression and register bucket/refill wiring, explicit seven-day lease arithmetic (its notification lacked seq/epoch and never reached send), equal-name edit latch/save payload, real image/font/meta-refresh/form/popup browser refusal controls, and broad rich-markdown bridge/command/edit-select smoke. Actual production state, callback routing and browser enforcement run in these cases; these alarms are deliberately retired on marginal value. All drivers and selectors survive. Existing unrelated receipts remain historical evidence for their unchanged selectors, not proof of the reduced cases.", + "Audit3732 removes 2 authored/3 finite registrations from two partial suites: nominal custom/Kimi local naming success and deferred context usage row presentation. Real losses: custom/Kimi successful extraction through conversation-name sanitization and agentLabel composition; separate ordered counted/deferred lists and exact percentage/token formatting. No replacement or equivalent coverage claimed. Retain 11 authored/13 finite raw-exact registrations for bounded naming instruction/refusal/cancellation, menu dismissal focus ownership and hover/composer Escape/timer cleanup. Source-only bounded value review, no runtime/CI/native/remote/mobile/folder workspace or global completion credit.", + "Audit3733 removes2authored/2finite terminal input checks: fixed custom-cap error/secret fixture and three-emoji cap5refusal whose6UTF16units already trip length fast guard (no UTF8-dependent boundary). Accept exact non-disclosure/oversized-refusal alarm losses; no replacement/equivalence claim. Retain13/13scalar/pending input, OSC state and cron DST/cadence outcomes after bounded material reads. Source-only zero runtime/novelty credit; original historical reasons preserved.", + "Audit3729 removes1authored/3finite by deleting whole CLI runtime pairing advisory-close suite. Accept losing post-real-close injected EIO preservation of native/script/unreadable pairing, env identity/preservation and exact close/release assertions; no actual failed-close leak or replacement coverage claimed. Two retained URL grammar/identity suites11authored16finite raw unchanged. Bounded source/owner/caller value review, zero novelty/runtime credit; other seven3724deferred closures remain. Historical receipts preserve original limits.", + "Audit3724 removes3authored/3finite checks by deleting two whole suites: TUI clear burst-size singleton and terminal-file-URL target two-case wrapper suite. Deliberate losses: derived widest burst<64byte alarm, UNC authority+line-column anchor composition, and malformed-percent null refusal. Real production algorithms execute in those tests; no mocked-output tautology, equivalent replacement, actual Claude/file-navigation delivery or universal safety-irrelevance claim. TUI58byte bound and URI examples have low marginal value as standalone suites. Actual1262/1264/1742KEEP superseded explicitly. Remaining14drivers83authored136finite raw unchanged. Bounded source-only review; ten closures deferred, four bounded keep judgments repeated with zero new semantic-frontier credit. No runtime/CI/native/remote/mobile/folder/global completion claim; historical receipts retain original scope.", + "Audit3723 removes 4 authored/4 finite registrations in two whole suites: keybinding cache freeze/token spellings and host-dependent Orca command name examples. Real losses include returned-object freeze, repeated Mod+P key, Space/PageDown/NumpadSubtract mapping, unknown/empty/prototype-token rejection, and headless Linux versus Windows-server/WSL command choice. No equivalent or replacement coverage claimed. Retain 12 authored/21 finite raw-exact registrations exercising generated scaffold validation, artifact failures, shipped editor/hook/worker/panel tests, actual generated typing compilation, independent CLI root routing and intent-name precedence. Source-only bounded audit; no runtime, CI, native, remote, mobile, folder workspace or global completion credit.", + "Audit3720 removes17authored/23finite checks: whole main catalog-date adapter2 and shared date-helper7, seven renderer nominal ranking/cap/no-date/composition cases, and one browser registration expanding to seven forced-container/DOM-child boundary cases. Deliberate real losses: community oldest-date UTC forwarding, official/undated omission, date sorting/window/invalid/future/skew/clamp and default/override cap; nominal ranking/cap and combined Featured/Newly-added outputs; real CSS459/460,719/720,1055/1056breakpoint, five-card partial-row and720px two-card first-row alarms. Browser cases really measure rendered geometry but force width/remove DOM children; no fake-pixel or tautology rationale. No replacement/equivalent coverage claimed. Retain14authored/19finite raw-exact registrations across4drivers: adversarial featured category/order/tie and installability, date order/window selection, actual PluginManager failure/escaping/duplicate-card suppression, real browser viewport/odd-count geometry/phone catalog visibility, syntax ingress/depth/include/printability and68dlong-bracket auto-close fill-in. No tests/browser/native/UI/provider/remote/mobile/folder/CI/global execution or completion credit.", + "Audit3717 removes6 authored/6finite checks in two whole thin-adapter/presentation suites. Deliberate real losses: ordinary recipe repository-URL withholding and provisioned-root credential scrubbing/forwarding; repository label lockstep suffix expansion, host-scoped map identity/collision grouping, Windows crosshost paths and WSL distro suffixes. Actual provision options, label/sort consumers and host/scrubber delegates inspected; no replacement/equivalence claim. Retain40 authored/84finite registrations raw exact in14 drivers with bounded owner/context review. Prior KEEP superseded for removed suites; no runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit.", + "Audit3714 removes8 authored/39finite checks: whole CLI selector-recovery, task display-text and ANSI grammar suites plus two name joiner/blank tables. Deliberate real losses: selector flag/value/identity and mutation recovery merge/serialization; exact task suffix, transcript fallback, input immutability, cache reuse and edited blocks; independent failed-escape/resumption and OSC/DCS/BEL/ST/C1/nested/unfinished stripping outputs; meaningful-language joiner preservation and invisible/blank-name rejection. These are real bounded alarms, removed as narrow supplied-error examples, helper/token inventories and repeated internal-work fixtures. Prior2936,1195/1196,1214/1215 and1082 KEEP superseded; no replacement or equivalent coverage claimed. Keep9authored/9finite raw-exact registrations in5surviving drivers: screenshot export/failure filesystem behavior, CLI local tree query, event-local reply provenance, vault role-sensitive content and four hostile/UTF16/dangling/tag-name regressions. No native/UI/provider/remote/mobile/folder/runtime/CI/global completion credit.", + "Audit3711 retires2authored/4finite cases by deleting whole clipboard-image-temp-file signature-to-name inventory (HEIC/TIFF/unrecognised bytes) and workspace-last-active switch-on supplied visit/reason singleton, plus its now-orphan test fixture. This intentionally loses real generated-filename suffix/extensionless alarms and real newer-visit archived7day versus inactive30day filtering/older-visit identity alarms. Filesystem writing and production reason pruning really execute; no equivalent replacement or universal absence of safety relevance is claimed. The clipboard test does not inspect written bytes, native delivery or decode; the visit test supplies candidate/timestamps and does not exercise persisted visit routing or actual removal.20authored/20finite cases remain unchanged across4bounded Git/sidecar/removal drivers. No new runner/test/module evaluation or runtime result; historical notes and receipts remain historical.", "Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit.", "Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained.", "Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit.", @@ -4227,7 +4204,8 @@ "Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope.", "Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope.", "Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope.", - "Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed." + "Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage 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." ], "demotionRule": "Demote if a retired runtime transport can leave a renderer subscription without a close event, if a close is delivered more than once, if one failing teardown strands its sibling subscriptions, if payload frames from a retired transport reach the renderer, or if a revealed remote terminal can stay blank or reject input after a reconnect." }, @@ -4345,7 +4323,7 @@ "providers": ["remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "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": "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", @@ -4356,7 +4334,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": "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": "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-grant-registry.test.ts src/main/browser/document-preview/doc-preview-file-reader.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/main/browser/document-preview/doc-preview-failure-notice.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", @@ -4712,6 +4690,10 @@ "Collect 100 consecutive focused CI passes or 14 days without an unexplained flake." ], "knownGaps": [ + "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.", + "Audit3814 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle from a Codex ready prompt even when stale startup lines remain :: Stale MCP startup lines must not block a later Codex ready header.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle when a stale Codex prompt is followed by the ready header :: A Codex ready header following a stale resume prompt must satisfy tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for an idle Cursor lane past its dismissed trust dialog (#8210) :: Later Cursor idle banner overrides retained trust dialog.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not block a mid-run Cursor lane on its dismissed trust dialog (#8210) :: Dismissed trust dialog must not report blocked for later busy Cursor; wait times out.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not classify unrelated press-enter prompts as Codex blocked prompts :: Unidentified press-enter text must time out rather than be classified Codex blocked.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for quiet background PTY agents without OSC titles :: Quiet Codex background terminal without OSC title eventually resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: sends agent prompts as bracketed paste before submit :: Driving prompt escapes embedded paste-end ESC, writes one framed paste then CR, and counts bytes.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: settles a foreground Codex prompt when launch metadata has not arrived :: Codex inferred from foreground without launch metadata waits for composer marker/quiescence before one CR.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: gives a late Codex render marker a fresh quiescence window :: Marker arriving at7.9s re-arms fresh quiet window instead of submitting at initial cap.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: writes large agent prompt paste frames atomically before delayed submit :: A prompt larger than input chunk budget is a single paste write before delayed CR with exact byte count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects oversized terminal.send text before provider writes :: Oversized ordinary terminal.send rejects input-too-large before any provider write.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects focusing an exited background terminal session :: focusTerminal refuses terminal_exited before invoking background reveal.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: pastes the same bytes the desktop draft paste sent for the prompt :: Launch-ready prompt normalizes CR/LF and renders embedded ESC visibly identically to desktop bracketed paste.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: keeps a prompt into a running agent behind the render settle, as before :: Driving prompt remains held through7s repaint activity then submits once by9s.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reports a queued PTY focus as not navigated when its notifier disappears :: Queued PTY focus and completed active reveal report not navigated after notifier removal; no second reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: does not invoke a stale graph-leaf focus notifier after queued PTY work :: Queued graph-leaf focus must not invoke old notifier after preceding PTY reveal and notifier removal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: paginates retained terminal output with explicit limits and truncation metadata :: Preview120lines, fractional limits,50/200 pages, retained2000line truncation and future-cursor metadata stay consistent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: falls back to renderer visible screen when uncursored TUI tail is blank :: Substantial blank uncursored tail uses mounted renderer visible screen with zero scrollback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reads and shows the runtime-owned alternate-screen grid without serialization :: Actual runtime alternate-screen grid provides read/show content without renderer/provider serialization.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: classifies older provider alternate-screen snapshots from ANSI :: Older provider without alternateScreen metadata classifies ANSI alternate entry and returns Remote Vim screen.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: honors the last ANSI screen transition when older provider metadata is absent :: Last ANSI alternate exit overrides earlier entry when explicit provider mode metadata is absent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: rejects a full provider screen frame after live output advances :: Live output arriving during second full-screen capture causes screen-unavailable rather than stale full frame.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: shares one provider snapshot between concurrent read and show calls :: Concurrent read/show share one successful provider snapshot and both receive Shared TUI content.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps cursor reads provider-free on restored alternate-screen PTYs :: Restored alternate-screen cursor transcript reads never acquire provider snapshot.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: backs off after a provider snapshot failure instead of retrying for show :: Failed provider capture is cached/backed off so later show does not retry.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: falls back once to a mounted renderer when a known alternate provider fails :: A known-alternate failed provider capture falls back exactly once to newly mounted renderer.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: bounds provider visible frames for read and show responses :: Provider visible read/show use six bounded lines and300character preview.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps renderer-fallback composer drafts separate from terminal output :: Renderer fallback strips dim composer draft from terminal output and exposes draft separately.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: does not use renderer visible-screen fallback for a short blank shell tail :: Two blank shell lines must not trigger renderer screen fallback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: trims terminal tail character budget without per-line array shifts :: Tail builder trims to256KiB with correct retained suffix and no Array.shift calls.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains ANSI-only status redraws instead of appending every frame :: Repeated erase/redraw replaces preview until newline then publishes one completed cursor row.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains split multi-line ANSI footer redraw state across chunks :: CUU state across chunks retains corrected footer rows and publishes new cursor entries.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not let stale lower rows hide earlier corrected footer rows from cursor reads :: Earlier corrected footer row must not be hidden by stale lower rows in cursor reads.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: bounds completed transcript entries from a single multi-line redraw chunk :: Single redraw chunk bounds completed transcript to2000retained lines and correct oldest/next/latest cursors.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains multi-line ANSI redraws when the last footer row stays partial :: Partial final redrawn row appears in preview but cursor sees it only after newline.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not retain split ANSI controls as visible terminal preview text :: Split color/mode escapes never leak preview fragments; long split OSC title truncates at MAX_OSC_TITLE_CHARS.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains same-line redraw cursor position across split full-line erase chunks :: Full-line erase preserves column across chunks so XY follows three spaces rather than old ABC.\nsrc/main/runtime/orca-runtime-tests/conpty-stream-read.spec.ts :: fills the requested line count even when blank rows sit below the prompt :: Blank rows below a ConPTY prompt must not consume the requested nonempty-line count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: does not retain split ST-terminated string controls as preview text :: Split ST-terminated Kitty/string controls must remain excluded from preview text.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects split OSC titles before retaining terminal previews :: Split BEL OSC title must update working title/status without leaking into preview.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects ST-terminated OSC titles split before the final backslash :: ST OSC split before final backslash must update title without leaking framing.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: preserves a trailing escape after a completed OSC title :: Completed OSC followed by pending ESC must preserve the next idle-title transition.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: seeds newly synced leaves from PTY pending ANSI state :: A newly synced graph leaf inherits pending ANSI so a split color fragment cannot leak.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: bounds retained partial terminal output before preview reads :: Partial terminal state stays capped at 4000, preserves retained array identity, and preview truncation/cursor output remains correct.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: submits the mail pointer to Cursor Agent only after the paste-burst delay :: Cursor mailbox pointer Enter must wait through the paste-burst delay; this is a real input-timing alarm intentionally retired.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts :: adopts a v1.4.150-shaped agent, setup, and shell orphan as one topology transaction :: Stale incarnation refuses without topology change; three agent/setup/shell lanes adopt atomically with layout/group/revision and preserved read/input/resize; exact replay is idempotent and competing owner refuses.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: retires the exact worker when it exits after renderer reveal :: Exact worker exit after reveal retires that worker and its surface.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: re-reveals a recovered worker after the renderer graph epoch changes :: Changed renderer graph epoch invalidates reveal receipt and forces another reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: defers recovery when the renderer omits the exact reveal identity :: Missing exact reveal identity defers recovery after two attempts.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: reconciles a same-id process replacement before headless adoption :: A process replacement before headless adoption must fence off stale ownership.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retires provider resume only after authoritative inventory proves the legacy PTY exited :: Authoritative owning-host inventory overrides false local hasPty, avoids SSH scanning, retires exited provider resume/surface, adopts live workers without headless reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retries inventory and unknown liveness without revealing a ghost worker :: Inventory failure and unknown liveness must retry without ghost reveal, eventually adopt, and stop retrying.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: refuses a live reserved pane before issuing a handle or revealing it :: A requireFreshPane launch receiving a live reserved owner must reject before handle/reveal/kill, and release its claim. No equivalent replacement claimed.", + "Audit3806 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: skips a listener unsubscribed mid-fan-out even with mobile exclusions active :: A listener removed by an earlier listener during one fanout is not called, including with a side-effect-excluded mobile listener present.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: retains bytes emitted before a fresh daemon spawn resolves :: Bytes and title arriving before an initial zero/reset provider response survive in the serialized headless buffer with their counted sequence.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits command-finished facts with best-effort exit codes across chunk splits :: A split OSC133 D exit code becomes130 and a missing code becomes null in ordered command-finished facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits pr-link facts once per URL with batch attribution :: A split GitHub PR URL yields42 rather than4, emits42/43 once each, and carries PTY/worktree/tab attribution.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits 2031-subscribe facts across chunk splits :: Split ESC[?20 then31h emits exactly one2031-subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: restores a provisional 2031 subscribe when daemon scan authority returns :: Returning daemon scan authority with partial scan seed and pending2031 subscription restores exactly one subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers the tracked title over the renderer snapshot lastTitle :: A synthetic live Cursor title overrides stale renderer lastTitle while preserving renderer snapshot source.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers provider history over a partial headless mirror for requested snapshots :: Authoritative requested snapshots return supplied provider frame/history/seq rather than a partial headless mirror, requesting5000rows.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: tracks live alternate-screen transitions after a provider snapshot :: Provider alternateScreen true is accepted, then live1049l/1049h update isTerminalAlternateScreen false/true.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: translates reset provider snapshots without retaining the old title :: A reset provider snapshot translates new local seq into the runtime domain and replaces Old process title with New process.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits the chunk agentStatus events before its side-effect batch :: Agent status callback precedes side-effect batch callback for one coalesced OSC9999/title/bell chunk.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: still emits a throwing chunk’s facts under its own seq, not the next chunk’s :: A tracker throw still flushes first chunk title facts under its own seq, and second chunk does not inherit those facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: seeds the lazily created tracker from the daemon-snapshot title :: A lazy tracker hydrated from renderer snapshot title Codex working emits agent-idle on later Codex done.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits command-code-working facts only after the banner arms the scrape :: Unarmed Thinking text emits no facts; a Command Code0.27.3 banner then hardcoded colored spinner text emits attributed command-code-working with the submitted prompt.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits a command-code-done fact when the idle composer returns :: After hardcoded banner/working text, returned idle composer emits command-code-done with the earlier submitted prompt.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: resizes the headless mirror after an accepted desktop PTY resize :: An external accepted resize produces the resized dimensions and same status-frame lines as a separately driven reference emulator.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: replaces suffix-only headless state with the recovered renderer snapshot :: Replacing suffix-only state removes old suffix, retains renderer history plus later output/cwd, and returns the live47x40PTY grid.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: stamps SSH connection identity on runtime terminal status :: A synthetic mounted-leaf OSC9999 status after registerPty carries the supplied SSH connectionId.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: does not retain WSL context when a PTY id is reused :: After exit and same-ID new null distro context, OSC7 file://server/share/repo uses UNC server path rather than old Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: preserves immutable context while a live daemon attach is unresolved :: preparePtyExecutionContext with preserveExisting refuses a supplied Debian replacement and subsequent OSC7 keeps original Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts :: projects frame-independent live state through main buffer snapshots :: Main-buffer snapshot puts focus-report/cursor-visibility modes in frameRestoreAnsi, excludes STATIC-FRAME there and includes it in data.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.ts :: continues terminal agent status fanout when a callback throws :: Throwing on the first status callback does not prevent second payload delivery and logs contextual error.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: returns a title-only replay snapshot and never historical attention :: Lose replay:true/title-only fact projection despite earlierbell and unknownPTYnull. No actual delivered-history notification or reattach behavior was exercised. No equivalent replacement claimed.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects a handle rebind while a controller-less status check yields :: A handle rebound while the null-controller status continuation yields must throw terminal_handle_stale.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects confirmation evidence when the owning PTY exits :: A pending strong confirmation resolving after owning PTY exit must reject terminal_exited.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-03.spec.ts :: keeps ordinary terminal send suffix failures on the existing not-writable contract :: Ordinary send writes text but refused CR must throw terminal_not_writable with beforeWrite twice and afterWrite once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell the execution host cannot apply instead of spawning its default :: Requested Windows shell on POSIX must refuse before spawning a default shell.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: quotes the agent startup command for the requested shell, not the host default :: Requested cmd shell must override PowerShell default quoting for agent startup command.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: keeps restored receipts outside a targeted worktree scan :: Targeted scan removes the moved-worktree receipt while preserving another worktree receipt.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: observes setup command completion without waiting for its interactive shell to exit :: Nonzero completion marker 17 resolves while interactive shell remains running.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: falls back to setup terminal exit when no completion signal is available :: Setup completion observer without token falls back to actual exit code 9.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: cancels setup completion observation when the caller aborts :: Abort rejects with the original reason and unsubscribes once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps observing after an uncertain setup terminal status :: Unknown exit waiter result must leave observation pending until completion marker arrives.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh omits a record :: Controller inventory omission disconnects the record but preserves its retained transcript.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh times out :: Hung inventory timeout leaves connected record and retained transcript intact.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle for adopted background PTY handles from the renderer title :: An adopted background handle resolves tui-idle from ready Codex renderer title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves live-leaf tui-idle from an OpenCode native title :: A live leaf resolves tui-idle from an OpenCode native title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from a Codex ready prompt preview :: A supplied Codex prompt preview resolves tui-idle without an actual agent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from an Antigravity prompt before the model line :: A supplied Antigravity prompt before model line resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell with no workspace instead of creating a default-shell tab :: Workspace-less explicit shell must reject before renderer default-tab request or spawn. This real guard/wiring alarm is deliberately retired.", + "Audit3798 per-case accepted losses:\nsrc/main/runtime/orca-runtime-tests/paired-settings.spec.ts :: awaits navigation-only updates from paired clients (%s) :: Updating only claudeSubagentNavigationEnabled waits for the actual controller call to the supplied pending Claude-view reconcile for both on/off values.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: drops a client page record even when its close command cannot be issued :: A removed workspace loses its runtime client-page record and headless browser projection despite close delivery_required rejection, and emits the asynchronous warning.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: leaves client-hosted pages alone when another host still owns the same worktree id :: Removing runtime:env-b metadata with local ownership leaves the local same-ID client page unchanged and issues no close command.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: marks live bindings again when reopening after a promoted window closes :: A reopened window marks its still-registered live worktree in activeWorktreeIdsOnShutdown after the first promoted window closes.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: preserves live SSH session identities when promoting a headless runtime :: Headless-to-desktop promotion records active worktree, SSH connection and remoteSessionIdsByTabId from the supplied surviving SSH PTY/session.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores a surviving renderer when its reload is cancelled :: A sole ready renderer reload cancelled under its current renderer fence returns true and becomes ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores headless authority when desktop promotion navigation is cancelled :: A cancelled desktop promotion with headless recovery returns false while headless authority remains ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: moves a desktop graph to unavailable when its reload times out :: A ready desktop graph without a headless fallback becomes unavailable at the reload deadline and retains its window/epoch.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: recovers a failed headless promotion and accepts a later renderer generation :: A promotion failure restores ready headless authority; a later valid same-window graph publishes ready desktop authority.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: clears a failed pane recovery so a later reconnect can retry :: After relay_reconnecting rejection, the pending recovery lock clears and the same pane/handle can call createTerminal a second time and return its supplied replacement.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: still preserves a CLI agent leaf when the reloaded renderer has not rebound its PTY :: An empty graph published during renderer reload preserves a preallocated live CLI PTY as one listable terminal before renderer rebind.\nsrc/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts :: keeps a no-incarnation handle across an in-graph pane remint :: Within one graph lifetime an unversioned PTY reminted onto another leaf retains its issued handle and resolves its old exit waiter after onPtyExit.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: matches explicit-id cwd PTYs when the resolved worktree cache is incomplete :: An explicit target absent from a fresh incomplete resolved cache adopts only its cwd PTY, rejects nested cwd PTY and does not rescan Git.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: ignores cwd-only controller PTYs for malformed explicit worktree IDs :: Malformed id:repo-1:: returns no terminals, does not adopt cwd-only controller PTY and avoids Git rescanning.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: refuses an SSH-backed create for mobile/runtime callers instead of creating locally :: Loss of this public unserved SSH create error-class/no-local-add/no-local-list alarm.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: records an app-selected parent workspace as a manual action :: Loss of the local runtime folder-parent manual origin, active-workspace source and explicit confidence projection alarm; no claim that SSH or cleanup coverage replaces it.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: browses runtime server directories before projects are added :: Loss of this public runtime alarm for browse availability before registration, directories-first lexical ordering and native path flavor.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: lists drive roots for a server-root browse :: Loss of the Windows public slash-root drive enumeration smoke and presence of the temporary directory drive.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations-part-02.spec.ts :: creates a missing runtime parent before creating the project directory :: Loss of this runtime createRepo recursive missing-parent/child existence and registered-path alarm.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: preserves selected project %s when a hosted parent is known :: Loss of both parent-selected and origin-selected normal fork-link projection/persisted upstream alarms plus exact single-probe count.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: links a current enterprise remote despite unavailable metadata and a retained %s :: Loss of normal current-enterprise-origin linking with stale automatic GitHub avatar or protected file image, unchanged icon assertion, and serialized project identity under unavailable metadata.", "Audit2643 deletes the seven fake-manager browser IPC cases: renderer-owned registration repair, untrusted download cancellation refusal, exact certificate approval, cancelled pending grab enablement, in-flight grab serialization, stale guest registration waits, and annotation ownership refusal. These alarms are intentionally lost without replacement; dated evidence retains its original scope and no fresh gate execution is claimed.", "Audit2145 accepts removal of canned runtime metadata/guard/forwarding, fake in-memory persistence, private work-count and wrapper-duplication tests from the construction/orca-runtime.test.ts aggregate, plus the two automation run-context guards from runtime-workspace-launch-contracts.test.ts. Retained race, framing, physical completion and ownership callbacks remain byte-identical. Existing commands remain valid selectors; historical receipts stay unchanged and provide no fresh validation or replacement coverage for the reduced suites.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/main/runtime/construction/orca-runtime.test.ts: remove only literal registration import/call pairs await import('../orca-runtime-tests/worktree-setup-and-startup.spec'), await import('../orca-runtime-tests/gitlab-and-pr-bases.spec'); no additional authored credit. src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts: routes tab switch and capture start by explicit page id; accepts focus on tab switch without altering bridge args (focus is main-side concern); keeps terminal cwd resolution fail-soft when the provider is unavailable. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts: drops the bounded scan cache when orphan-cleanup removal completes; clears optimistic reconcile tokens when a CLI worktree removal succeeds; emits drift without mutating when the fetched base fast-forwards created HEAD; emits base_changed without mutation when the fetched base rewrote history; skips stale-token reconciles without mutating or emitting stale status; emits unknown without mutation when fetch fails or the base ref is missing. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts: routes runtime preserved-branch force-delete through the selected WSL project runtime; replies to a waiting client with the error of a delete that fails after acceptance; treats forced runtime deletion of an already-missing unregistered worktree as cleanup; treats normal runtime deletion of an already-missing unregistered worktree as cleanup. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts: warns that a missing-repo removal only forgot the workspace; restores runtime watchers when CLI worktree deletion fails after teardown; does not re-spend the drain budget on a removal after a wedged install was abandoned; routes runtime worktree removal through the selected WSL project runtime; force-deletes a branch that was preserved by runtime worktree removal. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts: records GitLab pasted-project recents only after successful runtime lookup; threads explicit origin preference through runtime WSL PR base resolution; resolves local GitLab fork MR bases from the target project MR head ref; captures the fork MR head from a dedicated ref, not the shared FETCH_HEAD; keeps the durable MR head when the head fetch fails but the local ref resolves; routes runtime GitLab fork MR base git calls through the selected WSL project runtime. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts: passes SSH connection ids through GitLab task operations; routes runtime GitLab issue, MR, work-item, and todo actions through the selected WSL project runtime; routes runtime GitLab MR details, review-management, job, and pasted URL actions through the selected WSL project runtime; normalizes runtime GitLab issue list arguments like the desktop IPC path. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts: does not warn when setup is explicitly skipped for CLI-created worktrees; puts the agent a create starts in the first default tab, as the window does; keeps the 8s main-runtime startup readiness budget for agents without an override; gives OpenCode the 20s main-runtime startup readiness budget; launches explicit startup agents with prompts for CLI-created worktrees. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts: returns a setup launch payload for CLI-created worktrees when hooks are explicitly enabled; does not hand the window a setup main never tried to start; passes the selected Windows setup shell into runtime runner generation; follows normal setup policy for CLI-created worktrees without activating them; uses returned WSL setup shell metadata when runtime spawns setup; uses the shell-aware setup runner for windowless creates without a startup command; reports the in-process setup hook as running when nothing can launch the runner. src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts: coalesces two clients sleeping the same host worktree; stops exactly the expected live PTYs for a worktree; explains a refused workspace close instead of throwing the raw refusal enum. src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts: marks the desktop-active worktree as isActive; includes SSH-backed worktrees in the mobile worktree summary; caches repeated malformed path misses before normalizing them again. src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts: keeps title-only foreground work ahead of monitoring in another pane; keeps a local hook row while a connected PTY still backs its pane; keeps an OSC row via its connected PTY after the pane binding is cleared. src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts: resolves files through a source-visible linked-checkout worktree; marks saved session tabs with live PTYs as host sidebar activity; attributes live legacy PTYs from saved layout bindings when their panes are hidden; marks saved browser tabs as host sidebar activity like desktop; falls back to the path-keyed GitHub cache entry; includes folder workspaces in compact worktree summaries for mobile; attaches inline agent rows from the latest OSC 9999 status; projects monitoring over a title-derived working status. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts: pushes to an idle pane when the only live waiter filters out the message type; resolves a registered waiter without PTY-injecting when the leaf is already idle; keeps already-idle status after tui-idle wait for immediate message delivery; resolves message waiters when notifyMessageArrived is called; does not resolve type-filtered message waiters for unrelated message types; removes message waiter abort listeners after message arrival; resolves message waiters on timeout when no message arrives. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts: delivers pending mail via notifyMessageArrived when the recipient is already idle; does not keep retrying when every pending row was already pointed; repoints pending rows restored with a live-idle coordinator. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts: rolls back a half-created terminal whose surface never publishes. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts: rejects startup prompts for agents that require post-ready stdin; uses portable Unix quoting for mobile agent launch commands in WSL project runtimes; keeps PowerShell quoting for mobile agent launch commands in Windows host runtimes; uses cmd.exe quoting for mobile agent launch commands in local Windows host runtimes; publishes headless mobile session agent identity with synthesized PTY status; rejects disabled mobile session agent launches before spawning; validates mobile terminal insertion anchors before resolving agent launch commands. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts: coalesces a reconnect close burst onto one authoritative PTY inventory; keeps an explicit user close destructive while the PTY is live; builds mobile session agent launch commands on the runtime host; injects mobile quick-command prompts into the host-built agent startup command. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts: closes persisted headless terminal parents before any prior list call; tears down a serve-owned headless tab on close while a renderer is attached so it cannot resurrect; defers a renderer-published pending tab to the renderer instead of tearing it down; returns a delegated close outcome with no selection tombstone when the renderer owns the outcome; tears down a runtime pending shell the renderer never adopted on close. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts: materializes a plain shell when the pending tab has no launch agent; hydrates legacy persisted terminal tabs without layout entries; reads and indexes the full agent-status snapshot once per mobile projection; kills persisted SSH PTYs when closing hydrated headless tabs before pane metadata is restored; materializes hydrated pending headless terminals with the persisted session identity. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts: hydrates a persisted SSH-owned pane before an attached renderer publishes its graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts: publishes the desktop's tab name over the live agent title, and the live title without one; uses fresh neutral PTY titles over stale mobile snapshot and OSC titles; operates PTY-backed mobile session terminals without a renderer graph; reuses pane close for live PTYs that do not own a renderer tab; lists PTY-backed mobile session terminals without a renderer graph; shows and resolves active PTY-backed mobile session terminals without a renderer graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts: creates mobile session terminals for folder workspaces in a headless runtime server; spawns fresh headless SSH mobile session terminals instead of reattaching synthetic local ids; hydrates headless mobile session terminals from the host workspace session; keeps live headless mobile session terminals when a desktop renderer publishes without them; publishes laptop-created remote runtime split terminals to phone session tabs. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts: does not report headless wake degradation without sleeping records; does not wake slept agents for non-mobile session-only activation; does not rewrite unread metadata when a mobile activation finds the worktree already read; returns unread:false from worktree.ps after a mobile activation clears the flag; materializes pending mobile session terminals without focusing desktop clients; closes browser mobile session tabs when addressed by browser workspace id. src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts: resolves mobile terminal surfaces by exact split leaf; closes the matching mobile terminal UUID leaf without closing the whole tab; closes the whole mobile terminal tab when addressed by parent tab id; activates the active split leaf when addressed by parent tab id; clears unread metadata on mobile worktree activation without focusing desktop clients; wakes slept agents on the host renderer when a phone activates a worktree. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts: publishes the hook provider session on a headless mobile tab so native chat can address the transcript; recovers the agent type from the hook row when the pane was launched without an agent hint; reads one agent-status snapshot per projection, not one per terminal tab; waits for unknown-launch foreground owner before publishing Pi-compatible mobile status; keeps Pi-compatible mobile session status as Pi for an unknown-launch foreground pi PTY; keeps renderer-vetted mobile agent status for custom-titled terminals. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts: publishes terminal surface agent status for paired web clients; preserves authoritative OMP identity for Pi-compatible remote terminal snapshots; normalizes a remote OMP title without republishing omitted launch identity; skips the foreground-process probe when the PTY launch agent is already known; probes the foreground process only on a status transition for unknown launch agents; passes the client signal and the slept-worktree refusal to the spawn. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts: does not use stale runtime-created PTY status when a neutral PTY title exists; recognizes runtime-created Codex PTY handles from the ready prompt; recognizes runtime-created Antigravity PTY handles from the ready prompt; recognizes live leaf Antigravity terminals from the ready prompt; recognizes a later Antigravity header with a prompt but no model line; keeps mobile terminal surfaces visible while their leaf handle is pending. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts: lets Claude agents management titles clear stale runtime-created title status; does not recognize live Claude agents panes from a Claude foreground process; does not let stale tab-level agent titles override current neutral pane titles; lists live terminals with fresh pane titles over stale tab titles; lets adopted neutral pane titles use non-shell foreground fallback; lets adopted neutral pane titles retry wrapper foregrounds until recognized; authorizes settled CLI prompts only after positive %s foreground identity; does not recognize arbitrary foreground TUIs as running agents; lets live neutral pane titles retry wrapper foregrounds until recognized; lets current Claude agents PTY titles override stale runtime-created OSC titles; does not let stale Claude agents OSC titles suppress current PTY title activity. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts: keeps preallocated terminal handles valid across renderer reloads; preserves runtime-created PTY process identity after graph unavailable; keeps prompt bindings fenced across runtime restarts without provider incarnation; recognizes runtime-created PTY handles with agent launch titles; does not treat a bare Cursor Agent native title as a running agent session; uses stale runtime-created PTY status when there is no title or foreground evidence. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts: keeps orphaned list and show writability aligned with the send gate. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts: cancels a coalesced SSH worker recovery retry when its provider disconnects. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts: retries renderer reveal before clearing an adopted legacy worker sleeping record. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts: recovers exported ORCA_TERMINAL_HANDLE from discovered live PTY sessions. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts: applies ANSI erase-from-start line controls in retained previews; applies ANSI stripping for private or intermediate CSI line controls; applies ANSI stripping for unsupported erase-line modes; reveals an agent terminal under the pane the caller reserved; keeps a fresh %s pane host-owned when a desktop window is available; keeps desktop publication %s separate from the reserved host spawn; mints its own pane when the reserved leaf is malformed, and reports the one it used; starts an agent terminal with the model the caller picked; starts an agent terminal without a model flag when no pick was made; attributes a startup-agent launch named %s as %s; attributes a fresh agent session the host builds as unknown; leaves a bare agent command the user typed out of launch attribution. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts: trims oversized terminal output bursts without per-line array shifts; builds terminal previews without mapping the full retained tail; keeps recent PTY replay output capped without needing previous data for large chunks; applies terminal redraw controls before retaining previews; applies ANSI terminal redraw controls before retaining previews; retains multi-line ANSI footer redraws instead of appending old frames; keeps the cursor column when erasing full lines in multi-line redraws; applies ANSI split redraw controls without leaking raw params. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts: returns renderer visible screen lines through terminal.read RPC JSON result; separates composer drafts from provider-owned terminal screens. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts: reports an in-flight PTY focus as not navigated when its notifier disappears; reports graph-leaf focus as not navigated without a host notifier; grounds the provider mode tracker before a later chunk, in the emulator order; grounds an in-flight provider snapshot capture so it cannot publish the pre-reset screen; waits for terminal exit and resolves with the exit status; keeps terminal read payloads bounded while retained output remains pageable; trims terminal read preview character budget without per-line array shifts. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts: submits a silent Claude composer once after the bounded render fallback; chunks large terminal.send text before provider writes; yields chunked terminal input through immediates between writes; yields while validating accepted large terminal.send text before provider writes; reveals a background terminal session when focusing its handle; replays captured launch config when focusing a background agent session; reveals background terminal sessions with the freshest PTY title; renames background terminal handles without requiring a visible tab; keeps a background terminal handle stable while reveal adoption is racing. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts: resolves tui-idle when a stale Codex prompt is followed by Antigravity readiness; returns an agent-neutral blocked wait result for update prompts; returns an agent-neutral blocked wait result for workspace trust prompts; returns an agent-neutral blocked wait result for cwd selection prompts; returns a blocked wait result for Codex model migration prompts; returns a blocked wait result for Codex startup hook review prompts; returns an agent-neutral blocked wait result for generic interactive prompts; splits text and enter writes for background terminal handles; types the lead line for %s: %s; submits through the agent-specific PTY timing policy for %s. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts: waits for exit on background terminal handles; keeps retained PTY transcript memory when controller refresh fails; resolves tui-idle from an Antigravity ready prompt preview; resolves Antigravity ready prompts with newline-heavy pasted tails without splitting; resolves live-leaf tui-idle from an Antigravity ready prompt preview. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts: spawns the available Qoder command for a captured same-session resume: %s; does not use the local Windows shell setting for remote Windows bare agent creates; matches canonical bare agent commands when a command override is configured; keeps non-bare agent command terminal creates unchanged; keeps disabled bare agent command terminal creates unchanged; injects runtime hook receiver env into terminal sessions; creates background terminal sessions for a $label; creates background terminal sessions for a $label; enables Claude Agent Teams only for direct Claude launches when configured in-process; reveals Claude Agent Teams launches with the rewritten launch config; preserves Claude Agent Teams for sequenced Claude launches. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts: creates visible terminal sessions without asking the renderer to focus a tab; asks the pty controller for the requested shell instead of a startup command; knows the agent a flagged launch command names before any process read; retires a flagged command pane identity when the command exits; retires only receipted restored PTY authority on command completion and exit; forgets synthetic handles when disconnected PTY records are pruned. src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts: returns OSC titles from headless main terminal snapshots; adopts renderer-seeded titles into headless main terminal snapshots; returns cwd metadata from seeded headless main terminal snapshots; adopts OSC7 host metadata from seeded headless terminal scrollback; falls back to the renderer snapshot for hidden-output recovery without headless state; keeps an empty headless snapshot authoritative for hidden-output recovery; advances the absolute output sequence across a daemon stream gap; emits explicit OSC 9999 agent status from runtime PTY data. src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts: falls back to the provider snapshot for a restored PTY with no mounted renderer; falls back to the available mirror when authoritative provider history is unavailable; keeps an empty renderer snapshot when the provider has no retained content; keeps restored provider history authoritative after later live output; uses provider alternate-screen state while a partial model is unsafe; prefers the tracked title over the headless emulator lastTitle; keeps the cursor-agent literal in record-fallback snapshots only without a tracker title; touches mobile snapshots once for decorative spinner ticks, again on idle. src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts: creates a same-repo PR branch override from a resolved head SHA and matching push target; skips broad remote fetch for an existing full-SHA PR base; creates a selected Bitbucket PR branch override from a matching remote branch; suffixes an existing PR when a matching push target lacks selected PR metadata; suffixes a matching push target branch when selected PR metadata has no PR number; suffixes a matching push target branch when the existing PR is different; suffixes a selected PR remote conflict when the PR lookup fails; checks out an unused runtime PR branch only when it is at the resolved head SHA; suffixes only the runtime worktree path when an exact PR branch checkout path exists. src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts: returns runtime local base update suggestions from addWorktree; creates a runtime local worktree from a usable persisted local branch base; does not create a runtime local worktree when the refresh fails and no local base ref exists; creates a branchNameOverride worktree from the selected matching remote base ref. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/construction/orca-runtime.test.ts, src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts, src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts, src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts, src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts. Unresolved local/computed edges remain explicit debt.", @@ -4794,7 +4776,8 @@ "Audit3342 historical original evidenceRuns object, preserved verbatim; retired objects are not active evidence or replacement coverage:\n{\n \"date\": \"2026-08-27\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/store/slices/browser-workspace-doc-location.test.ts src/renderer/src/runtime/sync-runtime-graph-editor-diff-tabs.test.ts src/renderer/src/components/browser-pane/workspace-doc/workspace-doc-page-pane.test.tsx src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx\",\n \"currentCommand\": \"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/runtime/sync-runtime-graph/sync-runtime-graph-editor-diff-tabs.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx\",\n \"result\": \"failed\",\n \"durationSeconds\": 3,\n \"summary\": \"One sole-delta mutant dropping the window-focus re-offer: the guest is focused once at mount and never again after the window comes back, which is the desktop gap behind it — another app taking the front leaves the preview's only route out shut until the pane remounts. It fails only the new re-offer test, and the refusing-preview case beside it stays green, so the re-offer is pinned as gated rather than unconditional.\"\n }", "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. Original scope text is retained as the exact suffix of coverageNotes/oracle; historical evidence is unchanged.", "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. Earlier notes, complete dated receipts and archived gaps retain their original scopes.", - "Audit3460 historical original active selectors (verbatim JSON values; not current coverage):\ncommands: [\n \"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\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/document-preview/doc-preview-grant-registry.test.ts src/main/browser/document-preview/doc-preview-file-reader.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/main/browser/document-preview/doc-preview-failure-notice.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\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/sessions/partition-policies/browser-session-partition-policies.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/sessions/partition-policies/browser-session-partition-policies.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/store/slices/browser/pages/browser-workspace-doc-location.test.ts\",\n \"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\",\n \"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\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts\",\n \"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\",\n \"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\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/link-actions/LinkActionPopover.test.tsx\",\n \"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\",\n \"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\",\n \"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\",\n \"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\",\n \"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 --repeat-each=3\",\n \"npx playwright test --config tests/playwright.config.ts --project=electron-headless tests/e2e/paired-remote-html-preview-local-render.spec.ts --workers=1\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser/client-pages/orca-runtime-browser.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/browser/client-pages/orca-runtime-browser.test.ts src/renderer/src/hooks/useIpcEvents-close-routing-session-tabs.test.ts src/renderer/src/store/slices/browser/browser.test.ts\",\n \"SKIP_BUILD=1 pnpm exec playwright test tests/e2e/paired-browser-create-navigation-deadline.spec.ts --config tests/playwright.config.ts --project electron-headful --workers=1\",\n \"SKIP_BUILD=1 ORCA_E2E_FORCE_HEADFUL=1 ORCA_E2E_FORWARD_APP_LOGS=1 pnpm exec playwright test tests/e2e/paired-browser-creation-reconciliation-failure.spec.ts --config tests/playwright.config.ts --project electron-headful --workers=1 --reporter=line\",\n \"SKIP_BUILD=1 ORCA_E2E_FORCE_HEADFUL=1 ORCA_E2E_FORWARD_APP_LOGS=1 pnpm exec playwright test tests/e2e/paired-browser-creation-reconciliation-failure.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1 --reporter=line\"\n ]\ntestFiles: [\n \"src/main/runtime/browser/client-pages/orca-runtime-browser.test.ts\",\n \"src/renderer/src/hooks/useIpcEvents-close-routing-session-tabs.test.ts\",\n \"src/renderer/src/store/slices/browser/browser.test.ts\",\n \"src/main/browser/document-preview/doc-preview-grant-registry.test.ts\",\n \"src/main/browser/document-preview/doc-preview-file-reader.test.ts\",\n \"src/main/browser/sessions/partition-policies/browser-session-partition-policies.test.ts\",\n \"src/main/browser/document-preview/doc-preview-guest-policy.test.ts\",\n \"src/main/browser/document-preview/doc-preview-failure-notice.test.ts\",\n \"src/renderer/src/store/slices/browser/pages/browser-workspace-doc-location.test.ts\",\n \"src/main/browser/guest-lifecycle/manager/viewport/browser-manager-annotation-bridge.test.ts\",\n \"src/main/browser/backends/offscreen-browser-backend-lifecycle.test.ts\",\n \"src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts\",\n \"src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx\",\n \"src/shared/document-preview/doc-preview-scheme.test.ts\",\n \"src/renderer/src/lib/browser/documents/doc-preview-grants.test.ts\",\n \"src/renderer/src/components/browser-pane/workspace-doc/doc-preview-external-link-confirmation.test.ts\",\n \"src/renderer/src/components/link-actions/LinkActionPopover.test.tsx\",\n \"src/renderer/src/store/slices/browser/pages/browser-page-conversion.test.ts\",\n \"src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-conversion-publish.test.ts\",\n \"tests/e2e/paired-remote-html-preview-local-render.spec.ts\",\n \"tests/e2e/paired-preview-address-bar-convergence.spec.ts\",\n \"tests/e2e/paired-browser-create-navigation-deadline.spec.ts\",\n \"tests/e2e/paired-browser-creation-reconciliation-failure.spec.ts\",\n \"src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts\"\n ]\nassertionRefs: [\n {\n \"file\": \"src/renderer/src/hooks/useIpcEvents-close-routing-session-tabs.test.ts\",\n \"assertions\": [\"explicit cleanup cannot close a page owned by another worktree\"]\n },\n {\n \"file\": \"src/renderer/src/store/slices/browser/browser.test.ts\",\n \"assertions\": [\n \"a requested canonical page ID is stored on the page rather than reused as its workspace ID\",\n \"duplicate canonical page IDs are rejected before a second tab can materialize\"\n ]\n },\n {\n \"file\": \"tests/e2e/paired-remote-html-preview-local-render.spec.ts\",\n \"assertions\": [\n \"the host's HTML document renders inside the client-local orca-preview guest\",\n \"neither the client browser-workspace count nor the host browser-tab count moves off baseline\",\n \"the preview opens in its own split with mode html-preview and leaves the source editor active\",\n \"an explicit click reactivates the preview, and closing it preserves the source editor, its group, and the terminal\",\n \"the document reports having attempted both its unattended and its post-press egress, so neither absence assertion can pass on a document that never tried\",\n \"a scripted window.open and location.href driven by a real press elsewhere in the document route nothing and move no browser count\",\n \"a real target=_blank press in the rendered document routes out as an Orca browser tab while the preview stays open\"\n ]\n },\n {\n \"file\": \"src/main/browser/document-preview/doc-preview-file-reader.test.ts\",\n \"assertions\": [\n \"reads a document too large for one reply by range under the same grant\",\n \"refuses a document rewritten between ranges instead of splicing versions\",\n \"requires approval for a sibling directory before touching the runtime\"\n ]\n },\n {\n \"file\": \"src/main/browser/document-preview/doc-preview-grant-registry.test.ts\",\n \"assertions\": [\n \"keeps silent authority over a document directory strictly inside the workspace, and only there\",\n \"uses Windows semantics when authorizing a sibling directory\",\n \"keeps an approved SSH directory inside the canonical workspace boundary\"\n ]\n },\n {\n \"file\": \"src/main/browser/document-preview/doc-preview-failure-notice.test.ts\",\n \"assertions\": [\"413 and 415 map to distinct reasons and everything else stays generic\"]\n },\n {\n \"file\": \"src/main/browser/document-preview/doc-preview-guest-policy.test.ts\",\n \"assertions\": [\n \"never rebinds a bound guest onto a second grant\",\n \"leaves a re-minted preview registered when the guest it replaced tears down\"\n ]\n },\n {\n \"file\": \"src/shared/document-preview/doc-preview-scheme.test.ts\",\n \"assertions\": [\n \"malformed grant ids and unsupported schemes are refused\",\n \"undecodable percent escapes are refused\"\n ]\n },\n {\n \"file\": \"src/renderer/src/store/slices/browser/pages/browser-workspace-doc-location.test.ts\",\n \"assertions\": [\n \"a document page's url is blank in the store, in the written session and after restore\",\n \"a document navigation report leaves its URL blank, its title standing and nothing loading; its session excludes preview URLs\"\n ]\n },\n {\n \"file\": \"src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx\",\n \"assertions\": [\n \"a preview that is the reader's surface hands its guest focus, and one that is not leaves focus alone\",\n \"the window taking focus back re-offers it to the guest, and re-offers nothing for a preview that was refusing\"\n ]\n },\n {\n \"file\": \"tests/e2e/paired-browser-create-navigation-deadline.spec.ts\",\n \"assertions\": [\n \"a held navigation exceeds the former create deadline while the first RPC returns the exact authoritative host page ID\",\n \"host inventory contains exactly one new page and the user retry branch is never entered\"\n ]\n },\n {\n \"file\": \"tests/e2e/paired-browser-creation-reconciliation-failure.spec.ts\",\n \"assertions\": [\n \"the exact created page exists on the host while publication is held and no browser tab materializes on the client\",\n \"a forced post-create reconciliation timeout closes the exact host page and removes only the reserved empty split\",\n \"a forced capability rejection after caller preflight shows a toast and restores exact host and client inventories\",\n \"headed and headless hosts preserve the unrelated editor and terminal without local fallback\"\n ]\n },\n {\n \"file\": \"src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts\",\n \"assertions\": [\n \"replays a snapshot that beat the RPC response and focuses the exact adopted leaf\",\n \"retains exact-leaf focus intent when a split sibling publishes first\"\n ]\n }\n ]" + "Audit3460 historical original active selectors (verbatim JSON values; not current coverage):\ncommands: [\n \"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\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/document-preview/doc-preview-grant-registry.test.ts src/main/browser/document-preview/doc-preview-file-reader.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/main/browser/document-preview/doc-preview-failure-notice.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\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/sessions/partition-policies/browser-session-partition-policies.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/sessions/partition-policies/browser-session-partition-policies.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/store/slices/browser/pages/browser-workspace-doc-location.test.ts\",\n \"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\",\n \"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\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts\",\n \"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\",\n \"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\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/link-actions/LinkActionPopover.test.tsx\",\n \"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\",\n \"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\",\n \"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\",\n \"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\",\n \"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 --repeat-each=3\",\n \"npx playwright test --config tests/playwright.config.ts --project=electron-headless tests/e2e/paired-remote-html-preview-local-render.spec.ts --workers=1\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser/client-pages/orca-runtime-browser.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/browser/client-pages/orca-runtime-browser.test.ts src/renderer/src/hooks/useIpcEvents-close-routing-session-tabs.test.ts src/renderer/src/store/slices/browser/browser.test.ts\",\n \"SKIP_BUILD=1 pnpm exec playwright test tests/e2e/paired-browser-create-navigation-deadline.spec.ts --config tests/playwright.config.ts --project electron-headful --workers=1\",\n \"SKIP_BUILD=1 ORCA_E2E_FORCE_HEADFUL=1 ORCA_E2E_FORWARD_APP_LOGS=1 pnpm exec playwright test tests/e2e/paired-browser-creation-reconciliation-failure.spec.ts --config tests/playwright.config.ts --project electron-headful --workers=1 --reporter=line\",\n \"SKIP_BUILD=1 ORCA_E2E_FORCE_HEADFUL=1 ORCA_E2E_FORWARD_APP_LOGS=1 pnpm exec playwright test tests/e2e/paired-browser-creation-reconciliation-failure.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1 --reporter=line\"\n ]\ntestFiles: [\n \"src/main/runtime/browser/client-pages/orca-runtime-browser.test.ts\",\n \"src/renderer/src/hooks/useIpcEvents-close-routing-session-tabs.test.ts\",\n \"src/renderer/src/store/slices/browser/browser.test.ts\",\n \"src/main/browser/document-preview/doc-preview-grant-registry.test.ts\",\n \"src/main/browser/document-preview/doc-preview-file-reader.test.ts\",\n \"src/main/browser/sessions/partition-policies/browser-session-partition-policies.test.ts\",\n \"src/main/browser/document-preview/doc-preview-guest-policy.test.ts\",\n \"src/main/browser/document-preview/doc-preview-failure-notice.test.ts\",\n \"src/renderer/src/store/slices/browser/pages/browser-workspace-doc-location.test.ts\",\n \"src/main/browser/guest-lifecycle/manager/viewport/browser-manager-annotation-bridge.test.ts\",\n \"src/main/browser/backends/offscreen-browser-backend-lifecycle.test.ts\",\n \"src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts\",\n \"src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx\",\n \"src/shared/document-preview/doc-preview-scheme.test.ts\",\n \"src/renderer/src/lib/browser/documents/doc-preview-grants.test.ts\",\n \"src/renderer/src/components/browser-pane/workspace-doc/doc-preview-external-link-confirmation.test.ts\",\n \"src/renderer/src/components/link-actions/LinkActionPopover.test.tsx\",\n \"src/renderer/src/store/slices/browser/pages/browser-page-conversion.test.ts\",\n \"src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-conversion-publish.test.ts\",\n \"tests/e2e/paired-remote-html-preview-local-render.spec.ts\",\n \"tests/e2e/paired-preview-address-bar-convergence.spec.ts\",\n \"tests/e2e/paired-browser-create-navigation-deadline.spec.ts\",\n \"tests/e2e/paired-browser-creation-reconciliation-failure.spec.ts\",\n \"src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts\"\n ]\nassertionRefs: [\n {\n \"file\": \"src/renderer/src/hooks/useIpcEvents-close-routing-session-tabs.test.ts\",\n \"assertions\": [\"explicit cleanup cannot close a page owned by another worktree\"]\n },\n {\n \"file\": \"src/renderer/src/store/slices/browser/browser.test.ts\",\n \"assertions\": [\n \"a requested canonical page ID is stored on the page rather than reused as its workspace ID\",\n \"duplicate canonical page IDs are rejected before a second tab can materialize\"\n ]\n },\n {\n \"file\": \"tests/e2e/paired-remote-html-preview-local-render.spec.ts\",\n \"assertions\": [\n \"the host's HTML document renders inside the client-local orca-preview guest\",\n \"neither the client browser-workspace count nor the host browser-tab count moves off baseline\",\n \"the preview opens in its own split with mode html-preview and leaves the source editor active\",\n \"an explicit click reactivates the preview, and closing it preserves the source editor, its group, and the terminal\",\n \"the document reports having attempted both its unattended and its post-press egress, so neither absence assertion can pass on a document that never tried\",\n \"a scripted window.open and location.href driven by a real press elsewhere in the document route nothing and move no browser count\",\n \"a real target=_blank press in the rendered document routes out as an Orca browser tab while the preview stays open\"\n ]\n },\n {\n \"file\": \"src/main/browser/document-preview/doc-preview-file-reader.test.ts\",\n \"assertions\": [\n \"reads a document too large for one reply by range under the same grant\",\n \"refuses a document rewritten between ranges instead of splicing versions\",\n \"requires approval for a sibling directory before touching the runtime\"\n ]\n },\n {\n \"file\": \"src/main/browser/document-preview/doc-preview-grant-registry.test.ts\",\n \"assertions\": [\n \"keeps silent authority over a document directory strictly inside the workspace, and only there\",\n \"uses Windows semantics when authorizing a sibling directory\",\n \"keeps an approved SSH directory inside the canonical workspace boundary\"\n ]\n },\n {\n \"file\": \"src/main/browser/document-preview/doc-preview-failure-notice.test.ts\",\n \"assertions\": [\"413 and 415 map to distinct reasons and everything else stays generic\"]\n },\n {\n \"file\": \"src/main/browser/document-preview/doc-preview-guest-policy.test.ts\",\n \"assertions\": [\n \"never rebinds a bound guest onto a second grant\",\n \"leaves a re-minted preview registered when the guest it replaced tears down\"\n ]\n },\n {\n \"file\": \"src/shared/document-preview/doc-preview-scheme.test.ts\",\n \"assertions\": [\n \"malformed grant ids and unsupported schemes are refused\",\n \"undecodable percent escapes are refused\"\n ]\n },\n {\n \"file\": \"src/renderer/src/store/slices/browser/pages/browser-workspace-doc-location.test.ts\",\n \"assertions\": [\n \"a document page's url is blank in the store, in the written session and after restore\",\n \"a document navigation report leaves its URL blank, its title standing and nothing loading; its session excludes preview URLs\"\n ]\n },\n {\n \"file\": \"src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx\",\n \"assertions\": [\n \"a preview that is the reader's surface hands its guest focus, and one that is not leaves focus alone\",\n \"the window taking focus back re-offers it to the guest, and re-offers nothing for a preview that was refusing\"\n ]\n },\n {\n \"file\": \"tests/e2e/paired-browser-create-navigation-deadline.spec.ts\",\n \"assertions\": [\n \"a held navigation exceeds the former create deadline while the first RPC returns the exact authoritative host page ID\",\n \"host inventory contains exactly one new page and the user retry branch is never entered\"\n ]\n },\n {\n \"file\": \"tests/e2e/paired-browser-creation-reconciliation-failure.spec.ts\",\n \"assertions\": [\n \"the exact created page exists on the host while publication is held and no browser tab materializes on the client\",\n \"a forced post-create reconciliation timeout closes the exact host page and removes only the reserved empty split\",\n \"a forced capability rejection after caller preflight shows a toast and restores exact host and client inventories\",\n \"headed and headless hosts preserve the unrelated editor and terminal without local fallback\"\n ]\n },\n {\n \"file\": \"src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts\",\n \"assertions\": [\n \"replays a snapshot that beat the RPC response and focuses the exact adopted leaf\",\n \"retains exact-leaf focus intent when a split sibling publishes first\"\n ]\n }\n ]", + "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." ], "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." }, @@ -4826,32 +4809,31 @@ "providers": ["local", "remote-runtime", "ssh", "wsl"], "coveredPlatforms": ["macos", "linux"], "coveredProviders": [], - "coverageNotes": "Audit3381 intentionally removes the entire browser network tunnel protocol suite and active selectors/assertion. Static envelope/dispatch protocol alarms are lost without equivalent replacement. Remaining tunnel session and stream tests have narrower scopes. All three unrelated complete dated receipts are preserved verbatim with their original selectors; no fresh execution claimed. Module layout SSH policy: Retire the dynamic-forward launch argument/default inventory. The retained actual startup-cancellation entry case covers cancellation classification and termination/probe cleanup requests with supplied process/socket boundaries, not real SSH launch flags or live forwarding. Remove only the retired launch-flags assertion; unrelated dated receipts and their executed commands remain unchanged. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit1991: Remove the ordinary browser-host release/sub-cap and exact socket-close counter aliases. Retain the two actual admitted-device fairness and shared ask/browser/wait budget callbacks, which call server handlers with fake WebSockets and controlled pending RPCs. Preserve all3 unrelated dated receipts. No real browser placement or remote tunnel deployment is proved by this admission suite. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the mocked browser placement mutation and projection suites and both prospective selectors. Preserve3 unrelated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1973: Remove stale production-registration and negotiated metadata aliases, compound refusal/cleanup aliases, isolated descriptor/route/memory/cleanup microcases. Retain exact negotiated command settlement, duplicate/conflict fencing, ready/replay ordering, superseded-connection cleanup, second-host refusal, ungranted target refusal, public connector redaction, revocation race and route replacement aliases within injected-port scope. Reconciliation and all3 unrelated dated receipts remain unchanged. 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): Audit1918 narrows browser-host-command-ledger-capacity: intentionally loses injected per-page/global cache expiry-count ceilings and authority/command/result cloning inventory alarms. Retain valid commands/testFile and the oversized-wire pre-admission and delivery-failure outstanding-outcome assertions, backed by unchanged retained real-ledger callbacks with supplied browser delivery. These survivors are not equivalent replacement coverage for the deleted cache/cloning examples. Existing three exact unrelated tunnel/wire receipts retain their original scope; no fresh reduced-gate, real browser/provider, native/platform, soak or measured-budget result is added. Historical prior account (preserved verbatim): Audit1900 reduces ws-outbound-backpressure-queue by seven authored definitions while retaining ten. Current source19 assertions still describe distinct direct/queued aggregate admission, cooperative drain ordering and aggregate claim release. Existing commands, testFiles and all three source19 assertions remain valid and unchanged. The affected2026-11-04 Linux44tests/4files/5.58s receipt is retired whole as historical evidence. The other three unchanged-selector browser receipts retain their exact original scope. Reduced selectors have no fresh integrated, physical-device, mixed-host, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1709 removes low-value test definitions and retires affected assertion or execution-receipt claims without equivalent replacement coverage. Per-source reviews bound retained behavior and injected/native/remote limits. Unchanged assertions and receipts keep their original scope; gates lacking current active evidence are downgraded. Historical scope before this audit: 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: Audit1686 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: 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: Audit1563 retires mock cookie inventories, summary/flag/counter checks, historical replacement/replay narratives and setup-only alarms without equivalent replacement coverage. Retained changed cases exercise owned admission and cleanup, real staged-file lifetime, JSON/SQLite/WAL/schema compatibility, synthetic encryption and native Electron SameSite storage. Session/CDP/credential/write/renderer producers remain injected where recorded. Seven unchanged native definitions are not rerun locally; known stale registry-stub fixtures are not executable proof. Receipts selecting modified tests are retired; unaffected exact-selector receipts remain unchanged. Historical scope before this audit: Audit1559 removes mocked host/lease/reconciliation, event/flag/counter, forwarding, inventory and retry-budget alarms without equivalent replacement coverage. Retained cases establish owned promise, registry, rollback, admission and cleanup boundaries with injected Electron/renderer/host inputs; actual local sockets, file staging and Buffer collection are scoped in the PR. Receipts selecting modified tests are retired; unaffected exact-selector receipts remain historical evidence only. No live paired runtime, rendered browser/profile/TLS or device claim. Historical scope before this audit: Audit1401 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): Audit1340 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 protocol, registry, injected-socket, and loopback-listener tests cover strict framing, remote-DNS targets, exact destination-write and source-consumption credit, at most 256 streams per route with pending opens counted inside that cap, 1024 admitted opens per 10-second monotonic window, an 8 MiB per-route application-buffer ledger, shared 32 MiB browser-host and 128 MiB process ledgers across application copies, encrypted client queues, and native WebSocket bufferedAmount, bounded byte/claim/socket-source counts, a four-frame queued-drain quantum, authority epochs, exact host selection, one host per authenticated connection, four hosts per paired device, eight global browser-host polls with four per authenticated paired device, a shared ask/host ceiling that retains one quarter for waits, bounded initial and reconnect runtime_busy recovery, long-poll metering and disconnect abort, monotonic host/page/route generations without page tombstones, two-phase exact page retirement with cancellation, connection-owned cleanup, exact client revocation, stale and replaced fences, retired stream IDs, half-close and close ordering, SOCKS CONNECT, bind/close races, listener wildcard normalization, unsupported commands, unavailable routes, and raw/terminal binary-handler isolation. Page commands use a separately echoed v1 attach negotiation, exact authority/host/page generations, bounded command IDs and sequences, and bounded create/navigate payloads; legacy attaches still receive only the unchanged ready/revoked event shapes. A second optional reconciliation subprotocol gates bounded reclaim, close, and restore payloads behind exact attach/ready echo, complete inventory, command negotiation, reconnect authority, and command-result authority; the production client advertises it only with the matching command and inventory capabilities. Exact guest or app-renderer loss marks one page generation outcome-unknown, coalesces a bounded negotiated inventory reattach, closes or retires the dead generation, and allocates a fresh generation before URL restore; explicit close is not misclassified as a crash. Mixed-version mutation tests project hidden client pages before activate, close, split, reorder, and move-to-group admission, preserve hidden raw order slots, translate visible insertion indices, and project mutation snapshots. A production server orchestrator consumes each immutable inventory once, reserves target generations without exposing placement, emits only negotiated ledger commands, commits after exact completed proof, preserves unrelated and server placements, aborts an attempt when connection authority enters reconnect grace, and requires fresh inventory after failure or abort. The production client dispatcher additionally proves per-page FIFO execution, exact payload-matched duplicate replay, frozen command/result snapshots, a global retired-generation floor, transactional admission, bounded pages/active commands/queues/per-page and global result cache/concurrency, create dependency failure, cancellation, deduplicated retirement joining, and bounded close without late-result overwrite. The server ledger owns issue order and immutable command/result snapshots, bounds outstanding commands, active pages, and per-page/global replay caches, releases active-page capacity after an exact completed close while retaining bounded result replay, validates the shared wire payload before admission, requires live delivery and exact placement, authenticates results to the negotiated connection and paired lease, rejects gaps and conflicting replay, and fences outstanding outcomes at exact retirement. Negotiated command results reuse the authenticated attach socket through bounded nested JSON requests; exact ID routing, reverse-order replies, unknown and duplicate IDs, timeout teardown, serialization failure, aggregate queue accounting, acknowledgement validation, and the unchanged non-v1 path are deterministic. A stable local listener rejects CONNECT while offline or reconnecting, retains its address across replacement, requires a strictly increasing tunnel generation, ignores late superseded callbacks, propagates tunnel protocol failure to the route owner, and recycles exhausted stream IDs only after generation replacement. Reconnect uses the unchanged native v1 attach payload and capability pair; SSH descriptors alone add an execution-host capability and require a runtime-minted grant bound to the exact browser-host lease. Exact SSH provider epoch and connection generation fence ssh2 forwardOut and one non-interactive standalone system-SSH dynamic forward per route. Unit tests preserve domain-form SOCKS requests, sanitize remote errors, bound stderr, cancel startup, release timed-out and synchronously failed sockets, and release routes once. An ephemeral Docker sshd resolves a container-only domain and returns a unique HTTP marker through both ssh2 and the actual system-OpenSSH dynamic-forward adapter without touching the user's SSH files; authority loss fences the ssh2 route. The execution runtime charges route application bytes to the same per-host/process policy; its existing E2EE owner separately caps native outbound buffers process-wide. Production-registered browser-host and paired-runtime methods lease one exact host, prove attach, command delivery, and result settlement share one exact connection identity, then carry SOCKS and HTTP bytes over a dedicated E2EE socket to the fenced execution-host revision and prove route close destroys the destination socket. The production desktop adapter now composes one exact host per environment pairing revision with the page executor, current renderer selector, route Session/WebContents registries, and one reference-counted route per canonical execution-host key. Negotiated same-client control reconnect retains exact authority, placements, grants, dispatcher dedupe, executor guests, and listener addresses; it fences tunnels immediately, blocks route admission, reattaches command delivery only after ready, and replays unsettled commands without repeating completed mutations. Terminal release, replacement, legacy disconnect, and reconnect-grace expiry make only the exact host generation's client placements non-cancellable retirement-pending while retaining capacity until exact cleanup; reconnect grace preserves them. Environment replacement and app shutdown still serialize transport closure before page cleanup and force-close every remaining route. The production placement preparation starts the exact desktop adapter and advertises host/tunnel capabilities only when the paired Electron client is eligible. Node stream-internal high-water bytes, strict cross-route scheduling, and physical cross-platform evidence remain uncovered. The two Docker remote-only SSH browser routing journeys now run in the dedicated Linux ssh-browser-network-route CI job on full runs and their mapped source/test changes; 2 baseline and 6 repeated cases passed with no skips/retries on 2026-09-06. The removed retry-arithmetic and attach-request inventory suites are not current coverage; retained lease and composition suites exercise admission retry, cleanup, inventory negotiation, and reconnect behavior. Test-value audit1293 removes src/main/browser/network/tunnels/browser-network-tunnel-client-memory-budget.test.ts (4 authored cases). Their isolated assertions no longer run; surviving tests are not claimed as equivalent coverage. Fresh execution against the candidate SHA is required. Audit1302: src/main/browser/client-pages/lifecycle/browser-client-page-unavailability.test.ts: Every route/guest lifecycle/currentness/navigation/renderer/automation authority is supplied by fake callbacks, then unavailability listener is invoked manually and private inventory/mock calls are checked. No guest destruction, renderer disconnect or actual reconciliation/close consumer. Lose generation fence/reconcile-once/missing-renderer-close branch alarms; no equivalent replacement. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1318: src/shared/remote-runtime/requests/remote-runtime-subscription-request.test.ts: Retain actual local encrypted WebSocket subscription concurrency routing when host replies out of order, plus an exception thrown by a real ws consumer callback being turned into a subscription error. Server is a test-shaped handshake/response producer using production crypto, not actual runtime host/auth authority or independent cryptographic oracle. Remove happy second-request duplicate, unknown/duplicate-ID branches, fixed32 capacity, serialization/capacity/timeouts and fake memory release/admission call-count scenarios; intentionally lose those alarms. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1340: src/main/runtime/runtime-binary-message-router.test.ts removed. Connection mode conflict exceptions and one terminal/raw callback each. No equivalent replacement coverage is claimed. Audit1352: focused Linux unit selections validated on source head b638e07d395b76af3ba6b03761a1a0fe7e5e026e. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1360: focused Linux unit selections validated on source head 415c9cffc2d10024131ec4b6721767a22195de6d. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1371 removes the reconciliation protocol/capability echo inventory from browser-client-host-reconciliation.test.ts. The pending command result refusal without exact authority and later accepted acknowledgement callback remains byte-identical. The narrow negotiation echo alarm is intentionally lost; no equivalent browser/authenticated transport proof is claimed. Existing receipts with unchanged selectors retain only their original scope. Audit1401: src/main/browser/client-pages/lifecycle/browser-client-page-inventory.test.ts reduced. Loses deterministic equal-length URL compaction tie-breaking and reversed-input invariance alarm. No equivalent replacement coverage is claimed.", + "coverageNotes": "Audit4014 removes the complete browser client page command integration suite and its active command token, test selector and assertion reference. Its synthetic guest lifecycle still exercised real executor/dispatcher/Session/WebContents registry composition: navigation normalization, generation reclaim, spontaneous destruction inventory revocation, and exactly-once route/policy retirement alarms are intentionally lost. Electron guest navigation, proxy resolution and renderer lifecycle were supplied test ports; no equivalent replacement or fresh execution is claimed. The three unrelated active dated receipts and all prior historical strings remain unchanged. Historical prior account (preserved verbatim): Audit3381 intentionally removes the entire browser network tunnel protocol suite and active selectors/assertion. Static envelope/dispatch protocol alarms are lost without equivalent replacement. Remaining tunnel session and stream tests have narrower scopes. All three unrelated complete dated receipts are preserved verbatim with their original selectors; no fresh execution claimed. Module layout SSH policy: Retire the dynamic-forward launch argument/default inventory. The retained actual startup-cancellation entry case covers cancellation classification and termination/probe cleanup requests with supplied process/socket boundaries, not real SSH launch flags or live forwarding. Remove only the retired launch-flags assertion; unrelated dated receipts and their executed commands remain unchanged. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit1991: Remove the ordinary browser-host release/sub-cap and exact socket-close counter aliases. Retain the two actual admitted-device fairness and shared ask/browser/wait budget callbacks, which call server handlers with fake WebSockets and controlled pending RPCs. Preserve all3 unrelated dated receipts. No real browser placement or remote tunnel deployment is proved by this admission suite. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the mocked browser placement mutation and projection suites and both prospective selectors. Preserve3 unrelated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1973: Remove stale production-registration and negotiated metadata aliases, compound refusal/cleanup aliases, isolated descriptor/route/memory/cleanup microcases. Retain exact negotiated command settlement, duplicate/conflict fencing, ready/replay ordering, superseded-connection cleanup, second-host refusal, ungranted target refusal, public connector redaction, revocation race and route replacement aliases within injected-port scope. Reconciliation and all3 unrelated dated receipts remain unchanged. 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): Audit1918 narrows browser-host-command-ledger-capacity: intentionally loses injected per-page/global cache expiry-count ceilings and authority/command/result cloning inventory alarms. Retain valid commands/testFile and the oversized-wire pre-admission and delivery-failure outstanding-outcome assertions, backed by unchanged retained real-ledger callbacks with supplied browser delivery. These survivors are not equivalent replacement coverage for the deleted cache/cloning examples. Existing three exact unrelated tunnel/wire receipts retain their original scope; no fresh reduced-gate, real browser/provider, native/platform, soak or measured-budget result is added. Historical prior account (preserved verbatim): Audit1900 reduces ws-outbound-backpressure-queue by seven authored definitions while retaining ten. Current source19 assertions still describe distinct direct/queued aggregate admission, cooperative drain ordering and aggregate claim release. Existing commands, testFiles and all three source19 assertions remain valid and unchanged. The affected2026-11-04 Linux44tests/4files/5.58s receipt is retired whole as historical evidence. The other three unchanged-selector browser receipts retain their exact original scope. Reduced selectors have no fresh integrated, physical-device, mixed-host, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1709 removes low-value test definitions and retires affected assertion or execution-receipt claims without equivalent replacement coverage. Per-source reviews bound retained behavior and injected/native/remote limits. Unchanged assertions and receipts keep their original scope; gates lacking current active evidence are downgraded. Historical scope before this audit: 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: Audit1686 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: 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: Audit1563 retires mock cookie inventories, summary/flag/counter checks, historical replacement/replay narratives and setup-only alarms without equivalent replacement coverage. Retained changed cases exercise owned admission and cleanup, real staged-file lifetime, JSON/SQLite/WAL/schema compatibility, synthetic encryption and native Electron SameSite storage. Session/CDP/credential/write/renderer producers remain injected where recorded. Seven unchanged native definitions are not rerun locally; known stale registry-stub fixtures are not executable proof. Receipts selecting modified tests are retired; unaffected exact-selector receipts remain unchanged. Historical scope before this audit: Audit1559 removes mocked host/lease/reconciliation, event/flag/counter, forwarding, inventory and retry-budget alarms without equivalent replacement coverage. Retained cases establish owned promise, registry, rollback, admission and cleanup boundaries with injected Electron/renderer/host inputs; actual local sockets, file staging and Buffer collection are scoped in the PR. Receipts selecting modified tests are retired; unaffected exact-selector receipts remain historical evidence only. No live paired runtime, rendered browser/profile/TLS or device claim. Historical scope before this audit: Audit1401 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): Audit1340 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 protocol, registry, injected-socket, and loopback-listener tests cover strict framing, remote-DNS targets, exact destination-write and source-consumption credit, at most 256 streams per route with pending opens counted inside that cap, 1024 admitted opens per 10-second monotonic window, an 8 MiB per-route application-buffer ledger, shared 32 MiB browser-host and 128 MiB process ledgers across application copies, encrypted client queues, and native WebSocket bufferedAmount, bounded byte/claim/socket-source counts, a four-frame queued-drain quantum, authority epochs, exact host selection, one host per authenticated connection, four hosts per paired device, eight global browser-host polls with four per authenticated paired device, a shared ask/host ceiling that retains one quarter for waits, bounded initial and reconnect runtime_busy recovery, long-poll metering and disconnect abort, monotonic host/page/route generations without page tombstones, two-phase exact page retirement with cancellation, connection-owned cleanup, exact client revocation, stale and replaced fences, retired stream IDs, half-close and close ordering, SOCKS CONNECT, bind/close races, listener wildcard normalization, unsupported commands, unavailable routes, and raw/terminal binary-handler isolation. Page commands use a separately echoed v1 attach negotiation, exact authority/host/page generations, bounded command IDs and sequences, and bounded create/navigate payloads; legacy attaches still receive only the unchanged ready/revoked event shapes. A second optional reconciliation subprotocol gates bounded reclaim, close, and restore payloads behind exact attach/ready echo, complete inventory, command negotiation, reconnect authority, and command-result authority; the production client advertises it only with the matching command and inventory capabilities. Exact guest or app-renderer loss marks one page generation outcome-unknown, coalesces a bounded negotiated inventory reattach, closes or retires the dead generation, and allocates a fresh generation before URL restore; explicit close is not misclassified as a crash. Mixed-version mutation tests project hidden client pages before activate, close, split, reorder, and move-to-group admission, preserve hidden raw order slots, translate visible insertion indices, and project mutation snapshots. A production server orchestrator consumes each immutable inventory once, reserves target generations without exposing placement, emits only negotiated ledger commands, commits after exact completed proof, preserves unrelated and server placements, aborts an attempt when connection authority enters reconnect grace, and requires fresh inventory after failure or abort. The production client dispatcher additionally proves per-page FIFO execution, exact payload-matched duplicate replay, frozen command/result snapshots, a global retired-generation floor, transactional admission, bounded pages/active commands/queues/per-page and global result cache/concurrency, create dependency failure, cancellation, deduplicated retirement joining, and bounded close without late-result overwrite. The server ledger owns issue order and immutable command/result snapshots, bounds outstanding commands, active pages, and per-page/global replay caches, releases active-page capacity after an exact completed close while retaining bounded result replay, validates the shared wire payload before admission, requires live delivery and exact placement, authenticates results to the negotiated connection and paired lease, rejects gaps and conflicting replay, and fences outstanding outcomes at exact retirement. Negotiated command results reuse the authenticated attach socket through bounded nested JSON requests; exact ID routing, reverse-order replies, unknown and duplicate IDs, timeout teardown, serialization failure, aggregate queue accounting, acknowledgement validation, and the unchanged non-v1 path are deterministic. A stable local listener rejects CONNECT while offline or reconnecting, retains its address across replacement, requires a strictly increasing tunnel generation, ignores late superseded callbacks, propagates tunnel protocol failure to the route owner, and recycles exhausted stream IDs only after generation replacement. Reconnect uses the unchanged native v1 attach payload and capability pair; SSH descriptors alone add an execution-host capability and require a runtime-minted grant bound to the exact browser-host lease. Exact SSH provider epoch and connection generation fence ssh2 forwardOut and one non-interactive standalone system-SSH dynamic forward per route. Unit tests preserve domain-form SOCKS requests, sanitize remote errors, bound stderr, cancel startup, release timed-out and synchronously failed sockets, and release routes once. An ephemeral Docker sshd resolves a container-only domain and returns a unique HTTP marker through both ssh2 and the actual system-OpenSSH dynamic-forward adapter without touching the user's SSH files; authority loss fences the ssh2 route. The execution runtime charges route application bytes to the same per-host/process policy; its existing E2EE owner separately caps native outbound buffers process-wide. Production-registered browser-host and paired-runtime methods lease one exact host, prove attach, command delivery, and result settlement share one exact connection identity, then carry SOCKS and HTTP bytes over a dedicated E2EE socket to the fenced execution-host revision and prove route close destroys the destination socket. The production desktop adapter now composes one exact host per environment pairing revision with the page executor, current renderer selector, route Session/WebContents registries, and one reference-counted route per canonical execution-host key. Negotiated same-client control reconnect retains exact authority, placements, grants, dispatcher dedupe, executor guests, and listener addresses; it fences tunnels immediately, blocks route admission, reattaches command delivery only after ready, and replays unsettled commands without repeating completed mutations. Terminal release, replacement, legacy disconnect, and reconnect-grace expiry make only the exact host generation's client placements non-cancellable retirement-pending while retaining capacity until exact cleanup; reconnect grace preserves them. Environment replacement and app shutdown still serialize transport closure before page cleanup and force-close every remaining route. The production placement preparation starts the exact desktop adapter and advertises host/tunnel capabilities only when the paired Electron client is eligible. Node stream-internal high-water bytes, strict cross-route scheduling, and physical cross-platform evidence remain uncovered. The two Docker remote-only SSH browser routing journeys now run in the dedicated Linux ssh-browser-network-route CI job on full runs and their mapped source/test changes; 2 baseline and 6 repeated cases passed with no skips/retries on 2026-09-06. The removed retry-arithmetic and attach-request inventory suites are not current coverage; retained lease and composition suites exercise admission retry, cleanup, inventory negotiation, and reconnect behavior. Test-value audit1293 removes src/main/browser/network/tunnels/browser-network-tunnel-client-memory-budget.test.ts (4 authored cases). Their isolated assertions no longer run; surviving tests are not claimed as equivalent coverage. Fresh execution against the candidate SHA is required. Audit1302: src/main/browser/client-pages/lifecycle/browser-client-page-unavailability.test.ts: Every route/guest lifecycle/currentness/navigation/renderer/automation authority is supplied by fake callbacks, then unavailability listener is invoked manually and private inventory/mock calls are checked. No guest destruction, renderer disconnect or actual reconciliation/close consumer. Lose generation fence/reconcile-once/missing-renderer-close branch alarms; no equivalent replacement. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1318: src/shared/remote-runtime/requests/remote-runtime-subscription-request.test.ts: Retain actual local encrypted WebSocket subscription concurrency routing when host replies out of order, plus an exception thrown by a real ws consumer callback being turned into a subscription error. Server is a test-shaped handshake/response producer using production crypto, not actual runtime host/auth authority or independent cryptographic oracle. Remove happy second-request duplicate, unknown/duplicate-ID branches, fixed32 capacity, serialization/capacity/timeouts and fake memory release/admission call-count scenarios; intentionally lose those alarms. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1340: src/main/runtime/runtime-binary-message-router.test.ts removed. Connection mode conflict exceptions and one terminal/raw callback each. No equivalent replacement coverage is claimed. Audit1352: focused Linux unit selections validated on source head b638e07d395b76af3ba6b03761a1a0fe7e5e026e. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1360: focused Linux unit selections validated on source head 415c9cffc2d10024131ec4b6721767a22195de6d. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1371 removes the reconciliation protocol/capability echo inventory from browser-client-host-reconciliation.test.ts. The pending command result refusal without exact authority and later accepted acknowledgement callback remains byte-identical. The narrow negotiation echo alarm is intentionally lost; no equivalent browser/authenticated transport proof is claimed. Existing receipts with unchanged selectors retain only their original scope. Audit1401: src/main/browser/client-pages/lifecycle/browser-client-page-inventory.test.ts reduced. Loses deterministic equal-length URL compaction tie-breaking and reversed-input invariance alarm. No equivalent replacement coverage is claimed.", "motivatingLinks": [ "https://linear.app/stably/issue/STA-4150/refactor-remote-browser-to-client-hosted-electron-webviews" ], "invariant": "A client-hosted browser network route exists only for an exact live server-owned browser-host lease, authority epoch, host generation, paired identity, execution-host revision or SSH provider authority, and server-owned route generation. A client page is usable only when its runtime ID, authority epoch, host identity and generation, logical page ID, page-host generation, current placement, and still-live lease all match atomically; a retired, retirement-pending, or server-placed page cannot be claimed as live client placement. Live logical placements and their identities are bounded, an occupied logical page cannot change placement until exact two-phase retirement completes, cancellation restores the same authority, and the runtime-wide page generation stays monotonic without tombstones. Server-issued page commands and results remain bounded, FIFO per page, immutable after admission, authenticated to the exact paired lease, attach connection, and live placement, and replayable only when byte-equivalent. Negotiated transient result-transport loss retains exact authority and replays unsettled commands through the preserved client dedupe cache; terminal authority loss makes outstanding outcomes unknown and makes only the exact host generation's placements non-cancellable retirement-pending until exact cleanup or reconciliation proof. Desktop composition installs exact command authority before delivery, keeps result settlements below nested-request capacity, suspends every tunnel without closing guests on negotiated loss, gates handlers through route recovery, and synchronously suspends routes and revokes exact retained navigation grants before asynchronous transport or handler cleanup on terminal loss. Navigation-revocation failure remains observable without preventing guest destruction and route cleanup. One environment pairing revision owns at most one composed desktop host and one reference-counted route per canonical execution-host key; pairing replacement and shutdown close control transport before pages and force-close routes even when guest cleanup remains ambiguous. Non-native descriptors require explicit capability negotiation and an exact runtime-minted lease-bound execution-host grant. Host selection never chooses arbitrarily, stale cleanup or settlement cannot remove a replacement, destination names remain unresolved until the execution host, credit returns only after writes settle, and route loss never falls back to desktop DNS or sockets. A main-owned local listener remains stable across upstream transport loss, rejects CONNECT while offline, accepts only a strictly newer tunnel generation, ignores superseded callbacks, and never reuses a stream ID within one generation. Pending opens, admitted open rate, nested control requests, per-route application bytes, aggregate browser-host/process bytes, claims, and socket sources remain bounded with exact release on settlement and retirement. Queued transport drain yields after a bounded quantum. The local SOCKS endpoint accepts only loopback CONNECT and rejects unsupported commands.", - "oracle": "Test-value audit removes the retired suite and its active selectors/assertions. Retire the paired-host late subscription smoke: it checks a mocked close count and startup rejection, without remote unsubscribe or successor outcomes. Audit3381 intentionally removes the entire browser network tunnel protocol suite and active selectors/assertion. Static envelope/dispatch protocol alarms are lost without equivalent replacement. Remaining tunnel session and stream tests have narrower scopes. All three unrelated complete dated receipts are preserved verbatim with their original selectors; no fresh execution claimed. Module layout SSH policy: Retire the dynamic-forward launch argument/default inventory. The retained actual startup-cancellation entry case covers cancellation classification and termination/probe cleanup requests with supplied process/socket boundaries, not real SSH launch flags or live forwarding. Remove only the retired launch-flags assertion; unrelated dated receipts and their executed commands remain unchanged. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit1991: Remove the ordinary browser-host release/sub-cap and exact socket-close counter aliases. Retain the two actual admitted-device fairness and shared ask/browser/wait budget callbacks, which call server handlers with fake WebSockets and controlled pending RPCs. Preserve all3 unrelated dated receipts. No real browser placement or remote tunnel deployment is proved by this admission suite. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the mocked browser placement mutation and projection suites and both prospective selectors. Preserve3 unrelated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1973: Remove stale production-registration and negotiated metadata aliases, compound refusal/cleanup aliases, isolated descriptor/route/memory/cleanup microcases. Retain exact negotiated command settlement, duplicate/conflict fencing, ready/replay ordering, superseded-connection cleanup, second-host refusal, ungranted target refusal, public connector redaction, revocation race and route replacement aliases within injected-port scope. Reconciliation and all3 unrelated dated receipts remain unchanged. 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): Audit1918 narrows browser-host-command-ledger-capacity: intentionally loses injected per-page/global cache expiry-count ceilings and authority/command/result cloning inventory alarms. Retain valid commands/testFile and the oversized-wire pre-admission and delivery-failure outstanding-outcome assertions, backed by unchanged retained real-ledger callbacks with supplied browser delivery. These survivors are not equivalent replacement coverage for the deleted cache/cloning examples. Existing three exact unrelated tunnel/wire receipts retain their original scope; no fresh reduced-gate, real browser/provider, native/platform, soak or measured-budget result is added. Historical prior account (preserved verbatim): Audit1900 reduces ws-outbound-backpressure-queue by seven authored definitions while retaining ten. Current source19 assertions still describe distinct direct/queued aggregate admission, cooperative drain ordering and aggregate claim release. Existing commands, testFiles and all three source19 assertions remain valid and unchanged. The affected2026-11-04 Linux44tests/4files/5.58s receipt is retired whole as historical evidence. The other three unchanged-selector browser receipts retain their exact original scope. Reduced selectors have no fresh integrated, physical-device, mixed-host, soak or measured-budget result. 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: Audit1686 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: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Attach two browser hosts and require unqualified selection to fail ambiguous while exact selection succeeds. Reject a second identity on one connection and a fifth identity for one paired device, release one exact lease, then admit its replacement without starving another device. Admit four hosts from one authenticated device and a host from a second, reject the first device's fifth host, and release only the first device's exact counters while the second remains live. Fill asks and hosts to their shared ceiling, retain a quarter of the total budget for ordinary waits, close both sockets, and prove every global, class, and device counter releases. Reject one initial host attach with the unchanged runtime_busy response, then require bounded client-specific jitter to attach when capacity returns; repeated rejection and explicit close must release every timer and subscription. Replace one same-device connection, require the old subscription and route to fence, then prove late old cleanup leaves the new generation live. Mint an exact execution-host grant, reject a different key, prove late old grant cleanup leaves its replacement, and invalidate every grant with lease replacement. Reject client-to-client, client-to-server, server-to-server, and server-to-client placement overwrite until exact retirement. Begin retirement once idempotently, reject client use and every replacement while pending, cancel the exact token to restore the same placement, and reject delayed cancellation or completion after a newer retirement begins. On explicit release, replacement, legacy disconnect, and reconnect-grace expiry, require only the exact host generation's client placements to become non-cancellable retirement-pending before lease settlement; preserve negotiated grace, other hosts, server placements, replacements, and capacity until exact completion. Complete only the exact pending token, retain capacity until completion, and require a reused client page ID to receive a higher global generation without retaining a tombstone. Require a client page through the exact runtime, epoch, host, and page tuple; reject every mismatch, released or replaced leases, retirement-pending pages, retired pages, server placements, invalid identities, and the 257th live placement. Admit 1024 opens in one monotonic 10-second window and reject the 1025th until the window expires. Fill 8 MiB across destination-to-client queues and separately across unsettled client-to-destination writes, release one exact retired stream, admit one replacement, and require the next byte claim to close the route without stale-callback or reentrant-close underflow. Across multiple routes, charge application copies, encrypted queue entries, and dynamic native socket bytes to one 32 MiB browser-host and 128 MiB process ceiling; reject zero-byte claim/socket-source floods, fence released leases, synchronously release JavaScript queue claims while retaining native claims through exact socket close, and yield a parked queue after four frames without reordering. Route nested responses by exact ID under reordering, reject unknown and duplicate IDs, cap pending requests and queued bytes, and tear down every concurrent waiter once on timeout or close. Drive one real paired attach, command, and result through one exact connection ID; reject missing send support and malformed or wrong-runtime acknowledgements while preserving old non-v1 attaches. Drop an authenticated transport, require the same listener to reject CONNECT before and during reconnect, attach the exact existing native v1 payload and capability pair to a strictly newer generation, ignore late old callbacks, and roll an exhausted stream-ID ledger only by replacing the generation. Require SSH descriptors to add an execution-host capability and exact grant, reject missing grants and stale provider authority before resolver or binary registration, pass exact domains to ssh2 and system-SSH SOCKS without local resolution, sanitize connector diagnostics, and close every stream and standalone route process once on timeout, synchronous failure, or rotation. Drive the accepted lease through real paired E2EE native SOCKS-to-HTTP and ephemeral Docker ssh2 remote-only DNS journeys, then exercise exact frame, credit, half-close, stale-stream, remote-DNS, unsupported-command, offline, and teardown assertions.", + "oracle": "Audit4014 removes the complete browser client page command integration suite and its active command token, test selector and assertion reference. Its synthetic guest lifecycle still exercised real executor/dispatcher/Session/WebContents registry composition: navigation normalization, generation reclaim, spontaneous destruction inventory revocation, and exactly-once route/policy retirement alarms are intentionally lost. Electron guest navigation, proxy resolution and renderer lifecycle were supplied test ports; no equivalent replacement or fresh execution is claimed. The three unrelated active dated receipts and all prior historical strings remain unchanged. Historical prior account (preserved verbatim): Test-value audit3842 retires four ws-outbound queue unit probes: direct empty-queue send failure, configured drain quantum/zero-delay reschedule, injected aggregate claim/release accounting, and supplied unwritable drain guard. Their exact alarms are intentionally lost; retained queue behaviors are not equivalent replacements. All source-file commands remain valid. No fresh execution or measured-budget evidence is claimed. Historical prior account (preserved verbatim): Test-value audit removes the retired suite and its active selectors/assertions. Retire the paired-host late subscription smoke: it checks a mocked close count and startup rejection, without remote unsubscribe or successor outcomes. Audit3381 intentionally removes the entire browser network tunnel protocol suite and active selectors/assertion. Static envelope/dispatch protocol alarms are lost without equivalent replacement. Remaining tunnel session and stream tests have narrower scopes. All three unrelated complete dated receipts are preserved verbatim with their original selectors; no fresh execution claimed. Module layout SSH policy: Retire the dynamic-forward launch argument/default inventory. The retained actual startup-cancellation entry case covers cancellation classification and termination/probe cleanup requests with supplied process/socket boundaries, not real SSH launch flags or live forwarding. Remove only the retired launch-flags assertion; unrelated dated receipts and their executed commands remain unchanged. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit1991: Remove the ordinary browser-host release/sub-cap and exact socket-close counter aliases. Retain the two actual admitted-device fairness and shared ask/browser/wait budget callbacks, which call server handlers with fake WebSockets and controlled pending RPCs. Preserve all3 unrelated dated receipts. No real browser placement or remote tunnel deployment is proved by this admission suite. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the mocked browser placement mutation and projection suites and both prospective selectors. Preserve3 unrelated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1973: Remove stale production-registration and negotiated metadata aliases, compound refusal/cleanup aliases, isolated descriptor/route/memory/cleanup microcases. Retain exact negotiated command settlement, duplicate/conflict fencing, ready/replay ordering, superseded-connection cleanup, second-host refusal, ungranted target refusal, public connector redaction, revocation race and route replacement aliases within injected-port scope. Reconciliation and all3 unrelated dated receipts remain unchanged. 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): Audit1918 narrows browser-host-command-ledger-capacity: intentionally loses injected per-page/global cache expiry-count ceilings and authority/command/result cloning inventory alarms. Retain valid commands/testFile and the oversized-wire pre-admission and delivery-failure outstanding-outcome assertions, backed by unchanged retained real-ledger callbacks with supplied browser delivery. These survivors are not equivalent replacement coverage for the deleted cache/cloning examples. Existing three exact unrelated tunnel/wire receipts retain their original scope; no fresh reduced-gate, real browser/provider, native/platform, soak or measured-budget result is added. Historical prior account (preserved verbatim): Audit1900 reduces ws-outbound-backpressure-queue by seven authored definitions while retaining ten. Current source19 assertions still describe distinct direct/queued aggregate admission, cooperative drain ordering and aggregate claim release. Existing commands, testFiles and all three source19 assertions remain valid and unchanged. The affected2026-11-04 Linux44tests/4files/5.58s receipt is retired whole as historical evidence. The other three unchanged-selector browser receipts retain their exact original scope. Reduced selectors have no fresh integrated, physical-device, mixed-host, soak or measured-budget result. 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: Audit1686 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: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Attach two browser hosts and require unqualified selection to fail ambiguous while exact selection succeeds. Reject a second identity on one connection and a fifth identity for one paired device, release one exact lease, then admit its replacement without starving another device. Admit four hosts from one authenticated device and a host from a second, reject the first device's fifth host, and release only the first device's exact counters while the second remains live. Fill asks and hosts to their shared ceiling, retain a quarter of the total budget for ordinary waits, close both sockets, and prove every global, class, and device counter releases. Reject one initial host attach with the unchanged runtime_busy response, then require bounded client-specific jitter to attach when capacity returns; repeated rejection and explicit close must release every timer and subscription. Replace one same-device connection, require the old subscription and route to fence, then prove late old cleanup leaves the new generation live. Mint an exact execution-host grant, reject a different key, prove late old grant cleanup leaves its replacement, and invalidate every grant with lease replacement. Reject client-to-client, client-to-server, server-to-server, and server-to-client placement overwrite until exact retirement. Begin retirement once idempotently, reject client use and every replacement while pending, cancel the exact token to restore the same placement, and reject delayed cancellation or completion after a newer retirement begins. On explicit release, replacement, legacy disconnect, and reconnect-grace expiry, require only the exact host generation's client placements to become non-cancellable retirement-pending before lease settlement; preserve negotiated grace, other hosts, server placements, replacements, and capacity until exact completion. Complete only the exact pending token, retain capacity until completion, and require a reused client page ID to receive a higher global generation without retaining a tombstone. Require a client page through the exact runtime, epoch, host, and page tuple; reject every mismatch, released or replaced leases, retirement-pending pages, retired pages, server placements, invalid identities, and the 257th live placement. Admit 1024 opens in one monotonic 10-second window and reject the 1025th until the window expires. Fill 8 MiB across destination-to-client queues and separately across unsettled client-to-destination writes, release one exact retired stream, admit one replacement, and require the next byte claim to close the route without stale-callback or reentrant-close underflow. Across multiple routes, charge application copies, encrypted queue entries, and dynamic native socket bytes to one 32 MiB browser-host and 128 MiB process ceiling; reject zero-byte claim/socket-source floods, fence released leases, synchronously release JavaScript queue claims while retaining native claims through exact socket close, and yield a parked queue after four frames without reordering. Route nested responses by exact ID under reordering, reject unknown and duplicate IDs, cap pending requests and queued bytes, and tear down every concurrent waiter once on timeout or close. Drive one real paired attach, command, and result through one exact connection ID; reject missing send support and malformed or wrong-runtime acknowledgements while preserving old non-v1 attaches. Drop an authenticated transport, require the same listener to reject CONNECT before and during reconnect, attach the exact existing native v1 payload and capability pair to a strictly newer generation, ignore late old callbacks, and roll an exhausted stream-ID ledger only by replacing the generation. Require SSH descriptors to add an execution-host capability and exact grant, reject missing grants and stale provider authority before resolver or binary registration, pass exact domains to ssh2 and system-SSH SOCKS without local resolution, sanitize connector diagnostics, and close every stream and standalone route process once on timeout, synchronous failure, or rotation. Drive the accepted lease through real paired E2EE native SOCKS-to-HTTP and ephemeral Docker ssh2 remote-only DNS journeys, then exercise exact frame, credit, half-close, stale-stream, remote-DNS, unsupported-command, offline, and teardown assertions.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/routing/guest-authority/browser-route-webcontents-registry.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-reconnect.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-composition.test.ts src/main/runtime/browser/client-pages/runtime-browser-client-page-recovery.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser-host/reconciliation/browser-host-page-retirement.test.ts src/main/runtime/browser-host/reconciliation/browser-host-page-placement-replacement.test.ts src/main/runtime/browser-host/reconciliation/browser-host-page-placement.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser-host/commands/browser-host-command-ledger.test.ts src/main/runtime/browser-host/reconciliation/browser-host-page-placement.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/browser/browser-client-host-reconciliation.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/client-pages/execution/browser-client-page-command-executor.test.ts src/main/browser/client-pages/execution/browser-client-page-command-integration.test.ts src/main/browser/client-pages/lifecycle/browser-client-page-inventory.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-composition.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/runtime/rpc/methods/browser/browser-client-host.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/client-pages/execution/browser-client-page-command-executor.test.ts src/main/browser/client-pages/lifecycle/browser-client-page-inventory.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-composition.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/runtime/rpc/methods/browser/browser-client-host.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/client-pages/lifecycle/browser-client-page-reconciliation-adapters.test.ts src/main/browser/routing/sessions/browser-route-prepared-page-rekey.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/network/tunnels/browser-network-tunnel-session.test.ts src/main/browser/network/tunnels/remote-browser-socks-server.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/network/tunnels/browser-network-tunnel-client.test.ts src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts src/main/runtime/rpc/methods/browser/browser-network-tunnel.test.ts src/main/runtime/browser/network/browser-network-tunnel-paired-runtime.integration.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/network/tunnels/browser-network-tunnel-outbound-memory-budget.test.ts src/main/browser/network/tunnels/browser-network-tunnel-session-aggregate-memory.test.ts src/shared/ws-outbound-backpressure-queue.test.ts src/shared/remote-runtime/remote-runtime-client.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/shared/ws-outbound-backpressure-queue.test.ts src/shared/remote-runtime/remote-runtime-client.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/runtime/rpc/server/runtime-rpc-browser-host-admission.test.ts src/main/runtime/rpc/methods/browser/browser-client-host.test.ts src/main/runtime/rpc/methods/browser/browser-network-tunnel.test.ts src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts src/main/runtime/browser/network/browser-network-tunnel-paired-runtime.integration.test.ts src/main/browser/network/tunnels/browser-network-tunnel-client.test.ts src/main/browser/network/tunnels/browser-network-tunnel-session.test.ts src/main/browser/network/tunnels/browser-network-tunnel-session-aggregate-memory.test.ts src/main/browser/network/tunnels/browser-network-tunnel-outbound-memory-budget.test.ts src/main/browser/network/tunnels/remote-browser-socks-server.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/runtime/rpc/server/runtime-rpc-browser-host-admission.test.ts src/main/runtime/rpc/methods/browser/browser-client-host.test.ts src/main/runtime/rpc/methods/browser/browser-network-tunnel.test.ts src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts src/main/runtime/browser/network/browser-network-tunnel-paired-runtime.integration.test.ts src/main/browser/network/tunnels/browser-network-tunnel-client.test.ts src/main/browser/network/tunnels/browser-network-tunnel-session.test.ts src/main/browser/network/tunnels/remote-browser-socks-server.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/shared/ws-outbound-backpressure-queue.test.ts src/shared/remote-runtime/remote-runtime-client.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/runtime/rpc/methods/browser/browser-client-host.test.ts src/main/runtime/rpc/methods/browser/browser-network-tunnel.test.ts src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts src/main/runtime/browser/network/browser-network-tunnel-paired-runtime.integration.test.ts src/main/browser/network/tunnels/browser-network-tunnel-client.test.ts src/main/browser/network/tunnels/browser-network-tunnel-session.test.ts src/main/browser/network/tunnels/browser-network-tunnel-session-aggregate-memory.test.ts src/main/browser/network/tunnels/browser-network-tunnel-outbound-memory-budget.test.ts src/main/browser/network/tunnels/remote-browser-socks-server.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/runtime/rpc/methods/browser/browser-client-host.test.ts src/main/runtime/rpc/methods/browser/browser-network-tunnel.test.ts src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts src/main/runtime/browser/network/browser-network-tunnel-paired-runtime.integration.test.ts src/main/browser/network/tunnels/browser-network-tunnel-client.test.ts src/main/browser/network/tunnels/browser-network-tunnel-session.test.ts src/main/browser/network/tunnels/remote-browser-socks-server.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/shared/remote-runtime/remote-runtime-client.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/shared/remote-runtime/requests/remote-runtime-subscription-request.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/client-hosts/commands/browser-client-host-command-dispatcher.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/client-hosts/commands/browser-client-host-command-dispatcher.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-reconnect.test.ts src/main/browser/client-hosts/commands/browser-client-host-command-dispatcher.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/server/runtime-rpc-browser-host-admission.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/network/client-routes/browser-client-network-route-registry.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-composition.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-reconnect.test.ts src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts src/main/runtime/browser-host/commands/browser-host-command-ledger.test.ts src/main/runtime/browser-host/commands/browser-host-command-ledger-capacity.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/runtime/rpc/methods/browser/browser-client-host.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/network/client-routes/browser-client-network-route-registry.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-composition.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-reconnect.test.ts src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts src/main/runtime/browser-host/commands/browser-host-command-ledger.test.ts src/main/runtime/browser-host/commands/browser-host-command-ledger-capacity.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/runtime/rpc/server/runtime-rpc-browser-host-admission.test.ts src/main/runtime/rpc/methods/browser/browser-client-host.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/network/client-routes/browser-client-network-route-registry.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-composition.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-reconnect.test.ts src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts src/main/runtime/browser-host/commands/browser-host-command-ledger.test.ts src/main/runtime/browser-host/commands/browser-host-command-ledger-capacity.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/runtime/rpc/methods/browser/browser-client-host.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/network/client-routes/browser-client-network-route-registry.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-composition.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-registry.test.ts src/main/browser/client-pages/execution/browser-client-page-command-executor.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser-host/commands/browser-host-command-ledger.test.ts src/main/runtime/browser-host/commands/browser-host-command-ledger-capacity.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/runtime/rpc/methods/browser/browser-client-host.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/browser/network/execution-routes/browser-network-deferred-socket.test.ts src/main/browser/network/execution-routes/browser-network-execution-route.test.ts src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts src/main/runtime/rpc/methods/browser/browser-network-tunnel.test.ts src/main/browser/network/execution-routes/ssh-browser-network-execution-route.test.ts src/main/browser/network/tunnels/system-ssh-socks-client-socket.test.ts src/main/ssh/system-transport/forwarding/system-ssh-dynamic-forward-process.test.ts src/main/ssh/system-transport/forwarding/system-ssh-forward-process.test.ts src/main/ssh/system-transport/system-ssh-operations.test.ts src/main/ssh/port-forwarding/ssh-port-forward.test.ts", @@ -4867,7 +4849,6 @@ "src/main/runtime/browser-host/commands/browser-host-command-ledger.test.ts", "src/main/runtime/browser-host/commands/browser-host-command-ledger-capacity.test.ts", "src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts", - "src/main/runtime/rpc/server/runtime-rpc-browser-host-admission.test.ts", "src/main/runtime/rpc/methods/browser/browser-client-host.test.ts", "src/main/runtime/rpc/methods/browser/browser-client-host-reconciliation.test.ts", "src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-reconnect.test.ts", @@ -4875,7 +4856,6 @@ "src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-composition.test.ts", "src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-registry.test.ts", "src/main/browser/client-pages/execution/browser-client-page-command-executor.test.ts", - "src/main/browser/client-pages/execution/browser-client-page-command-integration.test.ts", "src/main/browser/client-pages/lifecycle/browser-client-page-reconciliation-adapters.test.ts", "src/main/browser/client-pages/lifecycle/browser-client-page-inventory.test.ts", "src/main/browser/routing/sessions/browser-route-prepared-page-rekey.test.ts", @@ -4900,13 +4880,6 @@ "tests/e2e/ssh-browser-network-execution-route.docker.unit.test.ts" ], "assertionRefs": [ - { - "file": "src/main/runtime/rpc/server/runtime-rpc-browser-host-admission.test.ts", - "assertions": [ - "one paired device cannot consume the second device's reserved browser-host share", - "asks and browser hosts share a ceiling that retains one quarter of total capacity for waits" - ] - }, { "file": "src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-reconnect.test.ts", "assertions": [ @@ -4938,12 +4911,6 @@ "stale, occupied, cross-page, and cross-renderer targets fail without mutation" ] }, - { - "file": "src/main/browser/client-pages/execution/browser-client-page-command-integration.test.ts", - "assertions": [ - "spontaneous exact guest destruction revokes active inventory before explicit page retirement" - ] - }, { "file": "src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-registry.test.ts", "assertions": ["keeps a failed authority transition tombstoned until cleanup settles"] @@ -5126,9 +5093,7 @@ { "file": "src/shared/ws-outbound-backpressure-queue.test.ts", "assertions": [ - "direct and already-retained queued frames use distinct aggregate admission semantics", - "queued drain yields after its configured frame quantum without reordering", - "aggregate queue claims release on drain, denial, disposal, and close" + "direct and already-retained queued frames use distinct aggregate admission semantics" ] } ], @@ -5187,6 +5152,7 @@ "Prove an Electron partition routes loopback, DNS, HTTP, HTTPS, WebSocket, workers, and speculative traffic without desktop fallback." ], "knownGaps": [ + "Audit4014 removes the complete browser client page command integration suite and its active command token, test selector and assertion reference. Its synthetic guest lifecycle still exercised real executor/dispatcher/Session/WebContents registry composition: navigation normalization, generation reclaim, spontaneous destruction inventory revocation, and exactly-once route/policy retirement alarms are intentionally lost. Electron guest navigation, proxy resolution and renderer lifecycle were supplied test ports; no equivalent replacement or fresh execution is claimed. The three unrelated active dated receipts and all prior historical strings remain unchanged. Historical prior account (preserved verbatim):", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/main/ssh/system-transport/system-ssh-forward-process.test.ts: spawns exactly the argv the orphan matcher is given, LogLevel=INFO included; runs port forwards unmultiplexed even when ssh_config disables muxing; preserves manual target port and identity options in the forwarded ssh command; does not spawn ssh when the requested local forward port is already in use; spawns ssh after the requested local forward port preflight succeeds; resolves startup after the grace period when ssh keeps running; sends SIGTERM then SIGKILL when the process does not exit; does not resolve stop until the process exits. src/main/ssh/port-forwarding/ssh-port-forward.test.ts: reports the port the OS bound when an ssh2 forward asks for port 0; adds an ssh2 port forward and returns entry; adds a system SSH port forward when no ssh2 client is available; reports the port a system SSH forward resolved when asked for port 0; passes resolved OpenSSH config to system SSH port forwards; disposes a system SSH tunnel when removing the forward; lists forwards filtered by connectionId; removes a forward by id; awaits forward close when removing a forward for user actions; returns null when removing nonexistent forward; removes all forwards for a connection; dispose removes all forwards; stores label in the entry; preserves the existing id when updating a forward succeeds. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/ssh/port-forwarding/ssh-port-forward.test.ts, src/main/ssh/system-transport/system-ssh-forward-process.test.ts. Unresolved local/computed edges remain explicit debt. Retired active assertionRefs (raw original objects retained as historical only): {\n \"file\": \"src/main/ssh/port-forwarding/ssh-port-forward.test.ts\",\n \"assertions\": [\n \"static system-SSH forwards receive the connection's complete resolved build options\"\n ]\n }", "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.", "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.", @@ -5242,7 +5208,8 @@ "Module layout SSH policy: Retire the dynamic-forward launch argument/default inventory. The retained actual startup-cancellation entry case covers cancellation classification and termination/probe cleanup requests with supplied process/socket boundaries, not real SSH launch flags or live forwarding. Remove only the retired launch-flags assertion; unrelated dated receipts and their executed commands remain unchanged.", "Historical dynamic-forward assertion metadata before inventory retirement, preserved verbatim:\n{\n \"file\": \"src/main/ssh/system-transport/forwarding/system-ssh-dynamic-forward-process.test.ts\",\n \"assertions\": [\n \"system SSH uses BatchMode=yes, disables ControlMaster, and positions one dynamic forward before the destination\",\n \"authority invalidation cancels an in-progress SSH launch and destroys its active readiness probe immediately\"\n ]\n }", "Audit3381 intentionally removes the entire browser network tunnel protocol suite and active selectors/assertion. Static envelope/dispatch protocol alarms are lost without equivalent replacement. Remaining tunnel session and stream tests have narrower scopes. All three unrelated complete dated receipts are preserved verbatim with their original selectors; no fresh execution claimed.\nOriginal active selector fields, historical raw native JSON values:\ncommands: [\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/routing/guest-authority/browser-route-webcontents-registry.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-reconnect.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-composition.test.ts src/main/runtime/browser/client-pages/runtime-browser-client-page-recovery.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser-host/reconciliation/browser-host-page-retirement.test.ts src/main/runtime/browser-host/reconciliation/browser-host-page-placement-replacement.test.ts src/main/runtime/browser-host/reconciliation/browser-host-page-placement.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser-host/commands/browser-host-command-ledger.test.ts src/main/runtime/browser-host/reconciliation/browser-host-page-placement.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/browser/browser-client-host-reconciliation.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/client-pages/execution/browser-client-page-command-executor.test.ts src/main/browser/client-pages/execution/browser-client-page-command-integration.test.ts src/main/browser/client-pages/lifecycle/browser-client-page-inventory.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-composition.test.ts src/main/browser/client-hosts/leases/paired-runtime-browser-host-lease.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/runtime/rpc/methods/browser/browser-client-host.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/client-pages/lifecycle/browser-client-page-reconciliation-adapters.test.ts src/main/browser/routing/sessions/browser-route-prepared-page-rekey.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/shared/browser/network/tunnels/browser-network-tunnel-protocol.test.ts src/main/browser/network/tunnels/browser-network-tunnel-session.test.ts src/main/browser/network/tunnels/remote-browser-socks-server.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/network/tunnels/browser-network-tunnel-client.test.ts src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts src/main/runtime/rpc/methods/browser/browser-network-tunnel.test.ts src/main/runtime/browser/network/browser-network-tunnel-paired-runtime.integration.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/network/tunnels/browser-network-tunnel-outbound-memory-budget.test.ts src/main/browser/network/tunnels/browser-network-tunnel-session-aggregate-memory.test.ts src/shared/ws-outbound-backpressure-queue.test.ts src/shared/remote-runtime/remote-runtime-client.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/shared/ws-outbound-backpressure-queue.test.ts src/shared/remote-runtime/remote-runtime-client.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/runtime/rpc/server/runtime-rpc-browser-host-admission.test.ts src/main/runtime/rpc/methods/browser/browser-client-host.test.ts src/main/runtime/rpc/methods/browser/browser-network-tunnel.test.ts src/main/browser/client-hosts/leases/paired-runtime-browser-host-lease.test.ts src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts src/main/runtime/browser/network/browser-network-tunnel-paired-runtime.integration.test.ts src/main/browser/network/tunnels/browser-network-tunnel-client.test.ts src/main/browser/network/tunnels/browser-network-tunnel-session.test.ts src/main/browser/network/tunnels/browser-network-tunnel-session-aggregate-memory.test.ts src/main/browser/network/tunnels/browser-network-tunnel-outbound-memory-budget.test.ts src/main/browser/network/tunnels/remote-browser-socks-server.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/runtime/rpc/server/runtime-rpc-browser-host-admission.test.ts src/main/runtime/rpc/methods/browser/browser-client-host.test.ts src/main/runtime/rpc/methods/browser/browser-network-tunnel.test.ts src/main/browser/client-hosts/leases/paired-runtime-browser-host-lease.test.ts src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts src/main/runtime/browser/network/browser-network-tunnel-paired-runtime.integration.test.ts src/main/browser/network/tunnels/browser-network-tunnel-client.test.ts src/main/browser/network/tunnels/browser-network-tunnel-session.test.ts src/main/browser/network/tunnels/remote-browser-socks-server.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/shared/remote-runtime/remote-runtime-client.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/shared/remote-runtime/requests/remote-runtime-subscription-request.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/client-hosts/commands/browser-client-host-command-dispatcher.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/client-hosts/leases/paired-runtime-browser-host-lease.test.ts src/main/browser/client-hosts/commands/browser-client-host-command-dispatcher.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-reconnect.test.ts src/main/browser/client-hosts/leases/paired-runtime-browser-host-lease.test.ts src/main/browser/client-hosts/commands/browser-client-host-command-dispatcher.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/server/runtime-rpc-browser-host-admission.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/network/client-routes/browser-client-network-route-registry.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-composition.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-reconnect.test.ts src/main/browser/client-hosts/leases/paired-runtime-browser-host-lease.test.ts src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts src/main/runtime/browser-host/commands/browser-host-command-ledger.test.ts src/main/runtime/browser-host/commands/browser-host-command-ledger-capacity.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/runtime/rpc/methods/browser/browser-client-host.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/network/client-routes/browser-client-network-route-registry.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-composition.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-reconnect.test.ts src/main/browser/client-hosts/leases/paired-runtime-browser-host-lease.test.ts src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts src/main/runtime/browser-host/commands/browser-host-command-ledger.test.ts src/main/runtime/browser-host/commands/browser-host-command-ledger-capacity.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/runtime/rpc/server/runtime-rpc-browser-host-admission.test.ts src/main/runtime/rpc/methods/browser/browser-client-host.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/network/client-routes/browser-client-network-route-registry.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-composition.test.ts src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-registry.test.ts src/main/browser/client-pages/execution/browser-client-page-command-executor.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser-host/commands/browser-host-command-ledger.test.ts src/main/runtime/browser-host/commands/browser-host-command-ledger-capacity.test.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/runtime/rpc/methods/browser/browser-client-host.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts src/main/browser/network/execution-routes/browser-network-deferred-socket.test.ts src/main/browser/network/execution-routes/browser-network-execution-route.test.ts src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts src/main/runtime/rpc/methods/browser/browser-network-tunnel.test.ts src/main/browser/network/execution-routes/ssh-browser-network-execution-route.test.ts src/main/browser/network/tunnels/system-ssh-socks-client-socket.test.ts src/main/ssh/system-transport/forwarding/system-ssh-dynamic-forward-process.test.ts src/main/ssh/system-transport/forwarding/system-ssh-forward-process.test.ts src/main/ssh/system-transport/system-ssh-operations.test.ts src/main/ssh/port-forwarding/ssh-port-forward.test.ts\",\n \"ORCA_RUN_DOCKER_SSH_BROWSER_E2E=1 pnpm exec vitest run --config config/vitest.config.ts tests/e2e/ssh-browser-network-execution-route.docker.unit.test.ts\",\n \"ORCA_RUN_DOCKER_SSH_BROWSER_E2E=1 node_modules/.bin/vitest run --config config/vitest.config.ts tests/e2e/ssh-browser-network-execution-route.docker.unit.test.ts\"\n ]\ntestFiles: [\n \"src/main/browser/routing/guest-authority/browser-route-webcontents-registry.test.ts\",\n \"src/main/runtime/browser/client-pages/runtime-browser-client-page-recovery.test.ts\",\n \"src/shared/browser/network/tunnels/browser-network-tunnel-protocol.test.ts\",\n \"src/main/runtime/browser-host/reconciliation/browser-host-page-retirement.test.ts\",\n \"src/main/runtime/browser-host/reconciliation/browser-host-page-placement-replacement.test.ts\",\n \"src/main/runtime/browser-host/reconciliation/browser-host-page-placement.test.ts\",\n \"src/main/runtime/browser-host/commands/browser-host-command-ledger.test.ts\",\n \"src/main/runtime/browser-host/commands/browser-host-command-ledger-capacity.test.ts\",\n \"src/main/runtime/browser-host/leases/browser-host-lease-registry.test.ts\",\n \"src/main/runtime/rpc/server/runtime-rpc-browser-host-admission.test.ts\",\n \"src/main/runtime/rpc/methods/browser/browser-client-host.test.ts\",\n \"src/main/runtime/rpc/methods/browser/browser-client-host-reconciliation.test.ts\",\n \"src/main/browser/client-hosts/leases/paired-runtime-browser-host-lease.test.ts\",\n \"src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-reconnect.test.ts\",\n \"src/main/browser/network/client-routes/browser-client-network-route-registry.test.ts\",\n \"src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-composition.test.ts\",\n \"src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-registry.test.ts\",\n \"src/main/browser/client-pages/execution/browser-client-page-command-executor.test.ts\",\n \"src/main/browser/client-pages/execution/browser-client-page-command-integration.test.ts\",\n \"src/main/browser/client-pages/lifecycle/browser-client-page-reconciliation-adapters.test.ts\",\n \"src/main/browser/client-pages/lifecycle/browser-client-page-inventory.test.ts\",\n \"src/main/browser/routing/sessions/browser-route-prepared-page-rekey.test.ts\",\n \"src/main/browser/client-hosts/commands/browser-client-host-command-dispatcher.test.ts\",\n \"src/main/browser/network/tunnels/browser-network-tunnel-session.test.ts\",\n \"src/main/browser/network/tunnels/browser-network-tunnel-session-aggregate-memory.test.ts\",\n \"src/main/browser/network/tunnels/browser-network-tunnel-client.test.ts\",\n \"src/main/browser/network/tunnels/browser-network-tunnel-outbound-memory-budget.test.ts\",\n \"src/main/browser/network/execution-routes/browser-network-deferred-socket.test.ts\",\n \"src/main/browser/network/execution-routes/browser-network-execution-route.test.ts\",\n \"src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts\",\n \"src/main/browser/network/execution-routes/ssh-browser-network-execution-route.test.ts\",\n \"src/main/browser/network/tunnels/system-ssh-socks-client-socket.test.ts\",\n \"src/main/ssh/system-transport/forwarding/system-ssh-dynamic-forward-process.test.ts\",\n \"src/main/ssh/port-forwarding/ssh-port-forward.test.ts\",\n \"src/main/browser/network/tunnels/remote-browser-socks-server.test.ts\",\n \"src/main/runtime/rpc/methods/browser/browser-network-tunnel.test.ts\",\n \"src/main/runtime/browser/network/browser-network-tunnel-paired-runtime.integration.test.ts\",\n \"src/shared/remote-runtime/remote-runtime-client.test.ts\",\n \"src/shared/remote-runtime/requests/remote-runtime-subscription-request.test.ts\",\n \"src/shared/ws-outbound-backpressure-queue.test.ts\",\n \"tests/e2e/ssh-browser-network-execution-route.docker.unit.test.ts\"\n ]\nassertionRefs: [\n {\n \"file\": \"src/main/runtime/rpc/server/runtime-rpc-browser-host-admission.test.ts\",\n \"assertions\": [\n \"one paired device cannot consume the second device's reserved browser-host share\",\n \"asks and browser hosts share a ceiling that retains one quarter of total capacity for waits\"\n ]\n },\n {\n \"file\": \"src/main/browser/client-hosts/leases/paired-runtime-browser-host-lease.test.ts\",\n \"assertions\": [\"closes a subscription acquired after local teardown\"]\n },\n {\n \"file\": \"src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-reconnect.test.ts\",\n \"assertions\": [\n \"an acknowledged mutation replay uses the preserved dispatcher result without rerunning its handler\"\n ]\n },\n {\n \"file\": \"src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-composition.test.ts\",\n \"assertions\": [\n \"waits for old handlers and ignores their late callbacks before replacement\",\n \"keeps one command gate across repeated loss while fencing stale route recovery\",\n \"fails closed without racing page cleanup when handlers do not settle\"\n ]\n },\n {\n \"file\": \"src/main/browser/client-pages/execution/browser-client-page-command-executor.test.ts\",\n \"assertions\": [\"holds Session and route release for the exact destroyed acknowledgement\"]\n },\n {\n \"file\": \"src/main/browser/client-pages/lifecycle/browser-client-page-reconciliation-adapters.test.ts\",\n \"assertions\": [\n \"destroys a guest rekeyed during an authority transition instead of granting navigation\"\n ]\n },\n {\n \"file\": \"src/main/browser/routing/sessions/browser-route-prepared-page-rekey.test.ts\",\n \"assertions\": [\n \"prepared authority rekeys without changing its opaque capability token\",\n \"stale, occupied, cross-page, and cross-renderer targets fail without mutation\"\n ]\n },\n {\n \"file\": \"src/main/browser/client-pages/execution/browser-client-page-command-integration.test.ts\",\n \"assertions\": [\n \"spontaneous exact guest destruction revokes active inventory before explicit page retirement\"\n ]\n },\n {\n \"file\": \"src/main/browser/client-hosts/lifecycle/paired-runtime-browser-client-host-registry.test.ts\",\n \"assertions\": [\"keeps a failed authority transition tombstoned until cleanup settles\"]\n },\n {\n \"file\": \"src/main/browser/network/client-routes/browser-client-network-route-registry.test.ts\",\n \"assertions\": [\n \"retains one exact route until its final page releases it\",\n \"keeps an ambiguously closed route fenced until final registry cleanup\",\n \"retires old authority routes without destroying them before exact page cleanup\",\n \"aborts a stale route recovery without retaining its retry timer\",\n \"fails bounded recovery after one route exhausts grace without leaking timers\",\n \"mints a fresh route for a retain that lands while the previous one is closing\",\n \"waits for a route still closing before reporting retirement\",\n \"rejects a retain the moment its signal aborts mid-startup\",\n \"refuses a retain that waited out a closing route onto a retired registry\",\n \"reports a failed final cleanup to an awaiting retirement\"\n ]\n },\n {\n \"file\": \"src/main/browser/client-hosts/commands/browser-client-host-command-dispatcher.test.ts\",\n \"assertions\": [\n \"keeps a timed-out retirement fenced until its handler actually settles\",\n \"bounds close while canceling queued and non-cooperative handlers\"\n ]\n },\n {\n \"file\": \"src/main/runtime/browser-host/commands/browser-host-command-ledger-capacity.test.ts\",\n \"assertions\": [\n \"oversized wire payloads fail before page, sequence, or delivery admission\",\n \"new issue delivery failure closes the ledger and fences every outstanding outcome\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/methods/browser/browser-client-host.test.ts\",\n \"assertions\": [\n \"negotiated exact reattach emits ready before replaying the unchanged unsettled command\",\n \"reattach before old cleanup preserves the same authority and ends only the superseded connection stream\",\n \"only the exact negotiated connection, paired device, and live page placement can settle a server-owned command\",\n \"exact duplicate results are idempotent while conflicts and stale or retired placement fail closed\",\n \"a second browser-host identity on one authenticated connection is rejected\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/methods/browser/browser-client-host-reconciliation.test.ts\",\n \"assertions\": [\n \"command result settlement requires the exact negotiated reconciliation authority\"\n ]\n },\n {\n \"file\": \"src/shared/browser/network/tunnels/browser-network-tunnel-protocol.test.ts\",\n \"assertions\": [\n \"remote DNS names round-trip without client resolution\",\n \"unknown versions, opcodes, oversized payloads, and length mismatches fail closed\"\n ]\n },\n {\n \"file\": \"src/main/browser/network/tunnels/browser-network-tunnel-session.test.ts\",\n \"assertions\": [\n \"replenishes client credit only after the destination write settles\",\n \"keeps concurrent streams alive when late data arrives for a retired stream\",\n \"flushes credited destination bytes before close\",\n \"caps aggregate retained destination bytes and releases exact stream accounting\",\n \"caps unsettled destination writes and releases retirement exactly once\",\n \"releases queued bytes once when an accepted send closes reentrantly\"\n ]\n },\n {\n \"file\": \"src/main/browser/network/tunnels/browser-network-tunnel-session-aggregate-memory.test.ts\",\n \"assertions\": [\n \"multiple execution-host routes share browser-host application-byte admission in both traffic directions\",\n \"route close releases aggregate claims exactly before stale destination-write callbacks\"\n ]\n },\n {\n \"file\": \"src/main/browser/network/tunnels/browser-network-tunnel-client.test.ts\",\n \"assertions\": [\n \"preserves remote DNS and waits for an opened acknowledgement\",\n \"sends only credited bytes in bounded frames and replenishes consumed input\",\n \"ignores a retired stream frame but rejects a never-allocated stream ID\",\n \"never reuses stream IDs within one generation after its bounded ledger exhausts\",\n \"replenishes only bytes settled after the readable consumer takes them\",\n \"fails closed when pending tiny destination frames exceed the chunk cap\",\n \"drains data that precedes a remote close before retiring the socket\"\n ]\n },\n {\n \"file\": \"src/main/browser/network/tunnels/browser-network-tunnel-outbound-memory-budget.test.ts\",\n \"assertions\": [\n \"application, encrypted-queue, and native socket bytes share one host ceiling\",\n \"distinct hosts share one process ceiling with exact release\",\n \"zero-byte claims, socket sources, hosts, and leases have independent bounds\",\n \"released leases cannot admit work and retained owners keep exact accounting alive\",\n \"unavailable native-buffer evidence fails closed until its exact source releases\"\n ]\n },\n {\n \"file\": \"src/main/browser/network/tunnels/remote-browser-socks-server.test.ts\",\n \"assertions\": [\n \"domain CONNECT preserves the final execution-host DNS target\",\n \"unsupported commands and unavailable routes open no fallback destination\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/methods/browser/browser-network-tunnel.test.ts\",\n \"assertions\": [\n \"ungranted or wrong-key SSH routes are rejected before resolver or binary registration\",\n \"connector diagnostics are mapped to a stable public error without local path disclosure\",\n \"grant revocation aborts connector startup immediately and cannot race through route admission\",\n \"the server allocates route generations and fences the replaced route\"\n ]\n },\n {\n \"file\": \"src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts\",\n \"assertions\": [\n \"closes a subscription that resolves after route teardown\",\n \"settles startup when close follows subscription acquisition before readiness\",\n \"bounds the post-auth readiness wait\",\n \"binds and releases the exact browser-host outbound memory lease\",\n \"keeps one listener fail-closed and accepts an increasing replacement generation\",\n \"ignores late callbacks from a superseded transport\",\n \"recovers again after a second transport death\",\n \"rejects a non-increasing replacement generation and remains retryable\",\n \"fences a ready generation even when the replacement closes before its await resumes\",\n \"replaces the tunnel generation before recycling a bounded stream ID\"\n ]\n },\n {\n \"file\": \"src/main/browser/network/execution-routes/browser-network-deferred-socket.test.ts\",\n \"assertions\": [\n \"destroy before source attachment emits one close and destroys a late source\",\n \"source close after destroy cannot emit duplicate wrapper close\"\n ]\n },\n {\n \"file\": \"src/main/browser/network/execution-routes/browser-network-execution-route.test.ts\",\n \"assertions\": [\n \"execution-host route keys cannot collide on delimiter-containing identities\",\n \"native routing accepts only the exact runtime revision without retaining an invalidation callback\"\n ]\n },\n {\n \"file\": \"src/main/browser/network/execution-routes/ssh-browser-network-execution-route.test.ts\",\n \"assertions\": [\n \"does not adopt a replacement ssh2 client under the captured authority\",\n \"releases a deferred socket when forwardOut throws during disconnect\",\n \"aborts system SSH startup when route authorization is revoked\",\n \"reaches external sites over ssh2 through the host proxy and keeps local names direct\",\n \"dials directly while the host environment is unreadable and adopts it once a retry reads it\",\n \"reaches external sites over system SSH through the host proxy\"\n ]\n },\n {\n \"file\": \"src/main/browser/network/tunnels/system-ssh-socks-client-socket.test.ts\",\n \"assertions\": [\n \"the internal SOCKS5 client encodes the exact destination as a domain request\"\n ]\n },\n {\n \"file\": \"src/main/ssh/system-transport/forwarding/system-ssh-dynamic-forward-process.test.ts\",\n \"assertions\": [\n \"authority invalidation cancels an in-progress SSH launch and destroys its active readiness probe immediately\"\n ]\n },\n {\n \"file\": \"tests/e2e/ssh-browser-network-execution-route.docker.unit.test.ts\",\n \"assertions\": [\n \"an ephemeral sshd resolves a container-only domain and returns a unique HTTP marker\",\n \"the real ssh2 forwardOut receives that exact domain and provider loss fences the route\",\n \"one non-interactive system-OpenSSH dynamic forward passes the same remote-only oracle and closes cleanly\"\n ]\n },\n {\n \"file\": \"src/shared/remote-runtime/requests/remote-runtime-subscription-request.test.ts\",\n \"assertions\": [\n \"nested JSON responses route by exact request ID under reverse-order delivery\"\n ]\n },\n {\n \"file\": \"src/shared/remote-runtime/remote-runtime-client.test.ts\",\n \"assertions\": [\n \"the authenticated socket binds the optional tunnel capability\",\n \"the dedicated outbound queue reports hard overflow instead of dropping a frame\",\n \"encrypted queue claims release synchronously while native socket ownership remains charged through exact close\"\n ]\n },\n {\n \"file\": \"src/shared/ws-outbound-backpressure-queue.test.ts\",\n \"assertions\": [\n \"direct and already-retained queued frames use distinct aggregate admission semantics\",\n \"queued drain yields after its configured frame quantum without reordering\",\n \"aggregate queue claims release on drain, denial, disposal, and close\"\n ]\n }\n ]", - "Test-value audit: Retire the paired-host late subscription smoke: it checks a mocked close count and startup rejection, without remote unsubscribe or successor outcomes. No equivalent replacement or fresh execution is claimed." + "Test-value audit: Retire the paired-host late subscription smoke: it checks a mocked close count and startup rejection, without remote unsubscribe or successor outcomes. No equivalent replacement or fresh execution is claimed.", + "Test-value audit3842 removes four authored/four finite outbound queue probes and the count80 row from each of three inbound queue declarations (zero extra authored removals, three extra finite removals). Direct fast-path failure, synthetic work quantum, injected aggregate callback accounting, supplied unwritable guard, and repeated eighty-payload alarms are accepted losses without equivalent replacement claims. Remaining inbound count8 cases retain actual WeakRef/GC and FIFO/rejection observations. All three unrelated dated gate receipts retain their original command/results/counts and are not fresh validation of changed sources." ], "demotionRule": "Keep experimental or demote if a self-asserted or ambiguous host can receive a route, an SSH descriptor bypasses capability, lease-bound grant, or provider-authority checks, late cleanup can remove a replacement, a route can resolve names on the desktop, exceed a byte or stream bound, replenish credit before destination settlement, accept a stale or non-increasing generation, reuse a stream ID within one generation, lose or bypass its fail-closed listener during reconnect, expose the SOCKS listener off-loopback, accept BIND/UDP, or fall back when the selected route is unavailable." }, @@ -5825,12 +5792,12 @@ "providers": ["local", "daemon", "ssh", "remote-runtime", "wsl"], "coveredPlatforms": ["macos"], "coveredProviders": ["local", "daemon", "remote-runtime"], - "coverageNotes": "Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial mobile-presence suite retains only five authored callbacks: admitted preview-paste completion across phone takeover, desktop take-back superseding mobile input, desktop viewport write/restore geometry, and held-fit reclaim convergence. Other supplied floor/rollback/selection/viewport/grace/disconnect/reconnect/orphan-state alarms are lost. No per-source assertion object exists to reassign. The one affected dated mobile-view-authority receipt is retired whole into historical notes with its full original/currentCommand/raw data preserved; it is not active corroboration for reduced candidate bytes. Imported mobile-subscribe registrations and retained callbacks remain bounded to their actual source obligations, without equivalent replacement or physical-phone/native-PTY claims. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1709 removes low-value test definitions and retires affected assertion or execution-receipt claims without equivalent replacement coverage. Per-source reviews bound retained behavior and injected/native/remote limits. Unchanged assertions and receipts keep their original scope; gates lacking current active evidence are downgraded. Historical scope before this audit: Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1623 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1320 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Deterministic host/parser, process-classifier, snapshot-publication, mixed-version, renderer, and macOS Electron coverage proves the local and shared paired-runtime contracts. Direct SSH intentionally publishes no shell proof and immediately preserves incumbent behavior. WSL, Windows ConPTY, Linux desktop, and paired headed/headless journeys remain gaps. The audit removed the isolated terminal-multiplex pending-escape-tail forwarding test. Its direct RPC snapshot field-copy alarm is lost; retained parser, snapshot and lifecycle suites do not establish equivalent RPC field coverage. Audit1320: src/renderer/src/components/terminal-pane/remote-runtime-pty-snapshot-escape-tail.test.ts removed. Snapshot pending escape/alternate-screen/shell metadata forwarding and negative app-store-read alarm disappears. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1402: src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.ts reduced. Loses basic paired serialize/initial replay forwarding check; hidden alt-frame grid/precedence policy remains. No real terminal renderer claim. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1412: src/main/daemon/terminal-host-concurrent-create.test.ts reduced. Loses race deduplication, attach during unsettled ownership proof, retry after failed spawn, distinct-session parallelism, disposal waiting and shutdown retry-fencing alarms bundled with removed internal-call counts or real-time waits. No replacement-equivalence claim. src/main/daemon/terminal-checkpoint-serializer.test.ts reduced. Loses bounded native conversion/no-whole-candidate materialization and snapshot getter single-read alarms. Retained byte-size outcomes do not establish CPU/allocation bounds. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "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. Audit3984 retires all nine mobile-presence and imported subscribe callbacks plus their orphan store fixture. Accepted losses include desktop/phone restore geometry, echo filtering, held reconnect/reclaim notifications, and the real headless snapshot sequence race. No equivalent replacement or fresh gate execution is claimed. Audit 3959 retires the whole session.test.ts driver (27 authored / 33 finite cases): startup/echo filtering, readiness input gates, ownership confirmation, detach authority, and termination retry/exit ordering alarms are intentionally lost. No equivalent replacement or fresh runtime validation is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial mobile-presence suite retains only five authored callbacks: admitted preview-paste completion across phone takeover, desktop take-back superseding mobile input, desktop viewport write/restore geometry, and held-fit reclaim convergence. Other supplied floor/rollback/selection/viewport/grace/disconnect/reconnect/orphan-state alarms are lost. No per-source assertion object exists to reassign. The one affected dated mobile-view-authority receipt is retired whole into historical notes with its full original/currentCommand/raw data preserved; it is not active corroboration for reduced candidate bytes. Imported mobile-subscribe registrations and retained callbacks remain bounded to their actual source obligations, without equivalent replacement or physical-phone/native-PTY claims. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1709 removes low-value test definitions and retires affected assertion or execution-receipt claims without equivalent replacement coverage. Per-source reviews bound retained behavior and injected/native/remote limits. Unchanged assertions and receipts keep their original scope; gates lacking current active evidence are downgraded. Historical scope before this audit: Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1623 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1320 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Deterministic host/parser, process-classifier, snapshot-publication, mixed-version, renderer, and macOS Electron coverage proves the local and shared paired-runtime contracts. Direct SSH intentionally publishes no shell proof and immediately preserves incumbent behavior. WSL, Windows ConPTY, Linux desktop, and paired headed/headless journeys remain gaps. The audit removed the isolated terminal-multiplex pending-escape-tail forwarding test. Its direct RPC snapshot field-copy alarm is lost; retained parser, snapshot and lifecycle suites do not establish equivalent RPC field coverage. Audit1320: src/renderer/src/components/terminal-pane/remote-runtime-pty-snapshot-escape-tail.test.ts removed. Snapshot pending escape/alternate-screen/shell metadata forwarding and negative app-store-read alarm disappears. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1402: src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.ts reduced. Loses basic paired serialize/initial replay forwarding check; hidden alt-frame grid/precedence policy remains. No real terminal renderer claim. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1412: src/main/daemon/terminal-host-concurrent-create.test.ts reduced. Loses race deduplication, attach during unsettled ownership proof, retry after failed spawn, distinct-session parallelism, disposal waiting and shutdown retry-fencing alarms bundled with removed internal-call counts or real-time waits. No replacement-equivalence claim. src/main/daemon/terminal-checkpoint-serializer.test.ts reduced. Loses bounded native conversion/no-whole-candidate materialization and snapshot getter single-read alarms. Retained byte-size outcomes do not establish CPU/allocation bounds. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", "motivatingLinks": ["https://github.com/stablyai/orca/pull/16379"], "invariant": "After a TUI exits or is killed, reveal, reattach, snapshot replay, or renderer remount must not deliver terminal-owned mouse or alternate-screen protocol bytes to the surviving shell. Recovery is an ordered output barrier in the daemon session data path: an OSC 133;D completing while the alternate screen is still active pauses the stream at that exact byte boundary, a fresh execution-host process inspection proves shell ownership, and on proof a mode reset is injected as in-stream output so every consumer converges by parsing the same bytes and the queued post-boundary shell output (the prompt) lands on the normal buffer. Snapshots are pure reads. Any failure — refuted proof, timeout, queue overflow, session death, disposal — flushes the queue unmodified, preserving incumbent behavior; later command or mode bytes revoke proof. Clean alternate-screen exits prove ownership asynchronously without pausing.", - "oracle": "Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial mobile-presence suite retains only five authored callbacks: admitted preview-paste completion across phone takeover, desktop take-back superseding mobile input, desktop viewport write/restore geometry, and held-fit reclaim convergence. Other supplied floor/rollback/selection/viewport/grace/disconnect/reconnect/orphan-state alarms are lost. No per-source assertion object exists to reassign. The one affected dated mobile-view-authority receipt is retired whole into historical notes with its full original/currentCommand/raw data preserved; it is not active corroboration for reduced candidate bytes. Imported mobile-subscribe registrations and retained callbacks remain bounded to their actual source obligations, without equivalent replacement or physical-phone/native-PTY claims. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1709 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Audit1683 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Run one fixed child-TUI journey for normal exit and cleanup-free SIGKILL. Assert renderer and host normal-buffer/non-mouse state, host snapshot terminalOwner metadata, exact PTY writes with no post-exit mouse report, unrelated-pane survival, post-boundary prompt output preserved (normal exit), ordered proof invalidation, bounded settlement and bail-out flush, one inspection per unclean episode with zero scans for ordinary output, split-escape safety at every chunk boundary, and old/new client-host fallback parity.", + "oracle": "Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial mobile-presence suite retains only five authored callbacks: admitted preview-paste completion across phone takeover, desktop take-back superseding mobile input, desktop viewport write/restore geometry, and held-fit reclaim convergence. Other supplied floor/rollback/selection/viewport/grace/disconnect/reconnect/orphan-state alarms are lost. No per-source assertion object exists to reassign. The one affected dated mobile-view-authority receipt is retired whole into historical notes with its full original/currentCommand/raw data preserved; it is not active corroboration for reduced candidate bytes. Imported mobile-subscribe registrations and retained callbacks remain bounded to their actual source obligations, without equivalent replacement or physical-phone/native-PTY claims. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1709 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Audit1683 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Run one fixed child-TUI journey for normal exit and cleanup-free SIGKILL. Assert renderer and host normal-buffer/non-mouse state, host snapshot terminalOwner metadata, exact PTY writes with no post-exit mouse report, unrelated-pane survival, post-boundary prompt output preserved (normal exit), ordered proof invalidation, bounded settlement and bail-out flush, one inspection per unclean episode with zero scans for ordinary output, split-escape safety at every chunk boundary, and old/new client-host fallback parity.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/shell-readiness/testing/terminal-shell-recovery-barrier.test.ts src/main/daemon/sessions/testing/session-shell-recovery.test.ts src/main/daemon/sessions/testing/session.test.ts src/main/daemon/terminal-host/testing/terminal-host-concurrent-create.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/daemon/history/restoration/testing/daemon-restore-scrollback-depth.test.ts src/main/daemon/history/restoration/testing/terminal-checkpoint-serializer.test.ts src/main/providers/agent-foreground-process.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/terminal/layout/mobile-presence-lock.test.ts src/shared/terminal/protocol/escape/terminal-partial-escape-tail.test.ts src/shared/terminal/protocol/escape/terminal-partial-escape-tail.fuzz.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/shell-readiness/testing/terminal-shell-recovery-barrier.test.ts src/main/daemon/sessions/testing/session-shell-recovery.test.ts src/main/daemon/terminal-host/testing/terminal-host-concurrent-create.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/daemon/history/restoration/testing/daemon-restore-scrollback-depth.test.ts src/main/daemon/history/restoration/testing/terminal-checkpoint-serializer.test.ts src/main/providers/agent-foreground-process.test.ts src/main/runtime/construction/orca-runtime.test.ts src/shared/terminal/protocol/escape/terminal-partial-escape-tail.test.ts src/shared/terminal/protocol/escape/terminal-partial-escape-tail.fuzz.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts --reporter=dot", "pnpm exec electron-vite build --mode e2e", "SKIP_BUILD=1 pnpm exec playwright test tests/e2e/terminal-hidden-child-tui-kill-mode-reset.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1" @@ -5838,14 +5805,12 @@ "testFiles": [ "src/main/daemon/shell-readiness/testing/terminal-shell-recovery-barrier.test.ts", "src/main/daemon/sessions/testing/session-shell-recovery.test.ts", - "src/main/daemon/sessions/testing/session.test.ts", "src/main/daemon/terminal-host/testing/terminal-host-concurrent-create.test.ts", "src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts", "src/main/daemon/history/restoration/testing/daemon-restore-scrollback-depth.test.ts", "src/main/daemon/history/restoration/testing/terminal-checkpoint-serializer.test.ts", "src/main/providers/agent-foreground-process.test.ts", "src/main/runtime/construction/orca-runtime.test.ts", - "src/main/runtime/terminal/layout/mobile-presence-lock.test.ts", "src/shared/terminal/protocol/escape/terminal-partial-escape-tail.test.ts", "src/shared/terminal/protocol/escape/terminal-partial-escape-tail.fuzz.test.ts", "tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts", @@ -5910,6 +5875,11 @@ "Keep missing-proof mixed-version behavior identical to the incumbent client path." ], "knownGaps": [ + "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.", + "Audit3984 retires all nine mobile-presence and imported subscribe callbacks plus their orphan store fixture. Accepted losses include desktop/phone restore geometry, echo filtering, held reconnect/reclaim notifications, and the real headless snapshot sequence race. No equivalent replacement or fresh gate execution is claimed.", + "Audit3814 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle from a Codex ready prompt even when stale startup lines remain :: Stale MCP startup lines must not block a later Codex ready header.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle when a stale Codex prompt is followed by the ready header :: A Codex ready header following a stale resume prompt must satisfy tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for an idle Cursor lane past its dismissed trust dialog (#8210) :: Later Cursor idle banner overrides retained trust dialog.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not block a mid-run Cursor lane on its dismissed trust dialog (#8210) :: Dismissed trust dialog must not report blocked for later busy Cursor; wait times out.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not classify unrelated press-enter prompts as Codex blocked prompts :: Unidentified press-enter text must time out rather than be classified Codex blocked.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for quiet background PTY agents without OSC titles :: Quiet Codex background terminal without OSC title eventually resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: sends agent prompts as bracketed paste before submit :: Driving prompt escapes embedded paste-end ESC, writes one framed paste then CR, and counts bytes.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: settles a foreground Codex prompt when launch metadata has not arrived :: Codex inferred from foreground without launch metadata waits for composer marker/quiescence before one CR.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: gives a late Codex render marker a fresh quiescence window :: Marker arriving at7.9s re-arms fresh quiet window instead of submitting at initial cap.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: writes large agent prompt paste frames atomically before delayed submit :: A prompt larger than input chunk budget is a single paste write before delayed CR with exact byte count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects oversized terminal.send text before provider writes :: Oversized ordinary terminal.send rejects input-too-large before any provider write.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects focusing an exited background terminal session :: focusTerminal refuses terminal_exited before invoking background reveal.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: pastes the same bytes the desktop draft paste sent for the prompt :: Launch-ready prompt normalizes CR/LF and renders embedded ESC visibly identically to desktop bracketed paste.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: keeps a prompt into a running agent behind the render settle, as before :: Driving prompt remains held through7s repaint activity then submits once by9s.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reports a queued PTY focus as not navigated when its notifier disappears :: Queued PTY focus and completed active reveal report not navigated after notifier removal; no second reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: does not invoke a stale graph-leaf focus notifier after queued PTY work :: Queued graph-leaf focus must not invoke old notifier after preceding PTY reveal and notifier removal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: paginates retained terminal output with explicit limits and truncation metadata :: Preview120lines, fractional limits,50/200 pages, retained2000line truncation and future-cursor metadata stay consistent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: falls back to renderer visible screen when uncursored TUI tail is blank :: Substantial blank uncursored tail uses mounted renderer visible screen with zero scrollback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reads and shows the runtime-owned alternate-screen grid without serialization :: Actual runtime alternate-screen grid provides read/show content without renderer/provider serialization.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: classifies older provider alternate-screen snapshots from ANSI :: Older provider without alternateScreen metadata classifies ANSI alternate entry and returns Remote Vim screen.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: honors the last ANSI screen transition when older provider metadata is absent :: Last ANSI alternate exit overrides earlier entry when explicit provider mode metadata is absent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: rejects a full provider screen frame after live output advances :: Live output arriving during second full-screen capture causes screen-unavailable rather than stale full frame.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: shares one provider snapshot between concurrent read and show calls :: Concurrent read/show share one successful provider snapshot and both receive Shared TUI content.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps cursor reads provider-free on restored alternate-screen PTYs :: Restored alternate-screen cursor transcript reads never acquire provider snapshot.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: backs off after a provider snapshot failure instead of retrying for show :: Failed provider capture is cached/backed off so later show does not retry.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: falls back once to a mounted renderer when a known alternate provider fails :: A known-alternate failed provider capture falls back exactly once to newly mounted renderer.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: bounds provider visible frames for read and show responses :: Provider visible read/show use six bounded lines and300character preview.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps renderer-fallback composer drafts separate from terminal output :: Renderer fallback strips dim composer draft from terminal output and exposes draft separately.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: does not use renderer visible-screen fallback for a short blank shell tail :: Two blank shell lines must not trigger renderer screen fallback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: trims terminal tail character budget without per-line array shifts :: Tail builder trims to256KiB with correct retained suffix and no Array.shift calls.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains ANSI-only status redraws instead of appending every frame :: Repeated erase/redraw replaces preview until newline then publishes one completed cursor row.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains split multi-line ANSI footer redraw state across chunks :: CUU state across chunks retains corrected footer rows and publishes new cursor entries.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not let stale lower rows hide earlier corrected footer rows from cursor reads :: Earlier corrected footer row must not be hidden by stale lower rows in cursor reads.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: bounds completed transcript entries from a single multi-line redraw chunk :: Single redraw chunk bounds completed transcript to2000retained lines and correct oldest/next/latest cursors.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains multi-line ANSI redraws when the last footer row stays partial :: Partial final redrawn row appears in preview but cursor sees it only after newline.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not retain split ANSI controls as visible terminal preview text :: Split color/mode escapes never leak preview fragments; long split OSC title truncates at MAX_OSC_TITLE_CHARS.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains same-line redraw cursor position across split full-line erase chunks :: Full-line erase preserves column across chunks so XY follows three spaces rather than old ABC.\nsrc/main/runtime/orca-runtime-tests/conpty-stream-read.spec.ts :: fills the requested line count even when blank rows sit below the prompt :: Blank rows below a ConPTY prompt must not consume the requested nonempty-line count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: does not retain split ST-terminated string controls as preview text :: Split ST-terminated Kitty/string controls must remain excluded from preview text.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects split OSC titles before retaining terminal previews :: Split BEL OSC title must update working title/status without leaking into preview.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects ST-terminated OSC titles split before the final backslash :: ST OSC split before final backslash must update title without leaking framing.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: preserves a trailing escape after a completed OSC title :: Completed OSC followed by pending ESC must preserve the next idle-title transition.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: seeds newly synced leaves from PTY pending ANSI state :: A newly synced graph leaf inherits pending ANSI so a split color fragment cannot leak.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: bounds retained partial terminal output before preview reads :: Partial terminal state stays capped at 4000, preserves retained array identity, and preview truncation/cursor output remains correct.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: submits the mail pointer to Cursor Agent only after the paste-burst delay :: Cursor mailbox pointer Enter must wait through the paste-burst delay; this is a real input-timing alarm intentionally retired.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts :: adopts a v1.4.150-shaped agent, setup, and shell orphan as one topology transaction :: Stale incarnation refuses without topology change; three agent/setup/shell lanes adopt atomically with layout/group/revision and preserved read/input/resize; exact replay is idempotent and competing owner refuses.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: retires the exact worker when it exits after renderer reveal :: Exact worker exit after reveal retires that worker and its surface.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: re-reveals a recovered worker after the renderer graph epoch changes :: Changed renderer graph epoch invalidates reveal receipt and forces another reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: defers recovery when the renderer omits the exact reveal identity :: Missing exact reveal identity defers recovery after two attempts.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: reconciles a same-id process replacement before headless adoption :: A process replacement before headless adoption must fence off stale ownership.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retires provider resume only after authoritative inventory proves the legacy PTY exited :: Authoritative owning-host inventory overrides false local hasPty, avoids SSH scanning, retires exited provider resume/surface, adopts live workers without headless reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retries inventory and unknown liveness without revealing a ghost worker :: Inventory failure and unknown liveness must retry without ghost reveal, eventually adopt, and stop retrying.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: refuses a live reserved pane before issuing a handle or revealing it :: A requireFreshPane launch receiving a live reserved owner must reject before handle/reveal/kill, and release its claim. No equivalent replacement claimed.", + "Audit3806 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: skips a listener unsubscribed mid-fan-out even with mobile exclusions active :: A listener removed by an earlier listener during one fanout is not called, including with a side-effect-excluded mobile listener present.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: retains bytes emitted before a fresh daemon spawn resolves :: Bytes and title arriving before an initial zero/reset provider response survive in the serialized headless buffer with their counted sequence.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits command-finished facts with best-effort exit codes across chunk splits :: A split OSC133 D exit code becomes130 and a missing code becomes null in ordered command-finished facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits pr-link facts once per URL with batch attribution :: A split GitHub PR URL yields42 rather than4, emits42/43 once each, and carries PTY/worktree/tab attribution.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits 2031-subscribe facts across chunk splits :: Split ESC[?20 then31h emits exactly one2031-subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: restores a provisional 2031 subscribe when daemon scan authority returns :: Returning daemon scan authority with partial scan seed and pending2031 subscription restores exactly one subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers the tracked title over the renderer snapshot lastTitle :: A synthetic live Cursor title overrides stale renderer lastTitle while preserving renderer snapshot source.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers provider history over a partial headless mirror for requested snapshots :: Authoritative requested snapshots return supplied provider frame/history/seq rather than a partial headless mirror, requesting5000rows.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: tracks live alternate-screen transitions after a provider snapshot :: Provider alternateScreen true is accepted, then live1049l/1049h update isTerminalAlternateScreen false/true.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: translates reset provider snapshots without retaining the old title :: A reset provider snapshot translates new local seq into the runtime domain and replaces Old process title with New process.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits the chunk agentStatus events before its side-effect batch :: Agent status callback precedes side-effect batch callback for one coalesced OSC9999/title/bell chunk.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: still emits a throwing chunk’s facts under its own seq, not the next chunk’s :: A tracker throw still flushes first chunk title facts under its own seq, and second chunk does not inherit those facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: seeds the lazily created tracker from the daemon-snapshot title :: A lazy tracker hydrated from renderer snapshot title Codex working emits agent-idle on later Codex done.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits command-code-working facts only after the banner arms the scrape :: Unarmed Thinking text emits no facts; a Command Code0.27.3 banner then hardcoded colored spinner text emits attributed command-code-working with the submitted prompt.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits a command-code-done fact when the idle composer returns :: After hardcoded banner/working text, returned idle composer emits command-code-done with the earlier submitted prompt.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: resizes the headless mirror after an accepted desktop PTY resize :: An external accepted resize produces the resized dimensions and same status-frame lines as a separately driven reference emulator.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: replaces suffix-only headless state with the recovered renderer snapshot :: Replacing suffix-only state removes old suffix, retains renderer history plus later output/cwd, and returns the live47x40PTY grid.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: stamps SSH connection identity on runtime terminal status :: A synthetic mounted-leaf OSC9999 status after registerPty carries the supplied SSH connectionId.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: does not retain WSL context when a PTY id is reused :: After exit and same-ID new null distro context, OSC7 file://server/share/repo uses UNC server path rather than old Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: preserves immutable context while a live daemon attach is unresolved :: preparePtyExecutionContext with preserveExisting refuses a supplied Debian replacement and subsequent OSC7 keeps original Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts :: projects frame-independent live state through main buffer snapshots :: Main-buffer snapshot puts focus-report/cursor-visibility modes in frameRestoreAnsi, excludes STATIC-FRAME there and includes it in data.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.ts :: continues terminal agent status fanout when a callback throws :: Throwing on the first status callback does not prevent second payload delivery and logs contextual error.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: returns a title-only replay snapshot and never historical attention :: Lose replay:true/title-only fact projection despite earlierbell and unknownPTYnull. No actual delivered-history notification or reattach behavior was exercised. No equivalent replacement claimed.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects a handle rebind while a controller-less status check yields :: A handle rebound while the null-controller status continuation yields must throw terminal_handle_stale.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects confirmation evidence when the owning PTY exits :: A pending strong confirmation resolving after owning PTY exit must reject terminal_exited.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-03.spec.ts :: keeps ordinary terminal send suffix failures on the existing not-writable contract :: Ordinary send writes text but refused CR must throw terminal_not_writable with beforeWrite twice and afterWrite once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell the execution host cannot apply instead of spawning its default :: Requested Windows shell on POSIX must refuse before spawning a default shell.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: quotes the agent startup command for the requested shell, not the host default :: Requested cmd shell must override PowerShell default quoting for agent startup command.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: keeps restored receipts outside a targeted worktree scan :: Targeted scan removes the moved-worktree receipt while preserving another worktree receipt.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: observes setup command completion without waiting for its interactive shell to exit :: Nonzero completion marker 17 resolves while interactive shell remains running.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: falls back to setup terminal exit when no completion signal is available :: Setup completion observer without token falls back to actual exit code 9.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: cancels setup completion observation when the caller aborts :: Abort rejects with the original reason and unsubscribes once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps observing after an uncertain setup terminal status :: Unknown exit waiter result must leave observation pending until completion marker arrives.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh omits a record :: Controller inventory omission disconnects the record but preserves its retained transcript.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh times out :: Hung inventory timeout leaves connected record and retained transcript intact.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle for adopted background PTY handles from the renderer title :: An adopted background handle resolves tui-idle from ready Codex renderer title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves live-leaf tui-idle from an OpenCode native title :: A live leaf resolves tui-idle from an OpenCode native title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from a Codex ready prompt preview :: A supplied Codex prompt preview resolves tui-idle without an actual agent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from an Antigravity prompt before the model line :: A supplied Antigravity prompt before model line resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell with no workspace instead of creating a default-shell tab :: Workspace-less explicit shell must reject before renderer default-tab request or spawn. This real guard/wiring alarm is deliberately retired.", + "Audit3798 per-case accepted losses:\nsrc/main/runtime/orca-runtime-tests/paired-settings.spec.ts :: awaits navigation-only updates from paired clients (%s) :: Updating only claudeSubagentNavigationEnabled waits for the actual controller call to the supplied pending Claude-view reconcile for both on/off values.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: drops a client page record even when its close command cannot be issued :: A removed workspace loses its runtime client-page record and headless browser projection despite close delivery_required rejection, and emits the asynchronous warning.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: leaves client-hosted pages alone when another host still owns the same worktree id :: Removing runtime:env-b metadata with local ownership leaves the local same-ID client page unchanged and issues no close command.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: marks live bindings again when reopening after a promoted window closes :: A reopened window marks its still-registered live worktree in activeWorktreeIdsOnShutdown after the first promoted window closes.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: preserves live SSH session identities when promoting a headless runtime :: Headless-to-desktop promotion records active worktree, SSH connection and remoteSessionIdsByTabId from the supplied surviving SSH PTY/session.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores a surviving renderer when its reload is cancelled :: A sole ready renderer reload cancelled under its current renderer fence returns true and becomes ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores headless authority when desktop promotion navigation is cancelled :: A cancelled desktop promotion with headless recovery returns false while headless authority remains ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: moves a desktop graph to unavailable when its reload times out :: A ready desktop graph without a headless fallback becomes unavailable at the reload deadline and retains its window/epoch.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: recovers a failed headless promotion and accepts a later renderer generation :: A promotion failure restores ready headless authority; a later valid same-window graph publishes ready desktop authority.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: clears a failed pane recovery so a later reconnect can retry :: After relay_reconnecting rejection, the pending recovery lock clears and the same pane/handle can call createTerminal a second time and return its supplied replacement.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: still preserves a CLI agent leaf when the reloaded renderer has not rebound its PTY :: An empty graph published during renderer reload preserves a preallocated live CLI PTY as one listable terminal before renderer rebind.\nsrc/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts :: keeps a no-incarnation handle across an in-graph pane remint :: Within one graph lifetime an unversioned PTY reminted onto another leaf retains its issued handle and resolves its old exit waiter after onPtyExit.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: matches explicit-id cwd PTYs when the resolved worktree cache is incomplete :: An explicit target absent from a fresh incomplete resolved cache adopts only its cwd PTY, rejects nested cwd PTY and does not rescan Git.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: ignores cwd-only controller PTYs for malformed explicit worktree IDs :: Malformed id:repo-1:: returns no terminals, does not adopt cwd-only controller PTY and avoids Git rescanning.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: refuses an SSH-backed create for mobile/runtime callers instead of creating locally :: Loss of this public unserved SSH create error-class/no-local-add/no-local-list alarm.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: records an app-selected parent workspace as a manual action :: Loss of the local runtime folder-parent manual origin, active-workspace source and explicit confidence projection alarm; no claim that SSH or cleanup coverage replaces it.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: browses runtime server directories before projects are added :: Loss of this public runtime alarm for browse availability before registration, directories-first lexical ordering and native path flavor.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: lists drive roots for a server-root browse :: Loss of the Windows public slash-root drive enumeration smoke and presence of the temporary directory drive.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations-part-02.spec.ts :: creates a missing runtime parent before creating the project directory :: Loss of this runtime createRepo recursive missing-parent/child existence and registered-path alarm.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: preserves selected project %s when a hosted parent is known :: Loss of both parent-selected and origin-selected normal fork-link projection/persisted upstream alarms plus exact single-probe count.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: links a current enterprise remote despite unavailable metadata and a retained %s :: Loss of normal current-enterprise-origin linking with stale automatic GitHub avatar or protected file image, unchanged icon assertion, and serialized project identity under unavailable metadata.", "NEXT65 current scope qualification: The NEXT65 knownGaps entries below govern the changed selectors and qualify any broader coverage implication in this gate’s unchanged oracle/coverageNotes narratives. Those narratives and preserved dated evidenceRuns retain their historical text and original exact execution scopes only; no fresh execution, transferred pass or equivalent replacement coverage is claimed. Upstream case removals remain upstream; original NEXT65 proposal descriptions grant no duplicate retirement credit.", "NEXT65 active selector scope reduction (including directory-selected whole-file retirements): src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-visibility-and-exit.test.ts. Remove complete registrations or registrar files within the selected scope for src/renderer/src/components/terminal-pane/pty-connection/reattach/pty-connection-daemon-snapshot-replay.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode-2031-subscriptions.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/geometry/pty-connection-visibility-resume-size.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/reattach/pty-connection-stale-daemon-snapshot-replay.spec.ts. Intentionally lose these named regression alarms without replacement: catches a subscribed pane up once per mode change across repeated reconnects — Mode2031 theme reporting catch-up/deduplication across repeated reconnects loses this direct protocol example.; defers to the viewer holding the grid, then catches up once on release — Held-grid viewer deferral and one catch-up/current-mode resending on release lose this direct protocol example.; repairs grid drift with a trailing probe when output stops inside the settled interval — A trailing drift probe after the last output frame loses this direct alarm.; skips foreground grid drift repair while mobile owns the PTY without a fit override — Mobile driver ownership suppressing foreground drift repair without override loses this direct alarm.; reports desktop geometry without resizing while a mobile-fit override is active — Desktop geometry reporting without resizing a mobile-owned grid loses this direct alarm.; defers a remote-desktop viewport claim until structural replay completes — Remote-desktop viewport claim waiting for structural replay completion loses this direct alarm.; skips observed desktop reassertion while mobile owns the PTY without a fit override — Observed desktop reassertion suppression under mobile ownership loses this direct alarm.; queues re-asserted resizes while pane resize holds are active — Resize hold release flushing the latest reasserted grid loses this direct alarm.; reasserts a remote grid only when visible (%s) — Visible-only remote grid reassertion loses its visible and hidden examples.; claims a focused visible remote mirror once when its passive fit hold arrives — Focused visible passive mirror claiming once, with unfocused and late repeat suppression, loses this direct sequence alarm.; does NOT re-assert while a mobile-fit override parks the PTY at phone dims — Phone fit hold suppressing visibility-resume PTY reassertion loses this direct alarm.; does NOT forward when the pane is hidden again before getSize resolves (stale hop) — Late size lookup after re-hide refusing a hidden-tab SIGWINCH loses this direct adverse-ordering alarm.; clears the captured pen for a normal-buffer fallback reattach — Fallback normal-buffer reattach clearing captured pen and dirty background loses this direct example.; waits for a recovered destination fit before forwarding its grid or live output — Recovered destination fitting before forwarding grid or live output loses this direct example.; suppresses the deferred reattach grid push when mobile claims the PTY while hidden — Mobile takeover while hidden suppressing deferred reattach grid forwarding loses this direct example.; drops stale callbacks but delivers fresh replacement output after an old replay clear — Fresh replacement output winning over stale callbacks after old replay clear loses this direct example.. Surviving parent statements and sibling registrations are preserved, but these reduced parent selectors have no fresh execution or transferred historical pass. Unrelated complete dated receipts retain only their original exact scopes; no equivalent replacement, rendered UI, provider, mobile, or cross-platform coverage is claimed.", "NEXT65 historical original active parent-selector fields (verbatim native JSON values; not current coverage):\ncommands: [\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/shell-readiness/testing/terminal-shell-recovery-barrier.test.ts src/main/daemon/sessions/testing/session-shell-recovery.test.ts src/main/daemon/sessions/testing/session.test.ts src/main/daemon/terminal-host/testing/terminal-host-concurrent-create.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/daemon/history/restoration/testing/daemon-restore-scrollback-depth.test.ts src/main/daemon/history/restoration/testing/terminal-checkpoint-serializer.test.ts src/main/providers/agent-foreground-process.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/terminal/layout/mobile-presence-lock.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-visibility-and-exit.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts src/shared/terminal/protocol/escape/terminal-partial-escape-tail.test.ts src/shared/terminal/protocol/escape/terminal-partial-escape-tail.fuzz.test.ts --reporter=dot\",\n \"pnpm exec vitest run --config config/vitest.config.ts tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts --reporter=dot\",\n \"pnpm exec electron-vite build --mode e2e\",\n \"SKIP_BUILD=1 pnpm exec playwright test tests/e2e/terminal-hidden-child-tui-kill-mode-reset.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1\"\n ]\ntestFiles: [\n \"src/main/daemon/shell-readiness/testing/terminal-shell-recovery-barrier.test.ts\",\n \"src/main/daemon/sessions/testing/session-shell-recovery.test.ts\",\n \"src/main/daemon/sessions/testing/session.test.ts\",\n \"src/main/daemon/terminal-host/testing/terminal-host-concurrent-create.test.ts\",\n \"src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts\",\n \"src/main/daemon/history/restoration/testing/daemon-restore-scrollback-depth.test.ts\",\n \"src/main/daemon/history/restoration/testing/terminal-checkpoint-serializer.test.ts\",\n \"src/main/providers/agent-foreground-process.test.ts\",\n \"src/main/runtime/construction/orca-runtime.test.ts\",\n \"src/main/runtime/terminal/layout/mobile-presence-lock.test.ts\",\n \"src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-visibility-and-exit.test.ts\",\n \"src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts\",\n \"src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts\",\n \"src/shared/terminal/protocol/escape/terminal-partial-escape-tail.test.ts\",\n \"src/shared/terminal/protocol/escape/terminal-partial-escape-tail.fuzz.test.ts\",\n \"tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts\",\n \"tests/e2e/terminal-hidden-child-tui-kill-mode-reset.spec.ts\"\n ]\nassertionRefs: [\n {\n \"file\": \"src/main/daemon/sessions/testing/session-shell-recovery.test.ts\",\n \"assertions\": [\n \"post-kill shell output survives into the normalized snapshot instead of the discarded alt buffer\",\n \"a snapshot taken during a split escape keeps the pending tail intact and stale proof is revoked by the completing bytes\"\n ]\n },\n {\n \"file\": \"src/shared/terminal/protocol/escape/terminal-partial-escape-tail.fuzz.test.ts\",\n \"assertions\": [\n \"the pending tail this gate threads over the wire folds identically at every code-unit split of the combined stream, including boundaries landing inside oscEsc/stringEsc\",\n \"the split sweep runs over an alphabet carrying CAN, SUB, doubled ESC inside OSC/DCS/SOS/PM/APC, BEL, C1 ST, NUL, DEL, intermediates, CJK, astral, and lone surrogates\"\n ]\n },\n {\n \"file\": \"tests/e2e/terminal-hidden-child-tui-kill-mode-reset.spec.ts\",\n \"assertions\": [\n \"normal exit and cleanup-free SIGKILL both restore a visible clean shell marker\",\n \"renderer logical buffer is normal and mouse tracking is disabled after host-proven recovery\",\n \"real pointer input writes no SGR mouse report to the surviving shell\",\n \"an unrelated pane remains live\"\n ]\n }\n ]", @@ -5954,7 +5924,8 @@ "Module layout policy correction: retire the remaining program-status-osc.spec.ts event-projection case (production/mock-derived pane-key oracle) and sign-in timeout case (real setTimeout wait with Date-only fake clocks). The runtime test registrar no longer imports that file. No replacement coverage or fresh execution is claimed for these losses; historical receipts retain their original source scope.", "Module layout policy correction: retire the two remaining worktree-ps-agent-row-dismissal.spec.ts registrations. The remint/dismissal/exit case computed expected snapshotVersion increments from a production snapshot and used real-clock vi.waitFor; the legacy OSC case derived its expected paneKey from the production layout-owner switch. The runtime registrar no longer imports this file. These public projection scenarios have no replacement coverage or fresh execution claimed; all historical receipts and earlier loss notes retain their original source scope.", "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.\nOriginal active selector fields (historical raw native JSON values; not current coverage):\ncommands: [\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/shell-readiness/testing/terminal-shell-recovery-barrier.test.ts src/main/daemon/sessions/testing/session-shell-recovery.test.ts src/main/daemon/sessions/testing/session.test.ts src/main/daemon/terminal-host/testing/terminal-host-concurrent-create.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/daemon/history/restoration/testing/daemon-restore-scrollback-depth.test.ts src/main/daemon/history/restoration/testing/terminal-checkpoint-serializer.test.ts src/main/providers/agent-foreground-process.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/terminal/layout/mobile-presence-lock.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-visibility-and-exit.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts src/shared/terminal/protocol/escape/terminal-partial-escape-tail.test.ts src/shared/terminal/protocol/escape/terminal-partial-escape-tail.fuzz.test.ts --reporter=dot\",\n \"pnpm exec vitest run --config config/vitest.config.ts tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts --reporter=dot\",\n \"pnpm exec electron-vite build --mode e2e\",\n \"SKIP_BUILD=1 pnpm exec playwright test tests/e2e/terminal-hidden-child-tui-kill-mode-reset.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1\"\n ]\ntestFiles: [\n \"src/main/daemon/shell-readiness/testing/terminal-shell-recovery-barrier.test.ts\",\n \"src/main/daemon/sessions/testing/session-shell-recovery.test.ts\",\n \"src/main/daemon/sessions/testing/session.test.ts\",\n \"src/main/daemon/terminal-host/testing/terminal-host-concurrent-create.test.ts\",\n \"src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts\",\n \"src/main/daemon/history/restoration/testing/daemon-restore-scrollback-depth.test.ts\",\n \"src/main/daemon/history/restoration/testing/terminal-checkpoint-serializer.test.ts\",\n \"src/main/providers/agent-foreground-process.test.ts\",\n \"src/main/runtime/construction/orca-runtime.test.ts\",\n \"src/main/runtime/terminal/layout/mobile-presence-lock.test.ts\",\n \"src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-visibility-and-exit.test.ts\",\n \"src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts\",\n \"src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts\",\n \"src/shared/terminal/protocol/escape/terminal-partial-escape-tail.test.ts\",\n \"src/shared/terminal/protocol/escape/terminal-partial-escape-tail.fuzz.test.ts\",\n \"tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts\",\n \"tests/e2e/terminal-hidden-child-tui-kill-mode-reset.spec.ts\"\n ]\nassertionRefs: [\n {\n \"file\": \"src/main/daemon/sessions/testing/session-shell-recovery.test.ts\",\n \"assertions\": [\n \"post-kill shell output survives into the normalized snapshot instead of the discarded alt buffer\",\n \"a snapshot taken during a split escape keeps the pending tail intact and stale proof is revoked by the completing bytes\"\n ]\n },\n {\n \"file\": \"src/shared/terminal/protocol/escape/terminal-partial-escape-tail.fuzz.test.ts\",\n \"assertions\": [\n \"the pending tail this gate threads over the wire folds identically at every code-unit split of the combined stream, including boundaries landing inside oscEsc/stringEsc\",\n \"the split sweep runs over an alphabet carrying CAN, SUB, doubled ESC inside OSC/DCS/SOS/PM/APC, BEL, C1 ST, NUL, DEL, intermediates, CJK, astral, and lone surrogates\"\n ]\n },\n {\n \"file\": \"tests/e2e/terminal-hidden-child-tui-kill-mode-reset.spec.ts\",\n \"assertions\": [\n \"normal exit and cleanup-free SIGKILL both restore a visible clean shell marker\",\n \"renderer logical buffer is normal and mouse tracking is disabled after host-proven recovery\",\n \"real pointer input writes no SGR mouse report to the surviving shell\",\n \"an unrelated pane remains live\"\n ]\n }\n ]", - "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. Original scope text is retained as the exact suffix of coverageNotes/oracle; historical evidence is unchanged." + "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. Original scope text is retained as the exact suffix of coverageNotes/oracle; historical evidence is unchanged.", + "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." ], "demotionRule": "Keep experimental or demote if missing ownership proof changes incumbent behavior, a live TUI loses mouse/focus modes, foreground inspection enters ordinary output/reveal paths, or the focused Electron journey flakes without an identified product or harness fault." }, @@ -6209,7 +6180,7 @@ "providers": ["local", "daemon", "ssh", "runtime"], "coveredPlatforms": ["macos"], "coveredProviders": ["local", "daemon", "ssh", "runtime"], - "coverageNotes": "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. 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. Audit3323 (reconciled source audit3320) intentionally retires seven low-value renderer authority/retirement examples: retires one pane, clears resume authority, and rejects late status without harming siblings — Late status reviving a retired pane, sibling damage, or resume authority left behind.; can retire live pane authority while retaining its sleeping session — Retiring live authority accidentally dropping a retained sleeping session.; keeps a physical pane routed through chained detaches until its current owner closes — Chained detach alias routing broken after original owner closes, or alias survives final close.; forgets routing aliases for purged tabs — Purged-tab routing aliases lingering.; retires split, relay, deferred, and pending sessions for a parked tab — Split, relay, deferred or pending session omitted from teardown, sleeping-record sibling damaged, parked disposer skipped.; retires parked ownership before teardown and sweeps published state before unified close — Parked cleanup/provider teardown/state removal/sweep/unified-close ordering changes.; starts mixed provider teardown and classifies both rejection kinds after synchronous retirement — Mixed teardown failures blocking retirement, or local/runtime warning counts misclassified.. Remove the exact-pane-retirement and chained-detach assertion references because their source cases are gone. Other retained cases do not replace these alarms. Preserve all dated evidenceRuns and prior history with their original source scope; no fresh execution or historical import-closure equivalence 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): Audit1904 reduces persistence-pty-binding-reconciliation from six to four definitions, intentionally losing legacy remap-load and first-binding projection alarms. Current selector/testFile remains valid, with no selected-source assertionRef or active matching receipt. The six unchanged close/continuity receipts keep their exact original scope; no new broad gate or replacement evidence is claimed. Historical prior account (preserved verbatim): Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1674 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: 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: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Live macOS Electron tests prove exact local PTY disappearance after parked-tab close and detached-pgid descendant death after agent close. A deterministic final-pane interleaving now proves durable tab retirement commits before externally owned PTY teardown can publish graph loss, and preserves an unrelated live canary through duplicate exit retirement. Deterministic tests also cover final-pane CLI close durability and same-incarnation handle continuity; persisted-empty restart suppression remains historical Electron evidence, alongside replacement and hard graph-loss stale fencing, preallocated-handle supersession, daemon and SSH routing, local/daemon pending-snapshot ownership across natural exit, stale-root descendant-signal suppression, graceful-to-immediate kill upgrades, duplicate-kill completion sharing, locale-stable bounded/fresh/coalesced process-table reads, deadline-safe successor scans, cycle-safe linear descendant traversal, target-only escalation indexing, 32-wide bulk teardown, source-scan timestamp identity, same-second PID ambiguity, ordinary runtime close ownership, unified-only hydration, split ownership, pane detach transfer, restart alias hydration, and late-hook suppression; live Linux, Windows, WSL, SSH, and remote-runtime process evidence remains pending. A paired macOS Electron journey (real attached-window desktop host plus a separate real paired desktop client, isolated profiles) covers the inverse authority direction for host-created terminals: a renderer graph sync must not retire a tab that `orca terminal create` made. The retained paired journey covers the incident shape the real CLI produces - a repo's FIRST host-created terminal, since src/cli/handlers/terminal.ts sends no clientMutationId. The repeated target-after-unrelated-terminal journey was retired; its separate ordering alarm is no longer provided. An earlier reading of this gate called a preceding host-created terminal and a `clientMutationId` protective; main-process instrumentation refuted that. The renderer's stale session write deleted the host tab from persistence in every variant, and only the delete's timing relative to the measured sync differed, so those rows were false negatives of a single-sync oracle. The defect was in persistence: persistPtyBinding did not raise the repo's terminal topology fence for the first host-admitted tab, leaving the renderer's pre-create tab list free to replay over it. Elapsed time and paired-client mirroring never decided anything. A windowless `orca serve` parity arm runs the identical oracle and passes on both the merge-base and the branch, confirming that topology does not exhibit the defect (the gate it turns on is window-conditioned) and that making the host binding unconditional did not regress it. All of this is macOS-local only. The reported incident occurred on a physical Windows host; we did not run against one. The claim that the mechanism is platform-independent rests on the authoritative-window gate and publication-epoch inheritance being OS-agnostic, not on Windows evidence, so no ConPTY, Windows window-lifecycle, update, or sleep behavior is covered here. The synthetic default-tabs unit suite was retired: its explicit-empty/default-tab assertions no longer supply unit evidence. This retirement supplies no new persisted-restart, runtime-routing, cross-platform, or mobile evidence; existing historical runs and counts remain historical. The test-value audit removes the isolated re-retirement-token/epoch, activity-cutoff, idle-reattach and sibling-restore examples. The cited exact retirement and chained-detach cases remain unchanged, alongside closed-tab revival fencing and alias churn bounds. Their retained evidence is not equivalent coverage for every removed permutation; historical execution evidence is unchanged. The test-value audit removed shared-owner snapshot/cold-restore reference examples, a direct absent-tab PTY-index update, caller-supplied host-owned teardown boolean/no-dispatch, and a single local-provider rejection example. It also removed hand-built detach-retention comparator examples for different runs, handles, provider identities, and handle-less rows without independent identity ingress. Their specific snapshot, missing-tab, host-decision, rejection-count, and comparator alarms are lost. Current exact authority/ordering and chained-detach cases remain retained; they do not establish equivalent coverage for the removed examples. Historical commands, counts, results, and red-green narratives remain historical. The test-value audit retires terminals-explicit-empty-hydration.test.ts in full: its direct git/folder empty-tombstone assertions and literal-flag auto-create helper check are lost. The store test never mounted the initial-terminal effect or performed a persisted restart. The audit also removes terminal-tab-retirement.test.ts pure ownership/alias/routing plan inventories and sleeping-record map assertions; its former 100-tab scan-count case was subsequently retired too; no assertion remains in that suite. These retained and historical cases do not establish equivalent tombstone, default-create, provider teardown, cross-platform, or mobile coverage. Historical commands, results, counts, and red-green narratives remain historical. The subsequent test-value audit deletes the remaining terminal-tab-retirement.test.ts suite. Its 100-tab case asserted only returned plan count and one outer scan per ownership store; it never inspected per-tab plans or provider teardown. Those direct cardinality/work-count alarms are intentionally lost. Historical executed commands, results, counts and red-green narratives remain historical; no equivalent replacement or new runtime, platform or mobile evidence 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. Audit1392: src/main/agent-hooks/server-pane-authority.test.ts reduced. Retires one duplicate-transfer no-op listener count and latest pty/timestamp callback fixture. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "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. Audit 3959 retires the whole session.test.ts driver (27 authored / 33 finite cases): startup/echo filtering, readiness input gates, ownership confirmation, detach authority, and termination retry/exit ordering alarms are intentionally lost. No equivalent replacement or fresh runtime validation is claimed. 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. 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. Audit3323 (reconciled source audit3320) intentionally retires seven low-value renderer authority/retirement examples: retires one pane, clears resume authority, and rejects late status without harming siblings — Late status reviving a retired pane, sibling damage, or resume authority left behind.; can retire live pane authority while retaining its sleeping session — Retiring live authority accidentally dropping a retained sleeping session.; keeps a physical pane routed through chained detaches until its current owner closes — Chained detach alias routing broken after original owner closes, or alias survives final close.; forgets routing aliases for purged tabs — Purged-tab routing aliases lingering.; retires split, relay, deferred, and pending sessions for a parked tab — Split, relay, deferred or pending session omitted from teardown, sleeping-record sibling damaged, parked disposer skipped.; retires parked ownership before teardown and sweeps published state before unified close — Parked cleanup/provider teardown/state removal/sweep/unified-close ordering changes.; starts mixed provider teardown and classifies both rejection kinds after synchronous retirement — Mixed teardown failures blocking retirement, or local/runtime warning counts misclassified.. Remove the exact-pane-retirement and chained-detach assertion references because their source cases are gone. Other retained cases do not replace these alarms. Preserve all dated evidenceRuns and prior history with their original source scope; no fresh execution or historical import-closure equivalence 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): Audit1904 reduces persistence-pty-binding-reconciliation from six to four definitions, intentionally losing legacy remap-load and first-binding projection alarms. Current selector/testFile remains valid, with no selected-source assertionRef or active matching receipt. The six unchanged close/continuity receipts keep their exact original scope; no new broad gate or replacement evidence is claimed. Historical prior account (preserved verbatim): Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1674 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: 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: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Live macOS Electron tests prove exact local PTY disappearance after parked-tab close and detached-pgid descendant death after agent close. A deterministic final-pane interleaving now proves durable tab retirement commits before externally owned PTY teardown can publish graph loss, and preserves an unrelated live canary through duplicate exit retirement. Deterministic tests also cover final-pane CLI close durability and same-incarnation handle continuity; persisted-empty restart suppression remains historical Electron evidence, alongside replacement and hard graph-loss stale fencing, preallocated-handle supersession, daemon and SSH routing, local/daemon pending-snapshot ownership across natural exit, stale-root descendant-signal suppression, graceful-to-immediate kill upgrades, duplicate-kill completion sharing, locale-stable bounded/fresh/coalesced process-table reads, deadline-safe successor scans, cycle-safe linear descendant traversal, target-only escalation indexing, 32-wide bulk teardown, source-scan timestamp identity, same-second PID ambiguity, ordinary runtime close ownership, unified-only hydration, split ownership, pane detach transfer, restart alias hydration, and late-hook suppression; live Linux, Windows, WSL, SSH, and remote-runtime process evidence remains pending. A paired macOS Electron journey (real attached-window desktop host plus a separate real paired desktop client, isolated profiles) covers the inverse authority direction for host-created terminals: a renderer graph sync must not retire a tab that `orca terminal create` made. The retained paired journey covers the incident shape the real CLI produces - a repo's FIRST host-created terminal, since src/cli/handlers/terminal.ts sends no clientMutationId. The repeated target-after-unrelated-terminal journey was retired; its separate ordering alarm is no longer provided. An earlier reading of this gate called a preceding host-created terminal and a `clientMutationId` protective; main-process instrumentation refuted that. The renderer's stale session write deleted the host tab from persistence in every variant, and only the delete's timing relative to the measured sync differed, so those rows were false negatives of a single-sync oracle. The defect was in persistence: persistPtyBinding did not raise the repo's terminal topology fence for the first host-admitted tab, leaving the renderer's pre-create tab list free to replay over it. Elapsed time and paired-client mirroring never decided anything. A windowless `orca serve` parity arm runs the identical oracle and passes on both the merge-base and the branch, confirming that topology does not exhibit the defect (the gate it turns on is window-conditioned) and that making the host binding unconditional did not regress it. All of this is macOS-local only. The reported incident occurred on a physical Windows host; we did not run against one. The claim that the mechanism is platform-independent rests on the authoritative-window gate and publication-epoch inheritance being OS-agnostic, not on Windows evidence, so no ConPTY, Windows window-lifecycle, update, or sleep behavior is covered here. The synthetic default-tabs unit suite was retired: its explicit-empty/default-tab assertions no longer supply unit evidence. This retirement supplies no new persisted-restart, runtime-routing, cross-platform, or mobile evidence; existing historical runs and counts remain historical. The test-value audit removes the isolated re-retirement-token/epoch, activity-cutoff, idle-reattach and sibling-restore examples. The cited exact retirement and chained-detach cases remain unchanged, alongside closed-tab revival fencing and alias churn bounds. Their retained evidence is not equivalent coverage for every removed permutation; historical execution evidence is unchanged. The test-value audit removed shared-owner snapshot/cold-restore reference examples, a direct absent-tab PTY-index update, caller-supplied host-owned teardown boolean/no-dispatch, and a single local-provider rejection example. It also removed hand-built detach-retention comparator examples for different runs, handles, provider identities, and handle-less rows without independent identity ingress. Their specific snapshot, missing-tab, host-decision, rejection-count, and comparator alarms are lost. Current exact authority/ordering and chained-detach cases remain retained; they do not establish equivalent coverage for the removed examples. Historical commands, counts, results, and red-green narratives remain historical. The test-value audit retires terminals-explicit-empty-hydration.test.ts in full: its direct git/folder empty-tombstone assertions and literal-flag auto-create helper check are lost. The store test never mounted the initial-terminal effect or performed a persisted restart. The audit also removes terminal-tab-retirement.test.ts pure ownership/alias/routing plan inventories and sleeping-record map assertions; its former 100-tab scan-count case was subsequently retired too; no assertion remains in that suite. These retained and historical cases do not establish equivalent tombstone, default-create, provider teardown, cross-platform, or mobile coverage. Historical commands, results, counts, and red-green narratives remain historical. The subsequent test-value audit deletes the remaining terminal-tab-retirement.test.ts suite. Its 100-tab case asserted only returned plan count and one outer scan per ownership store; it never inspected per-tab plans or provider teardown. Those direct cardinality/work-count alarms are intentionally lost. Historical executed commands, results, counts and red-green narratives remain historical; no equivalent replacement or new runtime, platform or mobile evidence 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. Audit1392: src/main/agent-hooks/server-pane-authority.test.ts reduced. Retires one duplicate-transfer no-op listener count and latest pty/timestamp callback fixture. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", "motivatingLinks": [ "https://linear.app/stably/issue/STA-4327", "https://github.com/stablyai/orca/pull/14590", @@ -6218,12 +6189,12 @@ "https://github.com/stablyai/orca/issues/14524" ], "invariant": "Close permanently removes the owned provider session, agent descendants, persisted tab/layout authority, and resume authority even when no TerminalPane is mounted; final-pane CLI close commits durable tab retirement before PTY stop can publish graph loss, does not acknowledge before that retirement, and treats the later exit retirement as idempotent. Workspace-wide CLI close applies that same durable contract to every terminal in exactly one worktree, including pinned and persisted-only surfaces, without touching sibling-worktree PTYs or resume records. A persisted explicit-empty state prevents initial-tab fallback from repopulating the workspace after reload or restart. A handle remains valid while the same provider-attested PTY incarnation survives renderer reload or re-key, and becomes stale without adopting a replacement incarnation. A terminating id remains reserved through natural exit, duplicate callers await the same completion, and immediate teardown upgrades any graceful request without signalling a recycled PID or a descendant tree after root ownership is lost; process-table work is locale-stable, bounded, fresh for each post-start request, same-turn coalesced, and begins within the requesting caller's deadline, including bulk worktree cleanup; detach and park preserve ownership; aliases prevent a detached agent's immutable physical pane key from being retired with its former tab.", - "oracle": "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. 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. Audit3323 (reconciled source audit3320) intentionally retires seven low-value renderer authority/retirement examples: retires one pane, clears resume authority, and rejects late status without harming siblings — Late status reviving a retired pane, sibling damage, or resume authority left behind.; can retire live pane authority while retaining its sleeping session — Retiring live authority accidentally dropping a retained sleeping session.; keeps a physical pane routed through chained detaches until its current owner closes — Chained detach alias routing broken after original owner closes, or alias survives final close.; forgets routing aliases for purged tabs — Purged-tab routing aliases lingering.; retires split, relay, deferred, and pending sessions for a parked tab — Split, relay, deferred or pending session omitted from teardown, sleeping-record sibling damaged, parked disposer skipped.; retires parked ownership before teardown and sweeps published state before unified close — Parked cleanup/provider teardown/state removal/sweep/unified-close ordering changes.; starts mixed provider teardown and classifies both rejection kinds after synchronous retirement — Mixed teardown failures blocking retirement, or local/runtime warning counts misclassified.. Remove the exact-pane-retirement and chained-detach assertion references because their source cases are gone. Other retained cases do not replace these alarms. Preserve all dated evidenceRuns and prior history with their original source scope; no fresh execution or historical import-closure equivalence 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): Audit1904 reduces persistence-pty-binding-reconciliation from six to four definitions, intentionally losing legacy remap-load and first-binding projection alarms. Current selector/testFile remains valid, with no selected-source assertionRef or active matching receipt. The six unchanged close/continuity receipts keep their exact original scope; no new broad gate or replacement evidence is claimed. Historical prior account (preserved verbatim): Audit1683 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Audit1674 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Capture exact tab, pane, PTY, handle, incarnation, and persisted layout identities. Final-pane terminal.close must invoke one durability-acknowledged tab retirement before exact PTY teardown; controlled PTY exit and graph removal afterward must remain idempotent, omit the target from persistence and provider inventory, and leave an unrelated canary handle live. terminal.closeAll must force-retire every pinned and unpinned target surface, clear its persisted agent-resume and incarnation records, await authoritative PTY exit, preserve a sibling worktree's tab, PTY, and resume authority, and return an unverifiable failure instead of claiming exit when the owning host does not confirm a stop. The ordinary path stays pending until the persisted row is removed and never falls back to the fire-and-forget pane event; reload/restart must keep the explicitly emptied worktree at zero terminal tabs and provider sessions. Reloading the renderer with the same tab/pane/PTY/incarnation must keep the handle readable; changing only the incarnation behind the same PTY id, losing the authoritative graph, or superseding the renderer handle with a preallocated handle must reject the old handle with terminal_handle_stale. Parked-close tests prove the exact PTY disappears; descendant/process tests keep natural exits reserved, upgrade teardown safely, bound/coalesce process-table work, and protect recycled identities.", + "oracle": "Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. 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. 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. Audit3323 (reconciled source audit3320) intentionally retires seven low-value renderer authority/retirement examples: retires one pane, clears resume authority, and rejects late status without harming siblings — Late status reviving a retired pane, sibling damage, or resume authority left behind.; can retire live pane authority while retaining its sleeping session — Retiring live authority accidentally dropping a retained sleeping session.; keeps a physical pane routed through chained detaches until its current owner closes — Chained detach alias routing broken after original owner closes, or alias survives final close.; forgets routing aliases for purged tabs — Purged-tab routing aliases lingering.; retires split, relay, deferred, and pending sessions for a parked tab — Split, relay, deferred or pending session omitted from teardown, sleeping-record sibling damaged, parked disposer skipped.; retires parked ownership before teardown and sweeps published state before unified close — Parked cleanup/provider teardown/state removal/sweep/unified-close ordering changes.; starts mixed provider teardown and classifies both rejection kinds after synchronous retirement — Mixed teardown failures blocking retirement, or local/runtime warning counts misclassified.. Remove the exact-pane-retirement and chained-detach assertion references because their source cases are gone. Other retained cases do not replace these alarms. Preserve all dated evidenceRuns and prior history with their original source scope; no fresh execution or historical import-closure equivalence 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): Audit1904 reduces persistence-pty-binding-reconciliation from six to four definitions, intentionally losing legacy remap-load and first-binding projection alarms. Current selector/testFile remains valid, with no selected-source assertionRef or active matching receipt. The six unchanged close/continuity receipts keep their exact original scope; no new broad gate or replacement evidence is claimed. Historical prior account (preserved verbatim): Audit1683 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Audit1674 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Capture exact tab, pane, PTY, handle, incarnation, and persisted layout identities. Final-pane terminal.close must invoke one durability-acknowledged tab retirement before exact PTY teardown; controlled PTY exit and graph removal afterward must remain idempotent, omit the target from persistence and provider inventory, and leave an unrelated canary handle live. terminal.closeAll must force-retire every pinned and unpinned target surface, clear its persisted agent-resume and incarnation records, await authoritative PTY exit, preserve a sibling worktree's tab, PTY, and resume authority, and return an unverifiable failure instead of claiming exit when the owning host does not confirm a stop. The ordinary path stays pending until the persisted row is removed and never falls back to the fire-and-forget pane event; reload/restart must keep the explicitly emptied worktree at zero terminal tabs and provider sessions. Reloading the renderer with the same tab/pane/PTY/incarnation must keep the handle readable; changing only the incarnation behind the same PTY id, losing the authoritative graph, or superseding the renderer handle with a preallocated handle must reject the old handle with terminal_handle_stale. Parked-close tests prove the exact PTY disappears; descendant/process tests keep natural exits reserved, upgrade teardown safely, bound/coalesce process-table work, and protect recycled identities.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/terminal/surface/orca-runtime-terminal-close-continuity.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts", "pnpm dlx node@24 ./node_modules/vitest/vitest.mjs run --config config/vitest.config.ts src/main/agent-hooks/server/testing/authority/server-pane-authority.test.ts src/main/ipc/agent-hooks.test.ts src/main/ipc/agent-pane-authority-ownership.test.ts src/main/persistence/terminal-topology/persistence-pane-identity-migration.test.ts src/main/persistence/terminal-topology/persistence-pty-binding-reconciliation.test.ts src/renderer/src/store/slices/agent-status/agent-pane-authority.test.ts src/renderer/src/store/terminals/terminal-pane-detach-agent-identity.test.ts src/renderer/src/store/terminals/terminal-tab-retirement-store.test.ts src/renderer/src/components/shared/kill-all-terminal-surfaces.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/pty/process-retirement/pty-descendant-termination.test.ts src/main/daemon/sessions/testing/session.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/pty/process-retirement/pty-descendant-termination.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts", "pnpm run test:e2e -- tests/e2e/terminal-tab-close-restart-persistence.spec.ts --workers=1", "pnpm run test:e2e -- tests/e2e/terminal-parked-close-retirement.spec.ts --workers=1", "pnpm run test:e2e -- tests/e2e/agent-descendant-process-kill.spec.ts --workers=1", @@ -6239,7 +6210,6 @@ "src/main/persistence/terminal-topology/persistence-pane-identity-migration.test.ts", "src/main/persistence/terminal-topology/persistence-pty-binding-reconciliation.test.ts", "src/main/pty/process-retirement/pty-descendant-termination.test.ts", - "src/main/daemon/sessions/testing/session.test.ts", "src/main/daemon/terminal-host/testing/terminal-host.test.ts", "src/main/providers/local-pty/local-pty-provider-shutdown.test.ts", "src/main/runtime/workspaces/removal/worktree-teardown.test.ts", @@ -6361,6 +6331,10 @@ "Add restart/no-resurrection and repeated park-close soak coverage." ], "knownGaps": [ + "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.", + "Audit3814 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle from a Codex ready prompt even when stale startup lines remain :: Stale MCP startup lines must not block a later Codex ready header.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle when a stale Codex prompt is followed by the ready header :: A Codex ready header following a stale resume prompt must satisfy tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for an idle Cursor lane past its dismissed trust dialog (#8210) :: Later Cursor idle banner overrides retained trust dialog.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not block a mid-run Cursor lane on its dismissed trust dialog (#8210) :: Dismissed trust dialog must not report blocked for later busy Cursor; wait times out.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not classify unrelated press-enter prompts as Codex blocked prompts :: Unidentified press-enter text must time out rather than be classified Codex blocked.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for quiet background PTY agents without OSC titles :: Quiet Codex background terminal without OSC title eventually resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: sends agent prompts as bracketed paste before submit :: Driving prompt escapes embedded paste-end ESC, writes one framed paste then CR, and counts bytes.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: settles a foreground Codex prompt when launch metadata has not arrived :: Codex inferred from foreground without launch metadata waits for composer marker/quiescence before one CR.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: gives a late Codex render marker a fresh quiescence window :: Marker arriving at7.9s re-arms fresh quiet window instead of submitting at initial cap.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: writes large agent prompt paste frames atomically before delayed submit :: A prompt larger than input chunk budget is a single paste write before delayed CR with exact byte count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects oversized terminal.send text before provider writes :: Oversized ordinary terminal.send rejects input-too-large before any provider write.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects focusing an exited background terminal session :: focusTerminal refuses terminal_exited before invoking background reveal.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: pastes the same bytes the desktop draft paste sent for the prompt :: Launch-ready prompt normalizes CR/LF and renders embedded ESC visibly identically to desktop bracketed paste.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: keeps a prompt into a running agent behind the render settle, as before :: Driving prompt remains held through7s repaint activity then submits once by9s.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reports a queued PTY focus as not navigated when its notifier disappears :: Queued PTY focus and completed active reveal report not navigated after notifier removal; no second reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: does not invoke a stale graph-leaf focus notifier after queued PTY work :: Queued graph-leaf focus must not invoke old notifier after preceding PTY reveal and notifier removal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: paginates retained terminal output with explicit limits and truncation metadata :: Preview120lines, fractional limits,50/200 pages, retained2000line truncation and future-cursor metadata stay consistent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: falls back to renderer visible screen when uncursored TUI tail is blank :: Substantial blank uncursored tail uses mounted renderer visible screen with zero scrollback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reads and shows the runtime-owned alternate-screen grid without serialization :: Actual runtime alternate-screen grid provides read/show content without renderer/provider serialization.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: classifies older provider alternate-screen snapshots from ANSI :: Older provider without alternateScreen metadata classifies ANSI alternate entry and returns Remote Vim screen.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: honors the last ANSI screen transition when older provider metadata is absent :: Last ANSI alternate exit overrides earlier entry when explicit provider mode metadata is absent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: rejects a full provider screen frame after live output advances :: Live output arriving during second full-screen capture causes screen-unavailable rather than stale full frame.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: shares one provider snapshot between concurrent read and show calls :: Concurrent read/show share one successful provider snapshot and both receive Shared TUI content.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps cursor reads provider-free on restored alternate-screen PTYs :: Restored alternate-screen cursor transcript reads never acquire provider snapshot.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: backs off after a provider snapshot failure instead of retrying for show :: Failed provider capture is cached/backed off so later show does not retry.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: falls back once to a mounted renderer when a known alternate provider fails :: A known-alternate failed provider capture falls back exactly once to newly mounted renderer.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: bounds provider visible frames for read and show responses :: Provider visible read/show use six bounded lines and300character preview.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps renderer-fallback composer drafts separate from terminal output :: Renderer fallback strips dim composer draft from terminal output and exposes draft separately.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: does not use renderer visible-screen fallback for a short blank shell tail :: Two blank shell lines must not trigger renderer screen fallback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: trims terminal tail character budget without per-line array shifts :: Tail builder trims to256KiB with correct retained suffix and no Array.shift calls.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains ANSI-only status redraws instead of appending every frame :: Repeated erase/redraw replaces preview until newline then publishes one completed cursor row.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains split multi-line ANSI footer redraw state across chunks :: CUU state across chunks retains corrected footer rows and publishes new cursor entries.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not let stale lower rows hide earlier corrected footer rows from cursor reads :: Earlier corrected footer row must not be hidden by stale lower rows in cursor reads.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: bounds completed transcript entries from a single multi-line redraw chunk :: Single redraw chunk bounds completed transcript to2000retained lines and correct oldest/next/latest cursors.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains multi-line ANSI redraws when the last footer row stays partial :: Partial final redrawn row appears in preview but cursor sees it only after newline.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not retain split ANSI controls as visible terminal preview text :: Split color/mode escapes never leak preview fragments; long split OSC title truncates at MAX_OSC_TITLE_CHARS.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains same-line redraw cursor position across split full-line erase chunks :: Full-line erase preserves column across chunks so XY follows three spaces rather than old ABC.\nsrc/main/runtime/orca-runtime-tests/conpty-stream-read.spec.ts :: fills the requested line count even when blank rows sit below the prompt :: Blank rows below a ConPTY prompt must not consume the requested nonempty-line count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: does not retain split ST-terminated string controls as preview text :: Split ST-terminated Kitty/string controls must remain excluded from preview text.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects split OSC titles before retaining terminal previews :: Split BEL OSC title must update working title/status without leaking into preview.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects ST-terminated OSC titles split before the final backslash :: ST OSC split before final backslash must update title without leaking framing.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: preserves a trailing escape after a completed OSC title :: Completed OSC followed by pending ESC must preserve the next idle-title transition.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: seeds newly synced leaves from PTY pending ANSI state :: A newly synced graph leaf inherits pending ANSI so a split color fragment cannot leak.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: bounds retained partial terminal output before preview reads :: Partial terminal state stays capped at 4000, preserves retained array identity, and preview truncation/cursor output remains correct.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: submits the mail pointer to Cursor Agent only after the paste-burst delay :: Cursor mailbox pointer Enter must wait through the paste-burst delay; this is a real input-timing alarm intentionally retired.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts :: adopts a v1.4.150-shaped agent, setup, and shell orphan as one topology transaction :: Stale incarnation refuses without topology change; three agent/setup/shell lanes adopt atomically with layout/group/revision and preserved read/input/resize; exact replay is idempotent and competing owner refuses.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: retires the exact worker when it exits after renderer reveal :: Exact worker exit after reveal retires that worker and its surface.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: re-reveals a recovered worker after the renderer graph epoch changes :: Changed renderer graph epoch invalidates reveal receipt and forces another reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: defers recovery when the renderer omits the exact reveal identity :: Missing exact reveal identity defers recovery after two attempts.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: reconciles a same-id process replacement before headless adoption :: A process replacement before headless adoption must fence off stale ownership.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retires provider resume only after authoritative inventory proves the legacy PTY exited :: Authoritative owning-host inventory overrides false local hasPty, avoids SSH scanning, retires exited provider resume/surface, adopts live workers without headless reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retries inventory and unknown liveness without revealing a ghost worker :: Inventory failure and unknown liveness must retry without ghost reveal, eventually adopt, and stop retrying.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: refuses a live reserved pane before issuing a handle or revealing it :: A requireFreshPane launch receiving a live reserved owner must reject before handle/reveal/kill, and release its claim. No equivalent replacement claimed.", + "Audit3806 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: skips a listener unsubscribed mid-fan-out even with mobile exclusions active :: A listener removed by an earlier listener during one fanout is not called, including with a side-effect-excluded mobile listener present.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: retains bytes emitted before a fresh daemon spawn resolves :: Bytes and title arriving before an initial zero/reset provider response survive in the serialized headless buffer with their counted sequence.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits command-finished facts with best-effort exit codes across chunk splits :: A split OSC133 D exit code becomes130 and a missing code becomes null in ordered command-finished facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits pr-link facts once per URL with batch attribution :: A split GitHub PR URL yields42 rather than4, emits42/43 once each, and carries PTY/worktree/tab attribution.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits 2031-subscribe facts across chunk splits :: Split ESC[?20 then31h emits exactly one2031-subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: restores a provisional 2031 subscribe when daemon scan authority returns :: Returning daemon scan authority with partial scan seed and pending2031 subscription restores exactly one subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers the tracked title over the renderer snapshot lastTitle :: A synthetic live Cursor title overrides stale renderer lastTitle while preserving renderer snapshot source.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers provider history over a partial headless mirror for requested snapshots :: Authoritative requested snapshots return supplied provider frame/history/seq rather than a partial headless mirror, requesting5000rows.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: tracks live alternate-screen transitions after a provider snapshot :: Provider alternateScreen true is accepted, then live1049l/1049h update isTerminalAlternateScreen false/true.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: translates reset provider snapshots without retaining the old title :: A reset provider snapshot translates new local seq into the runtime domain and replaces Old process title with New process.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits the chunk agentStatus events before its side-effect batch :: Agent status callback precedes side-effect batch callback for one coalesced OSC9999/title/bell chunk.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: still emits a throwing chunk’s facts under its own seq, not the next chunk’s :: A tracker throw still flushes first chunk title facts under its own seq, and second chunk does not inherit those facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: seeds the lazily created tracker from the daemon-snapshot title :: A lazy tracker hydrated from renderer snapshot title Codex working emits agent-idle on later Codex done.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits command-code-working facts only after the banner arms the scrape :: Unarmed Thinking text emits no facts; a Command Code0.27.3 banner then hardcoded colored spinner text emits attributed command-code-working with the submitted prompt.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits a command-code-done fact when the idle composer returns :: After hardcoded banner/working text, returned idle composer emits command-code-done with the earlier submitted prompt.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: resizes the headless mirror after an accepted desktop PTY resize :: An external accepted resize produces the resized dimensions and same status-frame lines as a separately driven reference emulator.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: replaces suffix-only headless state with the recovered renderer snapshot :: Replacing suffix-only state removes old suffix, retains renderer history plus later output/cwd, and returns the live47x40PTY grid.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: stamps SSH connection identity on runtime terminal status :: A synthetic mounted-leaf OSC9999 status after registerPty carries the supplied SSH connectionId.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: does not retain WSL context when a PTY id is reused :: After exit and same-ID new null distro context, OSC7 file://server/share/repo uses UNC server path rather than old Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: preserves immutable context while a live daemon attach is unresolved :: preparePtyExecutionContext with preserveExisting refuses a supplied Debian replacement and subsequent OSC7 keeps original Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts :: projects frame-independent live state through main buffer snapshots :: Main-buffer snapshot puts focus-report/cursor-visibility modes in frameRestoreAnsi, excludes STATIC-FRAME there and includes it in data.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.ts :: continues terminal agent status fanout when a callback throws :: Throwing on the first status callback does not prevent second payload delivery and logs contextual error.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: returns a title-only replay snapshot and never historical attention :: Lose replay:true/title-only fact projection despite earlierbell and unknownPTYnull. No actual delivered-history notification or reattach behavior was exercised. No equivalent replacement claimed.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects a handle rebind while a controller-less status check yields :: A handle rebound while the null-controller status continuation yields must throw terminal_handle_stale.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects confirmation evidence when the owning PTY exits :: A pending strong confirmation resolving after owning PTY exit must reject terminal_exited.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-03.spec.ts :: keeps ordinary terminal send suffix failures on the existing not-writable contract :: Ordinary send writes text but refused CR must throw terminal_not_writable with beforeWrite twice and afterWrite once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell the execution host cannot apply instead of spawning its default :: Requested Windows shell on POSIX must refuse before spawning a default shell.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: quotes the agent startup command for the requested shell, not the host default :: Requested cmd shell must override PowerShell default quoting for agent startup command.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: keeps restored receipts outside a targeted worktree scan :: Targeted scan removes the moved-worktree receipt while preserving another worktree receipt.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: observes setup command completion without waiting for its interactive shell to exit :: Nonzero completion marker 17 resolves while interactive shell remains running.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: falls back to setup terminal exit when no completion signal is available :: Setup completion observer without token falls back to actual exit code 9.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: cancels setup completion observation when the caller aborts :: Abort rejects with the original reason and unsubscribes once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps observing after an uncertain setup terminal status :: Unknown exit waiter result must leave observation pending until completion marker arrives.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh omits a record :: Controller inventory omission disconnects the record but preserves its retained transcript.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh times out :: Hung inventory timeout leaves connected record and retained transcript intact.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle for adopted background PTY handles from the renderer title :: An adopted background handle resolves tui-idle from ready Codex renderer title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves live-leaf tui-idle from an OpenCode native title :: A live leaf resolves tui-idle from an OpenCode native title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from a Codex ready prompt preview :: A supplied Codex prompt preview resolves tui-idle without an actual agent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from an Antigravity prompt before the model line :: A supplied Antigravity prompt before model line resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell with no workspace instead of creating a default-shell tab :: Workspace-less explicit shell must reject before renderer default-tab request or spawn. This real guard/wiring alarm is deliberately retired.", + "Audit3798 per-case accepted losses:\nsrc/main/runtime/orca-runtime-tests/paired-settings.spec.ts :: awaits navigation-only updates from paired clients (%s) :: Updating only claudeSubagentNavigationEnabled waits for the actual controller call to the supplied pending Claude-view reconcile for both on/off values.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: drops a client page record even when its close command cannot be issued :: A removed workspace loses its runtime client-page record and headless browser projection despite close delivery_required rejection, and emits the asynchronous warning.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: leaves client-hosted pages alone when another host still owns the same worktree id :: Removing runtime:env-b metadata with local ownership leaves the local same-ID client page unchanged and issues no close command.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: marks live bindings again when reopening after a promoted window closes :: A reopened window marks its still-registered live worktree in activeWorktreeIdsOnShutdown after the first promoted window closes.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: preserves live SSH session identities when promoting a headless runtime :: Headless-to-desktop promotion records active worktree, SSH connection and remoteSessionIdsByTabId from the supplied surviving SSH PTY/session.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores a surviving renderer when its reload is cancelled :: A sole ready renderer reload cancelled under its current renderer fence returns true and becomes ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores headless authority when desktop promotion navigation is cancelled :: A cancelled desktop promotion with headless recovery returns false while headless authority remains ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: moves a desktop graph to unavailable when its reload times out :: A ready desktop graph without a headless fallback becomes unavailable at the reload deadline and retains its window/epoch.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: recovers a failed headless promotion and accepts a later renderer generation :: A promotion failure restores ready headless authority; a later valid same-window graph publishes ready desktop authority.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: clears a failed pane recovery so a later reconnect can retry :: After relay_reconnecting rejection, the pending recovery lock clears and the same pane/handle can call createTerminal a second time and return its supplied replacement.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: still preserves a CLI agent leaf when the reloaded renderer has not rebound its PTY :: An empty graph published during renderer reload preserves a preallocated live CLI PTY as one listable terminal before renderer rebind.\nsrc/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts :: keeps a no-incarnation handle across an in-graph pane remint :: Within one graph lifetime an unversioned PTY reminted onto another leaf retains its issued handle and resolves its old exit waiter after onPtyExit.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: matches explicit-id cwd PTYs when the resolved worktree cache is incomplete :: An explicit target absent from a fresh incomplete resolved cache adopts only its cwd PTY, rejects nested cwd PTY and does not rescan Git.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: ignores cwd-only controller PTYs for malformed explicit worktree IDs :: Malformed id:repo-1:: returns no terminals, does not adopt cwd-only controller PTY and avoids Git rescanning.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: refuses an SSH-backed create for mobile/runtime callers instead of creating locally :: Loss of this public unserved SSH create error-class/no-local-add/no-local-list alarm.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: records an app-selected parent workspace as a manual action :: Loss of the local runtime folder-parent manual origin, active-workspace source and explicit confidence projection alarm; no claim that SSH or cleanup coverage replaces it.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: browses runtime server directories before projects are added :: Loss of this public runtime alarm for browse availability before registration, directories-first lexical ordering and native path flavor.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: lists drive roots for a server-root browse :: Loss of the Windows public slash-root drive enumeration smoke and presence of the temporary directory drive.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations-part-02.spec.ts :: creates a missing runtime parent before creating the project directory :: Loss of this runtime createRepo recursive missing-parent/child existence and registered-path alarm.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: preserves selected project %s when a hosted parent is known :: Loss of both parent-selected and origin-selected normal fork-link projection/persisted upstream alarms plus exact single-probe count.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: links a current enterprise remote despite unavailable metadata and a retained %s :: Loss of normal current-enterprise-origin linking with stale automatic GitHub avatar or protected file image, unchanged icon assertion, and serialized project identity under unavailable metadata.", "Audit2145 accepts removal of canned runtime metadata/guard/forwarding, fake in-memory persistence, private work-count and wrapper-duplication tests from the construction/orca-runtime.test.ts aggregate, plus the two automation run-context guards from runtime-workspace-launch-contracts.test.ts. Retained race, framing, physical completion and ownership callbacks remain byte-identical. Existing commands remain valid selectors; historical receipts stay unchanged and provide no fresh validation or replacement coverage for the reduced suites.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/main/runtime/construction/orca-runtime.test.ts: remove only literal registration import/call pairs await import('../orca-runtime-tests/worktree-setup-and-startup.spec'), await import('../orca-runtime-tests/gitlab-and-pr-bases.spec'); no additional authored credit. src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts: routes tab switch and capture start by explicit page id; accepts focus on tab switch without altering bridge args (focus is main-side concern); keeps terminal cwd resolution fail-soft when the provider is unavailable. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts: drops the bounded scan cache when orphan-cleanup removal completes; clears optimistic reconcile tokens when a CLI worktree removal succeeds; emits drift without mutating when the fetched base fast-forwards created HEAD; emits base_changed without mutation when the fetched base rewrote history; skips stale-token reconciles without mutating or emitting stale status; emits unknown without mutation when fetch fails or the base ref is missing. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts: routes runtime preserved-branch force-delete through the selected WSL project runtime; replies to a waiting client with the error of a delete that fails after acceptance; treats forced runtime deletion of an already-missing unregistered worktree as cleanup; treats normal runtime deletion of an already-missing unregistered worktree as cleanup. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts: warns that a missing-repo removal only forgot the workspace; restores runtime watchers when CLI worktree deletion fails after teardown; does not re-spend the drain budget on a removal after a wedged install was abandoned; routes runtime worktree removal through the selected WSL project runtime; force-deletes a branch that was preserved by runtime worktree removal. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts: records GitLab pasted-project recents only after successful runtime lookup; threads explicit origin preference through runtime WSL PR base resolution; resolves local GitLab fork MR bases from the target project MR head ref; captures the fork MR head from a dedicated ref, not the shared FETCH_HEAD; keeps the durable MR head when the head fetch fails but the local ref resolves; routes runtime GitLab fork MR base git calls through the selected WSL project runtime. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts: passes SSH connection ids through GitLab task operations; routes runtime GitLab issue, MR, work-item, and todo actions through the selected WSL project runtime; routes runtime GitLab MR details, review-management, job, and pasted URL actions through the selected WSL project runtime; normalizes runtime GitLab issue list arguments like the desktop IPC path. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts: does not warn when setup is explicitly skipped for CLI-created worktrees; puts the agent a create starts in the first default tab, as the window does; keeps the 8s main-runtime startup readiness budget for agents without an override; gives OpenCode the 20s main-runtime startup readiness budget; launches explicit startup agents with prompts for CLI-created worktrees. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts: returns a setup launch payload for CLI-created worktrees when hooks are explicitly enabled; does not hand the window a setup main never tried to start; passes the selected Windows setup shell into runtime runner generation; follows normal setup policy for CLI-created worktrees without activating them; uses returned WSL setup shell metadata when runtime spawns setup; uses the shell-aware setup runner for windowless creates without a startup command; reports the in-process setup hook as running when nothing can launch the runner. src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts: coalesces two clients sleeping the same host worktree; stops exactly the expected live PTYs for a worktree; explains a refused workspace close instead of throwing the raw refusal enum. src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts: marks the desktop-active worktree as isActive; includes SSH-backed worktrees in the mobile worktree summary; caches repeated malformed path misses before normalizing them again. src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts: keeps title-only foreground work ahead of monitoring in another pane; keeps a local hook row while a connected PTY still backs its pane; keeps an OSC row via its connected PTY after the pane binding is cleared. src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts: resolves files through a source-visible linked-checkout worktree; marks saved session tabs with live PTYs as host sidebar activity; attributes live legacy PTYs from saved layout bindings when their panes are hidden; marks saved browser tabs as host sidebar activity like desktop; falls back to the path-keyed GitHub cache entry; includes folder workspaces in compact worktree summaries for mobile; attaches inline agent rows from the latest OSC 9999 status; projects monitoring over a title-derived working status. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts: pushes to an idle pane when the only live waiter filters out the message type; resolves a registered waiter without PTY-injecting when the leaf is already idle; keeps already-idle status after tui-idle wait for immediate message delivery; resolves message waiters when notifyMessageArrived is called; does not resolve type-filtered message waiters for unrelated message types; removes message waiter abort listeners after message arrival; resolves message waiters on timeout when no message arrives. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts: delivers pending mail via notifyMessageArrived when the recipient is already idle; does not keep retrying when every pending row was already pointed; repoints pending rows restored with a live-idle coordinator. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts: rolls back a half-created terminal whose surface never publishes. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts: rejects startup prompts for agents that require post-ready stdin; uses portable Unix quoting for mobile agent launch commands in WSL project runtimes; keeps PowerShell quoting for mobile agent launch commands in Windows host runtimes; uses cmd.exe quoting for mobile agent launch commands in local Windows host runtimes; publishes headless mobile session agent identity with synthesized PTY status; rejects disabled mobile session agent launches before spawning; validates mobile terminal insertion anchors before resolving agent launch commands. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts: coalesces a reconnect close burst onto one authoritative PTY inventory; keeps an explicit user close destructive while the PTY is live; builds mobile session agent launch commands on the runtime host; injects mobile quick-command prompts into the host-built agent startup command. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts: closes persisted headless terminal parents before any prior list call; tears down a serve-owned headless tab on close while a renderer is attached so it cannot resurrect; defers a renderer-published pending tab to the renderer instead of tearing it down; returns a delegated close outcome with no selection tombstone when the renderer owns the outcome; tears down a runtime pending shell the renderer never adopted on close. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts: materializes a plain shell when the pending tab has no launch agent; hydrates legacy persisted terminal tabs without layout entries; reads and indexes the full agent-status snapshot once per mobile projection; kills persisted SSH PTYs when closing hydrated headless tabs before pane metadata is restored; materializes hydrated pending headless terminals with the persisted session identity. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts: hydrates a persisted SSH-owned pane before an attached renderer publishes its graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts: publishes the desktop's tab name over the live agent title, and the live title without one; uses fresh neutral PTY titles over stale mobile snapshot and OSC titles; operates PTY-backed mobile session terminals without a renderer graph; reuses pane close for live PTYs that do not own a renderer tab; lists PTY-backed mobile session terminals without a renderer graph; shows and resolves active PTY-backed mobile session terminals without a renderer graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts: creates mobile session terminals for folder workspaces in a headless runtime server; spawns fresh headless SSH mobile session terminals instead of reattaching synthetic local ids; hydrates headless mobile session terminals from the host workspace session; keeps live headless mobile session terminals when a desktop renderer publishes without them; publishes laptop-created remote runtime split terminals to phone session tabs. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts: does not report headless wake degradation without sleeping records; does not wake slept agents for non-mobile session-only activation; does not rewrite unread metadata when a mobile activation finds the worktree already read; returns unread:false from worktree.ps after a mobile activation clears the flag; materializes pending mobile session terminals without focusing desktop clients; closes browser mobile session tabs when addressed by browser workspace id. src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts: resolves mobile terminal surfaces by exact split leaf; closes the matching mobile terminal UUID leaf without closing the whole tab; closes the whole mobile terminal tab when addressed by parent tab id; activates the active split leaf when addressed by parent tab id; clears unread metadata on mobile worktree activation without focusing desktop clients; wakes slept agents on the host renderer when a phone activates a worktree. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts: publishes the hook provider session on a headless mobile tab so native chat can address the transcript; recovers the agent type from the hook row when the pane was launched without an agent hint; reads one agent-status snapshot per projection, not one per terminal tab; waits for unknown-launch foreground owner before publishing Pi-compatible mobile status; keeps Pi-compatible mobile session status as Pi for an unknown-launch foreground pi PTY; keeps renderer-vetted mobile agent status for custom-titled terminals. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts: publishes terminal surface agent status for paired web clients; preserves authoritative OMP identity for Pi-compatible remote terminal snapshots; normalizes a remote OMP title without republishing omitted launch identity; skips the foreground-process probe when the PTY launch agent is already known; probes the foreground process only on a status transition for unknown launch agents; passes the client signal and the slept-worktree refusal to the spawn. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts: does not use stale runtime-created PTY status when a neutral PTY title exists; recognizes runtime-created Codex PTY handles from the ready prompt; recognizes runtime-created Antigravity PTY handles from the ready prompt; recognizes live leaf Antigravity terminals from the ready prompt; recognizes a later Antigravity header with a prompt but no model line; keeps mobile terminal surfaces visible while their leaf handle is pending. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts: lets Claude agents management titles clear stale runtime-created title status; does not recognize live Claude agents panes from a Claude foreground process; does not let stale tab-level agent titles override current neutral pane titles; lists live terminals with fresh pane titles over stale tab titles; lets adopted neutral pane titles use non-shell foreground fallback; lets adopted neutral pane titles retry wrapper foregrounds until recognized; authorizes settled CLI prompts only after positive %s foreground identity; does not recognize arbitrary foreground TUIs as running agents; lets live neutral pane titles retry wrapper foregrounds until recognized; lets current Claude agents PTY titles override stale runtime-created OSC titles; does not let stale Claude agents OSC titles suppress current PTY title activity. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts: keeps preallocated terminal handles valid across renderer reloads; preserves runtime-created PTY process identity after graph unavailable; keeps prompt bindings fenced across runtime restarts without provider incarnation; recognizes runtime-created PTY handles with agent launch titles; does not treat a bare Cursor Agent native title as a running agent session; uses stale runtime-created PTY status when there is no title or foreground evidence. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts: keeps orphaned list and show writability aligned with the send gate. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts: cancels a coalesced SSH worker recovery retry when its provider disconnects. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts: retries renderer reveal before clearing an adopted legacy worker sleeping record. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts: recovers exported ORCA_TERMINAL_HANDLE from discovered live PTY sessions. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts: applies ANSI erase-from-start line controls in retained previews; applies ANSI stripping for private or intermediate CSI line controls; applies ANSI stripping for unsupported erase-line modes; reveals an agent terminal under the pane the caller reserved; keeps a fresh %s pane host-owned when a desktop window is available; keeps desktop publication %s separate from the reserved host spawn; mints its own pane when the reserved leaf is malformed, and reports the one it used; starts an agent terminal with the model the caller picked; starts an agent terminal without a model flag when no pick was made; attributes a startup-agent launch named %s as %s; attributes a fresh agent session the host builds as unknown; leaves a bare agent command the user typed out of launch attribution. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts: trims oversized terminal output bursts without per-line array shifts; builds terminal previews without mapping the full retained tail; keeps recent PTY replay output capped without needing previous data for large chunks; applies terminal redraw controls before retaining previews; applies ANSI terminal redraw controls before retaining previews; retains multi-line ANSI footer redraws instead of appending old frames; keeps the cursor column when erasing full lines in multi-line redraws; applies ANSI split redraw controls without leaking raw params. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts: returns renderer visible screen lines through terminal.read RPC JSON result; separates composer drafts from provider-owned terminal screens. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts: reports an in-flight PTY focus as not navigated when its notifier disappears; reports graph-leaf focus as not navigated without a host notifier; grounds the provider mode tracker before a later chunk, in the emulator order; grounds an in-flight provider snapshot capture so it cannot publish the pre-reset screen; waits for terminal exit and resolves with the exit status; keeps terminal read payloads bounded while retained output remains pageable; trims terminal read preview character budget without per-line array shifts. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts: submits a silent Claude composer once after the bounded render fallback; chunks large terminal.send text before provider writes; yields chunked terminal input through immediates between writes; yields while validating accepted large terminal.send text before provider writes; reveals a background terminal session when focusing its handle; replays captured launch config when focusing a background agent session; reveals background terminal sessions with the freshest PTY title; renames background terminal handles without requiring a visible tab; keeps a background terminal handle stable while reveal adoption is racing. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts: resolves tui-idle when a stale Codex prompt is followed by Antigravity readiness; returns an agent-neutral blocked wait result for update prompts; returns an agent-neutral blocked wait result for workspace trust prompts; returns an agent-neutral blocked wait result for cwd selection prompts; returns a blocked wait result for Codex model migration prompts; returns a blocked wait result for Codex startup hook review prompts; returns an agent-neutral blocked wait result for generic interactive prompts; splits text and enter writes for background terminal handles; types the lead line for %s: %s; submits through the agent-specific PTY timing policy for %s. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts: waits for exit on background terminal handles; keeps retained PTY transcript memory when controller refresh fails; resolves tui-idle from an Antigravity ready prompt preview; resolves Antigravity ready prompts with newline-heavy pasted tails without splitting; resolves live-leaf tui-idle from an Antigravity ready prompt preview. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts: spawns the available Qoder command for a captured same-session resume: %s; does not use the local Windows shell setting for remote Windows bare agent creates; matches canonical bare agent commands when a command override is configured; keeps non-bare agent command terminal creates unchanged; keeps disabled bare agent command terminal creates unchanged; injects runtime hook receiver env into terminal sessions; creates background terminal sessions for a $label; creates background terminal sessions for a $label; enables Claude Agent Teams only for direct Claude launches when configured in-process; reveals Claude Agent Teams launches with the rewritten launch config; preserves Claude Agent Teams for sequenced Claude launches. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts: creates visible terminal sessions without asking the renderer to focus a tab; asks the pty controller for the requested shell instead of a startup command; knows the agent a flagged launch command names before any process read; retires a flagged command pane identity when the command exits; retires only receipted restored PTY authority on command completion and exit; forgets synthetic handles when disconnected PTY records are pruned. src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts: returns OSC titles from headless main terminal snapshots; adopts renderer-seeded titles into headless main terminal snapshots; returns cwd metadata from seeded headless main terminal snapshots; adopts OSC7 host metadata from seeded headless terminal scrollback; falls back to the renderer snapshot for hidden-output recovery without headless state; keeps an empty headless snapshot authoritative for hidden-output recovery; advances the absolute output sequence across a daemon stream gap; emits explicit OSC 9999 agent status from runtime PTY data. src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts: falls back to the provider snapshot for a restored PTY with no mounted renderer; falls back to the available mirror when authoritative provider history is unavailable; keeps an empty renderer snapshot when the provider has no retained content; keeps restored provider history authoritative after later live output; uses provider alternate-screen state while a partial model is unsafe; prefers the tracked title over the headless emulator lastTitle; keeps the cursor-agent literal in record-fallback snapshots only without a tracker title; touches mobile snapshots once for decorative spinner ticks, again on idle. src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts: creates a same-repo PR branch override from a resolved head SHA and matching push target; skips broad remote fetch for an existing full-SHA PR base; creates a selected Bitbucket PR branch override from a matching remote branch; suffixes an existing PR when a matching push target lacks selected PR metadata; suffixes a matching push target branch when selected PR metadata has no PR number; suffixes a matching push target branch when the existing PR is different; suffixes a selected PR remote conflict when the PR lookup fails; checks out an unused runtime PR branch only when it is at the resolved head SHA; suffixes only the runtime worktree path when an exact PR branch checkout path exists. src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts: returns runtime local base update suggestions from addWorktree; creates a runtime local worktree from a usable persisted local branch base; does not create a runtime local worktree when the refresh fails and no local base ref exists; creates a branchNameOverride worktree from the selected matching remote base ref. tests/e2e/claude-agent-row-view.unit.test.ts: updates a mounted compact workflow description through the subscribed production parent; bounds upstream active-SSH visits for $population records, fallback=$fallback; derives %s destinations without requiring type or a workflow child ID; terminates a $path parent $status with no third request or intermediate toast; does not recover a first child %s. tests/e2e/cross-version-wire/agent-permission-legacy-spawn.unit.test.ts: keeps exact legacy ordering when structured creation cannot express afterTabId; can create a terminal without selecting the target worktree; preserves the legacy fresh-agent path when host authority is unavailable. tests/e2e/paired-instant-browser-tab.spec.ts: shows a paired browser tab before its create RPC resolves, then keeps it as one tab; adopts a paired browser tab without rebuilding its chrome. tests/e2e/session-tabs-decorative-title-fanout.unit.test.ts: bounds host publication and renderer application across remote worktrees; globally caps decorative freshness while every working status stays fresh. tests/e2e/session-tabs/mobile-session-active-performance.unit.test.ts: bounds saved-order publication selection at N and 10N without rematerializing navigation; bounds admitted placement reconciliation during supported reads at N and 10N; bounds selection input visits at 50 and 500 rows, including unavailable-target projection; keeps publication scoped to a changed worktree and shared by listeners at N and 10N; bounds preserved-chat merge and runtime-owned hydration at N and 10N (legacy=%s); bounds actual native retirement and shared delivery work at N and 10N. tests/e2e/session-tabs/mobile-session-active-publication.unit.test.ts: does not substitute a preserved row for an unavailable explicit legacy selection; resolves main-layout group selection %s (omitted group=%s). tests/e2e/structured-agent-session-launch-admission.unit.test.ts: opens a direct caller's terminal with the caller's own CLI arguments on a decline; opens the chat on the server that admitted it; opens only the terminal when this machine declines, without a notice; opens a new agent tab's terminal with the typed prompt when the caller names none; opens the chat, not a terminal, when this machine cannot resolve a new workspace yet; keeps its terminal fallback, as before. tests/e2e/structured-attention-prompt-relay.unit.test.ts: settles once per relayed prompt, not on every later status update. tests/e2e/structured-attention-read-retirement.unit.test.ts: Mark read on a chat never opened withdraws the prompt alert it surfaced; Mark read on a chat hidden since an earlier view covers the newer prompt it surfaced; reads a newly accepted visible prompt without sending an RPC for text-only updates. tests/e2e/structured-chat-tab-lifetime-cost.unit.test.ts: counts real raw stores, unrelated window publications and captured cleanup at %i chats; counts complete supplied-member sweep and separate final retirement at S=%i N=%i. tests/e2e/structured-session-workspace-authority.unit.test.ts: bounds actual target reveal across %i repo roots and metadata aliases. tests/e2e/terminal-agent-pane-launch.unit.test.ts: starts the host's planned command once, at the pane's size, and says it started; plans a pane whose prompt the window submits without the startup update prompt; preserves caller shell-ready delivery only for a connection-scoped adapter ($connectionId); starts no shell on plan failure (original failure: $returnLaunchFailure); cannot confirm a start whose provider answer was lost. tests/e2e/terminal-parked-memory.spec.ts: releases renderer terminal memory when hidden tabs park. tests/e2e/terminal-shortcuts.spec.ts: @headful Codex-like background output stays visible without disabling WebGL in auto mode; Shift with Russian layout text reaches the PTY as Cyrillic under kitty keyboard reporting. tests/e2e/terminal-split-activation-latency.spec.ts: records attributed CWD, spawn, bind, fixture-ready, input, and echo phases. tests/e2e/terminal-split-activation-latency-phases.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-split-activation-latency-main-probe.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-split-activation-latency-artifact.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-split-activation-latency-report.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-tab-switch-visual-restore.spec.ts: restores skipped hidden Grok output on light tab resume. tests/e2e/web-runtime-session-terminal-host-authority.unit.test.ts: delivers independent %s effort through the real prepared web callback; keeps same-ID local and runtime worktrees on the selected runtime owner; creates paired web agents through host authority so activation is mirrored; delivers generated continuation context after host-authoritative creation; seeds the chat composer for a draft that rode in on the launch command. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/construction/orca-runtime.test.ts, src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts, src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts, src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts, src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts, tests/e2e/claude-agent-row-view.unit.test.ts, tests/e2e/cross-version-wire/agent-permission-legacy-spawn.unit.test.ts, tests/e2e/paired-instant-browser-tab.spec.ts, tests/e2e/session-tabs-decorative-title-fanout.unit.test.ts, tests/e2e/session-tabs/mobile-session-active-performance.unit.test.ts, tests/e2e/session-tabs/mobile-session-active-publication.unit.test.ts, tests/e2e/structured-agent-session-launch-admission.unit.test.ts, tests/e2e/structured-attention-prompt-relay.unit.test.ts, tests/e2e/structured-attention-read-retirement.unit.test.ts, tests/e2e/structured-chat-tab-lifetime-cost.unit.test.ts, tests/e2e/structured-session-workspace-authority.unit.test.ts, tests/e2e/terminal-agent-pane-launch.unit.test.ts, tests/e2e/terminal-parked-memory.spec.ts, tests/e2e/terminal-shortcuts.spec.ts, tests/e2e/terminal-split-activation-latency.spec.ts, tests/e2e/terminal-split-activation-latency-phases.ts, tests/e2e/terminal-split-activation-latency-main-probe.ts, tests/e2e/terminal-split-activation-latency-artifact.ts, tests/e2e/terminal-split-activation-latency-report.ts, tests/e2e/terminal-tab-switch-visual-restore.spec.ts, tests/e2e/web-runtime-session-terminal-host-authority.unit.test.ts. Unresolved local/computed edges remain explicit debt.", "Audit2095 current-parent preparation2126 (approved2092/2093 removals; source refresh2109/independent2112): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-03.spec.ts: rejects exact terminal stop for multiple expected PTYs before stopping anything; omits stale renderer leaves when fresh PTY liveness is required; omits unbound renderer placeholders when fresh PTY liveness is required; captures the event method before the nested sleep receipt changes it; returns the close receipt without requiring a PTY stop; uses the same stop result as an empty explicit stop. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-04.spec.ts: builds a compact worktree summary from persisted and live runtime state; reads the linked-PR state from the renderer repoId-keyed GitHub cache; carries persisted worktree host ownership in mobile summaries; emits only instance- and boundary-validated lineage parents in mobile summaries; resolves WSL platforms only for repos represented in mobile summaries; omits worktrees hidden by the host visibility policy from mobile summaries; applies linked-checkout source visibility to mobile summaries. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review-part-02.spec.ts: routes runtime GitHub PR details and actions through the selected WSL project runtime; passes SSH connection context through hosted review creation flows; routes local WSL project hosted review flows through runtime git options; treats SSH worktree drift as unknown without local git probes. src/main/runtime/orca-runtime-tests/terminal-listing.spec.ts: emits one mobile session terminal tab per live PTY even if two tabs resolve to it; resolves projected split authority from the parent layout PTY binding; keeps explicit-id terminal lists from resolving all worktrees; keeps explicit-id cold-cache terminal lists from classifying unrelated same-repo worktrees; keeps unknown bare terminal-list ids on the no-scan exact-id path; matches explicit-id cwd PTYs for folder workspace instance IDs; routes PTY output through the PTY leaf index in large terminal graphs. src/main/runtime/orca-runtime-tests/window-authority.spec.ts: claims the first window as authoritative and ignores later windows; transfers authority from the headless sentinel to the first real window; relays terminal browser launches only while headless owns the graph; marks live headless PTYs for renderer reattach before desktop promotion; reports the activation gate state while no desktop window is available; bumps the epoch and enters reloading when the authoritative window reloads; can mark the graph ready for the authoritative window; drops back to unavailable and clears authority when the window disappears; hands the graph back to headless when a promoted serve window closes (#27292); keeps a crashed promoted serve renderer on its own window while the window is open; stays unavailable during initial loads before a graph is published. tests/e2e/automation-terminal-launch.unit.test.ts: launches explicit Chat for %s through the common entry and keeps its actual fallback; does not apply stored Terminal extras to Chat; forwards only complete Chat-consumed values, with no Terminal startup base; refuses an expired admission without minting another launch identity; records the actual chat identity and delegates new workspace setup and provenance. tests/e2e/github-project-provider-columns.unit.test.ts: renders %s through one bounded items request on a named cloud host; preserves zero and complete counters: %j; preserves populated and legacy rows through shared sorting, grouping and cells. tests/e2e/structured-agent-session-launch-continuation.unit.test.ts: carries renderer lifetime through host intent to the real %s provider builders. tests/e2e/terminal-account-restart.unit.test.ts: replaces a tombstoned owner while its persisted pane binding has not yet been cleared; paired restart retains the old owner (host authority: %s). tests/e2e/terminal-hidden-view-parking.spec.ts: does not park excluded tabs; reproduces a static frame byte-for-byte across 25 park/reveal cycles. tests/e2e/terminal-long-table-scroll-restore.spec.ts: reproduces long markdown table artifacts after workspace switch and scroll; keeps narrow wrapped signer markdown table coherent after restore and scroll; keeps real emoji markdown table right edge clean after restore and scroll. tests/e2e/terminal-long-table-fixtures.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-paste-ownership.spec.ts: Windows multiline keyboard paste normalizes terminal newlines with one PTY owner; right-click paste sends clipboard text to the focused terminal exactly once. tests/e2e/terminal-raw-emoji-table-scroll-restore.spec.ts: uses WebGL by default for ordinary terminal output when available @terminal-rendering-golden. tests/e2e/terminal-windows-shell-paste-ownership.spec.ts: cmd.exe default terminal keyboard paste preserves exact content with one PTY owner; Git Bash default terminal keyboard paste preserves POSIX-shaped content with one PTY owner; WSL terminal keyboard paste preserves Linux shell content with one PTY owner. tests/e2e/workspace-board-lane-virtualization.spec.ts: mounts a window of cards for a large lane and keeps lane indexes; renders later lane indexes after the lane scrolls. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-04.spec.ts, src/main/runtime/orca-runtime-tests/hooks-and-hosted-review-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-listing.spec.ts, src/main/runtime/orca-runtime-tests/window-authority.spec.ts, tests/e2e/automation-terminal-launch.unit.test.ts, tests/e2e/github-project-provider-columns.unit.test.ts, tests/e2e/structured-agent-session-launch-continuation.unit.test.ts, tests/e2e/terminal-account-restart.unit.test.ts, tests/e2e/terminal-hidden-view-parking.spec.ts, tests/e2e/terminal-long-table-scroll-restore.spec.ts, tests/e2e/terminal-long-table-fixtures.ts, tests/e2e/terminal-paste-ownership.spec.ts, tests/e2e/terminal-raw-emoji-table-scroll-restore.spec.ts, tests/e2e/terminal-windows-shell-paste-ownership.spec.ts, tests/e2e/workspace-board-lane-virtualization.spec.ts. Unresolved local/computed edges remain explicit debt. Complete dated receipts with direct selectors or current literal graph reaching tests/e2e/automation-terminal-launch.unit.test.ts, tests/e2e/github-project-provider-columns.unit.test.ts, tests/e2e/structured-agent-session-launch-continuation.unit.test.ts, tests/e2e/terminal-account-restart.unit.test.ts, tests/e2e/terminal-hidden-view-parking.spec.ts, tests/e2e/terminal-long-table-scroll-restore.spec.ts, tests/e2e/terminal-long-table-fixtures.ts, tests/e2e/terminal-paste-ownership.spec.ts, tests/e2e/terminal-raw-emoji-table-scroll-restore.spec.ts, tests/e2e/terminal-windows-shell-paste-ownership.spec.ts, tests/e2e/workspace-board-lane-virtualization.spec.ts are retired below as historical raw objects; their counts do not validate reduced commands. Historical retired receipt verbatim:\n{\n \"date\": \"2026-07-13\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm run test:e2e -- tests/e2e/terminal-parked-close-retirement.spec.ts --workers=1\",\n \"result\": \"passed\",\n \"durationSeconds\": 40.3,\n \"summary\": \"A fresh E2E build launched an isolated Electron profile, parked a live terminal, closed it through closeTab, and observed its exact PTY disappear.\"\n } Historical retired receipt verbatim:\n{\n \"date\": \"2026-07-14\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm run test:e2e -- tests/e2e/agent-descendant-process-kill.spec.ts --workers=1\",\n \"result\": \"passed\",\n \"durationSeconds\": 37.7,\n \"summary\": \"A current-main integrated fresh-build run proved a detached-pgid child was alive before agent PTY kill and absent afterward on the deadline-safe, root-ownership-gated implementation.\"\n } Historical retired receipt verbatim:\n{\n \"date\": \"2026-07-15\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm run test:e2e -- tests/e2e/agent-descendant-process-kill.spec.ts --workers=1\",\n \"result\": \"passed\",\n \"durationSeconds\": 78,\n \"summary\": \"The cycle-safe, target-indexed, bounded-fanout review head passed from a cold full build; the live detached-pgid descendant test body completed in 4.8 seconds.\"\n } Historical retired receipt verbatim:\n{\n \"date\": \"2026-08-14\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm run test:e2e -- tests/e2e/terminal-tab-close-restart-persistence.spec.ts --workers=1\",\n \"result\": \"passed\",\n \"durationSeconds\": 18.8,\n \"summary\": \"A fresh isolated Electron profile closed a split terminal tab through the runtime CLI and kept both renderer and runtime terminal inventories empty after restart.\"\n }", @@ -6403,7 +6377,8 @@ "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. All prior notes and dated/archived evidence retain original scopes.", "Audit3437 complete prior commands before completed-worker-retirement-resume retirement: [\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/terminal/surface/orca-runtime-terminal-close-continuity.test.ts\",\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts\",\"pnpm dlx node@24 ./node_modules/vitest/vitest.mjs run --config config/vitest.config.ts src/main/agent-hooks/server/testing/authority/server-pane-authority.test.ts src/main/ipc/agent-hooks.test.ts src/main/ipc/agent-pane-authority-ownership.test.ts src/main/persistence/terminal-topology/persistence-pane-identity-migration.test.ts src/main/persistence/terminal-topology/persistence-pty-binding-reconciliation.test.ts src/renderer/src/store/slices/agent-status/agent-pane-authority.test.ts src/renderer/src/store/terminals/terminal-pane-detach-agent-identity.test.ts src/renderer/src/store/terminals/terminal-tab-retirement-store.test.ts tests/e2e/completed-worker-retirement-resume.unit.test.ts src/renderer/src/components/shared/kill-all-terminal-surfaces.test.ts\",\"pnpm exec vitest run --config config/vitest.config.ts src/main/pty/process-retirement/pty-descendant-termination.test.ts src/main/daemon/sessions/testing/session.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts\",\"pnpm run test:e2e -- tests/e2e/terminal-tab-close-restart-persistence.spec.ts --workers=1\",\"pnpm run test:e2e -- tests/e2e/terminal-parked-close-retirement.spec.ts --workers=1\",\"pnpm run test:e2e -- tests/e2e/agent-descendant-process-kill.spec.ts --workers=1\",\"pnpm run test:e2e -- tests/e2e/paired-cli-terminal-graph-sync-tab-retention.spec.ts --workers=1\",\"pnpm run test:e2e -- tests/e2e/headless-serve-cli-terminal-retention-parity.spec.ts --workers=1\"]", "Audit3437 complete prior testFiles before completed-worker-retirement-resume retirement: [\"src/main/runtime/terminal/surface/orca-runtime-terminal-close-continuity.test.ts\",\"src/main/runtime/construction/orca-runtime.test.ts\",\"src/main/agent-hooks/server/testing/authority/server-pane-authority.test.ts\",\"src/main/ipc/agent-hooks.test.ts\",\"src/main/ipc/agent-pane-authority-ownership.test.ts\",\"src/main/persistence/terminal-topology/persistence-pane-identity-migration.test.ts\",\"src/main/persistence/terminal-topology/persistence-pty-binding-reconciliation.test.ts\",\"src/main/pty/process-retirement/pty-descendant-termination.test.ts\",\"src/main/daemon/sessions/testing/session.test.ts\",\"src/main/daemon/terminal-host/testing/terminal-host.test.ts\",\"src/main/providers/local-pty/local-pty-provider-shutdown.test.ts\",\"src/main/runtime/workspaces/removal/worktree-teardown.test.ts\",\"src/renderer/src/store/slices/agent-status/agent-pane-authority.test.ts\",\"src/renderer/src/store/terminals/terminal-pane-detach-agent-identity.test.ts\",\"src/renderer/src/store/terminals/terminal-tab-retirement-store.test.ts\",\"tests/e2e/completed-worker-retirement-resume.unit.test.ts\",\"src/renderer/src/components/shared/kill-all-terminal-surfaces.test.ts\",\"tests/e2e/terminal-tab-close-restart-persistence.spec.ts\",\"tests/e2e/terminal-parked-close-retirement.spec.ts\",\"tests/e2e/agent-descendant-process-kill.spec.ts\",\"tests/e2e/paired-cli-terminal-graph-sync-tab-retention.spec.ts\",\"tests/e2e/headless-serve-cli-terminal-retention-parity.spec.ts\"]", - "Audit3437 complete prior assertionRefs before completed-worker-retirement-resume retirement: [{\"file\":\"src/main/runtime/terminal/surface/orca-runtime-terminal-close-continuity.test.ts\",\"assertions\":[\"final-pane terminal.close remains pending until one renderer durability acknowledgement retires the persisted tab and layout\",\"final-pane externally owned teardown commits session retirement before PTY stop, tolerates duplicate exit retirement, and preserves an unrelated live canary\",\"post-ack workspace-session loss falls back to renderer cleanup and verified PTY teardown while every pre-ack retirement error remains non-destructive\",\"renderer reload with the same provider-attested PTY incarnation preserves the exact handle\",\"same-id replacement incarnation publishes a new handle and makes the old handle deterministically stale\",\"hard graph loss and preallocated-handle supersession make the retained renderer handle deterministically stale\"]},{\"file\":\"tests/e2e/terminal-tab-close-restart-persistence.spec.ts\",\"assertions\":[\"a durability-acknowledged whole-tab close leaves zero terminal tabs and provider sessions after restart\"]},{\"file\":\"tests/e2e/completed-worker-retirement-resume.unit.test.ts\",\"assertions\":[\"explicit close revokes the exact live recovery record both before and after PTY exit removes the tab, while PTY exit alone preserves interrupted-session recovery\"]},{\"file\":\"tests/e2e/terminal-parked-close-retirement.spec.ts\",\"assertions\":[\"a long-lived exact PTY remains alive after its terminal view is parked\",\"closing the parked tab removes the exact PTY from the provider inventory and the visible tab model\"]},{\"file\":\"tests/e2e/paired-cli-terminal-graph-sync-tab-retention.spec.ts\",\"assertions\":[\"an attached-window desktop host publishes the CLI-created terminal under the renderer publication epoch it inherits, proving the vulnerable classification path was taken rather than a headless or serve/SSH-shaped one\",\"with the target as the first host-created terminal, a renderer graph sync leaves the `terminal.create` tab in the host session inventory still naming its original daemon PTY\",\"the original fixture process answers a write through that handle with its own pid and a single READY line, so a respawned replacement cannot pass as a survivor\",\"the paired client applied that same sync and kept the tab with no replacement or resume tab appended\",\"an unrelated workspace keeps its own CLI terminal and PTY, and the client raises no direct local connection attempt or uncaught renderer error\"]},{\"file\":\"tests/e2e/headless-serve-cli-terminal-retention-parity.spec.ts\",\"assertions\":[\"a windowless serve host publishes host-created terminals under a headless epoch, never a renderer one, which is why it cannot reach the window-conditioned prune the desktop arm reproduces\",\"a later CLI dispatch leaves the earlier host-created terminal in the serve-host inventory still bound to its original PTY\",\"both original fixture processes answer writes through their own handles after the later dispatch\",\"the paired client mirrors exactly those two tabs with no replacement or resume tab appended, no direct local connection attempt, and no uncaught renderer error\"]},{\"file\":\"src/main/ipc/agent-pane-authority-ownership.test.ts\",\"assertions\":[\"pane authority transfer accepts only the canonical legacy/scoped runtime handle bound to the authoritative pane\"]},{\"file\":\"src/main/runtime/workspaces/removal/worktree-teardown.test.ts\",\"assertions\":[\"owned provider shutdowns start together so process-table snapshots can coalesce within a batch\",\"inventories above 32 sessions never exceed 32 concurrent provider shutdowns\"]},{\"file\":\"tests/e2e/agent-descendant-process-kill.spec.ts\",\"assertions\":[\"a detached-pgid descendant is alive before agent PTY kill and absent afterward\"]}]" + "Audit3437 complete prior assertionRefs before completed-worker-retirement-resume retirement: [{\"file\":\"src/main/runtime/terminal/surface/orca-runtime-terminal-close-continuity.test.ts\",\"assertions\":[\"final-pane terminal.close remains pending until one renderer durability acknowledgement retires the persisted tab and layout\",\"final-pane externally owned teardown commits session retirement before PTY stop, tolerates duplicate exit retirement, and preserves an unrelated live canary\",\"post-ack workspace-session loss falls back to renderer cleanup and verified PTY teardown while every pre-ack retirement error remains non-destructive\",\"renderer reload with the same provider-attested PTY incarnation preserves the exact handle\",\"same-id replacement incarnation publishes a new handle and makes the old handle deterministically stale\",\"hard graph loss and preallocated-handle supersession make the retained renderer handle deterministically stale\"]},{\"file\":\"tests/e2e/terminal-tab-close-restart-persistence.spec.ts\",\"assertions\":[\"a durability-acknowledged whole-tab close leaves zero terminal tabs and provider sessions after restart\"]},{\"file\":\"tests/e2e/completed-worker-retirement-resume.unit.test.ts\",\"assertions\":[\"explicit close revokes the exact live recovery record both before and after PTY exit removes the tab, while PTY exit alone preserves interrupted-session recovery\"]},{\"file\":\"tests/e2e/terminal-parked-close-retirement.spec.ts\",\"assertions\":[\"a long-lived exact PTY remains alive after its terminal view is parked\",\"closing the parked tab removes the exact PTY from the provider inventory and the visible tab model\"]},{\"file\":\"tests/e2e/paired-cli-terminal-graph-sync-tab-retention.spec.ts\",\"assertions\":[\"an attached-window desktop host publishes the CLI-created terminal under the renderer publication epoch it inherits, proving the vulnerable classification path was taken rather than a headless or serve/SSH-shaped one\",\"with the target as the first host-created terminal, a renderer graph sync leaves the `terminal.create` tab in the host session inventory still naming its original daemon PTY\",\"the original fixture process answers a write through that handle with its own pid and a single READY line, so a respawned replacement cannot pass as a survivor\",\"the paired client applied that same sync and kept the tab with no replacement or resume tab appended\",\"an unrelated workspace keeps its own CLI terminal and PTY, and the client raises no direct local connection attempt or uncaught renderer error\"]},{\"file\":\"tests/e2e/headless-serve-cli-terminal-retention-parity.spec.ts\",\"assertions\":[\"a windowless serve host publishes host-created terminals under a headless epoch, never a renderer one, which is why it cannot reach the window-conditioned prune the desktop arm reproduces\",\"a later CLI dispatch leaves the earlier host-created terminal in the serve-host inventory still bound to its original PTY\",\"both original fixture processes answer writes through their own handles after the later dispatch\",\"the paired client mirrors exactly those two tabs with no replacement or resume tab appended, no direct local connection attempt, and no uncaught renderer error\"]},{\"file\":\"src/main/ipc/agent-pane-authority-ownership.test.ts\",\"assertions\":[\"pane authority transfer accepts only the canonical legacy/scoped runtime handle bound to the authoritative pane\"]},{\"file\":\"src/main/runtime/workspaces/removal/worktree-teardown.test.ts\",\"assertions\":[\"owned provider shutdowns start together so process-table snapshots can coalesce within a batch\",\"inventories above 32 sessions never exceed 32 concurrent provider shutdowns\"]},{\"file\":\"tests/e2e/agent-descendant-process-kill.spec.ts\",\"assertions\":[\"a detached-pgid descendant is alive before agent PTY kill and absent afterward\"]}]", + "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." ], "demotionRule": "Keep experimental or demote to protection none if exact PTY disappearance flakes, a sibling/detached pane is retired, late hooks can recreate closed authority, or a renderer graph sync retires a host-created tab that no explicit close retired." }, @@ -6425,7 +6400,7 @@ "providers": ["daemon", "runtime", "ssh", "wsl"], "coveredPlatforms": ["linux", "macos", "windows"], "coveredProviders": ["daemon", "runtime"], - "coverageNotes": "Git owner cleanup retires the mixed request-connection suite under repository test policy, including its encrypted request cancellation and cached paired-desktop authentication alarms, without equivalent replacement. Current commands and assertion references omit the retired suite; dated evidence retains its original scope and does not validate this reduced set. 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. Audit2153: Reduced sources intentionally lose the forwarding smoke and retire an unrelated current selector; historical runs do not validate changed source bytes. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2020: The CLI WebSocket source retains old-protocol refusal only; its paired-open, capability, timeout and admission projection examples are removed. No daemon-generation coverage is transferred to that callback. Both independent daemon E2E receipts remain unchanged at their original commands; the reduced unit selector has no fresh result. Historical prior account (preserved verbatim): Audit1983: Delete the reasonless-close scalar suite and optional-capability socket forwarding alias. Delete the mocked close-attribution topology field-inventory suite and its aliases/selectors; preserve independent dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1959 (sources 1957:11, 1957:35, 1957:36): The fixture-supplied repository roundtrip, isolated capability metadata readback, parser/default-timer/size-threshold/internal failure-counter examples and standalone handshake-only replay example are removed. Source11 retains real encrypted multi-client event ordering, reconnect snapshot and multiplex delivery under synthetic runtime state, and does not establish the broad handshake-to-reasonless-close refusal alias; retire that whole assertion object. Source36 capability metadata readback alias is retired. Source35 retains the actual v2 runtime-only metadata/downgrade refusal callback and captured mutating-trace fresh-nonce rejection; its mapped mobile-v2 refusal alias remains within modeled credential lookup scope. Both independent daemon E2E dated receipts remain byte-exact with their original commands and results. 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): Audit1939 (sources1934/1935): Retain actual parked exit/disposal/cancel/leaf progression using injected exit and close adapters. The retained last-watcher case checks exact lifecyclePtyId, but no retained callback establishes the whole existing replacement-or-sibling-incarnation alias. Retire that broad assertion object rather than transfer partial support. Capability admission, static fields and duplicate routing examples are intentionally lost; unchanged daemon E2E receipts remain scoped to their own commands. 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): The browser auth capability-advertisement case is removed in this audit; its direct encrypted-auth literal alarm is lost. Retained lifecycle evidence is not an equivalent replacement. Historical run commands and results remain historical. Recorded native Windows evidence covers the v21/v22/v23/v24/v25 named-pipe matrix. The deterministic daemon harness covers capable and legacy paired-runtime request shapes against live v25/v26 PTYs in separate worktrees, plus an unrelated control. Host/renderer tests cover old servers, missing liveness, stale publications, reused claims, split parents, explicit user intent, cross-profile isolation, remote runtime clients, SSH-provider routing, and WSL boundaries. A headed host paired to a separate live client, headless serve parity, Linux, SSH, and WSL remain explicit gaps. The audit removed private-router tests of mocked kill results and log fields. Their isolated success/failure attribution and pending-spawn tolerance alarms are no longer registered here; live lifecycle evidence does not establish equivalent log coverage. The isolated close-intent suite was removed. web-runtime-session.test.ts no longer supplies the lifecycle-close or old-server method-not-found assertions formerly referenced here. Their direct partition and RPC-shape alarms are lost; retained live daemon evidence does not establish equivalent coverage. The broad mirror fixture retains user-close suppression, refused-close reconciliation and optimistic reorder only. Its earlier reconnect/incarnation and projection examples no longer establish current daemon-generation coverage. Those narrow alarms are lost; other daemon evidence is not equivalent replacement coverage. Audit1318: src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts: Retain real local encrypted WebSocket regressions for pre-ready socket replacement preserving a request, close-before-ready logical subscription cleanup, unrelated RPC surviving another deadline, and pending setup abort leaving a sibling pending. Host server is synthetic and uses production crypto; kept scenarios also retain internal diagnostics/memory assertions unchanged. Remove happy routing, authority-envelope, unknown-ID/log, cleanup enum, binary, keepalive/liveness and production-budget/private socket inventories; intentionally lose those alarms, no physical host authorization, independent crypto or remote provider claim. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "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. Audit3881 intentionally removes the entire legacy E2EE channel and mobile socket-wiring test suites and the v2 additive runtime-capability refusal callback, without equivalent replacement. Those deleted suites leave current selectors and that v2 assertion alias is retired. Retained v2 replay/queue-counter cases do not establish the removed capability refusal. Reduced test bytes/selectors have no fresh execution in this static packet; independent dated daemon E2E receipts retain their complete original scope. Historical prior account (preserved verbatim): Git owner cleanup retires the mixed request-connection suite under repository test policy, including its encrypted request cancellation and cached paired-desktop authentication alarms, without equivalent replacement. Current commands and assertion references omit the retired suite; dated evidence retains its original scope and does not validate this reduced set. 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. Audit2153: Reduced sources intentionally lose the forwarding smoke and retire an unrelated current selector; historical runs do not validate changed source bytes. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2020: The CLI WebSocket source retains old-protocol refusal only; its paired-open, capability, timeout and admission projection examples are removed. No daemon-generation coverage is transferred to that callback. Both independent daemon E2E receipts remain unchanged at their original commands; the reduced unit selector has no fresh result. Historical prior account (preserved verbatim): Audit1983: Delete the reasonless-close scalar suite and optional-capability socket forwarding alias. Delete the mocked close-attribution topology field-inventory suite and its aliases/selectors; preserve independent dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1959 (sources 1957:11, 1957:35, 1957:36): The fixture-supplied repository roundtrip, isolated capability metadata readback, parser/default-timer/size-threshold/internal failure-counter examples and standalone handshake-only replay example are removed. Source11 retains real encrypted multi-client event ordering, reconnect snapshot and multiplex delivery under synthetic runtime state, and does not establish the broad handshake-to-reasonless-close refusal alias; retire that whole assertion object. Source36 capability metadata readback alias is retired. Source35 retains the actual v2 runtime-only metadata/downgrade refusal callback and captured mutating-trace fresh-nonce rejection; its mapped mobile-v2 refusal alias remains within modeled credential lookup scope. Both independent daemon E2E dated receipts remain byte-exact with their original commands and results. 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): Audit1939 (sources1934/1935): Retain actual parked exit/disposal/cancel/leaf progression using injected exit and close adapters. The retained last-watcher case checks exact lifecyclePtyId, but no retained callback establishes the whole existing replacement-or-sibling-incarnation alias. Retire that broad assertion object rather than transfer partial support. Capability admission, static fields and duplicate routing examples are intentionally lost; unchanged daemon E2E receipts remain scoped to their own commands. 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): The browser auth capability-advertisement case is removed in this audit; its direct encrypted-auth literal alarm is lost. Retained lifecycle evidence is not an equivalent replacement. Historical run commands and results remain historical. Recorded native Windows evidence covers the v21/v22/v23/v24/v25 named-pipe matrix. The deterministic daemon harness covers capable and legacy paired-runtime request shapes against live v25/v26 PTYs in separate worktrees, plus an unrelated control. Host/renderer tests cover old servers, missing liveness, stale publications, reused claims, split parents, explicit user intent, cross-profile isolation, remote runtime clients, SSH-provider routing, and WSL boundaries. A headed host paired to a separate live client, headless serve parity, Linux, SSH, and WSL remain explicit gaps. The audit removed private-router tests of mocked kill results and log fields. Their isolated success/failure attribution and pending-spawn tolerance alarms are no longer registered here; live lifecycle evidence does not establish equivalent log coverage. The isolated close-intent suite was removed. web-runtime-session.test.ts no longer supplies the lifecycle-close or old-server method-not-found assertions formerly referenced here. Their direct partition and RPC-shape alarms are lost; retained live daemon evidence does not establish equivalent coverage. The broad mirror fixture retains user-close suppression, refused-close reconciliation and optimistic reorder only. Its earlier reconnect/incarnation and projection examples no longer establish current daemon-generation coverage. Those narrow alarms are lost; other daemon evidence is not equivalent replacement coverage. Audit1318: src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts: Retain real local encrypted WebSocket regressions for pre-ready socket replacement preserving a request, close-before-ready logical subscription cleanup, unrelated RPC surviving another deadline, and pending setup abort leaving a sibling pending. Host server is synthetic and uses production crypto; kept scenarios also retain internal diagnostics/memory assertions unchanged. Remove happy routing, authority-envelope, unknown-ID/log, cleanup enum, binary, keepalive/liveness and production-budget/private socket inventories; intentionally lose those alarms, no physical host authorization, independent crypto or remote provider claim. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/9749", "https://github.com/stablyai/orca/issues/9949", @@ -6434,18 +6409,15 @@ "https://github.com/stablyai/orca/issues/9229" ], "invariant": "Reconnect, replay, or lifecycle observations from a viewer that negotiated explicit close intent must never kill a live PTY. A capable reasonless close must keep and republish; a legacy paired viewer must retain current-main behavior because its intentional close and cleanup echo are wire-identical. Lifecycle close requires the exact observed publication, terminal, environment, and authoritative liveness, never signals a process, and leaves renderer-owned or partial-split retirement to its owner. Legacy daemon hello and warm reattachment remain non-destructive.", - "oracle": "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. 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): Audit1983: Delete the reasonless-close scalar suite and optional-capability socket forwarding alias. Delete the mocked close-attribution topology field-inventory suite and its aliases/selectors; preserve independent dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1959 (sources 1957:11, 1957:35, 1957:36): The fixture-supplied repository roundtrip, isolated capability metadata readback, parser/default-timer/size-threshold/internal failure-counter examples and standalone handshake-only replay example are removed. Source11 retains real encrypted multi-client event ordering, reconnect snapshot and multiplex delivery under synthetic runtime state, and does not establish the broad handshake-to-reasonless-close refusal alias; retire that whole assertion object. Source36 capability metadata readback alias is retired. Source35 retains the actual v2 runtime-only metadata/downgrade refusal callback and captured mutating-trace fresh-nonce rejection; its mapped mobile-v2 refusal alias remains within modeled credential lookup scope. Both independent daemon E2E dated receipts remain byte-exact with their original commands and results. 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): Audit1939 (sources1934/1935): Retain actual parked exit/disposal/cancel/leaf progression using injected exit and close adapters. The retained last-watcher case checks exact lifecyclePtyId, but no retained callback establishes the whole existing replacement-or-sibling-incarnation alias. Retire that broad assertion object rather than transfer partial support. Capability admission, static fields and duplicate routing examples are intentionally lost; unchanged daemon E2E receipts remain scoped to their own commands. 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): Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Start isolated v25 and v26 daemon generations with one capable-viewer PTY and one legacy-viewer PTY per generation in four target worktrees plus an unaddressed control PTY in a fifth worktree. Route them through the production desktop scanner, runtime, RPC dispatcher, renderer-close relay, and daemon router. First issue sequential reasonless closes from an authenticated capable connection and require refusal, snapshot republish, zero shutdown calls, exact process survival, and post-close I/O. Then issue the byte-identical requests without the negotiated capability and require current-main behavior: two ordered immediate shutdowns, session-killed events, and exact root/descendant death, while capable and control PTYs survive. An observer lists all targets before, between, and after while issuing zero closes. Unit contracts also require in-process reasonless refusal, legacy runtime/mobile compatibility, explicit user closes, encrypted client-auth advertisement, and old-server lifecycle calls never to fall back.", + "oracle": "Audit3881 intentionally removes the entire legacy E2EE channel and mobile socket-wiring test suites and the v2 additive runtime-capability refusal callback, without equivalent replacement. Those deleted suites leave current selectors and that v2 assertion alias is retired. Retained v2 replay/queue-counter cases do not establish the removed capability refusal. Reduced test bytes/selectors have no fresh execution in this static packet; independent dated daemon E2E receipts retain their complete original scope. Historical prior account (preserved verbatim): 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. Audit3774 (independent peer expansion of3773): deliberately retire7authored/13potential expanded registrations across4whole suites: standalone truncated8-byte E2EE guard; open/empty readiness null fast-path; capability parser acceptance/atomic malformed-array bounds; phone/delegated-parent/desktop/in-process creator provenance projections. These are real guard/policy alarms accepted as low marginal value, not tautologies. No equivalent replacement, authenticated-refusal, observer delivery, persisted visibility, synchronous scheduling or fresh execution is claimed. Prior dated receipts retain their exact original scopes and do not validate the changed/reduced current selector. Independent daemon E2E receipts remain scoped to their own unchanged commands. Historical prior account (preserved verbatim): 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. 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): Audit1983: Delete the reasonless-close scalar suite and optional-capability socket forwarding alias. Delete the mocked close-attribution topology field-inventory suite and its aliases/selectors; preserve independent dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1959 (sources 1957:11, 1957:35, 1957:36): The fixture-supplied repository roundtrip, isolated capability metadata readback, parser/default-timer/size-threshold/internal failure-counter examples and standalone handshake-only replay example are removed. Source11 retains real encrypted multi-client event ordering, reconnect snapshot and multiplex delivery under synthetic runtime state, and does not establish the broad handshake-to-reasonless-close refusal alias; retire that whole assertion object. Source36 capability metadata readback alias is retired. Source35 retains the actual v2 runtime-only metadata/downgrade refusal callback and captured mutating-trace fresh-nonce rejection; its mapped mobile-v2 refusal alias remains within modeled credential lookup scope. Both independent daemon E2E dated receipts remain byte-exact with their original commands and results. 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): Audit1939 (sources1934/1935): Retain actual parked exit/disposal/cancel/leaf progression using injected exit and close adapters. The retained last-watcher case checks exact lifecyclePtyId, but no retained callback establishes the whole existing replacement-or-sibling-incarnation alias. Retire that broad assertion object rather than transfer partial support. Capability admission, static fields and duplicate routing examples are intentionally lost; unchanged daemon E2E receipts remain scoped to their own commands. 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): Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Start isolated v25 and v26 daemon generations with one capable-viewer PTY and one legacy-viewer PTY per generation in four target worktrees plus an unaddressed control PTY in a fifth worktree. Route them through the production desktop scanner, runtime, RPC dispatcher, renderer-close relay, and daemon router. First issue sequential reasonless closes from an authenticated capable connection and require refusal, snapshot republish, zero shutdown calls, exact process survival, and post-close I/O. Then issue the byte-identical requests without the negotiated capability and require current-main behavior: two ordered immediate shutdowns, session-killed events, and exact root/descendant death, while capable and control PTYs survive. An observer lists all targets before, between, and after while issuing zero closes. Unit contracts also require in-process reasonless refusal, legacy runtime/mobile compatibility, explicit user closes, encrypted client-auth advertisement, and old-server lifecycle calls never to fall back.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/e2ee-channel.test.ts src/main/runtime/rpc/e2ee-channel-v2.test.ts src/main/runtime/rpc/mobile-socket-wiring.test.ts src/main/runtime/rpc/runtime-client-capabilities.test.ts src/shared/remote-runtime/remote-runtime-client.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts src/cli/runtime/websocket-transport.test.ts src/renderer/src/web/web-runtime-client.test.ts src/renderer/src/components/terminal/terminal-tab-actions.test.ts src/renderer/src/components/terminal/terminal-close-incarnation.test.ts src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-tab-watchers.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/mobile/e2ee/e2ee-channel-v2.test.ts src/shared/remote-runtime/remote-runtime-client.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts src/cli/runtime/websocket-transport.test.ts src/renderer/src/web/web-runtime-client.test.ts src/renderer/src/components/terminal/terminal-tab-actions.test.ts src/renderer/src/components/terminal/terminal-close-incarnation.test.ts src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-tab-watchers.test.ts", "pnpm exec playwright test tests/e2e/daemon-generation-reconnect-safety.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", "pnpm exec playwright test tests/e2e/daemon-generation-legacy-close-safety.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1" ], "testFiles": [ "src/main/runtime/construction/orca-runtime.test.ts", - "src/main/runtime/rpc/e2ee-channel.test.ts", - "src/main/runtime/rpc/e2ee-channel-v2.test.ts", - "src/main/runtime/rpc/mobile-socket-wiring.test.ts", - "src/main/runtime/rpc/runtime-client-capabilities.test.ts", + "src/main/runtime/rpc/mobile/e2ee/e2ee-channel-v2.test.ts", "src/shared/remote-runtime/remote-runtime-client.test.ts", "src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts", "src/cli/runtime/websocket-transport.test.ts", @@ -6475,16 +6447,6 @@ "shutdown-dispose-failed drops named-pipe authority within the deadline and exact fixture cleanup leaves no process tree" ] }, - { - "file": "src/main/runtime/rpc/e2ee-channel-v2.test.ts", - "assertions": ["mobile E2EE v2 continues to reject additive runtime capability metadata"] - }, - { - "file": "src/main/runtime/rpc/runtime-client-capabilities.test.ts", - "assertions": [ - "the authenticated capability parser accepts only bounded string arrays and rejects malformed or oversized input" - ] - }, { "file": "src/shared/remote-runtime/remote-runtime-client.test.ts", "assertions": [ @@ -6536,6 +6498,10 @@ "Add live Linux SSH-relay and Windows WSL reconnect artifacts without weakening keep-on-unknown." ], "knownGaps": [ + "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.", + "Audit3814 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle from a Codex ready prompt even when stale startup lines remain :: Stale MCP startup lines must not block a later Codex ready header.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle when a stale Codex prompt is followed by the ready header :: A Codex ready header following a stale resume prompt must satisfy tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for an idle Cursor lane past its dismissed trust dialog (#8210) :: Later Cursor idle banner overrides retained trust dialog.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not block a mid-run Cursor lane on its dismissed trust dialog (#8210) :: Dismissed trust dialog must not report blocked for later busy Cursor; wait times out.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not classify unrelated press-enter prompts as Codex blocked prompts :: Unidentified press-enter text must time out rather than be classified Codex blocked.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for quiet background PTY agents without OSC titles :: Quiet Codex background terminal without OSC title eventually resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: sends agent prompts as bracketed paste before submit :: Driving prompt escapes embedded paste-end ESC, writes one framed paste then CR, and counts bytes.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: settles a foreground Codex prompt when launch metadata has not arrived :: Codex inferred from foreground without launch metadata waits for composer marker/quiescence before one CR.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: gives a late Codex render marker a fresh quiescence window :: Marker arriving at7.9s re-arms fresh quiet window instead of submitting at initial cap.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: writes large agent prompt paste frames atomically before delayed submit :: A prompt larger than input chunk budget is a single paste write before delayed CR with exact byte count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects oversized terminal.send text before provider writes :: Oversized ordinary terminal.send rejects input-too-large before any provider write.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects focusing an exited background terminal session :: focusTerminal refuses terminal_exited before invoking background reveal.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: pastes the same bytes the desktop draft paste sent for the prompt :: Launch-ready prompt normalizes CR/LF and renders embedded ESC visibly identically to desktop bracketed paste.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: keeps a prompt into a running agent behind the render settle, as before :: Driving prompt remains held through7s repaint activity then submits once by9s.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reports a queued PTY focus as not navigated when its notifier disappears :: Queued PTY focus and completed active reveal report not navigated after notifier removal; no second reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: does not invoke a stale graph-leaf focus notifier after queued PTY work :: Queued graph-leaf focus must not invoke old notifier after preceding PTY reveal and notifier removal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: paginates retained terminal output with explicit limits and truncation metadata :: Preview120lines, fractional limits,50/200 pages, retained2000line truncation and future-cursor metadata stay consistent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: falls back to renderer visible screen when uncursored TUI tail is blank :: Substantial blank uncursored tail uses mounted renderer visible screen with zero scrollback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reads and shows the runtime-owned alternate-screen grid without serialization :: Actual runtime alternate-screen grid provides read/show content without renderer/provider serialization.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: classifies older provider alternate-screen snapshots from ANSI :: Older provider without alternateScreen metadata classifies ANSI alternate entry and returns Remote Vim screen.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: honors the last ANSI screen transition when older provider metadata is absent :: Last ANSI alternate exit overrides earlier entry when explicit provider mode metadata is absent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: rejects a full provider screen frame after live output advances :: Live output arriving during second full-screen capture causes screen-unavailable rather than stale full frame.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: shares one provider snapshot between concurrent read and show calls :: Concurrent read/show share one successful provider snapshot and both receive Shared TUI content.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps cursor reads provider-free on restored alternate-screen PTYs :: Restored alternate-screen cursor transcript reads never acquire provider snapshot.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: backs off after a provider snapshot failure instead of retrying for show :: Failed provider capture is cached/backed off so later show does not retry.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: falls back once to a mounted renderer when a known alternate provider fails :: A known-alternate failed provider capture falls back exactly once to newly mounted renderer.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: bounds provider visible frames for read and show responses :: Provider visible read/show use six bounded lines and300character preview.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps renderer-fallback composer drafts separate from terminal output :: Renderer fallback strips dim composer draft from terminal output and exposes draft separately.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: does not use renderer visible-screen fallback for a short blank shell tail :: Two blank shell lines must not trigger renderer screen fallback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: trims terminal tail character budget without per-line array shifts :: Tail builder trims to256KiB with correct retained suffix and no Array.shift calls.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains ANSI-only status redraws instead of appending every frame :: Repeated erase/redraw replaces preview until newline then publishes one completed cursor row.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains split multi-line ANSI footer redraw state across chunks :: CUU state across chunks retains corrected footer rows and publishes new cursor entries.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not let stale lower rows hide earlier corrected footer rows from cursor reads :: Earlier corrected footer row must not be hidden by stale lower rows in cursor reads.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: bounds completed transcript entries from a single multi-line redraw chunk :: Single redraw chunk bounds completed transcript to2000retained lines and correct oldest/next/latest cursors.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains multi-line ANSI redraws when the last footer row stays partial :: Partial final redrawn row appears in preview but cursor sees it only after newline.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not retain split ANSI controls as visible terminal preview text :: Split color/mode escapes never leak preview fragments; long split OSC title truncates at MAX_OSC_TITLE_CHARS.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains same-line redraw cursor position across split full-line erase chunks :: Full-line erase preserves column across chunks so XY follows three spaces rather than old ABC.\nsrc/main/runtime/orca-runtime-tests/conpty-stream-read.spec.ts :: fills the requested line count even when blank rows sit below the prompt :: Blank rows below a ConPTY prompt must not consume the requested nonempty-line count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: does not retain split ST-terminated string controls as preview text :: Split ST-terminated Kitty/string controls must remain excluded from preview text.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects split OSC titles before retaining terminal previews :: Split BEL OSC title must update working title/status without leaking into preview.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects ST-terminated OSC titles split before the final backslash :: ST OSC split before final backslash must update title without leaking framing.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: preserves a trailing escape after a completed OSC title :: Completed OSC followed by pending ESC must preserve the next idle-title transition.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: seeds newly synced leaves from PTY pending ANSI state :: A newly synced graph leaf inherits pending ANSI so a split color fragment cannot leak.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: bounds retained partial terminal output before preview reads :: Partial terminal state stays capped at 4000, preserves retained array identity, and preview truncation/cursor output remains correct.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: submits the mail pointer to Cursor Agent only after the paste-burst delay :: Cursor mailbox pointer Enter must wait through the paste-burst delay; this is a real input-timing alarm intentionally retired.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts :: adopts a v1.4.150-shaped agent, setup, and shell orphan as one topology transaction :: Stale incarnation refuses without topology change; three agent/setup/shell lanes adopt atomically with layout/group/revision and preserved read/input/resize; exact replay is idempotent and competing owner refuses.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: retires the exact worker when it exits after renderer reveal :: Exact worker exit after reveal retires that worker and its surface.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: re-reveals a recovered worker after the renderer graph epoch changes :: Changed renderer graph epoch invalidates reveal receipt and forces another reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: defers recovery when the renderer omits the exact reveal identity :: Missing exact reveal identity defers recovery after two attempts.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: reconciles a same-id process replacement before headless adoption :: A process replacement before headless adoption must fence off stale ownership.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retires provider resume only after authoritative inventory proves the legacy PTY exited :: Authoritative owning-host inventory overrides false local hasPty, avoids SSH scanning, retires exited provider resume/surface, adopts live workers without headless reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retries inventory and unknown liveness without revealing a ghost worker :: Inventory failure and unknown liveness must retry without ghost reveal, eventually adopt, and stop retrying.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: refuses a live reserved pane before issuing a handle or revealing it :: A requireFreshPane launch receiving a live reserved owner must reject before handle/reveal/kill, and release its claim. No equivalent replacement claimed.", + "Audit3806 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: skips a listener unsubscribed mid-fan-out even with mobile exclusions active :: A listener removed by an earlier listener during one fanout is not called, including with a side-effect-excluded mobile listener present.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: retains bytes emitted before a fresh daemon spawn resolves :: Bytes and title arriving before an initial zero/reset provider response survive in the serialized headless buffer with their counted sequence.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits command-finished facts with best-effort exit codes across chunk splits :: A split OSC133 D exit code becomes130 and a missing code becomes null in ordered command-finished facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits pr-link facts once per URL with batch attribution :: A split GitHub PR URL yields42 rather than4, emits42/43 once each, and carries PTY/worktree/tab attribution.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits 2031-subscribe facts across chunk splits :: Split ESC[?20 then31h emits exactly one2031-subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: restores a provisional 2031 subscribe when daemon scan authority returns :: Returning daemon scan authority with partial scan seed and pending2031 subscription restores exactly one subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers the tracked title over the renderer snapshot lastTitle :: A synthetic live Cursor title overrides stale renderer lastTitle while preserving renderer snapshot source.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers provider history over a partial headless mirror for requested snapshots :: Authoritative requested snapshots return supplied provider frame/history/seq rather than a partial headless mirror, requesting5000rows.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: tracks live alternate-screen transitions after a provider snapshot :: Provider alternateScreen true is accepted, then live1049l/1049h update isTerminalAlternateScreen false/true.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: translates reset provider snapshots without retaining the old title :: A reset provider snapshot translates new local seq into the runtime domain and replaces Old process title with New process.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits the chunk agentStatus events before its side-effect batch :: Agent status callback precedes side-effect batch callback for one coalesced OSC9999/title/bell chunk.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: still emits a throwing chunk’s facts under its own seq, not the next chunk’s :: A tracker throw still flushes first chunk title facts under its own seq, and second chunk does not inherit those facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: seeds the lazily created tracker from the daemon-snapshot title :: A lazy tracker hydrated from renderer snapshot title Codex working emits agent-idle on later Codex done.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits command-code-working facts only after the banner arms the scrape :: Unarmed Thinking text emits no facts; a Command Code0.27.3 banner then hardcoded colored spinner text emits attributed command-code-working with the submitted prompt.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits a command-code-done fact when the idle composer returns :: After hardcoded banner/working text, returned idle composer emits command-code-done with the earlier submitted prompt.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: resizes the headless mirror after an accepted desktop PTY resize :: An external accepted resize produces the resized dimensions and same status-frame lines as a separately driven reference emulator.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: replaces suffix-only headless state with the recovered renderer snapshot :: Replacing suffix-only state removes old suffix, retains renderer history plus later output/cwd, and returns the live47x40PTY grid.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: stamps SSH connection identity on runtime terminal status :: A synthetic mounted-leaf OSC9999 status after registerPty carries the supplied SSH connectionId.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: does not retain WSL context when a PTY id is reused :: After exit and same-ID new null distro context, OSC7 file://server/share/repo uses UNC server path rather than old Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: preserves immutable context while a live daemon attach is unresolved :: preparePtyExecutionContext with preserveExisting refuses a supplied Debian replacement and subsequent OSC7 keeps original Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts :: projects frame-independent live state through main buffer snapshots :: Main-buffer snapshot puts focus-report/cursor-visibility modes in frameRestoreAnsi, excludes STATIC-FRAME there and includes it in data.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.ts :: continues terminal agent status fanout when a callback throws :: Throwing on the first status callback does not prevent second payload delivery and logs contextual error.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: returns a title-only replay snapshot and never historical attention :: Lose replay:true/title-only fact projection despite earlierbell and unknownPTYnull. No actual delivered-history notification or reattach behavior was exercised. No equivalent replacement claimed.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects a handle rebind while a controller-less status check yields :: A handle rebound while the null-controller status continuation yields must throw terminal_handle_stale.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects confirmation evidence when the owning PTY exits :: A pending strong confirmation resolving after owning PTY exit must reject terminal_exited.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-03.spec.ts :: keeps ordinary terminal send suffix failures on the existing not-writable contract :: Ordinary send writes text but refused CR must throw terminal_not_writable with beforeWrite twice and afterWrite once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell the execution host cannot apply instead of spawning its default :: Requested Windows shell on POSIX must refuse before spawning a default shell.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: quotes the agent startup command for the requested shell, not the host default :: Requested cmd shell must override PowerShell default quoting for agent startup command.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: keeps restored receipts outside a targeted worktree scan :: Targeted scan removes the moved-worktree receipt while preserving another worktree receipt.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: observes setup command completion without waiting for its interactive shell to exit :: Nonzero completion marker 17 resolves while interactive shell remains running.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: falls back to setup terminal exit when no completion signal is available :: Setup completion observer without token falls back to actual exit code 9.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: cancels setup completion observation when the caller aborts :: Abort rejects with the original reason and unsubscribes once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps observing after an uncertain setup terminal status :: Unknown exit waiter result must leave observation pending until completion marker arrives.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh omits a record :: Controller inventory omission disconnects the record but preserves its retained transcript.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh times out :: Hung inventory timeout leaves connected record and retained transcript intact.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle for adopted background PTY handles from the renderer title :: An adopted background handle resolves tui-idle from ready Codex renderer title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves live-leaf tui-idle from an OpenCode native title :: A live leaf resolves tui-idle from an OpenCode native title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from a Codex ready prompt preview :: A supplied Codex prompt preview resolves tui-idle without an actual agent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from an Antigravity prompt before the model line :: A supplied Antigravity prompt before model line resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell with no workspace instead of creating a default-shell tab :: Workspace-less explicit shell must reject before renderer default-tab request or spawn. This real guard/wiring alarm is deliberately retired.", + "Audit3798 per-case accepted losses:\nsrc/main/runtime/orca-runtime-tests/paired-settings.spec.ts :: awaits navigation-only updates from paired clients (%s) :: Updating only claudeSubagentNavigationEnabled waits for the actual controller call to the supplied pending Claude-view reconcile for both on/off values.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: drops a client page record even when its close command cannot be issued :: A removed workspace loses its runtime client-page record and headless browser projection despite close delivery_required rejection, and emits the asynchronous warning.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: leaves client-hosted pages alone when another host still owns the same worktree id :: Removing runtime:env-b metadata with local ownership leaves the local same-ID client page unchanged and issues no close command.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: marks live bindings again when reopening after a promoted window closes :: A reopened window marks its still-registered live worktree in activeWorktreeIdsOnShutdown after the first promoted window closes.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: preserves live SSH session identities when promoting a headless runtime :: Headless-to-desktop promotion records active worktree, SSH connection and remoteSessionIdsByTabId from the supplied surviving SSH PTY/session.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores a surviving renderer when its reload is cancelled :: A sole ready renderer reload cancelled under its current renderer fence returns true and becomes ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores headless authority when desktop promotion navigation is cancelled :: A cancelled desktop promotion with headless recovery returns false while headless authority remains ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: moves a desktop graph to unavailable when its reload times out :: A ready desktop graph without a headless fallback becomes unavailable at the reload deadline and retains its window/epoch.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: recovers a failed headless promotion and accepts a later renderer generation :: A promotion failure restores ready headless authority; a later valid same-window graph publishes ready desktop authority.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: clears a failed pane recovery so a later reconnect can retry :: After relay_reconnecting rejection, the pending recovery lock clears and the same pane/handle can call createTerminal a second time and return its supplied replacement.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: still preserves a CLI agent leaf when the reloaded renderer has not rebound its PTY :: An empty graph published during renderer reload preserves a preallocated live CLI PTY as one listable terminal before renderer rebind.\nsrc/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts :: keeps a no-incarnation handle across an in-graph pane remint :: Within one graph lifetime an unversioned PTY reminted onto another leaf retains its issued handle and resolves its old exit waiter after onPtyExit.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: matches explicit-id cwd PTYs when the resolved worktree cache is incomplete :: An explicit target absent from a fresh incomplete resolved cache adopts only its cwd PTY, rejects nested cwd PTY and does not rescan Git.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: ignores cwd-only controller PTYs for malformed explicit worktree IDs :: Malformed id:repo-1:: returns no terminals, does not adopt cwd-only controller PTY and avoids Git rescanning.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: refuses an SSH-backed create for mobile/runtime callers instead of creating locally :: Loss of this public unserved SSH create error-class/no-local-add/no-local-list alarm.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: records an app-selected parent workspace as a manual action :: Loss of the local runtime folder-parent manual origin, active-workspace source and explicit confidence projection alarm; no claim that SSH or cleanup coverage replaces it.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: browses runtime server directories before projects are added :: Loss of this public runtime alarm for browse availability before registration, directories-first lexical ordering and native path flavor.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: lists drive roots for a server-root browse :: Loss of the Windows public slash-root drive enumeration smoke and presence of the temporary directory drive.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations-part-02.spec.ts :: creates a missing runtime parent before creating the project directory :: Loss of this runtime createRepo recursive missing-parent/child existence and registered-path alarm.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: preserves selected project %s when a hosted parent is known :: Loss of both parent-selected and origin-selected normal fork-link projection/persisted upstream alarms plus exact single-probe count.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: links a current enterprise remote despite unavailable metadata and a retained %s :: Loss of normal current-enterprise-origin linking with stale automatic GitHub avatar or protected file image, unchanged icon assertion, and serialized project identity under unavailable metadata.", "Audit2145 accepts removal of canned runtime metadata/guard/forwarding, fake in-memory persistence, private work-count and wrapper-duplication tests from the construction/orca-runtime.test.ts aggregate, plus the two automation run-context guards from runtime-workspace-launch-contracts.test.ts. Retained race, framing, physical completion and ownership callbacks remain byte-identical. Existing commands remain valid selectors; historical receipts stay unchanged and provide no fresh validation or replacement coverage for the reduced suites.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/main/runtime/construction/orca-runtime.test.ts: remove only literal registration import/call pairs await import('../orca-runtime-tests/worktree-setup-and-startup.spec'), await import('../orca-runtime-tests/gitlab-and-pr-bases.spec'); no additional authored credit. src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts: routes tab switch and capture start by explicit page id; accepts focus on tab switch without altering bridge args (focus is main-side concern); keeps terminal cwd resolution fail-soft when the provider is unavailable. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts: drops the bounded scan cache when orphan-cleanup removal completes; clears optimistic reconcile tokens when a CLI worktree removal succeeds; emits drift without mutating when the fetched base fast-forwards created HEAD; emits base_changed without mutation when the fetched base rewrote history; skips stale-token reconciles without mutating or emitting stale status; emits unknown without mutation when fetch fails or the base ref is missing. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts: routes runtime preserved-branch force-delete through the selected WSL project runtime; replies to a waiting client with the error of a delete that fails after acceptance; treats forced runtime deletion of an already-missing unregistered worktree as cleanup; treats normal runtime deletion of an already-missing unregistered worktree as cleanup. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts: warns that a missing-repo removal only forgot the workspace; restores runtime watchers when CLI worktree deletion fails after teardown; does not re-spend the drain budget on a removal after a wedged install was abandoned; routes runtime worktree removal through the selected WSL project runtime; force-deletes a branch that was preserved by runtime worktree removal. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts: records GitLab pasted-project recents only after successful runtime lookup; threads explicit origin preference through runtime WSL PR base resolution; resolves local GitLab fork MR bases from the target project MR head ref; captures the fork MR head from a dedicated ref, not the shared FETCH_HEAD; keeps the durable MR head when the head fetch fails but the local ref resolves; routes runtime GitLab fork MR base git calls through the selected WSL project runtime. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts: passes SSH connection ids through GitLab task operations; routes runtime GitLab issue, MR, work-item, and todo actions through the selected WSL project runtime; routes runtime GitLab MR details, review-management, job, and pasted URL actions through the selected WSL project runtime; normalizes runtime GitLab issue list arguments like the desktop IPC path. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts: does not warn when setup is explicitly skipped for CLI-created worktrees; puts the agent a create starts in the first default tab, as the window does; keeps the 8s main-runtime startup readiness budget for agents without an override; gives OpenCode the 20s main-runtime startup readiness budget; launches explicit startup agents with prompts for CLI-created worktrees. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts: returns a setup launch payload for CLI-created worktrees when hooks are explicitly enabled; does not hand the window a setup main never tried to start; passes the selected Windows setup shell into runtime runner generation; follows normal setup policy for CLI-created worktrees without activating them; uses returned WSL setup shell metadata when runtime spawns setup; uses the shell-aware setup runner for windowless creates without a startup command; reports the in-process setup hook as running when nothing can launch the runner. src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts: coalesces two clients sleeping the same host worktree; stops exactly the expected live PTYs for a worktree; explains a refused workspace close instead of throwing the raw refusal enum. src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts: marks the desktop-active worktree as isActive; includes SSH-backed worktrees in the mobile worktree summary; caches repeated malformed path misses before normalizing them again. src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts: keeps title-only foreground work ahead of monitoring in another pane; keeps a local hook row while a connected PTY still backs its pane; keeps an OSC row via its connected PTY after the pane binding is cleared. src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts: resolves files through a source-visible linked-checkout worktree; marks saved session tabs with live PTYs as host sidebar activity; attributes live legacy PTYs from saved layout bindings when their panes are hidden; marks saved browser tabs as host sidebar activity like desktop; falls back to the path-keyed GitHub cache entry; includes folder workspaces in compact worktree summaries for mobile; attaches inline agent rows from the latest OSC 9999 status; projects monitoring over a title-derived working status. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts: pushes to an idle pane when the only live waiter filters out the message type; resolves a registered waiter without PTY-injecting when the leaf is already idle; keeps already-idle status after tui-idle wait for immediate message delivery; resolves message waiters when notifyMessageArrived is called; does not resolve type-filtered message waiters for unrelated message types; removes message waiter abort listeners after message arrival; resolves message waiters on timeout when no message arrives. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts: delivers pending mail via notifyMessageArrived when the recipient is already idle; does not keep retrying when every pending row was already pointed; repoints pending rows restored with a live-idle coordinator. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts: rolls back a half-created terminal whose surface never publishes. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts: rejects startup prompts for agents that require post-ready stdin; uses portable Unix quoting for mobile agent launch commands in WSL project runtimes; keeps PowerShell quoting for mobile agent launch commands in Windows host runtimes; uses cmd.exe quoting for mobile agent launch commands in local Windows host runtimes; publishes headless mobile session agent identity with synthesized PTY status; rejects disabled mobile session agent launches before spawning; validates mobile terminal insertion anchors before resolving agent launch commands. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts: coalesces a reconnect close burst onto one authoritative PTY inventory; keeps an explicit user close destructive while the PTY is live; builds mobile session agent launch commands on the runtime host; injects mobile quick-command prompts into the host-built agent startup command. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts: closes persisted headless terminal parents before any prior list call; tears down a serve-owned headless tab on close while a renderer is attached so it cannot resurrect; defers a renderer-published pending tab to the renderer instead of tearing it down; returns a delegated close outcome with no selection tombstone when the renderer owns the outcome; tears down a runtime pending shell the renderer never adopted on close. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts: materializes a plain shell when the pending tab has no launch agent; hydrates legacy persisted terminal tabs without layout entries; reads and indexes the full agent-status snapshot once per mobile projection; kills persisted SSH PTYs when closing hydrated headless tabs before pane metadata is restored; materializes hydrated pending headless terminals with the persisted session identity. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts: hydrates a persisted SSH-owned pane before an attached renderer publishes its graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts: publishes the desktop's tab name over the live agent title, and the live title without one; uses fresh neutral PTY titles over stale mobile snapshot and OSC titles; operates PTY-backed mobile session terminals without a renderer graph; reuses pane close for live PTYs that do not own a renderer tab; lists PTY-backed mobile session terminals without a renderer graph; shows and resolves active PTY-backed mobile session terminals without a renderer graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts: creates mobile session terminals for folder workspaces in a headless runtime server; spawns fresh headless SSH mobile session terminals instead of reattaching synthetic local ids; hydrates headless mobile session terminals from the host workspace session; keeps live headless mobile session terminals when a desktop renderer publishes without them; publishes laptop-created remote runtime split terminals to phone session tabs. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts: does not report headless wake degradation without sleeping records; does not wake slept agents for non-mobile session-only activation; does not rewrite unread metadata when a mobile activation finds the worktree already read; returns unread:false from worktree.ps after a mobile activation clears the flag; materializes pending mobile session terminals without focusing desktop clients; closes browser mobile session tabs when addressed by browser workspace id. src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts: resolves mobile terminal surfaces by exact split leaf; closes the matching mobile terminal UUID leaf without closing the whole tab; closes the whole mobile terminal tab when addressed by parent tab id; activates the active split leaf when addressed by parent tab id; clears unread metadata on mobile worktree activation without focusing desktop clients; wakes slept agents on the host renderer when a phone activates a worktree. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts: publishes the hook provider session on a headless mobile tab so native chat can address the transcript; recovers the agent type from the hook row when the pane was launched without an agent hint; reads one agent-status snapshot per projection, not one per terminal tab; waits for unknown-launch foreground owner before publishing Pi-compatible mobile status; keeps Pi-compatible mobile session status as Pi for an unknown-launch foreground pi PTY; keeps renderer-vetted mobile agent status for custom-titled terminals. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts: publishes terminal surface agent status for paired web clients; preserves authoritative OMP identity for Pi-compatible remote terminal snapshots; normalizes a remote OMP title without republishing omitted launch identity; skips the foreground-process probe when the PTY launch agent is already known; probes the foreground process only on a status transition for unknown launch agents; passes the client signal and the slept-worktree refusal to the spawn. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts: does not use stale runtime-created PTY status when a neutral PTY title exists; recognizes runtime-created Codex PTY handles from the ready prompt; recognizes runtime-created Antigravity PTY handles from the ready prompt; recognizes live leaf Antigravity terminals from the ready prompt; recognizes a later Antigravity header with a prompt but no model line; keeps mobile terminal surfaces visible while their leaf handle is pending. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts: lets Claude agents management titles clear stale runtime-created title status; does not recognize live Claude agents panes from a Claude foreground process; does not let stale tab-level agent titles override current neutral pane titles; lists live terminals with fresh pane titles over stale tab titles; lets adopted neutral pane titles use non-shell foreground fallback; lets adopted neutral pane titles retry wrapper foregrounds until recognized; authorizes settled CLI prompts only after positive %s foreground identity; does not recognize arbitrary foreground TUIs as running agents; lets live neutral pane titles retry wrapper foregrounds until recognized; lets current Claude agents PTY titles override stale runtime-created OSC titles; does not let stale Claude agents OSC titles suppress current PTY title activity. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts: keeps preallocated terminal handles valid across renderer reloads; preserves runtime-created PTY process identity after graph unavailable; keeps prompt bindings fenced across runtime restarts without provider incarnation; recognizes runtime-created PTY handles with agent launch titles; does not treat a bare Cursor Agent native title as a running agent session; uses stale runtime-created PTY status when there is no title or foreground evidence. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts: keeps orphaned list and show writability aligned with the send gate. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts: cancels a coalesced SSH worker recovery retry when its provider disconnects. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts: retries renderer reveal before clearing an adopted legacy worker sleeping record. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts: recovers exported ORCA_TERMINAL_HANDLE from discovered live PTY sessions. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts: applies ANSI erase-from-start line controls in retained previews; applies ANSI stripping for private or intermediate CSI line controls; applies ANSI stripping for unsupported erase-line modes; reveals an agent terminal under the pane the caller reserved; keeps a fresh %s pane host-owned when a desktop window is available; keeps desktop publication %s separate from the reserved host spawn; mints its own pane when the reserved leaf is malformed, and reports the one it used; starts an agent terminal with the model the caller picked; starts an agent terminal without a model flag when no pick was made; attributes a startup-agent launch named %s as %s; attributes a fresh agent session the host builds as unknown; leaves a bare agent command the user typed out of launch attribution. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts: trims oversized terminal output bursts without per-line array shifts; builds terminal previews without mapping the full retained tail; keeps recent PTY replay output capped without needing previous data for large chunks; applies terminal redraw controls before retaining previews; applies ANSI terminal redraw controls before retaining previews; retains multi-line ANSI footer redraws instead of appending old frames; keeps the cursor column when erasing full lines in multi-line redraws; applies ANSI split redraw controls without leaking raw params. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts: returns renderer visible screen lines through terminal.read RPC JSON result; separates composer drafts from provider-owned terminal screens. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts: reports an in-flight PTY focus as not navigated when its notifier disappears; reports graph-leaf focus as not navigated without a host notifier; grounds the provider mode tracker before a later chunk, in the emulator order; grounds an in-flight provider snapshot capture so it cannot publish the pre-reset screen; waits for terminal exit and resolves with the exit status; keeps terminal read payloads bounded while retained output remains pageable; trims terminal read preview character budget without per-line array shifts. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts: submits a silent Claude composer once after the bounded render fallback; chunks large terminal.send text before provider writes; yields chunked terminal input through immediates between writes; yields while validating accepted large terminal.send text before provider writes; reveals a background terminal session when focusing its handle; replays captured launch config when focusing a background agent session; reveals background terminal sessions with the freshest PTY title; renames background terminal handles without requiring a visible tab; keeps a background terminal handle stable while reveal adoption is racing. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts: resolves tui-idle when a stale Codex prompt is followed by Antigravity readiness; returns an agent-neutral blocked wait result for update prompts; returns an agent-neutral blocked wait result for workspace trust prompts; returns an agent-neutral blocked wait result for cwd selection prompts; returns a blocked wait result for Codex model migration prompts; returns a blocked wait result for Codex startup hook review prompts; returns an agent-neutral blocked wait result for generic interactive prompts; splits text and enter writes for background terminal handles; types the lead line for %s: %s; submits through the agent-specific PTY timing policy for %s. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts: waits for exit on background terminal handles; keeps retained PTY transcript memory when controller refresh fails; resolves tui-idle from an Antigravity ready prompt preview; resolves Antigravity ready prompts with newline-heavy pasted tails without splitting; resolves live-leaf tui-idle from an Antigravity ready prompt preview. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts: spawns the available Qoder command for a captured same-session resume: %s; does not use the local Windows shell setting for remote Windows bare agent creates; matches canonical bare agent commands when a command override is configured; keeps non-bare agent command terminal creates unchanged; keeps disabled bare agent command terminal creates unchanged; injects runtime hook receiver env into terminal sessions; creates background terminal sessions for a $label; creates background terminal sessions for a $label; enables Claude Agent Teams only for direct Claude launches when configured in-process; reveals Claude Agent Teams launches with the rewritten launch config; preserves Claude Agent Teams for sequenced Claude launches. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts: creates visible terminal sessions without asking the renderer to focus a tab; asks the pty controller for the requested shell instead of a startup command; knows the agent a flagged launch command names before any process read; retires a flagged command pane identity when the command exits; retires only receipted restored PTY authority on command completion and exit; forgets synthetic handles when disconnected PTY records are pruned. src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts: returns OSC titles from headless main terminal snapshots; adopts renderer-seeded titles into headless main terminal snapshots; returns cwd metadata from seeded headless main terminal snapshots; adopts OSC7 host metadata from seeded headless terminal scrollback; falls back to the renderer snapshot for hidden-output recovery without headless state; keeps an empty headless snapshot authoritative for hidden-output recovery; advances the absolute output sequence across a daemon stream gap; emits explicit OSC 9999 agent status from runtime PTY data. src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts: falls back to the provider snapshot for a restored PTY with no mounted renderer; falls back to the available mirror when authoritative provider history is unavailable; keeps an empty renderer snapshot when the provider has no retained content; keeps restored provider history authoritative after later live output; uses provider alternate-screen state while a partial model is unsafe; prefers the tracked title over the headless emulator lastTitle; keeps the cursor-agent literal in record-fallback snapshots only without a tracker title; touches mobile snapshots once for decorative spinner ticks, again on idle. src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts: creates a same-repo PR branch override from a resolved head SHA and matching push target; skips broad remote fetch for an existing full-SHA PR base; creates a selected Bitbucket PR branch override from a matching remote branch; suffixes an existing PR when a matching push target lacks selected PR metadata; suffixes a matching push target branch when selected PR metadata has no PR number; suffixes a matching push target branch when the existing PR is different; suffixes a selected PR remote conflict when the PR lookup fails; checks out an unused runtime PR branch only when it is at the resolved head SHA; suffixes only the runtime worktree path when an exact PR branch checkout path exists. src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts: returns runtime local base update suggestions from addWorktree; creates a runtime local worktree from a usable persisted local branch base; does not create a runtime local worktree when the refresh fails and no local base ref exists; creates a branchNameOverride worktree from the selected matching remote base ref. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/construction/orca-runtime.test.ts, src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts, src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts, src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts, src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts. Unresolved local/computed edges remain explicit debt.", "Audit2095 current-parent preparation2126 (approved2092/2093 removals; source refresh2109/independent2112): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-03.spec.ts: rejects exact terminal stop for multiple expected PTYs before stopping anything; omits stale renderer leaves when fresh PTY liveness is required; omits unbound renderer placeholders when fresh PTY liveness is required; captures the event method before the nested sleep receipt changes it; returns the close receipt without requiring a PTY stop; uses the same stop result as an empty explicit stop. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-04.spec.ts: builds a compact worktree summary from persisted and live runtime state; reads the linked-PR state from the renderer repoId-keyed GitHub cache; carries persisted worktree host ownership in mobile summaries; emits only instance- and boundary-validated lineage parents in mobile summaries; resolves WSL platforms only for repos represented in mobile summaries; omits worktrees hidden by the host visibility policy from mobile summaries; applies linked-checkout source visibility to mobile summaries. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review-part-02.spec.ts: routes runtime GitHub PR details and actions through the selected WSL project runtime; passes SSH connection context through hosted review creation flows; routes local WSL project hosted review flows through runtime git options; treats SSH worktree drift as unknown without local git probes. src/main/runtime/orca-runtime-tests/terminal-listing.spec.ts: emits one mobile session terminal tab per live PTY even if two tabs resolve to it; resolves projected split authority from the parent layout PTY binding; keeps explicit-id terminal lists from resolving all worktrees; keeps explicit-id cold-cache terminal lists from classifying unrelated same-repo worktrees; keeps unknown bare terminal-list ids on the no-scan exact-id path; matches explicit-id cwd PTYs for folder workspace instance IDs; routes PTY output through the PTY leaf index in large terminal graphs. src/main/runtime/orca-runtime-tests/window-authority.spec.ts: claims the first window as authoritative and ignores later windows; transfers authority from the headless sentinel to the first real window; relays terminal browser launches only while headless owns the graph; marks live headless PTYs for renderer reattach before desktop promotion; reports the activation gate state while no desktop window is available; bumps the epoch and enters reloading when the authoritative window reloads; can mark the graph ready for the authoritative window; drops back to unavailable and clears authority when the window disappears; hands the graph back to headless when a promoted serve window closes (#27292); keeps a crashed promoted serve renderer on its own window while the window is open; stays unavailable during initial loads before a graph is published. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-04.spec.ts, src/main/runtime/orca-runtime-tests/hooks-and-hosted-review-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-listing.spec.ts, src/main/runtime/orca-runtime-tests/window-authority.spec.ts. Unresolved local/computed edges remain explicit debt.", @@ -6578,7 +6544,12 @@ "Audit2153 historical original testFiles item, preserved verbatim; retired selector is not active execution evidence: \"src/main/runtime/rpc/server/remote-runtime-request-connection.integration.test.ts\"", "Terminal/runtime defining-owner cleanup retires complete parking timer, lifecycle, mocked close/disposal and render/flip/mount work-count cases under repository test policy. The retained watcher source has only two literal-oracle coverage decisions; the retained cold-parking hook source has only the layout-PTY exemption invalidation case. Lost alarms include cooldown/measure/pin wakeups, split exit/close attribution and cancellation, watcher disposal/restart, flood timer rearm, worktree verdict damping, and destroyed-transport cold restore. No equivalent replacement coverage or execution pass for the reduced cases is claimed; prior dated 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. Original scope text is retained as the exact suffix of coverageNotes/oracle; historical evidence is unchanged.", - "Git owner cleanup retires the mixed request-connection suite under repository test policy, including its encrypted request cancellation and cached paired-desktop authentication alarms, without equivalent replacement. Current commands and assertion references omit the retired suite; dated evidence retains its original scope and does not validate this reduced set." + "Git owner cleanup retires the mixed request-connection suite under repository test policy, including its encrypted request cancellation and cached paired-desktop authentication alarms, without equivalent replacement. Current commands and assertion references omit the retired suite; dated evidence retains its original scope and does not validate this reduced set.", + "Audit3774 (independent peer expansion of3773): deliberately retire7authored/13potential expanded registrations across4whole suites: standalone truncated8-byte E2EE guard; open/empty readiness null fast-path; capability parser acceptance/atomic malformed-array bounds; phone/delegated-parent/desktop/in-process creator provenance projections. These are real guard/policy alarms accepted as low marginal value, not tautologies. No equivalent replacement, authenticated-refusal, observer delivery, persisted visibility, synchronous scheduling or fresh execution is claimed. Prior dated receipts retain their exact original scopes and do not validate the changed/reduced current selector. Independent daemon E2E receipts remain scoped to their own unchanged commands.", + "Audit3774 historical original active selector/assertion arrays, preserved verbatim; no replacement coverage claim.\ncommands:\n[\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/mobile/e2ee/e2ee-channel.test.ts src/main/runtime/rpc/mobile/e2ee/e2ee-channel-v2.test.ts src/main/runtime/rpc/mobile/mobile-socket-wiring.test.ts src/main/runtime/rpc/callers/runtime-client-capabilities.test.ts src/shared/remote-runtime/remote-runtime-client.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts src/cli/runtime/websocket-transport.test.ts src/renderer/src/web/web-runtime-client.test.ts src/renderer/src/components/terminal/terminal-tab-actions.test.ts src/renderer/src/components/terminal/terminal-close-incarnation.test.ts src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-tab-watchers.test.ts\",\n \"pnpm exec playwright test tests/e2e/daemon-generation-reconnect-safety.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1\",\n \"pnpm exec playwright test tests/e2e/daemon-generation-legacy-close-safety.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1\"\n ]\ntestFiles:\n[\n \"src/main/runtime/construction/orca-runtime.test.ts\",\n \"src/main/runtime/rpc/mobile/e2ee/e2ee-channel.test.ts\",\n \"src/main/runtime/rpc/mobile/e2ee/e2ee-channel-v2.test.ts\",\n \"src/main/runtime/rpc/mobile/mobile-socket-wiring.test.ts\",\n \"src/main/runtime/rpc/callers/runtime-client-capabilities.test.ts\",\n \"src/shared/remote-runtime/remote-runtime-client.test.ts\",\n \"src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts\",\n \"src/cli/runtime/websocket-transport.test.ts\",\n \"src/renderer/src/web/web-runtime-client.test.ts\",\n \"src/renderer/src/components/terminal/terminal-tab-actions.test.ts\",\n \"src/renderer/src/components/terminal/terminal-close-incarnation.test.ts\",\n \"src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-tab-watchers.test.ts\",\n \"tests/e2e/daemon-generation-reconnect-safety.spec.ts\",\n \"tests/e2e/daemon-generation-legacy-close-safety.spec.ts\"\n ]\nassertionRefs:\n[\n {\n \"file\": \"tests/e2e/daemon-generation-legacy-close-safety.spec.ts\",\n \"assertions\": [\n \"one identified capable viewer and one legacy viewer issue byte-identical sequential reasonless closes while a third viewer lists every target before, between, and after but issues zero closes\",\n \"capable v25/v26 PTY root/descendant incarnations in separate worktrees survive, answer post-close input, and produce zero shutdown calls and zero daemon session-killed events\",\n \"legacy v25/v26 PTY root/descendant incarnations die through ordered immediate shutdown calls with one daemon session-killed event each, matching current-main behavior\",\n \"an unaddressed fifth-worktree PTY root and descendant survive with zero kill events, excluding global fanout\",\n \"the JSON reconstruction records request order, negotiated capabilities, viewer connection, worktree/tab/PTY ids, daemon PID/protocol, call site, and exact before/after process liveness\"\n ]\n },\n {\n \"file\": \"tests/e2e/daemon-generation-reconnect-safety.spec.ts\",\n \"assertions\": [\n \"the production scanner discovers v21/v22/v23/v24/v25 from v26 and every generation accepts repeated client hellos while every exact daemon, PTY-root, and descendant incarnation remains alive\",\n \"desktop and two remote profiles repeat lifecycle closes before and after client relaunch with zero session-killed events\",\n \"shutdown-dispose-failed drops named-pipe authority within the deadline and exact fixture cleanup leaves no process tree\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/mobile/e2ee/e2ee-channel-v2.test.ts\",\n \"assertions\": [\"mobile E2EE v2 continues to reject additive runtime capability metadata\"]\n },\n {\n \"file\": \"src/main/runtime/rpc/callers/runtime-client-capabilities.test.ts\",\n \"assertions\": [\n \"the authenticated capability parser accepts only bounded string arrays and rejects malformed or oversized input\"\n ]\n },\n {\n \"file\": \"src/shared/remote-runtime/remote-runtime-client.test.ts\",\n \"assertions\": [\n \"one-shot and subscription runtime clients remain compatible while sending encrypted client authentication\"\n ]\n }\n ]", + "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.", + "Audit3881 intentionally removes the entire legacy E2EE channel and mobile socket-wiring test suites and the v2 additive runtime-capability refusal callback, without equivalent replacement. Those deleted suites leave current selectors and that v2 assertion alias is retired. Retained v2 replay/queue-counter cases do not establish the removed capability refusal. Reduced test bytes/selectors have no fresh execution in this static packet; independent dated daemon E2E receipts retain their complete original scope.", + "Audit3881 historical original selector/assertion arrays, preserved verbatim; retired entries are not active execution evidence or replacement coverage.\ncommands:\n[\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/mobile/e2ee/e2ee-channel.test.ts src/main/runtime/rpc/mobile/e2ee/e2ee-channel-v2.test.ts src/main/runtime/rpc/mobile/mobile-socket-wiring.test.ts src/shared/remote-runtime/remote-runtime-client.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts src/cli/runtime/websocket-transport.test.ts src/renderer/src/web/web-runtime-client.test.ts src/renderer/src/components/terminal/terminal-tab-actions.test.ts src/renderer/src/components/terminal/terminal-close-incarnation.test.ts src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-tab-watchers.test.ts\",\n \"pnpm exec playwright test tests/e2e/daemon-generation-reconnect-safety.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1\",\n \"pnpm exec playwright test tests/e2e/daemon-generation-legacy-close-safety.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1\"\n ]\ntestFiles:\n[\n \"src/main/runtime/construction/orca-runtime.test.ts\",\n \"src/main/runtime/rpc/mobile/e2ee/e2ee-channel.test.ts\",\n \"src/main/runtime/rpc/mobile/e2ee/e2ee-channel-v2.test.ts\",\n \"src/main/runtime/rpc/mobile/mobile-socket-wiring.test.ts\",\n \"src/shared/remote-runtime/remote-runtime-client.test.ts\",\n \"src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts\",\n \"src/cli/runtime/websocket-transport.test.ts\",\n \"src/renderer/src/web/web-runtime-client.test.ts\",\n \"src/renderer/src/components/terminal/terminal-tab-actions.test.ts\",\n \"src/renderer/src/components/terminal/terminal-close-incarnation.test.ts\",\n \"src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-tab-watchers.test.ts\",\n \"tests/e2e/daemon-generation-reconnect-safety.spec.ts\",\n \"tests/e2e/daemon-generation-legacy-close-safety.spec.ts\"\n ]\nassertionRefs:\n[\n {\n \"file\": \"tests/e2e/daemon-generation-legacy-close-safety.spec.ts\",\n \"assertions\": [\n \"one identified capable viewer and one legacy viewer issue byte-identical sequential reasonless closes while a third viewer lists every target before, between, and after but issues zero closes\",\n \"capable v25/v26 PTY root/descendant incarnations in separate worktrees survive, answer post-close input, and produce zero shutdown calls and zero daemon session-killed events\",\n \"legacy v25/v26 PTY root/descendant incarnations die through ordered immediate shutdown calls with one daemon session-killed event each, matching current-main behavior\",\n \"an unaddressed fifth-worktree PTY root and descendant survive with zero kill events, excluding global fanout\",\n \"the JSON reconstruction records request order, negotiated capabilities, viewer connection, worktree/tab/PTY ids, daemon PID/protocol, call site, and exact before/after process liveness\"\n ]\n },\n {\n \"file\": \"tests/e2e/daemon-generation-reconnect-safety.spec.ts\",\n \"assertions\": [\n \"the production scanner discovers v21/v22/v23/v24/v25 from v26 and every generation accepts repeated client hellos while every exact daemon, PTY-root, and descendant incarnation remains alive\",\n \"desktop and two remote profiles repeat lifecycle closes before and after client relaunch with zero session-killed events\",\n \"shutdown-dispose-failed drops named-pipe authority within the deadline and exact fixture cleanup leaves no process tree\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/mobile/e2ee/e2ee-channel-v2.test.ts\",\n \"assertions\": [\"mobile E2EE v2 continues to reject additive runtime capability metadata\"]\n },\n {\n \"file\": \"src/shared/remote-runtime/remote-runtime-client.test.ts\",\n \"assertions\": [\n \"one-shot and subscription runtime clients remain compatible while sending encrypted client authentication\"\n ]\n }\n ]" ], "demotionRule": "Keep experimental or quarantine if reconnect emits session-killed for a live canary, an exact root/descendant dies, an old server receives fallback destructive close, cleanup leaks a fixture process/pipe, or the gate flakes without a proven harness defect." }, @@ -7084,7 +7055,7 @@ "providers": ["local", "daemon", "ssh", "wsl", "remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": ["local", "daemon", "ssh", "wsl", "remote-runtime"], - "coverageNotes": "Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. The Codex restart suite and exact command/testFiles/assertionRef are removed; its mock account-change/remote-pane restart alarms are intentionally lost. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The 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. Audit3368 retires the whole host-session-launch unit source, including host-authority/create/ensure/legacy/Kimi/refusal/draft/options/prompt/cancel/kill/shared-disconnect and passive-sleep output callback alarms, without equivalent replacement. Its unit command token and test-file entry retire. Five unrelated macOS receipts remain verbatim and keep only their original scope; no fresh changed-selector/runtime/provider/process/UI/mobile/mixed-version/cross-platform evidence is claimed. Audit3359 retires the whole create-handoff suite. Supplied disposition, late completion, close-callback and metadata-bookkeeping alarms are intentionally lost without equivalent replacement; the compound unit selector and test-file entry narrow accordingly. Five unrelated macOS receipts retain their original scope. No fresh runtime, process-deduplication, physical provider/network, historical-import, 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. Audit2694 source-only review: Remove14 authored/14 expanded cases in the renderer completion wrapper family, including the complete bell/query-reply/stale-input factory, without replacement. Retain29 authored/34 expanded cases with unchanged callback bodies. Three removals are the existing pending2203 overlap and must be adopted/count-reconciled once; eleven are fresh removals. No current-source runtime or gate execution is supplied by this packet; dated evidence retains its original source scope and does not validate the reduced factory bytes. No equivalent replacement, physical provider, mixed-version, mobile, rendered UI, cross-platform, soak or measured-performance result is claimed. The existing command and testFiles selector retain tests/pty-connection-completion-and-notification.test.ts; no wrapper-specific assertionRef is removed. Historical selector results do not validate its changed reachable factories. Historical prior account (preserved verbatim): Audit2709 removes src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts: intentionally retire waiting out an older inventory and sharing a fresh post-operation request among concurrent callers. No equivalent replacement or fresh execution is claimed. Dated receipts remain historical evidence for their unchanged selectors only; they do not validate the reduced commands or full current gate. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Delete the complete pure orphan-topology suite and its file membership; preserve the other selectors from its combined command after archiving the original command string. Lost alarms are synthetic current-layout preservation, one-anchor grafting and ambiguous-anchor appending examples. Do not transfer their ownership/topology scope to sibling suites. Preserve all5 independent historical receipts exactly. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the mocked agent-session suite and its prospective selector and aliases. Retire all3 whole dated changed-selector receipts, preserving their original raw objects in historical gaps without transferring counts or durations. Preserve5 unrelated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial agent-operation service suite retains only concurrent retry joining with changed-fingerprint conflict. Retire its complete three-title assertion object: old-owner legacy fallback before side effects, nested SSH Pi transcript refusal and completed/ambiguous physical-commit replay fences are no longer backed. Other probe/launch option/ledger/failure/remote-inventory examples disappear as detailed below. No actual provider spawn, live SSH or physical commit proof is retained by this source. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1911: The complete provider PTY-inspection mock suite is removed: missing-provider rejection, stale-PTY renderer unverifiable mapping, preserved supplied renderer failures, and supplied transport-loss mapping alarms are intentionally lost. No actual terminal teardown, daemon error or remote transport was exercised. Only the deleted explicit source tokens, testFile and whole assertionRef are removed. Meaningful remaining source selectors/assertions and unaffected dated receipts retain their original scope. No equivalent replacement, fresh reduced-gate, native/platform/provider, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1623 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1495 intentionally deletes the orphan-owner suite: explicit owner/host predicate examples are retired; no equivalent replacement coverage or fresh result is claimed. Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/agent-completion-coordinator-pending-title-inspection.test.ts: Loses obsolete pending title process races, inspection failure suppression, explicit completion precedence and delayed remote inspection alarms. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1342 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audits1301 and1308 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Deterministic macOS tests cover controller claims, daemon and SSH/relay operation replay, mixed-version selection, runtime ownership, exact provisional handoff, durable terminal retirement, two independent viewer mirrors, guarded adoption of legacy live PTYs, and completion classification when either the outer remote transport or authoritative host/provider process inspection becomes unreachable. The adoption harness models v1.4.150 agent/setup/shell tabs, current-generation restart and reconnect, exact handle/incarnation/worktree/host checks, topology CAS, competing clients, split-pane/group restoration, WSL ownership, and SSH owner rejection. The secondary parity repro runs independent clients against one headless remote Orca runtime over encrypted pairing and a real daemon-backed PTY, with tokened fixture-process identity separated from unrelated Codex app-server startup probes. The automated primary topology runs an isolated headed macOS Orca desktop server plus a separate paired web client and proves viewer-local fresh/resume focus, exact legacy placement, writable PTYs, unrelated-terminal survival, and host/client cleanup. SSH coverage is provider/relay contract and fault-injection coverage only; it does not substitute for paired-server coverage. Live Windows, Linux, WSL, SSH, and physical paired-Linux hosts remain gaps. The isolated intent-owner ledger suite was removed. web-runtime-session.test.ts retains exact post-create handoff confirmation only; its previous fresh/resume presentation and publication-replay assertions are no longer current references. Those direct owner-partition, cap and RPC/focus alarms are lost; other agent-session evidence does not establish equivalence. Structured handoff and adopted-leaf focus references now point to their dedicated surviving fixtures. Mixed-version recovery retains actual old-host recovery followed by a new CLI tab; its unsupported/missing-evidence tables are removed. Orphan recovery retains in-flight adoption-conflict serialization only; previous topology/pruning and absence/adoption examples are removed. These removed projection, capability and adoption-shape alarms are lost; retained cases do not replace them. Audit1301: src/renderer/src/runtime/remote-runtime-session-tabs-inflight.test.ts reduced. Direct dedupe eviction/count and equal receipt-position sample loses authored alarm. No equivalent replacement coverage is claimed. Audit1308: src/renderer/src/runtime/web-session-tabs-sync-agent-handoff.test.ts removed. Exact provisional replacement and post-create exit confirmation handoff pipeline alarms disappear. No equivalent replacement coverage is claimed. Audit1313: src/main/runtime/terminal-orphan-topology.test.ts: Retain actual topology merge algorithms preserving disjoint subtrees and grafted/ambiguous shared anchors with independent expected trees. Remove duplicate leaf validator and empty/no-change passthrough examples. Lose basic validation and no-group/noop characterization; no renderer layout proof. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1342: src/renderer/src/components/terminal-pane/pty-connection-completion-and-notification.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "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. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. The Codex restart suite and exact command/testFiles/assertionRef are removed; its mock account-change/remote-pane restart alarms are intentionally lost. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The 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. Audit3368 retires the whole host-session-launch unit source, including host-authority/create/ensure/legacy/Kimi/refusal/draft/options/prompt/cancel/kill/shared-disconnect and passive-sleep output callback alarms, without equivalent replacement. Its unit command token and test-file entry retire. Five unrelated macOS receipts remain verbatim and keep only their original scope; no fresh changed-selector/runtime/provider/process/UI/mobile/mixed-version/cross-platform evidence is claimed. Audit3359 retires the whole create-handoff suite. Supplied disposition, late completion, close-callback and metadata-bookkeeping alarms are intentionally lost without equivalent replacement; the compound unit selector and test-file entry narrow accordingly. Five unrelated macOS receipts retain their original scope. No fresh runtime, process-deduplication, physical provider/network, historical-import, 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. Audit2694 source-only review: Remove14 authored/14 expanded cases in the renderer completion wrapper family, including the complete bell/query-reply/stale-input factory, without replacement. Retain29 authored/34 expanded cases with unchanged callback bodies. Three removals are the existing pending2203 overlap and must be adopted/count-reconciled once; eleven are fresh removals. No current-source runtime or gate execution is supplied by this packet; dated evidence retains its original source scope and does not validate the reduced factory bytes. No equivalent replacement, physical provider, mixed-version, mobile, rendered UI, cross-platform, soak or measured-performance result is claimed. The existing command and testFiles selector retain tests/pty-connection-completion-and-notification.test.ts; no wrapper-specific assertionRef is removed. Historical selector results do not validate its changed reachable factories. Historical prior account (preserved verbatim): Audit2709 removes src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts: intentionally retire waiting out an older inventory and sharing a fresh post-operation request among concurrent callers. No equivalent replacement or fresh execution is claimed. Dated receipts remain historical evidence for their unchanged selectors only; they do not validate the reduced commands or full current gate. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Delete the complete pure orphan-topology suite and its file membership; preserve the other selectors from its combined command after archiving the original command string. Lost alarms are synthetic current-layout preservation, one-anchor grafting and ambiguous-anchor appending examples. Do not transfer their ownership/topology scope to sibling suites. Preserve all5 independent historical receipts exactly. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the mocked agent-session suite and its prospective selector and aliases. Retire all3 whole dated changed-selector receipts, preserving their original raw objects in historical gaps without transferring counts or durations. Preserve5 unrelated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial agent-operation service suite retains only concurrent retry joining with changed-fingerprint conflict. Retire its complete three-title assertion object: old-owner legacy fallback before side effects, nested SSH Pi transcript refusal and completed/ambiguous physical-commit replay fences are no longer backed. Other probe/launch option/ledger/failure/remote-inventory examples disappear as detailed below. No actual provider spawn, live SSH or physical commit proof is retained by this source. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1911: The complete provider PTY-inspection mock suite is removed: missing-provider rejection, stale-PTY renderer unverifiable mapping, preserved supplied renderer failures, and supplied transport-loss mapping alarms are intentionally lost. No actual terminal teardown, daemon error or remote transport was exercised. Only the deleted explicit source tokens, testFile and whole assertionRef are removed. Meaningful remaining source selectors/assertions and unaffected dated receipts retain their original scope. No equivalent replacement, fresh reduced-gate, native/platform/provider, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1623 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1495 intentionally deletes the orphan-owner suite: explicit owner/host predicate examples are retired; no equivalent replacement coverage or fresh result is claimed. Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/agent-completion-coordinator-pending-title-inspection.test.ts: Loses obsolete pending title process races, inspection failure suppression, explicit completion precedence and delayed remote inspection alarms. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1342 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audits1301 and1308 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Deterministic macOS tests cover controller claims, daemon and SSH/relay operation replay, mixed-version selection, runtime ownership, exact provisional handoff, durable terminal retirement, two independent viewer mirrors, guarded adoption of legacy live PTYs, and completion classification when either the outer remote transport or authoritative host/provider process inspection becomes unreachable. The adoption harness models v1.4.150 agent/setup/shell tabs, current-generation restart and reconnect, exact handle/incarnation/worktree/host checks, topology CAS, competing clients, split-pane/group restoration, WSL ownership, and SSH owner rejection. The secondary parity repro runs independent clients against one headless remote Orca runtime over encrypted pairing and a real daemon-backed PTY, with tokened fixture-process identity separated from unrelated Codex app-server startup probes. The automated primary topology runs an isolated headed macOS Orca desktop server plus a separate paired web client and proves viewer-local fresh/resume focus, exact legacy placement, writable PTYs, unrelated-terminal survival, and host/client cleanup. SSH coverage is provider/relay contract and fault-injection coverage only; it does not substitute for paired-server coverage. Live Windows, Linux, WSL, SSH, and physical paired-Linux hosts remain gaps. The isolated intent-owner ledger suite was removed. web-runtime-session.test.ts retains exact post-create handoff confirmation only; its previous fresh/resume presentation and publication-replay assertions are no longer current references. Those direct owner-partition, cap and RPC/focus alarms are lost; other agent-session evidence does not establish equivalence. Structured handoff and adopted-leaf focus references now point to their dedicated surviving fixtures. Mixed-version recovery retains actual old-host recovery followed by a new CLI tab; its unsupported/missing-evidence tables are removed. Orphan recovery retains in-flight adoption-conflict serialization only; previous topology/pruning and absence/adoption examples are removed. These removed projection, capability and adoption-shape alarms are lost; retained cases do not replace them. Audit1301: src/renderer/src/runtime/remote-runtime-session-tabs-inflight.test.ts reduced. Direct dedupe eviction/count and equal receipt-position sample loses authored alarm. No equivalent replacement coverage is claimed. Audit1308: src/renderer/src/runtime/web-session-tabs-sync-agent-handoff.test.ts removed. Exact provisional replacement and post-create exit confirmation handoff pipeline alarms disappear. No equivalent replacement coverage is claimed. Audit1313: src/main/runtime/terminal-orphan-topology.test.ts: Retain actual topology merge algorithms preserving disjoint subtrees and grafted/ambiguous shared anchors with independent expected trees. Remove duplicate leaf validator and empty/no-change passthrough examples. Lose basic validation and no-group/noop characterization; no renderer layout proof. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1342: src/renderer/src/components/terminal-pane/pty-connection-completion-and-notification.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/8878", "https://github.com/stablyai/orca/issues/9151", @@ -7094,7 +7065,7 @@ "https://github.com/stablyai/orca/pull/10193" ], "invariant": "For every claim-capable execution route, one provider-session identity has at most one live PTY owner and one canonical host surface across concurrent clients, retries, reconnects, and stale publications. For paired structured fresh and resume requests, the authenticated owning runtime creates in background without a renderer window; activate=true focuses the exact requested leaf only on the requesting viewer, while activate=false changes no viewer focus. A live orphan may be adopted only when the controller proves its exact handle and incarnation, its worktree and host owner match, no competing visual owner exists, and a host topology CAS wins. A viewer may classify completion only from successful host/provider inspection or explicit lifecycle evidence; transport, handle, or provider unavailability remains unknown and breaks any consecutive-idle proof. A physical exit retires that exact incarnation durably so stale client state and host restart cannot recreate it. Mixed-version routes select the unchanged legacy request before any authority side effect or execution-owner-local filesystem access.", - "oracle": "Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. The Codex restart suite and exact command/testFiles/assertionRef are removed; its mock account-change/remote-pane restart alarms are intentionally lost. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The 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. Audit3368 retires the whole host-session-launch unit source, including host-authority/create/ensure/legacy/Kimi/refusal/draft/options/prompt/cancel/kill/shared-disconnect and passive-sleep output callback alarms, without equivalent replacement. Its unit command token and test-file entry retire. Five unrelated macOS receipts remain verbatim and keep only their original scope; no fresh changed-selector/runtime/provider/process/UI/mobile/mixed-version/cross-platform evidence is claimed. Audit3359 retires the whole create-handoff suite. Supplied disposition, late completion, close-callback and metadata-bookkeeping alarms are intentionally lost without equivalent replacement; the compound unit selector and test-file entry narrow accordingly. Five unrelated macOS receipts retain their original scope. No fresh runtime, process-deduplication, physical provider/network, historical-import, 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. Audit2694 source-only review: Remove14 authored/14 expanded cases in the renderer completion wrapper family, including the complete bell/query-reply/stale-input factory, without replacement. Retain29 authored/34 expanded cases with unchanged callback bodies. Three removals are the existing pending2203 overlap and must be adopted/count-reconciled once; eleven are fresh removals. No current-source runtime or gate execution is supplied by this packet; dated evidence retains its original source scope and does not validate the reduced factory bytes. No equivalent replacement, physical provider, mixed-version, mobile, rendered UI, cross-platform, soak or measured-performance result is claimed. The existing command and testFiles selector retain tests/pty-connection-completion-and-notification.test.ts; no wrapper-specific assertionRef is removed. Historical selector results do not validate its changed reachable factories. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Delete the complete pure orphan-topology suite and its file membership; preserve the other selectors from its combined command after archiving the original command string. Lost alarms are synthetic current-layout preservation, one-anchor grafting and ambiguous-anchor appending examples. Do not transfer their ownership/topology scope to sibling suites. Preserve all5 independent historical receipts exactly. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the mocked agent-session suite and its prospective selector and aliases. Retire all3 whole dated changed-selector receipts, preserving their original raw objects in historical gaps without transferring counts or durations. Preserve5 unrelated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial agent-operation service suite retains only concurrent retry joining with changed-fingerprint conflict. Retire its complete three-title assertion object: old-owner legacy fallback before side effects, nested SSH Pi transcript refusal and completed/ambiguous physical-commit replay fences are no longer backed. Other probe/launch option/ledger/failure/remote-inventory examples disappear as detailed below. No actual provider spawn, live SSH or physical commit proof is retained by this source. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1911: The complete provider PTY-inspection mock suite is removed: missing-provider rejection, stale-PTY renderer unverifiable mapping, preserved supplied renderer failures, and supplied transport-loss mapping alarms are intentionally lost. No actual terminal teardown, daemon error or remote transport was exercised. Only the deleted explicit source tokens, testFile and whole assertionRef are removed. Meaningful remaining source selectors/assertions and unaffected dated receipts retain their original scope. No equivalent replacement, fresh reduced-gate, native/platform/provider, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Race independent clients and repeated operation IDs, then assert one physical spawn and one canonical PTY/surface; inject exit-before-reply, provider disconnect, conflicting claim scope, old daemon/relay capabilities, reused handles, stale incarnations, owner mismatch, and topology revision conflict; assert safe adoption or explicit failure without a second spawn or wrong-process attachment. Run fresh/resume with activate true/false against an isolated headed desktop host and a separate paired client, then against isolated headless serve: assert host presentation stays background, only the requesting viewer focuses the exact leaf, inactive calls preserve client/DOM focus, a same-version publication replay cannot lose focus intent, and sibling-first split publication cannot consume exact-leaf intent. Restore legacy split panes and groups beside a newer host-owned tab, preserving exact predecessor/new/successor order, output, input, resize, titles, tab/leaf identity, active group, and multi-client convergence. For completion, drive a known running agent through outer transport loss, authoritative provider rejection, reconnect, explicit stop, real exit status, and successful hook completion; assert unavailable evidence never dispatches completion and two fresh authoritative idle samples are required after the gap. After exact exit, assert terminal and tab listings omit the surface, a stale publication cannot restore it, restart cannot resurrect it, exact tokened fixture PIDs are dead, and unrelated tabs/processes survive until scoped cleanup.", + "oracle": "Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. The Codex restart suite and exact command/testFiles/assertionRef are removed; its mock account-change/remote-pane restart alarms are intentionally lost. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The 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. Audit3368 retires the whole host-session-launch unit source, including host-authority/create/ensure/legacy/Kimi/refusal/draft/options/prompt/cancel/kill/shared-disconnect and passive-sleep output callback alarms, without equivalent replacement. Its unit command token and test-file entry retire. Five unrelated macOS receipts remain verbatim and keep only their original scope; no fresh changed-selector/runtime/provider/process/UI/mobile/mixed-version/cross-platform evidence is claimed. Audit3359 retires the whole create-handoff suite. Supplied disposition, late completion, close-callback and metadata-bookkeeping alarms are intentionally lost without equivalent replacement; the compound unit selector and test-file entry narrow accordingly. Five unrelated macOS receipts retain their original scope. No fresh runtime, process-deduplication, physical provider/network, historical-import, 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. Audit2694 source-only review: Remove14 authored/14 expanded cases in the renderer completion wrapper family, including the complete bell/query-reply/stale-input factory, without replacement. Retain29 authored/34 expanded cases with unchanged callback bodies. Three removals are the existing pending2203 overlap and must be adopted/count-reconciled once; eleven are fresh removals. No current-source runtime or gate execution is supplied by this packet; dated evidence retains its original source scope and does not validate the reduced factory bytes. No equivalent replacement, physical provider, mixed-version, mobile, rendered UI, cross-platform, soak or measured-performance result is claimed. The existing command and testFiles selector retain tests/pty-connection-completion-and-notification.test.ts; no wrapper-specific assertionRef is removed. Historical selector results do not validate its changed reachable factories. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Delete the complete pure orphan-topology suite and its file membership; preserve the other selectors from its combined command after archiving the original command string. Lost alarms are synthetic current-layout preservation, one-anchor grafting and ambiguous-anchor appending examples. Do not transfer their ownership/topology scope to sibling suites. Preserve all5 independent historical receipts exactly. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the mocked agent-session suite and its prospective selector and aliases. Retire all3 whole dated changed-selector receipts, preserving their original raw objects in historical gaps without transferring counts or durations. Preserve5 unrelated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial agent-operation service suite retains only concurrent retry joining with changed-fingerprint conflict. Retire its complete three-title assertion object: old-owner legacy fallback before side effects, nested SSH Pi transcript refusal and completed/ambiguous physical-commit replay fences are no longer backed. Other probe/launch option/ledger/failure/remote-inventory examples disappear as detailed below. No actual provider spawn, live SSH or physical commit proof is retained by this source. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1911: The complete provider PTY-inspection mock suite is removed: missing-provider rejection, stale-PTY renderer unverifiable mapping, preserved supplied renderer failures, and supplied transport-loss mapping alarms are intentionally lost. No actual terminal teardown, daemon error or remote transport was exercised. Only the deleted explicit source tokens, testFile and whole assertionRef are removed. Meaningful remaining source selectors/assertions and unaffected dated receipts retain their original scope. No equivalent replacement, fresh reduced-gate, native/platform/provider, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Race independent clients and repeated operation IDs, then assert one physical spawn and one canonical PTY/surface; inject exit-before-reply, provider disconnect, conflicting claim scope, old daemon/relay capabilities, reused handles, stale incarnations, owner mismatch, and topology revision conflict; assert safe adoption or explicit failure without a second spawn or wrong-process attachment. Run fresh/resume with activate true/false against an isolated headed desktop host and a separate paired client, then against isolated headless serve: assert host presentation stays background, only the requesting viewer focuses the exact leaf, inactive calls preserve client/DOM focus, a same-version publication replay cannot lose focus intent, and sibling-first split publication cannot consume exact-leaf intent. Restore legacy split panes and groups beside a newer host-owned tab, preserving exact predecessor/new/successor order, output, input, resize, titles, tab/leaf identity, active group, and multi-client convergence. For completion, drive a known running agent through outer transport loss, authoritative provider rejection, reconnect, explicit stop, real exit status, and successful hook completion; assert unavailable evidence never dispatches completion and two fresh authoritative idle samples are required after the gap. After exact exit, assert terminal and tab listings omit the surface, a stale publication cannot restore it, restart cannot resurrect it, exact tokened fixture PIDs are dead, and unrelated tabs/processes survive until scoped cleanup.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/shared/claimed-agent-pty-owner.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/runtime/session-construction/agent-session/orca-runtime-agent-session-operation.test.ts src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts", @@ -7291,6 +7262,10 @@ "Add live SSH/WSL provider evidence before claiming full provider coverage; Docker SSH proves only the SSH provider/relay path." ], "knownGaps": [ + "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.", + "Audit3814 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle from a Codex ready prompt even when stale startup lines remain :: Stale MCP startup lines must not block a later Codex ready header.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle when a stale Codex prompt is followed by the ready header :: A Codex ready header following a stale resume prompt must satisfy tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for an idle Cursor lane past its dismissed trust dialog (#8210) :: Later Cursor idle banner overrides retained trust dialog.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not block a mid-run Cursor lane on its dismissed trust dialog (#8210) :: Dismissed trust dialog must not report blocked for later busy Cursor; wait times out.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not classify unrelated press-enter prompts as Codex blocked prompts :: Unidentified press-enter text must time out rather than be classified Codex blocked.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for quiet background PTY agents without OSC titles :: Quiet Codex background terminal without OSC title eventually resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: sends agent prompts as bracketed paste before submit :: Driving prompt escapes embedded paste-end ESC, writes one framed paste then CR, and counts bytes.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: settles a foreground Codex prompt when launch metadata has not arrived :: Codex inferred from foreground without launch metadata waits for composer marker/quiescence before one CR.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: gives a late Codex render marker a fresh quiescence window :: Marker arriving at7.9s re-arms fresh quiet window instead of submitting at initial cap.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: writes large agent prompt paste frames atomically before delayed submit :: A prompt larger than input chunk budget is a single paste write before delayed CR with exact byte count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects oversized terminal.send text before provider writes :: Oversized ordinary terminal.send rejects input-too-large before any provider write.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects focusing an exited background terminal session :: focusTerminal refuses terminal_exited before invoking background reveal.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: pastes the same bytes the desktop draft paste sent for the prompt :: Launch-ready prompt normalizes CR/LF and renders embedded ESC visibly identically to desktop bracketed paste.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: keeps a prompt into a running agent behind the render settle, as before :: Driving prompt remains held through7s repaint activity then submits once by9s.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reports a queued PTY focus as not navigated when its notifier disappears :: Queued PTY focus and completed active reveal report not navigated after notifier removal; no second reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: does not invoke a stale graph-leaf focus notifier after queued PTY work :: Queued graph-leaf focus must not invoke old notifier after preceding PTY reveal and notifier removal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: paginates retained terminal output with explicit limits and truncation metadata :: Preview120lines, fractional limits,50/200 pages, retained2000line truncation and future-cursor metadata stay consistent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: falls back to renderer visible screen when uncursored TUI tail is blank :: Substantial blank uncursored tail uses mounted renderer visible screen with zero scrollback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reads and shows the runtime-owned alternate-screen grid without serialization :: Actual runtime alternate-screen grid provides read/show content without renderer/provider serialization.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: classifies older provider alternate-screen snapshots from ANSI :: Older provider without alternateScreen metadata classifies ANSI alternate entry and returns Remote Vim screen.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: honors the last ANSI screen transition when older provider metadata is absent :: Last ANSI alternate exit overrides earlier entry when explicit provider mode metadata is absent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: rejects a full provider screen frame after live output advances :: Live output arriving during second full-screen capture causes screen-unavailable rather than stale full frame.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: shares one provider snapshot between concurrent read and show calls :: Concurrent read/show share one successful provider snapshot and both receive Shared TUI content.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps cursor reads provider-free on restored alternate-screen PTYs :: Restored alternate-screen cursor transcript reads never acquire provider snapshot.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: backs off after a provider snapshot failure instead of retrying for show :: Failed provider capture is cached/backed off so later show does not retry.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: falls back once to a mounted renderer when a known alternate provider fails :: A known-alternate failed provider capture falls back exactly once to newly mounted renderer.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: bounds provider visible frames for read and show responses :: Provider visible read/show use six bounded lines and300character preview.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps renderer-fallback composer drafts separate from terminal output :: Renderer fallback strips dim composer draft from terminal output and exposes draft separately.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: does not use renderer visible-screen fallback for a short blank shell tail :: Two blank shell lines must not trigger renderer screen fallback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: trims terminal tail character budget without per-line array shifts :: Tail builder trims to256KiB with correct retained suffix and no Array.shift calls.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains ANSI-only status redraws instead of appending every frame :: Repeated erase/redraw replaces preview until newline then publishes one completed cursor row.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains split multi-line ANSI footer redraw state across chunks :: CUU state across chunks retains corrected footer rows and publishes new cursor entries.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not let stale lower rows hide earlier corrected footer rows from cursor reads :: Earlier corrected footer row must not be hidden by stale lower rows in cursor reads.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: bounds completed transcript entries from a single multi-line redraw chunk :: Single redraw chunk bounds completed transcript to2000retained lines and correct oldest/next/latest cursors.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains multi-line ANSI redraws when the last footer row stays partial :: Partial final redrawn row appears in preview but cursor sees it only after newline.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not retain split ANSI controls as visible terminal preview text :: Split color/mode escapes never leak preview fragments; long split OSC title truncates at MAX_OSC_TITLE_CHARS.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains same-line redraw cursor position across split full-line erase chunks :: Full-line erase preserves column across chunks so XY follows three spaces rather than old ABC.\nsrc/main/runtime/orca-runtime-tests/conpty-stream-read.spec.ts :: fills the requested line count even when blank rows sit below the prompt :: Blank rows below a ConPTY prompt must not consume the requested nonempty-line count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: does not retain split ST-terminated string controls as preview text :: Split ST-terminated Kitty/string controls must remain excluded from preview text.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects split OSC titles before retaining terminal previews :: Split BEL OSC title must update working title/status without leaking into preview.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects ST-terminated OSC titles split before the final backslash :: ST OSC split before final backslash must update title without leaking framing.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: preserves a trailing escape after a completed OSC title :: Completed OSC followed by pending ESC must preserve the next idle-title transition.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: seeds newly synced leaves from PTY pending ANSI state :: A newly synced graph leaf inherits pending ANSI so a split color fragment cannot leak.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: bounds retained partial terminal output before preview reads :: Partial terminal state stays capped at 4000, preserves retained array identity, and preview truncation/cursor output remains correct.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: submits the mail pointer to Cursor Agent only after the paste-burst delay :: Cursor mailbox pointer Enter must wait through the paste-burst delay; this is a real input-timing alarm intentionally retired.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts :: adopts a v1.4.150-shaped agent, setup, and shell orphan as one topology transaction :: Stale incarnation refuses without topology change; three agent/setup/shell lanes adopt atomically with layout/group/revision and preserved read/input/resize; exact replay is idempotent and competing owner refuses.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: retires the exact worker when it exits after renderer reveal :: Exact worker exit after reveal retires that worker and its surface.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: re-reveals a recovered worker after the renderer graph epoch changes :: Changed renderer graph epoch invalidates reveal receipt and forces another reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: defers recovery when the renderer omits the exact reveal identity :: Missing exact reveal identity defers recovery after two attempts.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: reconciles a same-id process replacement before headless adoption :: A process replacement before headless adoption must fence off stale ownership.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retires provider resume only after authoritative inventory proves the legacy PTY exited :: Authoritative owning-host inventory overrides false local hasPty, avoids SSH scanning, retires exited provider resume/surface, adopts live workers without headless reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retries inventory and unknown liveness without revealing a ghost worker :: Inventory failure and unknown liveness must retry without ghost reveal, eventually adopt, and stop retrying.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: refuses a live reserved pane before issuing a handle or revealing it :: A requireFreshPane launch receiving a live reserved owner must reject before handle/reveal/kill, and release its claim. No equivalent replacement claimed.", + "Audit3806 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: skips a listener unsubscribed mid-fan-out even with mobile exclusions active :: A listener removed by an earlier listener during one fanout is not called, including with a side-effect-excluded mobile listener present.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: retains bytes emitted before a fresh daemon spawn resolves :: Bytes and title arriving before an initial zero/reset provider response survive in the serialized headless buffer with their counted sequence.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits command-finished facts with best-effort exit codes across chunk splits :: A split OSC133 D exit code becomes130 and a missing code becomes null in ordered command-finished facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits pr-link facts once per URL with batch attribution :: A split GitHub PR URL yields42 rather than4, emits42/43 once each, and carries PTY/worktree/tab attribution.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits 2031-subscribe facts across chunk splits :: Split ESC[?20 then31h emits exactly one2031-subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: restores a provisional 2031 subscribe when daemon scan authority returns :: Returning daemon scan authority with partial scan seed and pending2031 subscription restores exactly one subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers the tracked title over the renderer snapshot lastTitle :: A synthetic live Cursor title overrides stale renderer lastTitle while preserving renderer snapshot source.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers provider history over a partial headless mirror for requested snapshots :: Authoritative requested snapshots return supplied provider frame/history/seq rather than a partial headless mirror, requesting5000rows.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: tracks live alternate-screen transitions after a provider snapshot :: Provider alternateScreen true is accepted, then live1049l/1049h update isTerminalAlternateScreen false/true.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: translates reset provider snapshots without retaining the old title :: A reset provider snapshot translates new local seq into the runtime domain and replaces Old process title with New process.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits the chunk agentStatus events before its side-effect batch :: Agent status callback precedes side-effect batch callback for one coalesced OSC9999/title/bell chunk.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: still emits a throwing chunk’s facts under its own seq, not the next chunk’s :: A tracker throw still flushes first chunk title facts under its own seq, and second chunk does not inherit those facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: seeds the lazily created tracker from the daemon-snapshot title :: A lazy tracker hydrated from renderer snapshot title Codex working emits agent-idle on later Codex done.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits command-code-working facts only after the banner arms the scrape :: Unarmed Thinking text emits no facts; a Command Code0.27.3 banner then hardcoded colored spinner text emits attributed command-code-working with the submitted prompt.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits a command-code-done fact when the idle composer returns :: After hardcoded banner/working text, returned idle composer emits command-code-done with the earlier submitted prompt.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: resizes the headless mirror after an accepted desktop PTY resize :: An external accepted resize produces the resized dimensions and same status-frame lines as a separately driven reference emulator.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: replaces suffix-only headless state with the recovered renderer snapshot :: Replacing suffix-only state removes old suffix, retains renderer history plus later output/cwd, and returns the live47x40PTY grid.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: stamps SSH connection identity on runtime terminal status :: A synthetic mounted-leaf OSC9999 status after registerPty carries the supplied SSH connectionId.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: does not retain WSL context when a PTY id is reused :: After exit and same-ID new null distro context, OSC7 file://server/share/repo uses UNC server path rather than old Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: preserves immutable context while a live daemon attach is unresolved :: preparePtyExecutionContext with preserveExisting refuses a supplied Debian replacement and subsequent OSC7 keeps original Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts :: projects frame-independent live state through main buffer snapshots :: Main-buffer snapshot puts focus-report/cursor-visibility modes in frameRestoreAnsi, excludes STATIC-FRAME there and includes it in data.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.ts :: continues terminal agent status fanout when a callback throws :: Throwing on the first status callback does not prevent second payload delivery and logs contextual error.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: returns a title-only replay snapshot and never historical attention :: Lose replay:true/title-only fact projection despite earlierbell and unknownPTYnull. No actual delivered-history notification or reattach behavior was exercised. No equivalent replacement claimed.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects a handle rebind while a controller-less status check yields :: A handle rebound while the null-controller status continuation yields must throw terminal_handle_stale.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects confirmation evidence when the owning PTY exits :: A pending strong confirmation resolving after owning PTY exit must reject terminal_exited.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-03.spec.ts :: keeps ordinary terminal send suffix failures on the existing not-writable contract :: Ordinary send writes text but refused CR must throw terminal_not_writable with beforeWrite twice and afterWrite once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell the execution host cannot apply instead of spawning its default :: Requested Windows shell on POSIX must refuse before spawning a default shell.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: quotes the agent startup command for the requested shell, not the host default :: Requested cmd shell must override PowerShell default quoting for agent startup command.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: keeps restored receipts outside a targeted worktree scan :: Targeted scan removes the moved-worktree receipt while preserving another worktree receipt.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: observes setup command completion without waiting for its interactive shell to exit :: Nonzero completion marker 17 resolves while interactive shell remains running.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: falls back to setup terminal exit when no completion signal is available :: Setup completion observer without token falls back to actual exit code 9.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: cancels setup completion observation when the caller aborts :: Abort rejects with the original reason and unsubscribes once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps observing after an uncertain setup terminal status :: Unknown exit waiter result must leave observation pending until completion marker arrives.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh omits a record :: Controller inventory omission disconnects the record but preserves its retained transcript.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh times out :: Hung inventory timeout leaves connected record and retained transcript intact.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle for adopted background PTY handles from the renderer title :: An adopted background handle resolves tui-idle from ready Codex renderer title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves live-leaf tui-idle from an OpenCode native title :: A live leaf resolves tui-idle from an OpenCode native title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from a Codex ready prompt preview :: A supplied Codex prompt preview resolves tui-idle without an actual agent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from an Antigravity prompt before the model line :: A supplied Antigravity prompt before model line resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell with no workspace instead of creating a default-shell tab :: Workspace-less explicit shell must reject before renderer default-tab request or spawn. This real guard/wiring alarm is deliberately retired.", + "Audit3798 per-case accepted losses:\nsrc/main/runtime/orca-runtime-tests/paired-settings.spec.ts :: awaits navigation-only updates from paired clients (%s) :: Updating only claudeSubagentNavigationEnabled waits for the actual controller call to the supplied pending Claude-view reconcile for both on/off values.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: drops a client page record even when its close command cannot be issued :: A removed workspace loses its runtime client-page record and headless browser projection despite close delivery_required rejection, and emits the asynchronous warning.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: leaves client-hosted pages alone when another host still owns the same worktree id :: Removing runtime:env-b metadata with local ownership leaves the local same-ID client page unchanged and issues no close command.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: marks live bindings again when reopening after a promoted window closes :: A reopened window marks its still-registered live worktree in activeWorktreeIdsOnShutdown after the first promoted window closes.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: preserves live SSH session identities when promoting a headless runtime :: Headless-to-desktop promotion records active worktree, SSH connection and remoteSessionIdsByTabId from the supplied surviving SSH PTY/session.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores a surviving renderer when its reload is cancelled :: A sole ready renderer reload cancelled under its current renderer fence returns true and becomes ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores headless authority when desktop promotion navigation is cancelled :: A cancelled desktop promotion with headless recovery returns false while headless authority remains ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: moves a desktop graph to unavailable when its reload times out :: A ready desktop graph without a headless fallback becomes unavailable at the reload deadline and retains its window/epoch.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: recovers a failed headless promotion and accepts a later renderer generation :: A promotion failure restores ready headless authority; a later valid same-window graph publishes ready desktop authority.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: clears a failed pane recovery so a later reconnect can retry :: After relay_reconnecting rejection, the pending recovery lock clears and the same pane/handle can call createTerminal a second time and return its supplied replacement.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: still preserves a CLI agent leaf when the reloaded renderer has not rebound its PTY :: An empty graph published during renderer reload preserves a preallocated live CLI PTY as one listable terminal before renderer rebind.\nsrc/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts :: keeps a no-incarnation handle across an in-graph pane remint :: Within one graph lifetime an unversioned PTY reminted onto another leaf retains its issued handle and resolves its old exit waiter after onPtyExit.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: matches explicit-id cwd PTYs when the resolved worktree cache is incomplete :: An explicit target absent from a fresh incomplete resolved cache adopts only its cwd PTY, rejects nested cwd PTY and does not rescan Git.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: ignores cwd-only controller PTYs for malformed explicit worktree IDs :: Malformed id:repo-1:: returns no terminals, does not adopt cwd-only controller PTY and avoids Git rescanning.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: refuses an SSH-backed create for mobile/runtime callers instead of creating locally :: Loss of this public unserved SSH create error-class/no-local-add/no-local-list alarm.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: records an app-selected parent workspace as a manual action :: Loss of the local runtime folder-parent manual origin, active-workspace source and explicit confidence projection alarm; no claim that SSH or cleanup coverage replaces it.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: browses runtime server directories before projects are added :: Loss of this public runtime alarm for browse availability before registration, directories-first lexical ordering and native path flavor.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: lists drive roots for a server-root browse :: Loss of the Windows public slash-root drive enumeration smoke and presence of the temporary directory drive.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations-part-02.spec.ts :: creates a missing runtime parent before creating the project directory :: Loss of this runtime createRepo recursive missing-parent/child existence and registered-path alarm.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: preserves selected project %s when a hosted parent is known :: Loss of both parent-selected and origin-selected normal fork-link projection/persisted upstream alarms plus exact single-probe count.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: links a current enterprise remote despite unavailable metadata and a retained %s :: Loss of normal current-enterprise-origin linking with stale automatic GitHub avatar or protected file image, unchanged icon assertion, and serialized project identity under unavailable metadata.", "Audit2694 intentional coverage losses (source-only, no replacement): src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-command-finished-interrupt-arbitration.spec.ts: 'drops the command-finished status when pending interrupt inference is rejected': Loses the standalone rejected-inference-to-drop alarm; the delayed-write rows remain but are not equivalent to this immediate rejection example. src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-bell-query-reply-and-stale-input.spec.ts: 'forwards raw onData after a bell as a query reply': Loses raw onData forwarding after the manually raised bell, including its hibernation-counter expectations. src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-bell-query-reply-and-stale-input.spec.ts: 'blocks onData on a stale codex pane': The real isCodexPaneStale guard executes, and removing it would allow the typed a to reach transport. Intentionally loses this genuine stale-account typing refusal alarm. No retained query-reply test is claimed equivalent. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'omits byte-parser callbacks from the local transport options': Loses local main-authority callback omission and lifecycle callback presence checks. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'keeps byte-parser callbacks on remote-runtime transports': Loses remote-runtime parser callback preservation and factory-argument alarm, including this compatibility boundary; no mixed-version execution is covered. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'consumes pty:sideEffect facts with the live-path policy after spawn': Loses title/bell fact routing and exact 250ms delayed fake notification example. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'schedules the completion notification for genuine working→idle facts': Loses positive main-fact working-to-idle scheduling alarm. Retained stale/race cases do not replace this positive example. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'drops the agent status from a command-finished fact like the byte path did': Loses command-finished fact-to-drop routing and removeAgentStatus noncall alarm. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'routes pr-link facts to the worktree PR observer': Loses PR-link fact forwarding, worktree/tab/PTY arguments alarm; retained raw-byte nonconsumption is not equivalent. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'seeds and settles Command Code status from command-code facts': Real Command Code seed/settle policy runs. Loses positive seed, prompt payload, and 1499+1ms completion boundary alarm; retained newer-working cancellation is not equivalent. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'does not byte-scan Command Code output — facts are the only consumer': Loses Command Code-specific no-byte-parser alarm. Retained PR/OSC raw-byte exclusion does not cover this parser. src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-notification-settings-gating.spec.ts: 'shares one raw store subscriber for agent-complete notification settings across panes': Actual shared subscribe/unsubscribe runs. Loses shared single-subscription and final-pane unsubscribe lifetime alarm, with no replacement claimed. src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-task-complete-dispatch.spec.ts: 'dispatches agent-task-complete for generic Codex spinner titles after process identity is confirmed': Real coordinator evidence path runs over fake process answers. Loses positive generic-title/confirmed-Codex completion and inspectProcess-argument alarm. src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-task-complete-dispatch.spec.ts: 'normalizes Pi-compatible remote titles to authoritative OMP launch identity': Real owner-compatible normalization runs. Loses Pi-to-OMP title/status normalization, active tab label, OSC observation, and retained launch-identity example; no real remote transport or equivalent replacement. Wrapper cleanup removes only the deleted bell factory import and its registration-only describe block; no additional authored removal credit. Audit2694 source-only review: Remove14 authored/14 expanded cases in the renderer completion wrapper family, including the complete bell/query-reply/stale-input factory, without replacement. Retain29 authored/34 expanded cases with unchanged callback bodies. Three removals are the existing pending2203 overlap and must be adopted/count-reconciled once; eleven are fresh removals. No current-source runtime or gate execution is supplied by this packet; dated evidence retains its original source scope and does not validate the reduced factory bytes. No equivalent replacement, physical provider, mixed-version, mobile, rendered UI, cross-platform, soak or measured-performance result is claimed. The existing command and testFiles selector retain tests/pty-connection-completion-and-notification.test.ts; no wrapper-specific assertionRef is removed. Historical selector results do not validate its changed reachable factories.", "Audit2145 accepts removal of canned runtime metadata/guard/forwarding, fake in-memory persistence, private work-count and wrapper-duplication tests from the construction/orca-runtime.test.ts aggregate, plus the two automation run-context guards from runtime-workspace-launch-contracts.test.ts. Retained race, framing, physical completion and ownership callbacks remain byte-identical. Existing commands remain valid selectors; historical receipts stay unchanged and provide no fresh validation or replacement coverage for the reduced suites.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/main/runtime/construction/orca-runtime.test.ts: remove only literal registration import/call pairs await import('../orca-runtime-tests/worktree-setup-and-startup.spec'), await import('../orca-runtime-tests/gitlab-and-pr-bases.spec'); no additional authored credit. src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts: routes tab switch and capture start by explicit page id; accepts focus on tab switch without altering bridge args (focus is main-side concern); keeps terminal cwd resolution fail-soft when the provider is unavailable. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts: drops the bounded scan cache when orphan-cleanup removal completes; clears optimistic reconcile tokens when a CLI worktree removal succeeds; emits drift without mutating when the fetched base fast-forwards created HEAD; emits base_changed without mutation when the fetched base rewrote history; skips stale-token reconciles without mutating or emitting stale status; emits unknown without mutation when fetch fails or the base ref is missing. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts: routes runtime preserved-branch force-delete through the selected WSL project runtime; replies to a waiting client with the error of a delete that fails after acceptance; treats forced runtime deletion of an already-missing unregistered worktree as cleanup; treats normal runtime deletion of an already-missing unregistered worktree as cleanup. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts: warns that a missing-repo removal only forgot the workspace; restores runtime watchers when CLI worktree deletion fails after teardown; does not re-spend the drain budget on a removal after a wedged install was abandoned; routes runtime worktree removal through the selected WSL project runtime; force-deletes a branch that was preserved by runtime worktree removal. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts: records GitLab pasted-project recents only after successful runtime lookup; threads explicit origin preference through runtime WSL PR base resolution; resolves local GitLab fork MR bases from the target project MR head ref; captures the fork MR head from a dedicated ref, not the shared FETCH_HEAD; keeps the durable MR head when the head fetch fails but the local ref resolves; routes runtime GitLab fork MR base git calls through the selected WSL project runtime. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts: passes SSH connection ids through GitLab task operations; routes runtime GitLab issue, MR, work-item, and todo actions through the selected WSL project runtime; routes runtime GitLab MR details, review-management, job, and pasted URL actions through the selected WSL project runtime; normalizes runtime GitLab issue list arguments like the desktop IPC path. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts: does not warn when setup is explicitly skipped for CLI-created worktrees; puts the agent a create starts in the first default tab, as the window does; keeps the 8s main-runtime startup readiness budget for agents without an override; gives OpenCode the 20s main-runtime startup readiness budget; launches explicit startup agents with prompts for CLI-created worktrees. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts: returns a setup launch payload for CLI-created worktrees when hooks are explicitly enabled; does not hand the window a setup main never tried to start; passes the selected Windows setup shell into runtime runner generation; follows normal setup policy for CLI-created worktrees without activating them; uses returned WSL setup shell metadata when runtime spawns setup; uses the shell-aware setup runner for windowless creates without a startup command; reports the in-process setup hook as running when nothing can launch the runner. src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts: coalesces two clients sleeping the same host worktree; stops exactly the expected live PTYs for a worktree; explains a refused workspace close instead of throwing the raw refusal enum. src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts: marks the desktop-active worktree as isActive; includes SSH-backed worktrees in the mobile worktree summary; caches repeated malformed path misses before normalizing them again. src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts: keeps title-only foreground work ahead of monitoring in another pane; keeps a local hook row while a connected PTY still backs its pane; keeps an OSC row via its connected PTY after the pane binding is cleared. src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts: resolves files through a source-visible linked-checkout worktree; marks saved session tabs with live PTYs as host sidebar activity; attributes live legacy PTYs from saved layout bindings when their panes are hidden; marks saved browser tabs as host sidebar activity like desktop; falls back to the path-keyed GitHub cache entry; includes folder workspaces in compact worktree summaries for mobile; attaches inline agent rows from the latest OSC 9999 status; projects monitoring over a title-derived working status. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts: pushes to an idle pane when the only live waiter filters out the message type; resolves a registered waiter without PTY-injecting when the leaf is already idle; keeps already-idle status after tui-idle wait for immediate message delivery; resolves message waiters when notifyMessageArrived is called; does not resolve type-filtered message waiters for unrelated message types; removes message waiter abort listeners after message arrival; resolves message waiters on timeout when no message arrives. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts: delivers pending mail via notifyMessageArrived when the recipient is already idle; does not keep retrying when every pending row was already pointed; repoints pending rows restored with a live-idle coordinator. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts: rolls back a half-created terminal whose surface never publishes. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts: rejects startup prompts for agents that require post-ready stdin; uses portable Unix quoting for mobile agent launch commands in WSL project runtimes; keeps PowerShell quoting for mobile agent launch commands in Windows host runtimes; uses cmd.exe quoting for mobile agent launch commands in local Windows host runtimes; publishes headless mobile session agent identity with synthesized PTY status; rejects disabled mobile session agent launches before spawning; validates mobile terminal insertion anchors before resolving agent launch commands. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts: coalesces a reconnect close burst onto one authoritative PTY inventory; keeps an explicit user close destructive while the PTY is live; builds mobile session agent launch commands on the runtime host; injects mobile quick-command prompts into the host-built agent startup command. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts: closes persisted headless terminal parents before any prior list call; tears down a serve-owned headless tab on close while a renderer is attached so it cannot resurrect; defers a renderer-published pending tab to the renderer instead of tearing it down; returns a delegated close outcome with no selection tombstone when the renderer owns the outcome; tears down a runtime pending shell the renderer never adopted on close. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts: materializes a plain shell when the pending tab has no launch agent; hydrates legacy persisted terminal tabs without layout entries; reads and indexes the full agent-status snapshot once per mobile projection; kills persisted SSH PTYs when closing hydrated headless tabs before pane metadata is restored; materializes hydrated pending headless terminals with the persisted session identity. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts: hydrates a persisted SSH-owned pane before an attached renderer publishes its graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts: publishes the desktop's tab name over the live agent title, and the live title without one; uses fresh neutral PTY titles over stale mobile snapshot and OSC titles; operates PTY-backed mobile session terminals without a renderer graph; reuses pane close for live PTYs that do not own a renderer tab; lists PTY-backed mobile session terminals without a renderer graph; shows and resolves active PTY-backed mobile session terminals without a renderer graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts: creates mobile session terminals for folder workspaces in a headless runtime server; spawns fresh headless SSH mobile session terminals instead of reattaching synthetic local ids; hydrates headless mobile session terminals from the host workspace session; keeps live headless mobile session terminals when a desktop renderer publishes without them; publishes laptop-created remote runtime split terminals to phone session tabs. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts: does not report headless wake degradation without sleeping records; does not wake slept agents for non-mobile session-only activation; does not rewrite unread metadata when a mobile activation finds the worktree already read; returns unread:false from worktree.ps after a mobile activation clears the flag; materializes pending mobile session terminals without focusing desktop clients; closes browser mobile session tabs when addressed by browser workspace id. src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts: resolves mobile terminal surfaces by exact split leaf; closes the matching mobile terminal UUID leaf without closing the whole tab; closes the whole mobile terminal tab when addressed by parent tab id; activates the active split leaf when addressed by parent tab id; clears unread metadata on mobile worktree activation without focusing desktop clients; wakes slept agents on the host renderer when a phone activates a worktree. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts: publishes the hook provider session on a headless mobile tab so native chat can address the transcript; recovers the agent type from the hook row when the pane was launched without an agent hint; reads one agent-status snapshot per projection, not one per terminal tab; waits for unknown-launch foreground owner before publishing Pi-compatible mobile status; keeps Pi-compatible mobile session status as Pi for an unknown-launch foreground pi PTY; keeps renderer-vetted mobile agent status for custom-titled terminals. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts: publishes terminal surface agent status for paired web clients; preserves authoritative OMP identity for Pi-compatible remote terminal snapshots; normalizes a remote OMP title without republishing omitted launch identity; skips the foreground-process probe when the PTY launch agent is already known; probes the foreground process only on a status transition for unknown launch agents; passes the client signal and the slept-worktree refusal to the spawn. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts: does not use stale runtime-created PTY status when a neutral PTY title exists; recognizes runtime-created Codex PTY handles from the ready prompt; recognizes runtime-created Antigravity PTY handles from the ready prompt; recognizes live leaf Antigravity terminals from the ready prompt; recognizes a later Antigravity header with a prompt but no model line; keeps mobile terminal surfaces visible while their leaf handle is pending. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts: lets Claude agents management titles clear stale runtime-created title status; does not recognize live Claude agents panes from a Claude foreground process; does not let stale tab-level agent titles override current neutral pane titles; lists live terminals with fresh pane titles over stale tab titles; lets adopted neutral pane titles use non-shell foreground fallback; lets adopted neutral pane titles retry wrapper foregrounds until recognized; authorizes settled CLI prompts only after positive %s foreground identity; does not recognize arbitrary foreground TUIs as running agents; lets live neutral pane titles retry wrapper foregrounds until recognized; lets current Claude agents PTY titles override stale runtime-created OSC titles; does not let stale Claude agents OSC titles suppress current PTY title activity. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts: keeps preallocated terminal handles valid across renderer reloads; preserves runtime-created PTY process identity after graph unavailable; keeps prompt bindings fenced across runtime restarts without provider incarnation; recognizes runtime-created PTY handles with agent launch titles; does not treat a bare Cursor Agent native title as a running agent session; uses stale runtime-created PTY status when there is no title or foreground evidence. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts: keeps orphaned list and show writability aligned with the send gate. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts: cancels a coalesced SSH worker recovery retry when its provider disconnects. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts: retries renderer reveal before clearing an adopted legacy worker sleeping record. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts: recovers exported ORCA_TERMINAL_HANDLE from discovered live PTY sessions. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts: applies ANSI erase-from-start line controls in retained previews; applies ANSI stripping for private or intermediate CSI line controls; applies ANSI stripping for unsupported erase-line modes; reveals an agent terminal under the pane the caller reserved; keeps a fresh %s pane host-owned when a desktop window is available; keeps desktop publication %s separate from the reserved host spawn; mints its own pane when the reserved leaf is malformed, and reports the one it used; starts an agent terminal with the model the caller picked; starts an agent terminal without a model flag when no pick was made; attributes a startup-agent launch named %s as %s; attributes a fresh agent session the host builds as unknown; leaves a bare agent command the user typed out of launch attribution. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts: trims oversized terminal output bursts without per-line array shifts; builds terminal previews without mapping the full retained tail; keeps recent PTY replay output capped without needing previous data for large chunks; applies terminal redraw controls before retaining previews; applies ANSI terminal redraw controls before retaining previews; retains multi-line ANSI footer redraws instead of appending old frames; keeps the cursor column when erasing full lines in multi-line redraws; applies ANSI split redraw controls without leaking raw params. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts: returns renderer visible screen lines through terminal.read RPC JSON result; separates composer drafts from provider-owned terminal screens. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts: reports an in-flight PTY focus as not navigated when its notifier disappears; reports graph-leaf focus as not navigated without a host notifier; grounds the provider mode tracker before a later chunk, in the emulator order; grounds an in-flight provider snapshot capture so it cannot publish the pre-reset screen; waits for terminal exit and resolves with the exit status; keeps terminal read payloads bounded while retained output remains pageable; trims terminal read preview character budget without per-line array shifts. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts: submits a silent Claude composer once after the bounded render fallback; chunks large terminal.send text before provider writes; yields chunked terminal input through immediates between writes; yields while validating accepted large terminal.send text before provider writes; reveals a background terminal session when focusing its handle; replays captured launch config when focusing a background agent session; reveals background terminal sessions with the freshest PTY title; renames background terminal handles without requiring a visible tab; keeps a background terminal handle stable while reveal adoption is racing. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts: resolves tui-idle when a stale Codex prompt is followed by Antigravity readiness; returns an agent-neutral blocked wait result for update prompts; returns an agent-neutral blocked wait result for workspace trust prompts; returns an agent-neutral blocked wait result for cwd selection prompts; returns a blocked wait result for Codex model migration prompts; returns a blocked wait result for Codex startup hook review prompts; returns an agent-neutral blocked wait result for generic interactive prompts; splits text and enter writes for background terminal handles; types the lead line for %s: %s; submits through the agent-specific PTY timing policy for %s. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts: waits for exit on background terminal handles; keeps retained PTY transcript memory when controller refresh fails; resolves tui-idle from an Antigravity ready prompt preview; resolves Antigravity ready prompts with newline-heavy pasted tails without splitting; resolves live-leaf tui-idle from an Antigravity ready prompt preview. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts: spawns the available Qoder command for a captured same-session resume: %s; does not use the local Windows shell setting for remote Windows bare agent creates; matches canonical bare agent commands when a command override is configured; keeps non-bare agent command terminal creates unchanged; keeps disabled bare agent command terminal creates unchanged; injects runtime hook receiver env into terminal sessions; creates background terminal sessions for a $label; creates background terminal sessions for a $label; enables Claude Agent Teams only for direct Claude launches when configured in-process; reveals Claude Agent Teams launches with the rewritten launch config; preserves Claude Agent Teams for sequenced Claude launches. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts: creates visible terminal sessions without asking the renderer to focus a tab; asks the pty controller for the requested shell instead of a startup command; knows the agent a flagged launch command names before any process read; retires a flagged command pane identity when the command exits; retires only receipted restored PTY authority on command completion and exit; forgets synthetic handles when disconnected PTY records are pruned. src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts: returns OSC titles from headless main terminal snapshots; adopts renderer-seeded titles into headless main terminal snapshots; returns cwd metadata from seeded headless main terminal snapshots; adopts OSC7 host metadata from seeded headless terminal scrollback; falls back to the renderer snapshot for hidden-output recovery without headless state; keeps an empty headless snapshot authoritative for hidden-output recovery; advances the absolute output sequence across a daemon stream gap; emits explicit OSC 9999 agent status from runtime PTY data. src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts: falls back to the provider snapshot for a restored PTY with no mounted renderer; falls back to the available mirror when authoritative provider history is unavailable; keeps an empty renderer snapshot when the provider has no retained content; keeps restored provider history authoritative after later live output; uses provider alternate-screen state while a partial model is unsafe; prefers the tracked title over the headless emulator lastTitle; keeps the cursor-agent literal in record-fallback snapshots only without a tracker title; touches mobile snapshots once for decorative spinner ticks, again on idle. src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts: creates a same-repo PR branch override from a resolved head SHA and matching push target; skips broad remote fetch for an existing full-SHA PR base; creates a selected Bitbucket PR branch override from a matching remote branch; suffixes an existing PR when a matching push target lacks selected PR metadata; suffixes a matching push target branch when selected PR metadata has no PR number; suffixes a matching push target branch when the existing PR is different; suffixes a selected PR remote conflict when the PR lookup fails; checks out an unused runtime PR branch only when it is at the resolved head SHA; suffixes only the runtime worktree path when an exact PR branch checkout path exists. src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts: returns runtime local base update suggestions from addWorktree; creates a runtime local worktree from a usable persisted local branch base; does not create a runtime local worktree when the refresh fails and no local base ref exists; creates a branchNameOverride worktree from the selected matching remote base ref. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/construction/orca-runtime.test.ts, src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts, src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts, src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts, src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts. Unresolved local/computed edges remain explicit debt.", @@ -7356,7 +7331,8 @@ "Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. The Codex restart suite and exact command/testFiles/assertionRef are removed; its mock account-change/remote-pane restart alarms are intentionally lost. Earlier notes and dated/archived evidence retain original scopes.", "Complete prior commands before exact deleted selectors were pruned: [\"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts\",\"pnpm exec vitest run --config config/vitest.config.ts src/shared/claimed-agent-pty-owner.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/runtime/session-construction/agent-session/orca-runtime-agent-session-operation.test.ts src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts\",\"pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-terminal-tab-retirement.unit.test.ts\",\"pnpm run build:cli && pnpm run build:electron-vite && node config/scripts/diagnostics/remote-agent-authority/remote-agent-session-authority-repro.mjs\",\"node --check config/scripts/development/remote-session-cleanup/remote-agent-session-process-cleanup.mjs && node config/scripts/diagnostics/remote-agent-authority/remote-agent-session-authority-repro.mjs\",\"pnpm exec electron-vite build --mode e2e\",\"VITE_EXPOSE_STORE=true pnpm run build:web\",\"ORCA_E2E_WEB_CLIENT=1 SKIP_BUILD=1 pnpm exec playwright test tests/e2e/remote-agent-session-focus-authority.spec.ts --config tests/playwright.config.ts --project electron-headful --workers=1\",\"Manual headed paired-server journey: isolated Orca desktop host + separate paired web client + real Codex process + 20-second WebSocket fault + reconnect + explicit stop\",\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts src/renderer/src/runtime/hosted-terminals/recovery/web-session-terminal-orphan-recovery.test.ts src/renderer/src/runtime/hosted-terminals/recovery/web-session-terminal-orphan-mixed-version.test.ts --maxWorkers=1\",\"pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/providers/routing/testing/daemon-pty-router.test.ts src/main/daemon/providers/routing/testing/degraded-daemon-pty-provider.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/runtime/construction/orca-runtime.test.ts tests/e2e/remote-agent-completion-authority.unit.test.ts src/renderer/src/runtime/hosted-terminals/inspection/runtime-terminal-inspection.test.ts src/renderer/src/components/terminal-pane/agent-completion/agent-completion-coordinator-process-cadence.test.ts\",\"pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-agent-completion-authority.unit.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/providers/routing/testing/daemon-pty-router.test.ts src/main/daemon/providers/routing/testing/degraded-daemon-pty-provider.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/renderer/src/runtime/hosted-terminals/inspection/runtime-terminal-inspection.test.ts src/renderer/src/components/terminal-pane/agent-completion/agent-completion-coordinator-process-cadence.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-completion-and-notification.test.ts src/renderer/src/lib/agent-session/accounts/codex/codex-session-restart.test.ts\"]", "Complete prior testFiles before exact deleted selectors were pruned: [\"src/main/daemon/terminal-host/testing/terminal-host.test.ts\",\"src/main/daemon/providers/routing/testing/daemon-pty-router.test.ts\",\"src/main/daemon/providers/routing/testing/degraded-daemon-pty-provider.test.ts\",\"src/main/runtime/construction/orca-runtime.test.ts\",\"tests/e2e/remote-agent-completion-authority.unit.test.ts\",\"src/renderer/src/runtime/hosted-terminals/inspection/runtime-terminal-inspection.test.ts\",\"src/renderer/src/components/terminal-pane/agent-completion/agent-completion-coordinator-process-cadence.test.ts\",\"src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-completion-and-notification.test.ts\",\"src/renderer/src/lib/agent-session/accounts/codex/codex-session-restart.test.ts\",\"src/shared/claimed-agent-pty-owner.test.ts\",\"src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts\",\"src/main/runtime/session-construction/agent-session/orca-runtime-agent-session-operation.test.ts\",\"src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts\",\"src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts\",\"tests/e2e/remote-agent-session-focus-authority.spec.ts\",\"config/scripts/diagnostics/remote-agent-authority/remote-agent-session-authority-repro.mjs\",\"config/scripts/development/remote-session-cleanup/remote-agent-session-process-cleanup.mjs\",\"tests/e2e/remote-terminal-tab-retirement.unit.test.ts\",\"src/renderer/src/runtime/hosted-terminals/recovery/web-session-terminal-orphan-recovery.test.ts\",\"src/renderer/src/runtime/hosted-terminals/recovery/web-session-terminal-orphan-mixed-version.test.ts\",\"src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts\"]", - "Complete prior assertionRefs before exact deleted selectors were pruned: [{\"file\":\"src/main/daemon/providers/routing/testing/degraded-daemon-pty-provider.test.ts\",\"assertions\":[\"completion inspection rejects an unmapped session instead of borrowing the local fallback\"]},{\"file\":\"tests/e2e/remote-agent-completion-authority.unit.test.ts\",\"assertions\":[\"transport loss remains unknown through reconnect and cannot dispatch completion\",\"returned unavailability or a thrown transport failure interrupts consecutive-idle proof and requires two fresh authoritative idle samples\",\"explicit stop, real exit status, and genuine successful completion remain distinct\"]},{\"file\":\"src/renderer/src/lib/agent-session/accounts/codex/codex-session-restart.test.ts\",\"assertions\":[\"one unreachable pane cannot suppress restart notices for another authoritatively confirmed Codex pane\"]},{\"file\":\"src/shared/claimed-agent-pty-owner.test.ts\",\"assertions\":[\"concurrent exact claims spawn once and later callers adopt the canonical owner\",\"same identity in another worktree conflicts and cannot be found as the current scope's owner\",\"generation-guarded exit and authoritative reconciliation cannot retire a replacement owner\"]},{\"file\":\"src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts\",\"assertions\":[\"independent runtime clients converge on one canonical live agent-session owner\",\"retries and concurrent requests cannot create a second physical PTY\"]},{\"file\":\"src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts\",\"assertions\":[\"an exact PTY exit retires host membership and stale topology cannot recreate the surface\",\"incarnation fencing prevents an old delayed exit from retiring a replacement PTY\"]},{\"file\":\"tests/e2e/remote-agent-session-focus-authority.spec.ts\",\"assertions\":[\"headed desktop host remains unfocused while the paired requester alone follows active fresh/resume sessions and inactive rows preserve exact client/DOM focus\",\"legacy afterTabId placement is exact in authoritative, mirrored, and rendered order with a pre-existing successor\",\"host PTY inventory plus writable agent/unrelated shell markers prove liveness, unrelated survival, and exact terminal/tab/PTY/process cleanup\"]},{\"file\":\"config/scripts/diagnostics/remote-agent-authority/remote-agent-session-authority-repro.mjs\",\"assertions\":[\"headless focused fresh/resume requests create background host surfaces without a renderer window\",\"dropped committed responses replay the same operation identity without another tokened agent spawn\",\"exact terminal/tab/process identity survives retries and stale-write rejection, then retires without restart resurrection while unrelated shells survive until scoped cleanup\"]},{\"file\":\"config/scripts/development/remote-session-cleanup/remote-agent-session-process-cleanup.mjs\",\"assertions\":[\"isolated daemon roots and captured descendants are verified dead before profile PID records are removed\"]},{\"file\":\"tests/e2e/remote-terminal-tab-retirement.unit.test.ts\",\"assertions\":[\"a durable host exit removes the terminal from two independent viewer mirrors instead of publishing a handle-less phantom\",\"one exact exit produces one same-epoch higher-version host publication and one durable persistence flush\",\"same-epoch stale publications cannot resurrect the retired surface after reconnect\"]},{\"file\":\"src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts\",\"assertions\":[\"replays a snapshot that beat the RPC response and focuses the exact adopted leaf\",\"retains exact-leaf focus intent when a split sibling publishes first\"]},{\"file\":\"src/renderer/src/runtime/hosted-terminals/recovery/web-session-terminal-orphan-mixed-version.test.ts\",\"assertions\":[\"mirrors a new CLI tab after old-host recovery when $name\"]},{\"file\":\"src/renderer/src/runtime/hosted-terminals/recovery/web-session-terminal-orphan-recovery.test.ts\",\"assertions\":[\"serializes a newer convergence snapshot after an in-flight adoption conflict\"]}]" + "Complete prior assertionRefs before exact deleted selectors were pruned: [{\"file\":\"src/main/daemon/providers/routing/testing/degraded-daemon-pty-provider.test.ts\",\"assertions\":[\"completion inspection rejects an unmapped session instead of borrowing the local fallback\"]},{\"file\":\"tests/e2e/remote-agent-completion-authority.unit.test.ts\",\"assertions\":[\"transport loss remains unknown through reconnect and cannot dispatch completion\",\"returned unavailability or a thrown transport failure interrupts consecutive-idle proof and requires two fresh authoritative idle samples\",\"explicit stop, real exit status, and genuine successful completion remain distinct\"]},{\"file\":\"src/renderer/src/lib/agent-session/accounts/codex/codex-session-restart.test.ts\",\"assertions\":[\"one unreachable pane cannot suppress restart notices for another authoritatively confirmed Codex pane\"]},{\"file\":\"src/shared/claimed-agent-pty-owner.test.ts\",\"assertions\":[\"concurrent exact claims spawn once and later callers adopt the canonical owner\",\"same identity in another worktree conflicts and cannot be found as the current scope's owner\",\"generation-guarded exit and authoritative reconciliation cannot retire a replacement owner\"]},{\"file\":\"src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts\",\"assertions\":[\"independent runtime clients converge on one canonical live agent-session owner\",\"retries and concurrent requests cannot create a second physical PTY\"]},{\"file\":\"src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts\",\"assertions\":[\"an exact PTY exit retires host membership and stale topology cannot recreate the surface\",\"incarnation fencing prevents an old delayed exit from retiring a replacement PTY\"]},{\"file\":\"tests/e2e/remote-agent-session-focus-authority.spec.ts\",\"assertions\":[\"headed desktop host remains unfocused while the paired requester alone follows active fresh/resume sessions and inactive rows preserve exact client/DOM focus\",\"legacy afterTabId placement is exact in authoritative, mirrored, and rendered order with a pre-existing successor\",\"host PTY inventory plus writable agent/unrelated shell markers prove liveness, unrelated survival, and exact terminal/tab/PTY/process cleanup\"]},{\"file\":\"config/scripts/diagnostics/remote-agent-authority/remote-agent-session-authority-repro.mjs\",\"assertions\":[\"headless focused fresh/resume requests create background host surfaces without a renderer window\",\"dropped committed responses replay the same operation identity without another tokened agent spawn\",\"exact terminal/tab/process identity survives retries and stale-write rejection, then retires without restart resurrection while unrelated shells survive until scoped cleanup\"]},{\"file\":\"config/scripts/development/remote-session-cleanup/remote-agent-session-process-cleanup.mjs\",\"assertions\":[\"isolated daemon roots and captured descendants are verified dead before profile PID records are removed\"]},{\"file\":\"tests/e2e/remote-terminal-tab-retirement.unit.test.ts\",\"assertions\":[\"a durable host exit removes the terminal from two independent viewer mirrors instead of publishing a handle-less phantom\",\"one exact exit produces one same-epoch higher-version host publication and one durable persistence flush\",\"same-epoch stale publications cannot resurrect the retired surface after reconnect\"]},{\"file\":\"src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts\",\"assertions\":[\"replays a snapshot that beat the RPC response and focuses the exact adopted leaf\",\"retains exact-leaf focus intent when a split sibling publishes first\"]},{\"file\":\"src/renderer/src/runtime/hosted-terminals/recovery/web-session-terminal-orphan-mixed-version.test.ts\",\"assertions\":[\"mirrors a new CLI tab after old-host recovery when $name\"]},{\"file\":\"src/renderer/src/runtime/hosted-terminals/recovery/web-session-terminal-orphan-recovery.test.ts\",\"assertions\":[\"serializes a newer convergence snapshot after an in-flight adoption conflict\"]}]", + "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." ], "demotionRule": "Keep experimental or demote if the focused gate flakes without a product or harness bug, if a retry can physically spawn twice, if a stale exit/publication can replace or resurrect a terminal, or if mixed-version fallback occurs after an authority side effect." }, @@ -8255,13 +8231,13 @@ "providers": ["paired-runtime", "ssh"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. The decorative fanout suite retains only real OSC9999 ingestion through runtime/title heartbeat/viewer past the stale boundary, preserving stateStartedAt and clearing expired prompt metadata. Spinner volume/zero-work inventories, Pi/Grok frame tables, rich-status and foreground-reset examples are retired. Existing receipts for separate paired-terminal sources retain their 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. Audit3342 removes three supplied activation/inventory fallback and same-handle retry examples; their fallback/retry alarms are intentionally lost without equivalent replacement. The exact mounted-HUB pending old-stream-end versus replacement-snapshot registration and its assertion remain. Unrelated dated macOS receipts retain only their original scope; no fresh runtime, provider, performance, mobile, mixed-version or cross-platform validation is claimed. NEXT46 terminal-owner layout and whole-case policy: src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-visibility-and-exit.test.ts, src/renderer/src/runtime/hosted-terminals/streams/remote-runtime-terminal-stall-recovery.test.ts. Complete retired/reduced selectors lose their listed alarms; retained cases have no transferred historical pass or equivalent replacement coverage. Unaffected dated receipts retain only their original exact scopes. This metadata edit is not fresh execution evidence. Historical prior account (preserved verbatim): Audit3326 adopts reconciled source audit3324 and intentionally retires these low-value examples and their regression alarms: restarts only the stream whose renderer delivery credit never settles — An unreturned renderer delivery credit stalls only its stream, leaving healthy sibling/shared transport alive. Fake-clock deadline plus real multiplexer unsubscribe isolates recovery ownership.; probes then restarts a stream when an entered command receives no frames — Entered command produces no output; actual multiplexer must probe then close only its stalled stream after probe timeout. Distinct response liveness from parser credit.; establishes a probe baseline before recovering an unsequenced stream — 142-line manual five-probe baseline/regression sequence derives request IDs from encoded mock traffic and checks repeated no-close/close choreography. Oversized algorithm/state-machine example; no actual renderer/host command or recovery delivery. Retires unsequenced/unchanged/regressed baseline classification alarms.. Retained tests do not replace these alarms. Dated unrelated evidence remains scoped to its original execution; no historical source/import-closure equivalence, fresh execution, real network/provider/SSH, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Audit 3318 reduces remote-runtime-pty-transport-unpublished-host-graph.test.ts, retiring its direct published-empty-graph omission-to-pane-exit alarm. The unchanged bounded unpublished-frame/pushed-recovery and stale-handle park/manual-retry cases are narrower, not equivalent replacements. Both complete three-case Linux receipts dated 2026-11-04 are archived as historical, including source heads; they do not validate this reduced selector. Remaining fourteen active receipts are macOS only. No fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. The direct side-effect-facts selector retains six cases: replay exclusion, live sequence handling, stale disposer ownership, one handoff drain, drain-before-snapshot, and stale replacement-snapshot refusal. Successful current-entry snapshot application is not witnessed by the retained snapshot case. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2162: Reduced inventory-authority source intentionally loses the examples recorded in knownGaps; historical execution is not validation of changed bytes. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Remove SSH/absent-inventory attach refusal, later-subscriber retry, no-view adoption/takeback, provider-tail/unknown-read projections, failed-keystroke retry and simpler loss reattach examples. Keep the existing-subscriber inventory-ready retry alias only at its retained callback, plus retained held-input cancellation/replacement and overlapping attach/loss fences. The inventory driver also loses the whole empty-worktree-publication registration and folder-host/unverifiable scalar examples. Retire the entire dated10-case attach receipt; retain16 independent receipts only in their original scopes. No retained-memory or real-daemon measurement follows from supplied provider inventories. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove initial-snapshot sequence-domain, limited-tail/truncation and unknown-output-sequence aliases whose callbacks are removed. The source retains partial-chunk replay and requested-snapshot retry/admission at supplied snapshot/data seams, not equivalent replacement or measured retained-memory proof. Preserve the existing stream/pending-wait capacity aliases only to their retained owning multiplex callbacks with supplied PTY resolutions. Removing the sibling-PTY heartbeat dedup work-count sample does not establish a new decorative fanout budget; the unrelated-PTY cancellation fence survives. Preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove the reasonless-close selector and narrow census aliases to actual retained runtime and injected-inventory callbacks. The removed synthetic census-dedup and isolated pre-boundary timing cases receive no replacement credit; preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): Delete the synthetic watcher-synchronization and partial-reconciliation suites. Retire all affected host-fact, capability-owner, activation-residue and retention-cap aliases because the remaining callbacks do not establish those full claims. Keep exact local hook/timer, byte-stream side effects, exit/disposal, scroll-intent cleanup and deterministic local rank/TTL progression callbacks within their mocked-host scope. No physical paired-host retention, resource budget or equivalent replacement evidence is assigned. The generic broad test command remains a runnable discovery command, never a dated execution receipt. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete hook-agent-status projection suite and its two behavioral assertion aliases. Supplied stored hook/title/resume/staleness/rename/question/generation/PTY-retirement/snapshot-version projections are intentionally lost. The separate osc-status-scan gate mentions this source only in existing historical notes and receives no mutation. No measured hidden-output retention, CPU/RSS or resource budget result is claimed by the deleted source or this audit. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Module ownership cleanup retires the modeled cold-park private watcher/render/work-count suites under the current test policy. Their assertions are no longer active evidence. Retained lifecycle tests and headed/headless journeys do not establish equivalent coverage for those removed harness alarms. Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. deletes src/renderer/src/components/terminal-pane/terminal-cold-park-verdict-loop.test.tsx: Loses modeled React oscillation alarm; real pane/watchers are not exercised. deletes src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts: Loses delayed credit until parsing, malformed frame/unknown stream handling, discarded transformed output recovery and failed ACK rearm alarms. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1412 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): This audit removes the browser response-after-manual-disconnect example. Its distinct in-flight response fencing alarm is lost; retained queued-call disconnect tests are not an equivalent replacement. Historical commands and results remain historical. Deterministic headed macOS runs launch an isolated Orca desktop server and a separate paired web client. A byte-identical headless run uses an isolated `orca serve` host. Both create six real paired host PTYs with bounded high-output scrollback, prove sustained output while all six client xterms are warm-mounted but hidden causes zero renderer scheduler work, then drive 180 timed real-PTY spinner frames through a second production `session.tabs.subscribeAll` transport and the real Zustand store. Each worktree must publish and apply only its exact initial-working and final-idle titles. Both topologies ordinary-park five xterms without enabling the lossy retention budget, assert bounded cells/heap/timer lag, then restore the bounded authoritative tail exactly once on the original PTY including output produced while parked and continued input/output. The headed oracle additionally keeps every remote target workspace and terminal unmounted in the host renderer before and after client recovery. Production-parity React contracts reproduce and remove the independent cold-park watcher/title feedback loop, including memo-cache discard, StrictMode cleanup replay, detached split-PTY replacement, and the zero-park fast path. A deterministic cross-boundary contract drives 24 real PTY trackers in distinct worktrees through 2,880 decorative spinner and bare-native redraw chunks and counts host publications, serialized bytes, renderer apply calls, and store mutations while preserving exact per-PTY raw chunks and per-worktree semantic transitions. Fake-clock continuation beyond the 30-minute stale boundary requires one deduplicated refresh per worktree every 15 minutes, globally spaced by at least 50 ms, with every mirrored working status still fresh. Exact-identical Pi plus rotating normalized Pi/Grok frames renew coarse working/permission state; rich prompt/tool/question fields retain their original 30-minute lease, and `stateStartedAt`/acknowledgement identity remain stable across title/hook source swaps. A separate headed desktop-client journey relaunches the host main process while retaining the daemon and a daemon-backgrounded PTY, then requires first-observation foreground sync and continued input/output on the same PTY. Unit coverage keeps layout versions out of snapshot output high-waters when a restored snapshot has no output sequence and retries an existing subscriber only after authoritative provider inventory proves the retained PTY exists. Separate headed/headless ACK-starvation tests recover one stalled stream without replacing its PTY. A headed output-drop oracle proves a successful snapshot probe cannot certify a stale live stream when the authoritative PTY sequence advanced beyond the client high-water. Unit coverage requires an unsequenced client to establish a first-probe baseline, remain attached at the same sequence, and recover only after a later probe advances. A capability-disabled run proves legacy hosts retain the prior lossy limit/TTL fallback. Unit tests cover exact-owner capability routing, raw-stream release, singleton side-effect facts with timed handoff cleanup, 64 simultaneous synthetic-title sources with zero decorative client events after convergence, per-client late-subscribe recovery, semantic bell/title transitions, local animation-frame preservation, legacy no-output-pause delivery gating with exact snapshot restore, provider-authoritative snapshots, 128 active streams plus retry after a 129th-stream capacity rejection, capacity-pressure backoff, full split-leaf remint reconciliation, truncation, and manual-disconnect queue fencing. Linux, Windows, live SSH, and production-scale paired hosts remain gaps. The audit removed the E2E parking override/debug-handle suite. Override exposure guards, delay/retention independence, TTL filtering and debug-handle forwarding alarms are lost. Retained real parking journeys do not establish equivalent test-harness configuration coverage. The test-value audit removes separate responsive-stream, intervening-control-frame and capacity-error classification examples. Retained multiplexer checks use fake clocks and captured transport callbacks; their per-stream isolation, deadline and probe-baseline assertions do not prove an actual host restart or equivalent replacement coverage. Historical run commands and results remain historical. The test-value audit removes the standalone retained/live metadata projection and additive-preference negative example from runtime-client-events.test.ts. Its remaining case checks partial-authority event admission through a captured callback; it does not establish full-pair projection, actual peer delivery or equivalent replacement coverage. Historical commands and results remain historical. The isolated accepted-handle-events observer suite is removed. Its runtime/worktree/pane membership, once-only delivery and listener-release ledger alarms are lost. Live hidden-retention evidence does not establish equivalent observer coverage. Audit1292: The entire host-session mirror empty-inventory settle suite is removed. Live-unpublished versus genuinely-empty hydration, same-ID revision response/in-flight fencing and cleared-tracking pending-probe invalidation alarms are lost. The singleton store and inventories were mocked; no real host census or resume delivery or equivalent replacement coverage is claimed. Audit1302: src/main/runtime/session-tabs-inventory-publication.test.ts: Keep actual runtime public inventory authority across renderer epochs/resync, fallback, aborts and invalid graph publishers. Remove copied nonempty publication, private scan counters/collector and known-host replacement, fake refresh that performs the restoration itself, environment capability flag, and private resume-store characterization whose fixture supplies reservation/rollback ordering. Lose isolated refresh/churn/receiver/capability and copied-payload wiring alarms; no equivalent replacement. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1318: src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts: Retain real local encrypted WebSocket regressions for pre-ready socket replacement preserving a request, close-before-ready logical subscription cleanup, unrelated RPC surviving another deadline, and pending setup abort leaving a sibling pending. Host server is synthetic and uses production crypto; kept scenarios also retain internal diagnostics/memory assertions unchanged. Remove happy routing, authority-envelope, unknown-ID/log, cleanup enum, binary, keepalive/liveness and production-budget/private socket inventories; intentionally lose those alarms, no physical host authorization, independent crypto or remote provider claim. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1346 removes the entire private-state-injected session-tabs rich-status boundary suite. Its stale task/question, neutral-title preservation, owner-change and provider-generation alarms are intentionally lost. Retained real terminal journeys do not establish equivalent replacement coverage. The prior mixed 42-contract execution receipt is historical and must not validate the reduced current selector; fresh validation remains required. Audit1352: focused Linux unit selections validated on source head b638e07d395b76af3ba6b03761a1a0fe7e5e026e. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1360: focused Linux unit selections validated on source head 415c9cffc2d10024131ec4b6721767a22195de6d. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1396: src/renderer/src/components/terminal-pane/terminal-parked-watcher-reconciliation.test.ts reduced. Retire standalone reconcile set output and positive untouchedFreshSpawn/workspaceOwner copying alarms; no native watcher execution claim. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1402: src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.ts reduced. Loses basic paired serialize/initial replay forwarding check; hidden alt-frame grid/precedence policy remains. No real terminal renderer claim. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1412: src/main/runtime/mobile-session-tabs-agent-status-heartbeat.test.ts reduced. Loses FIFO fairness/spacing, semantic bypass/cancellation, delayed-boundary scheduling and teardown timer-cleanup alarms. Retained fixed emission cases do not replace those outcomes. No equivalent replacement coverage is claimed.", + "coverageNotes": "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. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. The decorative fanout suite retains only real OSC9999 ingestion through runtime/title heartbeat/viewer past the stale boundary, preserving stateStartedAt and clearing expired prompt metadata. Spinner volume/zero-work inventories, Pi/Grok frame tables, rich-status and foreground-reset examples are retired. Existing receipts for separate paired-terminal sources retain their 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. Audit3342 removes three supplied activation/inventory fallback and same-handle retry examples; their fallback/retry alarms are intentionally lost without equivalent replacement. The exact mounted-HUB pending old-stream-end versus replacement-snapshot registration and its assertion remain. Unrelated dated macOS receipts retain only their original scope; no fresh runtime, provider, performance, mobile, mixed-version or cross-platform validation is claimed. NEXT46 terminal-owner layout and whole-case policy: src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-visibility-and-exit.test.ts, src/renderer/src/runtime/hosted-terminals/streams/remote-runtime-terminal-stall-recovery.test.ts. Complete retired/reduced selectors lose their listed alarms; retained cases have no transferred historical pass or equivalent replacement coverage. Unaffected dated receipts retain only their original exact scopes. This metadata edit is not fresh execution evidence. Historical prior account (preserved verbatim): Audit3326 adopts reconciled source audit3324 and intentionally retires these low-value examples and their regression alarms: restarts only the stream whose renderer delivery credit never settles — An unreturned renderer delivery credit stalls only its stream, leaving healthy sibling/shared transport alive. Fake-clock deadline plus real multiplexer unsubscribe isolates recovery ownership.; probes then restarts a stream when an entered command receives no frames — Entered command produces no output; actual multiplexer must probe then close only its stalled stream after probe timeout. Distinct response liveness from parser credit.; establishes a probe baseline before recovering an unsequenced stream — 142-line manual five-probe baseline/regression sequence derives request IDs from encoded mock traffic and checks repeated no-close/close choreography. Oversized algorithm/state-machine example; no actual renderer/host command or recovery delivery. Retires unsequenced/unchanged/regressed baseline classification alarms.. Retained tests do not replace these alarms. Dated unrelated evidence remains scoped to its original execution; no historical source/import-closure equivalence, fresh execution, real network/provider/SSH, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Audit 3318 reduces remote-runtime-pty-transport-unpublished-host-graph.test.ts, retiring its direct published-empty-graph omission-to-pane-exit alarm. The unchanged bounded unpublished-frame/pushed-recovery and stale-handle park/manual-retry cases are narrower, not equivalent replacements. Both complete three-case Linux receipts dated 2026-11-04 are archived as historical, including source heads; they do not validate this reduced selector. Remaining fourteen active receipts are macOS only. No fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. The direct side-effect-facts selector retains six cases: replay exclusion, live sequence handling, stale disposer ownership, one handoff drain, drain-before-snapshot, and stale replacement-snapshot refusal. Successful current-entry snapshot application is not witnessed by the retained snapshot case. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2162: Reduced inventory-authority source intentionally loses the examples recorded in knownGaps; historical execution is not validation of changed bytes. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Remove SSH/absent-inventory attach refusal, later-subscriber retry, no-view adoption/takeback, provider-tail/unknown-read projections, failed-keystroke retry and simpler loss reattach examples. Keep the existing-subscriber inventory-ready retry alias only at its retained callback, plus retained held-input cancellation/replacement and overlapping attach/loss fences. The inventory driver also loses the whole empty-worktree-publication registration and folder-host/unverifiable scalar examples. Retire the entire dated10-case attach receipt; retain16 independent receipts only in their original scopes. No retained-memory or real-daemon measurement follows from supplied provider inventories. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove initial-snapshot sequence-domain, limited-tail/truncation and unknown-output-sequence aliases whose callbacks are removed. The source retains partial-chunk replay and requested-snapshot retry/admission at supplied snapshot/data seams, not equivalent replacement or measured retained-memory proof. Preserve the existing stream/pending-wait capacity aliases only to their retained owning multiplex callbacks with supplied PTY resolutions. Removing the sibling-PTY heartbeat dedup work-count sample does not establish a new decorative fanout budget; the unrelated-PTY cancellation fence survives. Preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove the reasonless-close selector and narrow census aliases to actual retained runtime and injected-inventory callbacks. The removed synthetic census-dedup and isolated pre-boundary timing cases receive no replacement credit; preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): Delete the synthetic watcher-synchronization and partial-reconciliation suites. Retire all affected host-fact, capability-owner, activation-residue and retention-cap aliases because the remaining callbacks do not establish those full claims. Keep exact local hook/timer, byte-stream side effects, exit/disposal, scroll-intent cleanup and deterministic local rank/TTL progression callbacks within their mocked-host scope. No physical paired-host retention, resource budget or equivalent replacement evidence is assigned. The generic broad test command remains a runnable discovery command, never a dated execution receipt. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete hook-agent-status projection suite and its two behavioral assertion aliases. Supplied stored hook/title/resume/staleness/rename/question/generation/PTY-retirement/snapshot-version projections are intentionally lost. The separate osc-status-scan gate mentions this source only in existing historical notes and receives no mutation. No measured hidden-output retention, CPU/RSS or resource budget result is claimed by the deleted source or this audit. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Module ownership cleanup retires the modeled cold-park private watcher/render/work-count suites under the current test policy. Their assertions are no longer active evidence. Retained lifecycle tests and headed/headless journeys do not establish equivalent coverage for those removed harness alarms. Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. deletes src/renderer/src/components/terminal-pane/terminal-cold-park-verdict-loop.test.tsx: Loses modeled React oscillation alarm; real pane/watchers are not exercised. deletes src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts: Loses delayed credit until parsing, malformed frame/unknown stream handling, discarded transformed output recovery and failed ACK rearm alarms. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1412 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): This audit removes the browser response-after-manual-disconnect example. Its distinct in-flight response fencing alarm is lost; retained queued-call disconnect tests are not an equivalent replacement. Historical commands and results remain historical. Deterministic headed macOS runs launch an isolated Orca desktop server and a separate paired web client. A byte-identical headless run uses an isolated `orca serve` host. Both create six real paired host PTYs with bounded high-output scrollback, prove sustained output while all six client xterms are warm-mounted but hidden causes zero renderer scheduler work, then drive 180 timed real-PTY spinner frames through a second production `session.tabs.subscribeAll` transport and the real Zustand store. Each worktree must publish and apply only its exact initial-working and final-idle titles. Both topologies ordinary-park five xterms without enabling the lossy retention budget, assert bounded cells/heap/timer lag, then restore the bounded authoritative tail exactly once on the original PTY including output produced while parked and continued input/output. The headed oracle additionally keeps every remote target workspace and terminal unmounted in the host renderer before and after client recovery. Production-parity React contracts reproduce and remove the independent cold-park watcher/title feedback loop, including memo-cache discard, StrictMode cleanup replay, detached split-PTY replacement, and the zero-park fast path. A deterministic cross-boundary contract drives 24 real PTY trackers in distinct worktrees through 2,880 decorative spinner and bare-native redraw chunks and counts host publications, serialized bytes, renderer apply calls, and store mutations while preserving exact per-PTY raw chunks and per-worktree semantic transitions. Fake-clock continuation beyond the 30-minute stale boundary requires one deduplicated refresh per worktree every 15 minutes, globally spaced by at least 50 ms, with every mirrored working status still fresh. Exact-identical Pi plus rotating normalized Pi/Grok frames renew coarse working/permission state; rich prompt/tool/question fields retain their original 30-minute lease, and `stateStartedAt`/acknowledgement identity remain stable across title/hook source swaps. A separate headed desktop-client journey relaunches the host main process while retaining the daemon and a daemon-backgrounded PTY, then requires first-observation foreground sync and continued input/output on the same PTY. Unit coverage keeps layout versions out of snapshot output high-waters when a restored snapshot has no output sequence and retries an existing subscriber only after authoritative provider inventory proves the retained PTY exists. Separate headed/headless ACK-starvation tests recover one stalled stream without replacing its PTY. A headed output-drop oracle proves a successful snapshot probe cannot certify a stale live stream when the authoritative PTY sequence advanced beyond the client high-water. Unit coverage requires an unsequenced client to establish a first-probe baseline, remain attached at the same sequence, and recover only after a later probe advances. A capability-disabled run proves legacy hosts retain the prior lossy limit/TTL fallback. Unit tests cover exact-owner capability routing, raw-stream release, singleton side-effect facts with timed handoff cleanup, 64 simultaneous synthetic-title sources with zero decorative client events after convergence, per-client late-subscribe recovery, semantic bell/title transitions, local animation-frame preservation, legacy no-output-pause delivery gating with exact snapshot restore, provider-authoritative snapshots, 128 active streams plus retry after a 129th-stream capacity rejection, capacity-pressure backoff, full split-leaf remint reconciliation, truncation, and manual-disconnect queue fencing. Linux, Windows, live SSH, and production-scale paired hosts remain gaps. The audit removed the E2E parking override/debug-handle suite. Override exposure guards, delay/retention independence, TTL filtering and debug-handle forwarding alarms are lost. Retained real parking journeys do not establish equivalent test-harness configuration coverage. The test-value audit removes separate responsive-stream, intervening-control-frame and capacity-error classification examples. Retained multiplexer checks use fake clocks and captured transport callbacks; their per-stream isolation, deadline and probe-baseline assertions do not prove an actual host restart or equivalent replacement coverage. Historical run commands and results remain historical. The test-value audit removes the standalone retained/live metadata projection and additive-preference negative example from runtime-client-events.test.ts. Its remaining case checks partial-authority event admission through a captured callback; it does not establish full-pair projection, actual peer delivery or equivalent replacement coverage. Historical commands and results remain historical. The isolated accepted-handle-events observer suite is removed. Its runtime/worktree/pane membership, once-only delivery and listener-release ledger alarms are lost. Live hidden-retention evidence does not establish equivalent observer coverage. Audit1292: The entire host-session mirror empty-inventory settle suite is removed. Live-unpublished versus genuinely-empty hydration, same-ID revision response/in-flight fencing and cleared-tracking pending-probe invalidation alarms are lost. The singleton store and inventories were mocked; no real host census or resume delivery or equivalent replacement coverage is claimed. Audit1302: src/main/runtime/session-tabs-inventory-publication.test.ts: Keep actual runtime public inventory authority across renderer epochs/resync, fallback, aborts and invalid graph publishers. Remove copied nonempty publication, private scan counters/collector and known-host replacement, fake refresh that performs the restoration itself, environment capability flag, and private resume-store characterization whose fixture supplies reservation/rollback ordering. Lose isolated refresh/churn/receiver/capability and copied-payload wiring alarms; no equivalent replacement. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1318: src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts: Retain real local encrypted WebSocket regressions for pre-ready socket replacement preserving a request, close-before-ready logical subscription cleanup, unrelated RPC surviving another deadline, and pending setup abort leaving a sibling pending. Host server is synthetic and uses production crypto; kept scenarios also retain internal diagnostics/memory assertions unchanged. Remove happy routing, authority-envelope, unknown-ID/log, cleanup enum, binary, keepalive/liveness and production-budget/private socket inventories; intentionally lose those alarms, no physical host authorization, independent crypto or remote provider claim. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1346 removes the entire private-state-injected session-tabs rich-status boundary suite. Its stale task/question, neutral-title preservation, owner-change and provider-generation alarms are intentionally lost. Retained real terminal journeys do not establish equivalent replacement coverage. The prior mixed 42-contract execution receipt is historical and must not validate the reduced current selector; fresh validation remains required. Audit1352: focused Linux unit selections validated on source head b638e07d395b76af3ba6b03761a1a0fe7e5e026e. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1360: focused Linux unit selections validated on source head 415c9cffc2d10024131ec4b6721767a22195de6d. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1396: src/renderer/src/components/terminal-pane/terminal-parked-watcher-reconciliation.test.ts reduced. Retire standalone reconcile set output and positive untouchedFreshSpawn/workspaceOwner copying alarms; no native watcher execution claim. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1402: src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.ts reduced. Loses basic paired serialize/initial replay forwarding check; hidden alt-frame grid/precedence policy remains. No real terminal renderer claim. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1412: src/main/runtime/mobile-session-tabs-agent-status-heartbeat.test.ts reduced. Loses FIFO fairness/spacing, semantic bypass/cancellation, delayed-boundary scheduling and teardown timer-cleanup alarms. Retained fixed emission cases do not replace those outcomes. No equivalent replacement coverage is claimed.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/8652", "https://github.com/stablyai/orca/pull/10625" ], "invariant": "A host advertising terminal.paired-parking.v1 keeps the PTY and bounded authoritative history alive while an ordinary hidden-view park destroys the client xterm and releases its raw per-PTY stream. Reveal must restore up to the requested 5,000 rows, parked-time side effects/output, the same PTY identity, and continued input/output. Parked watcher synchronization compares parking semantics rather than fresh object identity, owns setup and cleanup across StrictMode replay, reconciles real PTY/layout changes, and performs no terminal-state scan when nothing is parked. After a host main-process relaunch, unknown local delivery-sync state must not be treated as proof that a surviving daemon PTY is already foregrounded. An empty headed session-tab inventory is authoritative only after the current renderer graph generation publishes a complete inventory and every execution host answers the PTY census; unpublished, resync-pending, transport-failed, and partially scoped inventories remain unverifiable, while genuinely authoritative empty and non-empty inventories settle and a scope-less legacy empty keeps its pre-authority best-effort settle so outdated hosts retain agent auto-resume. The unpublished-empty regression must keep the resume dispatch parked with exactly one daemon process/writer; restoring unconditional empty hydration must release one dispatch and create two live writers. If subscription precedes provider readiness, authoritative inventory must reconsider that existing subscriber without spawning, resizing, or changing reconnect state. A snapshot without an output high-water must keep it unknown rather than borrowing a layout version that can suppress newer live output. Hosts without the capability must gate hidden raw output before xterm scheduling and repaint from the authoritative snapshot on reveal while retaining the existing limit/TTL force-parking fallback. After the first semantic title state, decorative spinner frequency must add zero paired client-event frames and zero full session-tabs work between status-freshness leases regardless of hidden worktree count. Continuous working or permission evidence may refresh each affected worktree once per 15 minutes through one globally spaced FIFO so current and legacy viewers do not decay before 30 minutes; sibling PTYs share that worktree refresh, while local title animation, raw output, and semantic title, status, bell, completion, and query facts remain intact. A paired terminal stream whose delivery credits stop progressing must replace only that stream; command silence first probes authoritative state and replaces the stream if the probe times out or proves the PTY advanced beyond the client's delivered output sequence. When no comparable delivery high-water exists, the first sequenced probe establishes a baseline and only later advancement proves staleness. A same-sequence snapshot remains valid proof of a responsive silent command. A successful status probe may replace a pre-ready shared-control socket without rejecting or duplicating calls already waiting for that transport. Manual disconnect must retain pairing while preventing queued or passive calls and subscriptions from recreating transport until explicit Connect. A paired pane reconnecting to a relaunched host that has not yet published its window graph (an unpublished frame, bare or client-projected) must stay in recovery rather than retire, and the host's first published snapshot carrying the surface must reattach it; a published frame lacking the surface still retires it. The placeholder is only ever sent before the host's graph first publishes; afterwards a worktree with no tabs gets a real empty answer, pushed once to any client that asked during startup, so a paired client opening a never-opened host worktree still gets its first terminal.", - "oracle": "Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. The decorative fanout suite retains only real OSC9999 ingestion through runtime/title heartbeat/viewer past the stale boundary, preserving stateStartedAt and clearing expired prompt metadata. Spinner volume/zero-work inventories, Pi/Grok frame tables, rich-status and foreground-reset examples are retired. Existing receipts for separate paired-terminal sources retain their 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. Audit3342 removes three supplied activation/inventory fallback and same-handle retry examples; their fallback/retry alarms are intentionally lost without equivalent replacement. The exact mounted-HUB pending old-stream-end versus replacement-snapshot registration and its assertion remain. Unrelated dated macOS receipts retain only their original scope; no fresh runtime, provider, performance, mobile, mixed-version or cross-platform validation is claimed. Audit3326 adopts reconciled source audit3324 and intentionally retires these low-value examples and their regression alarms: restarts only the stream whose renderer delivery credit never settles — An unreturned renderer delivery credit stalls only its stream, leaving healthy sibling/shared transport alive. Fake-clock deadline plus real multiplexer unsubscribe isolates recovery ownership.; probes then restarts a stream when an entered command receives no frames — Entered command produces no output; actual multiplexer must probe then close only its stalled stream after probe timeout. Distinct response liveness from parser credit.; establishes a probe baseline before recovering an unsequenced stream — 142-line manual five-probe baseline/regression sequence derives request IDs from encoded mock traffic and checks repeated no-close/close choreography. Oversized algorithm/state-machine example; no actual renderer/host command or recovery delivery. Retires unsequenced/unchanged/regressed baseline classification alarms.. Retained tests do not replace these alarms. Dated unrelated evidence remains scoped to its original execution; no historical source/import-closure equivalence, fresh execution, real network/provider/SSH, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Audit 3318 reduces remote-runtime-pty-transport-unpublished-host-graph.test.ts, retiring its direct published-empty-graph omission-to-pane-exit alarm. The unchanged bounded unpublished-frame/pushed-recovery and stale-handle park/manual-retry cases are narrower, not equivalent replacements. Both complete three-case Linux receipts dated 2026-11-04 are archived as historical, including source heads; they do not validate this reduced selector. Remaining fourteen active receipts are macOS only. No fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. The direct side-effect-facts selector retains six cases: replay exclusion, live sequence handling, stale disposer ownership, one handoff drain, drain-before-snapshot, and stale replacement-snapshot refusal. Successful current-entry snapshot application is not witnessed by the retained snapshot case. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Remove SSH/absent-inventory attach refusal, later-subscriber retry, no-view adoption/takeback, provider-tail/unknown-read projections, failed-keystroke retry and simpler loss reattach examples. Keep the existing-subscriber inventory-ready retry alias only at its retained callback, plus retained held-input cancellation/replacement and overlapping attach/loss fences. The inventory driver also loses the whole empty-worktree-publication registration and folder-host/unverifiable scalar examples. Retire the entire dated10-case attach receipt; retain16 independent receipts only in their original scopes. No retained-memory or real-daemon measurement follows from supplied provider inventories. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove initial-snapshot sequence-domain, limited-tail/truncation and unknown-output-sequence aliases whose callbacks are removed. The source retains partial-chunk replay and requested-snapshot retry/admission at supplied snapshot/data seams, not equivalent replacement or measured retained-memory proof. Preserve the existing stream/pending-wait capacity aliases only to their retained owning multiplex callbacks with supplied PTY resolutions. Removing the sibling-PTY heartbeat dedup work-count sample does not establish a new decorative fanout budget; the unrelated-PTY cancellation fence survives. Preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove the reasonless-close selector and narrow census aliases to actual retained runtime and injected-inventory callbacks. The removed synthetic census-dedup and isolated pre-boundary timing cases receive no replacement credit; preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): Delete the synthetic watcher-synchronization and partial-reconciliation suites. Retire all affected host-fact, capability-owner, activation-residue and retention-cap aliases because the remaining callbacks do not establish those full claims. Keep exact local hook/timer, byte-stream side effects, exit/disposal, scroll-intent cleanup and deterministic local rank/TTL progression callbacks within their mocked-host scope. No physical paired-host retention, resource budget or equivalent replacement evidence is assigned. The generic broad test command remains a runnable discovery command, never a dated execution receipt. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete hook-agent-status projection suite and its two behavioral assertion aliases. Supplied stored hook/title/resume/staleness/rename/question/generation/PTY-retirement/snapshot-version projections are intentionally lost. The separate osc-status-scan gate mentions this source only in existing historical notes and receives no mutation. No measured hidden-output retention, CPU/RSS or resource budget result is claimed by the deleted source or this audit. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Run one byte-identical six-terminal oracle against an isolated headed desktop host and an isolated headless `orca serve` host. Stage at least 1,000,000 xterm cells, hide all six warm managers, emit an initial working title followed by 30 timed real-PTY spinner frames and a final idle title per worktree, and observe a second real session-tabs subscription plus the production renderer store. Require exactly two transport envelopes and two title mutations per worktree, no decorative title crossing either boundary, and positive decoded-envelope bytes. Enable ordinary parking with the lossy retention budget disabled, require exactly one mounted manager and five parked tabs, at most 45% retained cells, no more than 16 MiB heap growth, and under 500 ms timer drift. In headed mode, require the host renderer to remain on its original workspace with zero target terminal managers mounted throughout client park, reveal, and live I/O. While a tab is parked, require authoritative terminal.read to observe new PTY output; reveal it and require the original PTY, a marker within the requested 5,000-row history, the parked marker, and post-reveal input/output. Drive 24 real PTY title trackers in distinct worktrees through 40 decorative spinner frames each, then 40 spinner frames alternating with Cursor's bare native identity redraw, using fake clocks. Require all 2,880 raw chunks exactly and zero host session-tabs publications, serialized bytes, renderer apply calls, and renderer store mutations. Continue decorative evidence beyond 30 minutes, require exactly one refresh per worktree per 15-minute lease through a FIFO spaced by at least 50 ms, and require all 24 viewer statuses to remain working and fresh; then require one exact semantic idle transition and one visible-output chunk per PTY. Require ordinary and interior-Braille title changes to publish. Drive 64 host PTYs through ten 80 ms synthetic title frames, require zero paired client events after the first frame per PTY while all 640 local frames remain observable, attach a late client and require one current frame per PTY, then require semantic bell and idle transitions on both clients. Reconstruct a legacy subscribed stream with no outputPause capability, hide a chatty pane, require no hidden xterm writes, reveal it, and require one authoritative snapshot plus continued live output. Drop and acknowledge output only for one original paired-client stream, prove the fixture process consumed input while the host model advanced and the client stayed stale, then require the command snapshot probe to replace that stream, repaint exact fixture output, preserve authoritative PTY identity and target-tab cardinality, and resume live I/O. For a client without a delivered sequence, require the first numeric probe to establish a baseline without replacement, a same-sequence probe to remain attached, and a later advanced probe to replace only that stream. Withhold the first encrypted shared-control ready frame, start one RPC, trigger a status-probe refresh, and require two connections, one host delivery, successful response, and zero retained request bytes. Admit 128 active streams, reject the 129th as retryable, release one stream, then require the retry to attach and publish a snapshot without multiplying retained subscribers. Disable terminal.paired-parking.v1 and require the same oracle to fail before parking, while the legacy limit-one fallback separately passes. Also preserve truncated first paint, ACK-starved same-PTY recovery, responsive silent-command snapshot probes, dead-stream probe timeout recovery, and queued manual-disconnect fencing.", + "oracle": "Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. The decorative fanout suite retains only real OSC9999 ingestion through runtime/title heartbeat/viewer past the stale boundary, preserving stateStartedAt and clearing expired prompt metadata. Spinner volume/zero-work inventories, Pi/Grok frame tables, rich-status and foreground-reset examples are retired. Existing receipts for separate paired-terminal sources retain their 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. Audit3342 removes three supplied activation/inventory fallback and same-handle retry examples; their fallback/retry alarms are intentionally lost without equivalent replacement. The exact mounted-HUB pending old-stream-end versus replacement-snapshot registration and its assertion remain. Unrelated dated macOS receipts retain only their original scope; no fresh runtime, provider, performance, mobile, mixed-version or cross-platform validation is claimed. Audit3326 adopts reconciled source audit3324 and intentionally retires these low-value examples and their regression alarms: restarts only the stream whose renderer delivery credit never settles — An unreturned renderer delivery credit stalls only its stream, leaving healthy sibling/shared transport alive. Fake-clock deadline plus real multiplexer unsubscribe isolates recovery ownership.; probes then restarts a stream when an entered command receives no frames — Entered command produces no output; actual multiplexer must probe then close only its stalled stream after probe timeout. Distinct response liveness from parser credit.; establishes a probe baseline before recovering an unsequenced stream — 142-line manual five-probe baseline/regression sequence derives request IDs from encoded mock traffic and checks repeated no-close/close choreography. Oversized algorithm/state-machine example; no actual renderer/host command or recovery delivery. Retires unsequenced/unchanged/regressed baseline classification alarms.. Retained tests do not replace these alarms. Dated unrelated evidence remains scoped to its original execution; no historical source/import-closure equivalence, fresh execution, real network/provider/SSH, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Audit 3318 reduces remote-runtime-pty-transport-unpublished-host-graph.test.ts, retiring its direct published-empty-graph omission-to-pane-exit alarm. The unchanged bounded unpublished-frame/pushed-recovery and stale-handle park/manual-retry cases are narrower, not equivalent replacements. Both complete three-case Linux receipts dated 2026-11-04 are archived as historical, including source heads; they do not validate this reduced selector. Remaining fourteen active receipts are macOS only. No fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. The direct side-effect-facts selector retains six cases: replay exclusion, live sequence handling, stale disposer ownership, one handoff drain, drain-before-snapshot, and stale replacement-snapshot refusal. Successful current-entry snapshot application is not witnessed by the retained snapshot case. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Remove SSH/absent-inventory attach refusal, later-subscriber retry, no-view adoption/takeback, provider-tail/unknown-read projections, failed-keystroke retry and simpler loss reattach examples. Keep the existing-subscriber inventory-ready retry alias only at its retained callback, plus retained held-input cancellation/replacement and overlapping attach/loss fences. The inventory driver also loses the whole empty-worktree-publication registration and folder-host/unverifiable scalar examples. Retire the entire dated10-case attach receipt; retain16 independent receipts only in their original scopes. No retained-memory or real-daemon measurement follows from supplied provider inventories. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove initial-snapshot sequence-domain, limited-tail/truncation and unknown-output-sequence aliases whose callbacks are removed. The source retains partial-chunk replay and requested-snapshot retry/admission at supplied snapshot/data seams, not equivalent replacement or measured retained-memory proof. Preserve the existing stream/pending-wait capacity aliases only to their retained owning multiplex callbacks with supplied PTY resolutions. Removing the sibling-PTY heartbeat dedup work-count sample does not establish a new decorative fanout budget; the unrelated-PTY cancellation fence survives. Preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove the reasonless-close selector and narrow census aliases to actual retained runtime and injected-inventory callbacks. The removed synthetic census-dedup and isolated pre-boundary timing cases receive no replacement credit; preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): Delete the synthetic watcher-synchronization and partial-reconciliation suites. Retire all affected host-fact, capability-owner, activation-residue and retention-cap aliases because the remaining callbacks do not establish those full claims. Keep exact local hook/timer, byte-stream side effects, exit/disposal, scroll-intent cleanup and deterministic local rank/TTL progression callbacks within their mocked-host scope. No physical paired-host retention, resource budget or equivalent replacement evidence is assigned. The generic broad test command remains a runnable discovery command, never a dated execution receipt. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete hook-agent-status projection suite and its two behavioral assertion aliases. Supplied stored hook/title/resume/staleness/rename/question/generation/PTY-retirement/snapshot-version projections are intentionally lost. The separate osc-status-scan gate mentions this source only in existing historical notes and receives no mutation. No measured hidden-output retention, CPU/RSS or resource budget result is claimed by the deleted source or this audit. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Run one byte-identical six-terminal oracle against an isolated headed desktop host and an isolated headless `orca serve` host. Stage at least 1,000,000 xterm cells, hide all six warm managers, emit an initial working title followed by 30 timed real-PTY spinner frames and a final idle title per worktree, and observe a second real session-tabs subscription plus the production renderer store. Require exactly two transport envelopes and two title mutations per worktree, no decorative title crossing either boundary, and positive decoded-envelope bytes. Enable ordinary parking with the lossy retention budget disabled, require exactly one mounted manager and five parked tabs, at most 45% retained cells, no more than 16 MiB heap growth, and under 500 ms timer drift. In headed mode, require the host renderer to remain on its original workspace with zero target terminal managers mounted throughout client park, reveal, and live I/O. While a tab is parked, require authoritative terminal.read to observe new PTY output; reveal it and require the original PTY, a marker within the requested 5,000-row history, the parked marker, and post-reveal input/output. Drive 24 real PTY title trackers in distinct worktrees through 40 decorative spinner frames each, then 40 spinner frames alternating with Cursor's bare native identity redraw, using fake clocks. Require all 2,880 raw chunks exactly and zero host session-tabs publications, serialized bytes, renderer apply calls, and renderer store mutations. Continue decorative evidence beyond 30 minutes, require exactly one refresh per worktree per 15-minute lease through a FIFO spaced by at least 50 ms, and require all 24 viewer statuses to remain working and fresh; then require one exact semantic idle transition and one visible-output chunk per PTY. Require ordinary and interior-Braille title changes to publish. Drive 64 host PTYs through ten 80 ms synthetic title frames, require zero paired client events after the first frame per PTY while all 640 local frames remain observable, attach a late client and require one current frame per PTY, then require semantic bell and idle transitions on both clients. Reconstruct a legacy subscribed stream with no outputPause capability, hide a chatty pane, require no hidden xterm writes, reveal it, and require one authoritative snapshot plus continued live output. Drop and acknowledge output only for one original paired-client stream, prove the fixture process consumed input while the host model advanced and the client stayed stale, then require the command snapshot probe to replace that stream, repaint exact fixture output, preserve authoritative PTY identity and target-tab cardinality, and resume live I/O. For a client without a delivered sequence, require the first numeric probe to establish a baseline without replacement, a same-sequence probe to remain attached, and a later advanced probe to replace only that stream. Withhold the first encrypted shared-control ready frame, start one RPC, trigger a status-probe refresh, and require two connections, one host delivery, successful response, and zero retained request bytes. Admit 128 active streams, reject the 129th as retryable, release one stream, then require the retry to attach and publish a snapshot without multiplying retained subscribers. Disable terminal.paired-parking.v1 and require the same oracle to fail before parking, while the legacy limit-one fallback separately passes. Also preserve truncated first paint, ACK-starved same-PTY recovery, responsive silent-command snapshot probes, dead-stream probe timeout recovery, and queued manual-disconnect fencing.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-unpublished-host-graph.test.ts", "ORCA_BACKGROUND_LAUNCH=1 pnpm exec playwright test tests/e2e/paired-remote-terminal-host-quit-reconnect-input.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", @@ -8269,7 +8245,7 @@ "ORCA_BACKGROUND_LAUNCH=1 pnpm exec playwright test tests/e2e/paired-client-first-terminal-unopened-host-worktree.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/session-lifecycle/publication/mobile-session-tabs-agent-status-heartbeat.test.ts tests/e2e/session-tabs-decorative-title-fanout.unit.test.ts --maxWorkers=1", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/parking/lifecycle/use-terminal-tab-cold-parking.test.ts --maxWorkers=1", - "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/terminal-multiplex-initial-snapshot-buffering.test.ts src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts src/main/runtime/rpc/terminal-subscribe-buffer.test.ts src/renderer/src/components/terminal-pane/pty-transport/output/terminal-side-effect-facts-handler.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-activation-inventory-fallback.test.ts src/renderer/src/components/terminal-pane/parking/retention/terminal-hidden-view-parking.test.ts src/renderer/src/components/terminal-pane/parking/retention/terminal-hidden-worktree-retention.test.ts src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-tab-watchers.test.ts src/renderer/src/runtime/rpc/subscriptions/runtime-client-events.test.ts src/renderer/src/web/web-preload-api-runtime-environment.test.ts src/main/ipc/runtime-environments/runtime-environments-pairing.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/terminal/terminal-multiplex-initial-snapshot-buffering.test.ts src/main/runtime/rpc/terminal/terminal-multiplex-pty-wait-capacity.test.ts src/main/runtime/rpc/terminal/terminal-subscribe-buffer.test.ts src/renderer/src/components/terminal-pane/pty-transport/output/terminal-side-effect-facts-handler.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-activation-inventory-fallback.test.ts src/renderer/src/components/terminal-pane/parking/retention/terminal-hidden-view-parking.test.ts src/renderer/src/components/terminal-pane/parking/retention/terminal-hidden-worktree-retention.test.ts src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-tab-watchers.test.ts src/renderer/src/runtime/rpc/subscriptions/runtime-client-events.test.ts src/renderer/src/web/web-preload-api-runtime-environment.test.ts src/main/ipc/runtime-environments/runtime-environments-pairing.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/terminal/adoption/terminal-subscriber-driven-daemon-attach.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/session-tabs/runtime-inventory-publication-authority.test.ts src/main/runtime/rpc/methods/session-tabs/session-tabs-inventory-census-race.test.ts src/main/daemon/terminal-host/testing/terminal-host-agent-session.test.ts tests/e2e/session-tabs-empty-inventory-daemon-oracle.unit.test.ts --maxWorkers=1", "pnpm exec vitest run --config config/vitest.config.ts src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts", @@ -8293,10 +8269,9 @@ "src/main/runtime/construction/orca-runtime.test.ts", "src/renderer/src/web/web-preload-api-runtime-environment.test.ts", "src/main/ipc/runtime-environments/runtime-environments-pairing.test.ts", - "src/main/runtime/rpc/terminal-multiplex-initial-snapshot-buffering.test.ts", - "src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts", - "src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts", - "src/main/runtime/rpc/terminal-subscribe-buffer.test.ts", + "src/main/runtime/rpc/terminal/terminal-multiplex-initial-snapshot-buffering.test.ts", + "src/main/runtime/rpc/terminal/terminal-multiplex-pty-wait-capacity.test.ts", + "src/main/runtime/rpc/terminal/terminal-subscribe-buffer.test.ts", "src/main/runtime/terminal/adoption/terminal-subscriber-driven-daemon-attach.test.ts", "src/main/runtime/session-tabs/runtime-inventory-publication-authority.test.ts", "src/main/runtime/rpc/methods/session-tabs/session-tabs-inventory-census-race.test.ts", @@ -8415,7 +8390,7 @@ ] }, { - "file": "src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts", + "file": "src/main/runtime/rpc/terminal/terminal-multiplex-pty-wait-capacity.test.ts", "assertions": [ "admits 128 active streams, rejects the 129th, and reuses released capacity", "reserves PTY wait capacity independently from active streams" @@ -8602,6 +8577,10 @@ "Keep the budget-off control, exact manager count, final bounded-tail flood marker, parked-time output, and post-reveal PTY input in both topology runs." ], "knownGaps": [ + "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.", + "Audit3814 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle from a Codex ready prompt even when stale startup lines remain :: Stale MCP startup lines must not block a later Codex ready header.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle when a stale Codex prompt is followed by the ready header :: A Codex ready header following a stale resume prompt must satisfy tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for an idle Cursor lane past its dismissed trust dialog (#8210) :: Later Cursor idle banner overrides retained trust dialog.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not block a mid-run Cursor lane on its dismissed trust dialog (#8210) :: Dismissed trust dialog must not report blocked for later busy Cursor; wait times out.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not classify unrelated press-enter prompts as Codex blocked prompts :: Unidentified press-enter text must time out rather than be classified Codex blocked.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for quiet background PTY agents without OSC titles :: Quiet Codex background terminal without OSC title eventually resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: sends agent prompts as bracketed paste before submit :: Driving prompt escapes embedded paste-end ESC, writes one framed paste then CR, and counts bytes.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: settles a foreground Codex prompt when launch metadata has not arrived :: Codex inferred from foreground without launch metadata waits for composer marker/quiescence before one CR.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: gives a late Codex render marker a fresh quiescence window :: Marker arriving at7.9s re-arms fresh quiet window instead of submitting at initial cap.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: writes large agent prompt paste frames atomically before delayed submit :: A prompt larger than input chunk budget is a single paste write before delayed CR with exact byte count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects oversized terminal.send text before provider writes :: Oversized ordinary terminal.send rejects input-too-large before any provider write.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects focusing an exited background terminal session :: focusTerminal refuses terminal_exited before invoking background reveal.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: pastes the same bytes the desktop draft paste sent for the prompt :: Launch-ready prompt normalizes CR/LF and renders embedded ESC visibly identically to desktop bracketed paste.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: keeps a prompt into a running agent behind the render settle, as before :: Driving prompt remains held through7s repaint activity then submits once by9s.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reports a queued PTY focus as not navigated when its notifier disappears :: Queued PTY focus and completed active reveal report not navigated after notifier removal; no second reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: does not invoke a stale graph-leaf focus notifier after queued PTY work :: Queued graph-leaf focus must not invoke old notifier after preceding PTY reveal and notifier removal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: paginates retained terminal output with explicit limits and truncation metadata :: Preview120lines, fractional limits,50/200 pages, retained2000line truncation and future-cursor metadata stay consistent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: falls back to renderer visible screen when uncursored TUI tail is blank :: Substantial blank uncursored tail uses mounted renderer visible screen with zero scrollback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reads and shows the runtime-owned alternate-screen grid without serialization :: Actual runtime alternate-screen grid provides read/show content without renderer/provider serialization.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: classifies older provider alternate-screen snapshots from ANSI :: Older provider without alternateScreen metadata classifies ANSI alternate entry and returns Remote Vim screen.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: honors the last ANSI screen transition when older provider metadata is absent :: Last ANSI alternate exit overrides earlier entry when explicit provider mode metadata is absent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: rejects a full provider screen frame after live output advances :: Live output arriving during second full-screen capture causes screen-unavailable rather than stale full frame.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: shares one provider snapshot between concurrent read and show calls :: Concurrent read/show share one successful provider snapshot and both receive Shared TUI content.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps cursor reads provider-free on restored alternate-screen PTYs :: Restored alternate-screen cursor transcript reads never acquire provider snapshot.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: backs off after a provider snapshot failure instead of retrying for show :: Failed provider capture is cached/backed off so later show does not retry.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: falls back once to a mounted renderer when a known alternate provider fails :: A known-alternate failed provider capture falls back exactly once to newly mounted renderer.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: bounds provider visible frames for read and show responses :: Provider visible read/show use six bounded lines and300character preview.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps renderer-fallback composer drafts separate from terminal output :: Renderer fallback strips dim composer draft from terminal output and exposes draft separately.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: does not use renderer visible-screen fallback for a short blank shell tail :: Two blank shell lines must not trigger renderer screen fallback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: trims terminal tail character budget without per-line array shifts :: Tail builder trims to256KiB with correct retained suffix and no Array.shift calls.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains ANSI-only status redraws instead of appending every frame :: Repeated erase/redraw replaces preview until newline then publishes one completed cursor row.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains split multi-line ANSI footer redraw state across chunks :: CUU state across chunks retains corrected footer rows and publishes new cursor entries.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not let stale lower rows hide earlier corrected footer rows from cursor reads :: Earlier corrected footer row must not be hidden by stale lower rows in cursor reads.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: bounds completed transcript entries from a single multi-line redraw chunk :: Single redraw chunk bounds completed transcript to2000retained lines and correct oldest/next/latest cursors.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains multi-line ANSI redraws when the last footer row stays partial :: Partial final redrawn row appears in preview but cursor sees it only after newline.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not retain split ANSI controls as visible terminal preview text :: Split color/mode escapes never leak preview fragments; long split OSC title truncates at MAX_OSC_TITLE_CHARS.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains same-line redraw cursor position across split full-line erase chunks :: Full-line erase preserves column across chunks so XY follows three spaces rather than old ABC.\nsrc/main/runtime/orca-runtime-tests/conpty-stream-read.spec.ts :: fills the requested line count even when blank rows sit below the prompt :: Blank rows below a ConPTY prompt must not consume the requested nonempty-line count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: does not retain split ST-terminated string controls as preview text :: Split ST-terminated Kitty/string controls must remain excluded from preview text.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects split OSC titles before retaining terminal previews :: Split BEL OSC title must update working title/status without leaking into preview.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects ST-terminated OSC titles split before the final backslash :: ST OSC split before final backslash must update title without leaking framing.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: preserves a trailing escape after a completed OSC title :: Completed OSC followed by pending ESC must preserve the next idle-title transition.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: seeds newly synced leaves from PTY pending ANSI state :: A newly synced graph leaf inherits pending ANSI so a split color fragment cannot leak.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: bounds retained partial terminal output before preview reads :: Partial terminal state stays capped at 4000, preserves retained array identity, and preview truncation/cursor output remains correct.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: submits the mail pointer to Cursor Agent only after the paste-burst delay :: Cursor mailbox pointer Enter must wait through the paste-burst delay; this is a real input-timing alarm intentionally retired.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts :: adopts a v1.4.150-shaped agent, setup, and shell orphan as one topology transaction :: Stale incarnation refuses without topology change; three agent/setup/shell lanes adopt atomically with layout/group/revision and preserved read/input/resize; exact replay is idempotent and competing owner refuses.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: retires the exact worker when it exits after renderer reveal :: Exact worker exit after reveal retires that worker and its surface.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: re-reveals a recovered worker after the renderer graph epoch changes :: Changed renderer graph epoch invalidates reveal receipt and forces another reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: defers recovery when the renderer omits the exact reveal identity :: Missing exact reveal identity defers recovery after two attempts.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: reconciles a same-id process replacement before headless adoption :: A process replacement before headless adoption must fence off stale ownership.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retires provider resume only after authoritative inventory proves the legacy PTY exited :: Authoritative owning-host inventory overrides false local hasPty, avoids SSH scanning, retires exited provider resume/surface, adopts live workers without headless reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retries inventory and unknown liveness without revealing a ghost worker :: Inventory failure and unknown liveness must retry without ghost reveal, eventually adopt, and stop retrying.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: refuses a live reserved pane before issuing a handle or revealing it :: A requireFreshPane launch receiving a live reserved owner must reject before handle/reveal/kill, and release its claim. No equivalent replacement claimed.", + "Audit3806 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: skips a listener unsubscribed mid-fan-out even with mobile exclusions active :: A listener removed by an earlier listener during one fanout is not called, including with a side-effect-excluded mobile listener present.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: retains bytes emitted before a fresh daemon spawn resolves :: Bytes and title arriving before an initial zero/reset provider response survive in the serialized headless buffer with their counted sequence.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits command-finished facts with best-effort exit codes across chunk splits :: A split OSC133 D exit code becomes130 and a missing code becomes null in ordered command-finished facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits pr-link facts once per URL with batch attribution :: A split GitHub PR URL yields42 rather than4, emits42/43 once each, and carries PTY/worktree/tab attribution.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits 2031-subscribe facts across chunk splits :: Split ESC[?20 then31h emits exactly one2031-subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: restores a provisional 2031 subscribe when daemon scan authority returns :: Returning daemon scan authority with partial scan seed and pending2031 subscription restores exactly one subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers the tracked title over the renderer snapshot lastTitle :: A synthetic live Cursor title overrides stale renderer lastTitle while preserving renderer snapshot source.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers provider history over a partial headless mirror for requested snapshots :: Authoritative requested snapshots return supplied provider frame/history/seq rather than a partial headless mirror, requesting5000rows.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: tracks live alternate-screen transitions after a provider snapshot :: Provider alternateScreen true is accepted, then live1049l/1049h update isTerminalAlternateScreen false/true.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: translates reset provider snapshots without retaining the old title :: A reset provider snapshot translates new local seq into the runtime domain and replaces Old process title with New process.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits the chunk agentStatus events before its side-effect batch :: Agent status callback precedes side-effect batch callback for one coalesced OSC9999/title/bell chunk.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: still emits a throwing chunk’s facts under its own seq, not the next chunk’s :: A tracker throw still flushes first chunk title facts under its own seq, and second chunk does not inherit those facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: seeds the lazily created tracker from the daemon-snapshot title :: A lazy tracker hydrated from renderer snapshot title Codex working emits agent-idle on later Codex done.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits command-code-working facts only after the banner arms the scrape :: Unarmed Thinking text emits no facts; a Command Code0.27.3 banner then hardcoded colored spinner text emits attributed command-code-working with the submitted prompt.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits a command-code-done fact when the idle composer returns :: After hardcoded banner/working text, returned idle composer emits command-code-done with the earlier submitted prompt.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: resizes the headless mirror after an accepted desktop PTY resize :: An external accepted resize produces the resized dimensions and same status-frame lines as a separately driven reference emulator.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: replaces suffix-only headless state with the recovered renderer snapshot :: Replacing suffix-only state removes old suffix, retains renderer history plus later output/cwd, and returns the live47x40PTY grid.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: stamps SSH connection identity on runtime terminal status :: A synthetic mounted-leaf OSC9999 status after registerPty carries the supplied SSH connectionId.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: does not retain WSL context when a PTY id is reused :: After exit and same-ID new null distro context, OSC7 file://server/share/repo uses UNC server path rather than old Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: preserves immutable context while a live daemon attach is unresolved :: preparePtyExecutionContext with preserveExisting refuses a supplied Debian replacement and subsequent OSC7 keeps original Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts :: projects frame-independent live state through main buffer snapshots :: Main-buffer snapshot puts focus-report/cursor-visibility modes in frameRestoreAnsi, excludes STATIC-FRAME there and includes it in data.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.ts :: continues terminal agent status fanout when a callback throws :: Throwing on the first status callback does not prevent second payload delivery and logs contextual error.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: returns a title-only replay snapshot and never historical attention :: Lose replay:true/title-only fact projection despite earlierbell and unknownPTYnull. No actual delivered-history notification or reattach behavior was exercised. No equivalent replacement claimed.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects a handle rebind while a controller-less status check yields :: A handle rebound while the null-controller status continuation yields must throw terminal_handle_stale.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects confirmation evidence when the owning PTY exits :: A pending strong confirmation resolving after owning PTY exit must reject terminal_exited.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-03.spec.ts :: keeps ordinary terminal send suffix failures on the existing not-writable contract :: Ordinary send writes text but refused CR must throw terminal_not_writable with beforeWrite twice and afterWrite once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell the execution host cannot apply instead of spawning its default :: Requested Windows shell on POSIX must refuse before spawning a default shell.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: quotes the agent startup command for the requested shell, not the host default :: Requested cmd shell must override PowerShell default quoting for agent startup command.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: keeps restored receipts outside a targeted worktree scan :: Targeted scan removes the moved-worktree receipt while preserving another worktree receipt.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: observes setup command completion without waiting for its interactive shell to exit :: Nonzero completion marker 17 resolves while interactive shell remains running.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: falls back to setup terminal exit when no completion signal is available :: Setup completion observer without token falls back to actual exit code 9.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: cancels setup completion observation when the caller aborts :: Abort rejects with the original reason and unsubscribes once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps observing after an uncertain setup terminal status :: Unknown exit waiter result must leave observation pending until completion marker arrives.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh omits a record :: Controller inventory omission disconnects the record but preserves its retained transcript.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh times out :: Hung inventory timeout leaves connected record and retained transcript intact.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle for adopted background PTY handles from the renderer title :: An adopted background handle resolves tui-idle from ready Codex renderer title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves live-leaf tui-idle from an OpenCode native title :: A live leaf resolves tui-idle from an OpenCode native title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from a Codex ready prompt preview :: A supplied Codex prompt preview resolves tui-idle without an actual agent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from an Antigravity prompt before the model line :: A supplied Antigravity prompt before model line resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell with no workspace instead of creating a default-shell tab :: Workspace-less explicit shell must reject before renderer default-tab request or spawn. This real guard/wiring alarm is deliberately retired.", + "Audit3798 per-case accepted losses:\nsrc/main/runtime/orca-runtime-tests/paired-settings.spec.ts :: awaits navigation-only updates from paired clients (%s) :: Updating only claudeSubagentNavigationEnabled waits for the actual controller call to the supplied pending Claude-view reconcile for both on/off values.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: drops a client page record even when its close command cannot be issued :: A removed workspace loses its runtime client-page record and headless browser projection despite close delivery_required rejection, and emits the asynchronous warning.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: leaves client-hosted pages alone when another host still owns the same worktree id :: Removing runtime:env-b metadata with local ownership leaves the local same-ID client page unchanged and issues no close command.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: marks live bindings again when reopening after a promoted window closes :: A reopened window marks its still-registered live worktree in activeWorktreeIdsOnShutdown after the first promoted window closes.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: preserves live SSH session identities when promoting a headless runtime :: Headless-to-desktop promotion records active worktree, SSH connection and remoteSessionIdsByTabId from the supplied surviving SSH PTY/session.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores a surviving renderer when its reload is cancelled :: A sole ready renderer reload cancelled under its current renderer fence returns true and becomes ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores headless authority when desktop promotion navigation is cancelled :: A cancelled desktop promotion with headless recovery returns false while headless authority remains ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: moves a desktop graph to unavailable when its reload times out :: A ready desktop graph without a headless fallback becomes unavailable at the reload deadline and retains its window/epoch.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: recovers a failed headless promotion and accepts a later renderer generation :: A promotion failure restores ready headless authority; a later valid same-window graph publishes ready desktop authority.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: clears a failed pane recovery so a later reconnect can retry :: After relay_reconnecting rejection, the pending recovery lock clears and the same pane/handle can call createTerminal a second time and return its supplied replacement.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: still preserves a CLI agent leaf when the reloaded renderer has not rebound its PTY :: An empty graph published during renderer reload preserves a preallocated live CLI PTY as one listable terminal before renderer rebind.\nsrc/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts :: keeps a no-incarnation handle across an in-graph pane remint :: Within one graph lifetime an unversioned PTY reminted onto another leaf retains its issued handle and resolves its old exit waiter after onPtyExit.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: matches explicit-id cwd PTYs when the resolved worktree cache is incomplete :: An explicit target absent from a fresh incomplete resolved cache adopts only its cwd PTY, rejects nested cwd PTY and does not rescan Git.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: ignores cwd-only controller PTYs for malformed explicit worktree IDs :: Malformed id:repo-1:: returns no terminals, does not adopt cwd-only controller PTY and avoids Git rescanning.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: refuses an SSH-backed create for mobile/runtime callers instead of creating locally :: Loss of this public unserved SSH create error-class/no-local-add/no-local-list alarm.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: records an app-selected parent workspace as a manual action :: Loss of the local runtime folder-parent manual origin, active-workspace source and explicit confidence projection alarm; no claim that SSH or cleanup coverage replaces it.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: browses runtime server directories before projects are added :: Loss of this public runtime alarm for browse availability before registration, directories-first lexical ordering and native path flavor.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: lists drive roots for a server-root browse :: Loss of the Windows public slash-root drive enumeration smoke and presence of the temporary directory drive.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations-part-02.spec.ts :: creates a missing runtime parent before creating the project directory :: Loss of this runtime createRepo recursive missing-parent/child existence and registered-path alarm.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: preserves selected project %s when a hosted parent is known :: Loss of both parent-selected and origin-selected normal fork-link projection/persisted upstream alarms plus exact single-probe count.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: links a current enterprise remote despite unavailable metadata and a retained %s :: Loss of normal current-enterprise-origin linking with stale automatic GitHub avatar or protected file image, unchanged icon assertion, and serialized project identity under unavailable metadata.", "Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed.", "Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions.", "NEXT65 current scope qualification: The NEXT65 knownGaps entries below govern the changed selectors and qualify any broader coverage implication in this gate’s unchanged oracle/coverageNotes narratives. Those narratives and preserved dated evidenceRuns retain their historical text and original exact execution scopes only; no fresh execution, transferred pass or equivalent replacement coverage is claimed. Upstream case removals remain upstream; original NEXT65 proposal descriptions grant no duplicate retirement credit.", @@ -8720,7 +8699,8 @@ "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.\nOriginal active selector fields (historical raw native JSON values; not current coverage):\ncommands: [\n \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-unpublished-host-graph.test.ts\",\n \"ORCA_BACKGROUND_LAUNCH=1 pnpm exec playwright test tests/e2e/paired-remote-terminal-host-quit-reconnect-input.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/terminal/query/runtime-terminal-inventory-contracts.test.ts\",\n \"ORCA_BACKGROUND_LAUNCH=1 pnpm exec playwright test tests/e2e/paired-client-first-terminal-unopened-host-worktree.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/session-lifecycle/publication/mobile-session-tabs-agent-status-heartbeat.test.ts tests/e2e/session-tabs-decorative-title-fanout.unit.test.ts --maxWorkers=1\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/parking/lifecycle/use-terminal-tab-cold-parking.test.ts --maxWorkers=1\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/terminal-multiplex-initial-snapshot-buffering.test.ts src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts src/main/runtime/rpc/terminal-subscribe-buffer.test.ts src/renderer/src/components/terminal-pane/pty-transport/output/terminal-side-effect-facts-handler.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-visibility-and-exit.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-activation-inventory-fallback.test.ts src/renderer/src/components/terminal-pane/parking/retention/terminal-hidden-view-parking.test.ts src/renderer/src/components/terminal-pane/parking/retention/terminal-hidden-worktree-retention.test.ts src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-tab-watchers.test.ts src/renderer/src/runtime/rpc/subscriptions/runtime-client-events.test.ts src/renderer/src/web/web-preload-api-runtime-environment.test.ts src/main/ipc/runtime-environments/runtime-environments-pairing.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/terminal/adoption/terminal-subscriber-driven-daemon-attach.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/session-tabs/runtime-inventory-publication-authority.test.ts src/main/runtime/rpc/methods/session-tabs/session-tabs-inventory-census-race.test.ts src/main/daemon/terminal-host/testing/terminal-host-agent-session.test.ts tests/e2e/session-tabs-empty-inventory-daemon-oracle.unit.test.ts --maxWorkers=1\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts\",\n \"SKIP_BUILD=1 pnpm exec playwright test tests/e2e/paired-remote-terminal-host-restart-background-sync.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1\",\n \"ORCA_E2E_FORWARD_APP_LOGS=1 SKIP_BUILD=1 pnpm exec playwright test tests/e2e/paired-remote-terminal-host-restart-background-sync.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1 --repeat-each=10 --max-failures=1\",\n \"ORCA_E2E_WEB_CLIENT=1 SKIP_BUILD=1 pnpm exec playwright test tests/e2e/paired-remote-terminal-truncated-tail-first-paint.spec.ts --config tests/playwright.config.ts --project electron-headful --workers=1\",\n \"SKIP_BUILD=1 pnpm exec playwright test tests/e2e/paired-remote-terminal-lossy-initial-snapshot.spec.ts --config tests/playwright.config.ts --project electron-headful --workers=1\",\n \"ORCA_E2E_WEB_CLIENT=1 ORCA_E2E_DISABLE_PAIRED_TERMINAL_PARKING=1 SKIP_BUILD=1 pnpm exec playwright test tests/e2e/paired-remote-terminal-truncated-tail-first-paint.spec.ts --config tests/playwright.config.ts --project electron-headful --workers=1\",\n \"ORCA_E2E_WEB_CLIENT=1 SKIP_BUILD=1 pnpm exec playwright test tests/e2e/paired-remote-terminal-stall-recovery.spec.ts --config tests/playwright.config.ts --project electron-headful --workers=1\",\n \"ORCA_E2E_WEB_CLIENT=1 SKIP_BUILD=1 pnpm exec playwright test tests/e2e/paired-remote-terminal-probe-gap-recovery.spec.ts --config tests/playwright.config.ts --project electron-headful --workers=1\",\n \"ORCA_E2E_WEB_CLIENT=1 SKIP_BUILD=1 pnpm exec playwright test tests/e2e/headless-paired-remote-terminal-stall-recovery.spec.ts --config tests/playwright.config.ts --project electron-headful --workers=1\",\n \"ORCA_E2E_WEB_CLIENT=1 pnpm exec playwright test tests/e2e/paired-remote-terminal-retention-memory.spec.ts --config tests/playwright.config.ts --project electron-headful --workers=1\",\n \"ORCA_E2E_WEB_CLIENT=1 SKIP_BUILD=1 pnpm exec playwright test tests/e2e/paired-remote-terminal-retention-memory.spec.ts --config tests/playwright.config.ts --project electron-headful --workers=1\",\n \"ORCA_E2E_WEB_CLIENT=1 SKIP_BUILD=1 pnpm exec playwright test tests/e2e/headless-paired-remote-terminal-retention-memory.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1\",\n \"SKIP_BUILD=1 pnpm exec playwright test tests/e2e/terminal-parked-memory.spec.ts --config tests/playwright.config.ts --project electron-headful --workers=1\"\n ]\ntestFiles: [\n \"src/main/runtime/session-lifecycle/publication/mobile-session-tabs-agent-status-heartbeat.test.ts\",\n \"tests/e2e/session-tabs-decorative-title-fanout.unit.test.ts\",\n \"src/renderer/src/components/terminal-pane/parking/lifecycle/use-terminal-tab-cold-parking.test.ts\",\n \"src/main/runtime/construction/orca-runtime.test.ts\",\n \"src/renderer/src/web/web-preload-api-runtime-environment.test.ts\",\n \"src/main/ipc/runtime-environments/runtime-environments-pairing.test.ts\",\n \"src/main/runtime/rpc/terminal-multiplex-initial-snapshot-buffering.test.ts\",\n \"src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts\",\n \"src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts\",\n \"src/main/runtime/rpc/terminal-subscribe-buffer.test.ts\",\n \"src/main/runtime/terminal/adoption/terminal-subscriber-driven-daemon-attach.test.ts\",\n \"src/main/runtime/session-tabs/runtime-inventory-publication-authority.test.ts\",\n \"src/main/runtime/rpc/methods/session-tabs/session-tabs-inventory-census-race.test.ts\",\n \"src/main/daemon/terminal-host/testing/terminal-host-agent-session.test.ts\",\n \"tests/e2e/session-tabs-empty-inventory-daemon-oracle.unit.test.ts\",\n \"src/renderer/src/components/terminal-pane/pty-transport/output/terminal-side-effect-facts-handler.test.ts\",\n \"src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts\",\n \"src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-visibility-and-exit.test.ts\",\n \"src/renderer/src/components/terminal-pane/parking/retention/terminal-hidden-worktree-retention.test.ts\",\n \"src/renderer/src/components/terminal-pane/parking/retention/terminal-hidden-view-parking.test.ts\",\n \"src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-tab-watchers.test.ts\",\n \"src/renderer/src/runtime/rpc/subscriptions/runtime-client-events.test.ts\",\n \"src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-activation-inventory-fallback.test.ts\",\n \"src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts\",\n \"tests/e2e/paired-remote-terminal-lossy-initial-snapshot.spec.ts\",\n \"tests/e2e/paired-remote-terminal-truncated-tail-first-paint.spec.ts\",\n \"tests/e2e/paired-remote-terminal-stall-recovery.spec.ts\",\n \"tests/e2e/paired-remote-terminal-probe-gap-recovery.spec.ts\",\n \"tests/e2e/headless-paired-remote-terminal-stall-recovery.spec.ts\",\n \"tests/e2e/paired-remote-terminal-retention-memory.spec.ts\",\n \"tests/e2e/headless-paired-remote-terminal-retention-memory.spec.ts\",\n \"tests/e2e/terminal-parked-memory.spec.ts\",\n \"tests/e2e/paired-remote-terminal-host-restart-background-sync.spec.ts\",\n \"src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-unpublished-host-graph.test.ts\",\n \"tests/e2e/paired-remote-terminal-host-quit-reconnect-input.spec.ts\",\n \"src/main/runtime/terminal/query/runtime-terminal-inventory-contracts.test.ts\",\n \"tests/e2e/paired-client-first-terminal-unopened-host-worktree.spec.ts\"\n ]\nassertionRefs: [\n {\n \"file\": \"tests/e2e/session-tabs-decorative-title-fanout.unit.test.ts\",\n \"assertions\": [\n \"2,880 decorative spinner and bare-native real-PTY OSC chunks publish zero session-tabs snapshots or serialized bytes after semantic convergence\",\n \"the viewer performs zero snapshot applies and zero store mutations during decorative activity\",\n \"after 30 minutes, one globally spaced refresh per worktree keeps every mirrored working status fresh\",\n \"exact Pi and rotating normalized Pi/Grok frames renew explicit and fallback status without changing stateStartedAt or acknowledgement semantics\",\n \"matching title evidence renews retained OSC hook status without resetting stateStartedAt, then drops unverifiable prompt metadata after the hook row expires\",\n \"renderer-authored rich status keeps its original lease, then renews only coarse title-confirmed state and provider identity\",\n \"ordinary-shell title transitions replace working stateStartedAt with the completion transition time\",\n \"decorative heartbeats remain blocked until unknown foreground ownership resolves, then resume at the bounded interval\",\n \"tracked terminal state reset clears delayed foreground ownership markers\",\n \"raw chunks, semantic idle transitions, and visible output remain exact\"\n ]\n },\n {\n \"file\": \"src/main/runtime/terminal/adoption/terminal-subscriber-driven-daemon-attach.test.ts\",\n \"assertions\": [\"retries an existing subscriber when provider inventory becomes ready\"]\n },\n {\n \"file\": \"src/main/runtime/rpc/methods/session-tabs/session-tabs-inventory-census-race.test.ts\",\n \"assertions\": [\n \"creation and removal at the census release edge are subsumed once, and a delayed pre-boundary change is not replayed\",\n \"post-boundary creation and removal replay after the initial snapshot in sequence order\",\n \"create/remove/recreate transitions are preserved without collapse\",\n \"a post-boundary projected-state change is delivered without a new snapshot revision\",\n \"an older coalesced callback cannot overwrite a newer immediate change\",\n \"initialization churn publishes only the latest projected state and repeated structural overflow fails after bounded recollection\",\n \"disconnect aborts the census and removes the real runtime listener\"\n ]\n },\n {\n \"file\": \"tests/e2e/session-tabs-empty-inventory-daemon-oracle.unit.test.ts\",\n \"assertions\": [\n \"unpublished empty inventory keeps resume dispatch at zero with the original daemon session, process id, and writer as the sole live writer\",\n \"an authoritative empty inventory settles the mirror and releases exactly one resume dispatch with zero liveness probes\",\n \"re-enabling unconditional empty hydration makes the identical oracle red with one resume dispatch, two session ids, two process ids, and two writer calls\"\n ]\n },\n {\n \"file\": \"tests/e2e/paired-remote-terminal-host-restart-background-sync.spec.ts\",\n \"assertions\": [\n \"preserves daemon PID and target PTY identity across the paired host relaunch\",\n \"foregrounds the daemon-backgrounded target on its first post-relaunch remote observation\",\n \"delivers target and post-relaunch control terminal input and live output\"\n ]\n },\n {\n \"file\": \"tests/e2e/paired-remote-terminal-probe-gap-recovery.spec.ts\",\n \"assertions\": [\"replaces a stale paired stream when the PTY snapshot advanced\"]\n },\n {\n \"file\": \"tests/e2e/paired-remote-terminal-stall-recovery.spec.ts\",\n \"assertions\": [\n \"restarts one ACK-starved paired terminal stream without replacing its PTY\"\n ]\n },\n {\n \"file\": \"tests/e2e/headless-paired-remote-terminal-stall-recovery.spec.ts\",\n \"assertions\": [\"recovers an ACK-starved stream from an isolated headless Orca host\"]\n },\n {\n \"file\": \"tests/e2e/paired-remote-terminal-lossy-initial-snapshot.spec.ts\",\n \"assertions\": [\n \"a nonempty lossy initial snapshot paints exactly once on a paired client\",\n \"the authoritative host cursor advances and live output resumes exactly once\"\n ]\n },\n {\n \"file\": \"tests/e2e/paired-remote-terminal-truncated-tail-first-paint.spec.ts\",\n \"assertions\": [\n \"paints a paired remote terminal when only its retained text tail overflowed\",\n \"legacy paired hosts retain the lossy hidden-manager budget fallback\"\n ]\n },\n {\n \"file\": \"tests/e2e/paired-remote-terminal-retention-memory.spec.ts\",\n \"assertions\": [\n \"ordinary-parks paired terminals and restores authoritative host scrollback\",\n \"warm-mounted hidden paired streams schedule zero renderer output work under sustained host output\",\n \"six hidden real PTYs publish and apply only exact working and idle title transitions across paired transport\",\n \"client recovery completes while every target terminal remains unmounted in the host renderer\"\n ]\n },\n {\n \"file\": \"tests/e2e/headless-paired-remote-terminal-retention-memory.spec.ts\",\n \"assertions\": [\n \"ordinary-parks paired terminals against an isolated headless Orca host\",\n \"cold-activates only visible paired terminals against an isolated headless host\",\n \"the headless host bounds real-PTY decorative title transport and production store application\",\n \"the headless host shares the zero-hidden-renderer-work and exact-restoration contract\"\n ]\n },\n {\n \"file\": \"tests/e2e/terminal-parked-memory.spec.ts\",\n \"assertions\": [\n \"releases un-parkable hidden worktree buffers only once the retention budget engages\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts\",\n \"assertions\": [\n \"admits 128 active streams, rejects the 129th, and reuses released capacity\",\n \"reserves PTY wait capacity independently from active streams\"\n ]\n },\n {\n \"file\": \"src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts\",\n \"assertions\": [\n \"pauses capable paired output while hidden and restores exactly on reveal\",\n \"locally gates hidden paired output when a legacy host cannot pause it\"\n ]\n },\n {\n \"file\": \"src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-activation-inventory-fallback.test.ts\",\n \"assertions\": [\n \"keeps a mounted HUB mirror alive when the old stream ends before the replacement snapshot\"\n ]\n },\n {\n \"file\": \"src/renderer/src/web/web-preload-api-runtime-environment.test.ts\",\n \"assertions\": [\n \"keeps pairing while manual disconnect fences passive reconnects\",\n \"returns a disconnect envelope when a queued active runtime call disconnects\",\n \"returns a disconnect envelope when a queued selected environment call disconnects\"\n ]\n }\n ]", "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. Original scope text is retained as the exact suffix of coverageNotes/oracle; historical evidence is unchanged.", "Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. The decorative fanout suite retains only real OSC9999 ingestion through runtime/title heartbeat/viewer past the stale boundary, preserving stateStartedAt and clearing expired prompt metadata. Spinner volume/zero-work inventories, Pi/Grok frame tables, rich-status and foreground-reset examples are retired. Existing receipts for separate paired-terminal sources retain their original scopes. All prior notes and complete dated receipts retain their original scopes.", - "Audit3446 archived original assertionRef after source reduction; historical scope only, raw original object follows:\n{\n \"file\": \"tests/e2e/session-tabs-decorative-title-fanout.unit.test.ts\",\n \"assertions\": [\n \"2,880 decorative spinner and bare-native real-PTY OSC chunks publish zero session-tabs snapshots or serialized bytes after semantic convergence\",\n \"the viewer performs zero snapshot applies and zero store mutations during decorative activity\",\n \"after 30 minutes, one globally spaced refresh per worktree keeps every mirrored working status fresh\",\n \"exact Pi and rotating normalized Pi/Grok frames renew explicit and fallback status without changing stateStartedAt or acknowledgement semantics\",\n \"matching title evidence renews retained OSC hook status without resetting stateStartedAt, then drops unverifiable prompt metadata after the hook row expires\",\n \"renderer-authored rich status keeps its original lease, then renews only coarse title-confirmed state and provider identity\",\n \"ordinary-shell title transitions replace working stateStartedAt with the completion transition time\",\n \"decorative heartbeats remain blocked until unknown foreground ownership resolves, then resume at the bounded interval\",\n \"tracked terminal state reset clears delayed foreground ownership markers\",\n \"raw chunks, semantic idle transitions, and visible output remain exact\"\n ]\n }" + "Audit3446 archived original assertionRef after source reduction; historical scope only, raw original object follows:\n{\n \"file\": \"tests/e2e/session-tabs-decorative-title-fanout.unit.test.ts\",\n \"assertions\": [\n \"2,880 decorative spinner and bare-native real-PTY OSC chunks publish zero session-tabs snapshots or serialized bytes after semantic convergence\",\n \"the viewer performs zero snapshot applies and zero store mutations during decorative activity\",\n \"after 30 minutes, one globally spaced refresh per worktree keeps every mirrored working status fresh\",\n \"exact Pi and rotating normalized Pi/Grok frames renew explicit and fallback status without changing stateStartedAt or acknowledgement semantics\",\n \"matching title evidence renews retained OSC hook status without resetting stateStartedAt, then drops unverifiable prompt metadata after the hook row expires\",\n \"renderer-authored rich status keeps its original lease, then renews only coarse title-confirmed state and provider identity\",\n \"ordinary-shell title transitions replace working stateStartedAt with the completion transition time\",\n \"decorative heartbeats remain blocked until unknown foreground ownership resolves, then resume at the bounded interval\",\n \"tracked terminal state reset clears delayed foreground ownership markers\",\n \"raw chunks, semantic idle transitions, and visible output remain exact\"\n ]\n }", + "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." ], "demotionRule": "Keep experimental or demote to protection none if decorative title frequency changes paired client-event or session-tabs publication volume after convergence, a semantic fact is dropped, paired first paint is blank, passive work reconnects after manual disconnect, a capable hidden paired manager survives ordinary parking, a legacy hidden pane schedules raw xterm output or bypasses its fallback, reveal loses requested bounded history or live PTY identity, retained buffer cells do not fall, or either headed/headless scenario flakes." }, @@ -8884,7 +8864,7 @@ "providers": ["local", "daemon", "ssh", "remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous account (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous account (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous account (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous account (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous account (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous 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): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous account (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Independently remove one authored/finite Playwright closed-gate app-boot inventory: accept loss of real renderer/preload/main refusal composition, saved-host row and Add/Move hiding/Remove visibility alarms. Keep the unchanged scripted-move rendered dialog lifecycle/reload case. It runs no real WSL migration, host connection, file copy or automation restoration. No selector or Playwright participation cleanup is required because the spec remains. Previous 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. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result 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. Broad root-unit discovery loses whole cross-client workspace-sync, terminal-preview, picker-skill-hint and close-routing suites plus reduced worker-stop, remote-owned-record, scanner, mobile-bundle and daemon-health samples. Separate E2E discovery also loses the paired mobile/desktop mirror journey and two unit drivers. Retained callback/table/outer-loop/guard bytes are exact; retained checks do not replace the removed alarms. No app, native device, mixed-version, remote or cross-platform execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. 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. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. 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. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. 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. The broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. 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. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Module layout SSH policy: Retire the multiplexer private-clock saturation registration, the writer saturation transition-count registration and the changed-source dated writer/backpressure receipt. Retained byte delivery, lane order, fairness, settlement and cancellation cases are unvalidated by that historical receipt. No equivalent replacement, new execution, measured performance, live SSH/WSL or cross-platform proof is claimed. The unchanged WSL protocol receipt retains only its original command scope. Historical prior account (preserved verbatim): Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2070 (sources2068/2069): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/hooks-and-hosted-review.spec'). src/main/ssh/ssh-multiplexer-transport-writer.test.ts: reports saturated epochs and their drain boundary exactly once. src/main/runtime/orca-runtime-tests/worktree-removal-archive-hook-gate.spec.ts: removes and records the waiver when the failure is explicitly overridden; removes without an override record when the hook succeeds; removes when the hook is configured but not requested; removes when no archive hook is configured; holds a desktop removal in the same repo until this one is accepted; joins a desktop removal of the same worktree accepted while this one waited. src/main/runtime/orca-runtime-tests/worktree-ps-agent-row-dismissal.spec.ts: drops the row as soon as the user dismisses it, without waiting for the PTY to exit; tells paired clients to republish on the transition and on the dismissal; rejoins a row through its %s handle after pane ownership clears. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review.spec.ts: reports an error when the SSH filesystem provider is unavailable; reports an SSH orca.yaml as an error without reading any filesystem; reports ok for a local repo hook check; reads SSH issue commands as absent and drops writes without touching any filesystem; allows host integration slug helpers for SSH repos through provider-aware GitHub clients; routes runtime GitHub repo identity helpers through the selected WSL project runtime; routes runtime GitHub issue and work-item actions through the selected WSL project runtime; pins explicit origin preference on runtime open-by-number work item lookups; forwards check-details cancellation without local Git overrides. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. The historical receipt/currentCommand selecting src/main/ssh/ssh-multiplexer-transport-writer.test.ts remains historical and is not a passing result for the reduced current command. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete tail-wait memo suite: its sole current authored callback checks supplied fromTail/blocked field values. Retire all three broader memoization/equivalence/eviction assertion aliases; they are not backed by retained source callbacks. No scan-work budget, sustained output, physical terminal or resource measurement is assigned to this removed test. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1674 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Local macOS evidence covers main-process pending-output and projection-admission caps, saturated-tail wait detection, direct-SSH source retention/accounting, always-on V1 negotiation with legacy peer fallback, exact provider-generation pause ownership, renderer exit/data ordering, decoder input bounds, bounded reconnect scheduling, and WSL stdio transport settlement through deterministic unit contracts. A joined main/runtime oracle exercises renderer-sourced headed semantics and headless-model snapshot semantics without launching a live paired server. Separately, a macOS-hosted Docker OpenSSH run exercises only the deployed Linux relay and direct SSH provider with an exact 256 KiB source-credit plateau, concurrent PTY typing, fixed-size filesystem frames, Git churn, and owner-lease reconnect. Neither deterministic topology labels nor Docker SSH constitute live headed desktop, headless orca serve, or physical WSL evidence; local/daemon, prior-version daemons, Windows named pipes/ConPTY, folder workspaces, and mixed-version clients also remain uncovered. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "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. Audit3788 retires10 authored/11 expanded cases across six changed drivers, including the entire screencast pending-frame-retry and usage-source-cache-streaming suites. Deliberate losses are false-refused last-frame retry/once-only delivery, ordinary stable-pane reattachment, cleared-chat Dispatch completion, terminal-declared chat-caller refusal, at-rest worker liveness projection, nested depth/cap policy, small unsigned6/sealed7 plain-format and verified-bit examples, generic malformed-ISIZE footer refusal examples, and synthetic10k/100k chunk-size/work-count budgets in gzip and general cache I/O. These include real state/disk/RPC outcomes consciously retired for marginal value; retained E2EE-backlog, receipt/custody/uncertain-ack, integrity/migration and staging-cleanup cases are not equivalent replacements. The footer test did not prove early rejection or bounded allocation; staging cleanup did not seed unrelated files. No replacement or fresh native/remote/performance execution is claimed. Earlier raw selectors and dated receipts remain historical. Audit3779 retires17 authored/17 expanded registrations across six changed drivers, including the entire shared-Codex-home and prompt-telemetry suites. Accepted losses are shared-home wrapper noninterference/opt-out preservation, mocked metric count/provenance filters, SSH activity labeling/clearing and handover idle timing, VM ownership/capability/status projections and asleep-worktree refusal, a link-only external conversation replay sample, and two narrow input-credit noninterference/expiry examples. Retain the direct exact-tab/single-use input-credit case. These bounded real disk/state/routing alarms are intentionally retired for marginal value without equivalent replacement or fresh execution claims; earlier receipts remain historical. Audit3772 retires18 authored/27 expanded cases, including whole Codex service opt-out, RPC capability-parser, creator-provenance, short-ciphertext and readiness-null suites. Accepted losses include service ledger/symlink/mode cleanup, user TOML substring preservation, old-hash cleanup, description pass-through, malformed-file/pending-hash examples, coordinator write/probe counts, capability array bounds, positive creator projections, early short-payload refusal and readiness helper null shape. Two redundant Codex exit-cause rows are also retired; Pi shares their direct-idle path only in this empty-output immediate-exit fixture, and future agent-config drift coverage is lost. Real bounded filesystem/parser/runtime alarms are deliberately retired for marginal value; no equivalent replacements or fresh execution are claimed. Earlier receipts retain their historical scope. Audits3754/3755 intentionally remove9 authored/9 finite registrations: the entire one-case usage-source-cache-streaming.test.ts driver and8 cases from the surviving computer-action-validation.test.ts driver. This gate retains an unfiltered root Vitest command; UNIT_INCLUDE admits both source paths. Accepted losses are the real encoder output chunk-size/work-count alarm on repetitive10k/100k ownership payloads through a mocked durable sink, plus CLI diagnostic precedence, fractional window-id rejection, action-call-site window-target exclusivity, plain-text click-count recovery copy, incomplete click/drag targeting, mouse/modifier/direction allowlist samples and inline/stdin text exclusivity. These CLI cases exercise real argument/handler validation before mocked runtime calls; they are deliberately retired for marginal value, not declared tautologies. Retained cache I/O and CLI cases are not equivalent replacements for these alarms. Existing historical raw receipts remain unchanged and do not validate the deleted or reduced drivers. No fresh execution claim is made. Audits3758/3763 intentionally remove9 authored/11 finite registrations from6 changed drivers, including the entire pane-title-notification, window-linear-notices and worktree-card-lifecycle-effects suites. This gate retains an unfiltered root Vitest command admitting these paths. Accepted losses are same-account linked-row success-notice fanout, sidebar-switch channel forwarding, Linear-only notification forwarding/non-terminal-consumer selection/closed-window detach, destroyed-window refusal and first-send-failure suspension through the pane-title adapter, the100-card synthetic focus/poll absence sample, stored-source local folder badge refresh, unobserved-row badge refusal, and immediate reposChanged lineage invalidation. These exercise real owners with controlled ports; they are retired for marginal value, without equivalent replacement claims. The no-badge-work fixture does not seed its title-promised collection-only cache. Preserved historical receipts do not validate deleted or reduced drivers; no fresh execution is claimed. Audit3759 retires the entire one-case Tailwind compiler/scanner smoke. Accept loss of the direct CSS production/test/spec source-exclusion and rescan alarm; no replacement or current execution is claimed. Audit3752 independently approves audit3749: retire five authored/five finite watcher-process registrations, retaining18 raw-exact registrations. Accept loss of healthy shared-pool joint recovery, last-pending-failure idle retirement/respawn, late VITEST fallback release, missing-entry fail-closed selection and independent-supervisor fuse locality alarms. These are real bounded host-policy alarms intentionally retired for low marginal value; no equivalent replacement is asserted. Remaining driver selections exercise controlled FakeChild supervisor lifecycle, cancellation, physical-exit fencing, recovery and fuse behavior. This source review supplies no fresh native/process/platform/remote/SSH execution; historical receipts retain original source and selector scopes. Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered root Vitest command. Current UNIT_INCLUDE admits the partial push-service, metadata-dialog and two config/scripts browser drivers:10 authored/16 finite removals. Accepted losses: actual retry30s/60s progression and register bucket/refill wiring, explicit seven-day lease arithmetic (its notification lacked seq/epoch and never reached send), equal-name edit latch/save payload, real image/font/meta-refresh/form/popup browser refusal controls, and broad rich-markdown bridge/command/edit-select smoke. Actual production state, callback routing and browser enforcement run in these cases; these alarms are deliberately retired on marginal value. All drivers and selectors survive. Existing unrelated receipts remain historical evidence for their unchanged selectors, not proof of the reduced cases. Audit3732 removes 2 authored/3 finite registrations from two partial suites: nominal custom/Kimi local naming success and deferred context usage row presentation. Real losses: custom/Kimi successful extraction through conversation-name sanitization and agentLabel composition; separate ordered counted/deferred lists and exact percentage/token formatting. No replacement or equivalent coverage claimed. Retain 11 authored/13 finite raw-exact registrations for bounded naming instruction/refusal/cancellation, menu dismissal focus ownership and hover/composer Escape/timer cleanup. Source-only bounded value review, no runtime/CI/native/remote/mobile/folder workspace or global completion credit. Previous account (preserved verbatim): Audit3733 removes2authored/2finite terminal input checks: fixed custom-cap error/secret fixture and three-emoji cap5refusal whose6UTF16units already trip length fast guard (no UTF8-dependent boundary). Accept exact non-disclosure/oversized-refusal alarm losses; no replacement/equivalence claim. Retain13/13scalar/pending input, OSC state and cron DST/cadence outcomes after bounded material reads. Source-only zero runtime/novelty credit; original historical reasons preserved. Previous account (preserved verbatim): Audit3729 removes1authored/3finite by deleting whole CLI runtime pairing advisory-close suite. Accept losing post-real-close injected EIO preservation of native/script/unreadable pairing, env identity/preservation and exact close/release assertions; no actual failed-close leak or replacement coverage claimed. Two retained URL grammar/identity suites11authored16finite raw unchanged. Bounded source/owner/caller value review, zero novelty/runtime credit; other seven3724deferred closures remain. Historical receipts preserve original limits. Previous account (preserved verbatim): Audit3724 removes3authored/3finite checks by deleting two whole suites: TUI clear burst-size singleton and terminal-file-URL target two-case wrapper suite. Deliberate losses: derived widest burst<64byte alarm, UNC authority+line-column anchor composition, and malformed-percent null refusal. Real production algorithms execute in those tests; no mocked-output tautology, equivalent replacement, actual Claude/file-navigation delivery or universal safety-irrelevance claim. TUI58byte bound and URI examples have low marginal value as standalone suites. Actual1262/1264/1742KEEP superseded explicitly. Remaining14drivers83authored136finite raw unchanged. Bounded source-only review; ten closures deferred, four bounded keep judgments repeated with zero new semantic-frontier credit. No runtime/CI/native/remote/mobile/folder/global completion claim; historical receipts retain original scope. Previous account (preserved verbatim): Audit3723 removes 4 authored/4 finite registrations in two whole suites: keybinding cache freeze/token spellings and host-dependent Orca command name examples. Real losses include returned-object freeze, repeated Mod+P key, Space/PageDown/NumpadSubtract mapping, unknown/empty/prototype-token rejection, and headless Linux versus Windows-server/WSL command choice. No equivalent or replacement coverage claimed. Retain 12 authored/21 finite raw-exact registrations exercising generated scaffold validation, artifact failures, shipped editor/hook/worker/panel tests, actual generated typing compilation, independent CLI root routing and intent-name precedence. Source-only bounded audit; no runtime, CI, native, remote, mobile, folder workspace or global completion credit. Previous account (preserved verbatim): Audit3720 removes17authored/23finite checks: whole main catalog-date adapter2 and shared date-helper7, seven renderer nominal ranking/cap/no-date/composition cases, and one browser registration expanding to seven forced-container/DOM-child boundary cases. Deliberate real losses: community oldest-date UTC forwarding, official/undated omission, date sorting/window/invalid/future/skew/clamp and default/override cap; nominal ranking/cap and combined Featured/Newly-added outputs; real CSS459/460,719/720,1055/1056breakpoint, five-card partial-row and720px two-card first-row alarms. Browser cases really measure rendered geometry but force width/remove DOM children; no fake-pixel or tautology rationale. No replacement/equivalent coverage claimed. Retain14authored/19finite raw-exact registrations across4drivers: adversarial featured category/order/tie and installability, date order/window selection, actual PluginManager failure/escaping/duplicate-card suppression, real browser viewport/odd-count geometry/phone catalog visibility, syntax ingress/depth/include/printability and68dlong-bracket auto-close fill-in. No tests/browser/native/UI/provider/remote/mobile/folder/CI/global execution or completion credit. Previous account (preserved verbatim): Audit3717 removes6 authored/6finite checks in two whole thin-adapter/presentation suites. Deliberate real losses: ordinary recipe repository-URL withholding and provisioned-root credential scrubbing/forwarding; repository label lockstep suffix expansion, host-scoped map identity/collision grouping, Windows crosshost paths and WSL distro suffixes. Actual provision options, label/sort consumers and host/scrubber delegates inspected; no replacement/equivalence claim. Retain40 authored/84finite registrations raw exact in14 drivers with bounded owner/context review. Prior KEEP superseded for removed suites; no runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3714 removes8 authored/39finite checks: whole CLI selector-recovery, task display-text and ANSI grammar suites plus two name joiner/blank tables. Deliberate real losses: selector flag/value/identity and mutation recovery merge/serialization; exact task suffix, transcript fallback, input immutability, cache reuse and edited blocks; independent failed-escape/resumption and OSC/DCS/BEL/ST/C1/nested/unfinished stripping outputs; meaningful-language joiner preservation and invisible/blank-name rejection. These are real bounded alarms, removed as narrow supplied-error examples, helper/token inventories and repeated internal-work fixtures. Prior2936,1195/1196,1214/1215 and1082 KEEP superseded; no replacement or equivalent coverage claimed. Keep9authored/9finite raw-exact registrations in5surviving drivers: screenshot export/failure filesystem behavior, CLI local tree query, event-local reply provenance, vault role-sensitive content and four hostile/UTF16/dangling/tag-name regressions. No native/UI/provider/remote/mobile/folder/runtime/CI/global completion credit. Previous account (preserved verbatim): Audit3711 retires2authored/4finite cases by deleting whole clipboard-image-temp-file signature-to-name inventory (HEIC/TIFF/unrecognised bytes) and workspace-last-active switch-on supplied visit/reason singleton, plus its now-orphan test fixture. This intentionally loses real generated-filename suffix/extensionless alarms and real newer-visit archived7day versus inactive30day filtering/older-visit identity alarms. Filesystem writing and production reason pruning really execute; no equivalent replacement or universal absence of safety relevance is claimed. The clipboard test does not inspect written bytes, native delivery or decode; the visit test supplies candidate/timestamps and does not exercise persisted visit routing or actual removal.20authored/20finite cases remain unchanged across4bounded Git/sidecar/removal drivers. No new runner/test/module evaluation or runtime result; historical notes and receipts remain historical. Previous account (preserved verbatim): Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous account (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous account (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous account (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous account (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous account (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous 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): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous account (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Independently remove one authored/finite Playwright closed-gate app-boot inventory: accept loss of real renderer/preload/main refusal composition, saved-host row and Add/Move hiding/Remove visibility alarms. Keep the unchanged scripted-move rendered dialog lifecycle/reload case. It runs no real WSL migration, host connection, file copy or automation restoration. No selector or Playwright participation cleanup is required because the spec remains. Previous 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. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result 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. Broad root-unit discovery loses whole cross-client workspace-sync, terminal-preview, picker-skill-hint and close-routing suites plus reduced worker-stop, remote-owned-record, scanner, mobile-bundle and daemon-health samples. Separate E2E discovery also loses the paired mobile/desktop mirror journey and two unit drivers. Retained callback/table/outer-loop/guard bytes are exact; retained checks do not replace the removed alarms. No app, native device, mixed-version, remote or cross-platform execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. 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. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. 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. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. 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. The broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. 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. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Module layout SSH policy: Retire the multiplexer private-clock saturation registration, the writer saturation transition-count registration and the changed-source dated writer/backpressure receipt. Retained byte delivery, lane order, fairness, settlement and cancellation cases are unvalidated by that historical receipt. No equivalent replacement, new execution, measured performance, live SSH/WSL or cross-platform proof is claimed. The unchanged WSL protocol receipt retains only its original command scope. Historical prior account (preserved verbatim): Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2070 (sources2068/2069): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/hooks-and-hosted-review.spec'). src/main/ssh/ssh-multiplexer-transport-writer.test.ts: reports saturated epochs and their drain boundary exactly once. src/main/runtime/orca-runtime-tests/worktree-removal-archive-hook-gate.spec.ts: removes and records the waiver when the failure is explicitly overridden; removes without an override record when the hook succeeds; removes when the hook is configured but not requested; removes when no archive hook is configured; holds a desktop removal in the same repo until this one is accepted; joins a desktop removal of the same worktree accepted while this one waited. src/main/runtime/orca-runtime-tests/worktree-ps-agent-row-dismissal.spec.ts: drops the row as soon as the user dismisses it, without waiting for the PTY to exit; tells paired clients to republish on the transition and on the dismissal; rejoins a row through its %s handle after pane ownership clears. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review.spec.ts: reports an error when the SSH filesystem provider is unavailable; reports an SSH orca.yaml as an error without reading any filesystem; reports ok for a local repo hook check; reads SSH issue commands as absent and drops writes without touching any filesystem; allows host integration slug helpers for SSH repos through provider-aware GitHub clients; routes runtime GitHub repo identity helpers through the selected WSL project runtime; routes runtime GitHub issue and work-item actions through the selected WSL project runtime; pins explicit origin preference on runtime open-by-number work item lookups; forwards check-details cancellation without local Git overrides. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. The historical receipt/currentCommand selecting src/main/ssh/ssh-multiplexer-transport-writer.test.ts remains historical and is not a passing result for the reduced current command. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete tail-wait memo suite: its sole current authored callback checks supplied fromTail/blocked field values. Retire all three broader memoization/equivalence/eviction assertion aliases; they are not backed by retained source callbacks. No scan-work budget, sustained output, physical terminal or resource measurement is assigned to this removed test. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1674 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Local macOS evidence covers main-process pending-output and projection-admission caps, saturated-tail wait detection, direct-SSH source retention/accounting, always-on V1 negotiation with legacy peer fallback, exact provider-generation pause ownership, renderer exit/data ordering, decoder input bounds, bounded reconnect scheduling, and WSL stdio transport settlement through deterministic unit contracts. A joined main/runtime oracle exercises renderer-sourced headed semantics and headless-model snapshot semantics without launching a live paired server. Separately, a macOS-hosted Docker OpenSSH run exercises only the deployed Linux relay and direct SSH provider with an exact 256 KiB source-credit plateau, concurrent PTY typing, fixed-size filesystem frames, Git churn, and owner-lease reconnect. Neither deterministic topology labels nor Docker SSH constitute live headed desktop, headless orca serve, or physical WSL evidence; local/daemon, prior-version daemons, Windows named pipes/ConPTY, folder workspaces, and mixed-version clients also remain uncovered. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", "motivatingLinks": [ "https://github.com/stablyai/orca/pull/6836", "https://github.com/stablyai/orca/pull/6858", @@ -8892,7 +8872,7 @@ "https://github.com/stablyai/orca/pull/7054" ], "invariant": "High-volume terminal output must stay bounded across daemon socket writes, SSH relay writer/decoder/source retention/reconnect, main model and projection admission, runtime metadata, detectors, and tail checks, main-to-renderer in-flight bytes, renderer scheduler queues, and hidden-output restore without starving focused input. Every new SSH session offers V1 and every same-build relay supports it; legacy delivery is reachable only when capability negotiation proves the peer cannot use V1. Negotiated SSH spans remain exact and contiguous through activation, exit, cancellation, recovery, desktop projection, and required remote replacement; provisional activation data cannot project, reconnect may release it only into the exact attempt's private recovery quarantine after contract validation, and exit seals that quarantine against later same-token frames until ordered admission or exact cancellation proof. Reconnect checkpoint capture freezes exact provider-generation/PTy admission, cancels queued old work, and waits for the running raw completion before exposing its accepted checkpoint; timeout or failure detaches only that PTy's old model, makes the checkpoint unavailable, and releases the bounded fence without closing the shared provider, while the same failure outside an active exact migration remains generation-fatal and overlapping reconnects preserve any earlier outstanding fence. Pending renderer projection IDs are capped and compacted across split remainders, exit preparation owns its renderer fence through finalization, exit-time cancellation transfers published projections before proof commit, generation close fences late proof while draining exact projection waiters, closed-generation identity compacts without weakening stale rejection, canceled source-delivery retirement retains at most one ordered token per PTY, and pause/resume targets only the exact provider generation. Additional subscribers cannot stall the owner, while the required legacy primary retains backpressure.", - "oracle": "Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous oracle (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous oracle (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous oracle (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous oracle (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous oracle (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous oracle (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous oracle (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): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous oracle (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Previous oracle (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. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result 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. Broad root-unit discovery loses whole cross-client workspace-sync, terminal-preview, picker-skill-hint and close-routing suites plus reduced worker-stop, remote-owned-record, scanner, mobile-bundle and daemon-health samples. Separate E2E discovery also loses the paired mobile/desktop mirror journey and two unit drivers. Retained callback/table/outer-loop/guard bytes are exact; retained checks do not replace the removed alarms. No app, native device, mixed-version, remote or cross-platform execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. 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. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. 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. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. 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. The broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. 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. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Module layout SSH policy: Retire the multiplexer private-clock saturation registration, the writer saturation transition-count registration and the changed-source dated writer/backpressure receipt. Retained byte delivery, lane order, fairness, settlement and cancellation cases are unvalidated by that historical receipt. No equivalent replacement, new execution, measured performance, live SSH/WSL or cross-platform proof is claimed. The unchanged WSL protocol receipt retains only its original command scope. Historical prior account (preserved verbatim): Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2070 (sources2068/2069): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/hooks-and-hosted-review.spec'). src/main/ssh/ssh-multiplexer-transport-writer.test.ts: reports saturated epochs and their drain boundary exactly once. src/main/runtime/orca-runtime-tests/worktree-removal-archive-hook-gate.spec.ts: removes and records the waiver when the failure is explicitly overridden; removes without an override record when the hook succeeds; removes when the hook is configured but not requested; removes when no archive hook is configured; holds a desktop removal in the same repo until this one is accepted; joins a desktop removal of the same worktree accepted while this one waited. src/main/runtime/orca-runtime-tests/worktree-ps-agent-row-dismissal.spec.ts: drops the row as soon as the user dismisses it, without waiting for the PTY to exit; tells paired clients to republish on the transition and on the dismissal; rejoins a row through its %s handle after pane ownership clears. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review.spec.ts: reports an error when the SSH filesystem provider is unavailable; reports an SSH orca.yaml as an error without reading any filesystem; reports ok for a local repo hook check; reads SSH issue commands as absent and drops writes without touching any filesystem; allows host integration slug helpers for SSH repos through provider-aware GitHub clients; routes runtime GitHub repo identity helpers through the selected WSL project runtime; routes runtime GitHub issue and work-item actions through the selected WSL project runtime; pins explicit origin preference on runtime open-by-number work item lookups; forwards check-details cancellation without local Git overrides. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. The historical receipt/currentCommand selecting src/main/ssh/ssh-multiplexer-transport-writer.test.ts remains historical and is not a passing result for the reduced current command. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete tail-wait memo suite: its sole current authored callback checks supplied fromTail/blocked field values. Retire all three broader memoization/equivalence/eviction assertion aliases; they are not backed by retained source callbacks. No scan-work budget, sustained output, physical terminal or resource measurement is assigned to this removed test. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1674 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The current executable slice injects main-process renderer backlog pressure, then asserts ordinary terminal-wait detection without a joined-tail allocation and with full prompt-family continuity, per-PTY and total pending-output caps, a 1,024-ID projection cap with split-remainder compaction, preserved sequenced-tail metadata, active-pending protection ahead of background trimming, exact provider-generation pause ownership, renderer exit/data ordering, and ACK-gated in-flight bounds. The negotiation seam proves every initial connection and reconnect offers V1, the same-build relay advertises V1 without launch flags, old clients remain token-free, and method-not-found peers fall back without installing source ACK publication. The joined source-intake/multiplex oracle blocks renderer or headless serialization, admits one snapshot-covered span and one trailing span, requires replacement reservation only after the authoritative sequence is known, advances upstream ACK eligibility exactly to the covered boundary after SnapshotEnd, and delivers then ACKs the trailing span through the ordinary live path without cancellation. Source-range ledger and multiplex seams additionally require cumulative byte ACK 40 then 100 for one 100-byte frame to release exact byte credit without early source settlement, admit a contiguous higher-generation recovered token while the prior token remains unsettled, and reject stale stream or source generations without releasing in-flight byte credit. Replacement reservation rolls back every earlier span on a later failure, commit requires the exact frozen transfer states, and an authoritatively reclaimed covered span rejects commit without local trim authority while rollback removes the reservation idempotently. The exit-deadline oracle publishes a source-backed desktop projection, advances a fake clock to cancellation, and requires one projection transfer, proof commit, preparation, and final exit with no provider close, retained obligation, duplicate finalization, or process-lifetime cancellation tombstone; a second controlled proof remains pending across generation close and must never publish final exit, while both paths release the renderer preparation lease exactly once. The model-migration oracle accepts span A, blocks span B's raw emulator completion, begins disconnect migration, and proves no checkpoint or reconnect attach can remain at A; releasing B advances the exact checkpoint to B and projects B once. Its fake-clock arm reaches the 10-second deadline, requires checkpoint-unavailable, one exact model reset, zero retained admission charge and timers, and no effect from late raw settlement. Its two-PTY failure arm rejects one running raw callback under an active exact migration and requires one checkpoint-unavailable result, one model reset, zero provider closes, retained sibling checkpoint and transport liveness, zero charges and timers, and an unaffected other generation; a non-migrating sibling oracle still requires generation close. The intake additionally closes 2,048 sequential provider generations into one exact range, rejects stale events across that range, and preserves an out-of-order live gap until its own close. Direct-SSH contracts additionally prove activation-response settlement before the first source frame, claim-gated projection under same-decoder-turn response/data delivery, exact early-ACK reservation through send settlement or same-token retry, recovery completion visible before lease-held frames transfers those frames only into the private quarantine and admits no output until exact checkpoint-to-recoveryEnd coverage, invalid-checkpoint restore retention through response settlement followed by fresh-token retry and one live source frame, isolated saturated-subscriber eviction with healthy owner liveness, preserved legacy-primary backpressure, one-write ownership across write(false)/drain, control selection ahead of queued ordinary PTY input with FIFO lanes and bounded fairness, liveness rebasing, failed-exit retention through late ACK or exact recovery, response-settlement cancellation authority, token-scoped exit cancellation, exact checkpoint-to-recoveryEnd continuity, stale-owner one-shot retry, no physical PTY teardown on recovery failure, exact provider-generation closure and once-only cleanup when recovery cancellation publication or proof rejects, 16 MiB-plus-1 MiB decoder caps, charged per-PTY/session retention budgets, and eight-wide isolated reattach. The live Electron perf oracle adds hidden-output floods, renderer scheduler queue depth, dropped-output-zero normal scenarios, and active key latency budgets before promotion.", + "oracle": "Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3788 retires10 authored/11 expanded cases across six changed drivers, including the entire screencast pending-frame-retry and usage-source-cache-streaming suites. Deliberate losses are false-refused last-frame retry/once-only delivery, ordinary stable-pane reattachment, cleared-chat Dispatch completion, terminal-declared chat-caller refusal, at-rest worker liveness projection, nested depth/cap policy, small unsigned6/sealed7 plain-format and verified-bit examples, generic malformed-ISIZE footer refusal examples, and synthetic10k/100k chunk-size/work-count budgets in gzip and general cache I/O. These include real state/disk/RPC outcomes consciously retired for marginal value; retained E2EE-backlog, receipt/custody/uncertain-ack, integrity/migration and staging-cleanup cases are not equivalent replacements. The footer test did not prove early rejection or bounded allocation; staging cleanup did not seed unrelated files. No replacement or fresh native/remote/performance execution is claimed. Earlier raw selectors and dated receipts remain historical. Audit3779 retires17 authored/17 expanded registrations across six changed drivers, including the entire shared-Codex-home and prompt-telemetry suites. Accepted losses are shared-home wrapper noninterference/opt-out preservation, mocked metric count/provenance filters, SSH activity labeling/clearing and handover idle timing, VM ownership/capability/status projections and asleep-worktree refusal, a link-only external conversation replay sample, and two narrow input-credit noninterference/expiry examples. Retain the direct exact-tab/single-use input-credit case. These bounded real disk/state/routing alarms are intentionally retired for marginal value without equivalent replacement or fresh execution claims; earlier receipts remain historical. Audit3772 retires18 authored/27 expanded cases, including whole Codex service opt-out, RPC capability-parser, creator-provenance, short-ciphertext and readiness-null suites. Accepted losses include service ledger/symlink/mode cleanup, user TOML substring preservation, old-hash cleanup, description pass-through, malformed-file/pending-hash examples, coordinator write/probe counts, capability array bounds, positive creator projections, early short-payload refusal and readiness helper null shape. Two redundant Codex exit-cause rows are also retired; Pi shares their direct-idle path only in this empty-output immediate-exit fixture, and future agent-config drift coverage is lost. Real bounded filesystem/parser/runtime alarms are deliberately retired for marginal value; no equivalent replacements or fresh execution are claimed. Earlier receipts retain their historical scope. Audits3754/3755 intentionally remove9 authored/9 finite registrations: the entire one-case usage-source-cache-streaming.test.ts driver and8 cases from the surviving computer-action-validation.test.ts driver. This gate retains an unfiltered root Vitest command; UNIT_INCLUDE admits both source paths. Accepted losses are the real encoder output chunk-size/work-count alarm on repetitive10k/100k ownership payloads through a mocked durable sink, plus CLI diagnostic precedence, fractional window-id rejection, action-call-site window-target exclusivity, plain-text click-count recovery copy, incomplete click/drag targeting, mouse/modifier/direction allowlist samples and inline/stdin text exclusivity. These CLI cases exercise real argument/handler validation before mocked runtime calls; they are deliberately retired for marginal value, not declared tautologies. Retained cache I/O and CLI cases are not equivalent replacements for these alarms. Existing historical raw receipts remain unchanged and do not validate the deleted or reduced drivers. No fresh execution claim is made. Audits3758/3763 intentionally remove9 authored/11 finite registrations from6 changed drivers, including the entire pane-title-notification, window-linear-notices and worktree-card-lifecycle-effects suites. This gate retains an unfiltered root Vitest command admitting these paths. Accepted losses are same-account linked-row success-notice fanout, sidebar-switch channel forwarding, Linear-only notification forwarding/non-terminal-consumer selection/closed-window detach, destroyed-window refusal and first-send-failure suspension through the pane-title adapter, the100-card synthetic focus/poll absence sample, stored-source local folder badge refresh, unobserved-row badge refusal, and immediate reposChanged lineage invalidation. These exercise real owners with controlled ports; they are retired for marginal value, without equivalent replacement claims. The no-badge-work fixture does not seed its title-promised collection-only cache. Preserved historical receipts do not validate deleted or reduced drivers; no fresh execution is claimed. Audit3759 retires the entire one-case Tailwind compiler/scanner smoke. Accept loss of the direct CSS production/test/spec source-exclusion and rescan alarm; no replacement or current execution is claimed. Audit3752 independently approves audit3749: retire five authored/five finite watcher-process registrations, retaining18 raw-exact registrations. Accept loss of healthy shared-pool joint recovery, last-pending-failure idle retirement/respawn, late VITEST fallback release, missing-entry fail-closed selection and independent-supervisor fuse locality alarms. These are real bounded host-policy alarms intentionally retired for low marginal value; no equivalent replacement is asserted. Remaining driver selections exercise controlled FakeChild supervisor lifecycle, cancellation, physical-exit fencing, recovery and fuse behavior. This source review supplies no fresh native/process/platform/remote/SSH execution; historical receipts retain original source and selector scopes. Previous oracle (preserved verbatim): Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered root Vitest command. Current UNIT_INCLUDE admits the partial push-service, metadata-dialog and two config/scripts browser drivers:10 authored/16 finite removals. Accepted losses: actual retry30s/60s progression and register bucket/refill wiring, explicit seven-day lease arithmetic (its notification lacked seq/epoch and never reached send), equal-name edit latch/save payload, real image/font/meta-refresh/form/popup browser refusal controls, and broad rich-markdown bridge/command/edit-select smoke. Actual production state, callback routing and browser enforcement run in these cases; these alarms are deliberately retired on marginal value. All drivers and selectors survive. Existing unrelated receipts remain historical evidence for their unchanged selectors, not proof of the reduced cases. Audit3732 removes 2 authored/3 finite registrations from two partial suites: nominal custom/Kimi local naming success and deferred context usage row presentation. Real losses: custom/Kimi successful extraction through conversation-name sanitization and agentLabel composition; separate ordered counted/deferred lists and exact percentage/token formatting. No replacement or equivalent coverage claimed. Retain 11 authored/13 finite raw-exact registrations for bounded naming instruction/refusal/cancellation, menu dismissal focus ownership and hover/composer Escape/timer cleanup. Source-only bounded value review, no runtime/CI/native/remote/mobile/folder workspace or global completion credit. Previous oracle (preserved verbatim): Audit3733 removes2authored/2finite terminal input checks: fixed custom-cap error/secret fixture and three-emoji cap5refusal whose6UTF16units already trip length fast guard (no UTF8-dependent boundary). Accept exact non-disclosure/oversized-refusal alarm losses; no replacement/equivalence claim. Retain13/13scalar/pending input, OSC state and cron DST/cadence outcomes after bounded material reads. Source-only zero runtime/novelty credit; original historical reasons preserved. Previous oracle (preserved verbatim): Audit3729 removes1authored/3finite by deleting whole CLI runtime pairing advisory-close suite. Accept losing post-real-close injected EIO preservation of native/script/unreadable pairing, env identity/preservation and exact close/release assertions; no actual failed-close leak or replacement coverage claimed. Two retained URL grammar/identity suites11authored16finite raw unchanged. Bounded source/owner/caller value review, zero novelty/runtime credit; other seven3724deferred closures remain. Historical receipts preserve original limits. Previous oracle (preserved verbatim): Audit3724 removes3authored/3finite checks by deleting two whole suites: TUI clear burst-size singleton and terminal-file-URL target two-case wrapper suite. Deliberate losses: derived widest burst<64byte alarm, UNC authority+line-column anchor composition, and malformed-percent null refusal. Real production algorithms execute in those tests; no mocked-output tautology, equivalent replacement, actual Claude/file-navigation delivery or universal safety-irrelevance claim. TUI58byte bound and URI examples have low marginal value as standalone suites. Actual1262/1264/1742KEEP superseded explicitly. Remaining14drivers83authored136finite raw unchanged. Bounded source-only review; ten closures deferred, four bounded keep judgments repeated with zero new semantic-frontier credit. No runtime/CI/native/remote/mobile/folder/global completion claim; historical receipts retain original scope. Previous oracle (preserved verbatim): Audit3723 removes 4 authored/4 finite registrations in two whole suites: keybinding cache freeze/token spellings and host-dependent Orca command name examples. Real losses include returned-object freeze, repeated Mod+P key, Space/PageDown/NumpadSubtract mapping, unknown/empty/prototype-token rejection, and headless Linux versus Windows-server/WSL command choice. No equivalent or replacement coverage claimed. Retain 12 authored/21 finite raw-exact registrations exercising generated scaffold validation, artifact failures, shipped editor/hook/worker/panel tests, actual generated typing compilation, independent CLI root routing and intent-name precedence. Source-only bounded audit; no runtime, CI, native, remote, mobile, folder workspace or global completion credit. Previous oracle (preserved verbatim): Audit3720 removes17authored/23finite checks: whole main catalog-date adapter2 and shared date-helper7, seven renderer nominal ranking/cap/no-date/composition cases, and one browser registration expanding to seven forced-container/DOM-child boundary cases. Deliberate real losses: community oldest-date UTC forwarding, official/undated omission, date sorting/window/invalid/future/skew/clamp and default/override cap; nominal ranking/cap and combined Featured/Newly-added outputs; real CSS459/460,719/720,1055/1056breakpoint, five-card partial-row and720px two-card first-row alarms. Browser cases really measure rendered geometry but force width/remove DOM children; no fake-pixel or tautology rationale. No replacement/equivalent coverage claimed. Retain14authored/19finite raw-exact registrations across4drivers: adversarial featured category/order/tie and installability, date order/window selection, actual PluginManager failure/escaping/duplicate-card suppression, real browser viewport/odd-count geometry/phone catalog visibility, syntax ingress/depth/include/printability and68dlong-bracket auto-close fill-in. No tests/browser/native/UI/provider/remote/mobile/folder/CI/global execution or completion credit. Previous oracle (preserved verbatim): Audit3717 removes6 authored/6finite checks in two whole thin-adapter/presentation suites. Deliberate real losses: ordinary recipe repository-URL withholding and provisioned-root credential scrubbing/forwarding; repository label lockstep suffix expansion, host-scoped map identity/collision grouping, Windows crosshost paths and WSL distro suffixes. Actual provision options, label/sort consumers and host/scrubber delegates inspected; no replacement/equivalence claim. Retain40 authored/84finite registrations raw exact in14 drivers with bounded owner/context review. Prior KEEP superseded for removed suites; no runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous oracle (preserved verbatim): Audit3714 removes8 authored/39finite checks: whole CLI selector-recovery, task display-text and ANSI grammar suites plus two name joiner/blank tables. Deliberate real losses: selector flag/value/identity and mutation recovery merge/serialization; exact task suffix, transcript fallback, input immutability, cache reuse and edited blocks; independent failed-escape/resumption and OSC/DCS/BEL/ST/C1/nested/unfinished stripping outputs; meaningful-language joiner preservation and invisible/blank-name rejection. These are real bounded alarms, removed as narrow supplied-error examples, helper/token inventories and repeated internal-work fixtures. Prior2936,1195/1196,1214/1215 and1082 KEEP superseded; no replacement or equivalent coverage claimed. Keep9authored/9finite raw-exact registrations in5surviving drivers: screenshot export/failure filesystem behavior, CLI local tree query, event-local reply provenance, vault role-sensitive content and four hostile/UTF16/dangling/tag-name regressions. No native/UI/provider/remote/mobile/folder/runtime/CI/global completion credit. Previous oracle (preserved verbatim): Audit3711 retires2authored/4finite cases by deleting whole clipboard-image-temp-file signature-to-name inventory (HEIC/TIFF/unrecognised bytes) and workspace-last-active switch-on supplied visit/reason singleton, plus its now-orphan test fixture. This intentionally loses real generated-filename suffix/extensionless alarms and real newer-visit archived7day versus inactive30day filtering/older-visit identity alarms. Filesystem writing and production reason pruning really execute; no equivalent replacement or universal absence of safety relevance is claimed. The clipboard test does not inspect written bytes, native delivery or decode; the visit test supplies candidate/timestamps and does not exercise persisted visit routing or actual removal.20authored/20finite cases remain unchanged across4bounded Git/sidecar/removal drivers. No new runner/test/module evaluation or runtime result; historical notes and receipts remain historical. Previous oracle (preserved verbatim): Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous oracle (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous oracle (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous oracle (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous oracle (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous oracle (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous oracle (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous oracle (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): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous oracle (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Previous oracle (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. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result 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. Broad root-unit discovery loses whole cross-client workspace-sync, terminal-preview, picker-skill-hint and close-routing suites plus reduced worker-stop, remote-owned-record, scanner, mobile-bundle and daemon-health samples. Separate E2E discovery also loses the paired mobile/desktop mirror journey and two unit drivers. Retained callback/table/outer-loop/guard bytes are exact; retained checks do not replace the removed alarms. No app, native device, mixed-version, remote or cross-platform execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. 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. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. 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. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. 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. The broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. 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. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Module layout SSH policy: Retire the multiplexer private-clock saturation registration, the writer saturation transition-count registration and the changed-source dated writer/backpressure receipt. Retained byte delivery, lane order, fairness, settlement and cancellation cases are unvalidated by that historical receipt. No equivalent replacement, new execution, measured performance, live SSH/WSL or cross-platform proof is claimed. The unchanged WSL protocol receipt retains only its original command scope. Historical prior account (preserved verbatim): Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2070 (sources2068/2069): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/hooks-and-hosted-review.spec'). src/main/ssh/ssh-multiplexer-transport-writer.test.ts: reports saturated epochs and their drain boundary exactly once. src/main/runtime/orca-runtime-tests/worktree-removal-archive-hook-gate.spec.ts: removes and records the waiver when the failure is explicitly overridden; removes without an override record when the hook succeeds; removes when the hook is configured but not requested; removes when no archive hook is configured; holds a desktop removal in the same repo until this one is accepted; joins a desktop removal of the same worktree accepted while this one waited. src/main/runtime/orca-runtime-tests/worktree-ps-agent-row-dismissal.spec.ts: drops the row as soon as the user dismisses it, without waiting for the PTY to exit; tells paired clients to republish on the transition and on the dismissal; rejoins a row through its %s handle after pane ownership clears. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review.spec.ts: reports an error when the SSH filesystem provider is unavailable; reports an SSH orca.yaml as an error without reading any filesystem; reports ok for a local repo hook check; reads SSH issue commands as absent and drops writes without touching any filesystem; allows host integration slug helpers for SSH repos through provider-aware GitHub clients; routes runtime GitHub repo identity helpers through the selected WSL project runtime; routes runtime GitHub issue and work-item actions through the selected WSL project runtime; pins explicit origin preference on runtime open-by-number work item lookups; forwards check-details cancellation without local Git overrides. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. The historical receipt/currentCommand selecting src/main/ssh/ssh-multiplexer-transport-writer.test.ts remains historical and is not a passing result for the reduced current command. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete tail-wait memo suite: its sole current authored callback checks supplied fromTail/blocked field values. Retire all three broader memoization/equivalence/eviction assertion aliases; they are not backed by retained source callbacks. No scan-work budget, sustained output, physical terminal or resource measurement is assigned to this removed test. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1674 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The current executable slice injects main-process renderer backlog pressure, then asserts ordinary terminal-wait detection without a joined-tail allocation and with full prompt-family continuity, per-PTY and total pending-output caps, a 1,024-ID projection cap with split-remainder compaction, preserved sequenced-tail metadata, active-pending protection ahead of background trimming, exact provider-generation pause ownership, renderer exit/data ordering, and ACK-gated in-flight bounds. The negotiation seam proves every initial connection and reconnect offers V1, the same-build relay advertises V1 without launch flags, old clients remain token-free, and method-not-found peers fall back without installing source ACK publication. The joined source-intake/multiplex oracle blocks renderer or headless serialization, admits one snapshot-covered span and one trailing span, requires replacement reservation only after the authoritative sequence is known, advances upstream ACK eligibility exactly to the covered boundary after SnapshotEnd, and delivers then ACKs the trailing span through the ordinary live path without cancellation. Source-range ledger and multiplex seams additionally require cumulative byte ACK 40 then 100 for one 100-byte frame to release exact byte credit without early source settlement, admit a contiguous higher-generation recovered token while the prior token remains unsettled, and reject stale stream or source generations without releasing in-flight byte credit. Replacement reservation rolls back every earlier span on a later failure, commit requires the exact frozen transfer states, and an authoritatively reclaimed covered span rejects commit without local trim authority while rollback removes the reservation idempotently. The exit-deadline oracle publishes a source-backed desktop projection, advances a fake clock to cancellation, and requires one projection transfer, proof commit, preparation, and final exit with no provider close, retained obligation, duplicate finalization, or process-lifetime cancellation tombstone; a second controlled proof remains pending across generation close and must never publish final exit, while both paths release the renderer preparation lease exactly once. The model-migration oracle accepts span A, blocks span B's raw emulator completion, begins disconnect migration, and proves no checkpoint or reconnect attach can remain at A; releasing B advances the exact checkpoint to B and projects B once. Its fake-clock arm reaches the 10-second deadline, requires checkpoint-unavailable, one exact model reset, zero retained admission charge and timers, and no effect from late raw settlement. Its two-PTY failure arm rejects one running raw callback under an active exact migration and requires one checkpoint-unavailable result, one model reset, zero provider closes, retained sibling checkpoint and transport liveness, zero charges and timers, and an unaffected other generation; a non-migrating sibling oracle still requires generation close. The intake additionally closes 2,048 sequential provider generations into one exact range, rejects stale events across that range, and preserves an out-of-order live gap until its own close. Direct-SSH contracts additionally prove activation-response settlement before the first source frame, claim-gated projection under same-decoder-turn response/data delivery, exact early-ACK reservation through send settlement or same-token retry, recovery completion visible before lease-held frames transfers those frames only into the private quarantine and admits no output until exact checkpoint-to-recoveryEnd coverage, invalid-checkpoint restore retention through response settlement followed by fresh-token retry and one live source frame, isolated saturated-subscriber eviction with healthy owner liveness, preserved legacy-primary backpressure, one-write ownership across write(false)/drain, control selection ahead of queued ordinary PTY input with FIFO lanes and bounded fairness, liveness rebasing, failed-exit retention through late ACK or exact recovery, response-settlement cancellation authority, token-scoped exit cancellation, exact checkpoint-to-recoveryEnd continuity, stale-owner one-shot retry, no physical PTY teardown on recovery failure, exact provider-generation closure and once-only cleanup when recovery cancellation publication or proof rejects, 16 MiB-plus-1 MiB decoder caps, charged per-PTY/session retention budgets, and eight-wide isolated reattach. The live Electron perf oracle adds hidden-output floods, renderer scheduler queue depth, dropped-output-zero normal scenarios, and active key latency budgets before promotion.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts", @@ -8991,6 +8971,25 @@ "Keep stress variants non-blocking until stable runtime history exists." ], "knownGaps": [ + "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.", + "Audit3814 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle from a Codex ready prompt even when stale startup lines remain :: Stale MCP startup lines must not block a later Codex ready header.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle when a stale Codex prompt is followed by the ready header :: A Codex ready header following a stale resume prompt must satisfy tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for an idle Cursor lane past its dismissed trust dialog (#8210) :: Later Cursor idle banner overrides retained trust dialog.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not block a mid-run Cursor lane on its dismissed trust dialog (#8210) :: Dismissed trust dialog must not report blocked for later busy Cursor; wait times out.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not classify unrelated press-enter prompts as Codex blocked prompts :: Unidentified press-enter text must time out rather than be classified Codex blocked.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for quiet background PTY agents without OSC titles :: Quiet Codex background terminal without OSC title eventually resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: sends agent prompts as bracketed paste before submit :: Driving prompt escapes embedded paste-end ESC, writes one framed paste then CR, and counts bytes.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: settles a foreground Codex prompt when launch metadata has not arrived :: Codex inferred from foreground without launch metadata waits for composer marker/quiescence before one CR.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: gives a late Codex render marker a fresh quiescence window :: Marker arriving at7.9s re-arms fresh quiet window instead of submitting at initial cap.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: writes large agent prompt paste frames atomically before delayed submit :: A prompt larger than input chunk budget is a single paste write before delayed CR with exact byte count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects oversized terminal.send text before provider writes :: Oversized ordinary terminal.send rejects input-too-large before any provider write.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects focusing an exited background terminal session :: focusTerminal refuses terminal_exited before invoking background reveal.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: pastes the same bytes the desktop draft paste sent for the prompt :: Launch-ready prompt normalizes CR/LF and renders embedded ESC visibly identically to desktop bracketed paste.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: keeps a prompt into a running agent behind the render settle, as before :: Driving prompt remains held through7s repaint activity then submits once by9s.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reports a queued PTY focus as not navigated when its notifier disappears :: Queued PTY focus and completed active reveal report not navigated after notifier removal; no second reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: does not invoke a stale graph-leaf focus notifier after queued PTY work :: Queued graph-leaf focus must not invoke old notifier after preceding PTY reveal and notifier removal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: paginates retained terminal output with explicit limits and truncation metadata :: Preview120lines, fractional limits,50/200 pages, retained2000line truncation and future-cursor metadata stay consistent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: falls back to renderer visible screen when uncursored TUI tail is blank :: Substantial blank uncursored tail uses mounted renderer visible screen with zero scrollback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reads and shows the runtime-owned alternate-screen grid without serialization :: Actual runtime alternate-screen grid provides read/show content without renderer/provider serialization.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: classifies older provider alternate-screen snapshots from ANSI :: Older provider without alternateScreen metadata classifies ANSI alternate entry and returns Remote Vim screen.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: honors the last ANSI screen transition when older provider metadata is absent :: Last ANSI alternate exit overrides earlier entry when explicit provider mode metadata is absent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: rejects a full provider screen frame after live output advances :: Live output arriving during second full-screen capture causes screen-unavailable rather than stale full frame.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: shares one provider snapshot between concurrent read and show calls :: Concurrent read/show share one successful provider snapshot and both receive Shared TUI content.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps cursor reads provider-free on restored alternate-screen PTYs :: Restored alternate-screen cursor transcript reads never acquire provider snapshot.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: backs off after a provider snapshot failure instead of retrying for show :: Failed provider capture is cached/backed off so later show does not retry.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: falls back once to a mounted renderer when a known alternate provider fails :: A known-alternate failed provider capture falls back exactly once to newly mounted renderer.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: bounds provider visible frames for read and show responses :: Provider visible read/show use six bounded lines and300character preview.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps renderer-fallback composer drafts separate from terminal output :: Renderer fallback strips dim composer draft from terminal output and exposes draft separately.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: does not use renderer visible-screen fallback for a short blank shell tail :: Two blank shell lines must not trigger renderer screen fallback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: trims terminal tail character budget without per-line array shifts :: Tail builder trims to256KiB with correct retained suffix and no Array.shift calls.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains ANSI-only status redraws instead of appending every frame :: Repeated erase/redraw replaces preview until newline then publishes one completed cursor row.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains split multi-line ANSI footer redraw state across chunks :: CUU state across chunks retains corrected footer rows and publishes new cursor entries.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not let stale lower rows hide earlier corrected footer rows from cursor reads :: Earlier corrected footer row must not be hidden by stale lower rows in cursor reads.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: bounds completed transcript entries from a single multi-line redraw chunk :: Single redraw chunk bounds completed transcript to2000retained lines and correct oldest/next/latest cursors.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains multi-line ANSI redraws when the last footer row stays partial :: Partial final redrawn row appears in preview but cursor sees it only after newline.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not retain split ANSI controls as visible terminal preview text :: Split color/mode escapes never leak preview fragments; long split OSC title truncates at MAX_OSC_TITLE_CHARS.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains same-line redraw cursor position across split full-line erase chunks :: Full-line erase preserves column across chunks so XY follows three spaces rather than old ABC.\nsrc/main/runtime/orca-runtime-tests/conpty-stream-read.spec.ts :: fills the requested line count even when blank rows sit below the prompt :: Blank rows below a ConPTY prompt must not consume the requested nonempty-line count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: does not retain split ST-terminated string controls as preview text :: Split ST-terminated Kitty/string controls must remain excluded from preview text.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects split OSC titles before retaining terminal previews :: Split BEL OSC title must update working title/status without leaking into preview.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects ST-terminated OSC titles split before the final backslash :: ST OSC split before final backslash must update title without leaking framing.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: preserves a trailing escape after a completed OSC title :: Completed OSC followed by pending ESC must preserve the next idle-title transition.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: seeds newly synced leaves from PTY pending ANSI state :: A newly synced graph leaf inherits pending ANSI so a split color fragment cannot leak.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: bounds retained partial terminal output before preview reads :: Partial terminal state stays capped at 4000, preserves retained array identity, and preview truncation/cursor output remains correct.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: submits the mail pointer to Cursor Agent only after the paste-burst delay :: Cursor mailbox pointer Enter must wait through the paste-burst delay; this is a real input-timing alarm intentionally retired.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts :: adopts a v1.4.150-shaped agent, setup, and shell orphan as one topology transaction :: Stale incarnation refuses without topology change; three agent/setup/shell lanes adopt atomically with layout/group/revision and preserved read/input/resize; exact replay is idempotent and competing owner refuses.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: retires the exact worker when it exits after renderer reveal :: Exact worker exit after reveal retires that worker and its surface.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: re-reveals a recovered worker after the renderer graph epoch changes :: Changed renderer graph epoch invalidates reveal receipt and forces another reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: defers recovery when the renderer omits the exact reveal identity :: Missing exact reveal identity defers recovery after two attempts.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: reconciles a same-id process replacement before headless adoption :: A process replacement before headless adoption must fence off stale ownership.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retires provider resume only after authoritative inventory proves the legacy PTY exited :: Authoritative owning-host inventory overrides false local hasPty, avoids SSH scanning, retires exited provider resume/surface, adopts live workers without headless reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retries inventory and unknown liveness without revealing a ghost worker :: Inventory failure and unknown liveness must retry without ghost reveal, eventually adopt, and stop retrying.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: refuses a live reserved pane before issuing a handle or revealing it :: A requireFreshPane launch receiving a live reserved owner must reject before handle/reveal/kill, and release its claim. No equivalent replacement claimed.", + "Audit3806 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: skips a listener unsubscribed mid-fan-out even with mobile exclusions active :: A listener removed by an earlier listener during one fanout is not called, including with a side-effect-excluded mobile listener present.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: retains bytes emitted before a fresh daemon spawn resolves :: Bytes and title arriving before an initial zero/reset provider response survive in the serialized headless buffer with their counted sequence.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits command-finished facts with best-effort exit codes across chunk splits :: A split OSC133 D exit code becomes130 and a missing code becomes null in ordered command-finished facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits pr-link facts once per URL with batch attribution :: A split GitHub PR URL yields42 rather than4, emits42/43 once each, and carries PTY/worktree/tab attribution.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits 2031-subscribe facts across chunk splits :: Split ESC[?20 then31h emits exactly one2031-subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: restores a provisional 2031 subscribe when daemon scan authority returns :: Returning daemon scan authority with partial scan seed and pending2031 subscription restores exactly one subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers the tracked title over the renderer snapshot lastTitle :: A synthetic live Cursor title overrides stale renderer lastTitle while preserving renderer snapshot source.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers provider history over a partial headless mirror for requested snapshots :: Authoritative requested snapshots return supplied provider frame/history/seq rather than a partial headless mirror, requesting5000rows.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: tracks live alternate-screen transitions after a provider snapshot :: Provider alternateScreen true is accepted, then live1049l/1049h update isTerminalAlternateScreen false/true.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: translates reset provider snapshots without retaining the old title :: A reset provider snapshot translates new local seq into the runtime domain and replaces Old process title with New process.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits the chunk agentStatus events before its side-effect batch :: Agent status callback precedes side-effect batch callback for one coalesced OSC9999/title/bell chunk.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: still emits a throwing chunk’s facts under its own seq, not the next chunk’s :: A tracker throw still flushes first chunk title facts under its own seq, and second chunk does not inherit those facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: seeds the lazily created tracker from the daemon-snapshot title :: A lazy tracker hydrated from renderer snapshot title Codex working emits agent-idle on later Codex done.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits command-code-working facts only after the banner arms the scrape :: Unarmed Thinking text emits no facts; a Command Code0.27.3 banner then hardcoded colored spinner text emits attributed command-code-working with the submitted prompt.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits a command-code-done fact when the idle composer returns :: After hardcoded banner/working text, returned idle composer emits command-code-done with the earlier submitted prompt.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: resizes the headless mirror after an accepted desktop PTY resize :: An external accepted resize produces the resized dimensions and same status-frame lines as a separately driven reference emulator.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: replaces suffix-only headless state with the recovered renderer snapshot :: Replacing suffix-only state removes old suffix, retains renderer history plus later output/cwd, and returns the live47x40PTY grid.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: stamps SSH connection identity on runtime terminal status :: A synthetic mounted-leaf OSC9999 status after registerPty carries the supplied SSH connectionId.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: does not retain WSL context when a PTY id is reused :: After exit and same-ID new null distro context, OSC7 file://server/share/repo uses UNC server path rather than old Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: preserves immutable context while a live daemon attach is unresolved :: preparePtyExecutionContext with preserveExisting refuses a supplied Debian replacement and subsequent OSC7 keeps original Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts :: projects frame-independent live state through main buffer snapshots :: Main-buffer snapshot puts focus-report/cursor-visibility modes in frameRestoreAnsi, excludes STATIC-FRAME there and includes it in data.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.ts :: continues terminal agent status fanout when a callback throws :: Throwing on the first status callback does not prevent second payload delivery and logs contextual error.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: returns a title-only replay snapshot and never historical attention :: Lose replay:true/title-only fact projection despite earlierbell and unknownPTYnull. No actual delivered-history notification or reattach behavior was exercised. No equivalent replacement claimed.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects a handle rebind while a controller-less status check yields :: A handle rebound while the null-controller status continuation yields must throw terminal_handle_stale.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects confirmation evidence when the owning PTY exits :: A pending strong confirmation resolving after owning PTY exit must reject terminal_exited.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-03.spec.ts :: keeps ordinary terminal send suffix failures on the existing not-writable contract :: Ordinary send writes text but refused CR must throw terminal_not_writable with beforeWrite twice and afterWrite once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell the execution host cannot apply instead of spawning its default :: Requested Windows shell on POSIX must refuse before spawning a default shell.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: quotes the agent startup command for the requested shell, not the host default :: Requested cmd shell must override PowerShell default quoting for agent startup command.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: keeps restored receipts outside a targeted worktree scan :: Targeted scan removes the moved-worktree receipt while preserving another worktree receipt.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: observes setup command completion without waiting for its interactive shell to exit :: Nonzero completion marker 17 resolves while interactive shell remains running.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: falls back to setup terminal exit when no completion signal is available :: Setup completion observer without token falls back to actual exit code 9.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: cancels setup completion observation when the caller aborts :: Abort rejects with the original reason and unsubscribes once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps observing after an uncertain setup terminal status :: Unknown exit waiter result must leave observation pending until completion marker arrives.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh omits a record :: Controller inventory omission disconnects the record but preserves its retained transcript.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh times out :: Hung inventory timeout leaves connected record and retained transcript intact.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle for adopted background PTY handles from the renderer title :: An adopted background handle resolves tui-idle from ready Codex renderer title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves live-leaf tui-idle from an OpenCode native title :: A live leaf resolves tui-idle from an OpenCode native title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from a Codex ready prompt preview :: A supplied Codex prompt preview resolves tui-idle without an actual agent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from an Antigravity prompt before the model line :: A supplied Antigravity prompt before model line resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell with no workspace instead of creating a default-shell tab :: Workspace-less explicit shell must reject before renderer default-tab request or spawn. This real guard/wiring alarm is deliberately retired.", + "Audit3798 per-case accepted losses:\nsrc/main/runtime/orca-runtime-tests/paired-settings.spec.ts :: awaits navigation-only updates from paired clients (%s) :: Updating only claudeSubagentNavigationEnabled waits for the actual controller call to the supplied pending Claude-view reconcile for both on/off values.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: drops a client page record even when its close command cannot be issued :: A removed workspace loses its runtime client-page record and headless browser projection despite close delivery_required rejection, and emits the asynchronous warning.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: leaves client-hosted pages alone when another host still owns the same worktree id :: Removing runtime:env-b metadata with local ownership leaves the local same-ID client page unchanged and issues no close command.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: marks live bindings again when reopening after a promoted window closes :: A reopened window marks its still-registered live worktree in activeWorktreeIdsOnShutdown after the first promoted window closes.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: preserves live SSH session identities when promoting a headless runtime :: Headless-to-desktop promotion records active worktree, SSH connection and remoteSessionIdsByTabId from the supplied surviving SSH PTY/session.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores a surviving renderer when its reload is cancelled :: A sole ready renderer reload cancelled under its current renderer fence returns true and becomes ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores headless authority when desktop promotion navigation is cancelled :: A cancelled desktop promotion with headless recovery returns false while headless authority remains ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: moves a desktop graph to unavailable when its reload times out :: A ready desktop graph without a headless fallback becomes unavailable at the reload deadline and retains its window/epoch.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: recovers a failed headless promotion and accepts a later renderer generation :: A promotion failure restores ready headless authority; a later valid same-window graph publishes ready desktop authority.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: clears a failed pane recovery so a later reconnect can retry :: After relay_reconnecting rejection, the pending recovery lock clears and the same pane/handle can call createTerminal a second time and return its supplied replacement.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: still preserves a CLI agent leaf when the reloaded renderer has not rebound its PTY :: An empty graph published during renderer reload preserves a preallocated live CLI PTY as one listable terminal before renderer rebind.\nsrc/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts :: keeps a no-incarnation handle across an in-graph pane remint :: Within one graph lifetime an unversioned PTY reminted onto another leaf retains its issued handle and resolves its old exit waiter after onPtyExit.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: matches explicit-id cwd PTYs when the resolved worktree cache is incomplete :: An explicit target absent from a fresh incomplete resolved cache adopts only its cwd PTY, rejects nested cwd PTY and does not rescan Git.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: ignores cwd-only controller PTYs for malformed explicit worktree IDs :: Malformed id:repo-1:: returns no terminals, does not adopt cwd-only controller PTY and avoids Git rescanning.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: refuses an SSH-backed create for mobile/runtime callers instead of creating locally :: Loss of this public unserved SSH create error-class/no-local-add/no-local-list alarm.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: records an app-selected parent workspace as a manual action :: Loss of the local runtime folder-parent manual origin, active-workspace source and explicit confidence projection alarm; no claim that SSH or cleanup coverage replaces it.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: browses runtime server directories before projects are added :: Loss of this public runtime alarm for browse availability before registration, directories-first lexical ordering and native path flavor.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: lists drive roots for a server-root browse :: Loss of the Windows public slash-root drive enumeration smoke and presence of the temporary directory drive.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations-part-02.spec.ts :: creates a missing runtime parent before creating the project directory :: Loss of this runtime createRepo recursive missing-parent/child existence and registered-path alarm.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: preserves selected project %s when a hosted parent is known :: Loss of both parent-selected and origin-selected normal fork-link projection/persisted upstream alarms plus exact single-probe count.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: links a current enterprise remote despite unavailable metadata and a retained %s :: Loss of normal current-enterprise-origin linking with stale automatic GitHub avatar or protected file image, unchanged icon assertion, and serialized project identity under unavailable metadata.", + "Audit3788 retires10 authored/11 expanded cases across six changed drivers, including the entire screencast pending-frame-retry and usage-source-cache-streaming suites. Deliberate losses are false-refused last-frame retry/once-only delivery, ordinary stable-pane reattachment, cleared-chat Dispatch completion, terminal-declared chat-caller refusal, at-rest worker liveness projection, nested depth/cap policy, small unsigned6/sealed7 plain-format and verified-bit examples, generic malformed-ISIZE footer refusal examples, and synthetic10k/100k chunk-size/work-count budgets in gzip and general cache I/O. These include real state/disk/RPC outcomes consciously retired for marginal value; retained E2EE-backlog, receipt/custody/uncertain-ack, integrity/migration and staging-cleanup cases are not equivalent replacements. The footer test did not prove early rejection or bounded allocation; staging cleanup did not seed unrelated files. No replacement or fresh native/remote/performance execution is claimed. Earlier raw selectors and dated receipts remain historical.", + "Audit3779 retires17 authored/17 expanded registrations across six changed drivers, including the entire shared-Codex-home and prompt-telemetry suites. Accepted losses are shared-home wrapper noninterference/opt-out preservation, mocked metric count/provenance filters, SSH activity labeling/clearing and handover idle timing, VM ownership/capability/status projections and asleep-worktree refusal, a link-only external conversation replay sample, and two narrow input-credit noninterference/expiry examples. Retain the direct exact-tab/single-use input-credit case. These bounded real disk/state/routing alarms are intentionally retired for marginal value without equivalent replacement or fresh execution claims; earlier receipts remain historical.", + "Audit3772 retires18 authored/27 expanded cases, including whole Codex service opt-out, RPC capability-parser, creator-provenance, short-ciphertext and readiness-null suites. Accepted losses include service ledger/symlink/mode cleanup, user TOML substring preservation, old-hash cleanup, description pass-through, malformed-file/pending-hash examples, coordinator write/probe counts, capability array bounds, positive creator projections, early short-payload refusal and readiness helper null shape. Two redundant Codex exit-cause rows are also retired; Pi shares their direct-idle path only in this empty-output immediate-exit fixture, and future agent-config drift coverage is lost. Real bounded filesystem/parser/runtime alarms are deliberately retired for marginal value; no equivalent replacements or fresh execution are claimed. Earlier receipts retain their historical scope.", + "Audits3754/3755 intentionally remove9 authored/9 finite registrations: the entire one-case usage-source-cache-streaming.test.ts driver and8 cases from the surviving computer-action-validation.test.ts driver. This gate retains an unfiltered root Vitest command; UNIT_INCLUDE admits both source paths. Accepted losses are the real encoder output chunk-size/work-count alarm on repetitive10k/100k ownership payloads through a mocked durable sink, plus CLI diagnostic precedence, fractional window-id rejection, action-call-site window-target exclusivity, plain-text click-count recovery copy, incomplete click/drag targeting, mouse/modifier/direction allowlist samples and inline/stdin text exclusivity. These CLI cases exercise real argument/handler validation before mocked runtime calls; they are deliberately retired for marginal value, not declared tautologies. Retained cache I/O and CLI cases are not equivalent replacements for these alarms. Existing historical raw receipts remain unchanged and do not validate the deleted or reduced drivers. No fresh execution claim is made. Audits3758/3763 intentionally remove9 authored/11 finite registrations from6 changed drivers, including the entire pane-title-notification, window-linear-notices and worktree-card-lifecycle-effects suites. This gate retains an unfiltered root Vitest command admitting these paths. Accepted losses are same-account linked-row success-notice fanout, sidebar-switch channel forwarding, Linear-only notification forwarding/non-terminal-consumer selection/closed-window detach, destroyed-window refusal and first-send-failure suspension through the pane-title adapter, the100-card synthetic focus/poll absence sample, stored-source local folder badge refresh, unobserved-row badge refusal, and immediate reposChanged lineage invalidation. These exercise real owners with controlled ports; they are retired for marginal value, without equivalent replacement claims. The no-badge-work fixture does not seed its title-promised collection-only cache. Preserved historical receipts do not validate deleted or reduced drivers; no fresh execution is claimed. Audit3759 retires the entire one-case Tailwind compiler/scanner smoke. Accept loss of the direct CSS production/test/spec source-exclusion and rescan alarm; no replacement or current execution is claimed.", + "Audit3752 independently approves audit3749: retire five authored/five finite watcher-process registrations, retaining18 raw-exact registrations. Accept loss of healthy shared-pool joint recovery, last-pending-failure idle retirement/respawn, late VITEST fallback release, missing-entry fail-closed selection and independent-supervisor fuse locality alarms. These are real bounded host-policy alarms intentionally retired for low marginal value; no equivalent replacement is asserted. Remaining driver selections exercise controlled FakeChild supervisor lifecycle, cancellation, physical-exit fencing, recovery and fuse behavior. This source review supplies no fresh native/process/platform/remote/SSH execution; historical receipts retain original source and selector scopes.", + "Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered root Vitest command. Current UNIT_INCLUDE admits the partial push-service, metadata-dialog and two config/scripts browser drivers:10 authored/16 finite removals. Accepted losses: actual retry30s/60s progression and register bucket/refill wiring, explicit seven-day lease arithmetic (its notification lacked seq/epoch and never reached send), equal-name edit latch/save payload, real image/font/meta-refresh/form/popup browser refusal controls, and broad rich-markdown bridge/command/edit-select smoke. Actual production state, callback routing and browser enforcement run in these cases; these alarms are deliberately retired on marginal value. All drivers and selectors survive. Existing unrelated receipts remain historical evidence for their unchanged selectors, not proof of the reduced cases.", + "Audit3732 removes 2 authored/3 finite registrations from two partial suites: nominal custom/Kimi local naming success and deferred context usage row presentation. Real losses: custom/Kimi successful extraction through conversation-name sanitization and agentLabel composition; separate ordered counted/deferred lists and exact percentage/token formatting. No replacement or equivalent coverage claimed. Retain 11 authored/13 finite raw-exact registrations for bounded naming instruction/refusal/cancellation, menu dismissal focus ownership and hover/composer Escape/timer cleanup. Source-only bounded value review, no runtime/CI/native/remote/mobile/folder workspace or global completion credit.", + "Audit3733 removes2authored/2finite terminal input checks: fixed custom-cap error/secret fixture and three-emoji cap5refusal whose6UTF16units already trip length fast guard (no UTF8-dependent boundary). Accept exact non-disclosure/oversized-refusal alarm losses; no replacement/equivalence claim. Retain13/13scalar/pending input, OSC state and cron DST/cadence outcomes after bounded material reads. Source-only zero runtime/novelty credit; original historical reasons preserved.", + "Audit3729 removes1authored/3finite by deleting whole CLI runtime pairing advisory-close suite. Accept losing post-real-close injected EIO preservation of native/script/unreadable pairing, env identity/preservation and exact close/release assertions; no actual failed-close leak or replacement coverage claimed. Two retained URL grammar/identity suites11authored16finite raw unchanged. Bounded source/owner/caller value review, zero novelty/runtime credit; other seven3724deferred closures remain. Historical receipts preserve original limits.", + "Audit3724 removes3authored/3finite checks by deleting two whole suites: TUI clear burst-size singleton and terminal-file-URL target two-case wrapper suite. Deliberate losses: derived widest burst<64byte alarm, UNC authority+line-column anchor composition, and malformed-percent null refusal. Real production algorithms execute in those tests; no mocked-output tautology, equivalent replacement, actual Claude/file-navigation delivery or universal safety-irrelevance claim. TUI58byte bound and URI examples have low marginal value as standalone suites. Actual1262/1264/1742KEEP superseded explicitly. Remaining14drivers83authored136finite raw unchanged. Bounded source-only review; ten closures deferred, four bounded keep judgments repeated with zero new semantic-frontier credit. No runtime/CI/native/remote/mobile/folder/global completion claim; historical receipts retain original scope.", + "Audit3723 removes 4 authored/4 finite registrations in two whole suites: keybinding cache freeze/token spellings and host-dependent Orca command name examples. Real losses include returned-object freeze, repeated Mod+P key, Space/PageDown/NumpadSubtract mapping, unknown/empty/prototype-token rejection, and headless Linux versus Windows-server/WSL command choice. No equivalent or replacement coverage claimed. Retain 12 authored/21 finite raw-exact registrations exercising generated scaffold validation, artifact failures, shipped editor/hook/worker/panel tests, actual generated typing compilation, independent CLI root routing and intent-name precedence. Source-only bounded audit; no runtime, CI, native, remote, mobile, folder workspace or global completion credit.", + "Audit3720 removes17authored/23finite checks: whole main catalog-date adapter2 and shared date-helper7, seven renderer nominal ranking/cap/no-date/composition cases, and one browser registration expanding to seven forced-container/DOM-child boundary cases. Deliberate real losses: community oldest-date UTC forwarding, official/undated omission, date sorting/window/invalid/future/skew/clamp and default/override cap; nominal ranking/cap and combined Featured/Newly-added outputs; real CSS459/460,719/720,1055/1056breakpoint, five-card partial-row and720px two-card first-row alarms. Browser cases really measure rendered geometry but force width/remove DOM children; no fake-pixel or tautology rationale. No replacement/equivalent coverage claimed. Retain14authored/19finite raw-exact registrations across4drivers: adversarial featured category/order/tie and installability, date order/window selection, actual PluginManager failure/escaping/duplicate-card suppression, real browser viewport/odd-count geometry/phone catalog visibility, syntax ingress/depth/include/printability and68dlong-bracket auto-close fill-in. No tests/browser/native/UI/provider/remote/mobile/folder/CI/global execution or completion credit.", + "Audit3717 removes6 authored/6finite checks in two whole thin-adapter/presentation suites. Deliberate real losses: ordinary recipe repository-URL withholding and provisioned-root credential scrubbing/forwarding; repository label lockstep suffix expansion, host-scoped map identity/collision grouping, Windows crosshost paths and WSL distro suffixes. Actual provision options, label/sort consumers and host/scrubber delegates inspected; no replacement/equivalence claim. Retain40 authored/84finite registrations raw exact in14 drivers with bounded owner/context review. Prior KEEP superseded for removed suites; no runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit.", + "Audit3714 removes8 authored/39finite checks: whole CLI selector-recovery, task display-text and ANSI grammar suites plus two name joiner/blank tables. Deliberate real losses: selector flag/value/identity and mutation recovery merge/serialization; exact task suffix, transcript fallback, input immutability, cache reuse and edited blocks; independent failed-escape/resumption and OSC/DCS/BEL/ST/C1/nested/unfinished stripping outputs; meaningful-language joiner preservation and invisible/blank-name rejection. These are real bounded alarms, removed as narrow supplied-error examples, helper/token inventories and repeated internal-work fixtures. Prior2936,1195/1196,1214/1215 and1082 KEEP superseded; no replacement or equivalent coverage claimed. Keep9authored/9finite raw-exact registrations in5surviving drivers: screenshot export/failure filesystem behavior, CLI local tree query, event-local reply provenance, vault role-sensitive content and four hostile/UTF16/dangling/tag-name regressions. No native/UI/provider/remote/mobile/folder/runtime/CI/global completion credit.", + "Audit3711 retires2authored/4finite cases by deleting whole clipboard-image-temp-file signature-to-name inventory (HEIC/TIFF/unrecognised bytes) and workspace-last-active switch-on supplied visit/reason singleton, plus its now-orphan test fixture. This intentionally loses real generated-filename suffix/extensionless alarms and real newer-visit archived7day versus inactive30day filtering/older-visit identity alarms. Filesystem writing and production reason pruning really execute; no equivalent replacement or universal absence of safety relevance is claimed. The clipboard test does not inspect written bytes, native delivery or decode; the visit test supplies candidate/timestamps and does not exercise persisted visit routing or actual removal.20authored/20finite cases remain unchanged across4bounded Git/sidecar/removal drivers. No new runner/test/module evaluation or runtime result; historical notes and receipts remain historical.", "Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit.", "Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained.", "Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit.", @@ -9112,7 +9111,8 @@ "Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope.", "Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope.", "Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope.", - "Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed." + "Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage 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." ], "demotionRule": "Cannot promote without metric artifacts and bounded-byte assertions." }, @@ -9368,7 +9368,7 @@ "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/paired-reconnect-multi-pane-materialization.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal/background-terminal-worktree-mount.test.ts src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/store/terminals/terminal-pty-identity-replacement.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-detach-attach-handoff.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-expired-pane-recovery.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/remote-runtime-pty-recovery-state.test.ts src/shared/remote-runtime/remote-runtime-socket-liveness.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-socket-generation.test.ts src/shared/remote-runtime/remote-runtime-client-error-classification.test.ts src/main/runtime/rpc/remote-runtime-server-heartbeat.test.ts src/main/runtime/terminal/launch/orca-runtime-terminal-create-idempotency.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-expired-pane-recovery.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/remote-runtime-pty-recovery-state.test.ts src/shared/remote-runtime/remote-runtime-socket-liveness.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-socket-generation.test.ts src/shared/remote-runtime/remote-runtime-client-error-classification.test.ts src/main/runtime/terminal/launch/orca-runtime-terminal-create-idempotency.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/store/slices/ui/workspace-navigation-history-hydration.test.ts src/renderer/src/store/repos/repos-ssh-host-reconciliation.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/ssh/ssh.test.ts src/main/ssh/connection/ssh-connection-manager.test.ts src/main/ssh/connection/ssh-connection.test.ts src/preload/ssh-authority-forwarding.test.ts src/renderer/src/runtime/rpc/subscriptions/runtime-client-events.test.ts src/renderer/src/runtime/hosts/ssh/runtime-environment-ssh-state.test.ts src/shared/ssh-retained-payload-admission.test.ts --reporter=dot", "pnpm exec electron-vite build --mode e2e", @@ -9389,7 +9389,6 @@ "src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts", "src/shared/remote-runtime/control/remote-runtime-shared-control-socket-generation.test.ts", "src/shared/remote-runtime/remote-runtime-client-error-classification.test.ts", - "src/main/runtime/rpc/remote-runtime-server-heartbeat.test.ts", "src/main/runtime/terminal/launch/orca-runtime-terminal-create-idempotency.test.ts", "tests/e2e/paired-remote-terminal-materialization-reconnect.spec.ts", "src/renderer/src/store/slices/ui/workspace-navigation-history-hydration.test.ts", @@ -10313,7 +10312,7 @@ "providers": ["local", "daemon", "ssh", "remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "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. 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.", + "coverageNotes": "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. 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. 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.", "motivatingLinks": [ "https://linear.app/stably/issue/STA-3800", "https://linear.app/stably/issue/STA-3904", @@ -10323,7 +10322,7 @@ "https://github.com/stablyai/orca/issues/14347" ], "invariant": "Injected orchestration task prompts for recognized agent CLIs must send the prompt body inside one bracketed-paste frame, sanitize embedded ESC bytes, preserve chunk boundaries without losing the frame, and submit exactly once only after the agent can accept Enter. Local worker-start with supported observation must preserve an unobserved turn as start_unknown without revoking authority, closing questions, or triggering a rescue Enter; a worker report during observation must settle normally. Claude and Codex must emit a post-paste composer marker and then settle, or reach the bounded fallback first; every other agent retains the platform delay.", - "oracle": "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. 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": "Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. 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": [ "pnpm exec vitest run --config config/vitest.config.ts src/shared/agent-launch/startup/agent-prompt-injection.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/methods/orchestration/runs/tasks-dispatch.test.ts src/main/runtime/orchestration/coordinator/coordinator.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/orchestration/worker/worker-start-prompt-contract.test.ts --reporter=dot", @@ -10400,6 +10399,10 @@ "Capture stable red/green intentional-break evidence in CI before blocking promotion." ], "knownGaps": [ + "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.", + "Audit3814 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle from a Codex ready prompt even when stale startup lines remain :: Stale MCP startup lines must not block a later Codex ready header.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle when a stale Codex prompt is followed by the ready header :: A Codex ready header following a stale resume prompt must satisfy tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for an idle Cursor lane past its dismissed trust dialog (#8210) :: Later Cursor idle banner overrides retained trust dialog.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not block a mid-run Cursor lane on its dismissed trust dialog (#8210) :: Dismissed trust dialog must not report blocked for later busy Cursor; wait times out.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not classify unrelated press-enter prompts as Codex blocked prompts :: Unidentified press-enter text must time out rather than be classified Codex blocked.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for quiet background PTY agents without OSC titles :: Quiet Codex background terminal without OSC title eventually resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: sends agent prompts as bracketed paste before submit :: Driving prompt escapes embedded paste-end ESC, writes one framed paste then CR, and counts bytes.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: settles a foreground Codex prompt when launch metadata has not arrived :: Codex inferred from foreground without launch metadata waits for composer marker/quiescence before one CR.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: gives a late Codex render marker a fresh quiescence window :: Marker arriving at7.9s re-arms fresh quiet window instead of submitting at initial cap.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: writes large agent prompt paste frames atomically before delayed submit :: A prompt larger than input chunk budget is a single paste write before delayed CR with exact byte count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects oversized terminal.send text before provider writes :: Oversized ordinary terminal.send rejects input-too-large before any provider write.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects focusing an exited background terminal session :: focusTerminal refuses terminal_exited before invoking background reveal.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: pastes the same bytes the desktop draft paste sent for the prompt :: Launch-ready prompt normalizes CR/LF and renders embedded ESC visibly identically to desktop bracketed paste.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: keeps a prompt into a running agent behind the render settle, as before :: Driving prompt remains held through7s repaint activity then submits once by9s.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reports a queued PTY focus as not navigated when its notifier disappears :: Queued PTY focus and completed active reveal report not navigated after notifier removal; no second reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: does not invoke a stale graph-leaf focus notifier after queued PTY work :: Queued graph-leaf focus must not invoke old notifier after preceding PTY reveal and notifier removal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: paginates retained terminal output with explicit limits and truncation metadata :: Preview120lines, fractional limits,50/200 pages, retained2000line truncation and future-cursor metadata stay consistent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: falls back to renderer visible screen when uncursored TUI tail is blank :: Substantial blank uncursored tail uses mounted renderer visible screen with zero scrollback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reads and shows the runtime-owned alternate-screen grid without serialization :: Actual runtime alternate-screen grid provides read/show content without renderer/provider serialization.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: classifies older provider alternate-screen snapshots from ANSI :: Older provider without alternateScreen metadata classifies ANSI alternate entry and returns Remote Vim screen.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: honors the last ANSI screen transition when older provider metadata is absent :: Last ANSI alternate exit overrides earlier entry when explicit provider mode metadata is absent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: rejects a full provider screen frame after live output advances :: Live output arriving during second full-screen capture causes screen-unavailable rather than stale full frame.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: shares one provider snapshot between concurrent read and show calls :: Concurrent read/show share one successful provider snapshot and both receive Shared TUI content.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps cursor reads provider-free on restored alternate-screen PTYs :: Restored alternate-screen cursor transcript reads never acquire provider snapshot.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: backs off after a provider snapshot failure instead of retrying for show :: Failed provider capture is cached/backed off so later show does not retry.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: falls back once to a mounted renderer when a known alternate provider fails :: A known-alternate failed provider capture falls back exactly once to newly mounted renderer.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: bounds provider visible frames for read and show responses :: Provider visible read/show use six bounded lines and300character preview.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps renderer-fallback composer drafts separate from terminal output :: Renderer fallback strips dim composer draft from terminal output and exposes draft separately.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: does not use renderer visible-screen fallback for a short blank shell tail :: Two blank shell lines must not trigger renderer screen fallback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: trims terminal tail character budget without per-line array shifts :: Tail builder trims to256KiB with correct retained suffix and no Array.shift calls.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains ANSI-only status redraws instead of appending every frame :: Repeated erase/redraw replaces preview until newline then publishes one completed cursor row.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains split multi-line ANSI footer redraw state across chunks :: CUU state across chunks retains corrected footer rows and publishes new cursor entries.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not let stale lower rows hide earlier corrected footer rows from cursor reads :: Earlier corrected footer row must not be hidden by stale lower rows in cursor reads.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: bounds completed transcript entries from a single multi-line redraw chunk :: Single redraw chunk bounds completed transcript to2000retained lines and correct oldest/next/latest cursors.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains multi-line ANSI redraws when the last footer row stays partial :: Partial final redrawn row appears in preview but cursor sees it only after newline.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not retain split ANSI controls as visible terminal preview text :: Split color/mode escapes never leak preview fragments; long split OSC title truncates at MAX_OSC_TITLE_CHARS.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains same-line redraw cursor position across split full-line erase chunks :: Full-line erase preserves column across chunks so XY follows three spaces rather than old ABC.\nsrc/main/runtime/orca-runtime-tests/conpty-stream-read.spec.ts :: fills the requested line count even when blank rows sit below the prompt :: Blank rows below a ConPTY prompt must not consume the requested nonempty-line count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: does not retain split ST-terminated string controls as preview text :: Split ST-terminated Kitty/string controls must remain excluded from preview text.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects split OSC titles before retaining terminal previews :: Split BEL OSC title must update working title/status without leaking into preview.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects ST-terminated OSC titles split before the final backslash :: ST OSC split before final backslash must update title without leaking framing.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: preserves a trailing escape after a completed OSC title :: Completed OSC followed by pending ESC must preserve the next idle-title transition.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: seeds newly synced leaves from PTY pending ANSI state :: A newly synced graph leaf inherits pending ANSI so a split color fragment cannot leak.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: bounds retained partial terminal output before preview reads :: Partial terminal state stays capped at 4000, preserves retained array identity, and preview truncation/cursor output remains correct.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: submits the mail pointer to Cursor Agent only after the paste-burst delay :: Cursor mailbox pointer Enter must wait through the paste-burst delay; this is a real input-timing alarm intentionally retired.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts :: adopts a v1.4.150-shaped agent, setup, and shell orphan as one topology transaction :: Stale incarnation refuses without topology change; three agent/setup/shell lanes adopt atomically with layout/group/revision and preserved read/input/resize; exact replay is idempotent and competing owner refuses.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: retires the exact worker when it exits after renderer reveal :: Exact worker exit after reveal retires that worker and its surface.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: re-reveals a recovered worker after the renderer graph epoch changes :: Changed renderer graph epoch invalidates reveal receipt and forces another reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: defers recovery when the renderer omits the exact reveal identity :: Missing exact reveal identity defers recovery after two attempts.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: reconciles a same-id process replacement before headless adoption :: A process replacement before headless adoption must fence off stale ownership.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retires provider resume only after authoritative inventory proves the legacy PTY exited :: Authoritative owning-host inventory overrides false local hasPty, avoids SSH scanning, retires exited provider resume/surface, adopts live workers without headless reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retries inventory and unknown liveness without revealing a ghost worker :: Inventory failure and unknown liveness must retry without ghost reveal, eventually adopt, and stop retrying.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: refuses a live reserved pane before issuing a handle or revealing it :: A requireFreshPane launch receiving a live reserved owner must reject before handle/reveal/kill, and release its claim. No equivalent replacement claimed.", + "Audit3806 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: skips a listener unsubscribed mid-fan-out even with mobile exclusions active :: A listener removed by an earlier listener during one fanout is not called, including with a side-effect-excluded mobile listener present.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: retains bytes emitted before a fresh daemon spawn resolves :: Bytes and title arriving before an initial zero/reset provider response survive in the serialized headless buffer with their counted sequence.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits command-finished facts with best-effort exit codes across chunk splits :: A split OSC133 D exit code becomes130 and a missing code becomes null in ordered command-finished facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits pr-link facts once per URL with batch attribution :: A split GitHub PR URL yields42 rather than4, emits42/43 once each, and carries PTY/worktree/tab attribution.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits 2031-subscribe facts across chunk splits :: Split ESC[?20 then31h emits exactly one2031-subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: restores a provisional 2031 subscribe when daemon scan authority returns :: Returning daemon scan authority with partial scan seed and pending2031 subscription restores exactly one subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers the tracked title over the renderer snapshot lastTitle :: A synthetic live Cursor title overrides stale renderer lastTitle while preserving renderer snapshot source.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers provider history over a partial headless mirror for requested snapshots :: Authoritative requested snapshots return supplied provider frame/history/seq rather than a partial headless mirror, requesting5000rows.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: tracks live alternate-screen transitions after a provider snapshot :: Provider alternateScreen true is accepted, then live1049l/1049h update isTerminalAlternateScreen false/true.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: translates reset provider snapshots without retaining the old title :: A reset provider snapshot translates new local seq into the runtime domain and replaces Old process title with New process.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits the chunk agentStatus events before its side-effect batch :: Agent status callback precedes side-effect batch callback for one coalesced OSC9999/title/bell chunk.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: still emits a throwing chunk’s facts under its own seq, not the next chunk’s :: A tracker throw still flushes first chunk title facts under its own seq, and second chunk does not inherit those facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: seeds the lazily created tracker from the daemon-snapshot title :: A lazy tracker hydrated from renderer snapshot title Codex working emits agent-idle on later Codex done.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits command-code-working facts only after the banner arms the scrape :: Unarmed Thinking text emits no facts; a Command Code0.27.3 banner then hardcoded colored spinner text emits attributed command-code-working with the submitted prompt.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits a command-code-done fact when the idle composer returns :: After hardcoded banner/working text, returned idle composer emits command-code-done with the earlier submitted prompt.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: resizes the headless mirror after an accepted desktop PTY resize :: An external accepted resize produces the resized dimensions and same status-frame lines as a separately driven reference emulator.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: replaces suffix-only headless state with the recovered renderer snapshot :: Replacing suffix-only state removes old suffix, retains renderer history plus later output/cwd, and returns the live47x40PTY grid.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: stamps SSH connection identity on runtime terminal status :: A synthetic mounted-leaf OSC9999 status after registerPty carries the supplied SSH connectionId.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: does not retain WSL context when a PTY id is reused :: After exit and same-ID new null distro context, OSC7 file://server/share/repo uses UNC server path rather than old Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: preserves immutable context while a live daemon attach is unresolved :: preparePtyExecutionContext with preserveExisting refuses a supplied Debian replacement and subsequent OSC7 keeps original Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts :: projects frame-independent live state through main buffer snapshots :: Main-buffer snapshot puts focus-report/cursor-visibility modes in frameRestoreAnsi, excludes STATIC-FRAME there and includes it in data.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.ts :: continues terminal agent status fanout when a callback throws :: Throwing on the first status callback does not prevent second payload delivery and logs contextual error.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: returns a title-only replay snapshot and never historical attention :: Lose replay:true/title-only fact projection despite earlierbell and unknownPTYnull. No actual delivered-history notification or reattach behavior was exercised. No equivalent replacement claimed.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects a handle rebind while a controller-less status check yields :: A handle rebound while the null-controller status continuation yields must throw terminal_handle_stale.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects confirmation evidence when the owning PTY exits :: A pending strong confirmation resolving after owning PTY exit must reject terminal_exited.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-03.spec.ts :: keeps ordinary terminal send suffix failures on the existing not-writable contract :: Ordinary send writes text but refused CR must throw terminal_not_writable with beforeWrite twice and afterWrite once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell the execution host cannot apply instead of spawning its default :: Requested Windows shell on POSIX must refuse before spawning a default shell.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: quotes the agent startup command for the requested shell, not the host default :: Requested cmd shell must override PowerShell default quoting for agent startup command.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: keeps restored receipts outside a targeted worktree scan :: Targeted scan removes the moved-worktree receipt while preserving another worktree receipt.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: observes setup command completion without waiting for its interactive shell to exit :: Nonzero completion marker 17 resolves while interactive shell remains running.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: falls back to setup terminal exit when no completion signal is available :: Setup completion observer without token falls back to actual exit code 9.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: cancels setup completion observation when the caller aborts :: Abort rejects with the original reason and unsubscribes once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps observing after an uncertain setup terminal status :: Unknown exit waiter result must leave observation pending until completion marker arrives.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh omits a record :: Controller inventory omission disconnects the record but preserves its retained transcript.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh times out :: Hung inventory timeout leaves connected record and retained transcript intact.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle for adopted background PTY handles from the renderer title :: An adopted background handle resolves tui-idle from ready Codex renderer title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves live-leaf tui-idle from an OpenCode native title :: A live leaf resolves tui-idle from an OpenCode native title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from a Codex ready prompt preview :: A supplied Codex prompt preview resolves tui-idle without an actual agent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from an Antigravity prompt before the model line :: A supplied Antigravity prompt before model line resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell with no workspace instead of creating a default-shell tab :: Workspace-less explicit shell must reject before renderer default-tab request or spawn. This real guard/wiring alarm is deliberately retired.", + "Audit3798 per-case accepted losses:\nsrc/main/runtime/orca-runtime-tests/paired-settings.spec.ts :: awaits navigation-only updates from paired clients (%s) :: Updating only claudeSubagentNavigationEnabled waits for the actual controller call to the supplied pending Claude-view reconcile for both on/off values.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: drops a client page record even when its close command cannot be issued :: A removed workspace loses its runtime client-page record and headless browser projection despite close delivery_required rejection, and emits the asynchronous warning.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: leaves client-hosted pages alone when another host still owns the same worktree id :: Removing runtime:env-b metadata with local ownership leaves the local same-ID client page unchanged and issues no close command.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: marks live bindings again when reopening after a promoted window closes :: A reopened window marks its still-registered live worktree in activeWorktreeIdsOnShutdown after the first promoted window closes.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: preserves live SSH session identities when promoting a headless runtime :: Headless-to-desktop promotion records active worktree, SSH connection and remoteSessionIdsByTabId from the supplied surviving SSH PTY/session.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores a surviving renderer when its reload is cancelled :: A sole ready renderer reload cancelled under its current renderer fence returns true and becomes ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores headless authority when desktop promotion navigation is cancelled :: A cancelled desktop promotion with headless recovery returns false while headless authority remains ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: moves a desktop graph to unavailable when its reload times out :: A ready desktop graph without a headless fallback becomes unavailable at the reload deadline and retains its window/epoch.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: recovers a failed headless promotion and accepts a later renderer generation :: A promotion failure restores ready headless authority; a later valid same-window graph publishes ready desktop authority.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: clears a failed pane recovery so a later reconnect can retry :: After relay_reconnecting rejection, the pending recovery lock clears and the same pane/handle can call createTerminal a second time and return its supplied replacement.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: still preserves a CLI agent leaf when the reloaded renderer has not rebound its PTY :: An empty graph published during renderer reload preserves a preallocated live CLI PTY as one listable terminal before renderer rebind.\nsrc/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts :: keeps a no-incarnation handle across an in-graph pane remint :: Within one graph lifetime an unversioned PTY reminted onto another leaf retains its issued handle and resolves its old exit waiter after onPtyExit.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: matches explicit-id cwd PTYs when the resolved worktree cache is incomplete :: An explicit target absent from a fresh incomplete resolved cache adopts only its cwd PTY, rejects nested cwd PTY and does not rescan Git.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: ignores cwd-only controller PTYs for malformed explicit worktree IDs :: Malformed id:repo-1:: returns no terminals, does not adopt cwd-only controller PTY and avoids Git rescanning.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: refuses an SSH-backed create for mobile/runtime callers instead of creating locally :: Loss of this public unserved SSH create error-class/no-local-add/no-local-list alarm.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: records an app-selected parent workspace as a manual action :: Loss of the local runtime folder-parent manual origin, active-workspace source and explicit confidence projection alarm; no claim that SSH or cleanup coverage replaces it.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: browses runtime server directories before projects are added :: Loss of this public runtime alarm for browse availability before registration, directories-first lexical ordering and native path flavor.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: lists drive roots for a server-root browse :: Loss of the Windows public slash-root drive enumeration smoke and presence of the temporary directory drive.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations-part-02.spec.ts :: creates a missing runtime parent before creating the project directory :: Loss of this runtime createRepo recursive missing-parent/child existence and registered-path alarm.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: preserves selected project %s when a hosted parent is known :: Loss of both parent-selected and origin-selected normal fork-link projection/persisted upstream alarms plus exact single-probe count.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: links a current enterprise remote despite unavailable metadata and a retained %s :: Loss of normal current-enterprise-origin linking with stale automatic GitHub avatar or protected file image, unchanged icon assertion, and serialized project identity under unavailable metadata.", "Audit2086 (sources2082/2083): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-06.spec.ts: suppresses saved mobile agent status when live evidence is the Claude agents screen; suppresses saved mobile agent status when the current terminal title is neutral; suppresses saved mobile agent status when fresh live OSC title is Claude agents; keeps saved PTY bindings pending until the runtime knows the PTY is connected; refreshes daemon PTY liveness before publishing mobile session tabs; does not invalidate a newly spawned SSH pane from an overlapping stale process list. src/main/runtime/orca-runtime-tests/pty-title-status.spec.ts: associates controller PTYs with mixed-case Windows and UNC cwd paths; uses OSC titles rather than controller process names for rendererless PTYs; ignores the bare cursor-agent native title so synthesized spinner state survives; only records the bare Cursor native title via the stale-working clear; refuses a bare Cursor title while the foreground read is unavailable; does not treat a bare Cursor title as an agent once the shell owns the foreground; accepts a bare Cursor title when the foreground read confirms cursor-agent; refuses a bare Cursor title on a runtime pty with no controller attached; clears a stale working title after 3s of title-less output; cancels the stale-title timer when the PTY exits; keeps stale-title timers isolated per PTY. src/main/runtime/orca-runtime-tests/paired-settings.spec.ts: projects runtime-backed settings to paired clients; updates quick commands without widening general paired settings payloads; applies native-chat option deltas atomically on the runtime host; keeps a future-launch default when an older client asks to prune from inventory; preserves concurrent additions after forty quick commands; accepts runtime-backed setting updates from paired clients; broadcasts visibility default changes to paired clients; reconciles hooks only when paired-client hook settings change; rejects relative paths for runtime nested repo scan/import. 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.", "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.", "Audit2070 (sources2068/2069): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/hooks-and-hosted-review.spec'). src/main/runtime/orca-runtime-tests/worktree-removal-archive-hook-gate.spec.ts: removes and records the waiver when the failure is explicitly overridden; removes without an override record when the hook succeeds; removes when the hook is configured but not requested; removes when no archive hook is configured; holds a desktop removal in the same repo until this one is accepted; joins a desktop removal of the same worktree accepted while this one waited. src/main/runtime/orca-runtime-tests/worktree-ps-agent-row-dismissal.spec.ts: drops the row as soon as the user dismisses it, without waiting for the PTY to exit; tells paired clients to republish on the transition and on the dismissal; rejoins a row through its %s handle after pane ownership clears. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review.spec.ts: reports an error when the SSH filesystem provider is unavailable; reports an SSH orca.yaml as an error without reading any filesystem; reports ok for a local repo hook check; reads SSH issue commands as absent and drops writes without touching any filesystem; allows host integration slug helpers for SSH repos through provider-aware GitHub clients; routes runtime GitHub repo identity helpers through the selected WSL project runtime; routes runtime GitHub issue and work-item actions through the selected WSL project runtime; pins explicit origin preference on runtime open-by-number work item lookups; forwards check-details cancellation without local Git overrides. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence.", @@ -10426,7 +10429,8 @@ "Audit2095 current-parent preparation2126 (approved2092/2093 removals; source refresh2109/independent2112): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-03.spec.ts: rejects exact terminal stop for multiple expected PTYs before stopping anything; omits stale renderer leaves when fresh PTY liveness is required; omits unbound renderer placeholders when fresh PTY liveness is required; captures the event method before the nested sleep receipt changes it; returns the close receipt without requiring a PTY stop; uses the same stop result as an empty explicit stop. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-04.spec.ts: builds a compact worktree summary from persisted and live runtime state; reads the linked-PR state from the renderer repoId-keyed GitHub cache; carries persisted worktree host ownership in mobile summaries; emits only instance- and boundary-validated lineage parents in mobile summaries; resolves WSL platforms only for repos represented in mobile summaries; omits worktrees hidden by the host visibility policy from mobile summaries; applies linked-checkout source visibility to mobile summaries. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review-part-02.spec.ts: routes runtime GitHub PR details and actions through the selected WSL project runtime; passes SSH connection context through hosted review creation flows; routes local WSL project hosted review flows through runtime git options; treats SSH worktree drift as unknown without local git probes. src/main/runtime/orca-runtime-tests/terminal-listing.spec.ts: emits one mobile session terminal tab per live PTY even if two tabs resolve to it; resolves projected split authority from the parent layout PTY binding; keeps explicit-id terminal lists from resolving all worktrees; keeps explicit-id cold-cache terminal lists from classifying unrelated same-repo worktrees; keeps unknown bare terminal-list ids on the no-scan exact-id path; matches explicit-id cwd PTYs for folder workspace instance IDs; routes PTY output through the PTY leaf index in large terminal graphs. src/main/runtime/orca-runtime-tests/window-authority.spec.ts: claims the first window as authoritative and ignores later windows; transfers authority from the headless sentinel to the first real window; relays terminal browser launches only while headless owns the graph; marks live headless PTYs for renderer reattach before desktop promotion; reports the activation gate state while no desktop window is available; bumps the epoch and enters reloading when the authoritative window reloads; can mark the graph ready for the authoritative window; drops back to unavailable and clears authority when the window disappears; hands the graph back to headless when a promoted serve window closes (#27292); keeps a crashed promoted serve renderer on its own window while the window is open; stays unavailable during initial loads before a graph is published. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-04.spec.ts, src/main/runtime/orca-runtime-tests/hooks-and-hosted-review-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-listing.spec.ts, src/main/runtime/orca-runtime-tests/window-authority.spec.ts. Unresolved local/computed edges remain explicit debt.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/main/runtime/construction/orca-runtime.test.ts: remove only literal registration import/call pairs await import('../orca-runtime-tests/worktree-setup-and-startup.spec'), await import('../orca-runtime-tests/gitlab-and-pr-bases.spec'); no additional authored credit. src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts: routes tab switch and capture start by explicit page id; accepts focus on tab switch without altering bridge args (focus is main-side concern); keeps terminal cwd resolution fail-soft when the provider is unavailable. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts: drops the bounded scan cache when orphan-cleanup removal completes; clears optimistic reconcile tokens when a CLI worktree removal succeeds; emits drift without mutating when the fetched base fast-forwards created HEAD; emits base_changed without mutation when the fetched base rewrote history; skips stale-token reconciles without mutating or emitting stale status; emits unknown without mutation when fetch fails or the base ref is missing. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts: routes runtime preserved-branch force-delete through the selected WSL project runtime; replies to a waiting client with the error of a delete that fails after acceptance; treats forced runtime deletion of an already-missing unregistered worktree as cleanup; treats normal runtime deletion of an already-missing unregistered worktree as cleanup. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts: warns that a missing-repo removal only forgot the workspace; restores runtime watchers when CLI worktree deletion fails after teardown; does not re-spend the drain budget on a removal after a wedged install was abandoned; routes runtime worktree removal through the selected WSL project runtime; force-deletes a branch that was preserved by runtime worktree removal. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts: records GitLab pasted-project recents only after successful runtime lookup; threads explicit origin preference through runtime WSL PR base resolution; resolves local GitLab fork MR bases from the target project MR head ref; captures the fork MR head from a dedicated ref, not the shared FETCH_HEAD; keeps the durable MR head when the head fetch fails but the local ref resolves; routes runtime GitLab fork MR base git calls through the selected WSL project runtime. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts: passes SSH connection ids through GitLab task operations; routes runtime GitLab issue, MR, work-item, and todo actions through the selected WSL project runtime; routes runtime GitLab MR details, review-management, job, and pasted URL actions through the selected WSL project runtime; normalizes runtime GitLab issue list arguments like the desktop IPC path. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts: does not warn when setup is explicitly skipped for CLI-created worktrees; puts the agent a create starts in the first default tab, as the window does; keeps the 8s main-runtime startup readiness budget for agents without an override; gives OpenCode the 20s main-runtime startup readiness budget; launches explicit startup agents with prompts for CLI-created worktrees. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts: returns a setup launch payload for CLI-created worktrees when hooks are explicitly enabled; does not hand the window a setup main never tried to start; passes the selected Windows setup shell into runtime runner generation; follows normal setup policy for CLI-created worktrees without activating them; uses returned WSL setup shell metadata when runtime spawns setup; uses the shell-aware setup runner for windowless creates without a startup command; reports the in-process setup hook as running when nothing can launch the runner. src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts: coalesces two clients sleeping the same host worktree; stops exactly the expected live PTYs for a worktree; explains a refused workspace close instead of throwing the raw refusal enum. src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts: marks the desktop-active worktree as isActive; includes SSH-backed worktrees in the mobile worktree summary; caches repeated malformed path misses before normalizing them again. src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts: keeps title-only foreground work ahead of monitoring in another pane; keeps a local hook row while a connected PTY still backs its pane; keeps an OSC row via its connected PTY after the pane binding is cleared. src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts: resolves files through a source-visible linked-checkout worktree; marks saved session tabs with live PTYs as host sidebar activity; attributes live legacy PTYs from saved layout bindings when their panes are hidden; marks saved browser tabs as host sidebar activity like desktop; falls back to the path-keyed GitHub cache entry; includes folder workspaces in compact worktree summaries for mobile; attaches inline agent rows from the latest OSC 9999 status; projects monitoring over a title-derived working status. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts: pushes to an idle pane when the only live waiter filters out the message type; resolves a registered waiter without PTY-injecting when the leaf is already idle; keeps already-idle status after tui-idle wait for immediate message delivery; resolves message waiters when notifyMessageArrived is called; does not resolve type-filtered message waiters for unrelated message types; removes message waiter abort listeners after message arrival; resolves message waiters on timeout when no message arrives. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts: delivers pending mail via notifyMessageArrived when the recipient is already idle; does not keep retrying when every pending row was already pointed; repoints pending rows restored with a live-idle coordinator. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts: rolls back a half-created terminal whose surface never publishes. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts: rejects startup prompts for agents that require post-ready stdin; uses portable Unix quoting for mobile agent launch commands in WSL project runtimes; keeps PowerShell quoting for mobile agent launch commands in Windows host runtimes; uses cmd.exe quoting for mobile agent launch commands in local Windows host runtimes; publishes headless mobile session agent identity with synthesized PTY status; rejects disabled mobile session agent launches before spawning; validates mobile terminal insertion anchors before resolving agent launch commands. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts: coalesces a reconnect close burst onto one authoritative PTY inventory; keeps an explicit user close destructive while the PTY is live; builds mobile session agent launch commands on the runtime host; injects mobile quick-command prompts into the host-built agent startup command. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts: closes persisted headless terminal parents before any prior list call; tears down a serve-owned headless tab on close while a renderer is attached so it cannot resurrect; defers a renderer-published pending tab to the renderer instead of tearing it down; returns a delegated close outcome with no selection tombstone when the renderer owns the outcome; tears down a runtime pending shell the renderer never adopted on close. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts: materializes a plain shell when the pending tab has no launch agent; hydrates legacy persisted terminal tabs without layout entries; reads and indexes the full agent-status snapshot once per mobile projection; kills persisted SSH PTYs when closing hydrated headless tabs before pane metadata is restored; materializes hydrated pending headless terminals with the persisted session identity. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts: hydrates a persisted SSH-owned pane before an attached renderer publishes its graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts: publishes the desktop's tab name over the live agent title, and the live title without one; uses fresh neutral PTY titles over stale mobile snapshot and OSC titles; operates PTY-backed mobile session terminals without a renderer graph; reuses pane close for live PTYs that do not own a renderer tab; lists PTY-backed mobile session terminals without a renderer graph; shows and resolves active PTY-backed mobile session terminals without a renderer graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts: creates mobile session terminals for folder workspaces in a headless runtime server; spawns fresh headless SSH mobile session terminals instead of reattaching synthetic local ids; hydrates headless mobile session terminals from the host workspace session; keeps live headless mobile session terminals when a desktop renderer publishes without them; publishes laptop-created remote runtime split terminals to phone session tabs. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts: does not report headless wake degradation without sleeping records; does not wake slept agents for non-mobile session-only activation; does not rewrite unread metadata when a mobile activation finds the worktree already read; returns unread:false from worktree.ps after a mobile activation clears the flag; materializes pending mobile session terminals without focusing desktop clients; closes browser mobile session tabs when addressed by browser workspace id. src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts: resolves mobile terminal surfaces by exact split leaf; closes the matching mobile terminal UUID leaf without closing the whole tab; closes the whole mobile terminal tab when addressed by parent tab id; activates the active split leaf when addressed by parent tab id; clears unread metadata on mobile worktree activation without focusing desktop clients; wakes slept agents on the host renderer when a phone activates a worktree. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts: publishes the hook provider session on a headless mobile tab so native chat can address the transcript; recovers the agent type from the hook row when the pane was launched without an agent hint; reads one agent-status snapshot per projection, not one per terminal tab; waits for unknown-launch foreground owner before publishing Pi-compatible mobile status; keeps Pi-compatible mobile session status as Pi for an unknown-launch foreground pi PTY; keeps renderer-vetted mobile agent status for custom-titled terminals. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts: publishes terminal surface agent status for paired web clients; preserves authoritative OMP identity for Pi-compatible remote terminal snapshots; normalizes a remote OMP title without republishing omitted launch identity; skips the foreground-process probe when the PTY launch agent is already known; probes the foreground process only on a status transition for unknown launch agents; passes the client signal and the slept-worktree refusal to the spawn. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts: does not use stale runtime-created PTY status when a neutral PTY title exists; recognizes runtime-created Codex PTY handles from the ready prompt; recognizes runtime-created Antigravity PTY handles from the ready prompt; recognizes live leaf Antigravity terminals from the ready prompt; recognizes a later Antigravity header with a prompt but no model line; keeps mobile terminal surfaces visible while their leaf handle is pending. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts: lets Claude agents management titles clear stale runtime-created title status; does not recognize live Claude agents panes from a Claude foreground process; does not let stale tab-level agent titles override current neutral pane titles; lists live terminals with fresh pane titles over stale tab titles; lets adopted neutral pane titles use non-shell foreground fallback; lets adopted neutral pane titles retry wrapper foregrounds until recognized; authorizes settled CLI prompts only after positive %s foreground identity; does not recognize arbitrary foreground TUIs as running agents; lets live neutral pane titles retry wrapper foregrounds until recognized; lets current Claude agents PTY titles override stale runtime-created OSC titles; does not let stale Claude agents OSC titles suppress current PTY title activity. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts: keeps preallocated terminal handles valid across renderer reloads; preserves runtime-created PTY process identity after graph unavailable; keeps prompt bindings fenced across runtime restarts without provider incarnation; recognizes runtime-created PTY handles with agent launch titles; does not treat a bare Cursor Agent native title as a running agent session; uses stale runtime-created PTY status when there is no title or foreground evidence. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts: keeps orphaned list and show writability aligned with the send gate. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts: cancels a coalesced SSH worker recovery retry when its provider disconnects. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts: retries renderer reveal before clearing an adopted legacy worker sleeping record. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts: recovers exported ORCA_TERMINAL_HANDLE from discovered live PTY sessions. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts: applies ANSI erase-from-start line controls in retained previews; applies ANSI stripping for private or intermediate CSI line controls; applies ANSI stripping for unsupported erase-line modes; reveals an agent terminal under the pane the caller reserved; keeps a fresh %s pane host-owned when a desktop window is available; keeps desktop publication %s separate from the reserved host spawn; mints its own pane when the reserved leaf is malformed, and reports the one it used; starts an agent terminal with the model the caller picked; starts an agent terminal without a model flag when no pick was made; attributes a startup-agent launch named %s as %s; attributes a fresh agent session the host builds as unknown; leaves a bare agent command the user typed out of launch attribution. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts: trims oversized terminal output bursts without per-line array shifts; builds terminal previews without mapping the full retained tail; keeps recent PTY replay output capped without needing previous data for large chunks; applies terminal redraw controls before retaining previews; applies ANSI terminal redraw controls before retaining previews; retains multi-line ANSI footer redraws instead of appending old frames; keeps the cursor column when erasing full lines in multi-line redraws; applies ANSI split redraw controls without leaking raw params. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts: returns renderer visible screen lines through terminal.read RPC JSON result; separates composer drafts from provider-owned terminal screens. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts: reports an in-flight PTY focus as not navigated when its notifier disappears; reports graph-leaf focus as not navigated without a host notifier; grounds the provider mode tracker before a later chunk, in the emulator order; grounds an in-flight provider snapshot capture so it cannot publish the pre-reset screen; waits for terminal exit and resolves with the exit status; keeps terminal read payloads bounded while retained output remains pageable; trims terminal read preview character budget without per-line array shifts. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts: submits a silent Claude composer once after the bounded render fallback; chunks large terminal.send text before provider writes; yields chunked terminal input through immediates between writes; yields while validating accepted large terminal.send text before provider writes; reveals a background terminal session when focusing its handle; replays captured launch config when focusing a background agent session; reveals background terminal sessions with the freshest PTY title; renames background terminal handles without requiring a visible tab; keeps a background terminal handle stable while reveal adoption is racing. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts: resolves tui-idle when a stale Codex prompt is followed by Antigravity readiness; returns an agent-neutral blocked wait result for update prompts; returns an agent-neutral blocked wait result for workspace trust prompts; returns an agent-neutral blocked wait result for cwd selection prompts; returns a blocked wait result for Codex model migration prompts; returns a blocked wait result for Codex startup hook review prompts; returns an agent-neutral blocked wait result for generic interactive prompts; splits text and enter writes for background terminal handles; types the lead line for %s: %s; submits through the agent-specific PTY timing policy for %s. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts: waits for exit on background terminal handles; keeps retained PTY transcript memory when controller refresh fails; resolves tui-idle from an Antigravity ready prompt preview; resolves Antigravity ready prompts with newline-heavy pasted tails without splitting; resolves live-leaf tui-idle from an Antigravity ready prompt preview. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts: spawns the available Qoder command for a captured same-session resume: %s; does not use the local Windows shell setting for remote Windows bare agent creates; matches canonical bare agent commands when a command override is configured; keeps non-bare agent command terminal creates unchanged; keeps disabled bare agent command terminal creates unchanged; injects runtime hook receiver env into terminal sessions; creates background terminal sessions for a $label; creates background terminal sessions for a $label; enables Claude Agent Teams only for direct Claude launches when configured in-process; reveals Claude Agent Teams launches with the rewritten launch config; preserves Claude Agent Teams for sequenced Claude launches. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts: creates visible terminal sessions without asking the renderer to focus a tab; asks the pty controller for the requested shell instead of a startup command; knows the agent a flagged launch command names before any process read; retires a flagged command pane identity when the command exits; retires only receipted restored PTY authority on command completion and exit; forgets synthetic handles when disconnected PTY records are pruned. src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts: returns OSC titles from headless main terminal snapshots; adopts renderer-seeded titles into headless main terminal snapshots; returns cwd metadata from seeded headless main terminal snapshots; adopts OSC7 host metadata from seeded headless terminal scrollback; falls back to the renderer snapshot for hidden-output recovery without headless state; keeps an empty headless snapshot authoritative for hidden-output recovery; advances the absolute output sequence across a daemon stream gap; emits explicit OSC 9999 agent status from runtime PTY data. src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts: falls back to the provider snapshot for a restored PTY with no mounted renderer; falls back to the available mirror when authoritative provider history is unavailable; keeps an empty renderer snapshot when the provider has no retained content; keeps restored provider history authoritative after later live output; uses provider alternate-screen state while a partial model is unsafe; prefers the tracked title over the headless emulator lastTitle; keeps the cursor-agent literal in record-fallback snapshots only without a tracker title; touches mobile snapshots once for decorative spinner ticks, again on idle. src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts: creates a same-repo PR branch override from a resolved head SHA and matching push target; skips broad remote fetch for an existing full-SHA PR base; creates a selected Bitbucket PR branch override from a matching remote branch; suffixes an existing PR when a matching push target lacks selected PR metadata; suffixes a matching push target branch when selected PR metadata has no PR number; suffixes a matching push target branch when the existing PR is different; suffixes a selected PR remote conflict when the PR lookup fails; checks out an unused runtime PR branch only when it is at the resolved head SHA; suffixes only the runtime worktree path when an exact PR branch checkout path exists. src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts: returns runtime local base update suggestions from addWorktree; creates a runtime local worktree from a usable persisted local branch base; does not create a runtime local worktree when the refresh fails and no local base ref exists; creates a branchNameOverride worktree from the selected matching remote base ref. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/construction/orca-runtime.test.ts, src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts, src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts, src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts, src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts. Unresolved local/computed edges remain explicit debt.", "Audit2145 accepts removal of canned runtime metadata/guard/forwarding, fake in-memory persistence, private work-count and wrapper-duplication tests from the construction/orca-runtime.test.ts aggregate, plus the two automation run-context guards from runtime-workspace-launch-contracts.test.ts. Retained race, framing, physical completion and ownership callbacks remain byte-identical. Existing commands remain valid selectors; historical receipts stay unchanged and provide no fresh validation or replacement coverage for the reduced suites.", - "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. Original scope text is retained as the exact suffix of coverageNotes/oracle; historical evidence is unchanged." + "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. Original scope text is retained as the exact suffix of coverageNotes/oracle; historical evidence is unchanged.", + "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." ], "demotionRule": "Demote or quarantine if the live harness flakes without a product bug or harness bug filed to the terminal-input owner." }, @@ -10545,7 +10549,7 @@ "providers": ["local", "daemon", "ssh", "wsl", "remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "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.", + "coverageNotes": "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", @@ -10555,11 +10559,11 @@ "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": "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": "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/handlers/orchestration.test.ts src/cli/handlers/orchestration-check-identity.test.ts src/cli/handlers/orchestration-worker-cli.test.ts src/main/runtime/rpc/methods/orchestration/worker/composed-workers.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/handlers/orchestration-lifecycle-rejection.test.ts src/cli/handlers/orchestration-lifecycle-json-rejection.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/cli/orchestration/workers/orchestration-worker-cli.test.ts src/main/runtime/rpc/methods/orchestration/worker/composed-workers.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", @@ -10569,11 +10573,10 @@ "testFiles": [ "src/main/runtime/rpc/methods/orchestration/messaging/check-worker-federated-attachment.test.ts", "src/main/runtime/construction/orca-runtime.test.ts", - "src/cli/handlers/orchestration.test.ts", - "src/cli/handlers/orchestration-lifecycle-rejection.test.ts", - "src/cli/handlers/orchestration-lifecycle-json-rejection.test.ts", - "src/cli/handlers/orchestration-check-identity.test.ts", - "src/cli/handlers/orchestration-worker-cli.test.ts", + "src/cli/orchestration/orchestration.test.ts", + "src/cli/orchestration/recovery/orchestration-lifecycle-rejection.test.ts", + "src/cli/orchestration/messages/orchestration-check-identity.test.ts", + "src/cli/orchestration/workers/orchestration-worker-cli.test.ts", "src/main/runtime/rpc/methods/orchestration/worker/composed-workers.test.ts", "src/main/runtime/rpc/methods/orchestration/messaging/check.test.ts", "src/main/runtime/rpc/methods/orchestration/messaging/send.test.ts", @@ -10591,26 +10594,16 @@ ] }, { - "file": "src/cli/handlers/orchestration-lifecycle-rejection.test.ts", + "file": "src/cli/orchestration/recovery/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", + "a worker_done response without a lifecycle verdict fails closed when authoritative Dispatch and report state cannot confirm settlement", "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" + "post-verification failure preserves the worker_done mutation identity for recovery" ] }, { - "file": "src/cli/handlers/orchestration-lifecycle-json-rejection.test.ts", - "assertions": ["a rejected lifecycle verdict is emitted as a JSON ok=false envelope"] - }, - { - "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" - ] + "file": "src/cli/orchestration/messages/orchestration-check-identity.test.ts", + "assertions": ["an empty explicit --terminal is refused before reading a mailbox"] }, { "file": "src/main/runtime/rpc/methods/orchestration/messaging/check.test.ts", @@ -10698,6 +10691,10 @@ "Attach saved intentional-break artifacts for hidden local presentation and dropped stable-pane delivery." ], "knownGaps": [ + "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.", + "Audit3814 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle from a Codex ready prompt even when stale startup lines remain :: Stale MCP startup lines must not block a later Codex ready header.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle when a stale Codex prompt is followed by the ready header :: A Codex ready header following a stale resume prompt must satisfy tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for an idle Cursor lane past its dismissed trust dialog (#8210) :: Later Cursor idle banner overrides retained trust dialog.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not block a mid-run Cursor lane on its dismissed trust dialog (#8210) :: Dismissed trust dialog must not report blocked for later busy Cursor; wait times out.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not classify unrelated press-enter prompts as Codex blocked prompts :: Unidentified press-enter text must time out rather than be classified Codex blocked.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for quiet background PTY agents without OSC titles :: Quiet Codex background terminal without OSC title eventually resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: sends agent prompts as bracketed paste before submit :: Driving prompt escapes embedded paste-end ESC, writes one framed paste then CR, and counts bytes.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: settles a foreground Codex prompt when launch metadata has not arrived :: Codex inferred from foreground without launch metadata waits for composer marker/quiescence before one CR.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: gives a late Codex render marker a fresh quiescence window :: Marker arriving at7.9s re-arms fresh quiet window instead of submitting at initial cap.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: writes large agent prompt paste frames atomically before delayed submit :: A prompt larger than input chunk budget is a single paste write before delayed CR with exact byte count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects oversized terminal.send text before provider writes :: Oversized ordinary terminal.send rejects input-too-large before any provider write.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects focusing an exited background terminal session :: focusTerminal refuses terminal_exited before invoking background reveal.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: pastes the same bytes the desktop draft paste sent for the prompt :: Launch-ready prompt normalizes CR/LF and renders embedded ESC visibly identically to desktop bracketed paste.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: keeps a prompt into a running agent behind the render settle, as before :: Driving prompt remains held through7s repaint activity then submits once by9s.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reports a queued PTY focus as not navigated when its notifier disappears :: Queued PTY focus and completed active reveal report not navigated after notifier removal; no second reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: does not invoke a stale graph-leaf focus notifier after queued PTY work :: Queued graph-leaf focus must not invoke old notifier after preceding PTY reveal and notifier removal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: paginates retained terminal output with explicit limits and truncation metadata :: Preview120lines, fractional limits,50/200 pages, retained2000line truncation and future-cursor metadata stay consistent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: falls back to renderer visible screen when uncursored TUI tail is blank :: Substantial blank uncursored tail uses mounted renderer visible screen with zero scrollback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reads and shows the runtime-owned alternate-screen grid without serialization :: Actual runtime alternate-screen grid provides read/show content without renderer/provider serialization.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: classifies older provider alternate-screen snapshots from ANSI :: Older provider without alternateScreen metadata classifies ANSI alternate entry and returns Remote Vim screen.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: honors the last ANSI screen transition when older provider metadata is absent :: Last ANSI alternate exit overrides earlier entry when explicit provider mode metadata is absent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: rejects a full provider screen frame after live output advances :: Live output arriving during second full-screen capture causes screen-unavailable rather than stale full frame.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: shares one provider snapshot between concurrent read and show calls :: Concurrent read/show share one successful provider snapshot and both receive Shared TUI content.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps cursor reads provider-free on restored alternate-screen PTYs :: Restored alternate-screen cursor transcript reads never acquire provider snapshot.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: backs off after a provider snapshot failure instead of retrying for show :: Failed provider capture is cached/backed off so later show does not retry.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: falls back once to a mounted renderer when a known alternate provider fails :: A known-alternate failed provider capture falls back exactly once to newly mounted renderer.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: bounds provider visible frames for read and show responses :: Provider visible read/show use six bounded lines and300character preview.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps renderer-fallback composer drafts separate from terminal output :: Renderer fallback strips dim composer draft from terminal output and exposes draft separately.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: does not use renderer visible-screen fallback for a short blank shell tail :: Two blank shell lines must not trigger renderer screen fallback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: trims terminal tail character budget without per-line array shifts :: Tail builder trims to256KiB with correct retained suffix and no Array.shift calls.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains ANSI-only status redraws instead of appending every frame :: Repeated erase/redraw replaces preview until newline then publishes one completed cursor row.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains split multi-line ANSI footer redraw state across chunks :: CUU state across chunks retains corrected footer rows and publishes new cursor entries.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not let stale lower rows hide earlier corrected footer rows from cursor reads :: Earlier corrected footer row must not be hidden by stale lower rows in cursor reads.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: bounds completed transcript entries from a single multi-line redraw chunk :: Single redraw chunk bounds completed transcript to2000retained lines and correct oldest/next/latest cursors.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains multi-line ANSI redraws when the last footer row stays partial :: Partial final redrawn row appears in preview but cursor sees it only after newline.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not retain split ANSI controls as visible terminal preview text :: Split color/mode escapes never leak preview fragments; long split OSC title truncates at MAX_OSC_TITLE_CHARS.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains same-line redraw cursor position across split full-line erase chunks :: Full-line erase preserves column across chunks so XY follows three spaces rather than old ABC.\nsrc/main/runtime/orca-runtime-tests/conpty-stream-read.spec.ts :: fills the requested line count even when blank rows sit below the prompt :: Blank rows below a ConPTY prompt must not consume the requested nonempty-line count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: does not retain split ST-terminated string controls as preview text :: Split ST-terminated Kitty/string controls must remain excluded from preview text.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects split OSC titles before retaining terminal previews :: Split BEL OSC title must update working title/status without leaking into preview.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects ST-terminated OSC titles split before the final backslash :: ST OSC split before final backslash must update title without leaking framing.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: preserves a trailing escape after a completed OSC title :: Completed OSC followed by pending ESC must preserve the next idle-title transition.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: seeds newly synced leaves from PTY pending ANSI state :: A newly synced graph leaf inherits pending ANSI so a split color fragment cannot leak.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: bounds retained partial terminal output before preview reads :: Partial terminal state stays capped at 4000, preserves retained array identity, and preview truncation/cursor output remains correct.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: submits the mail pointer to Cursor Agent only after the paste-burst delay :: Cursor mailbox pointer Enter must wait through the paste-burst delay; this is a real input-timing alarm intentionally retired.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts :: adopts a v1.4.150-shaped agent, setup, and shell orphan as one topology transaction :: Stale incarnation refuses without topology change; three agent/setup/shell lanes adopt atomically with layout/group/revision and preserved read/input/resize; exact replay is idempotent and competing owner refuses.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: retires the exact worker when it exits after renderer reveal :: Exact worker exit after reveal retires that worker and its surface.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: re-reveals a recovered worker after the renderer graph epoch changes :: Changed renderer graph epoch invalidates reveal receipt and forces another reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: defers recovery when the renderer omits the exact reveal identity :: Missing exact reveal identity defers recovery after two attempts.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: reconciles a same-id process replacement before headless adoption :: A process replacement before headless adoption must fence off stale ownership.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retires provider resume only after authoritative inventory proves the legacy PTY exited :: Authoritative owning-host inventory overrides false local hasPty, avoids SSH scanning, retires exited provider resume/surface, adopts live workers without headless reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retries inventory and unknown liveness without revealing a ghost worker :: Inventory failure and unknown liveness must retry without ghost reveal, eventually adopt, and stop retrying.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: refuses a live reserved pane before issuing a handle or revealing it :: A requireFreshPane launch receiving a live reserved owner must reject before handle/reveal/kill, and release its claim. No equivalent replacement claimed.", + "Audit3806 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: skips a listener unsubscribed mid-fan-out even with mobile exclusions active :: A listener removed by an earlier listener during one fanout is not called, including with a side-effect-excluded mobile listener present.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: retains bytes emitted before a fresh daemon spawn resolves :: Bytes and title arriving before an initial zero/reset provider response survive in the serialized headless buffer with their counted sequence.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits command-finished facts with best-effort exit codes across chunk splits :: A split OSC133 D exit code becomes130 and a missing code becomes null in ordered command-finished facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits pr-link facts once per URL with batch attribution :: A split GitHub PR URL yields42 rather than4, emits42/43 once each, and carries PTY/worktree/tab attribution.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits 2031-subscribe facts across chunk splits :: Split ESC[?20 then31h emits exactly one2031-subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: restores a provisional 2031 subscribe when daemon scan authority returns :: Returning daemon scan authority with partial scan seed and pending2031 subscription restores exactly one subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers the tracked title over the renderer snapshot lastTitle :: A synthetic live Cursor title overrides stale renderer lastTitle while preserving renderer snapshot source.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers provider history over a partial headless mirror for requested snapshots :: Authoritative requested snapshots return supplied provider frame/history/seq rather than a partial headless mirror, requesting5000rows.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: tracks live alternate-screen transitions after a provider snapshot :: Provider alternateScreen true is accepted, then live1049l/1049h update isTerminalAlternateScreen false/true.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: translates reset provider snapshots without retaining the old title :: A reset provider snapshot translates new local seq into the runtime domain and replaces Old process title with New process.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits the chunk agentStatus events before its side-effect batch :: Agent status callback precedes side-effect batch callback for one coalesced OSC9999/title/bell chunk.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: still emits a throwing chunk’s facts under its own seq, not the next chunk’s :: A tracker throw still flushes first chunk title facts under its own seq, and second chunk does not inherit those facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: seeds the lazily created tracker from the daemon-snapshot title :: A lazy tracker hydrated from renderer snapshot title Codex working emits agent-idle on later Codex done.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits command-code-working facts only after the banner arms the scrape :: Unarmed Thinking text emits no facts; a Command Code0.27.3 banner then hardcoded colored spinner text emits attributed command-code-working with the submitted prompt.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits a command-code-done fact when the idle composer returns :: After hardcoded banner/working text, returned idle composer emits command-code-done with the earlier submitted prompt.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: resizes the headless mirror after an accepted desktop PTY resize :: An external accepted resize produces the resized dimensions and same status-frame lines as a separately driven reference emulator.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: replaces suffix-only headless state with the recovered renderer snapshot :: Replacing suffix-only state removes old suffix, retains renderer history plus later output/cwd, and returns the live47x40PTY grid.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: stamps SSH connection identity on runtime terminal status :: A synthetic mounted-leaf OSC9999 status after registerPty carries the supplied SSH connectionId.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: does not retain WSL context when a PTY id is reused :: After exit and same-ID new null distro context, OSC7 file://server/share/repo uses UNC server path rather than old Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: preserves immutable context while a live daemon attach is unresolved :: preparePtyExecutionContext with preserveExisting refuses a supplied Debian replacement and subsequent OSC7 keeps original Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts :: projects frame-independent live state through main buffer snapshots :: Main-buffer snapshot puts focus-report/cursor-visibility modes in frameRestoreAnsi, excludes STATIC-FRAME there and includes it in data.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.ts :: continues terminal agent status fanout when a callback throws :: Throwing on the first status callback does not prevent second payload delivery and logs contextual error.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: returns a title-only replay snapshot and never historical attention :: Lose replay:true/title-only fact projection despite earlierbell and unknownPTYnull. No actual delivered-history notification or reattach behavior was exercised. No equivalent replacement claimed.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects a handle rebind while a controller-less status check yields :: A handle rebound while the null-controller status continuation yields must throw terminal_handle_stale.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects confirmation evidence when the owning PTY exits :: A pending strong confirmation resolving after owning PTY exit must reject terminal_exited.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-03.spec.ts :: keeps ordinary terminal send suffix failures on the existing not-writable contract :: Ordinary send writes text but refused CR must throw terminal_not_writable with beforeWrite twice and afterWrite once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell the execution host cannot apply instead of spawning its default :: Requested Windows shell on POSIX must refuse before spawning a default shell.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: quotes the agent startup command for the requested shell, not the host default :: Requested cmd shell must override PowerShell default quoting for agent startup command.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: keeps restored receipts outside a targeted worktree scan :: Targeted scan removes the moved-worktree receipt while preserving another worktree receipt.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: observes setup command completion without waiting for its interactive shell to exit :: Nonzero completion marker 17 resolves while interactive shell remains running.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: falls back to setup terminal exit when no completion signal is available :: Setup completion observer without token falls back to actual exit code 9.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: cancels setup completion observation when the caller aborts :: Abort rejects with the original reason and unsubscribes once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps observing after an uncertain setup terminal status :: Unknown exit waiter result must leave observation pending until completion marker arrives.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh omits a record :: Controller inventory omission disconnects the record but preserves its retained transcript.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh times out :: Hung inventory timeout leaves connected record and retained transcript intact.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle for adopted background PTY handles from the renderer title :: An adopted background handle resolves tui-idle from ready Codex renderer title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves live-leaf tui-idle from an OpenCode native title :: A live leaf resolves tui-idle from an OpenCode native title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from a Codex ready prompt preview :: A supplied Codex prompt preview resolves tui-idle without an actual agent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from an Antigravity prompt before the model line :: A supplied Antigravity prompt before model line resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell with no workspace instead of creating a default-shell tab :: Workspace-less explicit shell must reject before renderer default-tab request or spawn. This real guard/wiring alarm is deliberately retired.", + "Audit3798 per-case accepted losses:\nsrc/main/runtime/orca-runtime-tests/paired-settings.spec.ts :: awaits navigation-only updates from paired clients (%s) :: Updating only claudeSubagentNavigationEnabled waits for the actual controller call to the supplied pending Claude-view reconcile for both on/off values.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: drops a client page record even when its close command cannot be issued :: A removed workspace loses its runtime client-page record and headless browser projection despite close delivery_required rejection, and emits the asynchronous warning.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: leaves client-hosted pages alone when another host still owns the same worktree id :: Removing runtime:env-b metadata with local ownership leaves the local same-ID client page unchanged and issues no close command.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: marks live bindings again when reopening after a promoted window closes :: A reopened window marks its still-registered live worktree in activeWorktreeIdsOnShutdown after the first promoted window closes.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: preserves live SSH session identities when promoting a headless runtime :: Headless-to-desktop promotion records active worktree, SSH connection and remoteSessionIdsByTabId from the supplied surviving SSH PTY/session.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores a surviving renderer when its reload is cancelled :: A sole ready renderer reload cancelled under its current renderer fence returns true and becomes ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores headless authority when desktop promotion navigation is cancelled :: A cancelled desktop promotion with headless recovery returns false while headless authority remains ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: moves a desktop graph to unavailable when its reload times out :: A ready desktop graph without a headless fallback becomes unavailable at the reload deadline and retains its window/epoch.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: recovers a failed headless promotion and accepts a later renderer generation :: A promotion failure restores ready headless authority; a later valid same-window graph publishes ready desktop authority.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: clears a failed pane recovery so a later reconnect can retry :: After relay_reconnecting rejection, the pending recovery lock clears and the same pane/handle can call createTerminal a second time and return its supplied replacement.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: still preserves a CLI agent leaf when the reloaded renderer has not rebound its PTY :: An empty graph published during renderer reload preserves a preallocated live CLI PTY as one listable terminal before renderer rebind.\nsrc/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts :: keeps a no-incarnation handle across an in-graph pane remint :: Within one graph lifetime an unversioned PTY reminted onto another leaf retains its issued handle and resolves its old exit waiter after onPtyExit.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: matches explicit-id cwd PTYs when the resolved worktree cache is incomplete :: An explicit target absent from a fresh incomplete resolved cache adopts only its cwd PTY, rejects nested cwd PTY and does not rescan Git.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: ignores cwd-only controller PTYs for malformed explicit worktree IDs :: Malformed id:repo-1:: returns no terminals, does not adopt cwd-only controller PTY and avoids Git rescanning.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: refuses an SSH-backed create for mobile/runtime callers instead of creating locally :: Loss of this public unserved SSH create error-class/no-local-add/no-local-list alarm.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: records an app-selected parent workspace as a manual action :: Loss of the local runtime folder-parent manual origin, active-workspace source and explicit confidence projection alarm; no claim that SSH or cleanup coverage replaces it.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: browses runtime server directories before projects are added :: Loss of this public runtime alarm for browse availability before registration, directories-first lexical ordering and native path flavor.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: lists drive roots for a server-root browse :: Loss of the Windows public slash-root drive enumeration smoke and presence of the temporary directory drive.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations-part-02.spec.ts :: creates a missing runtime parent before creating the project directory :: Loss of this runtime createRepo recursive missing-parent/child existence and registered-path alarm.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: preserves selected project %s when a hosted parent is known :: Loss of both parent-selected and origin-selected normal fork-link projection/persisted upstream alarms plus exact single-probe count.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: links a current enterprise remote despite unavailable metadata and a retained %s :: Loss of normal current-enterprise-origin linking with stale automatic GitHub avatar or protected file image, unchanged icon assertion, and serialized project identity under unavailable metadata.", "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.", "Audit2923 retires this entire mixed three-file receipt from current evidenceRuns because its selector included the removed migration suite. Preserved verbatim original JSON object (historical only; no reduced-selector validation):\n{\n \"date\": \"2026-08-11\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/cli/handlers/orchestration-lifecycle-rejection.test.ts src/cli/handlers/orchestration-lifecycle-json-rejection.test.ts src/cli/handlers/orchestration-migration.test.ts\",\n \"result\": \"passed\",\n \"durationSeconds\": 0.4,\n \"summary\": \"Three focused files passed 12 deterministic tests covering explicit current and Run-home verdicts, JSON failure output, exact report and terminal-state verification for stripped responses, stale/stopped rejection, idempotent retry, and first/replayed attested legacy settlements.\"\n }", "Audit2086 (sources2082/2083): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-06.spec.ts: suppresses saved mobile agent status when live evidence is the Claude agents screen; suppresses saved mobile agent status when the current terminal title is neutral; suppresses saved mobile agent status when fresh live OSC title is Claude agents; keeps saved PTY bindings pending until the runtime knows the PTY is connected; refreshes daemon PTY liveness before publishing mobile session tabs; does not invalidate a newly spawned SSH pane from an overlapping stale process list. src/main/runtime/orca-runtime-tests/pty-title-status.spec.ts: associates controller PTYs with mixed-case Windows and UNC cwd paths; uses OSC titles rather than controller process names for rendererless PTYs; ignores the bare cursor-agent native title so synthesized spinner state survives; only records the bare Cursor native title via the stale-working clear; refuses a bare Cursor title while the foreground read is unavailable; does not treat a bare Cursor title as an agent once the shell owns the foreground; accepts a bare Cursor title when the foreground read confirms cursor-agent; refuses a bare Cursor title on a runtime pty with no controller attached; clears a stale working title after 3s of title-less output; cancels the stale-title timer when the PTY exits; keeps stale-title timers isolated per PTY. src/main/runtime/orca-runtime-tests/paired-settings.spec.ts: projects runtime-backed settings to paired clients; updates quick commands without widening general paired settings payloads; applies native-chat option deltas atomically on the runtime host; keeps a future-launch default when an older client asks to prune from inventory; preserves concurrent additions after forty quick commands; accepts runtime-backed setting updates from paired clients; broadcasts visibility default changes to paired clients; reconciles hooks only when paired-client hook settings change; rejects relative paths for runtime nested repo scan/import. 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.", @@ -10749,7 +10746,9 @@ "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. All prior notes and dated/archived evidence retain original scopes.", "Complete prior commands before federation-lifecycle suite retirement: [\"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/handlers/orchestration.test.ts src/cli/handlers/orchestration-check-identity.test.ts src/cli/handlers/orchestration-worker-cli.test.ts src/main/runtime/rpc/methods/orchestration/worker/composed-workers.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/handlers/orchestration-lifecycle-rejection.test.ts src/cli/handlers/orchestration-lifecycle-json-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/rpc/methods/orchestration/federation/federation-lifecycle-settlement.test.ts --reporter=dot\",\"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\"]", "Complete prior testFiles before federation-lifecycle suite retirement: [\"src/main/runtime/rpc/methods/orchestration/messaging/check-worker-federated-attachment.test.ts\",\"src/main/runtime/construction/orca-runtime.test.ts\",\"src/cli/handlers/orchestration.test.ts\",\"src/cli/handlers/orchestration-lifecycle-rejection.test.ts\",\"src/cli/handlers/orchestration-lifecycle-json-rejection.test.ts\",\"src/cli/handlers/orchestration-check-identity.test.ts\",\"src/cli/handlers/orchestration-worker-cli.test.ts\",\"src/main/runtime/rpc/methods/orchestration/worker/composed-workers.test.ts\",\"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/rpc/methods/orchestration/federation/federation-lifecycle-settlement.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\"]", - "Complete prior assertionRefs before federation-lifecycle suite retirement: [{\"file\":\"src/main/runtime/rpc/methods/orchestration/messaging/check-worker-federated-attachment.test.ts\",\"assertions\":[\"replays the coordinator instruction and takes its ack after the app restarts\",\"files loopback mail once under the local Dispatch Run without replacing its owner\"]},{\"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-lifecycle-json-rejection.test.ts\",\"assertions\":[\"a rejected lifecycle verdict is emitted as a JSON ok=false envelope\"]},{\"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\"]},{\"file\":\"src/main/runtime/rpc/methods/orchestration/messaging/check.test.ts\",\"assertions\":[\"Run delivery resolves through a stable coordinator pane after handle remint\",\"a live handle cannot be retargeted by mismatched pane metadata\"]},{\"file\":\"src/main/runtime/rpc/methods/orchestration/messaging/send.test.ts\",\"assertions\":[\"Dispatch delivery resolves through a stable worker pane after handle remint\"]},{\"file\":\"src/main/runtime/rpc/methods/orchestration/federation/federation-lifecycle-settlement.test.ts\",\"assertions\":[\"a remote worker_done waits for Run-home settlement even when an older CLI omits the wait hint\",\"a current Run home still completes reports from legacy protocol v1/v2 worker servers\",\"persisted protocol v1/v2 workers retain legacy-compatible completion after their worker server updates\",\"preexisting same-outcome terminal ACK batches settle atomically while conflicting outcomes acknowledge nothing\",\"an aborted settlement wait returns operation_unknown instead of accepted success\",\"a Run-home terminal verdict settles the remote attachment and revokes its capability\",\"a terminal verdict cannot settle an unrelated relay item\",\"a terminal verdict cannot contradict the exact queued worker report outcome\",\"a rejected report replays its exact verdict without mutating durable rejection mail twice\"]},{\"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\":[\"worker-start exposes one inactive worker tab before workspace navigation\",\"the coordinator tab remains active\",\"ACK delivery reaches a stable coordinator pane through a stale handle\",\"one spawn remains live with no interruption event\",\"PTY/incarnation, tab, leaf, worktree, Task, and Dispatch identities remain stable\",\"workspace re-entry does not duplicate the worker tab or print Conversation interrupted\"]},{\"file\":\"tests/e2e/orchestration-worker-settlement-release-cli.spec.ts\",\"assertions\":[\"a compiled CLI worker_done with the wrong identity exits nonzero with ok=false\",\"the exact Task and Dispatch remain dispatched after rejection\",\"the correct worker identity receives an explicit completed lifecycle verdict\",\"an independent runtime read observes the Dispatch completed\"]}]" + "Complete prior assertionRefs before federation-lifecycle suite retirement: [{\"file\":\"src/main/runtime/rpc/methods/orchestration/messaging/check-worker-federated-attachment.test.ts\",\"assertions\":[\"replays the coordinator instruction and takes its ack after the app restarts\",\"files loopback mail once under the local Dispatch Run without replacing its owner\"]},{\"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-lifecycle-json-rejection.test.ts\",\"assertions\":[\"a rejected lifecycle verdict is emitted as a JSON ok=false envelope\"]},{\"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\"]},{\"file\":\"src/main/runtime/rpc/methods/orchestration/messaging/check.test.ts\",\"assertions\":[\"Run delivery resolves through a stable coordinator pane after handle remint\",\"a live handle cannot be retargeted by mismatched pane metadata\"]},{\"file\":\"src/main/runtime/rpc/methods/orchestration/messaging/send.test.ts\",\"assertions\":[\"Dispatch delivery resolves through a stable worker pane after handle remint\"]},{\"file\":\"src/main/runtime/rpc/methods/orchestration/federation/federation-lifecycle-settlement.test.ts\",\"assertions\":[\"a remote worker_done waits for Run-home settlement even when an older CLI omits the wait hint\",\"a current Run home still completes reports from legacy protocol v1/v2 worker servers\",\"persisted protocol v1/v2 workers retain legacy-compatible completion after their worker server updates\",\"preexisting same-outcome terminal ACK batches settle atomically while conflicting outcomes acknowledge nothing\",\"an aborted settlement wait returns operation_unknown instead of accepted success\",\"a Run-home terminal verdict settles the remote attachment and revokes its capability\",\"a terminal verdict cannot settle an unrelated relay item\",\"a terminal verdict cannot contradict the exact queued worker report outcome\",\"a rejected report replays its exact verdict without mutating durable rejection mail twice\"]},{\"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\":[\"worker-start exposes one inactive worker tab before workspace navigation\",\"the coordinator tab remains active\",\"ACK delivery reaches a stable coordinator pane through a stale handle\",\"one spawn remains live with no interruption event\",\"PTY/incarnation, tab, leaf, worktree, Task, and Dispatch identities remain stable\",\"workspace re-entry does not duplicate the worker tab or print Conversation interrupted\"]},{\"file\":\"tests/e2e/orchestration-worker-settlement-release-cli.spec.ts\",\"assertions\":[\"a compiled CLI worker_done with the wrong identity exits nonzero with ok=false\",\"the exact Task and Dispatch remain dispatched after rejection\",\"the correct worker identity receives an explicit completed lifecycle verdict\",\"an independent runtime read observes the Dispatch completed\"]}]", + "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." ], "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." }, @@ -10779,7 +10778,7 @@ "invariant": "A live Dispatch created by orchestration dispatch can be stopped or abandoned even though it has no supervised worker row. Release must durably record the requested outcome, revoke lifecycle authority, close questions, free the exact assignee identity, and block only the Task whose current Dispatch was released. It must never close the unsupervised terminal process, disturb unrelated or supervised workers, or let a repeat or opposite verb rewrite the persisted outcome.", "oracle": "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): Retained assertion references and unchanged receipts keep their original scopes; retired callbacks and archived receipts provide no current coverage.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/orchestration/worker/manual-dispatch-release.test.ts src/main/runtime/orchestration/db/worker-dispatch/orchestration-worker-dispatch-db.test.ts src/main/runtime/rpc/methods/orchestration/worker/workers-recovery.test.ts src/main/runtime/rpc/methods/orchestration/worker/worker-release.test.ts src/cli/handlers/orchestration-worker-cli.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/orchestration/worker/manual-dispatch-release.test.ts src/main/runtime/orchestration/db/worker-dispatch/orchestration-worker-dispatch-db.test.ts src/main/runtime/rpc/methods/orchestration/worker/workers-recovery.test.ts src/main/runtime/rpc/methods/orchestration/worker/worker-release.test.ts src/cli/orchestration/workers/orchestration-worker-cli.test.ts --reporter=dot", "pnpm run ensure:electron-runtime && pnpm exec playwright test tests/e2e/orchestration-low-level-dispatch-release.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", "SKIP_BUILD=1 pnpm exec playwright test tests/e2e/orchestration-low-level-dispatch-release.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1" ], @@ -10788,7 +10787,7 @@ "src/main/runtime/orchestration/db/worker-dispatch/orchestration-worker-dispatch-db.test.ts", "src/main/runtime/rpc/methods/orchestration/worker/workers-recovery.test.ts", "src/main/runtime/rpc/methods/orchestration/worker/worker-release.test.ts", - "src/cli/handlers/orchestration-worker-cli.test.ts", + "src/cli/orchestration/workers/orchestration-worker-cli.test.ts", "tests/e2e/orchestration-low-level-dispatch-release.spec.ts" ], "assertionRefs": [ @@ -10882,7 +10881,7 @@ "providers": ["local", "daemon", "ssh", "wsl", "remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "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": "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", @@ -10891,13 +10890,13 @@ "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": "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": "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/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 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/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/worker-release.test.ts src/main/runtime/rpc/methods/orchestration/worker/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/worker-release.test.ts src/main/runtime/rpc/methods/orchestration/worker/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/worker-release.test.ts src/main/runtime/rpc/methods/orchestration/worker/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 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": [ @@ -10906,7 +10905,7 @@ "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/rpc/orchestration/mutations/orchestration-mutation-ledger.test.ts", "src/main/runtime/orchestration/workers/transcripts/worker-transcript-read.test.ts", "tests/e2e/orchestration-worker-settlement-release-cli.spec.ts" ], @@ -10994,7 +10993,8 @@ "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. All prior notes and dated/archived evidence retain original scopes.", "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\"]}]" + "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." ], "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." }, @@ -12392,20 +12392,20 @@ "providers": ["local", "remote-runtime", "ssh"], "coveredPlatforms": ["macos", "linux"], "coveredProviders": ["local", "remote-runtime", "ssh"], - "coverageNotes": "Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous account (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous account (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous account (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous account (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous account (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous 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): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous account (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Independently remove one authored/finite Playwright closed-gate app-boot inventory: accept loss of real renderer/preload/main refusal composition, saved-host row and Add/Move hiding/Remove visibility alarms. Keep the unchanged scripted-move rendered dialog lifecycle/reload case. It runs no real WSL migration, host connection, file copy or automation restoration. No selector or Playwright participation cleanup is required because the spec remains. Previous 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. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3553/3559 current scope: delete worktrees-delete-pty-teardown.test.ts and worktrees-issue-command-overrides.test.ts entirely and remove three cases from worktrees-orphan-directory-cleanup.test.ts (6 authored/6 finite removals). Intentionally retire typed unserved-SSH create/delete admission, exact-name collision/error-token, proven-orphan no-force confirmation, standalone .git-directory refusal, and SSH-owned local-path preservation alarms. Retain only actual authorized orphan deletion and no-marker notes-file preservation; they are not equivalent replacements. The no-marker fixture resolves the default getRepos owner, so it does not prove temporary owner-repo binding. Git/Store/PTY/notifications are mocked; no physical process stop, durable metadata, real SSH delivery or native UI proof is claimed. Unchanged historical oracle, coverage, evidenceRuns and escaped receipts retain their original scopes only; no fresh execution or transferred pass validates the reduced sources. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result 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. Broad root-unit discovery loses whole cross-client workspace-sync, terminal-preview, picker-skill-hint and close-routing suites plus reduced worker-stop, remote-owned-record, scanner, mobile-bundle and daemon-health samples. Separate E2E discovery also loses the paired mobile/desktop mirror journey and two unit drivers. Retained callback/table/outer-loop/guard bytes are exact; retained checks do not replace the removed alarms. No app, native device, mixed-version, remote or cross-platform execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. 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. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. 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. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. 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. The broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. 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. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts: delivers remote file changes to listeners for the same worktree. src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Exact retired assertionRefs, preserved as historical objects only: {\n \"file\": \"src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts\",\n \"assertions\": [\n \"terminal watcher error and setup failure evict the shared entry before retrying callbacks run\",\n \"an old stream end cannot evict the replacement stream, which still delivers to its listener\",\n \"two same-worktree listeners share a synthetic subscription until the final stop unsubscribes and sends unwatch\"\n ]\n } Historical prior account (preserved verbatim): Audit1973: Delete the standalone mocked watcher cleanup suite and its entire sole-file prospective command. Retire the removed file-command transport-abort alias; preserve the independent cancellation suite and final-overflow/error/end cleanup callback, and13 unrelated receipt objects. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial runtime files-watch suite retains controlled Windows close-event waiting, shared-client survival, late physical-exit ownership/deadline cleanup and shutdown joining. Its combined Windows close/deadline/late-exit alias remains backed by unchanged callbacks. Retire native-error-close, pre-publication setup ownership and failed-delete rearm aliases; associated delegation, failure forwarding, removal routing and recovery examples are lost. These tests inject watch/subscription seams and do not observe an actual native watcher or physical process. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Partial runtime watcher-host suite loses mocked option/event/overflow/resubscription forwarding, supplied teardown-error propagation, aborted-signal/no-call and private ten-thousand-waiter-count inventories. Retire the 10,000-caller bound and failed-recovery-subscriber-ending assertion aliases. Keep same-root owner cancellation, pre-ready replacement, held root-close join, stale-generation recovery delivery and initial failed-root ownership mappings backed by retained real-host callbacks with injected subscription/error/physical-exit promises. No actual native watcher, process termination or resource bound was observed. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1645 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1623 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1516 removes package-electron-runtime-contract.test.mjs, a copied release-workflow platform and marker matrix. Its workflow wiring alarm is intentionally retired; no actual packaged watcher delivery was exercised and no equivalent replacement is claimed. Unaffected dated execution receipts retain their original scope; changed optional selectors have no fresh full-gate execution result. This audit removes the paired-web stopped-during-outage and late-ready direct-branch examples. The retained pre-ready cancellation, failed-unwatch retry and replay-continuity cases are not equivalent replacements for those ordering alarms. Current web-runtime-client.test.ts assertions below name only its retained pre-ready callback case; replay cases remain in their separate suite. Historical commands and results remain historical. Deterministic tests cover one shared healthy child per runtime process plus at most four bounded fault-quarantine children, native desktop, paired-runtime, and WSL snapshot processes sharing the same eight-physical-child reservation with typed serialized event-driven capacity recovery, including recursive re-wait when crash recovery reclaims an announced slot, one quarantine attempt per watch lifetime, generation-scoped cancellation, bounded termination with removable deadline waiters, replacement-crawl errors that cannot be blessed by a late readiness ack, pre-ready paired-web cancellation registered before an unbounded capacity wait, already-resolved and late physical-exit retry of a rejected paired-web teardown, physical desktop-install and local/SSH PTY teardown, stale-generation rejection, per-child stat bounds, final-overflow RPC delivery, and renderer eviction before terminal callbacks can retry. Destructive local and SSH removal fences both ID-derived and resolved-cwd terminal roots, including sibling-root/cwd combinations with reverse admission rollback, closes descendant relay watches before parent deletion, enumerates authoritative provider/cwd ownership, falls back to daemon spawn cwd before OSC 7, and keeps daemon/relay immediate shutdown pending until native exit or a bounded fail-closed error; a dead relay PID discovered during attach also settles concurrent shutdown before its stale entry is reaped, while Windows runtime watcher deadlines retain one removable physical-close waiter, treat Node's error-close path as positive physical-exit proof, and clear root ownership on late close. The relay policy test maps a standard repository's base, Git common directory, and worktree roots to one healthy supervisor, then proves a shared-child failure recovers those roots in separate quarantine supervisors with overflow and resumed events. Abortable capacity, quarantine, runtime-root, relay, SSH, and relay pre-install setup waits attach one reaction to each shared promise and explicitly remove 10,000 cancelled caller closures while one anchor remains. Built-entry macOS harnesses kill the desktop/runtime and SSH relay watcher children, then require automatic resubscription and later events while the host process and relay PTY survive. SSH bundles the child boundary beside relay.js, requires both artifacts for install completeness, and preserves registration-owned same-root cancellation. The test-value audit corrects the active renderer watch command/file reference to the existing runtime-file-client-watch.test.ts, whose three cases are retained unchanged. They observe synthetic subscription retry/fanout and unsubscribe/unwatch calls, not actual preload/main bookkeeping or physical watcher-process cleanup. The separate read/preview client suite loses forwarding, supplied-error and negative-only examples, retaining binary detection and Unicode SVG decoding. Historical evidence commands/results are unchanged. Test-value audit1293 removes src/main/providers/local-pty/local-pty-provider-session-inventory.test.ts (2 authored cases). Their isolated assertions no longer run; surviving tests are not claimed as equivalent coverage. Fresh execution against the candidate SHA is required. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1412: src/main/workspaces/removal/watcher-removal-gate.test.ts reduced. Loses exact removal-error compatibility with renderer predicate under shared message constants. Kept public refusal outcomes do not establish that renderer classification. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "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. Audit 3959 retires the whole session.test.ts driver (27 authored / 33 finite cases): startup/echo filtering, readiness input gates, ownership confirmation, detach authority, and termination retry/exit ordering alarms are intentionally lost. No equivalent replacement or fresh runtime validation is claimed. Audit3788 retires10 authored/11 expanded cases across six changed drivers, including the entire screencast pending-frame-retry and usage-source-cache-streaming suites. Deliberate losses are false-refused last-frame retry/once-only delivery, ordinary stable-pane reattachment, cleared-chat Dispatch completion, terminal-declared chat-caller refusal, at-rest worker liveness projection, nested depth/cap policy, small unsigned6/sealed7 plain-format and verified-bit examples, generic malformed-ISIZE footer refusal examples, and synthetic10k/100k chunk-size/work-count budgets in gzip and general cache I/O. These include real state/disk/RPC outcomes consciously retired for marginal value; retained E2EE-backlog, receipt/custody/uncertain-ack, integrity/migration and staging-cleanup cases are not equivalent replacements. The footer test did not prove early rejection or bounded allocation; staging cleanup did not seed unrelated files. No replacement or fresh native/remote/performance execution is claimed. Earlier raw selectors and dated receipts remain historical. Audit3779 retires17 authored/17 expanded registrations across six changed drivers, including the entire shared-Codex-home and prompt-telemetry suites. Accepted losses are shared-home wrapper noninterference/opt-out preservation, mocked metric count/provenance filters, SSH activity labeling/clearing and handover idle timing, VM ownership/capability/status projections and asleep-worktree refusal, a link-only external conversation replay sample, and two narrow input-credit noninterference/expiry examples. Retain the direct exact-tab/single-use input-credit case. These bounded real disk/state/routing alarms are intentionally retired for marginal value without equivalent replacement or fresh execution claims; earlier receipts remain historical. Audit3772 retires18 authored/27 expanded cases, including whole Codex service opt-out, RPC capability-parser, creator-provenance, short-ciphertext and readiness-null suites. Accepted losses include service ledger/symlink/mode cleanup, user TOML substring preservation, old-hash cleanup, description pass-through, malformed-file/pending-hash examples, coordinator write/probe counts, capability array bounds, positive creator projections, early short-payload refusal and readiness helper null shape. Two redundant Codex exit-cause rows are also retired; Pi shares their direct-idle path only in this empty-output immediate-exit fixture, and future agent-config drift coverage is lost. Real bounded filesystem/parser/runtime alarms are deliberately retired for marginal value; no equivalent replacements or fresh execution are claimed. Earlier receipts retain their historical scope. Audits3754/3755 intentionally remove9 authored/9 finite registrations: the entire one-case usage-source-cache-streaming.test.ts driver and8 cases from the surviving computer-action-validation.test.ts driver. This gate retains an unfiltered root Vitest command; UNIT_INCLUDE admits both source paths. Accepted losses are the real encoder output chunk-size/work-count alarm on repetitive10k/100k ownership payloads through a mocked durable sink, plus CLI diagnostic precedence, fractional window-id rejection, action-call-site window-target exclusivity, plain-text click-count recovery copy, incomplete click/drag targeting, mouse/modifier/direction allowlist samples and inline/stdin text exclusivity. These CLI cases exercise real argument/handler validation before mocked runtime calls; they are deliberately retired for marginal value, not declared tautologies. Retained cache I/O and CLI cases are not equivalent replacements for these alarms. Existing historical raw receipts remain unchanged and do not validate the deleted or reduced drivers. No fresh execution claim is made. Audits3758/3763 intentionally remove9 authored/11 finite registrations from6 changed drivers, including the entire pane-title-notification, window-linear-notices and worktree-card-lifecycle-effects suites. This gate retains an unfiltered root Vitest command admitting these paths. Accepted losses are same-account linked-row success-notice fanout, sidebar-switch channel forwarding, Linear-only notification forwarding/non-terminal-consumer selection/closed-window detach, destroyed-window refusal and first-send-failure suspension through the pane-title adapter, the100-card synthetic focus/poll absence sample, stored-source local folder badge refresh, unobserved-row badge refusal, and immediate reposChanged lineage invalidation. These exercise real owners with controlled ports; they are retired for marginal value, without equivalent replacement claims. The no-badge-work fixture does not seed its title-promised collection-only cache. Preserved historical receipts do not validate deleted or reduced drivers; no fresh execution is claimed. Audit3759 retires the entire one-case Tailwind compiler/scanner smoke. Accept loss of the direct CSS production/test/spec source-exclusion and rescan alarm; no replacement or current execution is claimed. Audit3752 independently approves audit3749: retire five authored/five finite watcher-process registrations, retaining18 raw-exact registrations. Accept loss of healthy shared-pool joint recovery, last-pending-failure idle retirement/respawn, late VITEST fallback release, missing-entry fail-closed selection and independent-supervisor fuse locality alarms. These are real bounded host-policy alarms intentionally retired for low marginal value; no equivalent replacement is asserted. Remaining driver selections exercise controlled FakeChild supervisor lifecycle, cancellation, physical-exit fencing, recovery and fuse behavior. This source review supplies no fresh native/process/platform/remote/SSH execution; historical receipts retain original source and selector scopes. Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered root Vitest command. Current UNIT_INCLUDE admits the partial push-service, metadata-dialog and two config/scripts browser drivers:10 authored/16 finite removals. Accepted losses: actual retry30s/60s progression and register bucket/refill wiring, explicit seven-day lease arithmetic (its notification lacked seq/epoch and never reached send), equal-name edit latch/save payload, real image/font/meta-refresh/form/popup browser refusal controls, and broad rich-markdown bridge/command/edit-select smoke. Actual production state, callback routing and browser enforcement run in these cases; these alarms are deliberately retired on marginal value. All drivers and selectors survive. Existing unrelated receipts remain historical evidence for their unchanged selectors, not proof of the reduced cases. Audit3732 removes 2 authored/3 finite registrations from two partial suites: nominal custom/Kimi local naming success and deferred context usage row presentation. Real losses: custom/Kimi successful extraction through conversation-name sanitization and agentLabel composition; separate ordered counted/deferred lists and exact percentage/token formatting. No replacement or equivalent coverage claimed. Retain 11 authored/13 finite raw-exact registrations for bounded naming instruction/refusal/cancellation, menu dismissal focus ownership and hover/composer Escape/timer cleanup. Source-only bounded value review, no runtime/CI/native/remote/mobile/folder workspace or global completion credit. Previous account (preserved verbatim): Audit3733 removes2authored/2finite terminal input checks: fixed custom-cap error/secret fixture and three-emoji cap5refusal whose6UTF16units already trip length fast guard (no UTF8-dependent boundary). Accept exact non-disclosure/oversized-refusal alarm losses; no replacement/equivalence claim. Retain13/13scalar/pending input, OSC state and cron DST/cadence outcomes after bounded material reads. Source-only zero runtime/novelty credit; original historical reasons preserved. Previous account (preserved verbatim): Audit3729 removes1authored/3finite by deleting whole CLI runtime pairing advisory-close suite. Accept losing post-real-close injected EIO preservation of native/script/unreadable pairing, env identity/preservation and exact close/release assertions; no actual failed-close leak or replacement coverage claimed. Two retained URL grammar/identity suites11authored16finite raw unchanged. Bounded source/owner/caller value review, zero novelty/runtime credit; other seven3724deferred closures remain. Historical receipts preserve original limits. Previous account (preserved verbatim): Audit3724 removes3authored/3finite checks by deleting two whole suites: TUI clear burst-size singleton and terminal-file-URL target two-case wrapper suite. Deliberate losses: derived widest burst<64byte alarm, UNC authority+line-column anchor composition, and malformed-percent null refusal. Real production algorithms execute in those tests; no mocked-output tautology, equivalent replacement, actual Claude/file-navigation delivery or universal safety-irrelevance claim. TUI58byte bound and URI examples have low marginal value as standalone suites. Actual1262/1264/1742KEEP superseded explicitly. Remaining14drivers83authored136finite raw unchanged. Bounded source-only review; ten closures deferred, four bounded keep judgments repeated with zero new semantic-frontier credit. No runtime/CI/native/remote/mobile/folder/global completion claim; historical receipts retain original scope. Previous account (preserved verbatim): Audit3723 removes 4 authored/4 finite registrations in two whole suites: keybinding cache freeze/token spellings and host-dependent Orca command name examples. Real losses include returned-object freeze, repeated Mod+P key, Space/PageDown/NumpadSubtract mapping, unknown/empty/prototype-token rejection, and headless Linux versus Windows-server/WSL command choice. No equivalent or replacement coverage claimed. Retain 12 authored/21 finite raw-exact registrations exercising generated scaffold validation, artifact failures, shipped editor/hook/worker/panel tests, actual generated typing compilation, independent CLI root routing and intent-name precedence. Source-only bounded audit; no runtime, CI, native, remote, mobile, folder workspace or global completion credit. Previous account (preserved verbatim): Audit3720 removes17authored/23finite checks: whole main catalog-date adapter2 and shared date-helper7, seven renderer nominal ranking/cap/no-date/composition cases, and one browser registration expanding to seven forced-container/DOM-child boundary cases. Deliberate real losses: community oldest-date UTC forwarding, official/undated omission, date sorting/window/invalid/future/skew/clamp and default/override cap; nominal ranking/cap and combined Featured/Newly-added outputs; real CSS459/460,719/720,1055/1056breakpoint, five-card partial-row and720px two-card first-row alarms. Browser cases really measure rendered geometry but force width/remove DOM children; no fake-pixel or tautology rationale. No replacement/equivalent coverage claimed. Retain14authored/19finite raw-exact registrations across4drivers: adversarial featured category/order/tie and installability, date order/window selection, actual PluginManager failure/escaping/duplicate-card suppression, real browser viewport/odd-count geometry/phone catalog visibility, syntax ingress/depth/include/printability and68dlong-bracket auto-close fill-in. No tests/browser/native/UI/provider/remote/mobile/folder/CI/global execution or completion credit. Previous account (preserved verbatim): Audit3717 removes6 authored/6finite checks in two whole thin-adapter/presentation suites. Deliberate real losses: ordinary recipe repository-URL withholding and provisioned-root credential scrubbing/forwarding; repository label lockstep suffix expansion, host-scoped map identity/collision grouping, Windows crosshost paths and WSL distro suffixes. Actual provision options, label/sort consumers and host/scrubber delegates inspected; no replacement/equivalence claim. Retain40 authored/84finite registrations raw exact in14 drivers with bounded owner/context review. Prior KEEP superseded for removed suites; no runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3714 removes8 authored/39finite checks: whole CLI selector-recovery, task display-text and ANSI grammar suites plus two name joiner/blank tables. Deliberate real losses: selector flag/value/identity and mutation recovery merge/serialization; exact task suffix, transcript fallback, input immutability, cache reuse and edited blocks; independent failed-escape/resumption and OSC/DCS/BEL/ST/C1/nested/unfinished stripping outputs; meaningful-language joiner preservation and invisible/blank-name rejection. These are real bounded alarms, removed as narrow supplied-error examples, helper/token inventories and repeated internal-work fixtures. Prior2936,1195/1196,1214/1215 and1082 KEEP superseded; no replacement or equivalent coverage claimed. Keep9authored/9finite raw-exact registrations in5surviving drivers: screenshot export/failure filesystem behavior, CLI local tree query, event-local reply provenance, vault role-sensitive content and four hostile/UTF16/dangling/tag-name regressions. No native/UI/provider/remote/mobile/folder/runtime/CI/global completion credit. Previous account (preserved verbatim): Audit3711 retires2authored/4finite cases by deleting whole clipboard-image-temp-file signature-to-name inventory (HEIC/TIFF/unrecognised bytes) and workspace-last-active switch-on supplied visit/reason singleton, plus its now-orphan test fixture. This intentionally loses real generated-filename suffix/extensionless alarms and real newer-visit archived7day versus inactive30day filtering/older-visit identity alarms. Filesystem writing and production reason pruning really execute; no equivalent replacement or universal absence of safety relevance is claimed. The clipboard test does not inspect written bytes, native delivery or decode; the visit test supplies candidate/timestamps and does not exercise persisted visit routing or actual removal.20authored/20finite cases remain unchanged across4bounded Git/sidecar/removal drivers. No new runner/test/module evaluation or runtime result; historical notes and receipts remain historical. Previous account (preserved verbatim): Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous account (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous account (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous account (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous account (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous account (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous 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): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous account (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Independently remove one authored/finite Playwright closed-gate app-boot inventory: accept loss of real renderer/preload/main refusal composition, saved-host row and Add/Move hiding/Remove visibility alarms. Keep the unchanged scripted-move rendered dialog lifecycle/reload case. It runs no real WSL migration, host connection, file copy or automation restoration. No selector or Playwright participation cleanup is required because the spec remains. Previous 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. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3553/3559 current scope: delete worktrees-delete-pty-teardown.test.ts and worktrees-issue-command-overrides.test.ts entirely and remove three cases from worktrees-orphan-directory-cleanup.test.ts (6 authored/6 finite removals). Intentionally retire typed unserved-SSH create/delete admission, exact-name collision/error-token, proven-orphan no-force confirmation, standalone .git-directory refusal, and SSH-owned local-path preservation alarms. Retain only actual authorized orphan deletion and no-marker notes-file preservation; they are not equivalent replacements. The no-marker fixture resolves the default getRepos owner, so it does not prove temporary owner-repo binding. Git/Store/PTY/notifications are mocked; no physical process stop, durable metadata, real SSH delivery or native UI proof is claimed. Unchanged historical oracle, coverage, evidenceRuns and escaped receipts retain their original scopes only; no fresh execution or transferred pass validates the reduced sources. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result 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. Broad root-unit discovery loses whole cross-client workspace-sync, terminal-preview, picker-skill-hint and close-routing suites plus reduced worker-stop, remote-owned-record, scanner, mobile-bundle and daemon-health samples. Separate E2E discovery also loses the paired mobile/desktop mirror journey and two unit drivers. Retained callback/table/outer-loop/guard bytes are exact; retained checks do not replace the removed alarms. No app, native device, mixed-version, remote or cross-platform execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. 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. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. 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. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. 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. The broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. 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. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts: delivers remote file changes to listeners for the same worktree. src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Exact retired assertionRefs, preserved as historical objects only: {\n \"file\": \"src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts\",\n \"assertions\": [\n \"terminal watcher error and setup failure evict the shared entry before retrying callbacks run\",\n \"an old stream end cannot evict the replacement stream, which still delivers to its listener\",\n \"two same-worktree listeners share a synthetic subscription until the final stop unsubscribes and sends unwatch\"\n ]\n } Historical prior account (preserved verbatim): Audit1973: Delete the standalone mocked watcher cleanup suite and its entire sole-file prospective command. Retire the removed file-command transport-abort alias; preserve the independent cancellation suite and final-overflow/error/end cleanup callback, and13 unrelated receipt objects. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial runtime files-watch suite retains controlled Windows close-event waiting, shared-client survival, late physical-exit ownership/deadline cleanup and shutdown joining. Its combined Windows close/deadline/late-exit alias remains backed by unchanged callbacks. Retire native-error-close, pre-publication setup ownership and failed-delete rearm aliases; associated delegation, failure forwarding, removal routing and recovery examples are lost. These tests inject watch/subscription seams and do not observe an actual native watcher or physical process. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Partial runtime watcher-host suite loses mocked option/event/overflow/resubscription forwarding, supplied teardown-error propagation, aborted-signal/no-call and private ten-thousand-waiter-count inventories. Retire the 10,000-caller bound and failed-recovery-subscriber-ending assertion aliases. Keep same-root owner cancellation, pre-ready replacement, held root-close join, stale-generation recovery delivery and initial failed-root ownership mappings backed by retained real-host callbacks with injected subscription/error/physical-exit promises. No actual native watcher, process termination or resource bound was observed. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1645 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1623 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1516 removes package-electron-runtime-contract.test.mjs, a copied release-workflow platform and marker matrix. Its workflow wiring alarm is intentionally retired; no actual packaged watcher delivery was exercised and no equivalent replacement is claimed. Unaffected dated execution receipts retain their original scope; changed optional selectors have no fresh full-gate execution result. This audit removes the paired-web stopped-during-outage and late-ready direct-branch examples. The retained pre-ready cancellation, failed-unwatch retry and replay-continuity cases are not equivalent replacements for those ordering alarms. Current web-runtime-client.test.ts assertions below name only its retained pre-ready callback case; replay cases remain in their separate suite. Historical commands and results remain historical. Deterministic tests cover one shared healthy child per runtime process plus at most four bounded fault-quarantine children, native desktop, paired-runtime, and WSL snapshot processes sharing the same eight-physical-child reservation with typed serialized event-driven capacity recovery, including recursive re-wait when crash recovery reclaims an announced slot, one quarantine attempt per watch lifetime, generation-scoped cancellation, bounded termination with removable deadline waiters, replacement-crawl errors that cannot be blessed by a late readiness ack, pre-ready paired-web cancellation registered before an unbounded capacity wait, already-resolved and late physical-exit retry of a rejected paired-web teardown, physical desktop-install and local/SSH PTY teardown, stale-generation rejection, per-child stat bounds, final-overflow RPC delivery, and renderer eviction before terminal callbacks can retry. Destructive local and SSH removal fences both ID-derived and resolved-cwd terminal roots, including sibling-root/cwd combinations with reverse admission rollback, closes descendant relay watches before parent deletion, enumerates authoritative provider/cwd ownership, falls back to daemon spawn cwd before OSC 7, and keeps daemon/relay immediate shutdown pending until native exit or a bounded fail-closed error; a dead relay PID discovered during attach also settles concurrent shutdown before its stale entry is reaped, while Windows runtime watcher deadlines retain one removable physical-close waiter, treat Node's error-close path as positive physical-exit proof, and clear root ownership on late close. The relay policy test maps a standard repository's base, Git common directory, and worktree roots to one healthy supervisor, then proves a shared-child failure recovers those roots in separate quarantine supervisors with overflow and resumed events. Abortable capacity, quarantine, runtime-root, relay, SSH, and relay pre-install setup waits attach one reaction to each shared promise and explicitly remove 10,000 cancelled caller closures while one anchor remains. Built-entry macOS harnesses kill the desktop/runtime and SSH relay watcher children, then require automatic resubscription and later events while the host process and relay PTY survive. SSH bundles the child boundary beside relay.js, requires both artifacts for install completeness, and preserves registration-owned same-root cancellation. The test-value audit corrects the active renderer watch command/file reference to the existing runtime-file-client-watch.test.ts, whose three cases are retained unchanged. They observe synthetic subscription retry/fanout and unsubscribe/unwatch calls, not actual preload/main bookkeeping or physical watcher-process cleanup. The separate read/preview client suite loses forwarding, supplied-error and negative-only examples, retaining binary detection and Unicode SVG decoding. Historical evidence commands/results are unchanged. Test-value audit1293 removes src/main/providers/local-pty/local-pty-provider-session-inventory.test.ts (2 authored cases). Their isolated assertions no longer run; surviving tests are not claimed as equivalent coverage. Fresh execution against the candidate SHA is required. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1412: src/main/workspaces/removal/watcher-removal-gate.test.ts reduced. Loses exact removal-error compatibility with renderer predicate under shared message constants. Kept public refusal outcomes do not establish that renderer classification. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/5308", "https://github.com/stablyai/orca/issues/7547", "https://github.com/stablyai/orca/issues/8212" ], "invariant": "Local runtime and SSH relay roots share one watcher child per host process while healthy and use at most four quarantine children after shard failure; native desktop, paired-runtime, and direct WSL snapshot children consume the same process-wide eight-child reservation and retry transient exhaustion without permanently disabling a root. Cancellation remains owned by its child generation and settles only after acknowledgement or bounded physical exit; paired-web retains cleanup ownership and can cancel before readiness even while capacity is exhausted, retries a failed unwatch after already-resolved or late physical exit without duplicating stream termination, replacements never overlap a still-retiring generation, and aborted or timed-out callers detach immediately even while queued behind same-root relay teardown. Destructive local and SSH cleanup holds one containment-aware watcher/terminal removal fence through descendant watcher and PTY physical exit plus parent Git/filesystem deletion; daemon and relay kill requests retain ownership until the actual subprocess exit callback or an equivalent positive dead-PID proof and propagate rejected signals or a bounded failure otherwise. A crash-fused shared shard moves affected roots into the bounded quarantine pool, a second fused quarantine ends those watch lifetimes, interrupted setup emits overflow after recovery, metadata work stays bounded, and the SSH relay, PTYs, Git, and other filesystem operations never load the watcher native addon or share its fault boundary.", - "oracle": "Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous oracle (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous oracle (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous oracle (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous oracle (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous oracle (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous oracle (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous oracle (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): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous oracle (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Previous oracle (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. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3553/3559 current scope: delete worktrees-delete-pty-teardown.test.ts and worktrees-issue-command-overrides.test.ts entirely and remove three cases from worktrees-orphan-directory-cleanup.test.ts (6 authored/6 finite removals). Intentionally retire typed unserved-SSH create/delete admission, exact-name collision/error-token, proven-orphan no-force confirmation, standalone .git-directory refusal, and SSH-owned local-path preservation alarms. Retain only actual authorized orphan deletion and no-marker notes-file preservation; they are not equivalent replacements. The no-marker fixture resolves the default getRepos owner, so it does not prove temporary owner-repo binding. Git/Store/PTY/notifications are mocked; no physical process stop, durable metadata, real SSH delivery or native UI proof is claimed. Unchanged historical oracle, coverage, evidenceRuns and escaped receipts retain their original scopes only; no fresh execution or transferred pass validates the reduced sources. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result 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. Broad root-unit discovery loses whole cross-client workspace-sync, terminal-preview, picker-skill-hint and close-routing suites plus reduced worker-stop, remote-owned-record, scanner, mobile-bundle and daemon-health samples. Separate E2E discovery also loses the paired mobile/desktop mirror journey and two unit drivers. Retained callback/table/outer-loop/guard bytes are exact; retained checks do not replace the removed alarms. No app, native device, mixed-version, remote or cross-platform execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. 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. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. 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. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. 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. The broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. 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. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts: delivers remote file changes to listeners for the same worktree. src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Exact retired assertionRefs, preserved as historical objects only: {\n \"file\": \"src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts\",\n \"assertions\": [\n \"terminal watcher error and setup failure evict the shared entry before retrying callbacks run\",\n \"an old stream end cannot evict the replacement stream, which still delivers to its listener\",\n \"two same-worktree listeners share a synthetic subscription until the final stop unsubscribes and sends unwatch\"\n ]\n } Historical prior account (preserved verbatim): Audit1973: Delete the standalone mocked watcher cleanup suite and its entire sole-file prospective command. Retire the removed file-command transport-abort alias; preserve the independent cancellation suite and final-overflow/error/end cleanup callback, and13 unrelated receipt objects. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial runtime files-watch suite retains controlled Windows close-event waiting, shared-client survival, late physical-exit ownership/deadline cleanup and shutdown joining. Its combined Windows close/deadline/late-exit alias remains backed by unchanged callbacks. Retire native-error-close, pre-publication setup ownership and failed-delete rearm aliases; associated delegation, failure forwarding, removal routing and recovery examples are lost. These tests inject watch/subscription seams and do not observe an actual native watcher or physical process. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Partial runtime watcher-host suite loses mocked option/event/overflow/resubscription forwarding, supplied teardown-error propagation, aborted-signal/no-call and private ten-thousand-waiter-count inventories. Retire the 10,000-caller bound and failed-recovery-subscriber-ending assertion aliases. Keep same-root owner cancellation, pre-ready replacement, held root-close join, stale-generation recovery delivery and initial failed-root ownership mappings backed by retained real-host callbacks with injected subscription/error/physical-exit promises. No actual native watcher, process termination or resource bound was observed. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1683 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Fill the global watcher-child reservation, require native desktop, paired-runtime, and WSL setup to retain typed transient capacity and retry after one serialized release, then cancel pending desktop and paired-client watches and require no retry. Hold one live anchor while aborting 10,000 callers at the capacity, quarantine-assignment, runtime-root, relay-setup, and SSH-registration layers; require exactly one explicit waiter and one base-promise reaction to remain, then zero after settlement. Hold an old relay unsubscribe, queue one same-root setup leader and one anchor, then abort 10,000 joiners; require every cancellation to settle before teardown releases, exactly one anchor waiter, and only one later physical install. Advance the former paired-web callback deadline while capacity remains full, require cancellation ownership to stay live, publish the server token before ready, and require files.unwatch to abort setup before a later slot release can install a native root. Reject the first ready-watch unwatch with a physical-exit promise, resolve that exit later, and require a fresh physical unwatch attempt, registry release, and exactly one stream end. Fill one healthy shared child with multiple roots, map a standard SSH repository's base, Git common directory, and worktree roots to one relay supervisor, then inject IPC disconnect-before-exit, queued and active cancellation, operations during termination, kill-without-exit, repeated unkillable generations, initial and recovery timeouts, and shard failure. During local and SSH deletion, attempt a late terminal spawn whose worktree identity and cwd name different roots, enumerate a non-prefix remote PTY by authoritative worktree ownership, withhold daemon/relay exit callbacks, make attach positively prove a concurrent-shutdown PID dead, and make the provider unavailable; require every acquired admission to roll back on rejection, dead-PID proof to settle physical exit before reaping, timeout to retain ownership, and Git/filesystem deletion never to start. Require bounded watcher process count, physical-exit settlement, healthy-root recovery, stale-generation rejection, overflow plus later events, and fail-closed destructive cleanup. Verify relay build hashes and remote install probes require both relay.js and relay-watcher.js. Launch the built relay with a real PTY and Parcel watch, kill only the watcher child, and require the same relay PID and PTY to answer before a replacement child delivers overflow and a post-crash event.", + "oracle": "Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3788 retires10 authored/11 expanded cases across six changed drivers, including the entire screencast pending-frame-retry and usage-source-cache-streaming suites. Deliberate losses are false-refused last-frame retry/once-only delivery, ordinary stable-pane reattachment, cleared-chat Dispatch completion, terminal-declared chat-caller refusal, at-rest worker liveness projection, nested depth/cap policy, small unsigned6/sealed7 plain-format and verified-bit examples, generic malformed-ISIZE footer refusal examples, and synthetic10k/100k chunk-size/work-count budgets in gzip and general cache I/O. These include real state/disk/RPC outcomes consciously retired for marginal value; retained E2EE-backlog, receipt/custody/uncertain-ack, integrity/migration and staging-cleanup cases are not equivalent replacements. The footer test did not prove early rejection or bounded allocation; staging cleanup did not seed unrelated files. No replacement or fresh native/remote/performance execution is claimed. Earlier raw selectors and dated receipts remain historical. Audit3779 retires17 authored/17 expanded registrations across six changed drivers, including the entire shared-Codex-home and prompt-telemetry suites. Accepted losses are shared-home wrapper noninterference/opt-out preservation, mocked metric count/provenance filters, SSH activity labeling/clearing and handover idle timing, VM ownership/capability/status projections and asleep-worktree refusal, a link-only external conversation replay sample, and two narrow input-credit noninterference/expiry examples. Retain the direct exact-tab/single-use input-credit case. These bounded real disk/state/routing alarms are intentionally retired for marginal value without equivalent replacement or fresh execution claims; earlier receipts remain historical. Audit3772 retires18 authored/27 expanded cases, including whole Codex service opt-out, RPC capability-parser, creator-provenance, short-ciphertext and readiness-null suites. Accepted losses include service ledger/symlink/mode cleanup, user TOML substring preservation, old-hash cleanup, description pass-through, malformed-file/pending-hash examples, coordinator write/probe counts, capability array bounds, positive creator projections, early short-payload refusal and readiness helper null shape. Two redundant Codex exit-cause rows are also retired; Pi shares their direct-idle path only in this empty-output immediate-exit fixture, and future agent-config drift coverage is lost. Real bounded filesystem/parser/runtime alarms are deliberately retired for marginal value; no equivalent replacements or fresh execution are claimed. Earlier receipts retain their historical scope. Audits3754/3755 intentionally remove9 authored/9 finite registrations: the entire one-case usage-source-cache-streaming.test.ts driver and8 cases from the surviving computer-action-validation.test.ts driver. This gate retains an unfiltered root Vitest command; UNIT_INCLUDE admits both source paths. Accepted losses are the real encoder output chunk-size/work-count alarm on repetitive10k/100k ownership payloads through a mocked durable sink, plus CLI diagnostic precedence, fractional window-id rejection, action-call-site window-target exclusivity, plain-text click-count recovery copy, incomplete click/drag targeting, mouse/modifier/direction allowlist samples and inline/stdin text exclusivity. These CLI cases exercise real argument/handler validation before mocked runtime calls; they are deliberately retired for marginal value, not declared tautologies. Retained cache I/O and CLI cases are not equivalent replacements for these alarms. Existing historical raw receipts remain unchanged and do not validate the deleted or reduced drivers. No fresh execution claim is made. Audits3758/3763 intentionally remove9 authored/11 finite registrations from6 changed drivers, including the entire pane-title-notification, window-linear-notices and worktree-card-lifecycle-effects suites. This gate retains an unfiltered root Vitest command admitting these paths. Accepted losses are same-account linked-row success-notice fanout, sidebar-switch channel forwarding, Linear-only notification forwarding/non-terminal-consumer selection/closed-window detach, destroyed-window refusal and first-send-failure suspension through the pane-title adapter, the100-card synthetic focus/poll absence sample, stored-source local folder badge refresh, unobserved-row badge refusal, and immediate reposChanged lineage invalidation. These exercise real owners with controlled ports; they are retired for marginal value, without equivalent replacement claims. The no-badge-work fixture does not seed its title-promised collection-only cache. Preserved historical receipts do not validate deleted or reduced drivers; no fresh execution is claimed. Audit3759 retires the entire one-case Tailwind compiler/scanner smoke. Accept loss of the direct CSS production/test/spec source-exclusion and rescan alarm; no replacement or current execution is claimed. Audit3752 independently approves audit3749: retire five authored/five finite watcher-process registrations, retaining18 raw-exact registrations. Accept loss of healthy shared-pool joint recovery, last-pending-failure idle retirement/respawn, late VITEST fallback release, missing-entry fail-closed selection and independent-supervisor fuse locality alarms. These are real bounded host-policy alarms intentionally retired for low marginal value; no equivalent replacement is asserted. Remaining driver selections exercise controlled FakeChild supervisor lifecycle, cancellation, physical-exit fencing, recovery and fuse behavior. This source review supplies no fresh native/process/platform/remote/SSH execution; historical receipts retain original source and selector scopes. Previous oracle (preserved verbatim): Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered root Vitest command. Current UNIT_INCLUDE admits the partial push-service, metadata-dialog and two config/scripts browser drivers:10 authored/16 finite removals. Accepted losses: actual retry30s/60s progression and register bucket/refill wiring, explicit seven-day lease arithmetic (its notification lacked seq/epoch and never reached send), equal-name edit latch/save payload, real image/font/meta-refresh/form/popup browser refusal controls, and broad rich-markdown bridge/command/edit-select smoke. Actual production state, callback routing and browser enforcement run in these cases; these alarms are deliberately retired on marginal value. All drivers and selectors survive. Existing unrelated receipts remain historical evidence for their unchanged selectors, not proof of the reduced cases. Audit3732 removes 2 authored/3 finite registrations from two partial suites: nominal custom/Kimi local naming success and deferred context usage row presentation. Real losses: custom/Kimi successful extraction through conversation-name sanitization and agentLabel composition; separate ordered counted/deferred lists and exact percentage/token formatting. No replacement or equivalent coverage claimed. Retain 11 authored/13 finite raw-exact registrations for bounded naming instruction/refusal/cancellation, menu dismissal focus ownership and hover/composer Escape/timer cleanup. Source-only bounded value review, no runtime/CI/native/remote/mobile/folder workspace or global completion credit. Previous oracle (preserved verbatim): Audit3733 removes2authored/2finite terminal input checks: fixed custom-cap error/secret fixture and three-emoji cap5refusal whose6UTF16units already trip length fast guard (no UTF8-dependent boundary). Accept exact non-disclosure/oversized-refusal alarm losses; no replacement/equivalence claim. Retain13/13scalar/pending input, OSC state and cron DST/cadence outcomes after bounded material reads. Source-only zero runtime/novelty credit; original historical reasons preserved. Previous oracle (preserved verbatim): Audit3729 removes1authored/3finite by deleting whole CLI runtime pairing advisory-close suite. Accept losing post-real-close injected EIO preservation of native/script/unreadable pairing, env identity/preservation and exact close/release assertions; no actual failed-close leak or replacement coverage claimed. Two retained URL grammar/identity suites11authored16finite raw unchanged. Bounded source/owner/caller value review, zero novelty/runtime credit; other seven3724deferred closures remain. Historical receipts preserve original limits. Previous oracle (preserved verbatim): Audit3724 removes3authored/3finite checks by deleting two whole suites: TUI clear burst-size singleton and terminal-file-URL target two-case wrapper suite. Deliberate losses: derived widest burst<64byte alarm, UNC authority+line-column anchor composition, and malformed-percent null refusal. Real production algorithms execute in those tests; no mocked-output tautology, equivalent replacement, actual Claude/file-navigation delivery or universal safety-irrelevance claim. TUI58byte bound and URI examples have low marginal value as standalone suites. Actual1262/1264/1742KEEP superseded explicitly. Remaining14drivers83authored136finite raw unchanged. Bounded source-only review; ten closures deferred, four bounded keep judgments repeated with zero new semantic-frontier credit. No runtime/CI/native/remote/mobile/folder/global completion claim; historical receipts retain original scope. Previous oracle (preserved verbatim): Audit3723 removes 4 authored/4 finite registrations in two whole suites: keybinding cache freeze/token spellings and host-dependent Orca command name examples. Real losses include returned-object freeze, repeated Mod+P key, Space/PageDown/NumpadSubtract mapping, unknown/empty/prototype-token rejection, and headless Linux versus Windows-server/WSL command choice. No equivalent or replacement coverage claimed. Retain 12 authored/21 finite raw-exact registrations exercising generated scaffold validation, artifact failures, shipped editor/hook/worker/panel tests, actual generated typing compilation, independent CLI root routing and intent-name precedence. Source-only bounded audit; no runtime, CI, native, remote, mobile, folder workspace or global completion credit. Previous oracle (preserved verbatim): Audit3720 removes17authored/23finite checks: whole main catalog-date adapter2 and shared date-helper7, seven renderer nominal ranking/cap/no-date/composition cases, and one browser registration expanding to seven forced-container/DOM-child boundary cases. Deliberate real losses: community oldest-date UTC forwarding, official/undated omission, date sorting/window/invalid/future/skew/clamp and default/override cap; nominal ranking/cap and combined Featured/Newly-added outputs; real CSS459/460,719/720,1055/1056breakpoint, five-card partial-row and720px two-card first-row alarms. Browser cases really measure rendered geometry but force width/remove DOM children; no fake-pixel or tautology rationale. No replacement/equivalent coverage claimed. Retain14authored/19finite raw-exact registrations across4drivers: adversarial featured category/order/tie and installability, date order/window selection, actual PluginManager failure/escaping/duplicate-card suppression, real browser viewport/odd-count geometry/phone catalog visibility, syntax ingress/depth/include/printability and68dlong-bracket auto-close fill-in. No tests/browser/native/UI/provider/remote/mobile/folder/CI/global execution or completion credit. Previous oracle (preserved verbatim): Audit3717 removes6 authored/6finite checks in two whole thin-adapter/presentation suites. Deliberate real losses: ordinary recipe repository-URL withholding and provisioned-root credential scrubbing/forwarding; repository label lockstep suffix expansion, host-scoped map identity/collision grouping, Windows crosshost paths and WSL distro suffixes. Actual provision options, label/sort consumers and host/scrubber delegates inspected; no replacement/equivalence claim. Retain40 authored/84finite registrations raw exact in14 drivers with bounded owner/context review. Prior KEEP superseded for removed suites; no runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous oracle (preserved verbatim): Audit3714 removes8 authored/39finite checks: whole CLI selector-recovery, task display-text and ANSI grammar suites plus two name joiner/blank tables. Deliberate real losses: selector flag/value/identity and mutation recovery merge/serialization; exact task suffix, transcript fallback, input immutability, cache reuse and edited blocks; independent failed-escape/resumption and OSC/DCS/BEL/ST/C1/nested/unfinished stripping outputs; meaningful-language joiner preservation and invisible/blank-name rejection. These are real bounded alarms, removed as narrow supplied-error examples, helper/token inventories and repeated internal-work fixtures. Prior2936,1195/1196,1214/1215 and1082 KEEP superseded; no replacement or equivalent coverage claimed. Keep9authored/9finite raw-exact registrations in5surviving drivers: screenshot export/failure filesystem behavior, CLI local tree query, event-local reply provenance, vault role-sensitive content and four hostile/UTF16/dangling/tag-name regressions. No native/UI/provider/remote/mobile/folder/runtime/CI/global completion credit. Previous oracle (preserved verbatim): Audit3711 retires2authored/4finite cases by deleting whole clipboard-image-temp-file signature-to-name inventory (HEIC/TIFF/unrecognised bytes) and workspace-last-active switch-on supplied visit/reason singleton, plus its now-orphan test fixture. This intentionally loses real generated-filename suffix/extensionless alarms and real newer-visit archived7day versus inactive30day filtering/older-visit identity alarms. Filesystem writing and production reason pruning really execute; no equivalent replacement or universal absence of safety relevance is claimed. The clipboard test does not inspect written bytes, native delivery or decode; the visit test supplies candidate/timestamps and does not exercise persisted visit routing or actual removal.20authored/20finite cases remain unchanged across4bounded Git/sidecar/removal drivers. No new runner/test/module evaluation or runtime result; historical notes and receipts remain historical. Previous oracle (preserved verbatim): Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous oracle (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous oracle (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous oracle (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous oracle (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous oracle (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous oracle (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous oracle (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): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous oracle (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Previous oracle (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. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3553/3559 current scope: delete worktrees-delete-pty-teardown.test.ts and worktrees-issue-command-overrides.test.ts entirely and remove three cases from worktrees-orphan-directory-cleanup.test.ts (6 authored/6 finite removals). Intentionally retire typed unserved-SSH create/delete admission, exact-name collision/error-token, proven-orphan no-force confirmation, standalone .git-directory refusal, and SSH-owned local-path preservation alarms. Retain only actual authorized orphan deletion and no-marker notes-file preservation; they are not equivalent replacements. The no-marker fixture resolves the default getRepos owner, so it does not prove temporary owner-repo binding. Git/Store/PTY/notifications are mocked; no physical process stop, durable metadata, real SSH delivery or native UI proof is claimed. Unchanged historical oracle, coverage, evidenceRuns and escaped receipts retain their original scopes only; no fresh execution or transferred pass validates the reduced sources. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result 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. Broad root-unit discovery loses whole cross-client workspace-sync, terminal-preview, picker-skill-hint and close-routing suites plus reduced worker-stop, remote-owned-record, scanner, mobile-bundle and daemon-health samples. Separate E2E discovery also loses the paired mobile/desktop mirror journey and two unit drivers. Retained callback/table/outer-loop/guard bytes are exact; retained checks do not replace the removed alarms. No app, native device, mixed-version, remote or cross-platform execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. 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. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. 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. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. 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. The broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. 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. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts: delivers remote file changes to listeners for the same worktree. src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Exact retired assertionRefs, preserved as historical objects only: {\n \"file\": \"src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts\",\n \"assertions\": [\n \"terminal watcher error and setup failure evict the shared entry before retrying callbacks run\",\n \"an old stream end cannot evict the replacement stream, which still delivers to its listener\",\n \"two same-worktree listeners share a synthetic subscription until the final stop unsubscribes and sends unwatch\"\n ]\n } Historical prior account (preserved verbatim): Audit1973: Delete the standalone mocked watcher cleanup suite and its entire sole-file prospective command. Retire the removed file-command transport-abort alias; preserve the independent cancellation suite and final-overflow/error/end cleanup callback, and13 unrelated receipt objects. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial runtime files-watch suite retains controlled Windows close-event waiting, shared-client survival, late physical-exit ownership/deadline cleanup and shutdown joining. Its combined Windows close/deadline/late-exit alias remains backed by unchanged callbacks. Retire native-error-close, pre-publication setup ownership and failed-delete rearm aliases; associated delegation, failure forwarding, removal routing and recovery examples are lost. These tests inject watch/subscription seams and do not observe an actual native watcher or physical process. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Partial runtime watcher-host suite loses mocked option/event/overflow/resubscription forwarding, supplied teardown-error propagation, aborted-signal/no-call and private ten-thousand-waiter-count inventories. Retire the 10,000-caller bound and failed-recovery-subscriber-ending assertion aliases. Keep same-root owner cancellation, pre-ready replacement, held root-close join, stale-generation recovery delivery and initial failed-root ownership mappings backed by retained real-host callbacks with injected subscription/error/physical-exit promises. No actual native watcher, process termination or resource bound was observed. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1683 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Fill the global watcher-child reservation, require native desktop, paired-runtime, and WSL setup to retain typed transient capacity and retry after one serialized release, then cancel pending desktop and paired-client watches and require no retry. Hold one live anchor while aborting 10,000 callers at the capacity, quarantine-assignment, runtime-root, relay-setup, and SSH-registration layers; require exactly one explicit waiter and one base-promise reaction to remain, then zero after settlement. Hold an old relay unsubscribe, queue one same-root setup leader and one anchor, then abort 10,000 joiners; require every cancellation to settle before teardown releases, exactly one anchor waiter, and only one later physical install. Advance the former paired-web callback deadline while capacity remains full, require cancellation ownership to stay live, publish the server token before ready, and require files.unwatch to abort setup before a later slot release can install a native root. Reject the first ready-watch unwatch with a physical-exit promise, resolve that exit later, and require a fresh physical unwatch attempt, registry release, and exactly one stream end. Fill one healthy shared child with multiple roots, map a standard SSH repository's base, Git common directory, and worktree roots to one relay supervisor, then inject IPC disconnect-before-exit, queued and active cancellation, operations during termination, kill-without-exit, repeated unkillable generations, initial and recovery timeouts, and shard failure. During local and SSH deletion, attempt a late terminal spawn whose worktree identity and cwd name different roots, enumerate a non-prefix remote PTY by authoritative worktree ownership, withhold daemon/relay exit callbacks, make attach positively prove a concurrent-shutdown PID dead, and make the provider unavailable; require every acquired admission to roll back on rejection, dead-PID proof to settle physical exit before reaping, timeout to retain ownership, and Git/filesystem deletion never to start. Require bounded watcher process count, physical-exit settlement, healthy-root recovery, stale-generation rejection, overflow plus later events, and fail-closed destructive cleanup. Verify relay build hashes and remote install probes require both relay.js and relay-watcher.js. Launch the built relay with a real PTY and Parcel watch, kill only the watcher child, and require the same relay PID and PTY to answer before a replacement child delivers overflow and a post-crash event.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watcher-process/child-lifecycle/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/supervision/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/supervision/parcel-watcher-disconnect-termination.test.ts src/main/ipc/filesystem/watcher-process/event-delivery/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/workspaces/removal/watcher-removal-gate.test.ts src/main/runtime/files/watch/orca-runtime-files-watch.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/methods/files/files.test.ts src/main/runtime/rpc/methods/files/files-watch-cancellation.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/shared/promise-settlement-waiters.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess/testing/pty-subprocess.test.ts src/main/daemon/sessions/testing/session.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts --reporter=dot", - "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watcher-process/child-lifecycle/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/supervision/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/supervision/parcel-watcher-disconnect-termination.test.ts src/main/ipc/filesystem/watcher-process/event-delivery/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/workspaces/removal/watcher-removal-gate.test.ts src/main/runtime/files/watch/orca-runtime-files-watch.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/methods/files/files.test.ts src/main/runtime/rpc/methods/files/files-watch-cancellation.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess/testing/pty-subprocess.test.ts src/main/daemon/sessions/testing/session.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts --reporter=dot", - "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/supervision/parcel-watcher-disconnect-termination.test.ts src/main/ipc/filesystem/watcher-process/event-delivery/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/workspaces/removal/watcher-removal-gate.test.ts src/main/runtime/files/watch/orca-runtime-files-watch.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/methods/files/files.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/daemon/pty-subprocess/testing/pty-subprocess.test.ts src/main/daemon/sessions/testing/session.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts --reporter=dot", - "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/supervision/parcel-watcher-disconnect-termination.test.ts src/main/ipc/filesystem/watcher-process/event-delivery/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/workspaces/removal/watcher-removal-gate.test.ts src/main/runtime/files/watch/orca-runtime-files-watch.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/methods/files/files.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/daemon/pty-subprocess/testing/pty-subprocess.test.ts src/main/daemon/sessions/testing/session.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/supervision/parcel-watcher-disconnect-termination.test.ts src/main/ipc/filesystem/watcher-process/event-delivery/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/workspaces/removal/watcher-removal-gate.test.ts src/main/runtime/files/watch/orca-runtime-files-watch.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/methods/files/files.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/daemon/sessions/testing/session.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watcher-process/child-lifecycle/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/supervision/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/supervision/parcel-watcher-disconnect-termination.test.ts src/main/ipc/filesystem/watcher-process/event-delivery/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/workspaces/removal/watcher-removal-gate.test.ts src/main/runtime/files/watch/orca-runtime-files-watch.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/methods/files/files.test.ts src/main/runtime/rpc/methods/files/files-watch-cancellation.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/shared/promise-settlement-waiters.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess/testing/pty-subprocess.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watcher-process/child-lifecycle/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/supervision/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/supervision/parcel-watcher-disconnect-termination.test.ts src/main/ipc/filesystem/watcher-process/event-delivery/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/workspaces/removal/watcher-removal-gate.test.ts src/main/runtime/files/watch/orca-runtime-files-watch.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/methods/files/files.test.ts src/main/runtime/rpc/methods/files/files-watch-cancellation.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess/testing/pty-subprocess.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/supervision/parcel-watcher-disconnect-termination.test.ts src/main/ipc/filesystem/watcher-process/event-delivery/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/workspaces/removal/watcher-removal-gate.test.ts src/main/runtime/files/watch/orca-runtime-files-watch.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/methods/files/files.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/daemon/pty-subprocess/testing/pty-subprocess.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/supervision/parcel-watcher-disconnect-termination.test.ts src/main/ipc/filesystem/watcher-process/event-delivery/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/workspaces/removal/watcher-removal-gate.test.ts src/main/runtime/files/watch/orca-runtime-files-watch.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/methods/files/files.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/daemon/pty-subprocess/testing/pty-subprocess.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/supervision/parcel-watcher-disconnect-termination.test.ts src/main/ipc/filesystem/watcher-process/event-delivery/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/workspaces/removal/watcher-removal-gate.test.ts src/main/runtime/files/watch/orca-runtime-files-watch.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/methods/files/files.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/supervision/parcel-watcher-disconnect-termination.test.ts src/main/ipc/filesystem/watcher-process/event-delivery/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/workspaces/removal/watcher-removal-gate.test.ts src/main/runtime/files/watch/orca-runtime-files-watch.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/methods/files/files.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/supervision/parcel-watcher-disconnect-termination.test.ts src/main/ipc/filesystem/watcher-process/event-delivery/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/workspaces/removal/watcher-removal-gate.test.ts src/main/runtime/files/watch/orca-runtime-files-watch.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/methods/files/files.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts", "pnpm run build:electron-vite", @@ -12430,7 +12430,6 @@ "src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts", "src/main/providers/local-pty/local-pty-provider-shutdown.test.ts", "src/main/daemon/pty-subprocess/testing/pty-subprocess.test.ts", - "src/main/daemon/sessions/testing/session.test.ts", "src/main/daemon/terminal-host/testing/terminal-host.test.ts", "src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts", "src/main/runtime/files/watch/orca-runtime-files-watch.test.ts", @@ -12481,7 +12480,7 @@ "queued abort removes one request without restarting healthy roots, while active abort or crawl-scoped timeout restores the shard", "queues subscribe and unsubscribe behind the retiring child; bounds a pending crawl and restores healthy roots after setup timeout", "production runtime-pool disposal rejects later subscriptions without forking an overlapping child", - "missing built entries fail closed" + "Historical assertion retired by audit3749/3752; no current direct driver or replacement coverage is claimed. Original assertion (preserved verbatim): missing built entries fail closed" ] }, { @@ -12720,6 +12719,25 @@ "Add a packaged orca serve pairing scenario that proves a connected client refreshes after child replacement." ], "knownGaps": [ + "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.", + "Audit3814 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle from a Codex ready prompt even when stale startup lines remain :: Stale MCP startup lines must not block a later Codex ready header.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle when a stale Codex prompt is followed by the ready header :: A Codex ready header following a stale resume prompt must satisfy tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for an idle Cursor lane past its dismissed trust dialog (#8210) :: Later Cursor idle banner overrides retained trust dialog.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not block a mid-run Cursor lane on its dismissed trust dialog (#8210) :: Dismissed trust dialog must not report blocked for later busy Cursor; wait times out.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not classify unrelated press-enter prompts as Codex blocked prompts :: Unidentified press-enter text must time out rather than be classified Codex blocked.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for quiet background PTY agents without OSC titles :: Quiet Codex background terminal without OSC title eventually resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: sends agent prompts as bracketed paste before submit :: Driving prompt escapes embedded paste-end ESC, writes one framed paste then CR, and counts bytes.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: settles a foreground Codex prompt when launch metadata has not arrived :: Codex inferred from foreground without launch metadata waits for composer marker/quiescence before one CR.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: gives a late Codex render marker a fresh quiescence window :: Marker arriving at7.9s re-arms fresh quiet window instead of submitting at initial cap.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: writes large agent prompt paste frames atomically before delayed submit :: A prompt larger than input chunk budget is a single paste write before delayed CR with exact byte count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects oversized terminal.send text before provider writes :: Oversized ordinary terminal.send rejects input-too-large before any provider write.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects focusing an exited background terminal session :: focusTerminal refuses terminal_exited before invoking background reveal.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: pastes the same bytes the desktop draft paste sent for the prompt :: Launch-ready prompt normalizes CR/LF and renders embedded ESC visibly identically to desktop bracketed paste.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: keeps a prompt into a running agent behind the render settle, as before :: Driving prompt remains held through7s repaint activity then submits once by9s.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reports a queued PTY focus as not navigated when its notifier disappears :: Queued PTY focus and completed active reveal report not navigated after notifier removal; no second reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: does not invoke a stale graph-leaf focus notifier after queued PTY work :: Queued graph-leaf focus must not invoke old notifier after preceding PTY reveal and notifier removal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: paginates retained terminal output with explicit limits and truncation metadata :: Preview120lines, fractional limits,50/200 pages, retained2000line truncation and future-cursor metadata stay consistent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: falls back to renderer visible screen when uncursored TUI tail is blank :: Substantial blank uncursored tail uses mounted renderer visible screen with zero scrollback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reads and shows the runtime-owned alternate-screen grid without serialization :: Actual runtime alternate-screen grid provides read/show content without renderer/provider serialization.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: classifies older provider alternate-screen snapshots from ANSI :: Older provider without alternateScreen metadata classifies ANSI alternate entry and returns Remote Vim screen.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: honors the last ANSI screen transition when older provider metadata is absent :: Last ANSI alternate exit overrides earlier entry when explicit provider mode metadata is absent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: rejects a full provider screen frame after live output advances :: Live output arriving during second full-screen capture causes screen-unavailable rather than stale full frame.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: shares one provider snapshot between concurrent read and show calls :: Concurrent read/show share one successful provider snapshot and both receive Shared TUI content.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps cursor reads provider-free on restored alternate-screen PTYs :: Restored alternate-screen cursor transcript reads never acquire provider snapshot.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: backs off after a provider snapshot failure instead of retrying for show :: Failed provider capture is cached/backed off so later show does not retry.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: falls back once to a mounted renderer when a known alternate provider fails :: A known-alternate failed provider capture falls back exactly once to newly mounted renderer.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: bounds provider visible frames for read and show responses :: Provider visible read/show use six bounded lines and300character preview.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps renderer-fallback composer drafts separate from terminal output :: Renderer fallback strips dim composer draft from terminal output and exposes draft separately.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: does not use renderer visible-screen fallback for a short blank shell tail :: Two blank shell lines must not trigger renderer screen fallback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: trims terminal tail character budget without per-line array shifts :: Tail builder trims to256KiB with correct retained suffix and no Array.shift calls.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains ANSI-only status redraws instead of appending every frame :: Repeated erase/redraw replaces preview until newline then publishes one completed cursor row.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains split multi-line ANSI footer redraw state across chunks :: CUU state across chunks retains corrected footer rows and publishes new cursor entries.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not let stale lower rows hide earlier corrected footer rows from cursor reads :: Earlier corrected footer row must not be hidden by stale lower rows in cursor reads.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: bounds completed transcript entries from a single multi-line redraw chunk :: Single redraw chunk bounds completed transcript to2000retained lines and correct oldest/next/latest cursors.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains multi-line ANSI redraws when the last footer row stays partial :: Partial final redrawn row appears in preview but cursor sees it only after newline.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not retain split ANSI controls as visible terminal preview text :: Split color/mode escapes never leak preview fragments; long split OSC title truncates at MAX_OSC_TITLE_CHARS.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains same-line redraw cursor position across split full-line erase chunks :: Full-line erase preserves column across chunks so XY follows three spaces rather than old ABC.\nsrc/main/runtime/orca-runtime-tests/conpty-stream-read.spec.ts :: fills the requested line count even when blank rows sit below the prompt :: Blank rows below a ConPTY prompt must not consume the requested nonempty-line count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: does not retain split ST-terminated string controls as preview text :: Split ST-terminated Kitty/string controls must remain excluded from preview text.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects split OSC titles before retaining terminal previews :: Split BEL OSC title must update working title/status without leaking into preview.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects ST-terminated OSC titles split before the final backslash :: ST OSC split before final backslash must update title without leaking framing.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: preserves a trailing escape after a completed OSC title :: Completed OSC followed by pending ESC must preserve the next idle-title transition.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: seeds newly synced leaves from PTY pending ANSI state :: A newly synced graph leaf inherits pending ANSI so a split color fragment cannot leak.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: bounds retained partial terminal output before preview reads :: Partial terminal state stays capped at 4000, preserves retained array identity, and preview truncation/cursor output remains correct.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: submits the mail pointer to Cursor Agent only after the paste-burst delay :: Cursor mailbox pointer Enter must wait through the paste-burst delay; this is a real input-timing alarm intentionally retired.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts :: adopts a v1.4.150-shaped agent, setup, and shell orphan as one topology transaction :: Stale incarnation refuses without topology change; three agent/setup/shell lanes adopt atomically with layout/group/revision and preserved read/input/resize; exact replay is idempotent and competing owner refuses.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: retires the exact worker when it exits after renderer reveal :: Exact worker exit after reveal retires that worker and its surface.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: re-reveals a recovered worker after the renderer graph epoch changes :: Changed renderer graph epoch invalidates reveal receipt and forces another reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: defers recovery when the renderer omits the exact reveal identity :: Missing exact reveal identity defers recovery after two attempts.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: reconciles a same-id process replacement before headless adoption :: A process replacement before headless adoption must fence off stale ownership.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retires provider resume only after authoritative inventory proves the legacy PTY exited :: Authoritative owning-host inventory overrides false local hasPty, avoids SSH scanning, retires exited provider resume/surface, adopts live workers without headless reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retries inventory and unknown liveness without revealing a ghost worker :: Inventory failure and unknown liveness must retry without ghost reveal, eventually adopt, and stop retrying.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: refuses a live reserved pane before issuing a handle or revealing it :: A requireFreshPane launch receiving a live reserved owner must reject before handle/reveal/kill, and release its claim. No equivalent replacement claimed.", + "Audit3806 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: skips a listener unsubscribed mid-fan-out even with mobile exclusions active :: A listener removed by an earlier listener during one fanout is not called, including with a side-effect-excluded mobile listener present.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: retains bytes emitted before a fresh daemon spawn resolves :: Bytes and title arriving before an initial zero/reset provider response survive in the serialized headless buffer with their counted sequence.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits command-finished facts with best-effort exit codes across chunk splits :: A split OSC133 D exit code becomes130 and a missing code becomes null in ordered command-finished facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits pr-link facts once per URL with batch attribution :: A split GitHub PR URL yields42 rather than4, emits42/43 once each, and carries PTY/worktree/tab attribution.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits 2031-subscribe facts across chunk splits :: Split ESC[?20 then31h emits exactly one2031-subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: restores a provisional 2031 subscribe when daemon scan authority returns :: Returning daemon scan authority with partial scan seed and pending2031 subscription restores exactly one subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers the tracked title over the renderer snapshot lastTitle :: A synthetic live Cursor title overrides stale renderer lastTitle while preserving renderer snapshot source.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers provider history over a partial headless mirror for requested snapshots :: Authoritative requested snapshots return supplied provider frame/history/seq rather than a partial headless mirror, requesting5000rows.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: tracks live alternate-screen transitions after a provider snapshot :: Provider alternateScreen true is accepted, then live1049l/1049h update isTerminalAlternateScreen false/true.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: translates reset provider snapshots without retaining the old title :: A reset provider snapshot translates new local seq into the runtime domain and replaces Old process title with New process.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits the chunk agentStatus events before its side-effect batch :: Agent status callback precedes side-effect batch callback for one coalesced OSC9999/title/bell chunk.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: still emits a throwing chunk’s facts under its own seq, not the next chunk’s :: A tracker throw still flushes first chunk title facts under its own seq, and second chunk does not inherit those facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: seeds the lazily created tracker from the daemon-snapshot title :: A lazy tracker hydrated from renderer snapshot title Codex working emits agent-idle on later Codex done.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits command-code-working facts only after the banner arms the scrape :: Unarmed Thinking text emits no facts; a Command Code0.27.3 banner then hardcoded colored spinner text emits attributed command-code-working with the submitted prompt.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits a command-code-done fact when the idle composer returns :: After hardcoded banner/working text, returned idle composer emits command-code-done with the earlier submitted prompt.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: resizes the headless mirror after an accepted desktop PTY resize :: An external accepted resize produces the resized dimensions and same status-frame lines as a separately driven reference emulator.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: replaces suffix-only headless state with the recovered renderer snapshot :: Replacing suffix-only state removes old suffix, retains renderer history plus later output/cwd, and returns the live47x40PTY grid.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: stamps SSH connection identity on runtime terminal status :: A synthetic mounted-leaf OSC9999 status after registerPty carries the supplied SSH connectionId.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: does not retain WSL context when a PTY id is reused :: After exit and same-ID new null distro context, OSC7 file://server/share/repo uses UNC server path rather than old Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: preserves immutable context while a live daemon attach is unresolved :: preparePtyExecutionContext with preserveExisting refuses a supplied Debian replacement and subsequent OSC7 keeps original Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts :: projects frame-independent live state through main buffer snapshots :: Main-buffer snapshot puts focus-report/cursor-visibility modes in frameRestoreAnsi, excludes STATIC-FRAME there and includes it in data.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.ts :: continues terminal agent status fanout when a callback throws :: Throwing on the first status callback does not prevent second payload delivery and logs contextual error.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: returns a title-only replay snapshot and never historical attention :: Lose replay:true/title-only fact projection despite earlierbell and unknownPTYnull. No actual delivered-history notification or reattach behavior was exercised. No equivalent replacement claimed.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects a handle rebind while a controller-less status check yields :: A handle rebound while the null-controller status continuation yields must throw terminal_handle_stale.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects confirmation evidence when the owning PTY exits :: A pending strong confirmation resolving after owning PTY exit must reject terminal_exited.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-03.spec.ts :: keeps ordinary terminal send suffix failures on the existing not-writable contract :: Ordinary send writes text but refused CR must throw terminal_not_writable with beforeWrite twice and afterWrite once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell the execution host cannot apply instead of spawning its default :: Requested Windows shell on POSIX must refuse before spawning a default shell.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: quotes the agent startup command for the requested shell, not the host default :: Requested cmd shell must override PowerShell default quoting for agent startup command.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: keeps restored receipts outside a targeted worktree scan :: Targeted scan removes the moved-worktree receipt while preserving another worktree receipt.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: observes setup command completion without waiting for its interactive shell to exit :: Nonzero completion marker 17 resolves while interactive shell remains running.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: falls back to setup terminal exit when no completion signal is available :: Setup completion observer without token falls back to actual exit code 9.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: cancels setup completion observation when the caller aborts :: Abort rejects with the original reason and unsubscribes once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps observing after an uncertain setup terminal status :: Unknown exit waiter result must leave observation pending until completion marker arrives.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh omits a record :: Controller inventory omission disconnects the record but preserves its retained transcript.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh times out :: Hung inventory timeout leaves connected record and retained transcript intact.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle for adopted background PTY handles from the renderer title :: An adopted background handle resolves tui-idle from ready Codex renderer title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves live-leaf tui-idle from an OpenCode native title :: A live leaf resolves tui-idle from an OpenCode native title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from a Codex ready prompt preview :: A supplied Codex prompt preview resolves tui-idle without an actual agent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from an Antigravity prompt before the model line :: A supplied Antigravity prompt before model line resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell with no workspace instead of creating a default-shell tab :: Workspace-less explicit shell must reject before renderer default-tab request or spawn. This real guard/wiring alarm is deliberately retired.", + "Audit3798 per-case accepted losses:\nsrc/main/runtime/orca-runtime-tests/paired-settings.spec.ts :: awaits navigation-only updates from paired clients (%s) :: Updating only claudeSubagentNavigationEnabled waits for the actual controller call to the supplied pending Claude-view reconcile for both on/off values.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: drops a client page record even when its close command cannot be issued :: A removed workspace loses its runtime client-page record and headless browser projection despite close delivery_required rejection, and emits the asynchronous warning.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: leaves client-hosted pages alone when another host still owns the same worktree id :: Removing runtime:env-b metadata with local ownership leaves the local same-ID client page unchanged and issues no close command.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: marks live bindings again when reopening after a promoted window closes :: A reopened window marks its still-registered live worktree in activeWorktreeIdsOnShutdown after the first promoted window closes.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: preserves live SSH session identities when promoting a headless runtime :: Headless-to-desktop promotion records active worktree, SSH connection and remoteSessionIdsByTabId from the supplied surviving SSH PTY/session.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores a surviving renderer when its reload is cancelled :: A sole ready renderer reload cancelled under its current renderer fence returns true and becomes ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores headless authority when desktop promotion navigation is cancelled :: A cancelled desktop promotion with headless recovery returns false while headless authority remains ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: moves a desktop graph to unavailable when its reload times out :: A ready desktop graph without a headless fallback becomes unavailable at the reload deadline and retains its window/epoch.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: recovers a failed headless promotion and accepts a later renderer generation :: A promotion failure restores ready headless authority; a later valid same-window graph publishes ready desktop authority.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: clears a failed pane recovery so a later reconnect can retry :: After relay_reconnecting rejection, the pending recovery lock clears and the same pane/handle can call createTerminal a second time and return its supplied replacement.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: still preserves a CLI agent leaf when the reloaded renderer has not rebound its PTY :: An empty graph published during renderer reload preserves a preallocated live CLI PTY as one listable terminal before renderer rebind.\nsrc/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts :: keeps a no-incarnation handle across an in-graph pane remint :: Within one graph lifetime an unversioned PTY reminted onto another leaf retains its issued handle and resolves its old exit waiter after onPtyExit.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: matches explicit-id cwd PTYs when the resolved worktree cache is incomplete :: An explicit target absent from a fresh incomplete resolved cache adopts only its cwd PTY, rejects nested cwd PTY and does not rescan Git.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: ignores cwd-only controller PTYs for malformed explicit worktree IDs :: Malformed id:repo-1:: returns no terminals, does not adopt cwd-only controller PTY and avoids Git rescanning.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: refuses an SSH-backed create for mobile/runtime callers instead of creating locally :: Loss of this public unserved SSH create error-class/no-local-add/no-local-list alarm.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: records an app-selected parent workspace as a manual action :: Loss of the local runtime folder-parent manual origin, active-workspace source and explicit confidence projection alarm; no claim that SSH or cleanup coverage replaces it.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: browses runtime server directories before projects are added :: Loss of this public runtime alarm for browse availability before registration, directories-first lexical ordering and native path flavor.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: lists drive roots for a server-root browse :: Loss of the Windows public slash-root drive enumeration smoke and presence of the temporary directory drive.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations-part-02.spec.ts :: creates a missing runtime parent before creating the project directory :: Loss of this runtime createRepo recursive missing-parent/child existence and registered-path alarm.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: preserves selected project %s when a hosted parent is known :: Loss of both parent-selected and origin-selected normal fork-link projection/persisted upstream alarms plus exact single-probe count.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: links a current enterprise remote despite unavailable metadata and a retained %s :: Loss of normal current-enterprise-origin linking with stale automatic GitHub avatar or protected file image, unchanged icon assertion, and serialized project identity under unavailable metadata.", + "Audit3788 retires10 authored/11 expanded cases across six changed drivers, including the entire screencast pending-frame-retry and usage-source-cache-streaming suites. Deliberate losses are false-refused last-frame retry/once-only delivery, ordinary stable-pane reattachment, cleared-chat Dispatch completion, terminal-declared chat-caller refusal, at-rest worker liveness projection, nested depth/cap policy, small unsigned6/sealed7 plain-format and verified-bit examples, generic malformed-ISIZE footer refusal examples, and synthetic10k/100k chunk-size/work-count budgets in gzip and general cache I/O. These include real state/disk/RPC outcomes consciously retired for marginal value; retained E2EE-backlog, receipt/custody/uncertain-ack, integrity/migration and staging-cleanup cases are not equivalent replacements. The footer test did not prove early rejection or bounded allocation; staging cleanup did not seed unrelated files. No replacement or fresh native/remote/performance execution is claimed. Earlier raw selectors and dated receipts remain historical.", + "Audit3779 retires17 authored/17 expanded registrations across six changed drivers, including the entire shared-Codex-home and prompt-telemetry suites. Accepted losses are shared-home wrapper noninterference/opt-out preservation, mocked metric count/provenance filters, SSH activity labeling/clearing and handover idle timing, VM ownership/capability/status projections and asleep-worktree refusal, a link-only external conversation replay sample, and two narrow input-credit noninterference/expiry examples. Retain the direct exact-tab/single-use input-credit case. These bounded real disk/state/routing alarms are intentionally retired for marginal value without equivalent replacement or fresh execution claims; earlier receipts remain historical.", + "Audit3772 retires18 authored/27 expanded cases, including whole Codex service opt-out, RPC capability-parser, creator-provenance, short-ciphertext and readiness-null suites. Accepted losses include service ledger/symlink/mode cleanup, user TOML substring preservation, old-hash cleanup, description pass-through, malformed-file/pending-hash examples, coordinator write/probe counts, capability array bounds, positive creator projections, early short-payload refusal and readiness helper null shape. Two redundant Codex exit-cause rows are also retired; Pi shares their direct-idle path only in this empty-output immediate-exit fixture, and future agent-config drift coverage is lost. Real bounded filesystem/parser/runtime alarms are deliberately retired for marginal value; no equivalent replacements or fresh execution are claimed. Earlier receipts retain their historical scope.", + "Audits3754/3755 intentionally remove9 authored/9 finite registrations: the entire one-case usage-source-cache-streaming.test.ts driver and8 cases from the surviving computer-action-validation.test.ts driver. This gate retains an unfiltered root Vitest command; UNIT_INCLUDE admits both source paths. Accepted losses are the real encoder output chunk-size/work-count alarm on repetitive10k/100k ownership payloads through a mocked durable sink, plus CLI diagnostic precedence, fractional window-id rejection, action-call-site window-target exclusivity, plain-text click-count recovery copy, incomplete click/drag targeting, mouse/modifier/direction allowlist samples and inline/stdin text exclusivity. These CLI cases exercise real argument/handler validation before mocked runtime calls; they are deliberately retired for marginal value, not declared tautologies. Retained cache I/O and CLI cases are not equivalent replacements for these alarms. Existing historical raw receipts remain unchanged and do not validate the deleted or reduced drivers. No fresh execution claim is made. Audits3758/3763 intentionally remove9 authored/11 finite registrations from6 changed drivers, including the entire pane-title-notification, window-linear-notices and worktree-card-lifecycle-effects suites. This gate retains an unfiltered root Vitest command admitting these paths. Accepted losses are same-account linked-row success-notice fanout, sidebar-switch channel forwarding, Linear-only notification forwarding/non-terminal-consumer selection/closed-window detach, destroyed-window refusal and first-send-failure suspension through the pane-title adapter, the100-card synthetic focus/poll absence sample, stored-source local folder badge refresh, unobserved-row badge refusal, and immediate reposChanged lineage invalidation. These exercise real owners with controlled ports; they are retired for marginal value, without equivalent replacement claims. The no-badge-work fixture does not seed its title-promised collection-only cache. Preserved historical receipts do not validate deleted or reduced drivers; no fresh execution is claimed. Audit3759 retires the entire one-case Tailwind compiler/scanner smoke. Accept loss of the direct CSS production/test/spec source-exclusion and rescan alarm; no replacement or current execution is claimed.", + "Audit3752 independently approves audit3749: retire five authored/five finite watcher-process registrations, retaining18 raw-exact registrations. Accept loss of healthy shared-pool joint recovery, last-pending-failure idle retirement/respawn, late VITEST fallback release, missing-entry fail-closed selection and independent-supervisor fuse locality alarms. These are real bounded host-policy alarms intentionally retired for low marginal value; no equivalent replacement is asserted. Remaining driver selections exercise controlled FakeChild supervisor lifecycle, cancellation, physical-exit fencing, recovery and fuse behavior. This source review supplies no fresh native/process/platform/remote/SSH execution; historical receipts retain original source and selector scopes.", + "Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered root Vitest command. Current UNIT_INCLUDE admits the partial push-service, metadata-dialog and two config/scripts browser drivers:10 authored/16 finite removals. Accepted losses: actual retry30s/60s progression and register bucket/refill wiring, explicit seven-day lease arithmetic (its notification lacked seq/epoch and never reached send), equal-name edit latch/save payload, real image/font/meta-refresh/form/popup browser refusal controls, and broad rich-markdown bridge/command/edit-select smoke. Actual production state, callback routing and browser enforcement run in these cases; these alarms are deliberately retired on marginal value. All drivers and selectors survive. Existing unrelated receipts remain historical evidence for their unchanged selectors, not proof of the reduced cases.", + "Audit3732 removes 2 authored/3 finite registrations from two partial suites: nominal custom/Kimi local naming success and deferred context usage row presentation. Real losses: custom/Kimi successful extraction through conversation-name sanitization and agentLabel composition; separate ordered counted/deferred lists and exact percentage/token formatting. No replacement or equivalent coverage claimed. Retain 11 authored/13 finite raw-exact registrations for bounded naming instruction/refusal/cancellation, menu dismissal focus ownership and hover/composer Escape/timer cleanup. Source-only bounded value review, no runtime/CI/native/remote/mobile/folder workspace or global completion credit.", + "Audit3733 removes2authored/2finite terminal input checks: fixed custom-cap error/secret fixture and three-emoji cap5refusal whose6UTF16units already trip length fast guard (no UTF8-dependent boundary). Accept exact non-disclosure/oversized-refusal alarm losses; no replacement/equivalence claim. Retain13/13scalar/pending input, OSC state and cron DST/cadence outcomes after bounded material reads. Source-only zero runtime/novelty credit; original historical reasons preserved.", + "Audit3729 removes1authored/3finite by deleting whole CLI runtime pairing advisory-close suite. Accept losing post-real-close injected EIO preservation of native/script/unreadable pairing, env identity/preservation and exact close/release assertions; no actual failed-close leak or replacement coverage claimed. Two retained URL grammar/identity suites11authored16finite raw unchanged. Bounded source/owner/caller value review, zero novelty/runtime credit; other seven3724deferred closures remain. Historical receipts preserve original limits.", + "Audit3724 removes3authored/3finite checks by deleting two whole suites: TUI clear burst-size singleton and terminal-file-URL target two-case wrapper suite. Deliberate losses: derived widest burst<64byte alarm, UNC authority+line-column anchor composition, and malformed-percent null refusal. Real production algorithms execute in those tests; no mocked-output tautology, equivalent replacement, actual Claude/file-navigation delivery or universal safety-irrelevance claim. TUI58byte bound and URI examples have low marginal value as standalone suites. Actual1262/1264/1742KEEP superseded explicitly. Remaining14drivers83authored136finite raw unchanged. Bounded source-only review; ten closures deferred, four bounded keep judgments repeated with zero new semantic-frontier credit. No runtime/CI/native/remote/mobile/folder/global completion claim; historical receipts retain original scope.", + "Audit3723 removes 4 authored/4 finite registrations in two whole suites: keybinding cache freeze/token spellings and host-dependent Orca command name examples. Real losses include returned-object freeze, repeated Mod+P key, Space/PageDown/NumpadSubtract mapping, unknown/empty/prototype-token rejection, and headless Linux versus Windows-server/WSL command choice. No equivalent or replacement coverage claimed. Retain 12 authored/21 finite raw-exact registrations exercising generated scaffold validation, artifact failures, shipped editor/hook/worker/panel tests, actual generated typing compilation, independent CLI root routing and intent-name precedence. Source-only bounded audit; no runtime, CI, native, remote, mobile, folder workspace or global completion credit.", + "Audit3720 removes17authored/23finite checks: whole main catalog-date adapter2 and shared date-helper7, seven renderer nominal ranking/cap/no-date/composition cases, and one browser registration expanding to seven forced-container/DOM-child boundary cases. Deliberate real losses: community oldest-date UTC forwarding, official/undated omission, date sorting/window/invalid/future/skew/clamp and default/override cap; nominal ranking/cap and combined Featured/Newly-added outputs; real CSS459/460,719/720,1055/1056breakpoint, five-card partial-row and720px two-card first-row alarms. Browser cases really measure rendered geometry but force width/remove DOM children; no fake-pixel or tautology rationale. No replacement/equivalent coverage claimed. Retain14authored/19finite raw-exact registrations across4drivers: adversarial featured category/order/tie and installability, date order/window selection, actual PluginManager failure/escaping/duplicate-card suppression, real browser viewport/odd-count geometry/phone catalog visibility, syntax ingress/depth/include/printability and68dlong-bracket auto-close fill-in. No tests/browser/native/UI/provider/remote/mobile/folder/CI/global execution or completion credit.", + "Audit3717 removes6 authored/6finite checks in two whole thin-adapter/presentation suites. Deliberate real losses: ordinary recipe repository-URL withholding and provisioned-root credential scrubbing/forwarding; repository label lockstep suffix expansion, host-scoped map identity/collision grouping, Windows crosshost paths and WSL distro suffixes. Actual provision options, label/sort consumers and host/scrubber delegates inspected; no replacement/equivalence claim. Retain40 authored/84finite registrations raw exact in14 drivers with bounded owner/context review. Prior KEEP superseded for removed suites; no runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit.", + "Audit3714 removes8 authored/39finite checks: whole CLI selector-recovery, task display-text and ANSI grammar suites plus two name joiner/blank tables. Deliberate real losses: selector flag/value/identity and mutation recovery merge/serialization; exact task suffix, transcript fallback, input immutability, cache reuse and edited blocks; independent failed-escape/resumption and OSC/DCS/BEL/ST/C1/nested/unfinished stripping outputs; meaningful-language joiner preservation and invisible/blank-name rejection. These are real bounded alarms, removed as narrow supplied-error examples, helper/token inventories and repeated internal-work fixtures. Prior2936,1195/1196,1214/1215 and1082 KEEP superseded; no replacement or equivalent coverage claimed. Keep9authored/9finite raw-exact registrations in5surviving drivers: screenshot export/failure filesystem behavior, CLI local tree query, event-local reply provenance, vault role-sensitive content and four hostile/UTF16/dangling/tag-name regressions. No native/UI/provider/remote/mobile/folder/runtime/CI/global completion credit.", + "Audit3711 retires2authored/4finite cases by deleting whole clipboard-image-temp-file signature-to-name inventory (HEIC/TIFF/unrecognised bytes) and workspace-last-active switch-on supplied visit/reason singleton, plus its now-orphan test fixture. This intentionally loses real generated-filename suffix/extensionless alarms and real newer-visit archived7day versus inactive30day filtering/older-visit identity alarms. Filesystem writing and production reason pruning really execute; no equivalent replacement or universal absence of safety relevance is claimed. The clipboard test does not inspect written bytes, native delivery or decode; the visit test supplies candidate/timestamps and does not exercise persisted visit routing or actual removal.20authored/20finite cases remain unchanged across4bounded Git/sidecar/removal drivers. No new runner/test/module evaluation or runtime result; historical notes and receipts remain historical.", "Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit.", "Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained.", "Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit.", @@ -12866,7 +12884,8 @@ "Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope.", "Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope.", "Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope.", - "Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed." + "Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage 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." ], "demotionRule": "Demote or quarantine if the fault harness flakes without a product or harness bug, if healthy operation exceeds one runtime watcher child, if total physical operation exceeds eight children including retiring generations, if quarantine children outlive their roots or repeat after fusing, if event delivery becomes unbounded, or if metadata/stat work returns to the serve process." }, @@ -13162,26 +13181,14 @@ "shellcheck config/docker/headless-serve-shutdown/run-signal-case.sh", "shellcheck config/docker/headless-serve-shutdown/run-appimage-desktop-startup-case.sh", "node config/scripts/runtime-verification/daemon-lifecycle/run-headless-serve-shutdown-docker.mjs --appimage dist/orca-linux.AppImage", - "node config/scripts/runtime-verification/daemon-lifecycle/run-headless-serve-shutdown-docker.mjs --appimage dist/orca-linux.AppImage --platform linux/amd64", - "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/main/startup/ensure-virtual-display.test.ts --maxWorkers=2 --reporter=dot" + "node config/scripts/runtime-verification/daemon-lifecycle/run-headless-serve-shutdown-docker.mjs --appimage dist/orca-linux.AppImage --platform linux/amd64" ], "testFiles": [ - "src/main/startup/ensure-virtual-display.test.ts", "config/scripts/runtime-verification/daemon-lifecycle/run-headless-serve-shutdown-docker.mjs", "config/docker/headless-serve-shutdown/run-signal-case.sh", "config/docker/headless-serve-shutdown/run-appimage-desktop-startup-case.sh" ], "assertionRefs": [ - { - "file": "src/main/startup/ensure-virtual-display.test.ts", - "assertions": [ - "owned Xvfb starts with terminate-after-last-client semantics", - "owned Xvfb uses an independent process group so terminal Ctrl-C cannot preempt Electron teardown", - "owned Xvfb retains an early-process-exit guard until Electron is ready", - "owned Xvfb is not stopped from Electron's cancelable will-quit event", - "external displays and non-Linux startup remain untouched" - ] - }, { "file": "config/scripts/runtime-verification/daemon-lifecycle/run-headless-serve-shutdown-docker.mjs", "assertions": [ @@ -13254,6 +13261,7 @@ "Keep exact listener, Xvfb, descendant, fatal-evidence, and canary identity assertions green." ], "knownGaps": [ + "The portable startup unit suite was removed after a source value audit; its mocked display admission, ownership, bind-race and protocol-selection alarms were deliberately dropped. Recorded unit runs are historical evidence only. The retained packaged signal journey does not replace those unit alarms.", "The local arm64 Docker host uses Rosetta for amd64 containers; native amd64 PR CI supplies the non-emulated repeat of the same extracted-AppRun PID contract.", "Ubuntu 20.04 is covered by the packaged native-binary glibc floor gate; this lifecycle journey runs on the reported Ubuntu 26.04 topology.", "Systemd units that override or omit the documented KillMode=mixed policy can still terminate owned Xvfb before Electron disconnects.", @@ -13278,13 +13286,13 @@ "providers": ["local-daemon"], "coveredPlatforms": ["linux"], "coveredProviders": ["local-daemon"], - "coverageNotes": "A restricted Ubuntu container stages the extracted AppImage payload with no /dev/fuse and with unprivileged user namespaces denied, then runs eight CLI cases across the bundled launcher and the extracted direct binary. x64 only, because PR CI builds only --x64.", + "coverageNotes": "Audit3930: The two dated evidenceRuns remain verbatim historical records for their original eight-case source. They are not fresh execution of the reduced three-case selector and do not validate all current output oracles: the original red/green account notes that earlier skills passes predated the stronger own-output matcher. Audit3925: Reduce eight hostile CLI examples to three: bundled status with no runtime, direct-binary skills text dispatch, and stale-display GUI diagnosis. Remove extra bundled help/version/skills/worktree and absent-display GUI examples; accept loss of packaged version equality and their exact output alarms without equivalent replacement. The reduced selector has no fresh execution evidence. Historical prior account (preserved verbatim): A restricted Ubuntu container stages the extracted AppImage payload with no /dev/fuse and with unprivileged user namespaces denied, then runs eight CLI cases across the bundled launcher and the extracted direct binary. x64 only, because PR CI builds only --x64.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/13719", "https://github.com/stablyai/orca/issues/14229" ], "invariant": "On a host without FUSE and without unprivileged user namespaces, every packaged CLI entrypoint either completes its command or reports a diagnosis, and never terminates on a signal.", - "oracle": "Build the image, stage the AppImage payload, and run each case in the restricted container. Assert the preconditions first: unshare -Ur must fail and /dev/fuse must be absent, so a relaxed runner fails the job rather than silently skipping. For each case require the exact expected exit status and an expected substring of the command's own output, with the harness RESULT/CRASHED/PRECONDITION_FAILED control lines excluded so a case name can never satisfy its own assertion. Any status of 128 or above is a crash and fails immediately. The per-case timeout is a failure deadline, never a success condition.", + "oracle": "Audit3925: Reduce eight hostile CLI examples to three: bundled status with no runtime, direct-binary skills text dispatch, and stale-display GUI diagnosis. Remove extra bundled help/version/skills/worktree and absent-display GUI examples; accept loss of packaged version equality and their exact output alarms without equivalent replacement. The reduced selector has no fresh execution evidence. Historical prior account (preserved verbatim): Build the image, stage the AppImage payload, and run each case in the restricted container. Assert the preconditions first: unshare -Ur must fail and /dev/fuse must be absent, so a relaxed runner fails the job rather than silently skipping. For each case require the exact expected exit status and an expected substring of the command's own output, with the harness RESULT/CRASHED/PRECONDITION_FAILED control lines excluded so a case name can never satisfy its own assertion. Any status of 128 or above is a crash and fails immediately. The per-case timeout is a failure deadline, never a success condition.", "commands": [ "node config/scripts/runtime-verification/desktop-transport/run-linux-cli-launch-contract-docker.mjs --appimage dist/orca-linux.AppImage", "shellcheck config/docker/cli-launch-contract/run-cli-case.sh" @@ -13297,9 +13305,8 @@ { "file": "config/scripts/runtime-verification/desktop-transport/run-linux-cli-launch-contract-docker.mjs", "assertions": [ - "the bundled launcher serves --help, --version, status, skills --help, and worktree list without Chromium", + "the bundled launcher reports status with no runtime without Chromium", "a direct binary launch reaching JavaScript runs the command instead of booting a GUI", - "a desktop launch with no display reports the missing-display diagnosis instead of trapping", "a stale DISPLAY is diagnosed rather than trusted", "expected output is matched against the command's own output, not the harness control lines" ] @@ -13336,15 +13343,15 @@ ], "runtimeBudget": { "p95Seconds": 300, - "scope": "eight CLI launch cases in one restricted Ubuntu container" + "scope": "three CLI launch cases in separate restricted Ubuntu containers" }, "flakeHistory": { "status": "not-started", - "evidence": "The harness is new; soak history is not yet available." + "evidence": "Audit3925: Historical prior-source evidence only; reduced selector has no fresh execution evidence. The harness is new; soak history is not yet available." }, "redGreenEvidence": { "status": "complete", - "evidence": "The same harness run against a stock release AppImage failed four of eight cases: nofuse-userns-bundled-version at status 93, and all three direct-binary cases crashed at status 133 (SIGTRAP, the uv_close abort of #13719 and #14229). The stack-tip AppImage passed all eight. Corroborated at artifact level: the stack-tip runtime is a static-pie ELF with no PT_INTERP, the stock runtime is dynamically linked. Caveat: the two skills cases previously asserted a substring that the harness's own RESULT line contained, so they passed independently of command output; both now assert the rendered help header, and the green runs above predate that change." + "evidence": "Audit3925: Historical prior-source evidence only; reduced selector has no fresh execution evidence. The same harness run against a stock release AppImage failed four of eight cases: nofuse-userns-bundled-version at status 93, and all three direct-binary cases crashed at status 133 (SIGTRAP, the uv_close abort of #13719 and #14229). The stack-tip AppImage passed all eight. Corroborated at artifact level: the stack-tip runtime is a static-pie ELF with no PT_INTERP, the stock runtime is dynamically linked. Caveat: the two skills cases previously asserted a substring that the harness's own RESULT line contained, so they passed independently of command output; both now assert the rendered help header, and the green runs above predate that change." }, "performanceBudget": { "required": false, @@ -13356,6 +13363,7 @@ "Re-run red/green against a stock AppImage after any change to the launcher entrypoint." ], "knownGaps": [ + "Audit3925: Reduce eight hostile CLI examples to three: bundled status with no runtime, direct-binary skills text dispatch, and stale-display GUI diagnosis. Remove extra bundled help/version/skills/worktree and absent-display GUI examples; accept loss of packaged version equality and their exact output alarms without equivalent replacement. The reduced selector has no fresh execution evidence. Original dated receipt objects are preserved in evidenceRuns as historical records only; no fresh native or reduced-selector validation is claimed. Skills matcher limitations remain in redGreenEvidence.", "The preconditions depend on moby's default seccomp profile denying unshare(CLONE_NEWUSER) and on /dev/fuse being absent. A runner with a relaxed profile or a mounted /dev/fuse trips PRECONDITION_FAILED and fails the job rather than skipping.", "x64 only: PR CI builds only --x64, so the arm64 launcher path is unexercised.", "The harness covers CLI entrypoints only; it does not exercise a full desktop session." @@ -14104,10 +14112,10 @@ "providers": ["paired-runtime"], "coveredPlatforms": ["linux"], "coveredProviders": ["paired-runtime"], - "coverageNotes": "Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous account (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous account (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous account (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous account (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous account (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous 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): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous account (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Independently remove one authored/finite Playwright closed-gate app-boot inventory: accept loss of real renderer/preload/main refusal composition, saved-host row and Add/Move hiding/Remove visibility alarms. Keep the unchanged scripted-move rendered dialog lifecycle/reload case. It runs no real WSL migration, host connection, file copy or automation restoration. No selector or Playwright participation cleanup is required because the spec remains. Previous 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. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. 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. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. 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. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. 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 broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. 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. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit1579 removes workflow/manifest/regex/private binary-header and diagnostic metric inventories, fixture selectors, injected forwarding/platform/signature/process examples, unproven overlap and internal churn counters without equivalent replacement coverage. Retains actual Git trust/diffs; filesystem hash/ELF-region/native discovery; child CLI module repair; compiler/lock/publication/rollback and synthetic Electron install/cache ownership; executable shell quoting/exit; controlled notary/timer cleanup; local patched extractor file/AST freshness; real Chromium/WebKit CSP/sandbox/HTTPS image/referrer/link/preservation controls under parsed Android headers. Five unchanged setup-pnpm/VM request-cleanup definitions reviewed and not rerun. GitHub, installer/archive, OS metric, client, native delegate, compressor, builder and Apple boundaries injected or absent where recorded. No actual native PTY, shipped full/native app, real Actions/cache/npm signature authority, downloaded Electron archive, real objdump/linker/native CLI/AppImage, signing/NSIS/notary/upload/updater or live freeze proof. Historical scope before this audit: Published Linux 1.4.188 desktop against current source in both directions; scheduled weekly and manually runnable. No required PR check.", + "coverageNotes": "Audit3788 retires10 authored/11 expanded cases across six changed drivers, including the entire screencast pending-frame-retry and usage-source-cache-streaming suites. Deliberate losses are false-refused last-frame retry/once-only delivery, ordinary stable-pane reattachment, cleared-chat Dispatch completion, terminal-declared chat-caller refusal, at-rest worker liveness projection, nested depth/cap policy, small unsigned6/sealed7 plain-format and verified-bit examples, generic malformed-ISIZE footer refusal examples, and synthetic10k/100k chunk-size/work-count budgets in gzip and general cache I/O. These include real state/disk/RPC outcomes consciously retired for marginal value; retained E2EE-backlog, receipt/custody/uncertain-ack, integrity/migration and staging-cleanup cases are not equivalent replacements. The footer test did not prove early rejection or bounded allocation; staging cleanup did not seed unrelated files. No replacement or fresh native/remote/performance execution is claimed. Earlier raw selectors and dated receipts remain historical. Audit3779 retires17 authored/17 expanded registrations across six changed drivers, including the entire shared-Codex-home and prompt-telemetry suites. Accepted losses are shared-home wrapper noninterference/opt-out preservation, mocked metric count/provenance filters, SSH activity labeling/clearing and handover idle timing, VM ownership/capability/status projections and asleep-worktree refusal, a link-only external conversation replay sample, and two narrow input-credit noninterference/expiry examples. Retain the direct exact-tab/single-use input-credit case. These bounded real disk/state/routing alarms are intentionally retired for marginal value without equivalent replacement or fresh execution claims; earlier receipts remain historical. Audit3772 retires18 authored/27 expanded cases, including whole Codex service opt-out, RPC capability-parser, creator-provenance, short-ciphertext and readiness-null suites. Accepted losses include service ledger/symlink/mode cleanup, user TOML substring preservation, old-hash cleanup, description pass-through, malformed-file/pending-hash examples, coordinator write/probe counts, capability array bounds, positive creator projections, early short-payload refusal and readiness helper null shape. Two redundant Codex exit-cause rows are also retired; Pi shares their direct-idle path only in this empty-output immediate-exit fixture, and future agent-config drift coverage is lost. Real bounded filesystem/parser/runtime alarms are deliberately retired for marginal value; no equivalent replacements or fresh execution are claimed. Earlier receipts retain their historical scope. Audits3754/3755 intentionally remove9 authored/9 finite registrations: the entire one-case usage-source-cache-streaming.test.ts driver and8 cases from the surviving computer-action-validation.test.ts driver. This gate retains an unfiltered root Vitest command; UNIT_INCLUDE admits both source paths. Accepted losses are the real encoder output chunk-size/work-count alarm on repetitive10k/100k ownership payloads through a mocked durable sink, plus CLI diagnostic precedence, fractional window-id rejection, action-call-site window-target exclusivity, plain-text click-count recovery copy, incomplete click/drag targeting, mouse/modifier/direction allowlist samples and inline/stdin text exclusivity. These CLI cases exercise real argument/handler validation before mocked runtime calls; they are deliberately retired for marginal value, not declared tautologies. Retained cache I/O and CLI cases are not equivalent replacements for these alarms. Existing historical raw receipts remain unchanged and do not validate the deleted or reduced drivers. No fresh execution claim is made. Audits3758/3763 intentionally remove9 authored/11 finite registrations from6 changed drivers, including the entire pane-title-notification, window-linear-notices and worktree-card-lifecycle-effects suites. This gate retains an unfiltered root Vitest command admitting these paths. Accepted losses are same-account linked-row success-notice fanout, sidebar-switch channel forwarding, Linear-only notification forwarding/non-terminal-consumer selection/closed-window detach, destroyed-window refusal and first-send-failure suspension through the pane-title adapter, the100-card synthetic focus/poll absence sample, stored-source local folder badge refresh, unobserved-row badge refusal, and immediate reposChanged lineage invalidation. These exercise real owners with controlled ports; they are retired for marginal value, without equivalent replacement claims. The no-badge-work fixture does not seed its title-promised collection-only cache. Preserved historical receipts do not validate deleted or reduced drivers; no fresh execution is claimed. Audit3759 retires the entire one-case Tailwind compiler/scanner smoke. Accept loss of the direct CSS production/test/spec source-exclusion and rescan alarm; no replacement or current execution is claimed. Audit3752 independently approves audit3749: retire five authored/five finite watcher-process registrations, retaining18 raw-exact registrations. Accept loss of healthy shared-pool joint recovery, last-pending-failure idle retirement/respawn, late VITEST fallback release, missing-entry fail-closed selection and independent-supervisor fuse locality alarms. These are real bounded host-policy alarms intentionally retired for low marginal value; no equivalent replacement is asserted. Remaining driver selections exercise controlled FakeChild supervisor lifecycle, cancellation, physical-exit fencing, recovery and fuse behavior. This source review supplies no fresh native/process/platform/remote/SSH execution; historical receipts retain original source and selector scopes. Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered root Vitest command. Current UNIT_INCLUDE admits the partial push-service, metadata-dialog and two config/scripts browser drivers:10 authored/16 finite removals. Accepted losses: actual retry30s/60s progression and register bucket/refill wiring, explicit seven-day lease arithmetic (its notification lacked seq/epoch and never reached send), equal-name edit latch/save payload, real image/font/meta-refresh/form/popup browser refusal controls, and broad rich-markdown bridge/command/edit-select smoke. Actual production state, callback routing and browser enforcement run in these cases; these alarms are deliberately retired on marginal value. All drivers and selectors survive. Existing unrelated receipts remain historical evidence for their unchanged selectors, not proof of the reduced cases. Audit3732 removes 2 authored/3 finite registrations from two partial suites: nominal custom/Kimi local naming success and deferred context usage row presentation. Real losses: custom/Kimi successful extraction through conversation-name sanitization and agentLabel composition; separate ordered counted/deferred lists and exact percentage/token formatting. No replacement or equivalent coverage claimed. Retain 11 authored/13 finite raw-exact registrations for bounded naming instruction/refusal/cancellation, menu dismissal focus ownership and hover/composer Escape/timer cleanup. Source-only bounded value review, no runtime/CI/native/remote/mobile/folder workspace or global completion credit. Previous account (preserved verbatim): Audit3733 removes2authored/2finite terminal input checks: fixed custom-cap error/secret fixture and three-emoji cap5refusal whose6UTF16units already trip length fast guard (no UTF8-dependent boundary). Accept exact non-disclosure/oversized-refusal alarm losses; no replacement/equivalence claim. Retain13/13scalar/pending input, OSC state and cron DST/cadence outcomes after bounded material reads. Source-only zero runtime/novelty credit; original historical reasons preserved. Previous account (preserved verbatim): Audit3729 removes1authored/3finite by deleting whole CLI runtime pairing advisory-close suite. Accept losing post-real-close injected EIO preservation of native/script/unreadable pairing, env identity/preservation and exact close/release assertions; no actual failed-close leak or replacement coverage claimed. Two retained URL grammar/identity suites11authored16finite raw unchanged. Bounded source/owner/caller value review, zero novelty/runtime credit; other seven3724deferred closures remain. Historical receipts preserve original limits. Previous account (preserved verbatim): Audit3724 removes3authored/3finite checks by deleting two whole suites: TUI clear burst-size singleton and terminal-file-URL target two-case wrapper suite. Deliberate losses: derived widest burst<64byte alarm, UNC authority+line-column anchor composition, and malformed-percent null refusal. Real production algorithms execute in those tests; no mocked-output tautology, equivalent replacement, actual Claude/file-navigation delivery or universal safety-irrelevance claim. TUI58byte bound and URI examples have low marginal value as standalone suites. Actual1262/1264/1742KEEP superseded explicitly. Remaining14drivers83authored136finite raw unchanged. Bounded source-only review; ten closures deferred, four bounded keep judgments repeated with zero new semantic-frontier credit. No runtime/CI/native/remote/mobile/folder/global completion claim; historical receipts retain original scope. Previous account (preserved verbatim): Audit3723 removes 4 authored/4 finite registrations in two whole suites: keybinding cache freeze/token spellings and host-dependent Orca command name examples. Real losses include returned-object freeze, repeated Mod+P key, Space/PageDown/NumpadSubtract mapping, unknown/empty/prototype-token rejection, and headless Linux versus Windows-server/WSL command choice. No equivalent or replacement coverage claimed. Retain 12 authored/21 finite raw-exact registrations exercising generated scaffold validation, artifact failures, shipped editor/hook/worker/panel tests, actual generated typing compilation, independent CLI root routing and intent-name precedence. Source-only bounded audit; no runtime, CI, native, remote, mobile, folder workspace or global completion credit. Previous account (preserved verbatim): Audit3720 removes17authored/23finite checks: whole main catalog-date adapter2 and shared date-helper7, seven renderer nominal ranking/cap/no-date/composition cases, and one browser registration expanding to seven forced-container/DOM-child boundary cases. Deliberate real losses: community oldest-date UTC forwarding, official/undated omission, date sorting/window/invalid/future/skew/clamp and default/override cap; nominal ranking/cap and combined Featured/Newly-added outputs; real CSS459/460,719/720,1055/1056breakpoint, five-card partial-row and720px two-card first-row alarms. Browser cases really measure rendered geometry but force width/remove DOM children; no fake-pixel or tautology rationale. No replacement/equivalent coverage claimed. Retain14authored/19finite raw-exact registrations across4drivers: adversarial featured category/order/tie and installability, date order/window selection, actual PluginManager failure/escaping/duplicate-card suppression, real browser viewport/odd-count geometry/phone catalog visibility, syntax ingress/depth/include/printability and68dlong-bracket auto-close fill-in. No tests/browser/native/UI/provider/remote/mobile/folder/CI/global execution or completion credit. Previous account (preserved verbatim): Audit3717 removes6 authored/6finite checks in two whole thin-adapter/presentation suites. Deliberate real losses: ordinary recipe repository-URL withholding and provisioned-root credential scrubbing/forwarding; repository label lockstep suffix expansion, host-scoped map identity/collision grouping, Windows crosshost paths and WSL distro suffixes. Actual provision options, label/sort consumers and host/scrubber delegates inspected; no replacement/equivalence claim. Retain40 authored/84finite registrations raw exact in14 drivers with bounded owner/context review. Prior KEEP superseded for removed suites; no runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3714 removes8 authored/39finite checks: whole CLI selector-recovery, task display-text and ANSI grammar suites plus two name joiner/blank tables. Deliberate real losses: selector flag/value/identity and mutation recovery merge/serialization; exact task suffix, transcript fallback, input immutability, cache reuse and edited blocks; independent failed-escape/resumption and OSC/DCS/BEL/ST/C1/nested/unfinished stripping outputs; meaningful-language joiner preservation and invisible/blank-name rejection. These are real bounded alarms, removed as narrow supplied-error examples, helper/token inventories and repeated internal-work fixtures. Prior2936,1195/1196,1214/1215 and1082 KEEP superseded; no replacement or equivalent coverage claimed. Keep9authored/9finite raw-exact registrations in5surviving drivers: screenshot export/failure filesystem behavior, CLI local tree query, event-local reply provenance, vault role-sensitive content and four hostile/UTF16/dangling/tag-name regressions. No native/UI/provider/remote/mobile/folder/runtime/CI/global completion credit. Previous account (preserved verbatim): Audit3711 retires2authored/4finite cases by deleting whole clipboard-image-temp-file signature-to-name inventory (HEIC/TIFF/unrecognised bytes) and workspace-last-active switch-on supplied visit/reason singleton, plus its now-orphan test fixture. This intentionally loses real generated-filename suffix/extensionless alarms and real newer-visit archived7day versus inactive30day filtering/older-visit identity alarms. Filesystem writing and production reason pruning really execute; no equivalent replacement or universal absence of safety relevance is claimed. The clipboard test does not inspect written bytes, native delivery or decode; the visit test supplies candidate/timestamps and does not exercise persisted visit routing or actual removal.20authored/20finite cases remain unchanged across4bounded Git/sidecar/removal drivers. No new runner/test/module evaluation or runtime result; historical notes and receipts remain historical. Previous account (preserved verbatim): Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous account (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous account (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous account (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous account (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous account (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous 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): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous account (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Independently remove one authored/finite Playwright closed-gate app-boot inventory: accept loss of real renderer/preload/main refusal composition, saved-host row and Add/Move hiding/Remove visibility alarms. Keep the unchanged scripted-move rendered dialog lifecycle/reload case. It runs no real WSL migration, host connection, file copy or automation restoration. No selector or Playwright participation cleanup is required because the spec remains. Previous 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. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. 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. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. 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. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. 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 broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. 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. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit1579 removes workflow/manifest/regex/private binary-header and diagnostic metric inventories, fixture selectors, injected forwarding/platform/signature/process examples, unproven overlap and internal churn counters without equivalent replacement coverage. Retains actual Git trust/diffs; filesystem hash/ELF-region/native discovery; child CLI module repair; compiler/lock/publication/rollback and synthetic Electron install/cache ownership; executable shell quoting/exit; controlled notary/timer cleanup; local patched extractor file/AST freshness; real Chromium/WebKit CSP/sandbox/HTTPS image/referrer/link/preservation controls under parsed Android headers. Five unchanged setup-pnpm/VM request-cleanup definitions reviewed and not rerun. GitHub, installer/archive, OS metric, client, native delegate, compressor, builder and Apple boundaries injected or absent where recorded. No actual native PTY, shipped full/native app, real Actions/cache/npm signature authority, downloaded Electron archive, real objdump/linker/native CLI/AppImage, signing/NSIS/notary/upload/updater or live freeze proof. Historical scope before this audit: Published Linux 1.4.188 desktop against current source in both directions; scheduled weekly and manually runnable. No required PR check.", "motivatingLinks": ["https://github.com/stablyai/orca/actions/runs/34069063016"], "invariant": "A paired client and host without client-hosted browser capabilities retain server-hosted browser placement across supported version skew.", - "oracle": "Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous oracle (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous oracle (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous oracle (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous oracle (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous oracle (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous oracle (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous oracle (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): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous oracle (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Previous oracle (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. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. 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. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. 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. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. 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 broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. 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. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Require both existing named browser placement scenarios to pass three times with one attempt, zero skips, zero failures, and no report errors.", + "oracle": "Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3788 retires10 authored/11 expanded cases across six changed drivers, including the entire screencast pending-frame-retry and usage-source-cache-streaming suites. Deliberate losses are false-refused last-frame retry/once-only delivery, ordinary stable-pane reattachment, cleared-chat Dispatch completion, terminal-declared chat-caller refusal, at-rest worker liveness projection, nested depth/cap policy, small unsigned6/sealed7 plain-format and verified-bit examples, generic malformed-ISIZE footer refusal examples, and synthetic10k/100k chunk-size/work-count budgets in gzip and general cache I/O. These include real state/disk/RPC outcomes consciously retired for marginal value; retained E2EE-backlog, receipt/custody/uncertain-ack, integrity/migration and staging-cleanup cases are not equivalent replacements. The footer test did not prove early rejection or bounded allocation; staging cleanup did not seed unrelated files. No replacement or fresh native/remote/performance execution is claimed. Earlier raw selectors and dated receipts remain historical. Audit3779 retires17 authored/17 expanded registrations across six changed drivers, including the entire shared-Codex-home and prompt-telemetry suites. Accepted losses are shared-home wrapper noninterference/opt-out preservation, mocked metric count/provenance filters, SSH activity labeling/clearing and handover idle timing, VM ownership/capability/status projections and asleep-worktree refusal, a link-only external conversation replay sample, and two narrow input-credit noninterference/expiry examples. Retain the direct exact-tab/single-use input-credit case. These bounded real disk/state/routing alarms are intentionally retired for marginal value without equivalent replacement or fresh execution claims; earlier receipts remain historical. Audit3772 retires18 authored/27 expanded cases, including whole Codex service opt-out, RPC capability-parser, creator-provenance, short-ciphertext and readiness-null suites. Accepted losses include service ledger/symlink/mode cleanup, user TOML substring preservation, old-hash cleanup, description pass-through, malformed-file/pending-hash examples, coordinator write/probe counts, capability array bounds, positive creator projections, early short-payload refusal and readiness helper null shape. Two redundant Codex exit-cause rows are also retired; Pi shares their direct-idle path only in this empty-output immediate-exit fixture, and future agent-config drift coverage is lost. Real bounded filesystem/parser/runtime alarms are deliberately retired for marginal value; no equivalent replacements or fresh execution are claimed. Earlier receipts retain their historical scope. Audits3754/3755 intentionally remove9 authored/9 finite registrations: the entire one-case usage-source-cache-streaming.test.ts driver and8 cases from the surviving computer-action-validation.test.ts driver. This gate retains an unfiltered root Vitest command; UNIT_INCLUDE admits both source paths. Accepted losses are the real encoder output chunk-size/work-count alarm on repetitive10k/100k ownership payloads through a mocked durable sink, plus CLI diagnostic precedence, fractional window-id rejection, action-call-site window-target exclusivity, plain-text click-count recovery copy, incomplete click/drag targeting, mouse/modifier/direction allowlist samples and inline/stdin text exclusivity. These CLI cases exercise real argument/handler validation before mocked runtime calls; they are deliberately retired for marginal value, not declared tautologies. Retained cache I/O and CLI cases are not equivalent replacements for these alarms. Existing historical raw receipts remain unchanged and do not validate the deleted or reduced drivers. No fresh execution claim is made. Audits3758/3763 intentionally remove9 authored/11 finite registrations from6 changed drivers, including the entire pane-title-notification, window-linear-notices and worktree-card-lifecycle-effects suites. This gate retains an unfiltered root Vitest command admitting these paths. Accepted losses are same-account linked-row success-notice fanout, sidebar-switch channel forwarding, Linear-only notification forwarding/non-terminal-consumer selection/closed-window detach, destroyed-window refusal and first-send-failure suspension through the pane-title adapter, the100-card synthetic focus/poll absence sample, stored-source local folder badge refresh, unobserved-row badge refusal, and immediate reposChanged lineage invalidation. These exercise real owners with controlled ports; they are retired for marginal value, without equivalent replacement claims. The no-badge-work fixture does not seed its title-promised collection-only cache. Preserved historical receipts do not validate deleted or reduced drivers; no fresh execution is claimed. Audit3759 retires the entire one-case Tailwind compiler/scanner smoke. Accept loss of the direct CSS production/test/spec source-exclusion and rescan alarm; no replacement or current execution is claimed. Audit3752 independently approves audit3749: retire five authored/five finite watcher-process registrations, retaining18 raw-exact registrations. Accept loss of healthy shared-pool joint recovery, last-pending-failure idle retirement/respawn, late VITEST fallback release, missing-entry fail-closed selection and independent-supervisor fuse locality alarms. These are real bounded host-policy alarms intentionally retired for low marginal value; no equivalent replacement is asserted. Remaining driver selections exercise controlled FakeChild supervisor lifecycle, cancellation, physical-exit fencing, recovery and fuse behavior. This source review supplies no fresh native/process/platform/remote/SSH execution; historical receipts retain original source and selector scopes. Previous oracle (preserved verbatim): Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered root Vitest command. Current UNIT_INCLUDE admits the partial push-service, metadata-dialog and two config/scripts browser drivers:10 authored/16 finite removals. Accepted losses: actual retry30s/60s progression and register bucket/refill wiring, explicit seven-day lease arithmetic (its notification lacked seq/epoch and never reached send), equal-name edit latch/save payload, real image/font/meta-refresh/form/popup browser refusal controls, and broad rich-markdown bridge/command/edit-select smoke. Actual production state, callback routing and browser enforcement run in these cases; these alarms are deliberately retired on marginal value. All drivers and selectors survive. Existing unrelated receipts remain historical evidence for their unchanged selectors, not proof of the reduced cases. Audit3732 removes 2 authored/3 finite registrations from two partial suites: nominal custom/Kimi local naming success and deferred context usage row presentation. Real losses: custom/Kimi successful extraction through conversation-name sanitization and agentLabel composition; separate ordered counted/deferred lists and exact percentage/token formatting. No replacement or equivalent coverage claimed. Retain 11 authored/13 finite raw-exact registrations for bounded naming instruction/refusal/cancellation, menu dismissal focus ownership and hover/composer Escape/timer cleanup. Source-only bounded value review, no runtime/CI/native/remote/mobile/folder workspace or global completion credit. Previous oracle (preserved verbatim): Audit3733 removes2authored/2finite terminal input checks: fixed custom-cap error/secret fixture and three-emoji cap5refusal whose6UTF16units already trip length fast guard (no UTF8-dependent boundary). Accept exact non-disclosure/oversized-refusal alarm losses; no replacement/equivalence claim. Retain13/13scalar/pending input, OSC state and cron DST/cadence outcomes after bounded material reads. Source-only zero runtime/novelty credit; original historical reasons preserved. Previous oracle (preserved verbatim): Audit3729 removes1authored/3finite by deleting whole CLI runtime pairing advisory-close suite. Accept losing post-real-close injected EIO preservation of native/script/unreadable pairing, env identity/preservation and exact close/release assertions; no actual failed-close leak or replacement coverage claimed. Two retained URL grammar/identity suites11authored16finite raw unchanged. Bounded source/owner/caller value review, zero novelty/runtime credit; other seven3724deferred closures remain. Historical receipts preserve original limits. Previous oracle (preserved verbatim): Audit3724 removes3authored/3finite checks by deleting two whole suites: TUI clear burst-size singleton and terminal-file-URL target two-case wrapper suite. Deliberate losses: derived widest burst<64byte alarm, UNC authority+line-column anchor composition, and malformed-percent null refusal. Real production algorithms execute in those tests; no mocked-output tautology, equivalent replacement, actual Claude/file-navigation delivery or universal safety-irrelevance claim. TUI58byte bound and URI examples have low marginal value as standalone suites. Actual1262/1264/1742KEEP superseded explicitly. Remaining14drivers83authored136finite raw unchanged. Bounded source-only review; ten closures deferred, four bounded keep judgments repeated with zero new semantic-frontier credit. No runtime/CI/native/remote/mobile/folder/global completion claim; historical receipts retain original scope. Previous oracle (preserved verbatim): Audit3723 removes 4 authored/4 finite registrations in two whole suites: keybinding cache freeze/token spellings and host-dependent Orca command name examples. Real losses include returned-object freeze, repeated Mod+P key, Space/PageDown/NumpadSubtract mapping, unknown/empty/prototype-token rejection, and headless Linux versus Windows-server/WSL command choice. No equivalent or replacement coverage claimed. Retain 12 authored/21 finite raw-exact registrations exercising generated scaffold validation, artifact failures, shipped editor/hook/worker/panel tests, actual generated typing compilation, independent CLI root routing and intent-name precedence. Source-only bounded audit; no runtime, CI, native, remote, mobile, folder workspace or global completion credit. Previous oracle (preserved verbatim): Audit3720 removes17authored/23finite checks: whole main catalog-date adapter2 and shared date-helper7, seven renderer nominal ranking/cap/no-date/composition cases, and one browser registration expanding to seven forced-container/DOM-child boundary cases. Deliberate real losses: community oldest-date UTC forwarding, official/undated omission, date sorting/window/invalid/future/skew/clamp and default/override cap; nominal ranking/cap and combined Featured/Newly-added outputs; real CSS459/460,719/720,1055/1056breakpoint, five-card partial-row and720px two-card first-row alarms. Browser cases really measure rendered geometry but force width/remove DOM children; no fake-pixel or tautology rationale. No replacement/equivalent coverage claimed. Retain14authored/19finite raw-exact registrations across4drivers: adversarial featured category/order/tie and installability, date order/window selection, actual PluginManager failure/escaping/duplicate-card suppression, real browser viewport/odd-count geometry/phone catalog visibility, syntax ingress/depth/include/printability and68dlong-bracket auto-close fill-in. No tests/browser/native/UI/provider/remote/mobile/folder/CI/global execution or completion credit. Previous oracle (preserved verbatim): Audit3717 removes6 authored/6finite checks in two whole thin-adapter/presentation suites. Deliberate real losses: ordinary recipe repository-URL withholding and provisioned-root credential scrubbing/forwarding; repository label lockstep suffix expansion, host-scoped map identity/collision grouping, Windows crosshost paths and WSL distro suffixes. Actual provision options, label/sort consumers and host/scrubber delegates inspected; no replacement/equivalence claim. Retain40 authored/84finite registrations raw exact in14 drivers with bounded owner/context review. Prior KEEP superseded for removed suites; no runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous oracle (preserved verbatim): Audit3714 removes8 authored/39finite checks: whole CLI selector-recovery, task display-text and ANSI grammar suites plus two name joiner/blank tables. Deliberate real losses: selector flag/value/identity and mutation recovery merge/serialization; exact task suffix, transcript fallback, input immutability, cache reuse and edited blocks; independent failed-escape/resumption and OSC/DCS/BEL/ST/C1/nested/unfinished stripping outputs; meaningful-language joiner preservation and invisible/blank-name rejection. These are real bounded alarms, removed as narrow supplied-error examples, helper/token inventories and repeated internal-work fixtures. Prior2936,1195/1196,1214/1215 and1082 KEEP superseded; no replacement or equivalent coverage claimed. Keep9authored/9finite raw-exact registrations in5surviving drivers: screenshot export/failure filesystem behavior, CLI local tree query, event-local reply provenance, vault role-sensitive content and four hostile/UTF16/dangling/tag-name regressions. No native/UI/provider/remote/mobile/folder/runtime/CI/global completion credit. Previous oracle (preserved verbatim): Audit3711 retires2authored/4finite cases by deleting whole clipboard-image-temp-file signature-to-name inventory (HEIC/TIFF/unrecognised bytes) and workspace-last-active switch-on supplied visit/reason singleton, plus its now-orphan test fixture. This intentionally loses real generated-filename suffix/extensionless alarms and real newer-visit archived7day versus inactive30day filtering/older-visit identity alarms. Filesystem writing and production reason pruning really execute; no equivalent replacement or universal absence of safety relevance is claimed. The clipboard test does not inspect written bytes, native delivery or decode; the visit test supplies candidate/timestamps and does not exercise persisted visit routing or actual removal.20authored/20finite cases remain unchanged across4bounded Git/sidecar/removal drivers. No new runner/test/module evaluation or runtime result; historical notes and receipts remain historical. Previous oracle (preserved verbatim): Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous oracle (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous oracle (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous oracle (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous oracle (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous oracle (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous oracle (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous oracle (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): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous oracle (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Previous oracle (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. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. 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. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. 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. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. 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 broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. 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. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. 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. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Require both existing named browser placement scenarios to pass three times with one attempt, zero skips, zero failures, and no report errors.", "commands": [ "gh workflow run packaged-browser-e2e.yml", "pnpm exec playwright test tests/e2e/packaged-mixed-version-browser-placement.spec.ts --config tests/playwright.config.ts --project=electron-headless --workers=1 --repeat-each=3 --retries=0", @@ -14156,6 +14164,24 @@ "Collect repeated scheduled history before making this required." ], "knownGaps": [ + "Audit3814 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle from a Codex ready prompt even when stale startup lines remain :: Stale MCP startup lines must not block a later Codex ready header.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle when a stale Codex prompt is followed by the ready header :: A Codex ready header following a stale resume prompt must satisfy tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for an idle Cursor lane past its dismissed trust dialog (#8210) :: Later Cursor idle banner overrides retained trust dialog.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not block a mid-run Cursor lane on its dismissed trust dialog (#8210) :: Dismissed trust dialog must not report blocked for later busy Cursor; wait times out.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not classify unrelated press-enter prompts as Codex blocked prompts :: Unidentified press-enter text must time out rather than be classified Codex blocked.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for quiet background PTY agents without OSC titles :: Quiet Codex background terminal without OSC title eventually resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: sends agent prompts as bracketed paste before submit :: Driving prompt escapes embedded paste-end ESC, writes one framed paste then CR, and counts bytes.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: settles a foreground Codex prompt when launch metadata has not arrived :: Codex inferred from foreground without launch metadata waits for composer marker/quiescence before one CR.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: gives a late Codex render marker a fresh quiescence window :: Marker arriving at7.9s re-arms fresh quiet window instead of submitting at initial cap.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: writes large agent prompt paste frames atomically before delayed submit :: A prompt larger than input chunk budget is a single paste write before delayed CR with exact byte count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects oversized terminal.send text before provider writes :: Oversized ordinary terminal.send rejects input-too-large before any provider write.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects focusing an exited background terminal session :: focusTerminal refuses terminal_exited before invoking background reveal.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: pastes the same bytes the desktop draft paste sent for the prompt :: Launch-ready prompt normalizes CR/LF and renders embedded ESC visibly identically to desktop bracketed paste.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: keeps a prompt into a running agent behind the render settle, as before :: Driving prompt remains held through7s repaint activity then submits once by9s.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reports a queued PTY focus as not navigated when its notifier disappears :: Queued PTY focus and completed active reveal report not navigated after notifier removal; no second reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: does not invoke a stale graph-leaf focus notifier after queued PTY work :: Queued graph-leaf focus must not invoke old notifier after preceding PTY reveal and notifier removal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: paginates retained terminal output with explicit limits and truncation metadata :: Preview120lines, fractional limits,50/200 pages, retained2000line truncation and future-cursor metadata stay consistent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: falls back to renderer visible screen when uncursored TUI tail is blank :: Substantial blank uncursored tail uses mounted renderer visible screen with zero scrollback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reads and shows the runtime-owned alternate-screen grid without serialization :: Actual runtime alternate-screen grid provides read/show content without renderer/provider serialization.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: classifies older provider alternate-screen snapshots from ANSI :: Older provider without alternateScreen metadata classifies ANSI alternate entry and returns Remote Vim screen.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: honors the last ANSI screen transition when older provider metadata is absent :: Last ANSI alternate exit overrides earlier entry when explicit provider mode metadata is absent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: rejects a full provider screen frame after live output advances :: Live output arriving during second full-screen capture causes screen-unavailable rather than stale full frame.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: shares one provider snapshot between concurrent read and show calls :: Concurrent read/show share one successful provider snapshot and both receive Shared TUI content.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps cursor reads provider-free on restored alternate-screen PTYs :: Restored alternate-screen cursor transcript reads never acquire provider snapshot.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: backs off after a provider snapshot failure instead of retrying for show :: Failed provider capture is cached/backed off so later show does not retry.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: falls back once to a mounted renderer when a known alternate provider fails :: A known-alternate failed provider capture falls back exactly once to newly mounted renderer.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: bounds provider visible frames for read and show responses :: Provider visible read/show use six bounded lines and300character preview.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps renderer-fallback composer drafts separate from terminal output :: Renderer fallback strips dim composer draft from terminal output and exposes draft separately.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: does not use renderer visible-screen fallback for a short blank shell tail :: Two blank shell lines must not trigger renderer screen fallback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: trims terminal tail character budget without per-line array shifts :: Tail builder trims to256KiB with correct retained suffix and no Array.shift calls.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains ANSI-only status redraws instead of appending every frame :: Repeated erase/redraw replaces preview until newline then publishes one completed cursor row.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains split multi-line ANSI footer redraw state across chunks :: CUU state across chunks retains corrected footer rows and publishes new cursor entries.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not let stale lower rows hide earlier corrected footer rows from cursor reads :: Earlier corrected footer row must not be hidden by stale lower rows in cursor reads.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: bounds completed transcript entries from a single multi-line redraw chunk :: Single redraw chunk bounds completed transcript to2000retained lines and correct oldest/next/latest cursors.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains multi-line ANSI redraws when the last footer row stays partial :: Partial final redrawn row appears in preview but cursor sees it only after newline.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not retain split ANSI controls as visible terminal preview text :: Split color/mode escapes never leak preview fragments; long split OSC title truncates at MAX_OSC_TITLE_CHARS.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains same-line redraw cursor position across split full-line erase chunks :: Full-line erase preserves column across chunks so XY follows three spaces rather than old ABC.\nsrc/main/runtime/orca-runtime-tests/conpty-stream-read.spec.ts :: fills the requested line count even when blank rows sit below the prompt :: Blank rows below a ConPTY prompt must not consume the requested nonempty-line count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: does not retain split ST-terminated string controls as preview text :: Split ST-terminated Kitty/string controls must remain excluded from preview text.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects split OSC titles before retaining terminal previews :: Split BEL OSC title must update working title/status without leaking into preview.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects ST-terminated OSC titles split before the final backslash :: ST OSC split before final backslash must update title without leaking framing.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: preserves a trailing escape after a completed OSC title :: Completed OSC followed by pending ESC must preserve the next idle-title transition.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: seeds newly synced leaves from PTY pending ANSI state :: A newly synced graph leaf inherits pending ANSI so a split color fragment cannot leak.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: bounds retained partial terminal output before preview reads :: Partial terminal state stays capped at 4000, preserves retained array identity, and preview truncation/cursor output remains correct.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: submits the mail pointer to Cursor Agent only after the paste-burst delay :: Cursor mailbox pointer Enter must wait through the paste-burst delay; this is a real input-timing alarm intentionally retired.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts :: adopts a v1.4.150-shaped agent, setup, and shell orphan as one topology transaction :: Stale incarnation refuses without topology change; three agent/setup/shell lanes adopt atomically with layout/group/revision and preserved read/input/resize; exact replay is idempotent and competing owner refuses.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: retires the exact worker when it exits after renderer reveal :: Exact worker exit after reveal retires that worker and its surface.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: re-reveals a recovered worker after the renderer graph epoch changes :: Changed renderer graph epoch invalidates reveal receipt and forces another reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: defers recovery when the renderer omits the exact reveal identity :: Missing exact reveal identity defers recovery after two attempts.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: reconciles a same-id process replacement before headless adoption :: A process replacement before headless adoption must fence off stale ownership.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retires provider resume only after authoritative inventory proves the legacy PTY exited :: Authoritative owning-host inventory overrides false local hasPty, avoids SSH scanning, retires exited provider resume/surface, adopts live workers without headless reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retries inventory and unknown liveness without revealing a ghost worker :: Inventory failure and unknown liveness must retry without ghost reveal, eventually adopt, and stop retrying.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: refuses a live reserved pane before issuing a handle or revealing it :: A requireFreshPane launch receiving a live reserved owner must reject before handle/reveal/kill, and release its claim. No equivalent replacement claimed.", + "Audit3806 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: skips a listener unsubscribed mid-fan-out even with mobile exclusions active :: A listener removed by an earlier listener during one fanout is not called, including with a side-effect-excluded mobile listener present.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: retains bytes emitted before a fresh daemon spawn resolves :: Bytes and title arriving before an initial zero/reset provider response survive in the serialized headless buffer with their counted sequence.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits command-finished facts with best-effort exit codes across chunk splits :: A split OSC133 D exit code becomes130 and a missing code becomes null in ordered command-finished facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits pr-link facts once per URL with batch attribution :: A split GitHub PR URL yields42 rather than4, emits42/43 once each, and carries PTY/worktree/tab attribution.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits 2031-subscribe facts across chunk splits :: Split ESC[?20 then31h emits exactly one2031-subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: restores a provisional 2031 subscribe when daemon scan authority returns :: Returning daemon scan authority with partial scan seed and pending2031 subscription restores exactly one subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers the tracked title over the renderer snapshot lastTitle :: A synthetic live Cursor title overrides stale renderer lastTitle while preserving renderer snapshot source.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers provider history over a partial headless mirror for requested snapshots :: Authoritative requested snapshots return supplied provider frame/history/seq rather than a partial headless mirror, requesting5000rows.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: tracks live alternate-screen transitions after a provider snapshot :: Provider alternateScreen true is accepted, then live1049l/1049h update isTerminalAlternateScreen false/true.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: translates reset provider snapshots without retaining the old title :: A reset provider snapshot translates new local seq into the runtime domain and replaces Old process title with New process.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits the chunk agentStatus events before its side-effect batch :: Agent status callback precedes side-effect batch callback for one coalesced OSC9999/title/bell chunk.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: still emits a throwing chunk’s facts under its own seq, not the next chunk’s :: A tracker throw still flushes first chunk title facts under its own seq, and second chunk does not inherit those facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: seeds the lazily created tracker from the daemon-snapshot title :: A lazy tracker hydrated from renderer snapshot title Codex working emits agent-idle on later Codex done.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits command-code-working facts only after the banner arms the scrape :: Unarmed Thinking text emits no facts; a Command Code0.27.3 banner then hardcoded colored spinner text emits attributed command-code-working with the submitted prompt.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits a command-code-done fact when the idle composer returns :: After hardcoded banner/working text, returned idle composer emits command-code-done with the earlier submitted prompt.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: resizes the headless mirror after an accepted desktop PTY resize :: An external accepted resize produces the resized dimensions and same status-frame lines as a separately driven reference emulator.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: replaces suffix-only headless state with the recovered renderer snapshot :: Replacing suffix-only state removes old suffix, retains renderer history plus later output/cwd, and returns the live47x40PTY grid.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: stamps SSH connection identity on runtime terminal status :: A synthetic mounted-leaf OSC9999 status after registerPty carries the supplied SSH connectionId.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: does not retain WSL context when a PTY id is reused :: After exit and same-ID new null distro context, OSC7 file://server/share/repo uses UNC server path rather than old Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: preserves immutable context while a live daemon attach is unresolved :: preparePtyExecutionContext with preserveExisting refuses a supplied Debian replacement and subsequent OSC7 keeps original Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts :: projects frame-independent live state through main buffer snapshots :: Main-buffer snapshot puts focus-report/cursor-visibility modes in frameRestoreAnsi, excludes STATIC-FRAME there and includes it in data.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.ts :: continues terminal agent status fanout when a callback throws :: Throwing on the first status callback does not prevent second payload delivery and logs contextual error.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: returns a title-only replay snapshot and never historical attention :: Lose replay:true/title-only fact projection despite earlierbell and unknownPTYnull. No actual delivered-history notification or reattach behavior was exercised. No equivalent replacement claimed.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects a handle rebind while a controller-less status check yields :: A handle rebound while the null-controller status continuation yields must throw terminal_handle_stale.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects confirmation evidence when the owning PTY exits :: A pending strong confirmation resolving after owning PTY exit must reject terminal_exited.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-03.spec.ts :: keeps ordinary terminal send suffix failures on the existing not-writable contract :: Ordinary send writes text but refused CR must throw terminal_not_writable with beforeWrite twice and afterWrite once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell the execution host cannot apply instead of spawning its default :: Requested Windows shell on POSIX must refuse before spawning a default shell.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: quotes the agent startup command for the requested shell, not the host default :: Requested cmd shell must override PowerShell default quoting for agent startup command.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: keeps restored receipts outside a targeted worktree scan :: Targeted scan removes the moved-worktree receipt while preserving another worktree receipt.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: observes setup command completion without waiting for its interactive shell to exit :: Nonzero completion marker 17 resolves while interactive shell remains running.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: falls back to setup terminal exit when no completion signal is available :: Setup completion observer without token falls back to actual exit code 9.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: cancels setup completion observation when the caller aborts :: Abort rejects with the original reason and unsubscribes once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps observing after an uncertain setup terminal status :: Unknown exit waiter result must leave observation pending until completion marker arrives.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh omits a record :: Controller inventory omission disconnects the record but preserves its retained transcript.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh times out :: Hung inventory timeout leaves connected record and retained transcript intact.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle for adopted background PTY handles from the renderer title :: An adopted background handle resolves tui-idle from ready Codex renderer title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves live-leaf tui-idle from an OpenCode native title :: A live leaf resolves tui-idle from an OpenCode native title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from a Codex ready prompt preview :: A supplied Codex prompt preview resolves tui-idle without an actual agent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from an Antigravity prompt before the model line :: A supplied Antigravity prompt before model line resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell with no workspace instead of creating a default-shell tab :: Workspace-less explicit shell must reject before renderer default-tab request or spawn. This real guard/wiring alarm is deliberately retired.", + "Audit3798 per-case accepted losses:\nsrc/main/runtime/orca-runtime-tests/paired-settings.spec.ts :: awaits navigation-only updates from paired clients (%s) :: Updating only claudeSubagentNavigationEnabled waits for the actual controller call to the supplied pending Claude-view reconcile for both on/off values.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: drops a client page record even when its close command cannot be issued :: A removed workspace loses its runtime client-page record and headless browser projection despite close delivery_required rejection, and emits the asynchronous warning.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: leaves client-hosted pages alone when another host still owns the same worktree id :: Removing runtime:env-b metadata with local ownership leaves the local same-ID client page unchanged and issues no close command.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: marks live bindings again when reopening after a promoted window closes :: A reopened window marks its still-registered live worktree in activeWorktreeIdsOnShutdown after the first promoted window closes.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: preserves live SSH session identities when promoting a headless runtime :: Headless-to-desktop promotion records active worktree, SSH connection and remoteSessionIdsByTabId from the supplied surviving SSH PTY/session.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores a surviving renderer when its reload is cancelled :: A sole ready renderer reload cancelled under its current renderer fence returns true and becomes ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores headless authority when desktop promotion navigation is cancelled :: A cancelled desktop promotion with headless recovery returns false while headless authority remains ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: moves a desktop graph to unavailable when its reload times out :: A ready desktop graph without a headless fallback becomes unavailable at the reload deadline and retains its window/epoch.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: recovers a failed headless promotion and accepts a later renderer generation :: A promotion failure restores ready headless authority; a later valid same-window graph publishes ready desktop authority.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: clears a failed pane recovery so a later reconnect can retry :: After relay_reconnecting rejection, the pending recovery lock clears and the same pane/handle can call createTerminal a second time and return its supplied replacement.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: still preserves a CLI agent leaf when the reloaded renderer has not rebound its PTY :: An empty graph published during renderer reload preserves a preallocated live CLI PTY as one listable terminal before renderer rebind.\nsrc/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts :: keeps a no-incarnation handle across an in-graph pane remint :: Within one graph lifetime an unversioned PTY reminted onto another leaf retains its issued handle and resolves its old exit waiter after onPtyExit.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: matches explicit-id cwd PTYs when the resolved worktree cache is incomplete :: An explicit target absent from a fresh incomplete resolved cache adopts only its cwd PTY, rejects nested cwd PTY and does not rescan Git.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: ignores cwd-only controller PTYs for malformed explicit worktree IDs :: Malformed id:repo-1:: returns no terminals, does not adopt cwd-only controller PTY and avoids Git rescanning.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: refuses an SSH-backed create for mobile/runtime callers instead of creating locally :: Loss of this public unserved SSH create error-class/no-local-add/no-local-list alarm.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: records an app-selected parent workspace as a manual action :: Loss of the local runtime folder-parent manual origin, active-workspace source and explicit confidence projection alarm; no claim that SSH or cleanup coverage replaces it.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: browses runtime server directories before projects are added :: Loss of this public runtime alarm for browse availability before registration, directories-first lexical ordering and native path flavor.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: lists drive roots for a server-root browse :: Loss of the Windows public slash-root drive enumeration smoke and presence of the temporary directory drive.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations-part-02.spec.ts :: creates a missing runtime parent before creating the project directory :: Loss of this runtime createRepo recursive missing-parent/child existence and registered-path alarm.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: preserves selected project %s when a hosted parent is known :: Loss of both parent-selected and origin-selected normal fork-link projection/persisted upstream alarms plus exact single-probe count.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: links a current enterprise remote despite unavailable metadata and a retained %s :: Loss of normal current-enterprise-origin linking with stale automatic GitHub avatar or protected file image, unchanged icon assertion, and serialized project identity under unavailable metadata.", + "Audit3788 retires10 authored/11 expanded cases across six changed drivers, including the entire screencast pending-frame-retry and usage-source-cache-streaming suites. Deliberate losses are false-refused last-frame retry/once-only delivery, ordinary stable-pane reattachment, cleared-chat Dispatch completion, terminal-declared chat-caller refusal, at-rest worker liveness projection, nested depth/cap policy, small unsigned6/sealed7 plain-format and verified-bit examples, generic malformed-ISIZE footer refusal examples, and synthetic10k/100k chunk-size/work-count budgets in gzip and general cache I/O. These include real state/disk/RPC outcomes consciously retired for marginal value; retained E2EE-backlog, receipt/custody/uncertain-ack, integrity/migration and staging-cleanup cases are not equivalent replacements. The footer test did not prove early rejection or bounded allocation; staging cleanup did not seed unrelated files. No replacement or fresh native/remote/performance execution is claimed. Earlier raw selectors and dated receipts remain historical.", + "Audit3779 retires17 authored/17 expanded registrations across six changed drivers, including the entire shared-Codex-home and prompt-telemetry suites. Accepted losses are shared-home wrapper noninterference/opt-out preservation, mocked metric count/provenance filters, SSH activity labeling/clearing and handover idle timing, VM ownership/capability/status projections and asleep-worktree refusal, a link-only external conversation replay sample, and two narrow input-credit noninterference/expiry examples. Retain the direct exact-tab/single-use input-credit case. These bounded real disk/state/routing alarms are intentionally retired for marginal value without equivalent replacement or fresh execution claims; earlier receipts remain historical.", + "Audit3772 retires18 authored/27 expanded cases, including whole Codex service opt-out, RPC capability-parser, creator-provenance, short-ciphertext and readiness-null suites. Accepted losses include service ledger/symlink/mode cleanup, user TOML substring preservation, old-hash cleanup, description pass-through, malformed-file/pending-hash examples, coordinator write/probe counts, capability array bounds, positive creator projections, early short-payload refusal and readiness helper null shape. Two redundant Codex exit-cause rows are also retired; Pi shares their direct-idle path only in this empty-output immediate-exit fixture, and future agent-config drift coverage is lost. Real bounded filesystem/parser/runtime alarms are deliberately retired for marginal value; no equivalent replacements or fresh execution are claimed. Earlier receipts retain their historical scope.", + "Audits3754/3755 intentionally remove9 authored/9 finite registrations: the entire one-case usage-source-cache-streaming.test.ts driver and8 cases from the surviving computer-action-validation.test.ts driver. This gate retains an unfiltered root Vitest command; UNIT_INCLUDE admits both source paths. Accepted losses are the real encoder output chunk-size/work-count alarm on repetitive10k/100k ownership payloads through a mocked durable sink, plus CLI diagnostic precedence, fractional window-id rejection, action-call-site window-target exclusivity, plain-text click-count recovery copy, incomplete click/drag targeting, mouse/modifier/direction allowlist samples and inline/stdin text exclusivity. These CLI cases exercise real argument/handler validation before mocked runtime calls; they are deliberately retired for marginal value, not declared tautologies. Retained cache I/O and CLI cases are not equivalent replacements for these alarms. Existing historical raw receipts remain unchanged and do not validate the deleted or reduced drivers. No fresh execution claim is made. Audits3758/3763 intentionally remove9 authored/11 finite registrations from6 changed drivers, including the entire pane-title-notification, window-linear-notices and worktree-card-lifecycle-effects suites. This gate retains an unfiltered root Vitest command admitting these paths. Accepted losses are same-account linked-row success-notice fanout, sidebar-switch channel forwarding, Linear-only notification forwarding/non-terminal-consumer selection/closed-window detach, destroyed-window refusal and first-send-failure suspension through the pane-title adapter, the100-card synthetic focus/poll absence sample, stored-source local folder badge refresh, unobserved-row badge refusal, and immediate reposChanged lineage invalidation. These exercise real owners with controlled ports; they are retired for marginal value, without equivalent replacement claims. The no-badge-work fixture does not seed its title-promised collection-only cache. Preserved historical receipts do not validate deleted or reduced drivers; no fresh execution is claimed. Audit3759 retires the entire one-case Tailwind compiler/scanner smoke. Accept loss of the direct CSS production/test/spec source-exclusion and rescan alarm; no replacement or current execution is claimed.", + "Audit3752 independently approves audit3749: retire five authored/five finite watcher-process registrations, retaining18 raw-exact registrations. Accept loss of healthy shared-pool joint recovery, last-pending-failure idle retirement/respawn, late VITEST fallback release, missing-entry fail-closed selection and independent-supervisor fuse locality alarms. These are real bounded host-policy alarms intentionally retired for low marginal value; no equivalent replacement is asserted. Remaining driver selections exercise controlled FakeChild supervisor lifecycle, cancellation, physical-exit fencing, recovery and fuse behavior. This source review supplies no fresh native/process/platform/remote/SSH execution; historical receipts retain original source and selector scopes.", + "Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered root Vitest command. Current UNIT_INCLUDE admits the partial push-service, metadata-dialog and two config/scripts browser drivers:10 authored/16 finite removals. Accepted losses: actual retry30s/60s progression and register bucket/refill wiring, explicit seven-day lease arithmetic (its notification lacked seq/epoch and never reached send), equal-name edit latch/save payload, real image/font/meta-refresh/form/popup browser refusal controls, and broad rich-markdown bridge/command/edit-select smoke. Actual production state, callback routing and browser enforcement run in these cases; these alarms are deliberately retired on marginal value. All drivers and selectors survive. Existing unrelated receipts remain historical evidence for their unchanged selectors, not proof of the reduced cases.", + "Audit3732 removes 2 authored/3 finite registrations from two partial suites: nominal custom/Kimi local naming success and deferred context usage row presentation. Real losses: custom/Kimi successful extraction through conversation-name sanitization and agentLabel composition; separate ordered counted/deferred lists and exact percentage/token formatting. No replacement or equivalent coverage claimed. Retain 11 authored/13 finite raw-exact registrations for bounded naming instruction/refusal/cancellation, menu dismissal focus ownership and hover/composer Escape/timer cleanup. Source-only bounded value review, no runtime/CI/native/remote/mobile/folder workspace or global completion credit.", + "Audit3733 removes2authored/2finite terminal input checks: fixed custom-cap error/secret fixture and three-emoji cap5refusal whose6UTF16units already trip length fast guard (no UTF8-dependent boundary). Accept exact non-disclosure/oversized-refusal alarm losses; no replacement/equivalence claim. Retain13/13scalar/pending input, OSC state and cron DST/cadence outcomes after bounded material reads. Source-only zero runtime/novelty credit; original historical reasons preserved.", + "Audit3729 removes1authored/3finite by deleting whole CLI runtime pairing advisory-close suite. Accept losing post-real-close injected EIO preservation of native/script/unreadable pairing, env identity/preservation and exact close/release assertions; no actual failed-close leak or replacement coverage claimed. Two retained URL grammar/identity suites11authored16finite raw unchanged. Bounded source/owner/caller value review, zero novelty/runtime credit; other seven3724deferred closures remain. Historical receipts preserve original limits.", + "Audit3724 removes3authored/3finite checks by deleting two whole suites: TUI clear burst-size singleton and terminal-file-URL target two-case wrapper suite. Deliberate losses: derived widest burst<64byte alarm, UNC authority+line-column anchor composition, and malformed-percent null refusal. Real production algorithms execute in those tests; no mocked-output tautology, equivalent replacement, actual Claude/file-navigation delivery or universal safety-irrelevance claim. TUI58byte bound and URI examples have low marginal value as standalone suites. Actual1262/1264/1742KEEP superseded explicitly. Remaining14drivers83authored136finite raw unchanged. Bounded source-only review; ten closures deferred, four bounded keep judgments repeated with zero new semantic-frontier credit. No runtime/CI/native/remote/mobile/folder/global completion claim; historical receipts retain original scope.", + "Audit3723 removes 4 authored/4 finite registrations in two whole suites: keybinding cache freeze/token spellings and host-dependent Orca command name examples. Real losses include returned-object freeze, repeated Mod+P key, Space/PageDown/NumpadSubtract mapping, unknown/empty/prototype-token rejection, and headless Linux versus Windows-server/WSL command choice. No equivalent or replacement coverage claimed. Retain 12 authored/21 finite raw-exact registrations exercising generated scaffold validation, artifact failures, shipped editor/hook/worker/panel tests, actual generated typing compilation, independent CLI root routing and intent-name precedence. Source-only bounded audit; no runtime, CI, native, remote, mobile, folder workspace or global completion credit.", + "Audit3720 removes17authored/23finite checks: whole main catalog-date adapter2 and shared date-helper7, seven renderer nominal ranking/cap/no-date/composition cases, and one browser registration expanding to seven forced-container/DOM-child boundary cases. Deliberate real losses: community oldest-date UTC forwarding, official/undated omission, date sorting/window/invalid/future/skew/clamp and default/override cap; nominal ranking/cap and combined Featured/Newly-added outputs; real CSS459/460,719/720,1055/1056breakpoint, five-card partial-row and720px two-card first-row alarms. Browser cases really measure rendered geometry but force width/remove DOM children; no fake-pixel or tautology rationale. No replacement/equivalent coverage claimed. Retain14authored/19finite raw-exact registrations across4drivers: adversarial featured category/order/tie and installability, date order/window selection, actual PluginManager failure/escaping/duplicate-card suppression, real browser viewport/odd-count geometry/phone catalog visibility, syntax ingress/depth/include/printability and68dlong-bracket auto-close fill-in. No tests/browser/native/UI/provider/remote/mobile/folder/CI/global execution or completion credit.", + "Audit3717 removes6 authored/6finite checks in two whole thin-adapter/presentation suites. Deliberate real losses: ordinary recipe repository-URL withholding and provisioned-root credential scrubbing/forwarding; repository label lockstep suffix expansion, host-scoped map identity/collision grouping, Windows crosshost paths and WSL distro suffixes. Actual provision options, label/sort consumers and host/scrubber delegates inspected; no replacement/equivalence claim. Retain40 authored/84finite registrations raw exact in14 drivers with bounded owner/context review. Prior KEEP superseded for removed suites; no runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit.", + "Audit3714 removes8 authored/39finite checks: whole CLI selector-recovery, task display-text and ANSI grammar suites plus two name joiner/blank tables. Deliberate real losses: selector flag/value/identity and mutation recovery merge/serialization; exact task suffix, transcript fallback, input immutability, cache reuse and edited blocks; independent failed-escape/resumption and OSC/DCS/BEL/ST/C1/nested/unfinished stripping outputs; meaningful-language joiner preservation and invisible/blank-name rejection. These are real bounded alarms, removed as narrow supplied-error examples, helper/token inventories and repeated internal-work fixtures. Prior2936,1195/1196,1214/1215 and1082 KEEP superseded; no replacement or equivalent coverage claimed. Keep9authored/9finite raw-exact registrations in5surviving drivers: screenshot export/failure filesystem behavior, CLI local tree query, event-local reply provenance, vault role-sensitive content and four hostile/UTF16/dangling/tag-name regressions. No native/UI/provider/remote/mobile/folder/runtime/CI/global completion credit.", + "Audit3711 retires2authored/4finite cases by deleting whole clipboard-image-temp-file signature-to-name inventory (HEIC/TIFF/unrecognised bytes) and workspace-last-active switch-on supplied visit/reason singleton, plus its now-orphan test fixture. This intentionally loses real generated-filename suffix/extensionless alarms and real newer-visit archived7day versus inactive30day filtering/older-visit identity alarms. Filesystem writing and production reason pruning really execute; no equivalent replacement or universal absence of safety relevance is claimed. The clipboard test does not inspect written bytes, native delivery or decode; the visit test supplies candidate/timestamps and does not exercise persisted visit routing or actual removal.20authored/20finite cases remain unchanged across4bounded Git/sidecar/removal drivers. No new runner/test/module evaluation or runtime result; historical notes and receipts remain historical.", "Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit.", "Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained.", "Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit.", @@ -14250,7 +14276,8 @@ "Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope.", "Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope.", "Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope.", - "Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed." + "Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage 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." ], "demotionRule": "Keep experimental if any direction skips or fails; do not extend timeouts or retry to green." }, diff --git a/config/repo-host-read-baseline.txt b/config/repo-host-read-baseline.txt index 7fcaeb3c4b7..c1fbbf6e2ab 100644 --- a/config/repo-host-read-baseline.txt +++ b/config/repo-host-read-baseline.txt @@ -2,7 +2,7 @@ # This is a RATCHET: counts may only go DOWN. Resolve the host instead (see fix text). # A lower bound: destructured and differently named rows are not counted. # Prune after a fix: pnpm check:repo-host-read-ratchet --prune -1 src/main/github/account-binding-required-host.ts +1 src/main/github/accounts/account-binding-required-host.ts 3 src/main/ipc/ephemeral-vm-recipe-context.ts 2 src/main/ipc/filesystem/filesystem-source-control-ai-targets.ts 1 src/main/ipc/folder-repo-git-upgrade.ts @@ -13,7 +13,6 @@ 1 src/main/ipc/source-control/github-work-item-args.ts 1 src/main/ipc/source-control/gitlab-repo-access.ts 2 src/main/ipc/workspace-cleanup/workspace-cleanup-candidate.ts -1 src/main/ipc/workspace-cleanup/workspace-cleanup-disconnected-ssh.ts 1 src/main/ipc/worktrees-test-metadata-pruning-store.ts 1 src/main/ipc/worktrees/listing/authoritative-local-worktree-metadata-pruning.ts 1 src/main/ipc/worktrees/listing/register-host-catalog-handlers.ts @@ -47,7 +46,7 @@ 1 src/main/workspaces/space-analysis/workspace-space-worktree-row.ts 1 src/shared/endpoint-catalog-adoption.ts 1 src/shared/folder-workspaces/folder-workspace-execution-host.ts -1 src/shared/github/github-cache-key.ts +1 src/shared/github/cache/github-cache-key.ts 1 src/shared/new-workspace-dialog-repo.ts 1 src/shared/sidebar-list/workspace-review-facts.ts 1 src/shared/workspace-session/workspace-session-terminal-buffers.ts diff --git a/config/scripts/ci/sharding/ci-shard-timings.json b/config/scripts/ci/sharding/ci-shard-timings.json index acad9ede442..286b183e044 100644 --- a/config/scripts/ci/sharding/ci-shard-timings.json +++ b/config/scripts/ci/sharding/ci-shard-timings.json @@ -224,7 +224,6 @@ "config/scripts/release/versioning/release-rc-history.test.mjs": 230, "config/scripts/release/workflow-contracts/release-windows-signing-gate.test.mjs": 102, "config/scripts/static-analysis/oxlint-contracts/renderer-scrollbar-style-plugin.test.mjs": 234, - "config/scripts/static-analysis/renderer-styles/renderer-tailwind-sources.test.mjs": 289, "config/scripts/desktop-distribution/nsis/replace-cached-nsis-elevate.test.mjs": 1258, "config/scripts/ci/workflow-contracts/required-pr-check-name.test.mjs": 1266, "config/scripts/archives/seven-zip/resolve-7za-path.test.mjs": 1391, @@ -306,7 +305,6 @@ "src/cli/command-suggestion-destructive-families.test.ts": 226, "src/cli/command-suggestion.test.ts": 68, "src/cli/computer-tree-query.test.ts": 79, - "src/cli/format-recovery.test.ts": 413, "src/cli/format.test.ts": 446, "src/cli/handlers/account.test.ts": 849, "src/cli/handlers/agent-hooks.test.ts": 1702, @@ -1271,7 +1269,6 @@ "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/hooks/reconciliation/codex-real-home-shared-entry.test.ts": 641, "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-state.test.ts": 363, @@ -1361,7 +1358,6 @@ "src/main/codex/hooks/installation/hook-service-managed-codex-hashes.test.ts": 1048, "src/main/codex/hooks/installation/hook-service-managed-install.test.ts": 492, "src/main/codex/hooks/installation/hook-service-runtime-trust-repair.test.ts": 475, - "src/main/codex/hooks/installation/hook-service-trust-grant.test.ts": 318, "src/main/codex/hooks/installation/hook-service-user-hook-mirroring.test.ts": 596, "src/main/codex/hooks/installation/hook-service-user-hook-trust-spellings.test.ts": 657, "src/main/codex/hooks/installation/hook-service-windows-key-spellings.test.ts": 461, @@ -1933,7 +1929,7 @@ "src/main/host/secret-protection-report.test.ts": 59, "src/main/i18n/main-i18n-lazy-locale.test.ts": 518, "src/main/i18n/system-language.test.ts": 358, - "src/main/media/image-file-signature.test.ts": 47, + "src/shared/image-file-signature.test.ts": 47, "src/main/credentials/integration-state-file-cache.test.ts": 47, "src/main/credentials/integration-token-file-cache.test.ts": 152, "src/main/ipc/account-sign-in-link-opener.test.ts": 128, @@ -3052,7 +3048,6 @@ "src/main/runtime/browser/client-pages/orca-runtime-browser-ghost-session-row-close.test.ts": 640, "src/main/runtime/browser/screencast/orca-runtime-browser-screencast-e2ee-backlog.test.ts": 659, "src/main/runtime/browser/screencast/orca-runtime-browser-screencast-fanout.test.ts": 607, - "src/main/runtime/browser/screencast/orca-runtime-browser-screencast-pending-frame-retry.test.ts": 595, "src/main/runtime/browser/client-pages/orca-runtime-browser.test.ts": 682, "src/main/runtime/terminal/query/orca-runtime-codex-idle-title-chat-address.test.ts": 5781, "src/main/runtime/terminal/surface/orca-runtime-cold-restore-terminal-membership-layout-owner.test.ts": 4130, @@ -3238,7 +3233,6 @@ "src/main/runtime/rpc/e2ee-channel-text-backpressure.test.ts": 204, "src/main/runtime/rpc/e2ee-channel-v2.test.ts": 287, "src/main/runtime/rpc/e2ee-channel.test.ts": 539, - "src/main/runtime/rpc/e2ee-crypto.test.ts": 121, "src/main/runtime/rpc/methods/accounts/accounts.test.ts": 161, "src/main/runtime/rpc/methods/agent-launch/agent-launch-at-rest.test.ts": 4936, "src/main/runtime/rpc/methods/agent-launch/agent-launch-caller-selection.test.ts": 1680, @@ -3396,7 +3390,6 @@ "src/main/runtime/rpc/mobile-e2ee-v2-compressed-frame.test.ts": 75, "src/main/runtime/rpc/mobile-e2ee-v2-desktop-session.test.ts": 98, "src/main/runtime/rpc/mobile-socket-wiring.test.ts": 312, - "src/main/runtime/rpc/orcad-feature-readiness.test.ts": 40, "src/main/runtime/rpc/orchestration-11745-regression-verification.test.ts": 22874, "src/main/runtime/rpc/orchestration-check-wait-session.test.ts": 5096, "src/main/runtime/rpc/orchestration-commit-notify-characterization.test.ts": 5702, @@ -3426,7 +3419,6 @@ "src/main/runtime/rpc/remote-runtime-server-heartbeat-missed-probe-tolerance.test.ts": 59, "src/main/runtime/rpc/remote-runtime-server-heartbeat.test.ts": 60, "src/main/runtime/rpc/repo-add-cli.integration.test.ts": 1603, - "src/main/runtime/rpc/runtime-client-capabilities.test.ts": 43, "src/main/runtime/rpc/runtime-source-admission.test.ts": 909, "src/main/runtime/rpc/shadowed-port-probe.test.ts": 99, "src/main/runtime/rpc/static-web-client-handler-stream.test.ts": 1823, @@ -3471,7 +3463,6 @@ "src/main/runtime/rpc/unix-socket-transport.test.ts": 79, "src/main/runtime/rpc/unpaired-device-auth-throttle.test.ts": 42, "src/main/runtime/rpc/web-session-pairing.test.ts": 402, - "src/main/runtime/rpc/workspace-creator-context.test.ts": 40, "src/main/runtime/rpc/worktree-removal-marker-projection.test.ts": 497, "src/main/runtime/rpc/worktree-rm-cli.integration.test.ts": 6876, "src/main/runtime/rpc/ws-empty-payload-frame-write.test.ts": 117, @@ -3908,7 +3899,6 @@ "src/main/startup/configure-process.test.ts": 255, "src/main/startup/e2e-external-open-guard.test.ts": 44, "src/main/startup/e2e-spawn-log-env.test.ts": 89, - "src/main/startup/ensure-virtual-display.test.ts": 135, "src/main/startup/first-window-startup-services.test.ts": 54, "src/main/startup/gpu-fallback-marker.test.ts": 61, "src/main/startup/gpu-lifecycle-install-dir-acl-guard.test.ts": 641, @@ -4067,7 +4057,6 @@ "src/main/window/renderer-recovery-reload-watchdog.test.ts": 69, "src/main/window/runtime-renderer-notification-sender.test.ts": 54, "src/main/window/runtime-window-lifecycle-terminal-reveal.test.ts": 100, - "src/main/window/runtime-window-pane-title-notification.test.ts": 97, "src/main/window/session-tab-close-request-relay.test.ts": 74, "src/main/window/terminal-tab-close-request-relay.test.ts": 64, "src/main/window/updater-package-recovery-ipc.test.ts": 169, @@ -6177,7 +6166,6 @@ "src/shared/agent-status/process/agent-process-presence-platform.test.ts": 64, "src/shared/agent-launch/startup/agent-prompt-injection.test.ts": 88, "src/shared/agent-scratch-worktrees.test.ts": 61, - "src/shared/agent-session/agent-message-display-text.test.ts": 147, "src/shared/agent-session/agent-session-approval-blocked-path.test.ts": 49, "src/shared/agent-session/agent-session-attachments.test.ts": 46, "src/shared/agent-session/agent-session-context-clear.test.ts": 222, @@ -6245,7 +6233,6 @@ "src/shared/agent-status/transport/agent-status-osc.test.ts": 104, "src/shared/agent-status/store/agent-status-store-reopen.test.ts": 199, "src/shared/agent-status/title/agent-status-tracker-program-activity.test.ts": 77, - "src/shared/agent-launch/startup/agent-tui-input-clear.test.ts": 57, "src/shared/ai-vault/resume/ai-vault-resume-command.test.ts": 70, "src/shared/ai-vault/resume/ai-vault-resume-target.test.ts": 85, "src/shared/ai-vault/scanning/ai-vault-scope-paths.test.ts": 73, @@ -6256,7 +6243,6 @@ "src/shared/ai-vault/session-display/ai-vault-session-filters.test.ts": 176, "src/shared/ai-vault/resume/ai-vault-ssh-resume-target.test.ts": 84, "src/shared/ansi-escape-sequences-consumers.test.ts": 140, - "src/shared/ansi-escape-sequences.test.ts": 289, "src/shared/antigravity-generation-plan.test.ts": 122, "src/shared/automatic-work-run-marker.test.ts": 93, "src/shared/automation-cron-dialect.test.ts": 65, @@ -6289,7 +6275,6 @@ "src/shared/claude-background-task-status.test.ts": 315, "src/shared/claude-model-list-probe.test.ts": 55, "src/shared/claude-shell-function.test.ts": 220, - "src/shared/cli-runtime-pairing-inputs.test.ts": 64, "src/shared/cloud-service-url.test.ts": 37, "src/shared/coalescing-keyed-runner.test.ts": 119, "src/shared/codebuddy-agent.test.ts": 301, @@ -6324,14 +6309,12 @@ "src/shared/ephemeral-vm-recipe-checkout-mode.test.ts": 106, "src/shared/ephemeral-vm-recipe-output-capture.test.ts": 287, "src/shared/ephemeral-vm-recipe-process.test.ts": 198, - "src/shared/ephemeral-vm-recipe-repo-url.test.ts": 56, "src/shared/ephemeral-vm-recipes.test.ts": 160, "src/shared/ephemeral-vm-runtime-store-rollback.test.ts": 321, "src/shared/ephemeral-vm-runtime-store.test.ts": 195, "src/shared/execution-host-registry-shared-control-connect.test.ts": 160, "src/shared/execution-host-registry.test.ts": 169, "src/shared/execution-host.test.ts": 56, - "src/shared/external-automation-jobs-file.test.ts": 72, "src/shared/external-worktree-inbox.test.ts": 69, "src/shared/feature-education-telemetry.test.ts": 36, "src/shared/feature-tips.test.ts": 54, @@ -6430,7 +6413,6 @@ "src/shared/keybindings-digit-index.test.ts": 110, "src/shared/keybindings-double-tap.test.ts": 92, "src/shared/keybindings-keyboard-layout.test.ts": 86, - "src/shared/keybindings-parse-cache.test.ts": 61, "src/shared/keybindings-parsing.test.ts": 86, "src/shared/keybindings-unassigned-actions.test.ts": 73, "src/shared/kiro-home.test.ts": 39, @@ -6568,7 +6550,6 @@ "src/shared/opencode-tui-plugin-install.test.ts": 82, "src/shared/openssh-default-shell.test.ts": 54, "src/shared/orca-browser-cli-commands.test.ts": 59, - "src/shared/orca-cli-command-name.test.ts": 41, "src/shared/orca-hook-setup-config.test.ts": 38, "src/shared/orca-session-address.test.ts": 154, "src/shared/orca-yaml-alias-bounds.test.ts": 425, @@ -6737,7 +6718,6 @@ "src/shared/remote-runtime/requests/remote-runtime-subscription-frame-router.test.ts": 143, "src/shared/remote-runtime/requests/remote-runtime-subscription-request.test.ts": 646, "src/shared/renderer-restart-preparation.test.ts": 197, - "src/shared/repo-display-labels.test.ts": 57, "src/shared/repo-host-identity.test.ts": 45, "src/shared/repo-icon.test.ts": 82, "src/shared/repo-pack-index-scheduling.test.ts": 67, @@ -6841,7 +6821,6 @@ "src/shared/terminal/protocol/queries/terminal-color-scheme-protocol.test.ts": 39, "src/shared/terminal/input/terminal-composer-draft.test.ts": 73, "src/shared/terminal/links/terminal-file-uri-link.test.ts": 51, - "src/shared/terminal/links/terminal-file-url-target.test.ts": 47, "src/shared/terminal/links/terminal-github-pr-link-detector.test.ts": 61, "src/shared/terminal/links/terminal-http-url-extraction.test.ts": 42, "src/shared/terminal/input/terminal-input.test.ts": 85, @@ -6917,7 +6896,6 @@ "src/shared/workspace-attachments/workspace-attachment-origins.test.ts": 42, "src/shared/workspace-attachments/workspace-attachments.test.ts": 204, "src/shared/workspace-cleanup/workspace-cleanup-browse-state-persistence.test.ts": 55, - "src/shared/workspace-last-active-switch-on.test.ts": 52, "src/shared/workspace-layout/old-client/old-client-method-translation.test.ts": 352, "src/shared/workspace-layout/old-client/old-client-pane-layout-translation.test.ts": 363, "src/shared/workspace-layout/old-client/old-client-session-tabs-projection-owned-editor.test.ts": 178, @@ -7030,7 +7008,6 @@ "src/wsl-guest/wsl-install-plugins-handler.test.ts": 283, "tests/e2e/SmartWorkspaceSourceResultList.linear-auth.unit.test.ts": 1976, "tests/e2e/SmartWorkspaceSourceResultList.linear-read-error.unit.test.ts": 3757, - "tests/e2e/agent-launch-cli.unit.test.ts": 2379, "tests/e2e/agent-launch-setup-choice.unit.test.ts": 2657, "tests/e2e/ai-vault-manual-name-clear.unit.test.ts": 21206, "tests/e2e/automation-chat-reopen.unit.test.ts": 6262, diff --git a/config/scripts/ci/unit-selection/check-test-file-runners.mjs b/config/scripts/ci/unit-selection/check-test-file-runners.mjs index 09f620398b7..c47bc154254 100644 --- a/config/scripts/ci/unit-selection/check-test-file-runners.mjs +++ b/config/scripts/ci/unit-selection/check-test-file-runners.mjs @@ -84,7 +84,7 @@ const NON_UNIT_TEST_RUNNERS = [ // `orca plugin test` runs every example's own tests in Node; the unit test drives it. name: 'example plugin tests (orca plugin test)', include: ['examples/plugins/*/src/**/*.test.ts', 'examples/plugins/*/src/**/*.test.tsx'], - sources: ['src/cli/plugin-authoring/plugin-test-runner.test.ts'], + sources: ['src/cli/plugins/authoring/plugin-test-runner.test.ts'], mirrors: ['readdirSync(EXAMPLES)'] }, { 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 ebde67a476a..8613ec9468f 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 @@ -37,8 +37,8 @@ export const UNIT_EXCLUDE = [ 'src/main/pty/shell-startup/zsh-startup-hook-user-config-equivalence.live-shell.test.ts', 'src/main/runtime/terminal/wait/tui-idle-zsh-preexec-hook-order.live-shell.test.ts', 'src/main/runtime/agent-session/environment/structured-session-cli-login-shell.live-shell.test.ts', - 'src/main/startup/shell-probe-terminal-detach.live-shell.test.ts', - 'src/main/startup/shell-probe-lifetime.live-shell.test.ts', + 'src/main/startup/shell-environment/shell-probe-terminal-detach.live-shell.test.ts', + 'src/main/startup/shell-environment/shell-probe-lifetime.live-shell.test.ts', 'src/renderer/src/components/terminal-pane/pty-connection/emulation/fish-color-scheme-child-stdin.node-pty.test.ts', 'src/shared/fish-wsl-cwd-report.node-pty.test.ts', 'src/main/wsl/filesystem/wsl-sh-cwd-report.node-pty.test.ts', @@ -52,7 +52,6 @@ export const UNIT_EXCLUDE = [ 'src/main/browser/guest-lifecycle/popups/presentation/popup-origin-chrome.electron.test.ts', 'src/main/browser/guest-lifecycle/navigation/browser-link-materialization.electron.test.ts', 'src/main/browser/client-pages/renderer/browser-client-page-renderer-lifecycle.electron.test.ts', - 'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-compatibility.electron.test.ts', 'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-native-compatibility.electron.test.ts', 'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-background-compatibility.electron.test.ts', 'src/main/browser/extensions/api-runtime/browser-extension-api.electron.test.ts', diff --git a/src/main/startup/__fixtures__/electron-vite-dev-grandchild.mjs b/config/scripts/development/launch/fixtures/electron-vite-dev-grandchild.mjs similarity index 100% rename from src/main/startup/__fixtures__/electron-vite-dev-grandchild.mjs rename to config/scripts/development/launch/fixtures/electron-vite-dev-grandchild.mjs diff --git a/src/main/startup/__fixtures__/fake-electron-vite-dev-cli.mjs b/config/scripts/development/launch/fixtures/fake-electron-vite-dev-cli.mjs similarity index 100% rename from src/main/startup/__fixtures__/fake-electron-vite-dev-cli.mjs rename to config/scripts/development/launch/fixtures/fake-electron-vite-dev-cli.mjs diff --git a/src/main/startup/run-electron-vite-dev.test.ts b/config/scripts/development/launch/run-electron-vite-dev.test.ts similarity index 96% rename from src/main/startup/run-electron-vite-dev.test.ts rename to config/scripts/development/launch/run-electron-vite-dev.test.ts index a25b5b79e5c..119815d5f67 100644 --- a/src/main/startup/run-electron-vite-dev.test.ts +++ b/config/scripts/development/launch/run-electron-vite-dev.test.ts @@ -183,7 +183,9 @@ describe('run-electron-vite-dev', () => { const tempDir = mkdtempSync(join(tmpdir(), 'orca-dev-wrapper-')) const pidFile = join(tempDir, 'grandchild.pid') const wrapperPath = resolve('config/scripts/development/launch/run-electron-vite-dev.mjs') - const fakeCliPath = resolve('src/main/startup/__fixtures__/fake-electron-vite-dev-cli.mjs') + const fakeCliPath = resolve( + 'config/scripts/development/launch/fixtures/fake-electron-vite-dev-cli.mjs' + ) const wrapper = spawn(process.execPath, [wrapperPath], { cwd: resolve('.'), @@ -228,7 +230,9 @@ describe('run-electron-vite-dev', () => { async () => { const tempDir = mkdtempSync(join(tmpdir(), 'orca-dev-wrapper-')) const wrapperPath = resolve('config/scripts/development/launch/run-electron-vite-dev.mjs') - const fakeCliPath = resolve('src/main/startup/__fixtures__/fake-electron-vite-dev-cli.mjs') + const fakeCliPath = resolve( + 'config/scripts/development/launch/fixtures/fake-electron-vite-dev-cli.mjs' + ) const baseEnv = devWrapperTestEnv({ ORCA_ELECTRON_VITE_CLI: fakeCliPath, ORCA_SKIP_DEV_CLI_PREPARE: '1', @@ -302,7 +306,9 @@ describe('run-electron-vite-dev', () => { const pidFile = join(tempDir, 'grandchild.pid') const envFile = join(tempDir, 'env.json') const wrapperPath = resolve('config/scripts/development/launch/run-electron-vite-dev.mjs') - const fakeCliPath = resolve('src/main/startup/__fixtures__/fake-electron-vite-dev-cli.mjs') + const fakeCliPath = resolve( + 'config/scripts/development/launch/fixtures/fake-electron-vite-dev-cli.mjs' + ) const { wrapper, readOutput } = spawnDevWrapper( [wrapperPath, '--remote-debugging-port=9448'], diff --git a/config/scripts/locale-catalog/locale-ko-key-overrides.json b/config/scripts/locale-catalog/locale-ko-key-overrides.json index 17a81bd49a0..89984c2df99 100644 --- a/config/scripts/locale-catalog/locale-ko-key-overrides.json +++ b/config/scripts/locale-catalog/locale-ko-key-overrides.json @@ -4715,21 +4715,9 @@ "auto.components.settings.ZcodePlanAccountsSection.detailsUnavailable": { "ko": "요금제 자격 증명 세부 정보는 Orca를 실행 중인 컴퓨터에서만 볼 수 있습니다." }, - "accounts.antigravity.signIn": { - "ko": "이 호스트에서 agy를 실행하고 브라우저 로그인을 완료한 후 현재 계정을 저장하세요. 다른 계정을 추가하려면 agy에서 /logout 명령을 실행하고 다시 로그인하세요." - }, - "accounts.antigravity.signedOut": { - "ko": "로그인된 agy 자체 계정이 없습니다." - }, "accounts.antigravity.changed": { "ko": "agy 자체 계정이 변경되었습니다. agy를 시작하기 전에 저장된 계정을 다시 선택하세요." }, - "accounts.antigravity.save": { - "ko": "현재 계정 저장" - }, - "accounts.antigravity.sessions": { - "ko": "선택한 계정은 이 호스트의 새 agy 세션에 적용됩니다. 기존 세션은 이전 계정을 계속 사용할 수 있습니다." - }, "accounts.antigravity.keyword.antigravity": { "ko": "antigravity" }, diff --git a/config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs b/config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs index be3dd5d8541..a24179060cd 100644 --- a/config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs +++ b/config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs @@ -30,10 +30,6 @@ describe('native dialog localization coverage', () => { ]) }) - it('does not change the existing renderer scan by default', () => { - expect(collectLocalizationCandidates(path, source, '/repo')).toEqual([]) - }) - it('fails the opt-in check for a new native dialog literal', async () => { const root = await mkdtemp(join(tmpdir(), 'orca-native-localization-')) const report = vi.spyOn(console, 'error').mockImplementation(() => {}) diff --git a/config/scripts/mobile-web-app/preview/mobile-web-app-html-preview-render.test.mjs b/config/scripts/mobile-web-app/preview/mobile-web-app-html-preview-render.test.mjs index 5c354c8f125..ebf5a689287 100644 --- a/config/scripts/mobile-web-app/preview/mobile-web-app-html-preview-render.test.mjs +++ b/config/scripts/mobile-web-app/preview/mobile-web-app-html-preview-render.test.mjs @@ -236,20 +236,6 @@ for (const engine of ['chromium', 'webkit']) { expect(sealed.reported.join(' ')).not.toContain('script-src') }, 180_000) - it('loads the artifact https images the directive admits, and still refuses its font', async (ctx) => { - // Await both images explicitly; bounded settle once observed background before element on loaded Chrome. - const read = await open(browser(), { - assets: assetServer.origin, - frameReady: 'images', - signal: ctx.signal - }) - expect(read.pixel).toBe(ARTIFACT_RGB) - // img-src governs CSS background and img element; require both requests. - expect([...read.secureHits].sort()).toEqual(['/css-bg.png', '/img.png']) - // Same HTTPS origin still cannot load font; img-src admission must not widen font-src. - expect(read.secureHits).not.toContain('/probe.woff2') - }, 120_000) - it('sends no referrer with an admitted https image, which is the shell header doing it', async (ctx) => { const sealed = await open(browser(), { assets: assetServer.origin, @@ -384,109 +370,6 @@ for (const engine of ['chromium', 'webkit']) { expect(read.popups).toBe(0) }, 120_000) - it("cannot reach the shell through a meta refresh at the embedder's own URL", async (ctx) => { - // Same-origin meta-refresh targets shell document; foreign-origin arm cannot prove shell-origin counter works. - const own = await open(browser(), { - signal: ctx.signal, - extra: { head: '' } - }) - // Require painted artifact before interpreting navigation refusal. - expect(own.pixelBefore).toBe(ARTIFACT_RGB) - // Link-to-/ control reads one on same counter, proving refresh zero is observable. - expect(own.ownOriginTopNavigations).toBe(0) - expect(own.topNavigations).toBe(0) - // Also reject self-frame shell-document fetch, which would embed session page inside preview. - expect(own.ownOriginFrameNavigations).toBe(0) - - // No-policy/allow-same-origin control must navigate frame to shell / to prove observer is not blind. - const loose = await open(browser(), { - signal: ctx.signal, - csp: null, - sandbox: 'allow-scripts allow-same-origin allow-top-navigation', - extra: { head: '' }, - // Navigating arm no longer contains marker; await navigation instead of artifact readiness. - frameReady: 'load', - expectNavigation: 'frame' - }) - expect(loose.ownOriginFrameNavigations).toBe(1) - - // Test sandbox token alone with no CSP; navigation must never begin or report. - const tokenOnly = await open(browser(), { - signal: ctx.signal, - csp: null, - extra: { head: '' } - }) - expect(tokenOnly.pixelBefore).toBe(ARTIFACT_RGB) - expect(tokenOnly.ownOriginFrameNavigations).toBe(0) - expect(tokenOnly.ownOriginTopNavigations).toBe(0) - expect(tokenOnly.violations).toEqual([]) - - // Test CSP alone with allow-same-origin: frame-src none blocks request at embedder; engines leave different content, so assert no server request. - const policyOnly = await open(browser(), { - signal: ctx.signal, - sandbox: 'allow-scripts allow-same-origin allow-top-navigation', - extra: { head: '' }, - frameReady: 'load' - }) - expect(policyOnly.ownOriginFrameNavigations).toBe(0) - expect(policyOnly.ownOriginTopNavigations).toBe(0) - expect(policyOnly.violations.join(' ')).toContain('frame-src') - }, 180_000) - - it('hands up nothing without a tap, and nothing for a form or a new window', async (ctx) => { - const meta = await open(browser(), { - signal: ctx.signal, - extra: { head: `` } - }) - expect(meta.topNavigations).toBe(0) - expect(meta.ownOriginTopNavigations).toBe(0) - const form = await open(browser(), { - signal: ctx.signal, - act: async ({ frame }) => { - await frame.click('#submit', { timeout: 2000 }) - } - }) - expect(form.actError).toBeNull() - expect(form.pixelBefore).toBe(ARTIFACT_RGB) - expect(form.topNavigations).toBe(0) - const blank = await open(browser(), { - signal: ctx.signal, - act: async ({ frame }) => { - await frame.click('#blanklink', { timeout: 2000 }) - } - }) - expect(blank.actError).toBeNull() - expect(blank.pixelBefore).toBe(ARTIFACT_RGB) - expect(blank.topNavigations).toBe(0) - expect(blank.popups).toBe(0) - const allowedForm = await open(browser(), { - signal: ctx.signal, - csp: null, - sandbox: 'allow-forms allow-top-navigation-by-user-activation', - expectNavigation: 'main-frame', - act: async ({ frame }) => { - await frame.click('#submit', { timeout: 2000 }) - } - }) - expect(allowedForm.pixelBefore).toBe(ARTIFACT_RGB) - expect(allowedForm.actError).toBeNull() - expect(allowedForm.topNavigations).toBe(1) - const allowedBlank = await open(browser(), { - signal: ctx.signal, - csp: null, - sandbox: 'allow-popups allow-popups-to-escape-sandbox', - act: async ({ page, frame }) => { - await Promise.all([ - page.waitForEvent('popup', { timeout: 10_000 }), - frame.click('#blanklink', { timeout: 2000 }) - ]) - } - }) - expect(allowedBlank.pixelBefore).toBe(ARTIFACT_RGB) - expect(allowedBlank.actError).toBeNull() - expect(allowedBlank.popups).toBe(1) - }, 180_000) - // Force slow-arm diagnostic sampling branch; formerly unexecuted branch had out-of-scope name and no test/lint coverage. // Force bounded navigation timeout after missed click; require useful diagnostic instead of exhausting whole case budget. diff --git a/config/scripts/mobile-web-app/session/mobile-web-app-native-chat-touch-scroll-render.test.mjs b/config/scripts/mobile-web-app/session/mobile-web-app-native-chat-touch-scroll-render.test.mjs new file mode 100644 index 00000000000..72f2380b7ed --- /dev/null +++ b/config/scripts/mobile-web-app/session/mobile-web-app-native-chat-touch-scroll-render.test.mjs @@ -0,0 +1,141 @@ +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 } from 'playwright-core' +import { + 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' + +// The phone's web pages must pan the transcript by touch and give a pinch to its text-size detector, not page zoom. +const mobileDir = fileURLToPath(new URL('../../../../mobile', import.meta.url)) + +const entry = ` +import { createRoot } from 'react-dom/client' +import { Text, View } from 'react-native' +import { GestureHandlerRootView } from 'react-native-gesture-handler' +import { MobileNativeChatPageScroll } from './src/session/native-chat/transcript/MobileNativeChatPageScroll' +import { + MobileNativeChatPinchZoom, + useMobileNativeChatPinchGesture +} from './src/session/native-chat/transcript/mobile-native-chat-pinch-zoom' + +function Transcript() { + const { fontScale, pinchGesture } = useMobileNativeChatPinchGesture('chat') + return + {fontScale} + + + + {Array.from({ length: 60 }, (_, i) => message {i})} + + + + +} +createRoot(document.getElementById('root')).render() +` + +const bundles = mobileWebAppDependenciesPresent() +const describeRender = bundles ? describe : describe.skip +let scratch +let server +let origin +let browser + +beforeAll(async () => { + if (!bundles) { + return + } + await mkdir(join(mobileDir, '.tmp'), { recursive: true }) + scratch = await mkdtemp(join(mobileDir, '.tmp', 'chat-touch-scroll-')) + const outDir = join(scratch, 'bundle') + await esbuild.build({ + ...mobileWebAppBuildOptions([]), + entryPoints: undefined, + stdin: { contents: entry, resolveDir: mobileDir, loader: 'tsx', sourcefile: 'transcript.tsx' }, + splitting: false, + write: true, + outdir: outDir, + entryNames: 'transcript', + metafile: false + }) + await writeFile( + join(outDir, 'index.html'), + '' + + '' + + `${MOBILE_WEB_APP_ROOT_RESET}` + + '
' + ) + 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 touch(page, steps) { + const cdp = await page.context().newCDPSession(page) + const [first, ...rest] = steps + await cdp.send('Input.dispatchTouchEvent', { type: 'touchStart', touchPoints: first }) + for (const touchPoints of rest) { + await cdp.send('Input.dispatchTouchEvent', { type: 'touchMove', touchPoints }) + await page.evaluate(() => new Promise(requestAnimationFrame)) + } + await cdp.send('Input.dispatchTouchEvent', { type: 'touchEnd', touchPoints: [] }) + await cdp.detach() +} + +const frames = (count, at) => Array.from({ length: count + 1 }, (_, step) => at(step / count)) + +async function openTranscript() { + const context = await browser.newContext({ + viewport: { width: 390, height: 844 }, + hasTouch: true, + isMobile: true + }) + const page = await context.newPage() + await page.goto(`${origin}/`) + await page.getByTestId('transcript').waitFor() + return page +} + +describeRender('native chat transcript in the phone web pages', () => { + it('pans the transcript under one finger', async () => { + const page = await openTranscript() + await touch( + page, + frames(10, (t) => [{ x: 195, y: 200 + 300 * t }]) + ) + await expect + .poll(() => page.getByTestId('transcript').evaluate((element) => element.scrollTop)) + .toBeLessThan(-100) + await page.context().close() + }) + + it('gives a pinch to the text size, not to page zoom', async () => { + const page = await openTranscript() + await touch( + page, + frames(10, (t) => [ + { x: 195, y: 330 - 120 * t, id: 0 }, + { x: 195, y: 370 + 120 * t, id: 1 } + ]) + ) + await expect.poll(() => page.getByTestId('font-scale').textContent()).not.toBe('1') + expect(await page.evaluate(() => window.visualViewport.scale)).toBe(1) + await page.context().close() + }) +}) diff --git a/config/scripts/mobile-web-app/session/mobile-web-app-rich-markdown-render.test.mjs b/config/scripts/mobile-web-app/session/mobile-web-app-rich-markdown-render.test.mjs index afa460518b3..af884f5aa77 100644 --- a/config/scripts/mobile-web-app/session/mobile-web-app-rich-markdown-render.test.mjs +++ b/config/scripts/mobile-web-app/session/mobile-web-app-rich-markdown-render.test.mjs @@ -16,31 +16,12 @@ import { mobileWebAppDependenciesPresent } from '../mobile-web-app-bundle-depend import { createBundleServer, installCspViolationRecorder, - installListenerRecorder, readShellCsp } from '../preview/mobile-web-app-render-harness.mjs' const mobileDir = fileURLToPath(new URL('../../../../mobile', import.meta.url)) const componentDir = join(mobileDir, 'src/components') -const COMMANDS = [ - { label: 'H1', command: 'heading1', select: 'all', expect: 'h1' }, - { label: 'H2', command: 'heading2', select: 'all', expect: 'h2' }, - { label: 'H3', command: 'heading3', select: 'all', expect: 'h3' }, - { label: 'Bold', command: 'bold', select: 'word', expect: 'b,strong' }, - { label: 'Italic', command: 'italic', select: 'word', expect: 'i,em' }, - { label: 'Strike', command: 'strike', select: 'word', expect: 'strike,s,del' }, - { label: 'Bullet list', command: 'bulletList', select: 'all', expect: 'ul' }, - { label: 'Numbered list', command: 'orderedList', select: 'all', expect: 'ol' }, - { label: 'Checklist', command: 'taskList', select: 'all', expect: 'ul[data-type="taskList"]' }, - { label: 'Quote', command: 'quote', select: 'all', expect: 'blockquote' }, - { label: 'Inline code', command: 'inlineCode', select: 'word', expect: 'code' }, - { label: 'Code block', command: 'codeBlock', select: 'all', expect: 'pre' } -] - -// Paragraph undoes another command; starting from p would prove nothing. -const PARAGRAPH = { label: 'Body', command: 'paragraph' } - // Serve inserted image locally: nonexistent URL logs WebKit load failure; successful paint proves shipped CSP admits it. const IMAGE_PATH = '/inserted.png' const URL_COMMANDS = [ @@ -151,21 +132,6 @@ function Harness() { createRoot(document.getElementById('root')).render(createElement(Harness)) ` -// Install ReactNativeWebView recorder before bundle: absence alone cannot prove editor JSON avoids shell bridge if bridge object never existed. -function installBridgeObjectRecorder() { - globalThis.__orcaBridgeReads = [] - const bridge = { - postMessage: (message) => globalThis.__orcaBridgeReads.push(`post ${String(message)}`) - } - Object.defineProperty(globalThis, 'ReactNativeWebView', { - configurable: true, - get: () => { - globalThis.__orcaBridgeReads.push('read') - return bridge - } - }) -} - const bundles = mobileWebAppDependenciesPresent() const describeEditor = bundles ? describe : describe.skip @@ -256,9 +222,7 @@ async function openPage(browser) { } }) page.on('pageerror', (error) => consoleErrors.push(`pageerror: ${error.message}`)) - await page.addInitScript(installBridgeObjectRecorder) await page.addInitScript(installCspViolationRecorder) - await page.addInitScript(installListenerRecorder, { selector: '#editor' }) await page.goto(`${origin}/`, { waitUntil: 'domcontentloaded' }) await page.waitForFunction(() => document.body.dataset.ready === 'yes') await page.waitForSelector('#first-surface #editor') @@ -326,89 +290,7 @@ describeEditor( afterAll(() => browser?.close()) - it('mounts the document, reports ready through the seam and never touches the bridge', async () => { - const { page, consoleErrors } = await openPage(browser) - try { - await setContent(page, '# Title', '

Title

') - expect(await readSurface(page)).toBe('

Title

') - // Initial markup proves document ready reached controller and pushed content through seam. - expect(await page.evaluate(() => globalThis.__orcaBridgeReads)).toEqual([]) - expect(await page.evaluate(() => globalThis.__orcaCspViolations)).toEqual([]) - expect(consoleErrors).toEqual([]) - // No editor occlusion report: screen’s web module already measures viewport, so reporting twice would lift bar twice. - expect(await page.evaluate(() => globalThis.__orcaEditor.insets)).toEqual([]) - } finally { - await page.close() - } - }, 600_000) - - it('runs every one of the fifteen commands against the document', async () => { - const { page, consoleErrors } = await openPage(browser) - try { - for (const [index, entry] of COMMANDS.entries()) { - const body = bodyFor(index) - await setContent(page, body, `

${body}

`) - // Require command effect absent beforehand or undelivered command could pass on previous document. - expect( - await page.evaluate( - (selector) => - document.querySelector('#first-surface #editor')?.querySelector(selector), - entry.expect - ), - `${entry.label} was already applied before it ran` - ).toBeNull() - await select(page, entry.select) - await press(page, entry.label) - await page.waitForFunction( - (selector) => - document.querySelector('#first-surface #editor')?.querySelector(selector) !== - null, - entry.expect, - { timeout: 15_000 } - ) - } - - // Paragraph must undo another block type; it is a no-op on p. - await setContent(page, '# Title', '

Title

') - await select(page, 'all') - await press(page, PARAGRAPH.label) - await page.waitForFunction( - () => - document.querySelector('#first-surface #editor')?.querySelector('h1') === null && - document.querySelector('#first-surface #editor')?.querySelector('p') !== null, - null, - { timeout: 15_000 } - ) - - expect(await page.evaluate(() => globalThis.__orcaCspViolations)).toEqual([]) - expect(consoleErrors).toEqual([]) - } finally { - await page.close() - } - }, 600_000) - // Both engines nest unordered list inside existing p; inline paragraph serialization once dropped bullet when saved. - it('edits and selects under the shipped document style, which makes other text unselectable', async () => { - const { page, consoleErrors } = await openPage(browser) - try { - await setContent(page, 'alpha', '

alpha

') - const word = page.locator('#first-surface #editor p') - await word.click() - await page.keyboard.press('End') - await page.keyboard.type(' bravo') - await page.waitForFunction( - () => - document.querySelector('#first-surface #editor p')?.textContent === 'alpha bravo' - ) - // Use browser gesture: a scripted Range bypasses body user-select:none. - await page.evaluate(() => window.getSelection()?.removeAllRanges()) - await word.dblclick() - expect(await page.evaluate(() => window.getSelection()?.toString().trim())).not.toBe('') - expect(consoleErrors).toEqual([]) - } finally { - await page.close() - } - }, 600_000) it('reports a typed bullet list as a list, and renders that markdown back as one', async () => { const { page, consoleErrors } = await openPage(browser) diff --git a/config/scripts/node-server/qualification/node-server-change-scope.test.mjs b/config/scripts/node-server/qualification/node-server-change-scope.test.mjs index 29172c0ad5c..0818dcbded8 100644 --- a/config/scripts/node-server/qualification/node-server-change-scope.test.mjs +++ b/config/scripts/node-server/qualification/node-server-change-scope.test.mjs @@ -74,23 +74,6 @@ it('tracks workspace source and manifest closures without trusting dist or widen ).toBe(false) }) -it('checks ordinary source unit files against actual imports before skipping the matrix', async () => { - const reachable = 'src/main/persistence/example/used.test.ts' - const unrelated = 'src/main/persistence/example/unrelated.test.tsx' - const removed = 'src/main/persistence/example/removed.test.ts' - const root = moduleTree({ - 'entry.ts': `import './${reachable}'; throw Error('never execute')`, - [reachable]: 'export const value = 1', - [unrelated]: 'throw Error("never execute unrelated test")' - }) - const inputs = await collectNodeServerInputs({ root, entryPoints: ['entry.ts'] }) - expect(inputs.has(reachable)).toBe(true) - expect(inputs.has(unrelated)).toBe(false) - expect((await classifyNodeServerChanges([reachable], async () => inputs)).shouldRun).toBe(true) - expect((await classifyNodeServerChanges([unrelated], async () => inputs)).shouldRun).toBe(false) - expect((await classifyNodeServerChanges([removed], async () => inputs)).shouldRun).toBe(false) -}) - it('retains qualification when a removed ordinary unit file breaks an actual import', async () => { const removed = 'src/main/persistence/example/removed.test.ts' const root = moduleTree({ 'entry.ts': `import './${removed}'` }) diff --git a/config/scripts/performance/session-transcripts/session-dedup-batches-benchmark.mjs b/config/scripts/performance/session-transcripts/session-dedup-batches-benchmark.mjs index 44a0bbd187c..6dac3efbbf3 100644 --- a/config/scripts/performance/session-transcripts/session-dedup-batches-benchmark.mjs +++ b/config/scripts/performance/session-transcripts/session-dedup-batches-benchmark.mjs @@ -5,7 +5,7 @@ import { buildCounterbalancedSchedule } from '../measurement/counterbalanced-ben const bundled = await build({ stdin: { - contents: "export * from './src/main/ai-vault/session-root-dedup.ts'", + contents: "export * from './src/main/ai-vault/parsing/session-root-dedup.ts'", resolveDir: process.cwd(), loader: 'ts' }, diff --git a/config/scripts/performance/session-transcripts/session-scan-cutoff-benchmark.mjs b/config/scripts/performance/session-transcripts/session-scan-cutoff-benchmark.mjs index b7311577324..07e54291087 100644 --- a/config/scripts/performance/session-transcripts/session-scan-cutoff-benchmark.mjs +++ b/config/scripts/performance/session-transcripts/session-scan-cutoff-benchmark.mjs @@ -32,10 +32,10 @@ async function load(contents) { return import(`data:text/javascript;base64,${encoded}`) } const [baselineModule, currentModule] = await Promise.all([ - load(`import { sessionSortTime } from './session-scanner-accumulator'; + load(`import { sessionSortTime } from './parsing/session-scanner-accumulator'; export ${baselineFunction.getText(baselineSource)}`), - load(`export { canStopParsingSessions } from './session-scan-cutoff'; -export { ScannedSessionCollection } from './session-root-dedup';`) + load(`export { canStopParsingSessions } from './parsing/session-scan-cutoff'; +export { ScannedSessionCollection } from './parsing/session-root-dedup';`) ]) const baseline = baselineModule.canStopParsingSessions const current = currentModule.canStopParsingSessions diff --git a/config/scripts/performance/session-transcripts/session-timeline-benchmark.mjs b/config/scripts/performance/session-transcripts/session-timeline-benchmark.mjs index 7e53173fcaf..71373dbab13 100644 --- a/config/scripts/performance/session-transcripts/session-timeline-benchmark.mjs +++ b/config/scripts/performance/session-transcripts/session-timeline-benchmark.mjs @@ -1,28 +1,81 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' -import { dirname, resolve } from 'node:path' +import { mkdtemp, rm, writeFile } from 'node:fs/promises' +import { createRequire } from 'node:module' +import { tmpdir } from 'node:os' +import { dirname, join, resolve } from 'node:path' import { performance } from 'node:perf_hooks' import { build } from 'esbuild' import { buildCounterbalancedSchedule } from '../measurement/counterbalanced-benchmark-schedule.mjs' import { summarizeBenchmarkSamples } from '../measurement/benchmark-sample-summary.mjs' +import ts from 'typescript-api' + +const baselineSourcePathArgument = process.argv.find((arg) => + arg.startsWith('--baseline-source-path=') +) +const baselineSourcePath = resolve( + baselineSourcePathArgument?.slice('--baseline-source-path='.length) ?? + 'src/main/ai-vault/session-scanner-accumulator.ts' +) + +function retargetLegacyAccumulatorValueImports(source) { + const program = ts.createSourceFile(baselineSourcePath, source, ts.ScriptTarget.Latest, true) + assert.equal(program.parseDiagnostics.length, 0, 'Baseline source must parse') + const replacements = [] + for (const statement of program.statements) { + if (!ts.isImportDeclaration(statement) || !ts.isStringLiteral(statement.moduleSpecifier)) { + continue + } + if ( + resolve(dirname(baselineSourcePath), statement.moduleSpecifier.text) !== + resolve('src/main/ai-vault/session-scanner-values') + ) { + continue + } + const clause = statement.importClause + assert( + clause && !clause.name && clause.namedBindings && ts.isNamedImports(clause.namedBindings) + ) + const imports = clause.namedBindings.elements.map((binding) => { + const name = (binding.propertyName ?? binding.name).text + const owner = + name === 'extractString' + ? 'src/shared/trimmed-string.ts' + : name === 'timestampMs' + ? 'src/main/ai-vault/parsing/session-record-time.ts' + : null + assert(owner, `Unsupported historical accumulator value import: ${name}`) + return `import ${clause.isTypeOnly ? 'type ' : ''}{ ${binding.getText(program)} } from ${JSON.stringify(resolve(owner))}` + }) + replacements.push({ + start: statement.getStart(program), + end: statement.end, + text: imports.join('\n') + }) + } + for (const replacement of replacements.toReversed()) { + source = source.slice(0, replacement.start) + replacement.text + source.slice(replacement.end) + } + return source +} // git show :src/main/ai-vault/session-scanner-accumulator.ts | node config/scripts/session-timeline-benchmark.mjs -const target = resolve('src/main/ai-vault/session-scanner-accumulator.ts') -async function load(source) { +const target = resolve('src/main/ai-vault/parsing/session-scanner-accumulator.ts') +async function load(source, sourcePath = target) { const result = await build({ stdin: { contents: ` export {createAccumulator, cloneSessionAccumulator, updateTimeline, finalizeSession} from './session-scanner-accumulator'; export {createClaudeSessionParseState, consumeClaudeSessionLine} - from './session-scanner-primary-parsers';`, + from '../scanners/claude/session-scanner-primary-parsers';`, loader: 'ts', resolveDir: dirname(target) }, bundle: true, write: false, platform: 'node', - format: 'esm', + format: 'cjs', plugins: [ { name: 'timeline-baseline', @@ -30,18 +83,26 @@ async function load(source) { plugin.onLoad({ filter: /session-scanner-accumulator\.ts$/ }, () => ({ contents: source, loader: 'ts', - resolveDir: dirname(target) + resolveDir: dirname(sourcePath) })) } } ] }) - return import( - `data:text/javascript;base64,${Buffer.from(result.outputFiles[0].text).toString('base64')}` - ) + const directory = await mkdtemp(join(tmpdir(), 'orca-session-timeline-')) + try { + const file = join(directory, 'timeline.cjs') + await writeFile(file, result.outputFiles[0].text) + return createRequire(import.meta.url)(file) + } finally { + await rm(directory, { recursive: true, force: true }) + } } const implementations = { - before: await load(readFileSync(0, 'utf8')), + before: await load( + retargetLegacyAccumulatorValueImports(readFileSync(0, 'utf8')), + baselineSourcePath + ), after: await load(readFileSync(target, 'utf8')) } const file = { path: 'timeline.jsonl', mtimeMs: 0, modifiedAt: '2026-01-01T00:00:00.000Z' } diff --git a/config/scripts/performance/terminal-stream/terminal-output-frame-chunk-benchmark.mjs b/config/scripts/performance/terminal-stream/terminal-output-frame-chunk-benchmark.mjs index 3869c703a5f..555e1bc69cb 100644 --- a/config/scripts/performance/terminal-stream/terminal-output-frame-chunk-benchmark.mjs +++ b/config/scripts/performance/terminal-stream/terminal-output-frame-chunk-benchmark.mjs @@ -50,7 +50,10 @@ if (ROUNDS % 2 !== 0) { } const CHUNK_SOURCE = readFileSync( - new URL('../../../../src/main/runtime/rpc/terminal-output-frame-chunks.ts', import.meta.url), + new URL( + '../../../../src/main/runtime/rpc/terminal/terminal-output-frame-chunks.ts', + import.meta.url + ), 'utf8' ) @@ -101,7 +104,10 @@ const { TerminalStreamOpcode, encodeTerminalStreamJson, encodeTerminalStreamText .href ) const { exceedsTerminalStreamChunkBytes, iterateTerminalOutputFrameChunks } = await import( - new URL('../../../../src/main/runtime/rpc/terminal-output-frame-chunks.ts', import.meta.url).href + new URL( + '../../../../src/main/runtime/rpc/terminal/terminal-output-frame-chunks.ts', + import.meta.url + ).href ) function previousGate(data) { diff --git a/config/scripts/performance/terminal-stream/terminal-stream-byte-length-benchmark.mjs b/config/scripts/performance/terminal-stream/terminal-stream-byte-length-benchmark.mjs index 85d0ce1da1d..493290c7b11 100644 --- a/config/scripts/performance/terminal-stream/terminal-stream-byte-length-benchmark.mjs +++ b/config/scripts/performance/terminal-stream/terminal-stream-byte-length-benchmark.mjs @@ -68,7 +68,10 @@ const { measureTerminalStreamByteLength, terminalStreamByteLengthExceeds } = await import( - new URL('../../../../src/main/runtime/rpc/terminal-stream-byte-length.ts', import.meta.url).href + new URL( + '../../../../src/main/runtime/rpc/terminal/terminal-stream-byte-length.ts', + import.meta.url + ).href ) const REQUESTED_SNAPSHOT_BYTE_BUDGET = (() => { diff --git a/config/scripts/performance/transport/cli-runtime-client-deferral-benchmark.mjs b/config/scripts/performance/transport/cli-runtime-client-deferral-benchmark.mjs deleted file mode 100644 index 21e3e86cabc..00000000000 --- a/config/scripts/performance/transport/cli-runtime-client-deferral-benchmark.mjs +++ /dev/null @@ -1,258 +0,0 @@ -#!/usr/bin/env node -// Compare real CLI emits before/after deferring RuntimeClient’s Zod/ws/tweetnacl/store graph until after flag validation. -// Restore seven baseline files; use fresh processes to measure cold graphs, alternate arm order, and verify output/exit equality before timing. -import { execFileSync, spawnSync } from 'node:child_process' -import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' -import { join } from 'node:path' -import { performance } from 'node:perf_hooks' -import { fileURLToPath } from 'node:url' - -const REPO = fileURLToPath(new URL('../../../..', import.meta.url)) - -const ROUNDS = Number(process.env.ORCA_CLI_DEFER_BENCH_ROUNDS ?? '30') -const WARMUP = Number(process.env.ORCA_CLI_DEFER_BENCH_WARMUP ?? '3') - -for (const [name, value] of [ - ['ORCA_CLI_DEFER_BENCH_ROUNDS', ROUNDS], - ['ORCA_CLI_DEFER_BENCH_WARMUP', WARMUP] -]) { - if (!Number.isSafeInteger(value) || value <= 0) { - throw new Error(`${name} must be a positive integer, received ${value}`) - } -} -if (ROUNDS % 2 !== 0) { - // Why: arms alternate which one leads; an odd count biases one arm. - throw new Error(`ORCA_CLI_DEFER_BENCH_ROUNDS must be even, received ${ROUNDS}`) -} - -const TOUCHED = [ - 'src/cli/args.ts', - 'src/cli/dispatch.ts', - 'src/cli/flags.ts', - 'src/cli/format.ts', - 'src/cli/index.ts', - 'src/cli/runtime/client.ts', - 'src/cli/selectors.ts' -] - -// Re-read production call forms so reverting deferral cannot make both arms identical; prose mentions must not satisfy the guard. -function assertMarkersFresh() { - const checks = [ - ['src/cli/index.ts', "await import('./runtime-client.js')"], - ['src/cli/index.ts', 'await loadRuntimeClientClass()'], - ['src/cli/index.ts', "import type { RuntimeClient } from './runtime-client'"], - ['src/cli/runtime/client.ts', "await import('./websocket-transport.js')"], - ['src/cli/runtime/client.ts', 'await loadSendWebSocketRequest()'], - ['src/cli/args.ts', "import { RuntimeClientError } from './runtime/types'"], - ['src/cli/flags.ts', "import { RuntimeClientError } from './runtime/types'"], - ['src/cli/dispatch.ts', "import { RuntimeClientError } from './runtime/types'"], - ['src/cli/selectors.ts', "import { RuntimeClientError } from './runtime/types'"], - ['src/cli/format.ts', "} from './runtime/types'"] - ] - for (const [file, marker] of checks) { - if (!readFileSync(join(REPO, file), 'utf8').includes(marker)) { - throw new Error( - `${file} no longer contains \`${marker}\` — cli-runtime-client-deferral-benchmark.mjs is stale` - ) - } - } -} - -function buildArm(label, baselineRev) { - // Build inside repo so emitted modules resolve its node_modules. - const outDir = join(REPO, `.bench-out-${label}`) - rmSync(outDir, { recursive: true, force: true }) - const restore = [] - try { - if (baselineRev) { - for (const file of TOUCHED) { - const path = join(REPO, file) - restore.push([path, readFileSync(path)]) - writeFileSync( - path, - execFileSync('git', ['show', `${baselineRev}:${file}`], { - cwd: REPO, - maxBuffer: 64 * 1024 * 1024 - }) - ) - } - } - execFileSync( - 'npx', - [ - 'tsc', - '-p', - 'config/tsconfig.cli.json', - '--outDir', - outDir, - '--composite', - 'false', - '--incremental', - 'false' - ], - { cwd: REPO, stdio: 'inherit' } - ) - } finally { - for (const [path, contents] of restore) { - writeFileSync(path, contents) - } - } - return join(outDir, 'cli/index.js') -} - -function run(entry, argv, env) { - const result = spawnSync(process.execPath, [entry, ...argv], { - cwd: REPO, - env: { ...process.env, ...env }, - encoding: 'buffer' - }) - if (result.error) { - throw result.error - } - return { - status: result.status, - stdout: result.stdout.toString('utf8'), - stderr: result.stderr.toString('utf8') - } -} - -// Count eager CJS graph in a child via Module._load, measuring the graph deferral actually moves. -function countEagerModules(entry) { - const probe = ` - const Module = require('module') - const original = Module._load - const seen = new Set() - Module._load = function (request, parent, isMain) { - try { seen.add(Module._resolveFilename(request, parent, isMain)) } catch { seen.add(request) } - return original.apply(this, arguments) - } - require(${JSON.stringify(entry)}) - const all = [...seen] - process.stdout.write(JSON.stringify({ - total: all.length, - nodeModules: all.filter((p) => p.includes('node_modules')).length - })) - ` - const result = spawnSync(process.execPath, ['-e', probe], { cwd: REPO, encoding: 'utf8' }) - if (result.status !== 0) { - throw new Error(`module probe failed: ${result.stderr}`) - } - return JSON.parse(result.stdout) -} - -const median = (values) => { - const sorted = [...values].sort((a, b) => a - b) - return sorted[Math.floor(sorted.length / 2)] -} - -const baselineIndex = process.argv.indexOf('--baseline') -const baselineRev = baselineIndex === -1 ? 'HEAD' : process.argv[baselineIndex + 1] - -assertMarkersFresh() - -const userDataPath = mkdtempSync(join(REPO, '.bench-userdata-')) - -try { - console.log(`Building eager baseline (${baselineRev}) …`) - const eagerEntry = buildArm('eager', baselineRev) - console.log('Building deferred (working tree) …') - const deferredEntry = buildArm('deferred', null) - - const eagerGraph = countEagerModules(eagerEntry) - const deferredGraph = countEagerModules(deferredEntry) - console.log( - `\nEager modules at process load: ${eagerGraph.total} -> ${deferredGraph.total} ` + - `(node_modules ${eagerGraph.nodeModules} -> ${deferredGraph.nodeModules})` - ) - if (deferredGraph.total >= eagerGraph.total) { - throw new Error( - 'deferred arm loads no fewer modules — the fixture does not exercise the change' - ) - } - - // Use empty user-data dirs for deterministic runtime-dependent cases. - const isolated = { ORCA_USER_DATA_PATH: userDataPath } - /** @type {Array<[string, string[], Record]>} */ - const cases = [ - ['orca --help', ['--help'], {}], - ['orca help worktree', ['help', 'worktree'], {}], - ['orca (no args)', [], {}], - ['unknown command', ['no-such-command'], {}], - ['unknown flag', ['worktree', 'list', '--nope'], {}], - ['orca agent-context --json', ['agent-context', '--json'], {}], - ['orca status --json', ['status', '--json'], isolated], - ['orca worktree list --json', ['worktree', 'list', '--json'], isolated] - ] - - // Compare output/exit before timing or a broken arm printing nothing appears fastest. - for (const [label, argv, env] of cases) { - const before = run(eagerEntry, argv, env) - const after = run(deferredEntry, argv, env) - if ( - before.status !== after.status || - before.stdout !== after.stdout || - before.stderr !== after.stderr - ) { - throw new Error(`arms disagree for "${label}" — refusing to report a timing`) - } - if (before.stdout.length + before.stderr.length === 0) { - throw new Error(`"${label}" produced no output on either arm; it proves nothing`) - } - } - - const pad = (value, width) => String(value).padStart(width) - console.log('\nFresh process per sample, wall clock. Lower is better.') - console.log(`rounds=${ROUNDS} warmup=${WARMUP} (per-arm median, arms alternate lead)`) - console.log(`${pad('case', 26)} ${pad('eager', 10)} ${pad('deferred', 10)} ${pad('speedup', 9)}`) - - // Accumulated so V8 cannot treat the spawn loop as dead code. - let consumed = 0 - - for (const [label, argv, env] of cases) { - for (let index = 0; index < WARMUP; index += 1) { - consumed += run(eagerEntry, argv, env).stdout.length - consumed += run(deferredEntry, argv, env).stdout.length - } - const samples = { eager: [], deferred: [] } - for (let round = 0; round < ROUNDS; round += 1) { - // Alternate which arm leads so a drifting machine load cannot be - // attributed to one arm. - const order = - round % 2 === 0 - ? [ - ['eager', eagerEntry], - ['deferred', deferredEntry] - ] - : [ - ['deferred', deferredEntry], - ['eager', eagerEntry] - ] - for (const [arm, entry] of order) { - const started = performance.now() - const result = run(entry, argv, env) - samples[arm].push(performance.now() - started) - consumed += result.stdout.length - } - } - const eagerMs = median(samples.eager) - const deferredMs = median(samples.deferred) - console.log( - `${pad(label, 26)} ${pad(`${eagerMs.toFixed(1)} ms`, 10)} ${pad(`${deferredMs.toFixed(1)} ms`, 10)} ${pad(`${(eagerMs / deferredMs).toFixed(2)}x`, 9)}` - ) - } - - if (consumed === 0) { - throw new Error('no output consumed — the timing loop was optimised away') - } - console.log( - '\nThe help and error rows are the ones the change targets: they return\n' + - 'before any client construction, so they drop the whole graph. `status` and\n' + - '`worktree list` still construct a client, so they only save the eager parse\n' + - 'of the parts the local path never uses (ws/tweetnacl via websocket-transport).' - ) -} finally { - rmSync(userDataPath, { recursive: true, force: true }) - for (const label of ['eager', 'deferred']) { - rmSync(join(REPO, `.bench-out-${label}`), { recursive: true, force: true }) - } -} diff --git a/config/scripts/performance/transport/cli-runtime-client-deferral-equivalence.mjs b/config/scripts/performance/transport/cli-runtime-client-deferral-equivalence.mjs deleted file mode 100644 index a3d06d5f9d6..00000000000 --- a/config/scripts/performance/transport/cli-runtime-client-deferral-equivalence.mjs +++ /dev/null @@ -1,446 +0,0 @@ -#!/usr/bin/env node -// Compare stdout/stderr/exit byte-for-byte across two real CLI emits: current tree and selected files restored from baseline (default HEAD~). -// Usage: node config/scripts/cli-runtime-client-deferral-equivalence.mjs [--baseline ] -import { execFileSync, spawnSync } from 'node:child_process' -import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync, readFileSync } from 'node:fs' -import { join, resolve } from 'node:path' -import { fileURLToPath } from 'node:url' - -const REPO = fileURLToPath(new URL('../../../..', import.meta.url)) - -// Restore only these baseline files; remove baseline-absent files (e.g. cli-error.ts), then restore the working tree. -const TOUCHED = [ - 'src/cli/args.ts', - 'src/cli/cli-error.ts', - 'src/cli/dispatch.ts', - 'src/cli/flags.ts', - 'src/cli/format.ts', - 'src/cli/index.ts', - 'src/cli/runtime/client.ts', - 'src/cli/selectors.ts' -] - -// Fail if real deferral call shapes change or baseline/current could become identical and pass vacuously. -function assertMarkersFresh() { - const index = readFileSync(join(REPO, 'src/cli/index.ts'), 'utf8') - const client = readFileSync(join(REPO, 'src/cli/runtime/client.ts'), 'utf8') - const checks = [ - ['src/cli/index.ts', index, 'await loadRuntimeClientClass()'], - ['src/cli/index.ts', index, "await import('./runtime-client.js')"], - ['src/cli/index.ts', index, "import type { RuntimeClient } from './runtime-client'"], - ['src/cli/runtime/client.ts', client, 'await loadSendWebSocketRequest()'], - ['src/cli/runtime/client.ts', client, "await import('./websocket-transport.js')"] - ] - for (const [file, source, marker] of checks) { - // Match calls so prose mentions cannot satisfy the guard. - if (!source.includes(marker)) { - throw new Error( - `${file} no longer contains \`${marker}\` — cli-runtime-client-deferral-equivalence.mjs is stale` - ) - } - } - const repointed = ['src/cli/args.ts', 'src/cli/flags.ts', 'src/cli/dispatch.ts'] - for (const file of repointed) { - const source = readFileSync(join(REPO, file), 'utf8') - if (!source.includes("import { RuntimeClientError } from './runtime/types'")) { - throw new Error(`${file} no longer repoints RuntimeClientError at ./runtime/types — stale`) - } - } -} - -function buildTree(label, baselineRev) { - // Build inside repo so emitted modules resolve its node_modules. - const outDir = join(REPO, `.equiv-out-${label}`) - rmSync(outDir, { recursive: true, force: true }) - const restored = [] - try { - if (baselineRev) { - for (const file of TOUCHED) { - const path = join(REPO, file) - restored.push([path, existsSync(path) ? readFileSync(path) : null]) - const old = spawnSync('git', ['show', `${baselineRev}:${file}`], { - cwd: REPO, - maxBuffer: 64 * 1024 * 1024 - }) - if (old.status === 0) { - writeFileSync(path, old.stdout) - } else { - rmSync(path, { force: true }) - } - } - } - execFileSync( - 'npx', - [ - 'tsc', - '-p', - 'config/tsconfig.cli.json', - '--outDir', - outDir, - '--composite', - 'false', - '--incremental', - 'false' - ], - { cwd: REPO, stdio: 'inherit' } - ) - } finally { - for (const [path, contents] of restored) { - if (contents === null) { - rmSync(path, { force: true }) - } else { - writeFileSync(path, contents) - } - } - } - return join(outDir, 'cli/index.js') -} - -// Every case must exit itself; bound spawnSync so reaching a blocking command fails instead of stalling forever. -const RUN_TIMEOUT_MS = 30_000 - -function run(entry, argv, env) { - const result = spawnSync(process.execPath, [entry, ...argv], { - cwd: REPO, - env: { ...process.env, ...env }, - encoding: 'buffer', - timeout: RUN_TIMEOUT_MS, - killSignal: 'SIGKILL' - }) - if (result.error) { - if (result.error.code === 'ETIMEDOUT') { - throw new Error( - `orca ${argv.join(' ')} did not exit within ${RUN_TIMEOUT_MS} ms — it reached a blocking command` - ) - } - throw result.error - } - return { - status: result.status, - stdout: result.stdout.toString('utf8'), - stderr: result.stderr.toString('utf8') - } -} - -// Require identical bytes; empty user-data dirs make runtime-dependent cases deterministically report not running. -function buildCases(isolatedUserData) { - const isolated = { ORCA_USER_DATA_PATH: isolatedUserData } - const cases = [ - // Paths that must never load the runtime client at all. - [[], {}], - [['--help'], {}], - [['help'], {}], - [['help', 'worktree'], {}], - [['help', 'browser'], {}], - [['worktree', '--help'], {}], - [['help', 'no-such-command'], {}], - [['no-such-command'], {}], - [['no-such-command'], { ORCA_PAIRING_CODE: 'garbage' }], - [['wrktree', 'list'], {}], - [['agent-context'], {}], - [['agent-context', '--json'], {}], - // Flag validation must still fire before any runtime lookup. - [['worktree', 'list', '--nonexistent-flag'], {}], - [['worktree', 'list', '--nonexistent-flag', '--json'], {}], - [['browser', 'snapshot', '--nonexistent-flag'], {}], - // resolveRemotePairing throws from the RuntimeClient CONSTRUCTOR. - [['status', '--pairing-code', 'x', '--environment', 'y'], isolated], - [['status', '--pairing-code', 'x', '--environment', 'y', '--json'], isolated], - [['status', '--pairing-code', 'not-a-pairing-code'], isolated], - [['status', '--pairing-code', 'not-a-pairing-code', '--json'], isolated], - [['status', '--pairing-code', 'orca://pair?code=zzzz'], isolated], - [['status', '--environment', 'no-such-environment'], isolated], - [['status', '--environment', 'no-such-environment', '--json'], isolated], - [['worktree', 'list', '--environment', 'no-such-environment', '--json'], isolated], - // The env-var fallback must stay live for non-suppressed commands... - [['status', '--json'], { ...isolated, ORCA_PAIRING_CODE: 'not-a-pairing-code' }], - [['status', '--json'], { ...isolated, ORCA_REMOTE_PAIRING: 'not-a-pairing-code' }], - [['status', '--json'], { ...isolated, ORCA_ENVIRONMENT: 'no-such-environment' }], - // Keep suppression for local-only groups. Do not invoke agent hooks on/off: they modify real ~/.claude configuration outside ORCA_USER_DATA_PATH. - [['environment', 'list', '--json'], { ...isolated, ORCA_ENVIRONMENT: 'no-such-environment' }], - [['environment', 'list', '--json'], { ...isolated, ORCA_PAIRING_CODE: 'not-a-pairing-code' }], - [['agent-context', '--json'], { ...isolated, ORCA_PAIRING_CODE: 'not-a-pairing-code' }], - // Runtime-unavailable reporting (RuntimeClientError formatting). - [['status'], isolated], - [['status', '--json'], isolated], - [['worktree', 'list', '--json'], isolated], - [['terminal', 'list', '--json'], isolated] - ] - // Seed fuzzing for reproducibility; all pool tokens must be safe to execute, checked against UNSAFE_TOKENS before running any case. - const tokens = [ - 'worktree', - 'list', - 'status', - 'browser', - 'snapshot', - 'terminal', - 'environment', - 'agent', - 'agent-context', - 'vm', - '--json', - '--help', - '--pairing-code', - '--environment', - '--worktree', - 'orca://pair?code=!!!', - '', - '-', - '--', - '--=', - 'a'.repeat(300), - 'näme-ünicode', - '💥', - '../..', - 'x\ty' - ] - let seed = 0x9e3779b9 - const next = () => { - seed ^= seed << 13 - seed ^= seed >>> 17 - seed ^= seed << 5 - return (seed >>> 0) / 0x100000000 - } - // Check entire pool, not just sampled cases: serve once survived review here and escaped the per-case scan by chance. - assertTokensSafe(tokens, 'fuzz token pool') - assertFuzzPoolDeclaredReadOnly(tokens) - for (let index = 0; index < 400; index += 1) { - const length = 1 + Math.floor(next() * 4) - const argv = [] - for (let part = 0; part < length; part += 1) { - argv.push(tokens[Math.floor(next() * tokens.length)]) - } - cases.push([argv, isolated]) - } - for (const [argv] of cases) { - assertTokensSafe(argv, `argv ${JSON.stringify(argv)}`) - } - return cases -} - -// Cases run real CLI with developer HOME/PATH: deny foreground commands, surviving children, config/registry writes and real UI input. -// Deny mixed read/write groups (capture/intercept/label/relation) wholesale; fuzzing cannot distinguish their subcommands. -const FOREGROUND_TOKENS = ['serve', 'open', 'claude-teams', 'exec', 'eval', 'launch', 'attach'] -const MUTATING_TOKENS = [ - // persistent config and registry state - 'on', - 'off', - 'hooks', - 'create', - 'remove', - 'rm', - 'delete', - 'add', - 'edit', - 'set', - 'set-value', - 'set-base-ref', - 'setup-clone', - 'setup-create', - 'setup-update', - 'setup-delete', - 'setup-existing-folder', - 'install', - 'uninstall', - 'reinstall', - 'update', - 'clone', - 'apply', - 'write', - 'reset', - 'clear', - 'enable', - 'disable', - 'use-default', - 'permissions', - // process and pane lifecycle - 'run', - 'run-stop', - 'start', - 'stop', - 'kill', - 'shutdown', - 'close', - 'split', - 'switch', - 'rename', - 'focus', - // orchestration writes - 'send', - 'reply', - 'dispatch', - 'task-create', - 'task-update', - 'gate-create', - 'gate-resolve', - // issue-tracker writes - 'save-issue', - 'comment', - 'label', - 'relation', - 'assignee', - 'priority', - 'estimate', - 'due-date', - // browser / computer / emulator input and navigation - 'goto', - 'back', - 'forward', - 'reload', - 'click', - 'dblclick', - 'hover', - 'fill', - 'type', - 'type-text', - 'select', - 'select-all', - 'uncheck', - 'keypress', - 'press-key', - 'inserttext', - 'hotkey', - 'paste-text', - 'perform-secondary-action', - 'drag', - 'scroll', - 'scrollintoview', - 'wheel', - 'move', - 'up', - 'down', - 'tap', - 'gesture', - 'button', - 'rotate', - 'upload', - 'download', - 'dismiss', - 'accept', - 'highlight', - 'viewport', - 'geolocation', - 'headers', - 'credentials', - 'offline', - 'media', - 'device', - 'capture', - 'intercept' -] - -const UNSAFE_TOKENS = new Map([ - ...FOREGROUND_TOKENS.map((token) => [token, 'runs in the foreground or spawns a process']), - ...MUTATING_TOKENS.map((token) => [token, 'can write outside ORCA_USER_DATA_PATH']) -]) - -// Deny lists miss new verbs (serve once escaped); require explicit read-only allowlisting for every pool token too. -const READ_ONLY_FUZZ_TOKENS = new Set([ - // command tokens: every path they can form is a list/show or a parse error - 'agent', - 'agent-context', - 'browser', - 'environment', - 'list', - 'snapshot', - 'status', - 'terminal', - 'vm', - 'worktree', - // global flags and hostile strings, which reach no handler at all - '--json', - '--help', - '--pairing-code', - '--environment', - '--worktree', - 'orca://pair?code=!!!', - '', - '-', - '--', - '--=', - 'a'.repeat(300), - 'näme-ünicode', - '💥', - '../..', - 'x\ty' -]) - -function assertTokensSafe(tokens, context) { - for (const token of tokens) { - const reason = UNSAFE_TOKENS.get(token) - if (reason) { - throw new Error(`Refusing to run ${context}: "${token}" ${reason}`) - } - } -} - -// Reject neither/both-list membership before any case runs; sampling cannot prove pool safety. -function assertFuzzPoolDeclaredReadOnly(tokens) { - for (const token of tokens) { - if (!READ_ONLY_FUZZ_TOKENS.has(token)) { - throw new Error( - `Fuzz token ${JSON.stringify(token)} is not declared in READ_ONLY_FUZZ_TOKENS — declare it read-only or drop it` - ) - } - } - for (const token of READ_ONLY_FUZZ_TOKENS) { - if (UNSAFE_TOKENS.has(token)) { - throw new Error( - `Token ${JSON.stringify(token)} is declared both read-only and unsafe — the two lists disagree` - ) - } - } -} - -const baselineIndex = process.argv.indexOf('--baseline') -const baselineRev = baselineIndex === -1 ? 'HEAD' : process.argv[baselineIndex + 1] - -assertMarkersFresh() - -const isolatedUserData = mkdtempSync(join(REPO, '.equiv-userdata-')) -mkdirSync(join(isolatedUserData, 'empty'), { recursive: true }) - -let oldEntry -let newEntry -try { - // Build cases and check safety before expensive tsc compiles so unsafe tokens fail immediately. - const cases = buildCases(isolatedUserData) - - console.log(`Building baseline (${baselineRev}) …`) - oldEntry = buildTree('old', baselineRev) - console.log('Building working tree …') - newEntry = buildTree('new', null) - - console.log(`Comparing ${cases.length} invocations byte for byte …`) - let mismatches = 0 - for (const [argv, env] of cases) { - const before = run(oldEntry, argv, env) - const after = run(newEntry, argv, env) - if ( - before.status !== after.status || - before.stdout !== after.stdout || - before.stderr !== after.stderr - ) { - mismatches += 1 - console.error(`\nMISMATCH argv=${JSON.stringify(argv)} env=${JSON.stringify(env)}`) - console.error(` exit before=${before.status} after=${after.status}`) - if (before.stdout !== after.stdout) { - console.error(` stdout before=${JSON.stringify(before.stdout.slice(0, 400))}`) - console.error(` after =${JSON.stringify(after.stdout.slice(0, 400))}`) - } - if (before.stderr !== after.stderr) { - console.error(` stderr before=${JSON.stringify(before.stderr.slice(0, 400))}`) - console.error(` after =${JSON.stringify(after.stderr.slice(0, 400))}`) - } - } - } - if (mismatches > 0) { - throw new Error(`${mismatches} of ${cases.length} invocations differ`) - } - console.log(`\nAll ${cases.length} invocations byte-identical (stdout, stderr, exit code).`) -} finally { - rmSync(isolatedUserData, { recursive: true, force: true }) - for (const label of ['old', 'new']) { - rmSync(resolve(REPO, `.equiv-out-${label}`), { recursive: true, force: true }) - } -} diff --git a/config/scripts/plugin-authoring/content-validation/validate-plugin-files.mjs b/config/scripts/plugin-authoring/content-validation/validate-plugin-files.mjs index bbdb13719aa..45164a171a7 100644 --- a/config/scripts/plugin-authoring/content-validation/validate-plugin-files.mjs +++ b/config/scripts/plugin-authoring/content-validation/validate-plugin-files.mjs @@ -17,11 +17,12 @@ const { validatePluginFile, pluginManifestWarnings } = loadPluginSchemaModule( const { parsePluginManifest } = loadPluginSchemaModule('manifest/plugin-manifest.ts') // Why the CLI's main entry: `orca plugin validate` and `release-entry` run these same checks, and // the printed contentHash must be what Orca computes at install. -const { - pluginCatalogReleaseForHead, - validateDeclaredPluginArtifacts, - validatePluginInstallContent -} = loadPluginSchemaModule('../../main/plugins/plugin-authoring-checks.ts') +const { pluginCatalogReleaseForHead } = loadPluginSchemaModule( + '../../main/plugins/plugin-catalog-release-entry.ts' +) +const { validateDeclaredPluginArtifacts, validatePluginInstallContent } = loadPluginSchemaModule( + '../../main/plugins/plugin-artifact-validation.ts' +) // Why shared: `orca plugin validate` runs these same strict artifact checks. const { strictPluginArtifactErrors, strictPluginArtifactWarnings } = loadPluginSchemaModule( 'authoring/plugin-strict-artifact-checks.ts' diff --git a/config/scripts/plugin-authoring/content-validation/validate-plugin-files.test.mjs b/config/scripts/plugin-authoring/content-validation/validate-plugin-files.test.mjs index f9ddb0587af..18ce2787ee4 100644 --- a/config/scripts/plugin-authoring/content-validation/validate-plugin-files.test.mjs +++ b/config/scripts/plugin-authoring/content-validation/validate-plugin-files.test.mjs @@ -4,7 +4,7 @@ import path from 'node:path' import process from 'node:process' import { runProcess } from '@orca/process-host' import { afterEach, describe, expect, it } from 'vitest' -import { createPluginFromTemplate } from '../../../../src/cli/plugin-authoring/plugin-create' +import { createPluginFromTemplate } from '../../../../src/cli/plugins/authoring/plugin-create' const SCRIPT = path.join(import.meta.dirname, './validate-plugin-files.mjs') const roots = [] diff --git a/config/scripts/runtime-verification/daemon-lifecycle/run-headless-linux-pairing-docker.mjs b/config/scripts/runtime-verification/daemon-lifecycle/run-headless-linux-pairing-docker.mjs index 799b8d73ab1..b0d79937213 100644 --- a/config/scripts/runtime-verification/daemon-lifecycle/run-headless-linux-pairing-docker.mjs +++ b/config/scripts/runtime-verification/daemon-lifecycle/run-headless-linux-pairing-docker.mjs @@ -4,10 +4,8 @@ import { existsSync } from 'node:fs' import { resolve } from 'node:path' const STARTUP_TIMEOUT_MS = 20_000 -const APPIMAGE_EXTRACTION_TIMEOUT_MS = 60_000 const commandArgs = process.argv.slice(2) const appImageArg = valueAfter('--appimage') -const pairingOnly = commandArgs.includes('--pairing-only') if (!appImageArg) { fail('Usage: run-headless-linux-pairing-docker.mjs --appimage /path/to/orca.AppImage') } @@ -32,28 +30,17 @@ const images = [ tag: 'orca-headless-pairing:debian-13', base: 'debian@sha256:020c0d20b9880058cbe785a9db107156c3c75c2ac944a6aa7ab59f2add76a7bd', libasound: 'libasound2t64' - }, - { - name: 'ubuntu-22.04-baseline', - tag: 'orca-headless-pairing:ubuntu-22.04', - base: 'ubuntu@sha256:0e0a0fc6d18feda9db1590da249ac93e8d5abfea8f4c3c0c849ce512b5ef8982', - libasound: 'libasound2' } ] try { docker(['volume', 'create', artifactVolume]) docker(['network', 'create', network]) - for (const image of pairingOnly ? images.slice(0, 2) : images) { + for (const image of images) { buildImage(image) } extractAppImage(images[0].tag) - if (!pairingOnly) { - await validateStartupMatrix() - await validateUnavailableContracts() - } await validateAuthenticatedPairing() - await validateUnreachableOffer() console.log('Headless Linux pairing Docker validation passed.') } finally { for (const container of containers) { @@ -111,71 +98,6 @@ function extractAppImage(image) { ]) } -async function validateStartupMatrix() { - const required = images.slice(0, 2) - for (const image of required) { - for (const launch of ['direct', 'xvfb', 'dbus-xvfb', 'journal']) { - for (const mode of ['human', 'json']) { - const result = await startAndWait({ image, launch, mode, address: 'pair-host.test' }) - validateReady(result.stdout, mode, 'pair-host.test', { - allowStdoutNoise: launch !== 'direct' - }) - stopContainer(result.name) - console.log(`PASS ${image.name} ${launch} ${mode}`) - } - } - } - const baseline = await startAndWait({ - image: images[2], - launch: 'xvfb', - mode: 'json', - address: '127.0.0.1' - }) - validateReady(baseline.stdout, 'json', '127.0.0.1', { allowStdoutNoise: true }) - stopContainer(baseline.name) - console.log(`PASS ${images[2].name} xvfb json`) - - const publicEntry = await startAndWait({ - image: images[0], - launch: 'direct', - mode: 'json', - address: '127.0.0.1', - appPath: '/artifacts/orca.AppImage', - startupTimeoutMs: APPIMAGE_EXTRACTION_TIMEOUT_MS - }) - validateReady(publicEntry.stdout, 'json', '127.0.0.1', { allowStdoutNoise: true }) - stopContainer(publicEntry.name) - console.log('PASS AppImage --appimage-extract-and-run --no-sandbox serve') -} - -async function validateUnavailableContracts() { - const invalid = await startAndWait({ - image: images[0], - launch: 'direct', - mode: 'json', - address: '0.0.0.0' - }) - const invalidPayload = readyJson(invalid.stdout) - assert(invalidPayload.pairing?.available === false, 'wildcard pairing must be unavailable') - assert( - invalidPayload.pairing.reason === 'invalid_advertised_endpoint', - 'wildcard pairing must expose invalid_advertised_endpoint' - ) - stopContainer(invalid.name) - - const disabled = await startAndWait({ - image: images[1], - launch: 'journal', - mode: 'json', - address: '127.0.0.1', - noPairing: true - }) - const disabledPayload = readyJson(disabled.stdout) - assert(disabledPayload.pairing?.reason === 'disabled_by_operator', 'disabled reason is missing') - stopContainer(disabled.name) - console.log('PASS explicit unavailable pairing contracts') -} - async function validateAuthenticatedPairing() { const server = await startAndWait({ image: images[0], @@ -220,22 +142,6 @@ async function validateAuthenticatedPairing() { console.log('PASS paired E2EE updater inventory and manual-service fallback') } -async function validateUnreachableOffer() { - const server = await startAndWait({ - image: images[0], - launch: 'direct', - mode: 'json', - address: 'orca-pairing-server:6769', - port: '6768', - networkAlias: 'orca-pairing-server' - }) - const payload = readyJson(server.stdout) - const client = runPairingClient(payload.pairing.url) - assert(client.status !== 0, 'a deliberately mismatched advertised port unexpectedly connected') - stopContainer(server.name) - console.log('PASS unreachable advertised endpoint fails the real client probe') -} - async function startAndWait({ image, launch, @@ -318,39 +224,6 @@ function hasCompleteReadyContract(stdout) { return readyJsonObjects(stdout).length > 0 } -function validateReady(logs, mode, expectedHost, options = {}) { - if (mode === 'human') { - assert( - (logs.match(/^Orca server ready$/gm) ?? []).length === 1, - 'human ready marker is not exact-once' - ) - assert(logs.includes('Bound endpoint: ws://0.0.0.0:'), 'human bound endpoint is missing') - assert( - logs.includes(`Advertised endpoint: ws://${expectedHost}:`), - 'human advertised endpoint is missing' - ) - assert(logs.includes('Pairing URL: orca://pair?code='), 'human pairing URL is missing') - return - } - if (!options.allowStdoutNoise) { - const stdoutLines = logs.split(/\r?\n/).filter(Boolean) - assert( - stdoutLines.length === 1, - `JSON stdout must contain exactly one line, found ${stdoutLines.length}:\n${logs}` - ) - } - const payload = readyJson(logs) - assert(payload.schemaVersion === 1, 'ready JSON schemaVersion is missing') - assert(payload.endpoint === payload.boundEndpoint, 'legacy JSON endpoint alias is inconsistent') - assert(payload.boundEndpoint?.startsWith('ws://0.0.0.0:'), 'JSON bound endpoint is invalid') - assert(payload.advertisedEndpoint?.includes(expectedHost), 'JSON advertised endpoint is invalid') - assert(payload.pairing?.available === true, 'JSON pairing offer is unavailable') - assert( - new URL(payload.boundEndpoint).port === new URL(payload.advertisedEndpoint).port, - 'an advertised host without a port must use the actual bound port' - ) -} - function readyJson(logs) { const matches = readyJsonObjects(logs) assert(matches.length === 1, `expected one ready JSON object, found ${matches.length}`) diff --git a/config/scripts/runtime-verification/desktop-transport/run-linux-cli-launch-contract-docker.mjs b/config/scripts/runtime-verification/desktop-transport/run-linux-cli-launch-contract-docker.mjs index d0c3c54c4d5..d577caf6c7c 100755 --- a/config/scripts/runtime-verification/desktop-transport/run-linux-cli-launch-contract-docker.mjs +++ b/config/scripts/runtime-verification/desktop-transport/run-linux-cli-launch-contract-docker.mjs @@ -24,18 +24,6 @@ const CLEANUP_TIMEOUT_MS = 30_000 // Exact statuses reject silent no-op launches as well as crashes. const CASES = [ - { - name: 'nofuse-userns-bundled-help', - expectStatus: 0, - expectOutput: 'Usage: orca ', - why: 'The bundled launcher must run with no FUSE, no display, and userns restricted (#11609, #12530).' - }, - { - name: 'nofuse-userns-bundled-version', - expectStatus: 0, - expectOutput: /^\d+\.\d+\.\d+/m, - why: 'A deployment must be able to read the installed version without a display (#13719).' - }, { name: 'nofuse-userns-bundled-status', // No runtime is running; the CLI must report that itself. @@ -43,32 +31,12 @@ const CASES = [ expectOutput: 'appRunning', why: 'A command that needs the runtime must report its absence, not abort.' }, - { - name: 'nofuse-userns-bundled-skills', - expectStatus: 0, - // Why: the rendered help header, not a bare 'skills' — the case name contains that word. - expectOutput: 'Usage: orca skills', - why: 'skills is a pure-text command that must never need Chromium (#14229).' - }, - { - name: 'nofuse-userns-bundled-worktree', - expectStatus: 1, - expectOutput: "Orca is not running. Run 'orca open' first.", - why: 'A runtime-dependent command must report the missing runtime, not abort.' - }, { name: 'nofuse-nosandbox-direct-binary-skills', expectStatus: 0, expectOutput: 'Usage: orca skills', why: 'A direct binary launch that reaches JavaScript must run the command, not boot a GUI (#14229).' }, - { - name: 'nofuse-nosandbox-direct-binary-gui', - // A missing display is an expected diagnosis, not a crash. - expectStatus: 1, - expectOutput: 'needs a usable display server', - why: 'A desktop launch with no display must diagnose it instead of dying in uv_close (#13719).' - }, { name: 'stale-display-nosandbox-direct-binary-gui', expectStatus: 1, diff --git a/config/scripts/skills/bundle-generation/generate-bundled-skill-guides.mjs b/config/scripts/skills/bundle-generation/generate-bundled-skill-guides.mjs index 40056f21e91..7cb75b19306 100644 --- a/config/scripts/skills/bundle-generation/generate-bundled-skill-guides.mjs +++ b/config/scripts/skills/bundle-generation/generate-bundled-skill-guides.mjs @@ -179,7 +179,7 @@ function serializeEmbeddedModule(guides) { }) .join(',\n') - return `// Generated by config/scripts/generate-bundled-skill-guides.mjs. Do not edit.\n\nexport type BundledSkillGuideReference = {\n readonly name: string\n readonly markdown: string\n}\n\nexport type BundledSkillGuide = {\n readonly name: string\n readonly description: string\n readonly markdown: string\n readonly aliases: readonly string[]\n readonly references: readonly BundledSkillGuideReference[]\n}\n\n${markdownConstants}\n\n// oxfmt-ignore\nexport const BUNDLED_SKILL_GUIDES = [\n${guideEntries}\n] as const satisfies readonly BundledSkillGuide[]\n` + return `// Generated by config/scripts/skills/bundle-generation/generate-bundled-skill-guides.mjs. Do not edit.\n\nexport type BundledSkillGuideReference = {\n readonly name: string\n readonly markdown: string\n}\n\nexport type BundledSkillGuide = {\n readonly name: string\n readonly description: string\n readonly markdown: string\n readonly aliases: readonly string[]\n readonly references: readonly BundledSkillGuideReference[]\n}\n\n${markdownConstants}\n\n// oxfmt-ignore\nexport const BUNDLED_SKILL_GUIDES = [\n${guideEntries}\n] as const satisfies readonly BundledSkillGuide[]\n` } async function readGuideReferences(repoRoot, guideName) { @@ -317,7 +317,7 @@ async function buildArtifacts(repoRoot = REPO_ROOT) { return [ { - path: path.join(repoRoot, 'src', 'cli', 'bundled-skill-guides.ts'), + path: path.join(repoRoot, 'src', 'cli', 'skills', 'bundled-skill-guides.ts'), content: serializeEmbeddedModule(guides) }, ...projections diff --git a/config/scripts/skills/bundle-generation/generate-plugin-authoring-skill-references.mjs b/config/scripts/skills/bundle-generation/generate-plugin-authoring-skill-references.mjs index 3c656d5530b..8f5a05f3495 100644 --- a/config/scripts/skills/bundle-generation/generate-plugin-authoring-skill-references.mjs +++ b/config/scripts/skills/bundle-generation/generate-plugin-authoring-skill-references.mjs @@ -208,12 +208,15 @@ function hookLines({ hooks, hookContribution, typeText }) { function renderHostApi(sources, { frame, worker }) { const { hostApi, hostDoc, capabilities } = sources - const names = hostApi.PLUGIN_HOST_METHOD_NAMES + const names = hostApi.PLUGIN_STABLE_HOST_METHOD_NAMES const methodsFor = (surface) => hostApi.pluginHostMethodsFor(surface).map(code).join(', ') const methods = names.map((name) => { const spec = hostApi.PLUGIN_HOST_API[name] const facts = [ spec.capability ? `capability ${code(spec.capability)}` : 'no capability', + ...Object.entries(spec.paramCapabilities ?? {}).map( + ([param, kind]) => `${code(param)} also needs ${code(kind)}` + ), spec.surfaces.join(', '), `since ${hostVersion(sources, spec.since)}`, ...(spec.deprecatedSince === undefined diff --git a/config/scripts/skills/bundle-generation/generate-skill-bundle-manifest.test.mjs b/config/scripts/skills/bundle-generation/generate-skill-bundle-manifest.test.mjs index e3c242f0f1a..dd8b8596d0a 100644 --- a/config/scripts/skills/bundle-generation/generate-skill-bundle-manifest.test.mjs +++ b/config/scripts/skills/bundle-generation/generate-skill-bundle-manifest.test.mjs @@ -1,7 +1,6 @@ import { createHash } from 'node:crypto' import { execFileSync } from 'node:child_process' import { - chmod, copyFile, mkdir, mkdtemp, @@ -114,29 +113,6 @@ describe('skill bundle manifest generator', () => { expect(digests).toHaveLength(2) }) - it.runIf(process.platform !== 'win32')( - 'rejects executable files in shipped skill packages', - async () => { - const packageRoot = await createPackage() - await writeFile(path.join(packageRoot, 'SKILL.md'), 'skill\n') - await writeFile(path.join(packageRoot, 'run.sh'), '#!/bin/sh\necho ok\n') - await chmod(path.join(packageRoot, 'run.sh'), 0o755) - - await expect(collectPackageFiles(packageRoot)).rejects.toThrow( - 'Executable file is not allowed in a shipped skill: run.sh' - ) - } - ) - - it.runIf(process.platform === 'linux')('rejects case-colliding paths', async () => { - const packageRoot = await createPackage() - await writeFile(path.join(packageRoot, 'SKILL.md'), 'skill') - await writeFile(path.join(packageRoot, 'Readme.md'), 'one') - await writeFile(path.join(packageRoot, 'README.md'), 'two') - - await expect(collectPackageFiles(packageRoot)).rejects.toThrow('Case-colliding skill paths') - }) - it('keeps guarding a directory or link that only wears an OS metadata name', async () => { const packageRoot = await createPackage() await writeFile(path.join(packageRoot, 'SKILL.md'), 'demo skill\n') diff --git a/config/scripts/static-analysis/process-boundaries/check-main-sync-spawn-ratchet.test.mjs b/config/scripts/static-analysis/process-boundaries/check-main-sync-spawn-ratchet.test.mjs index 429eefa9836..504795bbf88 100644 --- a/config/scripts/static-analysis/process-boundaries/check-main-sync-spawn-ratchet.test.mjs +++ b/config/scripts/static-analysis/process-boundaries/check-main-sync-spawn-ratchet.test.mjs @@ -126,13 +126,6 @@ describe('main sync-spawn ratchet', () => { expect(uses(source)).toEqual({ count: 0, symbols: [] }) }) - it.each(['import {', 'const broken = ;'])( - 'fails closed on source it cannot parse: %s', - (source) => { - expect(() => uses(source)).toThrow('Cannot parse src/main/consumer.ts') - } - ) - it('fails a new file and a rising count, and passes at the baseline count', () => { const one = "import { spawnSync } from 'node:child_process'\nspawnSync('a')" const root = tree({ diff --git a/config/scripts/static-analysis/ratchets/runtime-lifecycle/check-main-blocking-api-ratchet.test.mjs b/config/scripts/static-analysis/ratchets/runtime-lifecycle/check-main-blocking-api-ratchet.test.mjs index 97fcf47139f..32e1a11584b 100644 --- a/config/scripts/static-analysis/ratchets/runtime-lifecycle/check-main-blocking-api-ratchet.test.mjs +++ b/config/scripts/static-analysis/ratchets/runtime-lifecycle/check-main-blocking-api-ratchet.test.mjs @@ -4,7 +4,7 @@ import { tmpdir } from 'node:os' import path from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' import { main as fsMain } from './check-main-sync-fs-ratchet.mjs' -import { collectSyncLaunchUses } from '../../process-boundaries/check-main-sync-spawn-ratchet.mjs' +import '../../process-boundaries/check-main-sync-spawn-ratchet.mjs' import { countBlockingApis, main } from './check-main-blocking-api-ratchet.mjs' const file = 'src/main/consumer.ts' @@ -24,34 +24,6 @@ afterEach(() => { }) describe('main blocking API ratchets', () => { - it('counts import aliases, namespace APIs, CommonJS and Atomics aliases by category', () => { - expect( - counts(`import { scryptSync as hash } from 'node:crypto' - import * as z from 'node:zlib' - const { pbkdf2Sync } = require('crypto') - hash('pw'); pbkdf2Sync('pw'); z.gzipSync('bytes'); z.futureSync('bytes') - const { wait: sleep } = Atomics; sleep(buffer, 0, 0)`) - ).toEqual({ compression: 2, crypto: 2, atomics: 1, sqlite: 0, ipc: 0 }) - }) - - it.each([ - ["import { DatabaseSync as DB } from 'node:sqlite'", 'DB'], - ["import DB from 'better-sqlite3'", 'DB'], - ["import DB from '../sqlite/sync-database'", 'DB'], - ["const { DatabaseSync: DB } = require('node:sqlite')", 'DB'], - ["const { DatabaseSync: DB } = process.getBuiltinModule('node:sqlite')", 'DB'], - ["import * as sqlite from 'node:sqlite'", 'sqlite.DatabaseSync'] - ])('guards SQLite constructors and statement work: %s', (load, ctor) => { - expect( - counts(`${load} - const db = new ${ctor}('db') - db.exec('schema') - const statement = db.prepare('select') - statement.run(); statement.get(); statement.all(); for (const row of statement.iterate()) {} - db.prepare('select').get()`) - ).toEqual({ compression: 0, crypto: 0, atomics: 0, sqlite: 9, ipc: 0 }) - }) - it('guards typed SQL receivers without charging Map.get or async backup', () => { expect( counts(`import type Database from '../sqlite/sync-database' @@ -77,31 +49,6 @@ describe('main blocking API ratchets', () => { ).toBe(5) }) - it('guards callable better-sqlite3 construction and modern builtin subprocess loads', () => { - expect( - counts( - `import Database from 'better-sqlite3'; const db = Database('test'); db.exec('sql'); db.prepare('sql').get()` - ).sqlite - ).toBe(4) - expect( - collectSyncLaunchUses(file, `process.getBuiltinModule('node:child_process').execSync('test')`) - .count - ).toBe(1) - }) - - it('guards synchronous preload requests and main replies', () => { - expect( - counts( - "import { ipcRenderer as ipc } from 'electron'; ipc.sendSync('get')", - 'src/preload/index.ts' - ).ipc - ).toBe(1) - expect(counts("ipcMain.on('get', (event) => { event.returnValue = value })").ipc).toBe(1) - expect(counts("ipc.sendSync('get'); event.returnValue = value", 'src/shared/ipc.ts').ipc).toBe( - 2 - ) - }) - it('ignores strings, comments, unrelated SQL-shaped methods and nonblocking APIs', () => { expect( counts(`import * as c from 'node:crypto'; import * as z from 'node:zlib' diff --git a/config/scripts/static-analysis/renderer-styles/renderer-tailwind-sources.test.mjs b/config/scripts/static-analysis/renderer-styles/renderer-tailwind-sources.test.mjs deleted file mode 100644 index e06676bb5ab..00000000000 --- a/config/scripts/static-analysis/renderer-styles/renderer-tailwind-sources.test.mjs +++ /dev/null @@ -1,55 +0,0 @@ -import { - cpSync, - mkdtempSync, - mkdirSync, - readFileSync, - rmSync, - symlinkSync, - writeFileSync -} from 'node:fs' -import { createRequire } from 'node:module' -import { tmpdir } from 'node:os' -import { join, resolve } from 'node:path' -import { expect, it } from 'vitest' - -const require = createRequire(import.meta.resolve('@tailwindcss/vite')) -const { compile } = require('@tailwindcss/node') -const { Scanner } = require('@tailwindcss/oxide') - -it('generates renderer CSS from production files while excluding test and spec files', async () => { - const root = mkdtempSync(join(tmpdir(), 'orca-tailwind-sources-')) - try { - const renderer = join(root, 'src', 'renderer', 'src') - const assets = join(renderer, 'assets') - cpSync(resolve('src/renderer/src/assets'), assets, { recursive: true }) - cpSync(resolve('src/shared/styles'), join(root, 'src', 'shared', 'styles'), { recursive: true }) - symlinkSync(resolve('node_modules'), join(root, 'node_modules'), 'junction') - const components = join(renderer, 'components') - mkdirSync(components) - writeFileSync(join(components, 'example.tsx'), 'export const style = "z-[31415]"') - writeFileSync(join(components, 'example.test.tsx'), 'export const style = "z-[27182]"') - writeFileSync(join(components, 'example.spec.ts'), 'export const style = "z-[16180]"') - - const compiler = await compile(readFileSync(join(assets, 'main.css'), 'utf8'), { - base: assets, - onDependency() {} - }) - const automaticSources = - compiler.root === 'none' ? [] : [compiler.root ?? { base: root, pattern: '**/*' }] - const scanner = new Scanner({ - sources: [ - ...automaticSources.map((source) => ({ ...source, negated: false })), - ...compiler.sources - ] - }) - const css = compiler.build(scanner.scan()) - expect(css).toContain('z-index: 31415') - expect(css).not.toContain('z-index: 27182') - expect(css).not.toContain('z-index: 16180') - - writeFileSync(join(components, 'added.tsx'), 'export const style = "z-[14142]"') - expect(compiler.build(scanner.scan())).toContain('z-index: 14142') - } finally { - rmSync(root, { recursive: true, force: true }) - } -}) diff --git a/config/scripts/test-runtime/environment/vitest-orcad-feature-readiness-reset.ts b/config/scripts/test-runtime/environment/vitest-orcad-feature-readiness-reset.ts index b5480be2016..8675c384f75 100644 --- a/config/scripts/test-runtime/environment/vitest-orcad-feature-readiness-reset.ts +++ b/config/scripts/test-runtime/environment/vitest-orcad-feature-readiness-reset.ts @@ -1,6 +1,6 @@ // A startOrcad test that fails partway must not leave latches closed: later tests in the worker would wait 10 s. import { afterEach } from 'vitest' -import { _resetOrcadFeatureReadinessForTests } from '../../../../src/main/runtime/rpc/orcad-feature-readiness' +import { _resetOrcadFeatureReadinessForTests } from '../../../../src/main/runtime/rpc/startup/orcad-readiness' afterEach(() => { _resetOrcadFeatureReadinessForTests() 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 7af8783a59b..8b639caf0d7 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 @@ -12,14 +12,13 @@ const NODE_RUNTIME_INCLUDE = [ 'tests/e2e/cursor-quota-transport.unit.test.ts', 'tests/e2e/helpers/electron-process-shutdown.unit.test.ts', 'src/main/ai-vault-search/storage/session-search-index-writer.test.ts', - 'src/main/ai-vault/session-scanner-unlimited-dedup.test.ts', + 'src/main/ai-vault/parsing/session-scanner-unlimited-dedup.test.ts', // The parse cache persists through node:sqlite. 'src/main/ai-vault/parse-cache/session-parse-cache-antigravity-upgrade.test.ts', 'src/main/ai-vault/parse-cache/session-parse-cache-persistence.test.ts', - 'src/main/ai-vault/session-scanner-scope-cwd-facts.test.ts', - 'src/main/ai-vault/session-scanner-scope-walk.test.ts', + 'src/main/ai-vault/scope/session-scanner-scope-walk.test.ts', // The forced-probe handoff race opens only under V8's promise scheduling, which Electron main uses. - 'src/main/github/rate-limit.test.ts', + 'src/main/github/api/rate-limit.test.ts', // Electron main bridges streams with Node's implementation. 'src/main/host/electron-http-client.test.ts', 'src/main/browser/extensions/native-messaging/browser-extension-native-host-process-backpressure.test.ts', @@ -108,28 +107,26 @@ const NODE_RUNTIME_INCLUDE = [ // Playwright's CDP transport needs Node's WebSocket implementation. 'src/main/browser/guest-lifecycle/popups/presentation/popup-origin-chrome.electron.test.ts', 'src/main/browser/guest-lifecycle/navigation/browser-link-materialization.electron.test.ts', - 'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-compatibility.electron.test.ts', 'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-native-compatibility.electron.test.ts', 'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-background-compatibility.electron.test.ts', 'src/main/ai-vault/scanners/devin/session-scanner-devin-db.test.ts', 'src/shared/workspace-session/workspace-session-salvage.test.ts', 'src/main/git/repositories/discovery/repo-detection.test.ts', 'src/renderer/src/components/browser-pane/annotate/browser-grab-toast-owner-cleanup.test.tsx', - 'src/main/window/native-chat-paste-files.test.ts', + 'src/main/native-chat/paste-files/native-chat-paste-files.test.ts', 'src/main/computer/desktop-script/runtime-host/desktop-script-serve-channel.test.ts', 'src/main/providers/local-pty/local-pty-child-process-verdict.test.ts', 'src/main/providers/working-directory-validation.test.ts', 'src/main/pty/process-retirement/posix-pty-process-groups.integration.test.ts', 'src/shared/ephemeral-vm-recipe-output-capture.test.ts', - 'src/main/window/main-window-updater-deferred-setup.test.ts', + 'src/main/updater/lifecycle/main-window-updater-deferred-setup.test.ts', 'src/renderer/src/components/terminal-pane/host-state/terminal-pane-host-state-memo.test.ts', 'src/main/native-chat/agent-session-journal/**/*.test.ts', 'src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-terminal-writer-acquire.test.ts', 'src/main/runtime/agent-session/records/agent-session-conversation-name-store.test.ts', - 'src/main/runtime/rpc/ws-transport.test.ts', 'src/main/runtime/rpc/methods/structured-sessions/attachments/structured-agent-session-visual.test.ts', // Bun resolves 'ws' to its built-in client, which bypasses the patched package. - 'src/main/runtime/rpc/ws-empty-payload-frame-write.test.ts', + 'src/main/runtime/rpc/transports/websocket/ws-empty-payload-frame-write.test.ts', 'src/shared/remote-runtime/remote-runtime-client.test.ts', 'src/shared/remote-runtime/remote-runtime-connect-bound.test.ts', // Bun's built-in ws client ignores maxPayload; the product opener only runs on Node. diff --git a/config/scripts/workflow/source-routing/pr-code-change-scope.mjs b/config/scripts/workflow/source-routing/pr-code-change-scope.mjs index 30cf31c68da..089fd4e407b 100644 --- a/config/scripts/workflow/source-routing/pr-code-change-scope.mjs +++ b/config/scripts/workflow/source-routing/pr-code-change-scope.mjs @@ -211,7 +211,7 @@ const CROSS_VERSION_WIRE_PREFIXES = [ 'src/shared/browser/client-hosting/browser-client-host-protocol', 'src/shared/browser/network/tunnels/browser-network-tunnel-protocol', // Both released/current WebSocket transports must accept web upgrade marker (cross-version-web-upgrade-marker). - 'src/main/runtime/rpc/ws-transport.ts', + 'src/main/runtime/rpc/transports/websocket/ws-transport.ts', 'src/shared/web-origin-security.ts', 'src/shared/browser/client-hosting/browser-client-host-placement', 'src/shared/agent-launch/contracts/agent-launch-intent', @@ -241,7 +241,7 @@ const CROSS_VERSION_WIRE_PREFIXES = [ 'src/shared/agent-session-record', 'src/shared/agent-session-provider-handle', 'src/shared/agent-session/journal/', - 'src/main/ai-vault/structured-session-ownership.ts', + 'src/main/ai-vault/structured-sessions/structured-session-ownership.ts', 'src/main/native-chat/agent-session-journal/', 'src/main/native-chat/agent-session-wire/', // The released phone contract runs the current discovery owner and Claude producer. @@ -258,11 +258,11 @@ const CROSS_VERSION_WIRE_PREFIXES = [ 'src/main/runtime/rpc/dispatcher', // Run on every request the suites dispatch, whatever its method. 'src/main/runtime/rpc/core.ts', - 'src/main/runtime/rpc/errors.ts', - 'src/main/runtime/rpc/orchestration-contract-fence.ts', - 'src/main/runtime/rpc/orchestration-session-caller.ts', - 'src/main/runtime/rpc/orchestration-legacy-compatibility.ts', - 'src/main/runtime/rpc/orchestration-mutation-executor.ts', + 'src/main/runtime/rpc/responses/rpc-response.ts', + 'src/main/runtime/rpc/orchestration/compatibility/orchestration-contract-fence.ts', + 'src/main/runtime/rpc/orchestration/callers/orchestration-session-caller.ts', + 'src/main/runtime/rpc/orchestration/compatibility/orchestration-legacy-compatibility.ts', + 'src/main/runtime/rpc/orchestration/mutations/orchestration-mutation-executor.ts', 'src/shared/orchestration/orchestration-rpc-contract.ts', 'src/main/runtime/rpc/methods/agent-launch/agent-launch', 'src/main/runtime/rpc/methods/history/ai-vault.ts', diff --git a/config/scripts/workflow/source-routing/pr-e2e-source-routing.mjs b/config/scripts/workflow/source-routing/pr-e2e-source-routing.mjs index 9ff01ceca20..185f388ef22 100644 --- a/config/scripts/workflow/source-routing/pr-e2e-source-routing.mjs +++ b/config/scripts/workflow/source-routing/pr-e2e-source-routing.mjs @@ -132,7 +132,7 @@ export const PR_E2E_SOURCE_ROUTES = [ file ) || (isProductSource(file) && - /^src\/(?:cli\/runtime\/(?:launch|serve-)|main\/orcad\/(?:main|orcad-entry|orcad-command-startup|orcad-instance-lock|orcad-command-arguments|orcad-lifecycle)\.ts$|main\/startup\/desktop-profile-instance-lock\.ts$|main\/daemon\/(?:[^/]+\/)*daemon-(?:spawner|endpoint-adoption|init)|main\/server\/serve-)/.test( + /^src\/(?:cli\/runtime\/(?:launch|serve-)|main\/orcad\/(?:main|orcad-entry|orcad-command-startup|orcad-instance-lock|orcad-command-arguments|orcad-lifecycle)\.ts$|main\/startup\/profile-startup\/desktop-profile-instance-lock\.ts$|main\/daemon\/(?:[^/]+\/)*daemon-(?:spawner|endpoint-adoption|init)|main\/server\/serve-)/.test( file )) }, @@ -142,14 +142,16 @@ export const PR_E2E_SOURCE_ROUTES = [ matches: (file) => file === 'tests/e2e/helpers/orca-serve-cli-host.ts' || (isProductSource(file) && - /^src\/main\/startup\/(?:windows-app-data-path|main-process-preflight)\.ts$/.test(file)) + /^src\/main\/startup\/(?:windows-startup\/windows-app-data-path|main-process-preflight)\.ts$/.test( + file + )) }, { id: 'clipboard.windows-copy-file', specs: ['tests/e2e/file-explorer-copy-file-windows.spec.ts'], matches: (file) => isProductSource(file) && - /^src\/(?:main\/window\/clipboard-(?:file-copy|ipc-handlers)|renderer\/src\/components\/right-sidebar\/file-explorer\/panel\/file-explorer-row-file-transfer)\.ts$/.test( + /^src\/(?:main\/window\/clipboard\/clipboard-(?:file-copy|ipc-handlers)|renderer\/src\/components\/right-sidebar\/file-explorer\/panel\/file-explorer-row-file-transfer)\.ts$/.test( file ) }, @@ -492,7 +494,7 @@ export const PR_E2E_SOURCE_ROUTES = [ matches: (file) => file === 'tests/e2e/helpers/connector-fake-claude.ts' || (isProductSource(file) && - /^src\/(?:main\/external-conversations\/|main\/runtime\/rpc\/methods\/connector\.ts$|cli\/(?:handlers|specs)\/connector\.ts$|shared\/rpc-contract\/connector-params\.ts$)/.test( + /^src\/(?:main\/external-conversations\/|main\/runtime\/rpc\/methods\/connector\.ts$|cli\/(?:connectors|specs)\/connector\.ts$|shared\/rpc-contract\/connector-params\.ts$)/.test( file )) } diff --git a/config/scripts/workflow/source-routing/pr-editor-preview-e2e-source-routes.mjs b/config/scripts/workflow/source-routing/pr-editor-preview-e2e-source-routes.mjs index 22ff77e7998..5beaae6b8be 100644 --- a/config/scripts/workflow/source-routing/pr-editor-preview-e2e-source-routes.mjs +++ b/config/scripts/workflow/source-routing/pr-editor-preview-e2e-source-routes.mjs @@ -51,7 +51,7 @@ export const PR_EDITOR_PREVIEW_E2E_SOURCE_ROUTES = [ ) || [ 'src/main/ipc/filesystem/filesystem-read-handlers.ts', - 'src/main/startup/privileged-custom-schemes.ts', + 'src/main/startup/chromium-policy/privileged-custom-schemes.ts', 'src/preload/api/fs-bridge.ts', 'src/renderer/src/runtime/files/reads/runtime-file-range-preview.ts', 'src/renderer/src/runtime/files/reads/runtime-file-read-client.ts', diff --git a/config/scripts/workflow/source-routing/pr-feature-area-e2e-source-routes.mjs b/config/scripts/workflow/source-routing/pr-feature-area-e2e-source-routes.mjs index 1e6977f9dd9..63a7cb1c644 100644 --- a/config/scripts/workflow/source-routing/pr-feature-area-e2e-source-routes.mjs +++ b/config/scripts/workflow/source-routing/pr-feature-area-e2e-source-routes.mjs @@ -15,16 +15,7 @@ function featureRoute(id, specs, prefixes) { // Feature areas whose specs the nightly suite alone used to select (gap audit, Oct 2026). export const PR_FEATURE_AREA_E2E_SOURCE_ROUTES = [ - featureRoute( - 'feature.automations-ui', - ['automation-prompt-disclosure'], - [`${COMPONENTS}automations/`] - ), - featureRoute( - 'feature.sparse-checkout', - ['sparse-explorer-proof', 'sparse-preset-proof'], - [`${COMPONENTS}sparse/`] - ), + featureRoute('feature.sparse-checkout', ['sparse-explorer-proof'], [`${COMPONENTS}sparse/`]), featureRoute( 'feature.onboarding', ['onboarding', 'onboarding-language-catalog-retry'], diff --git a/config/scripts/workflow/source-routing/pr-package-test-paths.mjs b/config/scripts/workflow/source-routing/pr-package-test-paths.mjs index dd8a63c7bf8..7d65675fdae 100644 --- a/config/scripts/workflow/source-routing/pr-package-test-paths.mjs +++ b/config/scripts/workflow/source-routing/pr-package-test-paths.mjs @@ -129,7 +129,6 @@ export const LINUX_PACKAGE_TESTS = [ 'src/main/browser/guest-lifecycle/popups/presentation/popup-origin-chrome.electron.test.ts', 'src/main/browser/guest-lifecycle/navigation/browser-link-materialization.electron.test.ts', 'src/main/browser/client-pages/renderer/browser-client-page-renderer-lifecycle.electron.test.ts', - 'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-compatibility.electron.test.ts', 'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-native-compatibility.electron.test.ts', 'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-background-compatibility.electron.test.ts', 'src/main/browser/extensions/api-runtime/browser-extension-api.electron.test.ts', @@ -195,10 +194,10 @@ export const WINDOWS_BOUNDARY_TESTS = [ 'src/main/cli/wsl/wsl-cli-powershell-boundary.test.ts', 'src/main/cursor/hook-service.test.ts', 'src/main/orca-profiles/profile-index-store.test.ts', - 'src/main/startup/windows-install-dir-acl-repair.win32.test.ts', - 'src/main/startup/windows-app-data-path.test.ts', - 'src/main/startup/windows-std-handle-inheritance.win32.test.ts', - 'src/main/startup/windows-isolated-spawner.win32.test.ts', + 'src/main/startup/windows-install-permissions/windows-install-dir-acl-repair.win32.test.ts', + 'src/main/startup/windows-startup/windows-app-data-path.test.ts', + 'src/main/startup/windows-startup/windows-std-handle-inheritance.win32.test.ts', + 'src/main/startup/windows-startup/windows-isolated-spawner.win32.test.ts', 'src/main/runtime/workspaces/catalog/worktree-scan-admin-fingerprint-gate.test.ts', 'src/shared/secure-storage/secure-path-windows-acl.win32.test.ts', 'src/main/runtime/rpc/server/pairing/unreadable-secret-store-preservation.win32.test.ts', diff --git a/config/scripts/workflow/source-routing/pr-plugin-e2e-source-routes.mjs b/config/scripts/workflow/source-routing/pr-plugin-e2e-source-routes.mjs index 4b911af7b5c..b7314a73fe9 100644 --- a/config/scripts/workflow/source-routing/pr-plugin-e2e-source-routes.mjs +++ b/config/scripts/workflow/source-routing/pr-plugin-e2e-source-routes.mjs @@ -123,9 +123,9 @@ const SPECIFIC_PLUGIN_ROUTES = [ 'src\\/main\\/plugins\\/panels\\/(?:frame-serving\\/|guest-isolation\\/|desktop-actions\\/)?plugin-frame-', 'src\\/shared\\/plugins\\/frames\\/plugin-(?:frame-guest|panel-shell)', 'src\\/preload\\/plugin-frame-guest', - 'src\\/main\\/window\\/(?:main-window-webview-security|attach-main-window-services|host-frame-permission-policy)', + 'src\\/main\\/window\\/(?:security/(?:main-window-webview-security|host-frame-permission-policy)|attach-main-window-services)', 'src\\/main\\/ipc\\/(?:plugins|plugin-frame-entry-ipc)\\.ts$', - 'src\\/main\\/startup\\/main-process-plugins', + 'src\\/main\\/startup\\/plugin-startup\\/main-process-plugins', 'config\\/build-plugins\\/main-build-entry-points', 'src\\/main\\/browser\\/guest-lifecycle\\/input\\/browser-guest-shortcut-(?:forwarding|dispatch)', 'src\\/renderer\\/src\\/components\\/(?:plugins\\/frames\\/|right-sidebar\\/plugin-panels\\/PluginPanel\\.tsx$)', @@ -165,7 +165,7 @@ const SPECIFIC_PLUGIN_ROUTES = [ 'src\\/main\\/plugins\\/panels\\/(?:frame-serving\\/)?plugin-frame-(?:module-|source-serving|protocol\\.ts$)', 'src\\/main\\/plugins\\/plugin-content-hash', 'src\\/shared\\/plugins\\/frames\\/plugin-frame-source-modules', - 'src\\/cli\\/plugin-authoring\\/plugin-(?:type-files|components-template)', + 'src\\/cli\\/plugins\\/authoring\\/plugin-(?:type-files|components-template)', 'examples\\/plugins\\/hello-tsx\\/' ].join('|'), 'plugin-frame-guest|plugin-smoke' @@ -218,7 +218,7 @@ const SPECIFIC_PLUGIN_ROUTES = [ 'src\\/(?:main\\/plugins\\/view\\/(?!plugin-view-replay)|shared\\/plugins\\/view\\/)', 'src\\/main\\/runtime\\/rpc\\/methods\\/plugin-view', // Every `plugin shot` checks for a chrome region and resolves the default shots folder. - 'src\\/cli\\/(?:handlers\\/plugin-(?:view|shot-chrome|shot-default-dir)|specs\\/plugin-view)', + 'src\\/cli\\/(?:plugins\\/view\\/plugin-(?:view|shot-chrome|shot-default-dir)|specs\\/plugin-view)', 'src\\/renderer\\/src\\/hooks\\/(?:ipc-events\\/plugin-view-ipc-bridge|use-document-dark-theme)', 'src\\/renderer\\/src\\/components\\/right-sidebar\\/(?:plugin-panels\\/health\\/(?:plugin-panel-draw-status|use-plugin-panel-draw-report)|right-sidebar-panel-content)' ].join('|'), @@ -233,14 +233,14 @@ const SPECIFIC_PLUGIN_ROUTES = [ `${STORE}shot-replay`, 'src\\/main\\/plugins\\/view\\/plugin-view-replay', 'src\\/main\\/plugins\\/testing\\/plugin-test-(?:hooks|register)', - 'src\\/cli\\/(?:handlers|specs)\\/plugin-shot-scenario', - 'src\\/cli\\/plugin-authoring\\/plugin-(?:panel-check|test-runner|test-node)' + 'src\\/cli\\/(?:plugins\\/view|specs)\\/plugin-shot-scenario', + 'src\\/cli\\/plugins\\/authoring\\/plugin-(?:panel-check|test-runner|test-node)' ].join('|') ), pluginRoute( 'plugins.view-shot-editor', ['plugin-shot-editor'], - 'src\\/cli\\/handlers\\/plugin-shot-editor' + 'src\\/cli\\/plugins\\/view\\/plugin-shot-editor' ), pluginRoute( 'plugins.startup-and-manifest', 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 869a64153d3..de73fef0e5f 100644 --- a/config/scripts/workflow/source-routing/pr-shell-contract-prefixes.mjs +++ b/config/scripts/workflow/source-routing/pr-shell-contract-prefixes.mjs @@ -18,11 +18,11 @@ export const SHELL_PREFIXES = [ 'src/main/runtime/terminal/wait/tui-idle-evidence-source.ts', 'src/main/runtime/terminal/wait/tui-idle-evidence.ts', 'src/main/runtime/terminal/wait/tui-idle-zsh-preexec-hook-order.live-shell.test.ts', - 'src/main/startup/shell-probe-terminal-detach', - 'src/main/startup/shell-probe-lifetime', - 'src/main/startup/hydrate-shell-path', - 'src/main/startup/login-shell-environment', - 'src/main/startup/shell-path-probe', + 'src/main/startup/shell-environment/shell-probe-terminal-detach', + 'src/main/startup/shell-environment/shell-probe-lifetime', + 'src/main/startup/shell-environment/hydrate-shell-path', + 'src/main/startup/shell-environment/login-shell-environment', + 'src/main/startup/shell-environment/shell-path-probe', 'src/renderer/src/components/terminal-pane/pty-connection/emulation/fish-color-scheme', 'src/shared/fish-', 'src/shared/terminal/pty/ingress/pty-reply-echo-shapes', diff --git a/config/startup-worktree-localization-allowlist.json b/config/startup-worktree-localization-allowlist.json index 57d98c87207..4be5ddcec5a 100644 --- a/config/startup-worktree-localization-allowlist.json +++ b/config/startup-worktree-localization-allowlist.json @@ -1,6 +1,6 @@ [ { - "filePath": "src/main/startup/main-process-quit.ts", + "filePath": "src/main/startup/quit/main-process-quit.ts", "kind": "object-property:message", "text": "before-quit allowed for update install", "dynamic": false, @@ -8,7 +8,7 @@ "reason": "Updater lifecycle diagnostics are not displayed as UI copy." }, { - "filePath": "src/main/startup/main-process-quit.ts", + "filePath": "src/main/startup/quit/main-process-quit.ts", "kind": "object-property:message", "text": "will-quit cleanup for update install; daemonTeardown=disconnect", "dynamic": false, @@ -16,7 +16,7 @@ "reason": "Updater lifecycle diagnostics are not displayed as UI copy." }, { - "filePath": "src/main/startup/profile-state-recovery-preflight.ts", + "filePath": "src/main/startup/profile-startup/profile-state-recovery-preflight.ts", "kind": "object-property:message", "text": "Invalid profile-state recovery launch.", "dynamic": false, diff --git a/config/tsconfig.tc.web.json b/config/tsconfig.tc.web.json index 0b01e9e1eb6..82e91423858 100644 --- a/config/tsconfig.tc.web.json +++ b/config/tsconfig.tc.web.json @@ -64,6 +64,7 @@ "../src/main/ipc/worktree-linked-work-item-metadata.ts", "../src/main/ipc/worktree-metadata-merge.ts", "../src/main/wsl/discovery/wsl-availability.ts", + "../src/main/wsl/discovery/wsl-discovery-change.ts", "../src/main/wsl/filesystem/wsl-directory-probe-command.ts", "../src/main/wsl/discovery/wsl-distro-list-output.ts", "../src/main/wsl/discovery/wsl-distro-retry.ts", @@ -87,13 +88,13 @@ "../src/main/persistence/applying-settings/ui-selection-normalization.ts", "../src/main/persistence/applying-settings/ui-interaction-merge.ts", "../src/main/credentials/protected-secret-persistence.ts", - "../src/main/startup/serve-desktop-activation.ts", - "../src/main/startup/serve-mode-argv.ts", - "../src/main/startup/single-instance-lock.ts", - "../src/main/startup/startup-diagnostics.ts", - "../src/main/window/focus-existing-window.ts", - "../src/main/window/foreground-activation-policy.ts", - "../src/main/window/macos-app-activation.ts" + "../src/main/startup/serve-launch/serve-desktop-activation.ts", + "../src/main/startup/serve-launch/serve-mode-argv.ts", + "../src/main/startup/profile-startup/single-instance-lock.ts", + "../src/main/startup/diagnostics/startup-diagnostics.ts", + "../src/main/window/activation/focus-existing-window.ts", + "../src/main/window/activation/foreground-activation-policy.ts", + "../src/main/window/activation/macos-app-activation.ts" ], "compilerOptions": { "paths": { diff --git a/config/tsconfig.test.mobile-host-declarations.json b/config/tsconfig.test.mobile-host-declarations.json index df4e8408dd9..cb32d2f2e77 100644 --- a/config/tsconfig.test.mobile-host-declarations.json +++ b/config/tsconfig.test.mobile-host-declarations.json @@ -16,8 +16,8 @@ "../src/main/runtime/rpc/methods/source-control/github/github-repo-work-item-methods.ts", "../src/main/runtime/orca-runtime.ts", "../src/main/runtime/rpc/core.ts", - "../src/main/runtime/rpc/dispatcher-request-parsing.ts", - "../src/main/github/issue-field-options.ts", + "../src/main/runtime/rpc/dispatch/dispatcher-request-parsing.ts", + "../src/main/github/issues/issue-field-options.ts", "../src/main/runtime/workspaces/process-listing/runtime-worktree-ps-summaries.ts", "../src/types/build-constants.d.ts", "../src/main/native-chat/transcript-line-decoders-claude.ts", diff --git a/docs/assets/readme-downloads.svg b/docs/assets/readme-downloads.svg index 7d0cdd2a469..4a1eb462224 100644 --- a/docs/assets/readme-downloads.svg +++ b/docs/assets/readme-downloads.svg @@ -1,5 +1,5 @@ - - downloads: 173m + + downloads: 174m @@ -15,7 +15,7 @@ downloads downloads - 173m - 173m + 174m + 174m diff --git a/docs/reference/plugin-catalog.md b/docs/reference/plugin-catalog.md index f206c8f2b74..9ed6f37e209 100644 --- a/docs/reference/plugin-catalog.md +++ b/docs/reference/plugin-catalog.md @@ -63,7 +63,7 @@ The exact release the catalog vouches for. Orca refuses bytes that differ. | `images` | [CatalogImages](#catalogimages) | no | 1.4.245 | Images extracted from the release by catalog CI, which re-encodes them and strips metadata. Same rules as the manifest: icon PNG, WEBP, static, at least 128×128, square, at most 256 KB. Cover PNG, JPEG, WEBP, static, at least 800×500, at most 1024 KB. Screenshots PNG, JPEG, WEBP, static, at least 1280×800, at most 1536 KB. Images must not imitate Orca's trust badges. | | `themePreview` | [CatalogThemePreview](#catalogthemepreview)[] | no | 1.4.245 | Up to 4 theme palettes for listing art. Display only; the installed theme files decide the real colors. | | `contributes` | [CatalogContribution](#catalogcontribution)[] | no | 1.4.245 | What the release adds, as the listing shows it. Generate it with the catalog tooling; Orca refuses an install whose manifest says otherwise. | -| `capabilities` | (`"workspace:read"` \| `"workspace:write"` \| `"agent:read"` \| `"agent:launch"` \| `"terminal:send"` \| `"terminal:read"` \| `"notifications:show"` \| `"storage:own"` \| `"secrets:own"` \| `"settings:own"` \| `"appearance:write"`)[] | no | 1.4.245 | Every capability the release asks for. Orca refuses an install whose manifest asks for different ones. Example: `["notifications:show"]` | +| `capabilities` | (`"workspace:read"` \| `"workspace:write"` \| `"agent:read"` \| `"agent:launch"` \| `"terminal:send"` \| `"terminal:read"` \| `"notifications:show"` \| `"storage:own"` \| `"secrets:own"` \| `"settings:own"` \| `"appearance:write"` \| `"workspace:create"` \| `"automation:read"` \| `"automation:write"` \| `"history:read"`)[] | no | 1.4.245 | Every capability the release asks for. Orca refuses an install whose manifest asks for different ones. Example: `["notifications:show"]` | | `fileTypes` | string[] | no | 1.4.245 | Extensions, without the dot, that this release opens. Orca suggests the plugin when such a file has no viewer. | | `editorFileTypes` | string[] | no | 1.4.245 | The `fileTypes` this release opens in a custom editor. Orca suggests the plugin for such a file even when it already opens it as text. | diff --git a/docs/reference/plugin-host-api.md b/docs/reference/plugin-host-api.md index b0f38a0930d..83a83ca7808 100644 --- a/docs/reference/plugin-host-api.md +++ b/docs/reference/plugin-host-api.md @@ -2,7 +2,7 @@ -Host API 1.6 (`"pluginApi": 1`). Workers call a method with `await orca.host.call(name, params)`; panels and custom editors call the same methods through `window.orca.host.call(name, params)`. Each method lists the surfaces allowed to call it; any other surface gets `not_permitted`. `orca.host.has(name)` answers synchronously whether this Orca offers a method on the current surface, and `orca.api` is `{ major, minor }`. See [Plugin authoring](./plugin-authoring.md) for the frame API. +Host API 1.9 (`"pluginApi": 1`). Workers call a method with `await orca.host.call(name, params)`; panels and custom editors call the same methods through `window.orca.host.call(name, params)`. Each method lists the surfaces allowed to call it; any other surface gets `not_permitted`. `orca.host.has(name)` answers synchronously whether this Orca offers a method on the current surface, and `orca.api` is `{ major, minor }`. See [Plugin authoring](./plugin-authoring.md) for the frame API. Every call is checked against the capabilities the user approved, and params are validated before Orca runs anything: params are strict, so a field this Orca does not know is refused with `invalid_params` instead of being dropped. Mutations are recorded in the audit log as `plugin:.`. @@ -12,7 +12,7 @@ Methods whose capability is `none` need no capability but still need the plugin | Method | Capability | Surfaces | Mutation | Since | Summary | | --- | --- | --- | --- | --- | --- | -| [`workspace.readContext`](#workspacereadcontext) | `workspace:read` | worker, panel, editor | no | 1.0 | Branch, name and terminal ids of the focused workspace, or null when none is focused. | +| [`workspace.readContext`](#workspacereadcontext) | `workspace:read` | worker, panel, editor | no | 1.0 | Id, branch, name and terminal ids of the focused workspace, or null when none is focused. | | [`terminal.sendText`](#terminalsendtext) | `terminal:send` | worker | yes | 1.0 | Types text into one terminal named by id, optionally pressing Enter. | | [`notifications.show`](#notificationsshow) | `notifications:show` | worker, panel, editor | yes | 1.0 | Shows a desktop notification. | | [`storage.get`](#storageget) | `storage:own` | worker, panel, editor | no | 1.0 | Reads a JSON value from the plugin's private store; null when absent. | @@ -28,12 +28,13 @@ Methods whose capability is `none` need no capability but still need the plugin | [`shell.openExternal`](#shellopenexternal) | none | panel, editor | no | 1.1 | Opens an http:, https: or mailto: URL in the default browser. Needs a click or key press in the frame; desktop app only. Orca asks the person before an http(s) host the plugin was not allowed; `opened` is false if they cancel. | | [`files.saveAs`](#filessaveas) | none | panel, editor | yes | 1.1 | Offers data (a string or ArrayBuffer, up to 64 MiB) in Orca's save dialog; the plugin never learns the path. Needs a click or key press in the frame; desktop app only. | | [`plugin.request`](#pluginrequest) | none | panel, editor | no | 1.2 | Asks the plugin's own worker to run the handler it registered with `orca.panels.handle(name)`, starting the worker if needed; resolves with what the handler returned. `unknown_method` when no handler has that name. | -| [`agents.list`](#agentslist) | `agent:read` | worker, panel, editor | no | 1.2 | The agents in the focused workspace: their terminal, title, agent kind and status. `agent.status.changed` reports each change after. | +| [`agents.list`](#agentslist) | `agent:read` | worker, panel, editor | no | 1.2 | The agents in the focused workspace: their terminal, title, agent kind, status, session and dispatched task. `agent.status.changed` reports each change after. | | [`events.subscribe`](#eventssubscribe) | none | panel, editor | no | 1.2 | Delivers a workspace, agent or editor event to this panel as `orca.on(event)`; needs the event's read capability, when it has one. The frame APIs call it for you. | | [`statusBar.update`](#statusbarupdate) | none | worker | no | 1.2 | Changes one of the plugin's `contributes.statusBarItems` (named by `id`): fields given replace their current value, `visible: false` hides it. Desktop app only; lasts until Orca restarts, and is hidden while the plugin is disabled. A plugin with `main` and status bar items has its worker started when it is enabled and kept running while it stays enabled, so a worker can poll and update its items without an event or a hook. | | [`appearance.read`](#appearanceread) | `appearance:write` | worker | no | 1.4 | Reads the current desktop appearance revision for a conditional update. | | [`appearance.apply`](#appearanceapply) | `appearance:write` | worker | yes | 1.4 | Publishes owned app/editor and terminal colors and selects them in the desktop. Returns publication, not renderer acknowledgement. | -| [`workspace.list`](#workspacelist) | `workspace:read` | worker | no | 1.3 | Lists every workspace, Git worktrees and folders, on every host Orca reaches. | +| [`workspace.list`](#workspacelist) | `workspace:read` | worker | no | 1.3 | Lists every workspace, Git worktrees and folders, on every host Orca reaches; `includeStatus` (host API 1.7) adds each one's agent status. `hostId` is the host a row records (`local`, `ssh:…`, `runtime:…`), or null when it records none, as for a project-group folder on this machine. | +| [`project.list`](#projectlist) | `workspace:read` | worker | no | 1.7 | Lists your projects (repositories and folders) on every host; `id` is what `workspace.list` rows name as `projectId`. `hostId` is always named: `local`, `ssh:…` or `runtime:…`. | | [`workspace.open`](#workspaceopen) | `workspace:write` | worker | yes | 1.3 | Shows a workspace in Orca, as clicking it in the sidebar does; a folder workspace needs the desktop app. | | [`workspace.rename`](#workspacerename) | `workspace:write` | worker | yes | 1.5 | Renames a workspace in Orca's sidebar, as renaming it by hand does; the name stays until it is renamed again. | | [`terminal.create`](#terminalcreate) | `terminal:send` | worker | yes | 1.3 | Opens a terminal in a workspace, optionally running a command, in the background. | @@ -41,14 +42,25 @@ Methods whose capability is `none` need no capability but still need the plugin | [`agent.launch`](#agentlaunch) | `agent:launch` | worker | yes | 1.3 | Starts an agent's CLI in a new terminal of a workspace, in the background, and returns as soon as it starts; a `prompt` is sent once the agent is ready. | | [`editor.open`](#editoropen) | `workspace:write` | worker | yes | 1.3 | Opens a file of a workspace in an editor tab of Orca's window; desktop app only. `workspace.open` shows the workspace. | | [`commands.run`](#commandsrun) | `workspace:write` | worker | yes | 1.3 | Runs one of Orca's built-in actions in its window, never a plugin's replacement of it; desktop app only. | +| [`project.setHidden`](#projectsethidden) | `workspace:write` | worker | yes | 1.9 | Hides a project from Orca's sidebar, or shows it again, as Hide Project in its menu does. View-only: its workspaces, terminals, agents and automations keep running, `workspace.list` still lists its workspaces, `project.list` marks it `hidden`, and Orca's Hidden projects list can show it again. It changes one host's copy of the project; on a paired Orca server it hides the project for everyone connected. | +| [`terminal.list`](#terminallist) | `workspace:read` | worker | no | 1.7 | Lists a workspace's terminals, at most 50; `workspace.readContext` lists the focused one's. | +| [`terminal.focus`](#terminalfocus) | `workspace:write` | worker | yes | 1.7 | Shows any terminal's workspace and focuses its pane, as clicking it does; desktop app only. `focused` is false when a newer focus request won or the window did not move to it. | +| [`terminal.close`](#terminalclose) | `terminal:send` | worker | yes | 1.7 | Closes a terminal of the focused workspace, or one this plugin opened (`terminal.create`, `agent.launch`), stopping what runs in it (local or SSH); closing its last pane closes the tab. Any other terminal is refused with `action_failed`. A plugin keeps its terminals until it is disabled or removed. | +| [`workspace.create`](#workspacecreate) | `workspace:create` (+`agent:launch` for `agent`) | worker | yes | 1.8 | Creates a workspace (a new branch and worktree) in a Git project, local or SSH, and returns its id; with `agent`, starts that agent there once setup has run, in the background unless `open`; if the agent fails after the workspace exists, the error names its id. Orca's workspace-create and agent hooks run as for any create. | +| [`agent.resume`](#agentresume) | `agent:launch` | worker | yes | 1.8 | Resumes an agent's earlier session by its `sessionId` in a new terminal of a workspace, in the background; `started` is false when an Orca terminal already runs it. From host API 1.9, a session no Orca pane runs that Agent Session History lists on this computer (among the workspace's own sessions and the 200 newest) is prepared and started as Orca's own Resume does, in the agent account Orca would pick; only `agent:launch` is needed, since the plugin must already know the id. Other sessions, and workspaces on another host, resume by id. In WSL it uses the distro's default agent account, as `agent.launch` does. | +| [`automation.list`](#automationlist) | `automation:read` | worker | no | 1.8 | Lists the automations this Orca schedules, at most 200, with each one's prompt cut to 4096 characters. | +| [`automation.create`](#automationcreate) | `automation:write` | worker | yes | 1.8 | Creates an automation that starts `agent` with `prompt` on `schedule`, even when the plugin is not running, with the person's settings for that agent; Orca's Automations page shows it as created by the plugin. | +| [`automation.update`](#automationupdate) | `automation:write` | worker | yes | 1.8 | Changes an automation's name, prompt, schedule, time zone or whether it is enabled. Orca first asks the person about an automation this plugin did not create (or created before it was removed or disabled); if they decline or cannot be asked, or it changes while they are asked, nothing changes and `reason` says why. Orca also asks before a new prompt or schedule, or resuming, for any automation whose runs use extra agent settings the person chose. | +| [`automation.delete`](#automationdelete) | `automation:write` | worker | yes | 1.8 | Deletes an automation. Orca first asks the person about an automation this plugin did not create (or created before it was removed or disabled); if they decline or cannot be asked, or it changes while they are asked, nothing changes and `reason` says why. | +| [`agent.listSessions`](#agentlistsessions) | `history:read` | worker | no | 1.9 | Past agent sessions in Orca's Agent Session History on this computer (WSL distributions included on Windows), newest first: title, agent, workspace, branch, times, message and token counts, and whether an Orca terminal here runs it. Leaves out Antigravity IDE conversations and subagent transcripts, and never gives the conversation or file paths, though a title can be the start of its first message. `agent.resume` resumes one by its `sessionId`, for agents that resume by id. | | [`editor.readTypography`](#editorreadtypography) | none | worker, panel, editor | no | 1.6 | The font family, size, weight, line height, ligatures, word wrap and minimap Orca's file editor uses now, editor zoom included. `editor.typography.changed` reports each change after. | ### `workspace.readContext` -Branch, name and terminal ids of the focused workspace, or null when none is focused. +Id, branch, name and terminal ids of the focused workspace, or null when none is focused. ```ts -(params?: {}) => { branch: string; displayName: string; terminals: { id: string; title?: string }[] } | null +(params?: {}) => { workspaceId?: string; branch: string; displayName: string; terminals: { id: string; title?: string }[] } | null ``` ### `terminal.sendText` @@ -173,10 +185,10 @@ Asks the plugin's own worker to run the handler it registered with `orca.panels. ### `agents.list` -The agents in the focused workspace: their terminal, title, agent kind and status. `agent.status.changed` reports each change after. +The agents in the focused workspace: their terminal, title, agent kind, status, session and dispatched task. `agent.status.changed` reports each change after. ```ts -(params?: {}) => { agents: { terminalId: string | null; title: string | null; agent: string | null; state: "working" | "blocked" | "waiting" | "done"; stateStartedAt: number }[] } +(params?: {}) => { agents: { terminalId: string | null; title: string | null; agent: string | null; state: "working" | "blocked" | "waiting" | "done"; stateStartedAt: number; sessionId?: string | null; task?: { title: string } | null }[] } ``` ### `events.subscribe` @@ -213,10 +225,18 @@ Publishes owned app/editor and terminal colors and selects them in the desktop. ### `workspace.list` -Lists every workspace, Git worktrees and folders, on every host Orca reaches. +Lists every workspace, Git worktrees and folders, on every host Orca reaches; `includeStatus` (host API 1.7) adds each one's agent status. `hostId` is the host a row records (`local`, `ssh:…`, `runtime:…`), or null when it records none, as for a project-group folder on this machine. ```ts -(params?: {}) => { workspaces: { id: string; kind: "worktree" | "folder"; name: string; project?: string | null; path: string; branch: string | null; hostId: string | null }[]; truncated: boolean } +(params?: { includeStatus?: boolean }) => { workspaces: { id: string; kind: "worktree" | "folder"; name: string; project?: string | null; projectId?: string | null; path: string; branch: string | null; hostId: string | null; status?: { state: "working" | "permission" | "done" | "active" | "inactive"; unread: boolean; terminalCount: number; lastActivityAt: number | null } }[]; truncated: boolean; statusTruncated?: boolean } +``` + +### `project.list` + +Lists your projects (repositories and folders) on every host; `id` is what `workspace.list` rows name as `projectId`. `hostId` is always named: `local`, `ssh:…` or `runtime:…`. + +```ts +(params?: {}) => { projects: { id: string; name: string; kind: "git" | "folder"; hostId: string | null; path: string; hidden?: boolean }[]; truncated: boolean } ``` ### `workspace.open` @@ -275,6 +295,94 @@ Runs one of Orca's built-in actions in its window, never a plugin's replacement (params: { action: "worktree.history.back" | "worktree.history.forward" | "sidebar.left.toggle" | "sidebar.sleepingWorkspaces.toggle" | "floatingWorkspace.maximize" | "tab.rename" | "workspace.rename" | "workspace.openBoard" | "view.tasks" | "sidebar.right.toggle" | "sidebar.explorer.toggle" | "sidebar.search.toggle" | "sidebar.sourceControl.toggle" | "sidebar.checks.toggle" | "sidebar.ports.toggle" }) => { ran: true } ``` +### `project.setHidden` + +Hides a project from Orca's sidebar, or shows it again, as Hide Project in its menu does. View-only: its workspaces, terminals, agents and automations keep running, `workspace.list` still lists its workspaces, `project.list` marks it `hidden`, and Orca's Hidden projects list can show it again. It changes one host's copy of the project; on a paired Orca server it hides the project for everyone connected. + +```ts +(params: { projectId: string; hostId?: string; hidden: boolean }) => { hostId: string; hidden: boolean } +``` + +### `terminal.list` + +Lists a workspace's terminals, at most 50; `workspace.readContext` lists the focused one's. + +```ts +(params: { workspaceId: string }) => { terminals: { id: string; title?: string }[]; truncated: boolean } +``` + +### `terminal.focus` + +Shows any terminal's workspace and focuses its pane, as clicking it does; desktop app only. `focused` is false when a newer focus request won or the window did not move to it. + +```ts +(params: { terminalId: string }) => { focused: boolean } +``` + +### `terminal.close` + +Closes a terminal of the focused workspace, or one this plugin opened (`terminal.create`, `agent.launch`), stopping what runs in it (local or SSH); closing its last pane closes the tab. Any other terminal is refused with `action_failed`. A plugin keeps its terminals until it is disabled or removed. + +```ts +(params: { terminalId: string }) => { closed: true } +``` + +### `workspace.create` + +Creates a workspace (a new branch and worktree) in a Git project, local or SSH, and returns its id; with `agent`, starts that agent there once setup has run, in the background unless `open`; if the agent fails after the workspace exists, the error names its id. Orca's workspace-create and agent hooks run as for any create. + +```ts +(params: { projectId: string; hostId?: string; name?: string; baseBranch?: string; agent?: string; prompt?: string; setup?: "skip"; open?: boolean }) => { workspaceId: string; terminalId?: string } +``` + +### `agent.resume` + +Resumes an agent's earlier session by its `sessionId` in a new terminal of a workspace, in the background; `started` is false when an Orca terminal already runs it. From host API 1.9, a session no Orca pane runs that Agent Session History lists on this computer (among the workspace's own sessions and the 200 newest) is prepared and started as Orca's own Resume does, in the agent account Orca would pick; only `agent:launch` is needed, since the plugin must already know the id. Other sessions, and workspaces on another host, resume by id. In WSL it uses the distro's default agent account, as `agent.launch` does. + +```ts +(params: { workspaceId: string; agent: "claude" | "codebuddy" | "codex" | "qoder" | "qoder-cn" | "qwen-code" | "gemini" | "antigravity" | "opencode" | "opencode2" | "pi" | "mimo-code" | "droid" | "grok" | "devin" | "omp" | "prime-agent" | "copilot" | "cursor" | "kimi" | "muse" | "zcode" | "dsh" | "jcode" | "kiro" | "hermes"; sessionId: string }) => { terminalId: string; started: boolean } +``` + +### `automation.list` + +Lists the automations this Orca schedules, at most 200, with each one's prompt cut to 4096 characters. + +```ts +(params?: {}) => { automations: { id: string; name: string; agent: string; prompt: string; promptTruncated: boolean; projectId: string | null; hostId: string | null; workspaceId: string | null; workspaceMode: "existing" | "new-per-run"; schedule: string | null; timezone: string; enabled: boolean; nextRunAt: number | null; lastRunAt: number | null; createdByThisPlugin: boolean }[]; truncated: boolean } +``` + +### `automation.create` + +Creates an automation that starts `agent` with `prompt` on `schedule`, even when the plugin is not running, with the person's settings for that agent; Orca's Automations page shows it as created by the plugin. + +```ts +(params: { name: string; prompt: string; agent: string; projectId?: string; hostId?: string; workspaceId?: string; schedule: string; timezone?: string; enabled?: boolean; creationKey?: string }) => { automationId: string } +``` + +### `automation.update` + +Changes an automation's name, prompt, schedule, time zone or whether it is enabled. Orca first asks the person about an automation this plugin did not create (or created before it was removed or disabled); if they decline or cannot be asked, or it changes while they are asked, nothing changes and `reason` says why. Orca also asks before a new prompt or schedule, or resuming, for any automation whose runs use extra agent settings the person chose. + +```ts +(params: { automationId: string; name?: string; prompt?: string; schedule?: string; timezone?: string; enabled?: boolean }) => { updated: boolean; reason?: "cancelled" | "consent-unavailable" | "changed" } +``` + +### `automation.delete` + +Deletes an automation. Orca first asks the person about an automation this plugin did not create (or created before it was removed or disabled); if they decline or cannot be asked, or it changes while they are asked, nothing changes and `reason` says why. + +```ts +(params: { automationId: string }) => { deleted: boolean; reason?: "cancelled" | "consent-unavailable" | "changed" } +``` + +### `agent.listSessions` + +Past agent sessions in Orca's Agent Session History on this computer (WSL distributions included on Windows), newest first: title, agent, workspace, branch, times, message and token counts, and whether an Orca terminal here runs it. Leaves out Antigravity IDE conversations and subagent transcripts, and never gives the conversation or file paths, though a title can be the start of its first message. `agent.resume` resumes one by its `sessionId`, for agents that resume by id. + +```ts +(params?: { workspaceId?: string; limit?: number }) => { sessions: { sessionId: string; agent: string; title: string; workspaceId: string | null; hostId: string; branch: string | null; createdAt: number | null; updatedAt: number; messageCount: number; totalTokens: number; running: boolean }[]; truncated: boolean } +``` + ### `editor.readTypography` The font family, size, weight, line height, ligatures, word wrap and minimap Orca's file editor uses now, editor zoom included. `editor.typography.changed` reports each change after. @@ -289,10 +397,10 @@ A worker receives the events its manifest lists in `contributes.events` through | Event | Payload | Summary | | --- | --- | --- | -| `workspace.created` | `{ workspaceId: string; kind: "worktree" \| "folder"; path: string; branch: string }` | A worktree workspace was created. | -| `workspace.removed` | `{ workspaceId: string; kind: "worktree" \| "folder"; path: string }` | A worktree workspace was removed. | -| `agent.status.changed` | `{ workspaceId: string \| null; paneKey: string; terminalId?: string; title?: string; state: "working" \| "blocked" \| "waiting" \| "done"; receivedAt: number; mainAgent?: { state: "working" \| "blocked" \| "waiting" \| "done"; outcome?: "success" \| "failure" \| "cancellation" \| "superseded" \| "interruption" \| "unconfirmed"; stateStartedAt: number } }` | An agent in a terminal pane changed status; `workspaceId` is null when Orca cannot tie the pane to a workspace, and `terminalId` names its terminal when Orca lists it. | -| `workspace.changed` | `{ context: { branch: string; displayName: string; terminals: { id: string; title?: string }[] } \| null }` | The focused workspace changed, or its terminals were opened, closed or renamed; `context` is what `workspace.readContext` now answers. Each new subscriber first gets the current context. | +| `workspace.created` | `{ workspaceId: string; workspaceListId?: string; kind: "worktree" \| "folder"; path: string; branch: string }` | A worktree workspace was created; `workspaceListId` (host API 1.7) is the id `workspace.list` gives it. | +| `workspace.removed` | `{ workspaceId: string; workspaceListId?: string; kind: "worktree" \| "folder"; path: string }` | A worktree workspace was removed; `workspaceListId` (host API 1.7) is the id `workspace.list` gave it. | +| `agent.status.changed` | `{ workspaceId: string \| null; workspaceListId?: string; paneKey: string; terminalId?: string; title?: string; state: "working" \| "blocked" \| "waiting" \| "done"; receivedAt: number; mainAgent?: { state: "working" \| "blocked" \| "waiting" \| "done"; outcome?: "success" \| "failure" \| "cancellation" \| "superseded" \| "interruption" \| "unconfirmed"; stateStartedAt: number }; sessionId?: string }` | An agent in a terminal pane changed status; `workspaceId` is null when Orca cannot tie the pane to a workspace, `workspaceListId` (host API 1.7) is the id `workspace.list` gives that workspace, `terminalId` names its terminal when Orca lists it, and `sessionId` (host API 1.8) is what `agent.resume` takes. | +| `workspace.changed` | `{ context: { workspaceId?: string; branch: string; displayName: string; terminals: { id: string; title?: string }[] } \| null }` | The focused workspace changed, or its terminals were opened, closed or renamed; `context` is what `workspace.readContext` now answers, its `workspaceId` included. Each new subscriber first gets the current context. | | `editor.typography.changed` | `{ fontFamily: string; cssFontFamily: string; fontSize: number; fontWeight: string; lineHeight: number; fontLigatures: boolean; wordWrap: "on" \| "off"; minimap: boolean }` | What Orca's file editor uses changed (a setting or the editor zoom); the payload is what `editor.readTypography` now answers. Needs no capability. | ## Hooks diff --git a/docs/reference/plugin-manifest.md b/docs/reference/plugin-manifest.md index a257a924c7c..fd039f450f8 100644 --- a/docs/reference/plugin-manifest.md +++ b/docs/reference/plugin-manifest.md @@ -237,7 +237,7 @@ A host API the plugin may call once the user consents. | Field | Type | Required | Since | Description | | --- | --- | --- | --- | --- | -| `kind` | `"workspace:read"` \| `"workspace:write"` \| `"agent:read"` \| `"agent:launch"` \| `"terminal:send"` \| `"terminal:read"` \| `"notifications:show"` \| `"storage:own"` \| `"secrets:own"` \| `"settings:own"` \| `"appearance:write"` | yes | 1.4.160 | Capability granted on user consent. | +| `kind` | `"workspace:read"` \| `"workspace:write"` \| `"agent:read"` \| `"agent:launch"` \| `"terminal:send"` \| `"terminal:read"` \| `"notifications:show"` \| `"storage:own"` \| `"secrets:own"` \| `"settings:own"` \| `"appearance:write"` \| `"workspace:create"` \| `"automation:read"` \| `"automation:write"` \| `"history:read"` | yes | 1.4.160 | Capability granted on user consent. | ## Screenshot diff --git a/docs/schemas/plugins/orca-catalog.v2.schema.json b/docs/schemas/plugins/orca-catalog.v2.schema.json index 7741b72b197..e0e030baac6 100644 --- a/docs/schemas/plugins/orca-catalog.v2.schema.json +++ b/docs/schemas/plugins/orca-catalog.v2.schema.json @@ -349,7 +349,7 @@ "notifications:show" ] ], - "maxItems": 11, + "maxItems": 15, "type": "array", "items": { "type": "string", @@ -364,7 +364,11 @@ "storage:own", "secrets:own", "settings:own", - "appearance:write" + "appearance:write", + "workspace:create", + "automation:read", + "automation:write", + "history:read" ] } }, diff --git a/docs/schemas/plugins/orca-plugin.v2.schema.json b/docs/schemas/plugins/orca-plugin.v2.schema.json index 665f0887bee..0d1cefe4b4f 100644 --- a/docs/schemas/plugins/orca-plugin.v2.schema.json +++ b/docs/schemas/plugins/orca-plugin.v2.schema.json @@ -1581,7 +1581,11 @@ "storage:own", "secrets:own", "settings:own", - "appearance:write" + "appearance:write", + "workspace:create", + "automation:read", + "automation:write", + "history:read" ], "description": "Capability granted on user consent.", "x-orca-since": "1.4.160", @@ -1596,7 +1600,11 @@ "storage:own": "1.4.245", "secrets:own": "1.4.245", "settings:own": "1.4.160", - "appearance:write": "1.4.249" + "appearance:write": "1.4.249", + "workspace:create": "1.4.258", + "automation:read": "1.4.258", + "automation:write": "1.4.258", + "history:read": "1.4.258" } } }, diff --git a/docs/site/content/docs/cli/reference.mdx b/docs/site/content/docs/cli/reference.mdx index ac3bfc1ba6c..bd03318a771 100644 --- a/docs/site/content/docs/cli/reference.mdx +++ b/docs/site/content/docs/cli/reference.mdx @@ -95,10 +95,14 @@ orca repo add --path /abs/path/to/folder --kind folder --json orca repo show --repo id: --json orca repo set-base-ref --repo id: --ref origin/main --json orca repo search-refs --repo id: --query main --limit 10 --json +orca repo hide --repo id: --json +orca repo unhide --repo id: --json ``` Set the repo base ref before creating lots of worktrees so new tasks branch from the right place by default. +`repo hide` takes a project out of the sidebar, project pickers and the workspace switcher without stopping anything: its terminals, agents and automations keep running, `repo list` still lists it with `hiddenAt` set, and commands that name it keep working. Hiding applies to one host's copy of a project; add `--host ` to pick which copy when it is set up on several. On a paired Orca server the setting lives on that server, so hiding a project there hides it for everyone connected to it. `repo unhide`, or the Hidden projects list at the bottom of the sidebar, shows it again. + `repo add` defaults to `--kind git`. Use `--kind folder` to open an ordinary directory, including a repo-tool root containing separate Git repositories, as a folder workspace without Git worktrees or source control. With `--environment`, use an absolute path on that Orca server. ## Worktrees diff --git a/docs/site/content/docs/notifications.mdx b/docs/site/content/docs/notifications.mdx index 8d5e02866f7..e3aa8da76c4 100644 --- a/docs/site/content/docs/notifications.mdx +++ b/docs/site/content/docs/notifications.mdx @@ -29,3 +29,24 @@ Pick a custom desktop notification sound per category under [Settings → Notifi Supported formats: MP3, WAV, OGG, M4A, AAC, FLAC. One file applies to all delivered desktop notifications. When you use a custom sound, set its playback volume from the same settings pane. + +## Disable mobile push from a host + +Set `ORCA_MOBILE_PUSH_MODE` in the environment of each desktop or remote runtime +that sends mobile push, then restart that host: + +- `full` (default): existing notification titles, bodies and navigation identifiers. +- `disabled`: no alert or test sends and no new push registration from that host. + Existing registration deletion and queued cleanup still run. This does not + itself erase historical gateway/provider records or disable live in-app events. + +An unrecognized nonempty value disables push delivery. This is a host configuration, +not a centrally enforced organization policy. Users who control the host environment +can change it. It applies to that host's push gateway traffic, not local desktop +notifications or direct/Relay application content. Every sending host needs the +setting; older Orca versions do not implement it. OS notification permissions and +lock-screen preview settings are separate controls. + +There is no generic-content mode: enabled push may include project/agent text and +identifiers. Disabling phone lock-screen previews does not stop that content from +reaching the push gateway and APNs/FCM. diff --git a/docs/site/tests/docs-package.test.mjs b/docs/site/tests/docs-package.test.mjs deleted file mode 100644 index 4b353a717c6..00000000000 --- a/docs/site/tests/docs-package.test.mjs +++ /dev/null @@ -1,68 +0,0 @@ -import assert from 'node:assert/strict' -import { readFile, readdir } from 'node:fs/promises' -import { existsSync } from 'node:fs' -import path from 'node:path' -import test from 'node:test' - -const siteRoot = path.resolve(import.meta.dirname, '..') -const contentRoot = path.join(siteRoot, 'content', 'docs') -const publicRoot = path.join(siteRoot, 'public') - -async function walkFiles(directory, extension) { - const entries = await readDirectory(directory) - const files = [] - for (const entry of entries) { - const absolutePath = path.join(directory, entry.name) - if (entry.isDirectory()) { - files.push(...(await walkFiles(absolutePath, extension))) - } else if (!extension || entry.name.endsWith(extension)) { - files.push(absolutePath) - } - } - return files -} - -async function readDirectory(directory) { - return readdir(directory, { withFileTypes: true }) -} - -function publicPathExists(urlPath) { - const pathname = urlPath.split('#', 1)[0].split('?', 1)[0] - return existsSync(path.join(publicRoot, pathname.replace(/^\//, ''))) -} - -function isMediaPath(urlPath) { - return /\.(?:gif|jpe?g|png|webp|mp4|svg|ico)$/i.test(urlPath.split(/[?#]/, 1)[0]) -} - -test('every local media URL referenced by docs resolves in public assets', async () => { - const files = await walkFiles(contentRoot, '.mdx') - const localUrls = new Set() - for (const file of files) { - const content = await readFile(file, 'utf8') - for (const match of content.matchAll( - /(?:src|href)=['"](\/docs\/[^'"\s)]+)|\]\((\/docs\/[^)\s]+)\)/g - )) { - const url = match[1] ?? match[2] - if (isMediaPath(url)) { - localUrls.add(url) - } - } - } - - assert.ok(localUrls.size > 0, 'expected docs to reference at least one local media asset') - for (const url of localUrls) { - assert.ok(publicPathExists(url), `${url} is referenced but missing from public/`) - } -}) - -test('docs content does not link to routes that only exist on the marketing site', async () => { - const files = await walkFiles(contentRoot, '.mdx') - assert.ok(files.length > 0, 'expected docs content pages') - for (const file of files) { - const content = await readFile(file, 'utf8') - for (const match of content.matchAll(/\]\((\/(?!docs(?:\/|[)#]))[^)\s]+)\)/g)) { - assert.fail(`${path.relative(siteRoot, file)} links to an unhosted local route: ${match[1]}`) - } - } -}) diff --git a/docs/site/tests/search-excerpt.test.mjs b/docs/site/tests/search-excerpt.test.mjs index 68b2c87869d..0842c21cf73 100644 --- a/docs/site/tests/search-excerpt.test.mjs +++ b/docs/site/tests/search-excerpt.test.mjs @@ -12,15 +12,6 @@ test('link destinations retain escaped closing parentheses and literal escapes', } }) -test('search excerpts omit inline Markdown syntax', () => { - assert.equal( - stripSearchExcerptMarkdown( - 'Use **bold**, *emphasis*, `inline code`, and [linked text](https://example.com).' - ), - 'Use bold, emphasis, inline code, and linked text.' - ) -}) - test('search excerpts preserve highlighted matches inside Markdown', () => { assert.equal( stripSearchExcerptMarkdown('**Privacy controls**'), diff --git a/mobile/app.json b/mobile/app.json index af0c265fad7..98a16c60a20 100644 --- a/mobile/app.json +++ b/mobile/app.json @@ -89,6 +89,7 @@ "usesCleartextTraffic": true, "allowBackup": false, "permissions": ["RECORD_AUDIO", "MODIFY_AUDIO_SETTINGS"], + "blockedPermissions": ["android.permission.SYSTEM_ALERT_WINDOW"], "package": "com.stably.orca.mobile", "versionCode": 28, "googleServicesFile": "./google-services.json" diff --git a/mobile/app/h/[hostId]/session/[worktreeId].tsx b/mobile/app/h/[hostId]/session/[worktreeId].tsx index d167737e3b1..bfc6a69989d 100644 --- a/mobile/app/h/[hostId]/session/[worktreeId].tsx +++ b/mobile/app/h/[hostId]/session/[worktreeId].tsx @@ -6,6 +6,7 @@ import { import { useCallback } from 'react' import { useLocalSearchParams, useRouter } from 'expo-router' import { firstParam } from '../../../../src/navigation/route-param-reader' +import { STANDALONE_SESSION_PARAM } from '../../../../src/navigation/host-stack-navigation' import { shellScreenRoute, shellScreenRouteKey @@ -25,6 +26,7 @@ export default withWorkspaceRoute(function MobileSessionScreen() { created?: string | string[] warning?: string | string[] paneKey?: string | string[] + standalone?: string | string[] }>() const hostId = firstParam(params.hostId) const worktreeId = firstParam(params.worktreeId) @@ -45,7 +47,7 @@ export default withWorkspaceRoute(function MobileSessionScreen() { // Omit empty params: created=1 is one-shot, warning is host text, absent name derives a label, and empty paneKey marks a spent tap. const routeParams: Record = { ...Object.fromEntries( - (['name', 'created', 'warning', 'paneKey'] as const) + (['name', 'created', 'warning', 'paneKey', STANDALONE_SESSION_PARAM] as const) .map((key) => [key, firstParam(params[key])] as const) .filter(([, value]) => value !== '') ), diff --git a/mobile/modules/orca-gzip-utf8-codec/android/src/test/java/expo/modules/orcagziputf8codec/StrictUtf8Test.kt b/mobile/modules/orca-gzip-utf8-codec/android/src/test/java/expo/modules/orcagziputf8codec/StrictUtf8Test.kt deleted file mode 100644 index b9a381729e5..00000000000 --- a/mobile/modules/orca-gzip-utf8-codec/android/src/test/java/expo/modules/orcagziputf8codec/StrictUtf8Test.kt +++ /dev/null @@ -1,21 +0,0 @@ -package expo.modules.orcagziputf8codec - -import org.junit.Assert.assertNull -import org.junit.Test - -class StrictUtf8Test { - @Test - fun `hands back to JS what TextDecoder would repair or strip`() { - val refused = listOf( - byteArrayOf(0xef.toByte(), 0xbb.toByte(), 0xbf.toByte(), 0x41), - byteArrayOf(0xc0.toByte(), 0x80.toByte()), - byteArrayOf(0xed.toByte(), 0xa0.toByte(), 0x80.toByte()), - byteArrayOf(0x41, 0xe2.toByte(), 0x82.toByte()), - byteArrayOf(0x80.toByte()), - byteArrayOf(0xf5.toByte(), 0x80.toByte(), 0x80.toByte(), 0x80.toByte()) - ) - for (bytes in refused) { - assertNull(decodeStrictUtf8(bytes)) - } - } -} diff --git a/mobile/modules/orca-gzip-utf8-codec/tests/GzipUtf8CodecChecks.swift b/mobile/modules/orca-gzip-utf8-codec/tests/GzipUtf8CodecChecks.swift index 0d827b818c8..f042d65f55d 100644 --- a/mobile/modules/orca-gzip-utf8-codec/tests/GzipUtf8CodecChecks.swift +++ b/mobile/modules/orca-gzip-utf8-codec/tests/GzipUtf8CodecChecks.swift @@ -3,7 +3,7 @@ import Foundation // The codec's decisions, compiled and run without a device, from the module directory: // // swiftc -O -o /tmp/gzip-utf8-codec-checks ios/BoundedGunzip.swift \ -// ios/StrictUtf8.swift tests/GzipUtf8CodecChecks.swift && /tmp/gzip-utf8-codec-checks +// tests/GzipUtf8CodecChecks.swift && /tmp/gzip-utf8-codec-checks @main struct GzipUtf8CodecChecks { static var failures = 0 @@ -37,14 +37,6 @@ import Foundation check(actual == expected, "gunzip: \(name)") } - let refused: [[UInt8]] = [ - [0xef, 0xbb, 0xbf, 0x41], [0xc0, 0x80], [0xed, 0xa0, 0x80], [0x41, 0xe2, 0x82], [0x80], - [0xf5, 0x80, 0x80, 0x80], - ] - for input in refused { - check(decodeStrictUtf8(Data(input)) == nil, "utf8: refuses \(input)") - } - print(failures == 0 ? "all checks passed" : "\(failures) check(s) failed") exit(failures == 0 ? 0 : 1) } diff --git a/mobile/modules/orca-mobile-web-shell/tests/MobileWebShellChecks.swift b/mobile/modules/orca-mobile-web-shell/tests/MobileWebShellChecks.swift index 4b7eba42367..137056568c9 100644 --- a/mobile/modules/orca-mobile-web-shell/tests/MobileWebShellChecks.swift +++ b/mobile/modules/orca-mobile-web-shell/tests/MobileWebShellChecks.swift @@ -11,38 +11,6 @@ import Foundation // ios/MobileWebShellNavigationPolicy.swift \ // tests/MobileWebShellChecks.swift && /tmp/mobile-web-shell-checks @main struct MobileWebShellChecks { - static let session = "sess-01JN_aZ9" - - static func parts( - path: String, - method: String = "GET", - hasRangeHeader: Bool = false, - scheme: String? = MobileWebShellOrigin.scheme, - host: String? = session, - port: Int? = nil, - user: String? = nil, - query: String? = nil, - fragment: String? = nil, - urlByteCount: Int = 64 - ) -> MobileWebShellRequestParts { - MobileWebShellRequestParts( - method: method, - hasRangeHeader: hasRangeHeader, - scheme: scheme, - host: host, - port: port, - user: user, - query: query, - fragment: fragment, - percentEncodedPath: path, - urlByteCount: urlByteCount - ) - } - - static func resolve(_ request: MobileWebShellRequestParts) -> String? { - MobileWebShellOrigin.resolveRequestPath(request, sessionId: session) - } - static func manifest( schemaVersion: Int = 1, entrypoint: String = "index.html", @@ -68,54 +36,10 @@ import Foundation } - static func checkRequestResolution() { - precondition(resolve(parts(path: "/")) == "/") - precondition(resolve(parts(path: "")) == "/") - precondition(resolve(parts(path: "/assets/aa.js")) == "/assets/aa.js") - // A host a parser canonicalised must still bind to this session. - precondition(resolve(parts(path: "/", host: session.uppercased())) == "/") - - precondition(resolve(parts(path: "/", method: "POST")) == nil) - precondition(resolve(parts(path: "/", method: "HEAD")) == nil) - precondition(resolve(parts(path: "/", hasRangeHeader: true)) == nil) - precondition(resolve(parts(path: "/", scheme: "https")) == nil) - precondition(resolve(parts(path: "/", scheme: nil)) == nil) - // Unicode folding would serve assets to unminted Kelvin-sign hosts. - precondition(MobileWebShellOrigin.resolveRequestPath( - parts(path: "/", host: "\u{212A}ey"), - sessionId: "key" - ) == nil) - precondition(MobileWebShellOrigin.resolveRequestPath( - parts(path: "/", host: "KEY"), - sessionId: "key" - ) == "/") - precondition(resolve(parts(path: "/", host: "other-session")) == nil) - precondition(resolve(parts(path: "/", host: nil)) == nil) - precondition(resolve(parts(path: "/", port: 443)) == nil) - precondition(resolve(parts(path: "/", user: "someone")) == nil) - precondition(resolve(parts(path: "/", query: "v=1")) == nil) - precondition(resolve(parts(path: "/", fragment: "frag")) == nil) - precondition(resolve(parts(path: "/assets/%2e%2e/etc")) == nil) - precondition(resolve(parts(path: "assets/aa.js")) == nil) - precondition(resolve(parts(path: "/", urlByteCount: 8 * 1024)) == "/") - precondition(resolve(parts(path: "/", urlByteCount: 8 * 1024 + 1)) == nil) - precondition(MobileWebShellOrigin.resolveRequestPath(parts(path: "/"), sessionId: "") == nil) - } - - - static func checkGenerationMap() { guard let built = generation(manifest()) else { preconditionFailure("manifest rejected") } - precondition(built.entries.count == 4) - precondition(built.entries["/"]?.file.path == "/tmp/generation/index.html") - precondition(built.entries["/"]?.contentType == "text/html; charset=utf-8") // Only / may serve document bytes with CSP; no entrypoint alias. precondition(built.entries["/index.html"] == nil) - precondition(built.entries["/assets/aa.js"]?.contentType == "text/javascript; charset=utf-8") - precondition(built.entries["/assets/bb.png"]?.file.path == "/tmp/generation/assets/bb.png") - precondition(built.entries["/manifest.json"]?.contentType == "application/json") - precondition(built.entries["/assets/cc.js"] == nil) - precondition(built.entries["/../secret"] == nil) precondition(generation(manifest(schemaVersion: 2)) == nil) precondition(generation(manifest(entrypoint: "start.html")) == nil) @@ -143,7 +67,6 @@ import Foundation // NSNumber bridges JSON true and 1.0 to Int; neither satisfies the integer-1 contract. precondition(generation(Data(#"{"schemaVersion":true,"entrypoint":"index.html","assets":[{"path":"index.html","contentType":"text/html"}]}"#.utf8)) == nil) precondition(generation(Data(#"{"schemaVersion":1.0,"entrypoint":"index.html","assets":[{"path":"index.html","contentType":"text/html"}]}"#.utf8)) == nil) - precondition(generation(Data(#"{"schemaVersion":1,"entrypoint":"index.html","assets":[{"path":"index.html","contentType":"text/html"}]}"#.utf8)) != nil) precondition(generation(Data(#"{"schemaVersion":"1","entrypoint":"index.html","assets":[{"path":"index.html","contentType":"text/html"}]}"#.utf8)) == nil) precondition(generation(Data("not json".utf8)) == nil) precondition(generation(Data("[]".utf8)) == nil) @@ -223,162 +146,9 @@ import Foundation - static func bridgeSource( - isOurWebView: Bool = true, - isMainFrame: Bool = true, - hasCommittedDocument: Bool = true, - originProtocol: String = MobileWebShellOrigin.scheme, - originHost: String = session - ) -> MobileWebShellBridgeSource { - MobileWebShellBridgeSource( - isOurWebView: isOurWebView, - isMainFrame: isMainFrame, - hasCommittedDocument: hasCommittedDocument, - originProtocol: originProtocol, - originHost: originHost - ) - } - - static func acceptsBridge(_ source: MobileWebShellBridgeSource) -> Bool { - MobileWebShellBridge.accepts(source, sessionId: session) - } - - - static func checkBridgeAcceptance() { - precondition(acceptsBridge(bridgeSource())) - // Simulator: WebKit ASCII-lowercases custom-scheme hosts; exact session comparison refuses every message. - precondition(acceptsBridge(bridgeSource(originHost: "sess-01jn_az9"))) - precondition(acceptsBridge(bridgeSource(originHost: "SESS-01JN_AZ9"))) - - // A frame we did not serve. - precondition(!acceptsBridge(bridgeSource(originHost: "sess-01JN_aZ8"))) - precondition(!acceptsBridge(bridgeSource(originHost: ""))) - precondition(!acceptsBridge(bridgeSource(originHost: "sess-01JN_aZ9.evil"))) - // Unicode folding would accept unminted Kelvin-sign hosts. - precondition(!MobileWebShellBridge.accepts( - bridgeSource(originHost: "\u{212A}ey"), - sessionId: "key" - )) - precondition(MobileWebShellOrigin.asciiLowercased("\u{212A}EY") == "\u{212A}ey") - - // Another scheme reaching the same handler. - precondition(!acceptsBridge(bridgeSource(originProtocol: "https"))) - precondition(!acceptsBridge(bridgeSource(originProtocol: ""))) - precondition(!acceptsBridge(bridgeSource(originProtocol: "orca-mobile-web "))) - - // A subframe, and a message routed to a WebView that is not ours. - precondition(!acceptsBridge(bridgeSource(isMainFrame: false))) - precondition(!acceptsBridge(bridgeSource(isOurWebView: false))) - - // The replaced same-origin document remains alive until the new load commits. - precondition(!acceptsBridge(bridgeSource(hasCommittedDocument: false))) - - // No applied session is not an empty one: nothing may be accepted before a load. - precondition(!MobileWebShellBridge.accepts(bridgeSource(originHost: ""), sessionId: "")) - precondition(!MobileWebShellBridge.accepts(bridgeSource(originHost: "a b"), sessionId: "a b")) - } - - static func checkBridgePostTarget() { - func canPost( - _ host: String?, - _ sessionId: String = session, - committed: Bool = true - ) -> Bool { - MobileWebShellBridge.canPost( - toFrameOriginHost: host, - sessionId: sessionId, - hasCommittedDocument: committed - ) - } - - precondition(canPost(session)) - // The same ASCII fold as acceptance: WebKit reports the host lowercased. - precondition(canPost("sess-01jn_az9")) - - // Never post without an accepted frame: before first message, after failure/death, or with bridge disabled. - precondition(!canPost(nil)) - - // A frame from another document, and a frame under no session at all. - precondition(!canPost("sess-01JN_aZ8")) - precondition(!canPost("\u{212A}ey", "key")) - precondition(!canPost(session, "")) - precondition(!canPost("", "")) - - // Provisional navigation invalidates the held frame until commit. - precondition(!canPost(session, committed: false)) - } - - - // One allow/opener decision; TypeScript’s readBridgeExternalLinkUrl owns scheme filtering. - static func checkNavigationVerdict() { - let foreign = "https://example.com/artifact-link" - let document = "orca-mobile-web://\(session)/" - func verdict( - _ url: String? = "https://example.com/artifact-link", - isMainFrame: Bool = true, - isDocumentUrl: Bool = false, - isShellLoad: Bool = false, - hasGesture: Bool = true, - isDownload: Bool = false - ) -> MobileWebShellNavigationVerdict { - MobileWebShellNavigationPolicy.verdict( - url: url, - isMainFrame: isMainFrame, - isDocumentUrl: isDocumentUrl, - isShellLoad: isShellLoad, - hasGesture: hasGesture, - isDownload: isDownload - ) - } - precondition(verdict() == .cancelAndOffer(foreign)) - // WebKit reports our own load with main-frame source and target. - precondition(verdict(document, isDocumentUrl: true, isShellLoad: true, hasGesture: false) == .allow) - // Never offer/reload other document-URL navigations; sandboxed top navigation can report no gesture. - precondition(verdict(document, isDocumentUrl: true, hasGesture: false) == .cancel) - precondition(verdict(document, isDocumentUrl: true, hasGesture: true) == .cancel) - // Refuse non-shell document loads from page or preview frames. - precondition(verdict(document, isDocumentUrl: true, isShellLoad: false, hasGesture: false) == .cancel) - // A top-page meta refresh or a redirect to somewhere else: refused, and never opened. - precondition(verdict(hasGesture: false) == .cancel) - // Gestured downloads reach the opener, never the document-load allowance. - precondition( - verdict(document, isDocumentUrl: true, isShellLoad: true, hasGesture: false, isDownload: true) - == .cancel - ) - precondition(verdict(isDownload: true) == .cancelAndOffer(foreign)) - // Document-URL downloads are never offered, regardless of gesture. - precondition(verdict(document, isDocumentUrl: true, isDownload: true) == .cancel) - // A foreign-URL subframe is never offered: the user is not leaving the app. - precondition(verdict(isMainFrame: false) == .cancel) - precondition(verdict(isMainFrame: false, hasGesture: false) == .cancel) - // Sealed srcdoc frames (HTML previews, chat visuals) load; no other subframe or top-level srcdoc does. - let srcdoc = MobileWebShellNavigationPolicy.inlineDocumentUrl - precondition(verdict(srcdoc, isMainFrame: false, hasGesture: false) == .allow) - precondition(verdict(srcdoc, isMainFrame: false, isDownload: true) == .cancel) - precondition(verdict(srcdoc, hasGesture: false) == .cancel) - precondition(verdict("about:blank", isMainFrame: false, hasGesture: false) == .cancel) - precondition(verdict(document, isMainFrame: false, isDocumentUrl: true, isShellLoad: true) == .cancel) - precondition(verdict(nil) == .cancel) - precondition(verdict("") == .cancel) - // The crossing cap, at it and one past it. - let cap = MobileWebShellNavigationPolicy.maxCancelledNavigationUrlCharacters - let prefix = "https://example.com/" - let atCap = prefix + String(repeating: "a", count: cap - prefix.count) - precondition(atCap.count == cap) - precondition(MobileWebShellNavigationPolicy.offerableUrl(atCap) == atCap) - precondition(MobileWebShellNavigationPolicy.offerableUrl(atCap + "a") == nil) - precondition(verdict(atCap + "a") == .cancel) - // A scheme the opener will refuse still crosses: one filter, in the half that updates. - precondition(verdict("javascript:alert(1)") == .cancelAndOffer("javascript:alert(1)")) - } - static func main() { - checkRequestResolution() checkGenerationMap() checkLoadStateMachine() - checkNavigationVerdict() - checkBridgeAcceptance() - checkBridgePostTarget() print("mobile web shell checks OK") } } diff --git a/mobile/modules/orca-notification-dismissal/tests/PushDismissalLedgerChecks.swift b/mobile/modules/orca-notification-dismissal/tests/PushDismissalLedgerChecks.swift index 9f6f6578e24..dd96f2f0541 100644 --- a/mobile/modules/orca-notification-dismissal/tests/PushDismissalLedgerChecks.swift +++ b/mobile/modules/orca-notification-dismissal/tests/PushDismissalLedgerChecks.swift @@ -22,12 +22,6 @@ import Foundation precondition(!restored.contains(identity(1, "qa-host", "qa-epoch", "other"), now: 102)) precondition(!restored.contains(identity(1), now: 86501)) precondition(PushDismissalIdentity(["hostFingerprint":"h", "notificationId":"n", "notificationEpoch":"e", "notificationSeq":true]) == nil) - precondition(restored.containsNotification(payload(1), now: 102)) - precondition(!restored.containsNotification(payload(3), now: 102)) - precondition(!restored.containsNotification(payload(1, "other"), now: 102)) - precondition(!restored.containsNotification(payload(1, "qa-host", "other"), now: 102)) - precondition(!restored.containsNotification(payload(1, "qa-host", "qa-epoch", "other"), now: 102)) - precondition(!restored.containsNotification(["hostFingerprint": "qa-host"], now: 102)) for hosts in [1, 3] { for index in 0..<520 { ledger.remember(identity(2, "host-\(index % hosts)", "epoch-\(hosts)", "note-\(index)"), now: 200) diff --git a/mobile/packages/expo-two-way-audio/tests/RecordingInterruptionIntentTests.swift b/mobile/packages/expo-two-way-audio/tests/RecordingInterruptionIntentTests.swift deleted file mode 100644 index 9229f1829da..00000000000 --- a/mobile/packages/expo-two-way-audio/tests/RecordingInterruptionIntentTests.swift +++ /dev/null @@ -1,30 +0,0 @@ -@main -struct RecordingInterruptionIntentTests { - static func main() { - var intent = RecordingInterruptionIntent() - // An idle audio interruption never starts a recording. - intent.began(wasRecording: false) - precondition(intent.ended(shouldResume: true, isRecording: false) == .blocked) - // A still-owned recording resumes once, not again on a duplicate end event. - intent.began(wasRecording: true) - precondition(intent.ended(shouldResume: true, isRecording: false) == .resume) - precondition(intent.ended(shouldResume: true, isRecording: false) == .blocked) - // A blocked or missing shouldResume bit consumes the old resume request. - intent.began(wasRecording: true) - precondition(intent.ended(shouldResume: false, isRecording: false) == .blocked) - precondition(intent.ended(shouldResume: true, isRecording: false) == .blocked) - // JavaScript cancels capture after began; ended must not turn its microphone back on. - intent.began(wasRecording: true) - intent.cancel() - precondition(intent.ended(shouldResume: true, isRecording: false) == .blocked) - // A newer explicit recording must not be cancelled by the old end notification. - intent.began(wasRecording: true) - intent.cancel() - precondition(intent.ended(shouldResume: true, isRecording: true) == .none) - // The most recent interruption, even one while idle, replaces old resume intent. - intent.began(wasRecording: true) - intent.began(wasRecording: false) - precondition(intent.ended(shouldResume: true, isRecording: false) == .blocked) - print("RecordingInterruptionIntent: 8 assertions passed") - } -} diff --git a/mobile/src/agents/use-agent-list-row-actions.tsx b/mobile/src/agents/use-agent-list-row-actions.tsx index f5b45eda889..837183789c8 100644 --- a/mobile/src/agents/use-agent-list-row-actions.tsx +++ b/mobile/src/agents/use-agent-list-row-actions.tsx @@ -35,6 +35,8 @@ export function useAgentListRowActions( hostId: row.hostId, worktreeId: row.entry.worktreeId, name: row.entry.workspaceName, + // Home's lists span desktops, so Back returns to them rather than to this desktop's list. + standalone: true, ...(withPane ? { paneKey: row.entry.agent.paneKey } : {}) }), [openMobileSession] diff --git a/mobile/src/components/DragReorderList.tsx b/mobile/src/components/DragReorderList.tsx index cd51eba8e1f..25800381080 100644 --- a/mobile/src/components/DragReorderList.tsx +++ b/mobile/src/components/DragReorderList.tsx @@ -46,6 +46,8 @@ export type DragReorderListProps = { rowHeight?: number scopeKey?: string rowPresentation?: 'settings' | 'plain' + /** A long press anywhere on the row lifts it, not only on its grip. */ + liftFromRow?: boolean renderRow: (item: ItemT, handle: ReactNode) => ReactNode /** Called with every item key in the new order after a drop changes it. */ onReorder?: (orderedKeys: string[]) => void @@ -66,6 +68,7 @@ export function DragReorderList({ rowHeight, scopeKey = '', rowPresentation = 'settings', + liftFromRow = false, renderRow, onReorder, onMove, @@ -349,6 +352,7 @@ export function DragReorderList({ movable={!canMove || canMove(item)} disabled={isMoveDisabled?.(item) ?? false} presentation={rowPresentation} + liftFromRow={liftFromRow} onMeasure={onMeasure} shared={shared} scrollOffsetY={scrollOffsetY} diff --git a/mobile/src/components/DragReorderRow.tsx b/mobile/src/components/DragReorderRow.tsx index af8102eee38..3b574b907b4 100644 --- a/mobile/src/components/DragReorderRow.tsx +++ b/mobile/src/components/DragReorderRow.tsx @@ -55,6 +55,7 @@ export function DragReorderRow({ movable, disabled, presentation, + liftFromRow = false, onMeasure, shared, scrollOffsetY, @@ -71,6 +72,7 @@ export function DragReorderRow({ movable: boolean disabled: boolean presentation: 'settings' | 'plain' + liftFromRow?: boolean onMeasure: (key: string, height: number) => void shared: DragSharedState scrollOffsetY: SharedValue @@ -191,43 +193,56 @@ export function DragReorderRow({ restingBackground ]) - const handle = movable ? ( + const grip = ( + { + if (disabled) { + return + } + if (event.nativeEvent.actionName === 'moveUp') { + onAccessibilityMove(rowKey, -1) + } else if (event.nativeEvent.actionName === 'moveDown') { + onAccessibilityMove(rowKey, 1) + } + }} + hitSlop={{ + top: 8, + bottom: 8, + left: 8, + right: presentation === 'plain' ? 24 : 8 + }} + > + + + ) + // Lifting from the whole row puts the one gesture there; the grip then only shows and moves by actions. + // Only the plain row carries the row gesture; a settings row keeps it on the grip. + const rowLifts = liftFromRow && movable && presentation === 'plain' + const handle = !movable ? null : rowLifts ? ( + grip + ) : ( + {grip} + ) + const plainContent = rowLifts ? ( - { - if (disabled) { - return - } - if (event.nativeEvent.actionName === 'moveUp') { - onAccessibilityMove(rowKey, -1) - } else if (event.nativeEvent.actionName === 'moveDown') { - onAccessibilityMove(rowKey, 1) - } - }} - hitSlop={{ - top: 8, - bottom: 8, - left: 8, - right: presentation === 'plain' ? 24 : 8 - }} - > - - + {renderContent(handle)} - ) : null + ) : ( + renderContent(handle) + ) return ( onMeasure(rowKey, event.nativeEvent.layout.height)} @@ -239,7 +254,7 @@ export function DragReorderRow({ ]} > {presentation === 'plain' ? ( - renderContent(handle) + plainContent ) : ( <> {renderContent(handle)} diff --git a/mobile/src/components/MobileMarkdownCallout.tsx b/mobile/src/components/MobileMarkdownCallout.tsx index d127e671329..d08ddcee680 100644 --- a/mobile/src/components/MobileMarkdownCallout.tsx +++ b/mobile/src/components/MobileMarkdownCallout.tsx @@ -7,7 +7,7 @@ import { OctagonAlert, TriangleAlert } from 'lucide-react-native' -import type { GitHubCalloutKind } from '../../../src/shared/github/github-callouts' +import type { GitHubCalloutKind } from '../../../src/shared/github/markdown/github-callouts' import { translate } from '../i18n/mobile-i18n' import { styles } from './mobile-markdown-styles' import { colors } from '../theme/mobile-theme' diff --git a/mobile/src/components/mobile-markdown-github-syntax.test.ts b/mobile/src/components/mobile-markdown-github-syntax.test.ts deleted file mode 100644 index 185d38fcc0f..00000000000 --- a/mobile/src/components/mobile-markdown-github-syntax.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { parseMobileMarkdownTree } from './mobile-markdown-tree' - -const blocks = (source: string) => parseMobileMarkdownTree(source, false).children - -describe('GitHub syntax in mobile Markdown', () => { - it('draws an https at its authored width and leaves icons out', () => { - expect( - blocks( - '

shot

\n\n' + - 'Minor ' - ) - ).toEqual([ - { - type: 'paragraph', - children: [ - { type: 'image', url: 'https://example.com/a.png', alt: 'shot', data: { width: 300 } } - ] - }, - { type: 'paragraph', children: [{ type: 'text', value: 'Minor ' }] } - ]) - }) -}) diff --git a/mobile/src/components/mobile-markdown-growing-tree.test.ts b/mobile/src/components/mobile-markdown-growing-tree.test.ts index a2ad41fa2f8..24833e3d5ec 100644 --- a/mobile/src/components/mobile-markdown-growing-tree.test.ts +++ b/mobile/src/components/mobile-markdown-growing-tree.test.ts @@ -53,10 +53,6 @@ describe('text growing a character at a time', () => { ]) }) - it('joins a line that stops being a heading to the paragraph above', () => { - expect(grown('para\n#x')).toEqual([paragraph('para\n#x')]) - }) - it('makes one math block once a display formula closes past a blank line', () => { expect(grown('$$\nx\n\ny\n$$')).toEqual([ { type: 'math', value: 'x\n\ny', source: '$$\nx\n\ny\n$$' } diff --git a/mobile/src/components/mobile-markdown-links-context.ts b/mobile/src/components/mobile-markdown-links-context.ts index 43d8279c7d4..130fbdabffd 100644 --- a/mobile/src/components/mobile-markdown-links-context.ts +++ b/mobile/src/components/mobile-markdown-links-context.ts @@ -1,7 +1,7 @@ import { createContext, useEffect, useMemo, useRef, useSyncExternalStore } from 'react' import { createNativeChatFileLinkHooks } from '../../../src/shared/native-chat/native-chat-file-link-hooks' import type { NativeChatFileLinkExistence } from '../../../src/shared/native-chat/native-chat-file-link-existence' -import type { GitHubRepoReference } from '../../../src/shared/github/github-reference-links' +import type { GitHubRepoReference } from '../../../src/shared/github/markdown/github-reference-links' /** What a chat knows about its workspace for links in its text; absent outside chat. */ export type MobileMarkdownLinks = { diff --git a/mobile/src/components/mobile-markdown-mdast-nodes.d.ts b/mobile/src/components/mobile-markdown-mdast-nodes.d.ts index a7ad5fdee08..cbb0c832a13 100644 --- a/mobile/src/components/mobile-markdown-mdast-nodes.d.ts +++ b/mobile/src/components/mobile-markdown-mdast-nodes.d.ts @@ -1,5 +1,5 @@ import type { BlockContent, DefinitionContent, Literal, Parent, PhrasingContent } from 'mdast' -import type { GitHubCalloutKind } from '../../../src/shared/github/github-callouts' +import type { GitHubCalloutKind } from '../../../src/shared/github/markdown/github-callouts' // The node types MobileMarkdown adds to mdast, registered by declaration merging. Merging needs // interfaces, which React Doctor's root rules flag; mobile's lint config ignores this file because diff --git a/mobile/src/components/mobile-markdown-mermaid-routing.test.ts b/mobile/src/components/mobile-markdown-mermaid-routing.test.ts deleted file mode 100644 index e2983a9c5a3..00000000000 --- a/mobile/src/components/mobile-markdown-mermaid-routing.test.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { createElement } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, describe, expect, it, vi } from 'vitest' -import { MobileMarkdown } from './MobileMarkdown' -import { findAllByHostType, findByHostType } from '../test-support/react-test-renderer-host-nodes' - -vi.mock('react-native', () => ({ - Linking: { openURL: vi.fn() }, - Platform: { OS: 'ios' }, - Pressable: 'Pressable', - ScrollView: 'ScrollView', - StyleSheet: { create: (styles: T) => styles, hairlineWidth: 1 }, - Text: 'Text', - View: 'View' -})) -vi.mock('./pr-sidebar/MermaidDiagram', () => ({ MermaidDiagram: 'MermaidDiagram' })) -vi.mock('./MobileSourceCopyButton', () => ({ MobileSourceCopyButton: 'MobileSourceCopyButton' })) - -let renderer: ReactTestRenderer | undefined - -afterEach(() => { - renderer?.unmount() - renderer = undefined - vi.restoreAllMocks() -}) - -function render(content: string): ReactTestRenderer { - act(() => { - renderer = create(createElement(MobileMarkdown, { content })) - }) - return renderer! -} - -function mermaidCount(tree: ReactTestRenderer): number { - return findAllByHostType(tree.root, 'MermaidDiagram').length -} - -function firstMermaid(tree: ReactTestRenderer) { - return findByHostType(tree.root, 'MermaidDiagram') -} - -describe('MobileMarkdown mermaid routing', () => { - it('keeps identical sibling diagrams uniquely keyed', () => { - const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) - const diagram = '```mermaid\ngraph TD; A-->B\n```' - const tree = render(`${diagram}\n\n${diagram}`) - const warnings = consoleError.mock.calls.flat().join(' ') - expect(mermaidCount(tree)).toBe(2) - expect(warnings).not.toContain('same key') - }) - - it('preserves a completed diagram while later prose streams', () => { - const diagram = '```mermaid\ngraph TD; A-->B\n```' - const tree = render(diagram) - const initial = firstMermaid(tree) - act(() => tree.update(createElement(MobileMarkdown, { content: `${diagram}\n\nNext` }))) - expect(firstMermaid(tree)).toBe(initial) - }) - - it('remounts a diagram when its source changes', () => { - const tree = render('```mermaid\ngraph TD; A-->B\n```') - const initial = firstMermaid(tree) - act(() => - tree.update(createElement(MobileMarkdown, { content: '```mermaid\ngraph TD; A-->C\n```' })) - ) - expect(firstMermaid(tree)).not.toBe(initial) - }) -}) diff --git a/mobile/src/components/mobile-markdown-styles.ts b/mobile/src/components/mobile-markdown-styles.ts index c1513bb21ce..3a26e0dd6c8 100644 --- a/mobile/src/components/mobile-markdown-styles.ts +++ b/mobile/src/components/mobile-markdown-styles.ts @@ -269,23 +269,27 @@ export type MarkdownTone = { } /** Colours and weight over the styles above, for one surface. The default tone overrides nothing. */ -export const MARKDOWN_TONES: Record<'default' | 'userMessage' | 'strong' | 'muted', MarkdownTone> = - { - default: { text: null, secondary: null, link: null, inlineCode: null }, - // A card's title: the question an agent asks. - strong: { text: { fontWeight: '600' }, secondary: null, link: null, inlineCode: null }, - // Settled text beside a receipt's muted answer. - muted: themedStyles(() => ({ - text: { color: colors.textMuted }, - secondary: null, - link: null, - inlineCode: null - })), - // Desktop's user bubble only strengthens the text; links and code keep their chat colors. - userMessage: themedStyles(() => ({ - text: { color: colors.chatForegroundStrong }, - secondary: null, - link: null, - inlineCode: null - })) - } +export const MARKDOWN_TONES: Record< + 'default' | 'userMessage' | 'strong' | 'medium' | 'muted', + MarkdownTone +> = { + default: { text: null, secondary: null, link: null, inlineCode: null }, + // A card's title: the question an agent asks. + strong: { text: { fontWeight: '600' }, secondary: null, link: null, inlineCode: null }, + // The answer card's question: body size, lighter than its options' bold labels. + medium: { text: { fontWeight: '500' }, secondary: null, link: null, inlineCode: null }, + // Settled text beside a receipt's muted answer. + muted: themedStyles(() => ({ + text: { color: colors.textMuted }, + secondary: null, + link: null, + inlineCode: null + })), + // Desktop's user bubble only strengthens the text; links and code keep their chat colors. + userMessage: themedStyles(() => ({ + text: { color: colors.chatForegroundStrong }, + secondary: null, + link: null, + inlineCode: null + })) +} diff --git a/mobile/src/components/mobile-markdown-table.test.tsx b/mobile/src/components/mobile-markdown-table.test.tsx deleted file mode 100644 index d718eeb80e0..00000000000 --- a/mobile/src/components/mobile-markdown-table.test.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import { createElement } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { describe, expect, it, vi } from 'vitest' -import { MobileMarkdown } from './MobileMarkdown' -import { styles } from './mobile-markdown-styles' - -vi.mock('react-native', () => ({ - Linking: { openURL: () => Promise.resolve() }, - Platform: { OS: 'ios' }, - Pressable: 'Pressable', - ScrollView: 'ScrollView', - StyleSheet: { create: (styles: unknown) => styles, hairlineWidth: 1 }, - Text: 'Text', - View: 'View' -})) - -vi.mock('./pr-sidebar/MermaidDiagram', () => ({ MermaidDiagram: 'MermaidDiagram' })) -vi.mock('./MobileSourceCopyButton', () => ({ MobileSourceCopyButton: 'MobileSourceCopyButton' })) - -/** Each rendered table row's cell styles, header row first. */ -function renderTableCellStyles(content: string): unknown[][] { - let renderer: ReactTestRenderer | null = null - act(() => { - renderer = create(createElement(MobileMarkdown, { content })) - }) - const rows = renderer!.root.findAll((node) => node.props.style === styles.tableRow) - const cellStyles = rows.map((row) => - row.children.map((cell) => (typeof cell === 'string' ? undefined : cell.props.style)) - ) - act(() => renderer!.unmount()) - return cellStyles -} - -function cellWidth(style: unknown): number { - for (const entry of [style].flat()) { - if (entry && typeof entry === 'object' && 'width' in entry && typeof entry.width === 'number') { - return entry.width - } - } - throw new Error('table cell has no width') -} - -function markdownTable(headers: string[], rows: string[][]): string { - return [headers, headers.map(() => '---'), ...rows] - .map((row) => `| ${row.join(' | ')} |`) - .join('\n') -} - -describe('MobileMarkdown tables', () => { - it('renders every row and column with one width per column', () => { - const headers = Array.from({ length: 10 }, (_, column) => `Column ${column}`) - const rows = Array.from({ length: 50 }, (_, row) => - headers.map((_, column) => (row === 7 && column === 3 ? 'a much longer cell value' : 'x')) - ) - const cellStyles = renderTableCellStyles(markdownTable(headers, rows)) - - expect(cellStyles.map((row) => row.length)).toEqual(Array.from({ length: 51 }, () => 10)) - const widths = cellStyles.map((row) => row.map(cellWidth)) - for (const row of widths) { - expect(row).toEqual(widths[0]) - } - expect(widths[0]![3]).toBeGreaterThan(widths[0]![2]!) - }) - - it('sizes a column by the text it draws, not its markdown source', () => { - const [widths] = renderTableCellStyles( - markdownTable( - ['A', 'B', 'C'], - [['docs', '[docs](https://example.com/a/very/long/path)', '文档文档']] - ) - ).map((row) => row.map(cellWidth)) - - expect(widths![1]).toBe(widths![0]) - expect(widths![2]).toBeGreaterThan(widths![0]!) - }) -}) diff --git a/mobile/src/components/mobile-markdown-tree.ts b/mobile/src/components/mobile-markdown-tree.ts index 0eca3907d49..b511ad24a87 100644 --- a/mobile/src/components/mobile-markdown-tree.ts +++ b/mobile/src/components/mobile-markdown-tree.ts @@ -3,7 +3,7 @@ import cjkFriendly from 'markdown-it-cjk-friendly' import footnote from 'markdown-it-footnote' import type { AlignType, Parent, PhrasingContent, Root, RootContent, Table } from 'mdast' import remend from 'remend' -import { forEachGitHubCallout } from '../../../src/shared/github/github-callouts' +import { forEachGitHubCallout } from '../../../src/shared/github/markdown/github-callouts' import { codeNode, type Token } from './mobile-markdown-code-nodes' import { inlineTagNode, inlineTagPairs } from './mobile-markdown-inline-html' import { readTaskMarker } from './mobile-markdown-task-items' diff --git a/mobile/src/components/pr-sidebar/MobileLinkPrForm.tsx b/mobile/src/components/pr-sidebar/MobileLinkPrForm.tsx index df19a803b29..03f03584590 100644 --- a/mobile/src/components/pr-sidebar/MobileLinkPrForm.tsx +++ b/mobile/src/components/pr-sidebar/MobileLinkPrForm.tsx @@ -8,7 +8,7 @@ import { triggerError, triggerSuccess } from '../../platform/haptics' import { parseGitHubIssueOrPRLink, parseGitHubIssueOrPRNumber -} from '../../../../src/shared/github/links' +} from '../../../../src/shared/github/repositories/links' import { linkMobilePr } from '../../source-control/mobile-pr-link' import { TextField } from '../composer-input/TextField' import { useMobileTranslation } from '../../i18n/use-mobile-translation' diff --git a/mobile/src/components/pr-sidebar/MobilePrTabSheets.tsx b/mobile/src/components/pr-sidebar/MobilePrTabSheets.tsx index 57c5d472bc8..d8c5eae6729 100644 --- a/mobile/src/components/pr-sidebar/MobilePrTabSheets.tsx +++ b/mobile/src/components/pr-sidebar/MobilePrTabSheets.tsx @@ -4,8 +4,8 @@ import { GitMerge } from 'lucide-react-native' import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' import { useMobileTranslation } from '../../i18n/use-mobile-translation' import type { Translate } from '../../i18n/mobile-i18n' -import type { GitHubPRMergeMethod } from '../../../../src/shared/github/pull-request-types' -import { resolveGitHubPRMergeMethods } from '../../../../src/shared/github/pull-request-merge-methods' +import type { GitHubPRMergeMethod } from '../../../../src/shared/github/pull-requests/pull-request-types' +import { resolveGitHubPRMergeMethods } from '../../../../src/shared/github/pull-requests/merge/pull-request-merge-methods' import { KeyedBottomDrawer } from '../bottom-drawer/keyed-bottom-drawer' import { SheetHeader } from '../nav-bar/SheetHeader' import { SheetPrimaryButton } from '../SheetPrimaryButton' diff --git a/mobile/src/components/pr-sidebar/PRCheckDetail.tsx b/mobile/src/components/pr-sidebar/PRCheckDetail.tsx index 90894b5922e..7b9674d1646 100644 --- a/mobile/src/components/pr-sidebar/PRCheckDetail.tsx +++ b/mobile/src/components/pr-sidebar/PRCheckDetail.tsx @@ -1,7 +1,7 @@ import { ActivityIndicator, ScrollView, Text, View } from 'react-native' import { colors } from '../../theme/mobile-theme' import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' -import type { PRCheckRunDetails } from '../../../../src/shared/github/check-types' +import type { PRCheckRunDetails } from '../../../../src/shared/github/checks/check-types' import { presentCheckDetail, type CheckDetailJob } from './pr-check-detail-content' import { mobilePrSidebarStyles as styles } from './mobile-pr-sidebar-styles' import { useMobileTranslation } from '../../i18n/use-mobile-translation' diff --git a/mobile/src/components/pr-sidebar/PRCommentCard.tsx b/mobile/src/components/pr-sidebar/PRCommentCard.tsx index eea6227f480..8bf6e839b5c 100644 --- a/mobile/src/components/pr-sidebar/PRCommentCard.tsx +++ b/mobile/src/components/pr-sidebar/PRCommentCard.tsx @@ -6,7 +6,7 @@ import type { GitHubReaction, GitHubReactionContent, PRComment -} from '../../../../src/shared/github/comment-types' +} from '../../../../src/shared/github/comments/comment-types' import { colors, pressedStyle } from '../../theme/mobile-theme' import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' import type { Translate } from '../../i18n/mobile-i18n' diff --git a/mobile/src/components/pr-sidebar/PRCommentsSection.tsx b/mobile/src/components/pr-sidebar/PRCommentsSection.tsx index 9c44d335d27..18f461d6b80 100644 --- a/mobile/src/components/pr-sidebar/PRCommentsSection.tsx +++ b/mobile/src/components/pr-sidebar/PRCommentsSection.tsx @@ -1,8 +1,8 @@ import { useMemo, useState } from 'react' import { ActivityIndicator, Pressable, Text, View } from 'react-native' import { ChevronDown, ChevronRight } from 'lucide-react-native' -import type { PRState } from '../../../../src/shared/github/pull-request-types' -import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-item-types' +import type { PRState } from '../../../../src/shared/github/pull-requests/pull-request-types' +import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-items/work-item-types' import type { GitHubPrRepoSlug } from '../../source-control/review/github-pr-repo-slug' import { colors, pressedStyle } from '../../theme/mobile-theme' import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' diff --git a/mobile/src/components/pr-sidebar/PrCheckFailureRow.tsx b/mobile/src/components/pr-sidebar/PrCheckFailureRow.tsx index e4d44717d17..2d7d8416984 100644 --- a/mobile/src/components/pr-sidebar/PrCheckFailureRow.tsx +++ b/mobile/src/components/pr-sidebar/PrCheckFailureRow.tsx @@ -17,7 +17,7 @@ import type { Translate } from '../../i18n/mobile-i18n' import { openExternalLink } from '../../platform/external-link' import { useClipboardWriter } from '../../platform/clipboard' import { triggerError, triggerSuccess } from '../../platform/haptics' -import type { PRCheckDetail } from '../../../../src/shared/github/check-types' +import type { PRCheckDetail } from '../../../../src/shared/github/checks/check-types' import { LIST_LEADING_SLOT, LIST_ROW_PADDING } from '../list/ListGroup' import { PullDownMenu } from '../nav-bar/PullDownMenu' import type { ActionSheetAction } from '../ActionSheetModal' diff --git a/mobile/src/components/pr-sidebar/PrChecksScreen.tsx b/mobile/src/components/pr-sidebar/PrChecksScreen.tsx index e833511fa55..b0060ae92b3 100644 --- a/mobile/src/components/pr-sidebar/PrChecksScreen.tsx +++ b/mobile/src/components/pr-sidebar/PrChecksScreen.tsx @@ -7,7 +7,7 @@ import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' import { useMobileTranslation } from '../../i18n/use-mobile-translation' import type { Translate } from '../../i18n/mobile-i18n' import { openExternalLink } from '../../platform/external-link' -import type { PRCheckDetail } from '../../../../src/shared/github/check-types' +import type { PRCheckDetail } from '../../../../src/shared/github/checks/check-types' import { isBrokenCheck } from '../../../../src/shared/source-control/checks/pr-checks-fix-prompt' import { sortChecksBySeverity } from '../../../../src/shared/source-control/checks/pr-check-severity-order' import { buildPrFixChecksPrompt } from '../../source-control/review/pr-ai-triage-prompt' diff --git a/mobile/src/components/pr-sidebar/PrReviewersSheet.tsx b/mobile/src/components/pr-sidebar/PrReviewersSheet.tsx index ff357de0f3b..0ccb982bd2f 100644 --- a/mobile/src/components/pr-sidebar/PrReviewersSheet.tsx +++ b/mobile/src/components/pr-sidebar/PrReviewersSheet.tsx @@ -5,8 +5,8 @@ import { colors, pressedStyle } from '../../theme/mobile-theme' import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' import { useMobileTranslation } from '../../i18n/use-mobile-translation' import type { Translate } from '../../i18n/mobile-i18n' -import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-item-types' -import { getGitHubPRReviewerRows } from '../../../../src/shared/github/pr-reviewer-display' +import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-items/work-item-types' +import { getGitHubPRReviewerRows } from '../../../../src/shared/github/pull-requests/pr-reviewer-display' import { useCalmConnectionState } from '../../transport/connection/calm-connection-state' import { classifyConnection, diff --git a/mobile/src/components/pr-sidebar/PrTabBottomAction.tsx b/mobile/src/components/pr-sidebar/PrTabBottomAction.tsx index fd7bc73a9bf..eddd0a99bbc 100644 --- a/mobile/src/components/pr-sidebar/PrTabBottomAction.tsx +++ b/mobile/src/components/pr-sidebar/PrTabBottomAction.tsx @@ -3,8 +3,8 @@ import { GitMerge, GitPullRequest, Sparkles, type LucideIcon } from 'lucide-reac import { colors, feedback, pressedStyle } from '../../theme/mobile-theme' import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' import { useMobileTranslation } from '../../i18n/use-mobile-translation' -import { resolveGitHubPRMergeMethods } from '../../../../src/shared/github/pull-request-merge-methods' -import { resolveGitHubPRMergeState } from '../../../../src/shared/github/pull-request-merge-state' +import { resolveGitHubPRMergeMethods } from '../../../../src/shared/github/pull-requests/merge/pull-request-merge-methods' +import { resolveGitHubPRMergeState } from '../../../../src/shared/github/pull-requests/merge/pull-request-merge-state' import { MOBILE_GITHUB_MARK_PR_READY_RUNTIME_CAPABILITY } from '../../../../src/shared/source-control/runtime/source-control-runtime-capabilities' import { useRouteCapability } from '../../worktree/use-workspace-client' import { buildResolveConflictsPrompt } from '../../source-control/review/pr-ai-triage-prompt' diff --git a/mobile/src/components/pr-sidebar/PrThreadCode.tsx b/mobile/src/components/pr-sidebar/PrThreadCode.tsx index c35b3f6b411..7a642750765 100644 --- a/mobile/src/components/pr-sidebar/PrThreadCode.tsx +++ b/mobile/src/components/pr-sidebar/PrThreadCode.tsx @@ -1,5 +1,5 @@ import { Text, View } from 'react-native' -import type { DiffHunkLine } from '../../../../src/shared/github/pr-comment-diff-hunk' +import type { DiffHunkLine } from '../../../../src/shared/github/comments/pr-comment-diff-hunk' import { colors, radii, spacing, typography } from '../../theme/mobile-theme' import { themedStyleSheet } from '../../theme/themed-styles' import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' diff --git a/mobile/src/components/pr-sidebar/PrThreadRow.tsx b/mobile/src/components/pr-sidebar/PrThreadRow.tsx index 10a6a117720..2a57abeb40b 100644 --- a/mobile/src/components/pr-sidebar/PrThreadRow.tsx +++ b/mobile/src/components/pr-sidebar/PrThreadRow.tsx @@ -15,13 +15,13 @@ import { Sparkles, Trash2 } from 'lucide-react-native' -import type { PRComment } from '../../../../src/shared/github/comment-types' +import type { PRComment } from '../../../../src/shared/github/comments/comment-types' import { getPRCommentGroupRoot, type PRCommentGroup } from '../../../../src/shared/source-control/review-comments/pr-comment-groups' import { isBotPRComment } from '../../../../src/shared/source-control/review-comments/pr-comment-audience' -import { threadDiffLines } from '../../../../src/shared/github/pr-comment-diff-hunk' +import { threadDiffLines } from '../../../../src/shared/github/comments/pr-comment-diff-hunk' import { colors, pressedStyle, radii, spacing, typography } from '../../theme/mobile-theme' import { themedStyleSheet } from '../../theme/themed-styles' import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' diff --git a/mobile/src/components/pr-sidebar/PrThreadScreen.tsx b/mobile/src/components/pr-sidebar/PrThreadScreen.tsx index b1db7052d92..d87cf43aae6 100644 --- a/mobile/src/components/pr-sidebar/PrThreadScreen.tsx +++ b/mobile/src/components/pr-sidebar/PrThreadScreen.tsx @@ -1,6 +1,6 @@ import { ScrollView, Text, View } from 'react-native' import type { PRCommentGroup } from '../../../../src/shared/source-control/review-comments/pr-comment-groups' -import { threadDiffLines } from '../../../../src/shared/github/pr-comment-diff-hunk' +import { threadDiffLines } from '../../../../src/shared/github/comments/pr-comment-diff-hunk' import { colors, spacing, typography } from '../../theme/mobile-theme' import { themedStyleSheet } from '../../theme/themed-styles' import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' diff --git a/mobile/src/components/pr-sidebar/pr-actions-state.ts b/mobile/src/components/pr-sidebar/pr-actions-state.ts index ca224703516..b2844c528ca 100644 --- a/mobile/src/components/pr-sidebar/pr-actions-state.ts +++ b/mobile/src/components/pr-sidebar/pr-actions-state.ts @@ -1,12 +1,15 @@ -import type { GitHubPRMergeMethod, PRInfo } from '../../../../src/shared/github/pull-request-types' +import type { + GitHubPRMergeMethod, + PRInfo +} from '../../../../src/shared/github/pull-requests/pull-request-types' import { resolveGitHubPRMergeState, type GitHubPRMergeStateKind -} from '../../../../src/shared/github/pull-request-merge-state' +} from '../../../../src/shared/github/pull-requests/merge/pull-request-merge-state' import { resolveGitHubPRStackMergeDecision, type GitHubPRStackMergeBlocker -} from '../../../../src/shared/github/pull-request-stack-merge' +} from '../../../../src/shared/github/pull-requests/merge/pull-request-stack-merge' import { translate } from '../../i18n/mobile-i18n' // Copy for desktop’s merge-state kinds; the shared rule decides which one applies. diff --git a/mobile/src/components/pr-sidebar/pr-check-detail-content.ts b/mobile/src/components/pr-sidebar/pr-check-detail-content.ts index 1f226876628..d95865918e4 100644 --- a/mobile/src/components/pr-sidebar/pr-check-detail-content.ts +++ b/mobile/src/components/pr-sidebar/pr-check-detail-content.ts @@ -2,7 +2,7 @@ import type { PRCheckAnnotation, PRCheckJob, PRCheckRunDetails -} from '../../../../src/shared/github/check-types' +} from '../../../../src/shared/github/checks/check-types' import { resolveStepOutcome, summarizeJobSteps diff --git a/mobile/src/components/pr-sidebar/pr-checks-presentation.ts b/mobile/src/components/pr-sidebar/pr-checks-presentation.ts index 3b9cba6a125..ed451236639 100644 --- a/mobile/src/components/pr-sidebar/pr-checks-presentation.ts +++ b/mobile/src/components/pr-sidebar/pr-checks-presentation.ts @@ -1,5 +1,5 @@ -import type { PRCheckDetail } from '../../../../src/shared/github/check-types' -import type { PRState } from '../../../../src/shared/github/pull-request-types' +import type { PRCheckDetail } from '../../../../src/shared/github/checks/check-types' +import type { PRState } from '../../../../src/shared/github/pull-requests/pull-request-types' import { getProviderChecksOutcome, summarizeProviderChecks diff --git a/mobile/src/components/pr-sidebar/pr-comment-composer-drafts.test.tsx b/mobile/src/components/pr-sidebar/pr-comment-composer-drafts.test.tsx deleted file mode 100644 index 2710d18b844..00000000000 --- a/mobile/src/components/pr-sidebar/pr-comment-composer-drafts.test.tsx +++ /dev/null @@ -1,90 +0,0 @@ -import { createElement, type ReactNode } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, beforeEach, expect, it, vi } from 'vitest' - -const hosts = vi.hoisted(() => { - const Box = (props: { children?: ReactNode }): ReactNode => props.children ?? null - Box.displayName = 'MessageBox' - return { Box } -}) -vi.mock('react-native', () => ({ Pressable: () => null })) -vi.mock('lucide-react-native', () => ({ X: () => null })) -vi.mock('../../theme/use-mobile-color-scheme', () => ({ useMobileColorScheme: () => 'light' })) -vi.mock('../composer-input/MessageBox', () => ({ MessageBox: hosts.Box })) -vi.mock('../composer-input/composer-input-styles', () => ({ composerInputStyles: {} })) - -import { publishPageDeviceStore } from '../../mobile-web-shell/bridge/page-device-store' -import { resetDurableDraftFieldsForTests } from '../../drafts/durable-draft-fields' -import { publishInMemoryDeviceStore } from '../../drafts/in-memory-device-store.test-support' -import { PRCommentComposer } from './PRCommentComposer' - -// The shell's draft table outlives the page; nothing else does. -const table = new Map() -let renderer: ReactTestRenderer | null = null -let onSubmit: (body: string) => Promise = async () => true - -const KEY = 'draft:prComment:wt-1:host-1::/acme/app#12#new' - -async function open(): Promise { - await act(async () => { - renderer = create( - createElement(PRCommentComposer, { - placeholder: 'Comment', - submitLabel: 'Comment', - submitting: false, - draftKey: KEY, - onSubmit: (body: string) => onSubmit(body) - }) - ) - await vi.advanceTimersByTimeAsync(0) - }) -} - -function box(): { value: string; onChangeText: (text: string) => void; onSend: () => void } { - const props = renderer?.root.findByType(hosts.Box).props - return { value: props?.value, onChangeText: props?.onChangeText, onSend: props?.onSend } -} - -async function type(text: string): Promise { - act(() => box().onChangeText(text)) - await act(async () => { - await vi.advanceTimersByTimeAsync(1000) - }) -} - -// A kill: the page and its memory go, the store stays. -function kill(): void { - act(() => renderer?.unmount()) - renderer = null - resetDurableDraftFieldsForTests() -} - -beforeEach(() => { - vi.useFakeTimers() - publishInMemoryDeviceStore(table) -}) - -afterEach(() => { - kill() - table.clear() - publishPageDeviceStore(null) - onSubmit = async () => true - vi.useRealTimers() -}) - -it('keeps text typed in a reopened composer when the earlier post lands', async () => { - let land: (ok: boolean) => void = () => {} - onSubmit = () => new Promise((resolve) => (land = resolve)) - await open() - await type('first thought') - act(() => box().onSend()) - act(() => renderer?.unmount()) - - await open() - await type('a second thought') - await act(async () => { - land(true) - await vi.advanceTimersByTimeAsync(1000) - }) - expect(box().value).toBe('a second thought') -}) diff --git a/mobile/src/components/pr-sidebar/pr-create-sheet-drafts.test.tsx b/mobile/src/components/pr-sidebar/pr-create-sheet-drafts.test.tsx deleted file mode 100644 index 3db7251d9fb..00000000000 --- a/mobile/src/components/pr-sidebar/pr-create-sheet-drafts.test.tsx +++ /dev/null @@ -1,144 +0,0 @@ -import { createElement, type ReactNode } from 'react' -import { act, create, type ReactTestInstance, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, beforeEach, expect, it, vi } from 'vitest' - -const hosts = vi.hoisted(() => { - const make = (name: string) => { - const Host = (props: { children?: ReactNode }): ReactNode => props.children ?? null - Host.displayName = name - return Host - } - return { - View: make('View'), - Text: make('Text'), - Pressable: make('Pressable'), - Field: make('FieldTextInput'), - Button: make('SheetPrimaryButton') - } -}) -vi.mock('react-native', () => ({ - View: hosts.View, - Text: hosts.Text, - Pressable: hosts.Pressable, - ActivityIndicator: hosts.View, - StyleSheet: { create: (styles: T) => styles, hairlineWidth: 1, absoluteFillObject: {} }, - Platform: { OS: 'ios', select: (options: Record) => options.ios } -})) -vi.mock('lucide-react-native', () => ({ ChevronsUpDown: hosts.View, Sparkles: hosts.View })) -vi.mock('../../theme/use-mobile-color-scheme', () => ({ useMobileColorScheme: () => 'light' })) -vi.mock('../nav-bar/SheetHeader', () => ({ SheetHeader: hosts.View })) -vi.mock('../SheetPrimaryButton', () => ({ SheetPrimaryButton: hosts.Button })) -vi.mock('../list/ListGroup', () => ({ ListGroup: hosts.View, ListRow: hosts.View })) -vi.mock('../MobileSwitch', () => ({ MobileSwitch: hosts.View })) -vi.mock('./PrBasePicker', () => ({ PrBasePicker: hosts.View })) -vi.mock('../composer-input/FieldTextInput', () => ({ FieldTextInput: hosts.Field })) -vi.mock('../../source-control/MobileCommitFailurePanel', () => ({ - MobileCommitFailurePanel: hosts.View -})) -vi.mock('../../source-control/use-mobile-commit-failure-recovery', () => ({ - useMobileCommitFailureRecovery: () => null -})) -const host = vi.hoisted(() => ({ - seed: vi.fn(), - create: vi.fn() -})) -vi.mock('../../source-control/mobile-pr-create-draft', () => ({ - loadMobilePrCreateDraft: host.seed, - generateMobilePrFields: vi.fn(), - cancelMobilePrFields: vi.fn(async () => {}) -})) -vi.mock('../../source-control/mobile-hosted-review-create-intent-runner', () => ({ - runMobileHostedReviewCreateIntent: host.create, - isMobileHostedReviewCommitFailure: () => false -})) - -import { publishPageDeviceStore } from '../../mobile-web-shell/bridge/page-device-store' -import { resetDurableDraftFieldsForTests } from '../../drafts/durable-draft-fields' -import { publishInMemoryDeviceStore } from '../../drafts/in-memory-device-store.test-support' -import { createFakeRpcClient } from '../../mobile-web-shell/bridge-host-test-fakes' -import { PrCreateSheet } from './PrCreateSheet' -import type { MobilePrTab } from './use-mobile-pr-tab' -import { mountFixture } from '../../test-support/rpc-recording/recorder-fixture-shape' - -// The shell's draft table outlives the page; nothing else does. -const table = new Map() -let renderer: ReactTestRenderer | null = null - -// The sheet reads only these fields of the PR tab. -const tab = mountFixture({ - client: createFakeRpcClient(), - hostId: 'host-1', - worktreeId: 'repo::/work/feature', - gitBranch: 'feature/login', - gitStatus: null, - commitsAhead: null, - connState: 'connected', - workspaceLabel: 'feature', - creatingPr: false, - setCreatingPr: () => {}, - closeSheet: () => {}, - closeSheetThen: () => {} -}) - -async function open(): Promise { - await act(async () => { - renderer = create(createElement(PrCreateSheet, { tab })) - await vi.advanceTimersByTimeAsync(0) - }) -} - -function titleField(): ReactTestInstance | undefined { - return renderer?.root.findAllByType(hosts.Field)[0] -} - -async function typeTitle(title: string): Promise { - act(() => titleField()?.props.onChangeText(title)) - await act(async () => { - await vi.advanceTimersByTimeAsync(1000) - }) -} - -// A kill: the page and its memory go, the store stays. -function kill(): void { - act(() => renderer?.unmount()) - renderer = null - resetDurableDraftFieldsForTests() -} - -beforeEach(() => { - vi.useFakeTimers() - host.seed.mockResolvedValue({ - prefill: { provider: 'github', base: 'main', title: '', body: '' }, - title: 'Seed from commits', - body: '', - base: 'main' - }) - publishInMemoryDeviceStore(table) -}) - -afterEach(() => { - kill() - table.clear() - publishPageDeviceStore(null) - host.seed.mockReset() - host.create.mockReset() - vi.useRealTimers() -}) - -it('keeps nothing for the next Create once a Create lands after its sheet closed', async () => { - let land: (outcome: unknown) => void = () => {} - host.create.mockReturnValue(new Promise((resolve) => (land = resolve))) - await open() - await typeTitle('Fix the login race') - act(() => renderer?.root.findByType(hosts.Button).props.onPress()) - // A branch or client change closes the sheet while the Create is still running. - act(() => renderer?.unmount()) - await act(async () => { - land({ ok: true, url: 'https://example.test/pr/1', prefill: { provider: 'github' } }) - await vi.advanceTimersByTimeAsync(1000) - }) - kill() - - await open() - expect(titleField()?.props.value).toBe('Seed from commits') -}) diff --git a/mobile/src/components/pr-sidebar/pr-tab-gates.ts b/mobile/src/components/pr-sidebar/pr-tab-gates.ts index e7aa9ee321b..66d8d132760 100644 --- a/mobile/src/components/pr-sidebar/pr-tab-gates.ts +++ b/mobile/src/components/pr-sidebar/pr-tab-gates.ts @@ -1,8 +1,8 @@ -import { isCompletePRCheckOwner } from '../../../../src/shared/github/complete-pr-check-owner' +import { isCompletePRCheckOwner } from '../../../../src/shared/github/checks/complete-pr-check-owner' import { getProviderChecksOutcome } from '../../../../src/shared/source-control/checks/provider-check-summary' -import type { PRCheckDetail } from '../../../../src/shared/github/check-types' -import type { PRInfo } from '../../../../src/shared/github/pull-request-types' -import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-item-types' +import type { PRCheckDetail } from '../../../../src/shared/github/checks/check-types' +import type { PRInfo } from '../../../../src/shared/github/pull-requests/pull-request-types' +import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-items/work-item-types' import { groupPRComments } from '../../../../src/shared/source-control/review-comments/pr-comment-groups' import { isBotPRComment } from '../../../../src/shared/source-control/review-comments/pr-comment-audience' import { translate } from '../../i18n/mobile-i18n' diff --git a/mobile/src/components/pr-sidebar/use-mobile-pr-polling.ts b/mobile/src/components/pr-sidebar/use-mobile-pr-polling.ts index 69a6f16aae6..a0c295fd531 100644 --- a/mobile/src/components/pr-sidebar/use-mobile-pr-polling.ts +++ b/mobile/src/components/pr-sidebar/use-mobile-pr-polling.ts @@ -3,9 +3,9 @@ import { useFocusEffect } from 'expo-router' import { ChecksDetailPollingPolicy, nextChecksPollBackoffMs -} from '../../../../src/shared/github/checks-detail-polling-policy' -import type { PRCheckDetail } from '../../../../src/shared/github/check-types' -import type { PRInfo } from '../../../../src/shared/github/pull-request-types' +} from '../../../../src/shared/github/checks/checks-detail-polling-policy' +import type { PRCheckDetail } from '../../../../src/shared/github/checks/check-types' +import type { PRInfo } from '../../../../src/shared/github/pull-requests/pull-request-types' import { useHostQuery } from '../../query/host-query' import { NO_BRANCH, diff --git a/mobile/src/components/pr-sidebar/use-mobile-pr-tab.ts b/mobile/src/components/pr-sidebar/use-mobile-pr-tab.ts index 46ea23cb2d1..795f3acc787 100644 --- a/mobile/src/components/pr-sidebar/use-mobile-pr-tab.ts +++ b/mobile/src/components/pr-sidebar/use-mobile-pr-tab.ts @@ -8,7 +8,7 @@ import { type PrSidebarData, type PrSidebarState } from '../../source-control/review/mobile-pr-sidebar-state' -import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-item-types' +import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-items/work-item-types' import type { PrSidebarLoadOptions } from '../../source-control/review/use-mobile-pr-sidebar-controller' import { prActionSlices, diff --git a/mobile/src/components/pr-sidebar/use-pr-check-run-details.ts b/mobile/src/components/pr-sidebar/use-pr-check-run-details.ts index b8a0896d446..a418f230af8 100644 --- a/mobile/src/components/pr-sidebar/use-pr-check-run-details.ts +++ b/mobile/src/components/pr-sidebar/use-pr-check-run-details.ts @@ -1,5 +1,5 @@ import { useCallback, useLayoutEffect, useRef, useState } from 'react' -import type { PRCheckDetail } from '../../../../src/shared/github/check-types' +import type { PRCheckDetail } from '../../../../src/shared/github/checks/check-types' import { fetchPRCheckDetails } from '../../source-control/review/github-pr-rpc' import '../../source-control/review/github-pr-repo-slug' import type { GitHubPrRepoSlug } from '../../source-control/review/github-pr-repo-slug' diff --git a/mobile/src/components/pr-sidebar/use-pr-tab-menu.ts b/mobile/src/components/pr-sidebar/use-pr-tab-menu.ts index 347b93bca31..a977b03f32a 100644 --- a/mobile/src/components/pr-sidebar/use-pr-tab-menu.ts +++ b/mobile/src/components/pr-sidebar/use-pr-tab-menu.ts @@ -5,8 +5,8 @@ import { triggerError, triggerSuccess } from '../../platform/haptics' import { openMobilePrUrl } from '../mobile-pr-url' import type { ActionSheetAction } from '../ActionSheetModal' import { canEditPRTitle } from '../../source-control/review/pr-title-edit' -import { resolveGitHubPRMergeMethods } from '../../../../src/shared/github/pull-request-merge-methods' -import { resolveGitHubPRMergeState } from '../../../../src/shared/github/pull-request-merge-state' +import { resolveGitHubPRMergeMethods } from '../../../../src/shared/github/pull-requests/merge/pull-request-merge-methods' +import { resolveGitHubPRMergeState } from '../../../../src/shared/github/pull-requests/merge/pull-request-merge-state' import { MOBILE_GITHUB_MARK_PR_DRAFT_RUNTIME_CAPABILITY, MOBILE_GITHUB_MARK_PR_READY_RUNTIME_CAPABILITY diff --git a/mobile/src/components/pr-sidebar/use-reviewer-people.ts b/mobile/src/components/pr-sidebar/use-reviewer-people.ts index b26e4d23e01..8ff18cb644b 100644 --- a/mobile/src/components/pr-sidebar/use-reviewer-people.ts +++ b/mobile/src/components/pr-sidebar/use-reviewer-people.ts @@ -1,8 +1,6 @@ import { useState } from 'react' -import type { - GitHubAssignableUser, - GitHubOwnerRepo -} from '../../../../src/shared/github/pull-request-types' +import type { GitHubAssignableUser } from '../../../../src/shared/github/pull-requests/pull-request-types' +import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../../../../src/shared/github/repositories/repository-identity' import { useWorkspaceExecutionHost } from '../../navigation/workspace-execution-host' import { useHostQuery } from '../../query/host-query' import { isHostNotConnectedError } from '../../query/host-query-errors' diff --git a/mobile/src/components/use-mobile-markdown-tree.ts b/mobile/src/components/use-mobile-markdown-tree.ts index 544661db1ca..9d93e59bb78 100644 --- a/mobile/src/components/use-mobile-markdown-tree.ts +++ b/mobile/src/components/use-mobile-markdown-tree.ts @@ -3,7 +3,7 @@ import { useMemo, useRef } from 'react' import { linkGitHubReferences, type GitHubRepoReference -} from '../../../src/shared/github/github-reference-links' +} from '../../../src/shared/github/markdown/github-reference-links' import { linkNativeChatFilePaths, type FileLinkExists diff --git a/mobile/src/diagnostics/connection/connection-log-buffer.test.ts b/mobile/src/diagnostics/connection/connection-log-buffer.test.ts index 39712e28e54..d85333d85fa 100644 --- a/mobile/src/diagnostics/connection/connection-log-buffer.test.ts +++ b/mobile/src/diagnostics/connection/connection-log-buffer.test.ts @@ -7,6 +7,66 @@ function entry(id: number): ConnectionLogEntry { } describe('connection log buffer', () => { + it('discards history without a pending hydration or late event restoring it', async () => { + let resolveLoad: (entries: readonly ConnectionLogEntry[]) => void = () => {} + let persisted: readonly ConnectionLogEntry[] = [entry(1)] + const store = createConnectionLogStore(3, { + load: () => + new Promise((resolve) => { + resolveLoad = resolve + }), + save: async (_hostId, entries) => { + persisted = entries + } + }) + const hydration = store.hydrate('host-a') + store.append('host-a', entry(2)) + + await store.discard('host-a') + resolveLoad([entry(1)]) + await hydration + store.append('host-a', entry(3)) + await store.flush() + + expect(store.get('host-a')).toEqual([]) + expect(persisted).toEqual([]) + }) + + it('discards history after an older in-flight save finishes', async () => { + let finishSave: () => void = () => {} + let markSaveStarted: () => void = () => {} + const saveStarted = new Promise((resolve) => { + markSaveStarted = resolve + }) + let persisted: readonly ConnectionLogEntry[] = [] + let holdNextSave = false + const store = createConnectionLogStore(3, { + load: async () => [], + save: async (_hostId, entries) => { + if (holdNextSave) { + holdNextSave = false + markSaveStarted() + await new Promise((resolve) => { + finishSave = resolve + }) + } + persisted = entries + } + }) + await store.hydrate('host-a') + await store.flush() + holdNextSave = true + store.append('host-a', entry(1)) + await saveStarted + + const cleared = store.discard('host-a') + finishSave() + await cleared + + expect(store.get('host-a')).toEqual([]) + expect(persisted).toEqual([]) + }) + it('redacts credentials before retaining or persisting an event', async () => { const save = vi.fn(async () => {}) const store = createConnectionLogStore(3, { diff --git a/mobile/src/diagnostics/connection/connection-log-buffer.ts b/mobile/src/diagnostics/connection/connection-log-buffer.ts index 6d574d66c86..3ef652f741a 100644 --- a/mobile/src/diagnostics/connection/connection-log-buffer.ts +++ b/mobile/src/diagnostics/connection/connection-log-buffer.ts @@ -8,6 +8,8 @@ const PERSISTENCE_RETRY_DELAY_MS = 200 export type ConnectionLogStore = { append: (hostId: string, entry: ConnectionLogEntry) => void + /** Drops and persists empty history; later appends for the removed host are ignored. */ + discard: (hostId: string) => Promise flush: () => Promise get: (hostId: string) => readonly ConnectionLogEntry[] hydrate: (hostId: string) => Promise @@ -27,6 +29,8 @@ export function createConnectionLogStore( const listenersByHost = new Map void>>() const hydratedHosts = new Set() const hydrationFailedHosts = new Set() + // Removed host ids are never reused, so late events from closing clients must not recreate history. + const discardedHosts = new Set() const hydrationByHost = new Map>() const activeSaveByHost = new Map>() const dirtyHosts = new Set() @@ -133,6 +137,9 @@ export function createConnectionLogStore( const pending = persistence .load(hostId) .then((stored) => { + if (hydratedHosts.has(hostId)) { + return + } const live = entriesByHost.get(hostId) ?? [] const seen = new Set() const merged: ConnectionLogEntry[] = [] @@ -163,6 +170,9 @@ export function createConnectionLogStore( return { append(hostId, entry) { + if (discardedHosts.has(hostId)) { + return + } let entries = entriesByHost.get(hostId) if (!entries) { entries = [] @@ -176,6 +186,15 @@ export function createConnectionLogStore( .catch(() => {}) }, + async discard(hostId) { + discardedHosts.add(hostId) + entriesByHost.delete(hostId) + hydratedHosts.add(hostId) + hydrationFailedHosts.delete(hostId) + notify(hostId) + await flushHost(hostId) + }, + flush: async () => { await Promise.all([...entriesByHost.keys()].map((hostId) => flushHost(hostId))) }, diff --git a/mobile/src/diagnostics/connection/persisted-connection-log-store.ts b/mobile/src/diagnostics/connection/persisted-connection-log-store.ts index 3b3fe05265c..c44c8bf2e38 100644 --- a/mobile/src/diagnostics/connection/persisted-connection-log-store.ts +++ b/mobile/src/diagnostics/connection/persisted-connection-log-store.ts @@ -24,6 +24,11 @@ export const connectionLogStore = createConnectionLogStore(200, { } }) +export async function discardConnectionLogs(hostId: string): Promise { + sessionStartedHosts.delete(hostId) + await connectionLogStore.discard(hostId) +} + export function recordConnectionRevival( hostId: string, reason: 'app-resume' | 'network-change' diff --git a/mobile/src/dictation/mobile-dictation-text-insertion.test.ts b/mobile/src/dictation/mobile-dictation-text-insertion.test.ts index 196dfdd615b..eaeef956dc7 100644 --- a/mobile/src/dictation/mobile-dictation-text-insertion.test.ts +++ b/mobile/src/dictation/mobile-dictation-text-insertion.test.ts @@ -4,14 +4,6 @@ import { insertDictationText } from './mobile-dictation-text-insertion' const at = (text: string, start: number, end = start) => ({ text, start, end }) describe('insertDictationText', () => { - it('replaces the selected words and keeps the caret after them', () => { - const draft = 'Rename the prop and update the tests' - expect(insertDictationText(draft, 'fetchTimeout', at(draft, 7, 15))).toEqual({ - text: 'Rename fetchTimeout and update the tests', - caret: 19 - }) - }) - it('appends when the field was never focused or changed since the selection was read', () => { expect(insertDictationText('ls -la', 'in src', null).text).toBe('ls -la in src') expect(insertDictationText('', 'spoken', null).text).toBe('spoken') diff --git a/mobile/src/drafts/durable-draft-fields.test.tsx b/mobile/src/drafts/durable-draft-fields.test.tsx index 9e3b4882f59..7fc8925af75 100644 --- a/mobile/src/drafts/durable-draft-fields.test.tsx +++ b/mobile/src/drafts/durable-draft-fields.test.tsx @@ -1,13 +1,9 @@ import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, expect, it, vi } from 'vitest' -import { - publishPageDeviceStore, - readPageDeviceStore -} from '../mobile-web-shell/bridge/page-device-store' +import { afterEach, expect, it } from 'vitest' +import { publishPageDeviceStore } from '../mobile-web-shell/bridge/page-device-store' import { encodeDeviceStoreValue } from '../device-store/device-store-value-codec' import { resetDurableDraftFieldsForTests, useDurableDraftField } from './durable-draft-fields' -import { publishInMemoryDeviceStore } from './in-memory-device-store.test-support' const KEY = 'draft:prEdit:wt:main' let renderer: ReactTestRenderer | null = null @@ -51,105 +47,3 @@ it('keeps a field the user cleared while the saved copy was still being read', a expect(field![0]).toBe('') }) - -it('drops an older draft once the text grows past what the store can hold', async () => { - vi.useFakeTimers() - const table = new Map() - publishInMemoryDeviceStore(table) - const open = async () => { - await act(async () => { - renderer = create(createElement(Field)) - await vi.advanceTimersByTimeAsync(0) - }) - } - const kill = () => { - act(() => renderer?.unmount()) - renderer = null - resetDurableDraftFieldsForTests() - } - await open() - act(() => field![1]('a short description')) - await act(async () => { - await vi.advanceTimersByTimeAsync(1000) - }) - // Text that doesn't compress, well past the store's 512 KiB cap once encoded. - let seed = 7 - const huge = Array.from({ length: 900_000 }, () => { - seed ^= seed << 13 - seed ^= seed >>> 17 - seed ^= seed << 5 - return String.fromCharCode(33 + ((seed >>> 0) % 90)) - }).join('') - act(() => field![1](huge)) - await act(async () => { - await vi.advanceTimersByTimeAsync(1000) - }) - kill() - - await open() - expect(field![0]).toBe('') - vi.useRealTimers() -}) - -it('saves text typed while the store could not be read once the store answers again', async () => { - vi.useFakeTimers() - const table = new Map() - publishInMemoryDeviceStore(table) - const store = readPageDeviceStore()! - let readFails = true - publishPageDeviceStore({ - ...store, - read: async (name, keys) => (readFails ? { status: 'unavailable' } : store.read(name, keys)) - }) - await act(async () => { - renderer = create(createElement(Field)) - await vi.advanceTimersByTimeAsync(0) - }) - act(() => field![1]('typed while the store was down')) - readFails = false - await act(async () => { - await vi.advanceTimersByTimeAsync(15_000) - }) - act(() => renderer?.unmount()) - renderer = null - resetDurableDraftFieldsForTests() - - await act(async () => { - renderer = create(createElement(Field)) - await vi.advanceTimersByTimeAsync(0) - }) - expect(field![0]).toBe('typed while the store was down') - vi.useRealTimers() -}) - -it('does not bring back a saved draft the user cleared while the store could not be read', async () => { - vi.useFakeTimers() - const table = new Map([[KEY, encodeDeviceStoreValue({ body: 'already sent text' })]]) - publishInMemoryDeviceStore(table) - const store = readPageDeviceStore()! - let readFails = true - publishPageDeviceStore({ - ...store, - read: async (name, keys) => (readFails ? { status: 'unavailable' } : store.read(name, keys)) - }) - await act(async () => { - renderer = create(createElement(Field)) - await vi.advanceTimersByTimeAsync(0) - }) - // The send landed: its success handler clears a field that is already empty on this page. - act(() => field![1]('')) - readFails = false - await act(async () => { - await vi.advanceTimersByTimeAsync(15_000) - }) - act(() => renderer?.unmount()) - renderer = null - resetDurableDraftFieldsForTests() - - await act(async () => { - renderer = create(createElement(Field)) - await vi.advanceTimersByTimeAsync(0) - }) - expect(field![0]).toBe('') - vi.useRealTimers() -}) diff --git a/mobile/src/drafts/in-memory-device-store.test-support.ts b/mobile/src/drafts/in-memory-device-store.test-support.ts deleted file mode 100644 index eab27b59619..00000000000 --- a/mobile/src/drafts/in-memory-device-store.test-support.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { DEVICE_STORE_MAX_VALUE_LENGTH } from '../device-store/device-store-value-codec' -import { publishPageDeviceStore } from '../mobile-web-shell/bridge/page-device-store' - -/** Grants the page a device store backed by `table`, which outlives the page and keeps the shell's value cap. */ -export function publishInMemoryDeviceStore(table: Map): void { - publishPageDeviceStore({ - available: () => true, - read: async (_table, keys) => ({ - status: 'ok', - values: keys.map((key) => table.get(key) ?? null) - }), - write: async (_table, ops) => { - // Like the shell, a value over the cap refuses the whole call. - if (ops.some((op) => (op.value?.length ?? 0) > DEVICE_STORE_MAX_VALUE_LENGTH)) { - return { written: false, refusal: 'too-large' } - } - for (const op of ops) { - if (op.value === null) { - table.delete(op.key) - } else { - table.set(op.key, op.value) - } - } - return { written: true } - } - }) -} diff --git a/mobile/src/drafts/use-document-edit-draft.test.tsx b/mobile/src/drafts/use-document-edit-draft.test.tsx deleted file mode 100644 index a941c117bd4..00000000000 --- a/mobile/src/drafts/use-document-edit-draft.test.tsx +++ /dev/null @@ -1,106 +0,0 @@ -import { createElement } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import { publishPageDeviceStore } from '../mobile-web-shell/bridge/page-device-store' -import { publishInMemoryDeviceStore } from './in-memory-device-store.test-support' -import { dropDocumentEditDraft, resetDocumentEditDraftsForTests } from './document-edit-draft-rows' -import { useDocumentEditDraft } from './use-document-edit-draft' - -type Draft = ReturnType - -// The shell's draft table outlives the page; nothing else does. -const table = new Map() -let renderer: ReactTestRenderer | null = null -let latest: Draft | null = null - -const KEY = 'draft:markdownTab:wt:tab-1' - -function Editor(props: { base: string; live: string; onRestore: (content: string) => void }) { - latest = useDocumentEditDraft({ draftKey: KEY, editable: true, ...props }) - return null -} - -async function open(base: string, live: string, onRestore = vi.fn()): Promise { - await act(async () => { - renderer = create(createElement(Editor, { base, live, onRestore })) - await vi.advanceTimersByTimeAsync(0) - }) -} - -async function type(base: string, live: string): Promise { - act(() => renderer?.update(createElement(Editor, { base, live, onRestore: vi.fn() }))) - await act(async () => { - await vi.advanceTimersByTimeAsync(1000) - }) -} - -// A kill: the page and its memory go, the store stays. -function kill(): void { - act(() => renderer?.unmount()) - renderer = null - resetDocumentEditDraftsForTests() -} - -beforeEach(() => { - vi.useFakeTimers() - publishInMemoryDeviceStore(table) -}) - -afterEach(() => { - kill() - table.clear() - publishPageDeviceStore(null) - vi.useRealTimers() -}) - -it('offers edits back after a kill and restores them when the host still serves their version', async () => { - await open('# notes\n', '# notes\n') - await type('# notes\n', '# notes\nship it\n') - kill() - - const onRestore = vi.fn() - await open('# notes\n', '# notes\n', onRestore) - expect(latest?.offer).toMatchObject({ content: '# notes\nship it\n', baseMatches: true }) - expect(onRestore).not.toHaveBeenCalled() - - act(() => latest?.restore()) - expect(onRestore).toHaveBeenCalledWith('# notes\nship it\n') - expect(latest?.offer).toBeNull() -}) - -it('never applies edits made against a version the desktop has since changed', async () => { - await open('# notes\n', '# notes\n') - await type('# notes\n', '# notes\nship it\n') - kill() - - const onRestore = vi.fn() - await open('# notes\nedited on desktop\n', '# notes\nedited on desktop\n', onRestore) - expect(latest?.offer).toMatchObject({ content: '# notes\nship it\n', baseMatches: false }) - - act(() => latest?.restore()) - expect(onRestore).not.toHaveBeenCalled() - expect(latest?.offer).not.toBeNull() - - act(() => latest?.discardOffer()) - await act(async () => { - await vi.advanceTimersByTimeAsync(1000) - }) - expect(table.size).toBe(0) -}) - -it('keeps edits on offer when the edits typed over them are discarded', async () => { - await open('# notes\n', '# notes\n') - await type('# notes\n', '# notes\nship it\n') - kill() - - await open('# notes\n', '# notes\n') - await type('# notes\n', '# notes\nsomething else\n') - act(() => dropDocumentEditDraft(KEY)) - await act(async () => { - await vi.advanceTimersByTimeAsync(1000) - }) - kill() - - await open('# notes\n', '# notes\n') - expect(latest?.offer).toMatchObject({ content: '# notes\nship it\n', baseMatches: true }) -}) diff --git a/mobile/src/files/attachments/mobile-agent-image-fit.ts b/mobile/src/files/attachments/mobile-agent-image-fit.ts new file mode 100644 index 00000000000..5c49afb7774 --- /dev/null +++ b/mobile/src/files/attachments/mobile-agent-image-fit.ts @@ -0,0 +1,80 @@ +import { + AGENT_IMAGE_MAX_BYTES, + AGENT_IMAGE_MAX_LONG_EDGE, + clipboardImageSizeWithinEdge, + encodeClipboardImageWithinLimit, + type ClipboardImageDimensions +} from '../../../../src/shared/clipboard-image' +import { base64DecodedByteLength } from '../../../../src/shared/agent-session/agent-session-attachments' +import { detectImageFileSignature } from '../../../../src/shared/image-file-signature' +import { decodeBase64Bytes } from '../../transport/encryption/base64-byte-codec' +import type { PickedMobileImage } from '../../platform/media-picker-contract' + +// Page-only: decodes and re-encodes through the WebView's canvas. + +const DATA_URL_PREFIX_RE = /^data:image\/[a-z0-9.+-]+;base64,/i +const SIGNATURE_BASE64_CHARS = 16 +const JPEG_QUALITY = 0.85 + +function encodeJpegBase64(image: HTMLImageElement, size: ClipboardImageDimensions): string { + const canvas = document.createElement('canvas') + canvas.width = size.width + canvas.height = size.height + const context = canvas.getContext('2d') + if (context === null) { + throw new Error('Failed to encode image') + } + // JPEG has no alpha, so transparent pixels would otherwise turn black. + context.fillStyle = '#ffffff' + context.fillRect(0, 0, size.width, size.height) + context.imageSmoothingQuality = 'high' + context.drawImage(image, 0, 0, size.width, size.height) + const encoded = canvas.toDataURL('image/jpeg', JPEG_QUALITY).replace(DATA_URL_PREFIX_RE, '') + if (encoded.length === 0) { + throw new Error('Failed to encode image') + } + return encoded +} + +/** Shrink a photo to what agents accept; small images in formats they read pass through unchanged. */ +export async function fitMobileAgentImageBase64(data: string, mimeHint?: string): Promise { + const base64 = data.replace(DATA_URL_PREFIX_RE, '') + const signature = detectImageFileSignature( + decodeBase64Bytes(base64.slice(0, SIGNATURE_BASE64_CHARS)) + ) + const image = new Image() + image.src = `data:${signature?.mimeType ?? mimeHint ?? 'image/png'};base64,${base64}` + try { + await image.decode() + } catch (error) { + // A format agents read uploads as picked; anything else would reach them as an unreadable .png. + if (signature !== null) { + return base64 + } + throw error + } + const source = { width: image.naturalWidth, height: image.naturalHeight } + const size = clipboardImageSizeWithinEdge(source, AGENT_IMAGE_MAX_LONG_EDGE) + if ( + signature !== null && + size.width === source.width && + size.height === source.height && + base64DecodedByteLength(base64) <= AGENT_IMAGE_MAX_BYTES + ) { + return base64 + } + return encodeClipboardImageWithinLimit( + size, + (target) => encodeJpegBase64(image, target), + base64DecodedByteLength, + AGENT_IMAGE_MAX_BYTES + ) +} + +/** Files-app picks that aren't images carry a fileName and upload as-is. */ +export async function fitMobileAgentImage(image: PickedMobileImage): Promise { + if (image.fileName !== undefined) { + return image + } + return { ...image, base64: await fitMobileAgentImageBase64(image.base64, image.mime) } +} diff --git a/mobile/src/files/attachments/mobile-clipboard-image-downscale.ts b/mobile/src/files/attachments/mobile-clipboard-image-downscale.ts deleted file mode 100644 index 810ec138ccb..00000000000 --- a/mobile/src/files/attachments/mobile-clipboard-image-downscale.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Keep resize arithmetic free of upload RPC dependencies so browser raster checks can import it alone. - -// Why: PNG bytes don't scale exactly with pixel area, so undershoot the target on -// each pass and let the bounded retry converge instead of distorting in one shot. -const MOBILE_CLIPBOARD_IMAGE_DOWNSCALE_SAFETY = 0.85 - -export type MobileClipboardImageResizer = ( - source: string, - target: { width: number; height: number } -) => Promise<{ data: string; width: number; height: number }> - -export function computeMobileClipboardImageDownscale( - base64Length: number, - width: number, - height: number, - maxBase64Length: number -): { width: number; height: number } | null { - if (base64Length <= maxBase64Length) { - return null - } - if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) { - return null - } - const scale = Math.sqrt(maxBase64Length / base64Length) * MOBILE_CLIPBOARD_IMAGE_DOWNSCALE_SAFETY - const nextWidth = Math.max(1, Math.floor(width * scale)) - const nextHeight = Math.max(1, Math.floor(height * scale)) - // Guard against a no-op shrink (already 1px) so the retry loop can't spin forever. - if (nextWidth >= width && nextHeight >= height) { - return null - } - return { width: nextWidth, height: nextHeight } -} diff --git a/mobile/src/files/attachments/mobile-clipboard-image-resize.ts b/mobile/src/files/attachments/mobile-clipboard-image-resize.ts deleted file mode 100644 index 8e59ddb032a..00000000000 --- a/mobile/src/files/attachments/mobile-clipboard-image-resize.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { MobileClipboardImageResizer } from './mobile-clipboard-image-downscale' - -// Keep PNG output: upload retries measure its base64 size and terminal paste assumes PNG. Browser tests exercise a real raster under the shipped CSP. - -const CLIPBOARD_IMAGE_DATA_URL_PREFIX_RE = /^data:image\/[a-z0-9.+-]+;base64,/i -const RESIZED_MIME = 'image/png' - -export const resizeMobileClipboardImage: MobileClipboardImageResizer = async (source, target) => { - const base64 = source.replace(CLIPBOARD_IMAGE_DATA_URL_PREFIX_RE, '') - const image = new Image() - image.src = `data:${RESIZED_MIME};base64,${base64}` - // decode rejects unreadable sources; an onload-only promise could remain pending forever. - await image.decode() - const canvas = document.createElement('canvas') - canvas.width = target.width - canvas.height = target.height - const context = canvas.getContext('2d') - if (context === null) { - throw new Error('Failed to encode resized clipboard image') - } - context.drawImage(image, 0, 0, canvas.width, canvas.height) - const resized = canvas.toDataURL(RESIZED_MIME).replace(CLIPBOARD_IMAGE_DATA_URL_PREFIX_RE, '') - // Why: empty base64 would pass the downstream base64 check and upload a corrupt image, so fail - // loudly here instead of silently sending an invalid payload. - if (resized.length === 0) { - throw new Error('Failed to encode resized clipboard image') - } - // Return dimensions from the encoded canvas so metadata and bytes describe the same raster. - return { data: resized, width: canvas.width, height: canvas.height } -} diff --git a/mobile/src/files/attachments/mobile-clipboard-image.ts b/mobile/src/files/attachments/mobile-clipboard-image.ts index aaac9ba4f2f..1dfd393a413 100644 --- a/mobile/src/files/attachments/mobile-clipboard-image.ts +++ b/mobile/src/files/attachments/mobile-clipboard-image.ts @@ -1,10 +1,6 @@ import { isWindowsAbsolutePathLike } from '../../../../src/shared/cross-platform-path' import { formatImageDropPasteText } from '../../../../src/shared/image-path-paste' import { formatAgentImagePath } from '../../../../src/shared/agent-image-paste' -import { - computeMobileClipboardImageDownscale, - type MobileClipboardImageResizer -} from './mobile-clipboard-image-downscale' import { MOBILE_CLIPBOARD_IMAGE_UPLOAD_CHUNK_BASE64_CHARS } from './mobile-clipboard-image-upload-chunk' import '../../transport/connection/stable-logical-rpc-client' import { isLogicalClientCutoverError } from '../../transport/connection/logical-client-cutover-error' @@ -21,7 +17,6 @@ export const MOBILE_CLIPBOARD_IMAGE_MAX_BASE64_CHARS = 24 * 1024 * 1024 export const MOBILE_CLIPBOARD_IMAGE_SINGLE_FRAME_FALLBACK_BASE64_CHARS = 256 * 1024 const MOBILE_CLIPBOARD_IMAGE_UPLOAD_CUTOVER_MAX_RETRIES = 1 -const MOBILE_CLIPBOARD_IMAGE_MAX_DOWNSCALE_ATTEMPTS = 3 const DATA_URL_PREFIX_RE = /^data:image\/[a-z0-9.+-]+;base64,/i const BASE64_PATTERN = /^[A-Za-z0-9+/]*={0,2}$/ @@ -37,39 +32,6 @@ export function normalizeMobileClipboardImageBase64(data: string): string { return contentBase64 } -export type MobileClipboardImage = { - data: string - size: { width: number; height: number } -} - -// Retry bounded downscales; any remaining overflow reaches the existing too-large check. -export async function prepareMobileClipboardImageBase64( - image: MobileClipboardImage, - resize: MobileClipboardImageResizer, - maxBase64Length: number = MOBILE_CLIPBOARD_IMAGE_MAX_BASE64_CHARS -): Promise { - let data = image.data - let width = image.size.width - let height = image.size.height - for (let attempt = 0; attempt < MOBILE_CLIPBOARD_IMAGE_MAX_DOWNSCALE_ATTEMPTS; attempt += 1) { - const contentLength = data.replace(DATA_URL_PREFIX_RE, '').length - const target = computeMobileClipboardImageDownscale( - contentLength, - width, - height, - maxBase64Length - ) - if (!target) { - return data - } - const resized = await resize(data, target) - data = resized.data - width = resized.width - height = resized.height - } - return data -} - export async function saveMobileClipboardImageAsTempFile( client: MobileClipboardImageRpcSender, imageData: string, diff --git a/mobile/src/files/attachments/mobile-image-attachment.ts b/mobile/src/files/attachments/mobile-image-attachment.ts index e876db4978e..259d2816731 100644 --- a/mobile/src/files/attachments/mobile-image-attachment.ts +++ b/mobile/src/files/attachments/mobile-image-attachment.ts @@ -17,6 +17,7 @@ export type AttachMobileImageDeps = { readonly pickImage: (source: MobileImageSource) => Promise // Start spinner only after selection; the OS picker may remain open a long time. readonly onUploadStart?: () => void + readonly fitImage?: (image: PickedMobileImage) => Promise readonly beforeTerminalSend?: (terminal: string) => Promise } @@ -30,14 +31,16 @@ export async function attachMobileImageToTerminal( getConnectionId, pickImage, onUploadStart, + fitImage, beforeTerminalSend }: AttachMobileImageDeps ): Promise { - const picked = await pickImage(source) - if (!picked) { + const pickedImage = await pickImage(source) + if (!pickedImage) { return false } onUploadStart?.() + const picked = fitImage ? await fitImage(pickedImage) : pickedImage const connectionId = await getConnectionId() const imagePath = await saveMobileClipboardImageAsTempFile(client, picked.base64, { connectionId, diff --git a/mobile/src/files/attachments/mobile-image-base64-accumulator.test.ts b/mobile/src/files/attachments/mobile-image-base64-accumulator.test.ts index 14cfdeca4ac..efe0cfff696 100644 --- a/mobile/src/files/attachments/mobile-image-base64-accumulator.test.ts +++ b/mobile/src/files/attachments/mobile-image-base64-accumulator.test.ts @@ -7,15 +7,6 @@ function decodeBase64(data: string): Uint8Array { } describe('MobileImageBase64Accumulator', () => { - it('preserves bytes split across non-aligned source chunks', () => { - const accumulator = new MobileImageBase64Accumulator() - accumulator.append(new Uint8Array([1])) - accumulator.append(new Uint8Array([2, 3])) - accumulator.append(new Uint8Array([4, 5])) - - expect(accumulator.finish()).toBe('AQIDBAU=') - }) - it('preserves bytes across internal staging flushes', () => { const bytes = new Uint8Array(256 * 1024 + 7) bytes.forEach((_, index) => { diff --git a/mobile/src/files/attachments/mobile-image-source-picker.ts b/mobile/src/files/attachments/mobile-image-source-picker.ts index 14500f76c36..1df1e6f7175 100644 --- a/mobile/src/files/attachments/mobile-image-source-picker.ts +++ b/mobile/src/files/attachments/mobile-image-source-picker.ts @@ -1,6 +1,7 @@ import * as DocumentPicker from 'expo-document-picker' import { File as FsFile } from 'expo-file-system' import * as ImagePicker from 'expo-image-picker' +import { Platform } from 'react-native' import { CLIPBOARD_IMAGE_MAX_SOURCE_BYTES, assertClipboardImageBase64LengthWithinLimit, @@ -14,6 +15,17 @@ import type { MobileImageSource, PickedMobileImage } from '../../platform/media- const MOBILE_IMAGE_READ_CHUNK_BYTES = 256 * 1024 +/** Library picks that agents and the page's canvas can read: HEIC arrives as JPEG on both platforms. */ +export function agentReadableLibraryImageOptions(): ImagePicker.ImagePickerOptions { + return { + // Android hands back HEIC as-is at quality 1, which its WebView can't decode; below 1 it re-encodes to JPEG. + quality: Platform.OS === 'android' ? 0.99 : 1, + // iOS otherwise hands back HEIC as-is, which agents can't read; Compatible gives JPEG. + preferredAssetRepresentationMode: + ImagePicker.UIImagePickerPreferredAssetRepresentationMode.Compatible + } +} + type MobileImageFileHandle = { readonly size: number | null readBytesSync(length: number): Uint8Array @@ -87,10 +99,7 @@ async function* pickFromLibrary( base64: false, allowsMultipleSelection: multiple, ...(multiple ? { selectionLimit: 0, orderedSelection: true } : {}), - quality: 1, - // iOS otherwise hands back HEIC as-is, which agents can't read; Compatible gives JPEG. - preferredAssetRepresentationMode: - ImagePicker.UIImagePickerPreferredAssetRepresentationMode.Compatible + ...agentReadableLibraryImageOptions() }) if (result.canceled) { return diff --git a/mobile/src/files/attachments/use-mobile-image-attachment.ts b/mobile/src/files/attachments/use-mobile-image-attachment.ts index fe8648ef372..450a50e4975 100644 --- a/mobile/src/files/attachments/use-mobile-image-attachment.ts +++ b/mobile/src/files/attachments/use-mobile-image-attachment.ts @@ -8,6 +8,7 @@ import { type MobileImageSource } from '../../platform/media-picker-contract' import { attachMobileImageToTerminal } from './mobile-image-attachment' +import { fitMobileAgentImage } from './mobile-agent-image-fit' type CurrentRef = { readonly current: T @@ -68,6 +69,7 @@ export function useMobileImageAttachment({ getConnectionId: getActiveWorktreeConnectionId, pickImage: picker.pickImage, onUploadStart: () => setIsAttaching(true), + fitImage: fitMobileAgentImage, beforeTerminalSend }) if (sent) { diff --git a/mobile/src/files/mobile-file-path-route-encoding.test.ts b/mobile/src/files/mobile-file-path-route-encoding.test.ts deleted file mode 100644 index 08819e37998..00000000000 --- a/mobile/src/files/mobile-file-path-route-encoding.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { BRIDGE_ROUTE_HREF_PATTERN } from '../mobile-web-shell/bridge/bridge-caps' - -import { stringifyRouteHref } from '../navigation/route-href' -import { createMobileFilePreviewHref } from './mobile-file-preview-route' - -const HAZARD_PATHS = [ - 'src/my file.ts', - 'a%2Fb.ts', - 'a#b.ts', - 'a+b.ts', - 'a&b.ts', - 'a\nb.ts', - 'docs/readme.md', - '../etc/passwd', - 'docs/日本語.md', - '/logs/run.txt', - 'a=b.ts', - 'a%b.ts' -] - -function relativePathFromHref(href: string): string | null { - const query = href.slice(href.indexOf('?') + 1) - return new URLSearchParams(query).get('relativePath') -} - -describe.each(HAZARD_PATHS)('a file path the route carries: %s', (relativePath) => { - it('survives the href the page would hand back to the shell', () => { - const href = stringifyRouteHref( - createMobileFilePreviewHref({ - hostId: 'host-1', - worktreeId: 'wt-1', - relativePath, - source: 'worktree' - }) - ) - expect(BRIDGE_ROUTE_HREF_PATTERN.test(href)).toBe(true) - expect(relativePathFromHref(href)).toBe(relativePath) - }) -}) diff --git a/mobile/src/files/session-documents/use-mobile-session-markdown-actions.ts b/mobile/src/files/session-documents/use-mobile-session-markdown-actions.ts index ac139204736..41502a7ba5e 100644 --- a/mobile/src/files/session-documents/use-mobile-session-markdown-actions.ts +++ b/mobile/src/files/session-documents/use-mobile-session-markdown-actions.ts @@ -19,6 +19,7 @@ export type MobileSessionMarkdownActionsScope = Pick< | 'hostId' | 'worktreeId' | 'router' + | 'standalone' | 'client' | 'sessionTabs' | 'setMarkdownDocs' @@ -39,6 +40,7 @@ export function useMobileSessionMarkdownActions(scope: MobileSessionMarkdownActi hostId, worktreeId, router, + standalone, client, sessionTabs, setMarkdownDocs, @@ -124,13 +126,14 @@ export function useMobileSessionMarkdownActions(scope: MobileSessionMarkdownActi }, [markdownDocs, sessionTabs, t]) const leaveSession = useCallback(() => { - if (router.canGoBack()) { + // A standalone session has no list beneath; the page's Back hands the exit to the shell. + if (router.canGoBack() || standalone) { router.back() return } // Why: Android back can fire at the root route; replace avoids React Navigation's dev-only GO_BACK warning. router.replace(`/h/${hostId}`) - }, [hostId, router]) + }, [hostId, router, standalone]) // The sheet's Copy and Discard both settle the phone's drafts, so none is offered back next time. const leaveSessionDroppingDrafts = useCallback( diff --git a/mobile/src/host-catalog/host-removal-lifecycle.ts b/mobile/src/host-catalog/host-removal-lifecycle.ts index 29e05398f23..df0ce07c200 100644 --- a/mobile/src/host-catalog/host-removal-lifecycle.ts +++ b/mobile/src/host-catalog/host-removal-lifecycle.ts @@ -1,4 +1,5 @@ import type { QueryClient } from '@tanstack/react-query' +import { discardConnectionLogs } from '../diagnostics/connection/persisted-connection-log-store' import { wipeHostStore } from '../device-store/device-store' import { deleteHostPageCache, @@ -31,4 +32,5 @@ export async function removeHostAndCloseClient( void forgetHostUpdateFailures(hostId).catch(() => undefined) void deleteHostPageCache(hostId).catch(() => undefined) void wipeHostStore(hostId).catch(() => undefined) + void discardConnectionLogs(hostId).catch(() => undefined) } diff --git a/mobile/src/host-screen/host-sidebar-feed-sections.test.ts b/mobile/src/host-screen/host-sidebar-feed-sections.test.ts index 5e8f0f990f0..5d0cf70ce29 100644 --- a/mobile/src/host-screen/host-sidebar-feed-sections.test.ts +++ b/mobile/src/host-screen/host-sidebar-feed-sections.test.ts @@ -6,25 +6,19 @@ import { import { buildSidebarFeedCatalog } from '../../../src/shared/sidebar-list/sidebar-feed-catalog' import { buildHostFeedView } from './host-sidebar-feed-inputs' -import { buildHostFeedSections, buildPreFeedSections } from './host-sidebar-feed-sections' +import { buildHostFeedSections } from './host-sidebar-feed-sections' import { - FEED_ROWS, SERVED_SECTIONS, feedDomains, feedKey, feedRow, - liveRow, phoneView } from './host-sidebar-feed.test-fixture' import type { MobileViewState } from '../worktree/workspace-view-settings' import type { ProjectGroup } from '../../../src/shared/project-group-types' import { readServedProjectSections } from '../worktree/project-sections-operations' -import type { LastVisitedWorktreeOnHost } from '../worktree/host-list-highlight' -import type { WorktreeHostContextView } from '../worktree/workspace-list-types' import { NO_WORKTREE_HOST_CONTEXT } from '../worktree/worktree-host-context-labels' -const catalog = buildSidebarFeedCatalog(SERVED_SECTIONS, [], []) - function phoneFeedView( view: MobileViewState, showPinnedInGroups = false, @@ -38,42 +32,6 @@ function phoneFeedView( }) } -function sectionsFor( - view: MobileViewState, - options: { - showPinnedInGroups?: boolean - live?: ReturnType[] - /** Host context by worktree id, as the display pass looks it up. */ - hostContext?: ReadonlyMap - search?: string - lastVisited?: LastVisitedWorktreeOnHost | null - } = {} -) { - const built = buildSidebarFeedRows( - feedDomains(), - catalog, - phoneFeedView(view, options.showPinnedInGroups) - ) - return buildHostFeedSections({ - rows: built.sectionRows, - lastVisited: options.lastVisited ?? null, - liveRows: options.live ?? [], - hostContextOf: (row) => options.hostContext?.get(row.worktreeId), - repoHostIdByRepoId: new Map([['lab', 'ssh:gpu']]), - search: options.search ?? '' - }) -} - -function outline(sections: ReturnType): string[] { - return sections.flatMap((section) => [ - `${section.key} "${section.title}" ${String(section.count)}${section.icon ? ' pin' : ''}`, - ...section.data.map( - (row) => - ` ${row.view.sectionListKey} depth=${String(row.view.lineageDepth)}${row.row.isActive ? ' ACTIVE' : ''}` - ) - ]) -} - describe('the phone list from the sidebar feed', () => { it('files a grouped project under its group header, nested and in the group’s order', () => { const group = (id: string, name: string, extra: Partial = {}): ProjectGroup => ({ @@ -150,150 +108,4 @@ describe('the phone list from the sidebar feed', () => { ).toEqual([[[2, true]], [[2, true]]]) expect(sections.at(-2)?.data.map((row) => row.row.worktreeId)).toEqual(['lab::/w/gpu']) }) - - describe('the highlight: only the workspace this phone last opened, where shown', () => { - const active = (sections: ReturnType) => - outline(sections).filter((line) => line.endsWith(' ACTIVE')) - - it('never matches a desktop row for a visit on a server of the same id', () => { - const lastVisited = { worktreeId: 'orca::/w/child', executionHost: 'runtime:env-1' as const } - expect(active(sectionsFor(phoneView(), { lastVisited }))).toEqual([]) - }) - }) - - it('takes what the feed carries from the feed, over an older worktree.ps row', () => { - const feedChild = { - ...FEED_ROWS.child, - displayName: 'new name', - branch: 'new-branch', - comment: 'new note', - isUnread: true, - isPinned: true - } - const built = buildSidebarFeedRows( - feedDomains({ - workspaces: new Map([ - [feedKey('|orca::/w/parent'), FEED_ROWS.parent], - [feedKey('|orca::/w/child'), feedChild] - ]) - }), - catalog, - phoneFeedView(phoneView()) - ) - const stale = liveRow({ - worktreeId: 'orca::/w/child', - displayName: 'old name', - branch: 'old-branch', - comment: 'old note', - unread: false, - isPinned: false, - isArchived: true, - liveTerminalCount: 3 - }) - const sections = buildHostFeedSections({ - rows: built.sectionRows, - lastVisited: null, - liveRows: [stale], - hostContextOf: NO_WORKTREE_HOST_CONTEXT, - repoHostIdByRepoId: new Map(), - search: 'new name' - }) - expect(sections.flatMap((section) => section.data.map((item) => item.row))).toEqual([ - expect.objectContaining({ - worktreeId: 'orca::/w/child', - displayName: 'new name', - branch: 'new-branch', - comment: 'new note', - unread: true, - isPinned: true, - isArchived: false, - liveTerminalCount: 3 - }) - ]) - }) - - it('never draws one host’s live row under another host’s workspace of the same id', () => { - const sections = sectionsFor(phoneView(), { - live: [liveRow({ worktreeId: 'lab::/w/gpu', hostId: 'local', liveTerminalCount: 5 })] - }) - const remote = sections - .flatMap((section) => section.data) - .find((row) => row.row.worktreeId === 'lab::/w/gpu') - expect(remote?.row).toMatchObject({ hostId: 'ssh:gpu', liveTerminalCount: 0 }) - }) -}) - -describe('the phone list before the first feed read', () => { - const cached = [ - liveRow({ worktreeId: 'orca::/w/b', displayName: 'beta' }), - liveRow({ worktreeId: 'orca::/w/a', displayName: 'alpha' }), - liveRow({ worktreeId: 'orca::/w/old', displayName: 'old', isArchived: true }) - ] - const preFeedVisiting = ( - search: string, - rows: typeof cached, - lastVisited: LastVisitedWorktreeOnHost | null - ) => - buildPreFeedSections({ - rows, - hostContextOf: NO_WORKTREE_HOST_CONTEXT, - view: phoneView(), - search, - repoHostIdByRepoId: new Map(), - lastVisited - }) - - it('highlights the row this phone opened, never the one the desktop marked active', () => { - const rows = [{ ...cached[0]!, isActive: true }, cached[1]!] - const highlighted = (lastVisited: LastVisitedWorktreeOnHost | null) => - preFeedVisiting('', rows, lastVisited)[0] - ?.data.filter((row) => row.row.isActive) - .map((row) => row.row.worktreeId) - expect(highlighted(null)).toEqual([]) - expect(highlighted({ worktreeId: 'orca::/w/a' })).toEqual(['orca::/w/a']) - expect(highlighted({ worktreeId: 'orca::/w/gone' })).toEqual([]) - }) -}) - -describe('a header repeated in two host sections', () => { - it('gets a distinct list key in each section and one shared collapse key', () => { - const projectHeader = { - type: 'header' as const, - key: 'project:p', - label: 'P', - count: 0, - icon: { kind: 'project' as const } - } - const hostHeader = (hostId: 'local' | 'ssh:gpu') => ({ - type: 'host-header' as const, - key: `host:${hostId}`, - hostId, - kind: hostId === 'local' ? ('local' as const) : ('ssh' as const), - label: hostId, - detail: '', - health: 'available' as const, - collapsed: false, - count: 0 - }) - const sections = buildHostFeedSections({ - rows: [ - hostHeader('local'), - { ...projectHeader, hostId: 'local' }, - hostHeader('ssh:gpu'), - { ...projectHeader, hostId: 'ssh:gpu' } - ], - lastVisited: null, - liveRows: [], - hostContextOf: NO_WORKTREE_HOST_CONTEXT, - repoHostIdByRepoId: new Map(), - search: '' - }) - - expect(sections.map(({ key, collapseKey }) => [key, collapseKey ?? key])).toEqual([ - ['host:local', 'host:local'], - ['project:p@local', 'project:p'], - ['host:ssh:gpu', 'host:ssh:gpu'], - ['project:p@ssh:gpu', 'project:p'] - ]) - }) }) diff --git a/mobile/src/host-screen/host-sidebar-feed-sections.ts b/mobile/src/host-screen/host-sidebar-feed-sections.ts index 2c383682c8e..fcdf2861ab7 100644 --- a/mobile/src/host-screen/host-sidebar-feed-sections.ts +++ b/mobile/src/host-screen/host-sidebar-feed-sections.ts @@ -21,6 +21,7 @@ import { } from '../worktree/worktree-host-context-labels' import { filterWorktrees } from '../worktree/workspace-list-sections' import { rowFiltersForView, type MobileViewState } from '../worktree/workspace-view-settings' +import type { HiddenProjects } from '../../../src/shared/hidden-projects' export type HostFeedListSources = { rows: readonly HostSectionRow[] @@ -271,12 +272,15 @@ export function buildPreFeedSections(sources: { search: string repoHostIdByRepoId: ReadonlyMap lastVisited: LastVisitedWorktreeOnHost | null + /** The catalog's hidden projects; this fallback leaves them out as the feed's rows do. */ + hiddenProjects: HiddenProjects }): Section[] { const rows = filterWorktrees( sources.rows, rowFiltersForView(sources.view), sources.search, - sources.repoHostIdByRepoId + sources.repoHostIdByRepoId, + sources.hiddenProjects ).map((row) => ({ // Replaces worktree.ps's mark, which is the desktop's selection. row: { ...row, isActive: isLastVisitedWorktreeRow(row, sources.lastVisited) }, diff --git a/mobile/src/host-screen/use-host-list-sections.ts b/mobile/src/host-screen/use-host-list-sections.ts index 9eb690a93ac..96ca76f8333 100644 --- a/mobile/src/host-screen/use-host-list-sections.ts +++ b/mobile/src/host-screen/use-host-list-sections.ts @@ -18,6 +18,8 @@ import { buildHostFeedSections, buildPreFeedSections } from './host-sidebar-feed import { useHostRepoIconDataUrls } from './use-host-repo-icon-data-urls' import type { HostSidebarFeed } from './use-host-sidebar-feed' import type { HostScreenState } from './use-host-screen-state' +import { indexHiddenProjects } from '../../../src/shared/hidden-projects' +import { LOCAL_EXECUTION_HOST_ID } from '../../../src/shared/execution-host' export type HostListSectionsInputs = { client: RpcClient | null @@ -160,12 +162,14 @@ function useFeedHostListSections({ view: state.view, search: state.search, repoHostIdByRepoId: state.repoHostIdByRepoId, - lastVisited + lastVisited, + hiddenProjects: indexHiddenProjects(catalog.repos, LOCAL_EXECUTION_HOST_ID) }) : NO_SECTIONS, [ built, preFeed, + catalog, displayWorktrees, hostContextOf, state.view, diff --git a/mobile/src/i18n/en-runtime-required.json b/mobile/src/i18n/en-runtime-required.json index ff6c952994d..0e32408735c 100644 --- a/mobile/src/i18n/en-runtime-required.json +++ b/mobile/src/i18n/en-runtime-required.json @@ -73,6 +73,13 @@ "notice": { "modelFallback": "Claude switched models: {{from}} → {{to}}." }, + "queuedMessages": { + "moreCount_one": "{{count}} more", + "moreCount_other": "{{count}} more", + "queuedCount_one": "{{count}} queued message", + "queuedCount_other": "{{count}} queued messages", + "foldNeedsAttention": "{{more}}, a message needs attention" + }, "subagentGroup": { "ran_one": "Ran {{count}} subagent", "ran_other": "Ran {{count}} subagents", diff --git a/mobile/src/i18n/locales/de.json b/mobile/src/i18n/locales/de.json index 3cf6847e407..080ef99262d 100644 --- a/mobile/src/i18n/locales/de.json +++ b/mobile/src/i18n/locales/de.json @@ -356,8 +356,7 @@ "pausedState": "Pausiert", "queuedState": "In der Warteschlange", "resume": "Fortsetzen", - "resumeSending": "Senden der Nachrichten in der Warteschlange fortsetzen", - "title": "Nachrichten in der Warteschlange" + "resumeSending": "Senden der Nachrichten in der Warteschlange fortsetzen" }, "offlineQueue": { "failed": "Nicht gesendet – zum erneuten Versuch auf Senden tippen", @@ -2321,20 +2320,16 @@ "loadFailed": "Pull Request konnte nicht geladen werden" }, "queuedCardText": { - "showLess": "Weniger anzeigen", "showLessHint": "Zeigt weniger von der Nachricht an", - "showMore": "Mehr anzeigen", "showMoreHint": "Zeigt die ganze Nachricht an" }, "queuedMessageCardRow": { - "deleteHint": "Diese Nachricht aus der Warteschlange löschen", "images_one": "{{count}} Bild", "images_other": "{{count}} Bilder", "moreActions": "Weitere Aktionen", "send": "Senden", "sendAgainHint": "Diese Nachricht erneut senden", "sendHint": "Diese Nachricht senden", - "showLessHint": "Zeigt weniger von der Nachricht an", "steer": "Steuern", "steerHint": "Ohne Unterbrechung des Modells übermitteln" }, diff --git a/mobile/src/i18n/locales/en.json b/mobile/src/i18n/locales/en.json index 46dc3c90822..4147e76f1cc 100644 --- a/mobile/src/i18n/locales/en.json +++ b/mobile/src/i18n/locales/en.json @@ -2056,9 +2056,7 @@ }, "queuedCardText": { "showLessHint": "Shows less of the message", - "showMoreHint": "Shows the whole message", - "showLess": "Show less", - "showMore": "Show more" + "showMoreHint": "Shows the whole message" }, "queuedMessageCardRow": { "images_one": "{{count}} image", @@ -2068,9 +2066,8 @@ "sendHint": "Send this message", "steer": "Steer", "send": "Send", - "deleteHint": "Delete this queued message", "moreActions": "More actions", - "showLessHint": "Shows less of the message" + "you": "You" }, "queuedMessageComposer": { "commandsNotAllowed": "Commands can't be saved in a queued message.", @@ -3027,10 +3024,16 @@ "clearAll": "Clear all", "resumeSending": "Resume sending the queued messages", "resume": "Resume", - "title": "Queued messages", "pausedState": "Paused", "queuedState": "Queued", - "editMessage": "Edit message" + "editMessage": "Edit message", + "showLess": "Show less", + "moreCount_one": "{{count}} more", + "moreCount_other": "{{count}} more", + "deleteMessage": "Delete message", + "queuedCount_one": "{{count}} queued message", + "queuedCount_other": "{{count}} queued messages", + "foldNeedsAttention": "{{more}}, a message needs attention" }, "offlineQueue": { "failed": "Couldn't send — tap Send to retry", diff --git a/mobile/src/i18n/locales/es.json b/mobile/src/i18n/locales/es.json index fa5c23917d0..9ae48aea8df 100644 --- a/mobile/src/i18n/locales/es.json +++ b/mobile/src/i18n/locales/es.json @@ -360,8 +360,7 @@ "pausedState": "En pausa", "queuedState": "En cola", "resume": "Reanudar", - "resumeSending": "Reanudar el envío de los mensajes en cola", - "title": "Mensajes en cola" + "resumeSending": "Reanudar el envío de los mensajes en cola" }, "offlineQueue": { "failed": "No se pudo enviar: toca Enviar para reintentar", @@ -2390,13 +2389,10 @@ "loadFailed": "No se pudo cargar la pull request" }, "queuedCardText": { - "showLess": "Mostrar menos", "showLessHint": "Muestra menos contenido del mensaje", - "showMore": "Mostrar más", "showMoreHint": "Muestra el mensaje completo" }, "queuedMessageCardRow": { - "deleteHint": "Eliminar este mensaje en cola", "images_many": "{{count}} imágenes", "images_one": "{{count}} imagen", "images_other": "{{count}} imágenes", @@ -2404,7 +2400,6 @@ "send": "Enviar", "sendAgainHint": "Volver a enviar este mensaje", "sendHint": "Enviar este mensaje", - "showLessHint": "Muestra menos contenido del mensaje", "steer": "Enviar ahora", "steerHint": "Enviar sin interrumpir al modelo" }, diff --git a/mobile/src/i18n/locales/fr.json b/mobile/src/i18n/locales/fr.json index 55fb33e0a87..eea40512fb7 100644 --- a/mobile/src/i18n/locales/fr.json +++ b/mobile/src/i18n/locales/fr.json @@ -360,8 +360,7 @@ "pausedState": "En pause", "queuedState": "En file d'attente", "resume": "Reprendre", - "resumeSending": "Reprendre l'envoi des messages en file d'attente", - "title": "Messages en file d'attente" + "resumeSending": "Reprendre l'envoi des messages en file d'attente" }, "offlineQueue": { "failed": "Échec de l'envoi — touchez Envoyer pour réessayer", @@ -2390,13 +2389,10 @@ "loadFailed": "Impossible de charger la pull request" }, "queuedCardText": { - "showLess": "Afficher moins", "showLessHint": "Affiche une version abrégée du message", - "showMore": "Afficher plus", "showMoreHint": "Affiche le message entier" }, "queuedMessageCardRow": { - "deleteHint": "Supprimer ce message en attente", "images_many": "{{count}} images", "images_one": "{{count}} image", "images_other": "{{count}} images", @@ -2404,7 +2400,6 @@ "send": "Envoyer", "sendAgainHint": "Renvoyer ce message", "sendHint": "Envoyer ce message", - "showLessHint": "Affiche une version abrégée du message", "steer": "Envoyer maintenant", "steerHint": "Envoyer sans interrompre le modèle" }, diff --git a/mobile/src/i18n/locales/ja.json b/mobile/src/i18n/locales/ja.json index 43702cfb068..36f4c2aff3b 100644 --- a/mobile/src/i18n/locales/ja.json +++ b/mobile/src/i18n/locales/ja.json @@ -356,8 +356,7 @@ "pausedState": "一時停止中", "queuedState": "キュー待ち", "resume": "再開", - "resumeSending": "キュー内のメッセージの送信を再開", - "title": "キュー内のメッセージ" + "resumeSending": "キュー内のメッセージの送信を再開" }, "offlineQueue": { "failed": "送信できませんでした — 「送信」をタップして再試行", @@ -2317,20 +2316,16 @@ "loadFailed": "PR を読み込めませんでした。" }, "queuedCardText": { - "showLess": "折りたたむ", "showLessHint": "メッセージを折りたたんで表示します。", - "showMore": "さらに表示", "showMoreHint": "メッセージ全体を表示します。" }, "queuedMessageCardRow": { - "deleteHint": "キュー内のこのメッセージを削除", "images_one": "画像 {{count}} 枚", "images_other": "画像 {{count}} 枚", "moreActions": "その他の操作", "send": "送信", "sendAgainHint": "このメッセージを再送信", "sendHint": "このメッセージを送信", - "showLessHint": "メッセージを折りたたんで表示します。", "steer": "今すぐ送信", "steerHint": "モデルを中断せずに送信します" }, diff --git a/mobile/src/i18n/locales/ko.json b/mobile/src/i18n/locales/ko.json index 508bae80ba0..3b478623298 100644 --- a/mobile/src/i18n/locales/ko.json +++ b/mobile/src/i18n/locales/ko.json @@ -356,8 +356,7 @@ "pausedState": "일시 중지됨", "queuedState": "대기 중", "resume": "재개", - "resumeSending": "대기 중인 메시지 전송 재개", - "title": "대기 중인 메시지" + "resumeSending": "대기 중인 메시지 전송 재개" }, "offlineQueue": { "failed": "보내지 못했습니다 — 보내기를 탭해 다시 시도하세요", @@ -2317,20 +2316,16 @@ "loadFailed": "PR을 로드할 수 없습니다." }, "queuedCardText": { - "showLess": "접기", "showLessHint": "메시지의 일부만 표시합니다.", - "showMore": "더 보기", "showMoreHint": "메시지 전체를 표시합니다." }, "queuedMessageCardRow": { - "deleteHint": "대기 중인 메시지 삭제", "images_one": "이미지 {{count}}개", "images_other": "이미지 {{count}}개", "moreActions": "추가 작업", "send": "보내기", "sendAgainHint": "이 메시지 다시 보내기", "sendHint": "이 메시지 보내기", - "showLessHint": "메시지의 일부만 표시합니다.", "steer": "지금 보내기", "steerHint": "모델을 중단하지 않고 보냅니다" }, diff --git a/mobile/src/i18n/locales/pt.json b/mobile/src/i18n/locales/pt.json index faf7f8cc7ea..d7f11c1a401 100644 --- a/mobile/src/i18n/locales/pt.json +++ b/mobile/src/i18n/locales/pt.json @@ -378,8 +378,7 @@ "pausedState": "Pausado", "queuedState": "Na fila", "resume": "Retomar", - "resumeSending": "Retomar o envio das mensagens na fila", - "title": "Mensagens na fila" + "resumeSending": "Retomar o envio das mensagens na fila" }, "offlineQueue": { "failed": "Não foi possível enviar — toque em Enviar para tentar de novo", @@ -1716,7 +1715,6 @@ "desktops": { "pairDesktop": "Emparelhe um computador" }, - "jumpBackIn": {}, "sections": { "tasks": "Tarefas", "tasksSubtitle": "Explore suas issues e revisões" @@ -2763,13 +2761,10 @@ "loadFailed": "Não foi possível carregar o pull request" }, "queuedCardText": { - "showLess": "Mostrar menos", "showLessHint": "Mostra menos conteúdo da mensagem", - "showMore": "Mostrar mais", "showMoreHint": "Mostra a mensagem inteira" }, "queuedMessageCardRow": { - "deleteHint": "Excluir esta mensagem da fila", "images_many": "{{count}} imagens", "images_one": "{{count}} imagem", "images_other": "{{count}} imagens", @@ -2777,7 +2772,6 @@ "send": "Enviar", "sendAgainHint": "Enviar esta mensagem novamente", "sendHint": "Enviar esta mensagem", - "showLessHint": "Mostra menos conteúdo da mensagem", "steer": "Orientar", "steerHint": "Enviar sem interromper o modelo" }, diff --git a/mobile/src/i18n/locales/ru.json b/mobile/src/i18n/locales/ru.json index 9025fa32b48..a48953f4f52 100644 --- a/mobile/src/i18n/locales/ru.json +++ b/mobile/src/i18n/locales/ru.json @@ -364,8 +364,7 @@ "pausedState": "Приостановлено", "queuedState": "В очереди", "resume": "Продолжить", - "resumeSending": "Возобновить отправку сообщений из очереди", - "title": "Очередь сообщений" + "resumeSending": "Возобновить отправку сообщений из очереди" }, "offlineQueue": { "failed": "Не отправлено — нажмите «Отправить», чтобы повторить", @@ -2459,13 +2458,10 @@ "loadFailed": "Не удалось загрузить пул-реквест" }, "queuedCardText": { - "showLess": "Свернуть", "showLessHint": "Сворачивает сообщение", - "showMore": "Показать больше", "showMoreHint": "Показывает сообщение целиком" }, "queuedMessageCardRow": { - "deleteHint": "Удалить это сообщение из очереди", "images_few": "{{count}} изображения", "images_many": "{{count}} изображений", "images_one": "{{count}} изображение", @@ -2474,7 +2470,6 @@ "send": "Отправить", "sendAgainHint": "Отправить это сообщение ещё раз", "sendHint": "Отправить это сообщение", - "showLessHint": "Сворачивает сообщение", "steer": "Сейчас", "steerHint": "Отправить сообщение, не прерывая работу модели" }, diff --git a/mobile/src/i18n/locales/tr.json b/mobile/src/i18n/locales/tr.json index fd01e212a54..3986dd06aff 100644 --- a/mobile/src/i18n/locales/tr.json +++ b/mobile/src/i18n/locales/tr.json @@ -356,8 +356,7 @@ "pausedState": "Duraklatıldı", "queuedState": "Sıraya alındı", "resume": "Devam ettir", - "resumeSending": "Kuyruktaki mesajları göndermeye devam et", - "title": "Kuyruktaki mesajlar" + "resumeSending": "Kuyruktaki mesajları göndermeye devam et" }, "offlineQueue": { "failed": "Gönderilemedi — yeniden denemek için Gönder'e dokunun", @@ -2321,20 +2320,16 @@ "loadFailed": "Pull request yüklenemedi" }, "queuedCardText": { - "showLess": "Daha az göster", "showLessHint": "Mesajın daha azını gösterir", - "showMore": "Daha fazla göster", "showMoreHint": "Mesajın tamamını gösterir" }, "queuedMessageCardRow": { - "deleteHint": "Sıraya alınmış bu mesajı sil", "images_one": "{{count}} görsel", "images_other": "{{count}} görsel", "moreActions": "Diğer işlemler", "send": "Gönder", "sendAgainHint": "Bu mesajı yeniden gönder", "sendHint": "Bu mesajı gönder", - "showLessHint": "Mesajın daha azını gösterir", "steer": "Yönlendir", "steerHint": "Modeli kesintiye uğratmadan gönder" }, diff --git a/mobile/src/i18n/locales/zh-Hant.json b/mobile/src/i18n/locales/zh-Hant.json index 23df25ab951..5d5a9d41f7b 100644 --- a/mobile/src/i18n/locales/zh-Hant.json +++ b/mobile/src/i18n/locales/zh-Hant.json @@ -356,8 +356,7 @@ "pausedState": "已暫停", "queuedState": "已排隊", "resume": "繼續", - "resumeSending": "繼續傳送排隊的訊息", - "title": "排隊的訊息" + "resumeSending": "繼續傳送排隊的訊息" }, "offlineQueue": { "failed": "無法傳送 — 點按「傳送」重試", @@ -2317,20 +2316,16 @@ "loadFailed": "無法載入 PR" }, "queuedCardText": { - "showLess": "收合", "showLessHint": "顯示較少訊息內容", - "showMore": "顯示更多", "showMoreHint": "顯示完整訊息" }, "queuedMessageCardRow": { - "deleteHint": "刪除這則排隊中的訊息", "images_one": "{{count}} 張圖片", "images_other": "{{count}} 張圖片", "moreActions": "更多操作", "send": "傳送", "sendAgainHint": "再次傳送此訊息", "sendHint": "傳送此訊息", - "showLessHint": "顯示較少訊息內容", "steer": "引導", "steerHint": "提交且不中斷模型" }, diff --git a/mobile/src/i18n/locales/zh.json b/mobile/src/i18n/locales/zh.json index 1788567f012..99baccd066a 100644 --- a/mobile/src/i18n/locales/zh.json +++ b/mobile/src/i18n/locales/zh.json @@ -356,8 +356,7 @@ "pausedState": "已暂停", "queuedState": "已排队", "resume": "继续", - "resumeSending": "继续发送排队的消息", - "title": "排队的消息" + "resumeSending": "继续发送排队的消息" }, "offlineQueue": { "failed": "无法发送 — 点按“发送”重试", @@ -2323,20 +2322,16 @@ "loadFailed": "无法加载 PR" }, "queuedCardText": { - "showLess": "收起", "showLessHint": "收起消息的部分内容", - "showMore": "显示更多", "showMoreHint": "显示完整消息" }, "queuedMessageCardRow": { - "deleteHint": "删除队列中的这条消息", "images_one": "{{count}} 张图片", "images_other": "{{count}} 张图片", "moreActions": "更多操作", "send": "发送", "sendAgainHint": "再次发送此消息", "sendHint": "发送此消息", - "showLessHint": "收起消息的部分内容", "steer": "立即发送", "steerHint": "提交且不中断模型" }, diff --git a/mobile/src/i18n/mobile-i18n.test.ts b/mobile/src/i18n/mobile-i18n.test.ts index 08e08089f53..5f59287345b 100644 --- a/mobile/src/i18n/mobile-i18n.test.ts +++ b/mobile/src/i18n/mobile-i18n.test.ts @@ -32,12 +32,4 @@ describe('activateMobileUiLocale', () => { expect(mobileI18n.language).toBe('ja') expect(translate('greeting', 'Hello')).toBe('こんにちは') }) - - it('falls back to English when a catalog cannot load', async () => { - failing.add('de') - vi.spyOn(console, 'warn').mockImplementation(() => {}) - await activateMobileUiLocale('de') - expect(getMobileUiLocale()).toBe('en') - expect(translate('greeting', 'Hello')).toBe('Hello') - }) }) diff --git a/mobile/src/mobile-web-shell/MobileWebShellScreen.tsx b/mobile/src/mobile-web-shell/MobileWebShellScreen.tsx index 11e05d21660..e9aacdff0a8 100644 --- a/mobile/src/mobile-web-shell/MobileWebShellScreen.tsx +++ b/mobile/src/mobile-web-shell/MobileWebShellScreen.tsx @@ -37,6 +37,7 @@ import { useShellPageStorageRefresh } from './use-shell-page-storage-refresh' import { usePageHostSnapshot } from './use-page-host-snapshot' import { useReportedHostAreaServing } from './host-area-serving' import { isHostRouteOf } from './page-route-policy' +import { isStandaloneSessionHref } from '../navigation/host-stack-navigation' import { nativeStackReturn } from './native-stack-return' import { useResponsiveLayout } from '../layout/responsive-layout' import { storageReadParamsSchema, type BridgeNativeVerb } from './bridge/bridge-native-verbs' @@ -188,7 +189,10 @@ export function MobileWebShellScreen({ router.dismissTo(href) return } - return void (replace ? router.replace(href) : router.push(href)) + // A standalone session takes the host list's place, so Back leaves the host. + return void (replace || isStandaloneSessionHref(href) + ? router.replace(href) + : router.push(href)) } const openTarget = usePageOpenTarget({ route, diff --git a/mobile/src/mobile-web-shell/bridge-host-requests.ts b/mobile/src/mobile-web-shell/bridge-host-requests.ts index 24984412811..9bb367d223a 100644 --- a/mobile/src/mobile-web-shell/bridge-host-requests.ts +++ b/mobile/src/mobile-web-shell/bridge-host-requests.ts @@ -1,4 +1,4 @@ -import { classifyExactGitHubOperation } from '../../../src/shared/github/exact-work-item-operation' +import { classifyExactGitHubOperation } from '../../../src/shared/github/work-items/exact-work-item-operation' import { captureGitHubInvocation, GITHUB_TARGET_CHECK_TIMED_OUT, diff --git a/mobile/src/mobile-web-shell/bridge/bridge-caps.test.ts b/mobile/src/mobile-web-shell/bridge/bridge-caps.test.ts deleted file mode 100644 index 229f012ea4f..00000000000 --- a/mobile/src/mobile-web-shell/bridge/bridge-caps.test.ts +++ /dev/null @@ -1,234 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - BRIDGE_MAX_DEPTH, - BRIDGE_MAX_EXTERNAL_LINK_CHARS, - BRIDGE_MAX_MESSAGE_BYTES, - BRIDGE_MAX_NODES, - isBridgeExternalLinkUrl, - readBridgeExternalLinkUrl, - parseBridgeMessage, - utf8ByteLength -} from './bridge-caps' - -function jsonStringOfBytes(bytes: number): string { - return `"${'x'.repeat(bytes - 2)}"` -} - -function nestedArrays(levels: number): string { - return `${'['.repeat(levels - 1)}0${']'.repeat(levels - 1)}` -} - -function arrayOfNodes(nodes: number): string { - return `[${Array.from({ length: nodes - 1 }, () => '0').join(',')}]` -} - -describe('utf8ByteLength', () => { - it('agrees with TextEncoder across the encoding widths', () => { - const encoder = new TextEncoder() - for (const sample of ['', 'plain ascii', 'é', 'ünïcodé', '中文', '😀', 'a😀b中é']) { - expect(utf8ByteLength(sample)).toBe(encoder.encode(sample).length) - } - }) - - it('counts a lone surrogate as its replacement, like TextEncoder does', () => { - const loneHigh = '\ud83d' - const loneLow = '\ude00' - expect(utf8ByteLength(loneHigh)).toBe(new TextEncoder().encode(loneHigh).length) - expect(utf8ByteLength(`a${loneLow}b`)).toBe(new TextEncoder().encode(`a${loneLow}b`).length) - }) - - it('counts a surrogate pair once, not twice', () => { - expect(utf8ByteLength('😀')).toBe(4) - expect(utf8ByteLength('😀😀')).toBe(8) - }) -}) - -function listingReply(rows: number): string { - const records = Array.from({ length: rows }, (_, index) => ({ - id: index, - name: `worktree-${index}`, - branch: 'main', - dirty: false - })) - return JSON.stringify({ - v: 1, - type: 'reply', - id: 'a'.repeat(22), - payload: { ok: true, result: records } - }) -} - -describe('parseBridgeMessage byte cap', () => { - it('accepts a frame of exactly the cap', () => { - const raw = jsonStringOfBytes(BRIDGE_MAX_MESSAGE_BYTES) - expect(utf8ByteLength(raw)).toBe(BRIDGE_MAX_MESSAGE_BYTES) - expect(parseBridgeMessage(raw, 'page-to-shell').ok).toBe(true) - }) - - it('refuses a frame one byte over the cap', () => { - const raw = jsonStringOfBytes(BRIDGE_MAX_MESSAGE_BYTES + 1) - expect(parseBridgeMessage(raw, 'page-to-shell')).toEqual({ ok: false, refusal: 'oversized' }) - }) - - it('measures bytes, not code units, so multi-byte text cannot slip past', () => { - // Half the cap in code units, every one of them two bytes: under the length guard, over the cap. - const body = 'é'.repeat(BRIDGE_MAX_MESSAGE_BYTES / 2) - const raw = `"${body}"` - expect(raw.length).toBeLessThan(BRIDGE_MAX_MESSAGE_BYTES) - expect(parseBridgeMessage(raw, 'page-to-shell')).toEqual({ ok: false, refusal: 'oversized' }) - }) -}) - -describe('parseBridgeMessage document caps', () => { - it('refuses text that is not JSON', () => { - expect(parseBridgeMessage('{', 'page-to-shell')).toEqual({ - ok: false, - refusal: 'malformed-json' - }) - expect(parseBridgeMessage('', 'page-to-shell')).toEqual({ - ok: false, - refusal: 'malformed-json' - }) - }) - - it('accepts nesting of exactly the depth cap', () => { - expect(parseBridgeMessage(nestedArrays(BRIDGE_MAX_DEPTH), 'page-to-shell').ok).toBe(true) - }) - - it('refuses nesting one level past the depth cap', () => { - expect(parseBridgeMessage(nestedArrays(BRIDGE_MAX_DEPTH + 1), 'page-to-shell')).toEqual({ - ok: false, - refusal: 'too-deep' - }) - }) - - it('counts object nesting the same as array nesting', () => { - const deep = `${'{"a":'.repeat(BRIDGE_MAX_DEPTH)}0${'}'.repeat(BRIDGE_MAX_DEPTH)}` - expect(parseBridgeMessage(deep, 'page-to-shell')).toEqual({ ok: false, refusal: 'too-deep' }) - }) - - it('accepts exactly the node cap', () => { - expect(parseBridgeMessage(arrayOfNodes(BRIDGE_MAX_NODES), 'page-to-shell').ok).toBe(true) - }) - - it('refuses one node past the cap', () => { - expect(parseBridgeMessage(arrayOfNodes(BRIDGE_MAX_NODES + 1), 'page-to-shell')).toEqual({ - ok: false, - refusal: 'too-many-nodes' - }) - }) - - it('counts object values as nodes too', () => { - const entries = Array.from({ length: BRIDGE_MAX_NODES }, (_, index) => `"k${index}":0`) - expect(parseBridgeMessage(`{${entries.join(',')}}`, 'page-to-shell')).toEqual({ - ok: false, - refusal: 'too-many-nodes' - }) - }) - - it('returns the parsed document when every cap holds', () => { - expect(parseBridgeMessage('{"v":1,"type":"ready"}', 'page-to-shell')).toEqual({ - ok: true, - message: { v: 1, type: 'ready' } - }) - }) -}) - -describe('parseBridgeMessage direction', () => { - it('lets a reply past the node cap through, and refuses the same document from the page', () => { - const raw = listingReply(5_000) - expect(utf8ByteLength(raw)).toBeLessThan(BRIDGE_MAX_MESSAGE_BYTES) - expect(parseBridgeMessage(raw, 'page-to-shell')).toEqual({ - ok: false, - refusal: 'too-many-nodes' - }) - expect(parseBridgeMessage(raw, 'shell-to-page').ok).toBe(true) - }) - - it('lets a reply nest past the depth cap, and refuses the same nesting from the page', () => { - const raw = nestedArrays(BRIDGE_MAX_DEPTH + 1) - expect(parseBridgeMessage(raw, 'shell-to-page').ok).toBe(true) - expect(parseBridgeMessage(raw, 'page-to-shell')).toEqual({ ok: false, refusal: 'too-deep' }) - }) - - it('holds a reply to the frame byte cap all the same', () => { - expect( - parseBridgeMessage(jsonStringOfBytes(BRIDGE_MAX_MESSAGE_BYTES), 'shell-to-page').ok - ).toBe(true) - expect( - parseBridgeMessage(jsonStringOfBytes(BRIDGE_MAX_MESSAGE_BYTES + 1), 'shell-to-page') - ).toEqual({ - ok: false, - refusal: 'oversized' - }) - }) - - it('holds a reply to being JSON at all', () => { - expect(parseBridgeMessage('{', 'shell-to-page')).toEqual({ - ok: false, - refusal: 'malformed-json' - }) - }) -}) - -// Use the shared URL parser rule at both page call and shell envelope; an allowlisted absolute scheme is required before device dispatch. -describe('the URLs a page may hand to the shell', () => { - it('takes the three schemes a task source produces, on any host and any path', () => { - for (const url of [ - 'https://github.com/stablyai/orca/pull/1', - 'http://localhost:3000/x?y=1#z', - 'mailto:someone@example.com?subject=hi', - 'https://user:pass@example.com/a%20b' - ]) { - expect(isBridgeExternalLinkUrl(url), url).toBe(true) - } - }) - - it('refuses every other scheme, including one hiding an allowed word', () => { - for (const url of [ - 'javascript:alert("https://example.com")', - 'file:///etc/passwd', - 'data:text/html,', - 'intent://scan/#Intent;scheme=zxing;end', - 'orca-mobile-web://session/x', - 'ftp://example.com/f' - ]) { - expect(isBridgeExternalLinkUrl(url), url).toBe(false) - } - }) - - it('refuses a target that is not an absolute URL at all', () => { - for (const url of ['', '/h/host-a/tasks', '//example.com', 'example.com', 'https://']) { - expect(isBridgeExternalLinkUrl(url), url).toBe(false) - } - }) - - it('holds the URL to the same cap a route href gets', () => { - const under = `https://example.com/${'a'.repeat(BRIDGE_MAX_EXTERNAL_LINK_CHARS - 20)}` - expect(under).toHaveLength(BRIDGE_MAX_EXTERNAL_LINK_CHARS) - expect(isBridgeExternalLinkUrl(under)).toBe(true) - expect(isBridgeExternalLinkUrl(`${under}a`)).toBe(false) - }) -}) - -// Forward normalized hrefs: WHATWG strips controls and trims spaces, while valid bare origins gain a slash. Rejecting every changed spelling would reject ordinary URLs. -describe('the URL that actually crosses', () => { - it('is the parsed href, for the four shapes that survive the scheme check unchanged', () => { - expect(readBridgeExternalLinkUrl('ht\ntps://example.com')).toBe('https://example.com/') - expect(readBridgeExternalLinkUrl('https://example.com/a\r\n')).toBe('https://example.com/a') - expect(readBridgeExternalLinkUrl(' https://example.com/a ')).toBe('https://example.com/a') - expect(readBridgeExternalLinkUrl('https:example.com')).toBe('https://example.com/') - }) - - it('takes an ordinary URL that differs from its own href, rather than refusing it', () => { - expect(readBridgeExternalLinkUrl('https://example.com')).toBe('https://example.com/') - }) - - it('holds the normalized form to the cap, not just the string it was handed', () => { - // Percent-encoding expands, so a raw string inside the cap can normalize past it. - const raw = `https://example.com/${'\u00e9'.repeat(BRIDGE_MAX_EXTERNAL_LINK_CHARS - 21)}` - expect(raw.length).toBeLessThanOrEqual(BRIDGE_MAX_EXTERNAL_LINK_CHARS) - expect(new URL(raw).href.length).toBeGreaterThan(BRIDGE_MAX_EXTERNAL_LINK_CHARS) - expect(readBridgeExternalLinkUrl(raw)).toBeNull() - }) -}) diff --git a/mobile/src/mobile-web-shell/media-handle-registry.test.ts b/mobile/src/mobile-web-shell/media-handle-registry.test.ts index 5167a0b9421..117c472d296 100644 --- a/mobile/src/mobile-web-shell/media-handle-registry.test.ts +++ b/mobile/src/mobile-web-shell/media-handle-registry.test.ts @@ -1,9 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { readShellRefusalCode } from './bridge-host-errors' -import { - BRIDGE_MEDIA_MAX_LIVE_HANDLES, - BRIDGE_MEDIA_READ_MAX_BYTES -} from './bridge/bridge-media-verbs' +import { BRIDGE_MEDIA_MAX_LIVE_HANDLES } from './bridge/bridge-media-verbs' import { MEDIA_HANDLE_TTL_MS, MediaHandleRegistry, type StagedMedia } from './media-handle-registry' const staged = (index: number, byteLength = 3000): StagedMedia => ({ @@ -37,24 +34,6 @@ describe('minting handles', () => { }) }) - it('answers one item per staged file, each with a handle of its own', () => { - const items = registry.mint([staged(1), staged(2)]) - expect(items.map((item) => item.mime)).toEqual(['image/png', 'image/png']) - expect(items.map((item) => item.byteLength)).toEqual([3000, 3000]) - expect(items[0]?.handle).not.toBe(items[1]?.handle) - expect(registry.liveCount()).toBe(2) - }) - - it('carries the pixel dimensions only when the picker reported them', () => { - const [withSize, withoutSize] = registry.mint([ - staged(1), - { uri: 'file:///cache/a.pdf', mime: 'application/pdf', byteLength: 12 } - ]) - expect(withSize).toMatchObject({ width: 10, height: 8 }) - expect(withoutSize).not.toHaveProperty('width') - expect(withoutSize).not.toHaveProperty('height') - }) - it('refuses a pick that would pass the live-handle cap, and stages nothing of it', () => { registry.mint(Array.from({ length: BRIDGE_MEDIA_MAX_LIVE_HANDLES }, (_, i) => staged(i))) const extra = staged(99) @@ -84,36 +63,6 @@ describe('reading a handle', () => { registry = new MediaHandleRegistry({ now: () => clock, discard: (uri) => deleted.push(uri) }) }) - it('answers the byte range a chunk covers, and says which one ends the file', () => { - const [item] = registry.mint([staged(1, 1000)]) - const handle = item?.handle ?? '' - expect(registry.read(handle, 0, 400)).toEqual({ - uri: 'file:///cache/orca-media-1.png', - start: 0, - end: 400, - eof: false - }) - expect(registry.read(handle, 600, 400)).toMatchObject({ start: 600, end: 1000, eof: true }) - }) - - it('shortens the last chunk rather than reading past the file', () => { - const [item] = registry.mint([staged(1, 1000)]) - expect(registry.read(item?.handle ?? '', 900, 400)).toMatchObject({ end: 1000, eof: true }) - }) - - it('reads an empty staged file once, and calls it the end', () => { - const [item] = registry.mint([staged(1, 0)]) - expect(registry.read(item?.handle ?? '', 0, 400)).toMatchObject({ start: 0, end: 0, eof: true }) - }) - - it('never hands back more than one chunk, whatever length it was asked for', () => { - // Call the registry directly to prove its own chunk bound even when no wire schema runs. - const [item] = registry.mint([staged(1, BRIDGE_MEDIA_READ_MAX_BYTES * 3)]) - const range = registry.read(item?.handle ?? '', 0, BRIDGE_MEDIA_READ_MAX_BYTES * 3) - expect(range.end).toBe(BRIDGE_MEDIA_READ_MAX_BYTES) - expect(range.eof).toBe(false) - }) - it('refuses a read at or past the end of a file that had bytes', () => { const [item] = registry.mint([staged(1, 1000)]) const handle = item?.handle ?? '' @@ -157,39 +106,6 @@ describe('ending a handle', () => { registry = new MediaHandleRegistry({ now: () => 1_000, discard: (uri) => deleted.push(uri) }) }) - it('deletes the staged file and says it released one', () => { - const [item] = registry.mint([staged(1)]) - expect(registry.release(item?.handle ?? '')).toBe(true) - expect(deleted).toEqual(['file:///cache/orca-media-1.png']) - expect(registry.liveCount()).toBe(0) - }) - - it('answers false for a handle the TTL already expired, as the wire contract says', () => { - // Release must sweep before lookup so expired handles report released:false as the wire contract promises. - let clock = 1_000 - const swept: string[] = [] - const ageing = new MediaHandleRegistry({ - now: () => clock, - discard: (uri) => swept.push(uri) - }) - const [item] = ageing.mint([staged(1)]) - clock += MEDIA_HANDLE_TTL_MS + 1 - expect(ageing.release(item?.handle ?? '')).toBe(false) - expect(swept).toEqual(['file:///cache/orca-media-1.png']) - }) - - it('is gone at exactly the TTL, not one millisecond after', () => { - let clock = 1_000 - const ageing = new MediaHandleRegistry({ now: () => clock, discard: () => {} }) - const [item] = ageing.mint([staged(1)]) - const handle = item?.handle ?? '' - clock += MEDIA_HANDLE_TTL_MS - 1 - expect(ageing.liveCount()).toBe(1) - clock += 1 - expect(ageing.liveCount()).toBe(0) - expect(ageing.release(handle)).toBe(false) - }) - it('answers false for a handle it no longer holds, rather than refusing', () => { // Repeated/expired release is normal during unmount, whose caller cannot know which handles survived. const [item] = registry.mint([staged(1)]) @@ -199,15 +115,6 @@ describe('ending a handle', () => { expect(deleted).toHaveLength(1) }) - it('releases everything at once, which is what the session end and the unmount call', () => { - registry.mint([staged(1), staged(2), staged(3)]) - registry.releaseAll() - expect(deleted).toHaveLength(3) - expect(registry.liveCount()).toBe(0) - registry.releaseAll() - expect(deleted).toHaveLength(3) - }) - it('keeps going when the device refuses to delete one staged file', () => { const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) try { diff --git a/mobile/src/navigation/host-stack-navigation.ts b/mobile/src/navigation/host-stack-navigation.ts index d7c81415119..6f01d9cecd3 100644 --- a/mobile/src/navigation/host-stack-navigation.ts +++ b/mobile/src/navigation/host-stack-navigation.ts @@ -75,11 +75,26 @@ export type PendingHostStackNavigation = Readonly<{ export const HOST_SESSION_ROUTE = '[hostId]/session/[worktreeId]' const HOST_INDEX_ROUTE = '[hostId]/index' -// A session keeps its host's list beneath it so Back lands there; other targets take the list's place. -function opensOverHostList(target: HostStackRouteTarget): boolean { +// A session opened in its host list's place (Home's agent rows), so Back leaves the host instead of showing the list. +export const STANDALONE_SESSION_PARAM = 'standalone' + +export function isStandaloneSessionHref(href: string): boolean { + const [path = '', query = ''] = (href.split('#')[0] ?? '').split('?') + return ( + /^\/h\/[^/]+\/session\//.test(path) && + query.split('&').includes(`${STANDALONE_SESSION_PARAM}=1`) + ) +} + +function isSessionRoute(target: HostStackRouteTarget): boolean { return target.name === HOST_SESSION_ROUTE } +// A session keeps its host's list beneath it so Back lands there, unless it is standalone; other targets take the list's place. +function opensOverHostList(target: HostStackRouteTarget): boolean { + return isSessionRoute(target) && target.params[STANDALONE_SESSION_PARAM] !== '1' +} + const SETTLED_NAVIGATION: HostStackNavigationController = { cancel: () => {}, isActive: () => false, @@ -183,7 +198,7 @@ export function navigateToHostStackRoute( return SETTLED_NAVIGATION } // The host screen opens the session inside its document when the page it activates can, else pushes it as before. - const href = openInHostDocument && opensOverHostList(target) ? sessionOpenHref(target) : null + const href = openInHostDocument && isSessionRoute(target) ? sessionOpenHref(target) : null // useLocalSearchParams decodes every value once more, which would undo the target's own escapes. const open = href === null ? null : encodeURIComponent(href) const inThisHost = hostState?.key && hostParamMatches(focused?.params?.hostId, hostId) @@ -197,8 +212,17 @@ export function navigateToHostStackRoute( return SETTLED_NAVIGATION } // Already inside this host: pushing the host route again would stack a second list. - if (opensOverHostList(target) && inThisHost) { - navigation.dispatch({ type: 'PUSH', target: hostState.key, payload: target }) + if (isSessionRoute(target) && inThisHost) { + if (!opensOverHostList(target) && focused?.key && focused.name === HOST_INDEX_ROUTE) { + navigation.dispatch({ + type: 'REPLACE', + target: hostState.key, + source: focused.key, + payload: target + }) + } else { + navigation.dispatch({ type: 'PUSH', target: hostState.key, payload: target }) + } return SETTLED_NAVIGATION } return open === null @@ -261,7 +285,7 @@ function openWhenHostStackCommits( return } dispose() - if (latest && opensOverHostList(latest[0])) { + if (latest && isSessionRoute(latest[0])) { navigateToHostStackRoute(navigation, router, hostId, ...latest) } else if (latest) { navigation.dispatch({ diff --git a/mobile/src/navigation/use-reported-page-location.web.ts b/mobile/src/navigation/use-reported-page-location.web.ts index 4cbb148b469..37e2c5678a2 100644 --- a/mobile/src/navigation/use-reported-page-location.web.ts +++ b/mobile/src/navigation/use-reported-page-location.web.ts @@ -4,6 +4,7 @@ import { normalizeExecutionHostId } from '../../../src/shared/execution-host' import { usePageBridgeClient } from '../transport/connection/client-context.web' import { firstParam } from './route-param-reader' import { workspaceRouteHref } from './workspace-execution-host' +import { STANDALONE_SESSION_PARAM } from './host-stack-navigation' // Tell the shell which session this document shows, so it can treat a notification for it as already seen. export function useReportedPageLocation(): void { @@ -13,13 +14,16 @@ export function useReportedPageLocation(): void { hostId?: string | string[] worktreeId?: string | string[] executionHost?: string | string[] + standalone?: string | string[] }>() const host = `/h/${encodeURIComponent(firstParam(params.hostId))}` const worktreeId = firstParam(params.worktreeId) + // Keep standalone so a restored document again opens without the list beneath. + const standalone = firstParam(params[STANDALONE_SESSION_PARAM]) === '1' const href = segments.at(-2) === 'session' && worktreeId !== '' ? workspaceRouteHref( - `${host}/session/${encodeURIComponent(worktreeId)}`, + `${host}/session/${encodeURIComponent(worktreeId)}${standalone ? `?${STANDALONE_SESSION_PARAM}=1` : ''}`, normalizeExecutionHostId(firstParam(params.executionHost)) ?? undefined ) : host diff --git a/mobile/src/navigation/use-shell-open-target.web.ts b/mobile/src/navigation/use-shell-open-target.web.ts index 80a8a6724ca..1db6151f2f4 100644 --- a/mobile/src/navigation/use-shell-open-target.web.ts +++ b/mobile/src/navigation/use-shell-open-target.web.ts @@ -10,6 +10,7 @@ import type { BridgeInitRoute } from '../mobile-web-shell/bridge/bridge-init-rou import { BRIDGE_OPEN_ROUTE_PARAM } from '../mobile-web-shell/bridge/bridge-route-update' import { usePageBridgeClient } from '../transport/connection/client-context.web' import { createRefusalReporter, handOffRoute, servedHere } from './route-handoff.web' +import { isStandaloneSessionHref } from './host-stack-navigation' type StackState = ReturnType['state'] type StackRoute = { name: string; params?: object } @@ -74,7 +75,9 @@ function planOpenSplice( return null } delete params[BRIDGE_OPEN_ROUTE_PARAM] - return { target, state: { ...state, index: 1, routes: [{ ...only, params }, opened] } } + // A standalone session takes the list's place, leaving no in-page Back to the list. + const routes = isStandaloneSessionHref(target) ? [opened] : [{ ...only, params }, opened] + return { target, state: { ...state, index: routes.length - 1, routes } } } function decodedPathnameOf(href: string): string { @@ -122,7 +125,11 @@ export function useShellOpenTarget(): boolean { } return } - router.push(target) + if (isStandaloneSessionHref(target)) { + router.replace(target) + } else { + router.push(target) + } } const open = (target: string): void => { if (!isThisHost(client, target)) { diff --git a/mobile/src/new-workspace/creation/mobile-workspace-name.test.ts b/mobile/src/new-workspace/creation/mobile-workspace-name.test.ts deleted file mode 100644 index e4d804435c3..00000000000 --- a/mobile/src/new-workspace/creation/mobile-workspace-name.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { getLinkedWorkItemSuggestedName } from './mobile-workspace-name' - -describe('mobile workspace names', () => { - it('removes apostrophes inside words instead of splitting them', () => { - expect( - getLinkedWorkItemSuggestedName({ - title: "Can't enable browser notifications" - }) - ).toBe('cant-enable-browser-notifications') - - expect( - getLinkedWorkItemSuggestedName({ - title: 'Can’t enable browser notifications' - }) - ).toBe('cant-enable-browser-notifications') - }) -}) diff --git a/mobile/src/new-workspace/source-selection/smart-source-fan-out.ts b/mobile/src/new-workspace/source-selection/smart-source-fan-out.ts index b87f09efe4f..fde41b68b68 100644 --- a/mobile/src/new-workspace/source-selection/smart-source-fan-out.ts +++ b/mobile/src/new-workspace/source-selection/smart-source-fan-out.ts @@ -1,5 +1,5 @@ import { linearIssueReadFailureMessage } from '../../../../src/shared/integration-credential-errors' -import type { GitHubWorkItem } from '../../../../src/shared/github/work-item-types' +import type { GitHubWorkItem } from '../../../../src/shared/github/work-items/work-item-types' import type { GitLabWorkItem } from '../../../../src/shared/gitlab-types' import type { LinearIssue } from '../../../../src/shared/linear/issue-types' import type { BaseRefSearchResult } from '../../../../src/shared/repo-types' @@ -8,7 +8,7 @@ import { type SmartNameMode } from '../../../../src/shared/new-workspace/smart-workspace-source-results' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' -import { isGitHubWorkItemsSshRemoteRequiredError } from '../../../../src/shared/github/work-item-ssh-error' +import { isGitHubWorkItemsSshRemoteRequiredError } from '../../../../src/shared/github/work-items/work-item-ssh-error' import type { MrStateFilter } from './mobile-composer-source-types' import type { JiraIssue, JiraSiteSelection } from '../../../../src/shared/jira/jira-types' import { diff --git a/mobile/src/new-workspace/source-selection/smart-source-paste-intent.ts b/mobile/src/new-workspace/source-selection/smart-source-paste-intent.ts index 61543d9d17d..16ebcfd0652 100644 --- a/mobile/src/new-workspace/source-selection/smart-source-paste-intent.ts +++ b/mobile/src/new-workspace/source-selection/smart-source-paste-intent.ts @@ -1,11 +1,11 @@ -import type { GitHubWorkItem } from '../../../../src/shared/github/work-item-types' +import type { GitHubWorkItem } from '../../../../src/shared/github/work-items/work-item-types' import type { GitLabWorkItem } from '../../../../src/shared/gitlab-types' +import { normalizeGitHubLinkQuery } from '../../../../src/shared/new-workspace/github-links' import { - normalizeGitHubLinkQuery, parseGitHubIssueOrPRLink, type GitHubIssueOrPRLink, type RepoSlug -} from '../../../../src/shared/new-workspace/github-links' +} from '../../../../src/shared/github/repositories/links' import { parseGitLabIssueOrMRLink } from '../../../../src/shared/new-workspace/gitlab-links' import { isSmartWorkspaceSourceQueryWithinLimit } from '../../../../src/shared/new-workspace/smart-workspace-source-results' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' @@ -16,7 +16,7 @@ import { readGitHubWorkItemByNumber, gitlabWorkItemByPathRead } from '../../tasks/providers/mobile-task-source-search-operations' -import { githubRepoIdentityKey } from '../../../../src/shared/github/repository-identity-key' +import { githubRepoIdentityKey } from '../../../../src/shared/github/repositories/repository-identity-key' export type PasteRepoCandidate = { id: string diff --git a/mobile/src/new-workspace/source-selection/smart-source-search-requests.ts b/mobile/src/new-workspace/source-selection/smart-source-search-requests.ts index 94264aff688..a422f5b8692 100644 --- a/mobile/src/new-workspace/source-selection/smart-source-search-requests.ts +++ b/mobile/src/new-workspace/source-selection/smart-source-search-requests.ts @@ -1,4 +1,4 @@ -import type { GitHubWorkItem } from '../../../../src/shared/github/work-item-types' +import type { GitHubWorkItem } from '../../../../src/shared/github/work-items/work-item-types' import type { GitLabWorkItem } from '../../../../src/shared/gitlab-types' import type { LinearIssue } from '../../../../src/shared/linear/issue-types' import type { BaseRefSearchResult } from '../../../../src/shared/repo-types' diff --git a/mobile/src/new-workspace/source-selection/use-mobile-composer-source.ts b/mobile/src/new-workspace/source-selection/use-mobile-composer-source.ts index 46cfee81afe..d160f997839 100644 --- a/mobile/src/new-workspace/source-selection/use-mobile-composer-source.ts +++ b/mobile/src/new-workspace/source-selection/use-mobile-composer-source.ts @@ -1,5 +1,5 @@ import { useCallback, useMemo, useRef, useState } from 'react' -import type { GitHubWorkItem } from '../../../../src/shared/github/work-item-types' +import type { GitHubWorkItem } from '../../../../src/shared/github/work-items/work-item-types' import type { GitLabWorkItem } from '../../../../src/shared/gitlab-types' import type { LinearIssue } from '../../../../src/shared/linear/issue-types' import { resolveComposerManualBranchNameChange } from '../../../../src/shared/composer-branch-selection' diff --git a/mobile/src/new-workspace/source-selection/use-smart-workspace-source.ts b/mobile/src/new-workspace/source-selection/use-smart-workspace-source.ts index ba6752c1bb2..88c896a914c 100644 --- a/mobile/src/new-workspace/source-selection/use-smart-workspace-source.ts +++ b/mobile/src/new-workspace/source-selection/use-smart-workspace-source.ts @@ -1,5 +1,5 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react' -import type { GitHubWorkItem } from '../../../../src/shared/github/work-item-types' +import type { GitHubWorkItem } from '../../../../src/shared/github/work-items/work-item-types' import type { GitLabWorkItem } from '../../../../src/shared/gitlab-types' import { buildSmartWorkspaceSourceRows, diff --git a/mobile/src/platform/media-picker-contract.ts b/mobile/src/platform/media-picker-contract.ts index f74ed63fe71..6108257ba3e 100644 --- a/mobile/src/platform/media-picker-contract.ts +++ b/mobile/src/platform/media-picker-contract.ts @@ -11,6 +11,8 @@ export type PickedMobileImage = { readonly uri?: string // Non-image Files-app picks keep their name so the host saves the file under it. readonly fileName?: string + // Decode hint for formats with no byte signature the phone recognizes (SVG, HEIC). + readonly mime?: string } export type PickedMobileFile = { diff --git a/mobile/src/platform/media-picker.web.ts b/mobile/src/platform/media-picker.web.ts index 67437d14ec9..a41d502bf5f 100644 --- a/mobile/src/platform/media-picker.web.ts +++ b/mobile/src/platform/media-picker.web.ts @@ -23,8 +23,12 @@ import { isPickedImageMime, mobilePickedFileFallbackName } from './mobile-picked // Refusals reject; only user cancellation returns an empty selection. // The page cannot load a native cache URI; the composer falls back to an inline data URI. -function pickedImage(base64: string, fileName: string | undefined): PickedMobileImage { - return { base64, fileName } +function pickedImage( + base64: string, + fileName: string | undefined, + mime: string +): PickedMobileImage { + return { base64, fileName, mime } } // Older shells lack nameMedia; derive a filename from MIME instead. @@ -58,7 +62,7 @@ async function* readPicked( // Release before yielding because callers may stop after one image and strand scarce handles. unread.shift() await releaseStagedMedia(verbs, item.handle) - yield pickedImage(base64, fileName) + yield pickedImage(base64, fileName, item.mime) } } finally { await releaseAllStagedMedia(verbs, unread) diff --git a/mobile/src/platform/native-media-device.test.ts b/mobile/src/platform/native-media-device.test.ts index c17e49a619f..4f5dc2c2c8a 100644 --- a/mobile/src/platform/native-media-device.test.ts +++ b/mobile/src/platform/native-media-device.test.ts @@ -14,6 +14,7 @@ const expo = vi.hoisted(() => ({ vi.mock('expo-clipboard', () => ({ getImageAsync: expo.getImageAsync })) vi.mock('expo-document-picker', () => ({ getDocumentAsync: expo.getDocumentAsync })) +vi.mock('react-native', () => ({ Platform: { OS: 'ios' } })) vi.mock('expo-image-picker', () => ({ UIImagePickerPreferredAssetRepresentationMode: { Compatible: 'compatible' }, launchImageLibraryAsync: expo.launchImageLibraryAsync, diff --git a/mobile/src/platform/native-media-device.ts b/mobile/src/platform/native-media-device.ts index c12f2642088..539bd16e6fe 100644 --- a/mobile/src/platform/native-media-device.ts +++ b/mobile/src/platform/native-media-device.ts @@ -2,6 +2,7 @@ import * as Clipboard from 'expo-clipboard' import * as DocumentPicker from 'expo-document-picker' import { Directory, File as FsFile, Paths } from 'expo-file-system' import * as ImagePicker from 'expo-image-picker' +import { agentReadableLibraryImageOptions } from '../files/attachments/mobile-image-source-picker' import type { MediaHandleRegistry } from '../mobile-web-shell/media-handle-registry' import type { NativeMediaDeps } from './native-media' @@ -63,10 +64,7 @@ export function nativeMediaDeviceDeps(registry: MediaHandleRegistry): NativeMedi base64: false, allowsMultipleSelection: multiple, ...(multiple ? { selectionLimit: limit, orderedSelection: true } : {}), - quality: 1, - // iOS otherwise hands back HEIC as-is, which agents can't read; Compatible gives JPEG. - preferredAssetRepresentationMode: - ImagePicker.UIImagePickerPreferredAssetRepresentationMode.Compatible + ...agentReadableLibraryImageOptions() }), // DocumentPicker has no selection cap; enforce remaining room again before staging and minting. launchFiles: ({ multiple }) => diff --git a/mobile/src/platform/native-media-stage-cleanup.test.ts b/mobile/src/platform/native-media-stage-cleanup.test.ts index 2da52089607..b29c17c0e44 100644 --- a/mobile/src/platform/native-media-stage-cleanup.test.ts +++ b/mobile/src/platform/native-media-stage-cleanup.test.ts @@ -31,6 +31,7 @@ vi.mock('expo-clipboard', () => ({ getImageAsync: () => Promise.resolve({ data: 'data:image/png;base64,AQID' }) })) vi.mock('expo-document-picker', () => ({})) +vi.mock('react-native', () => ({ Platform: { OS: 'ios' } })) vi.mock('expo-image-picker', () => ({})) vi.mock('expo-file-system', () => ({ File: class { diff --git a/mobile/src/platform/native-media.test.ts b/mobile/src/platform/native-media.test.ts index be096146f65..5ee9410f0d5 100644 --- a/mobile/src/platform/native-media.test.ts +++ b/mobile/src/platform/native-media.test.ts @@ -433,34 +433,6 @@ describe('reading chunks', () => { ).rejects.toThrow(/stopped reading/) expect(handles.at(-1)?.closed).toBe(true) }) - - it('refuses a read for a handle the page released', async () => { - const { probe, handle } = await staged(64) - await expect(probe.serve('native.media.release', { handle })).resolves.toEqual({ - released: true - }) - await expect( - probe.serve('native.media.read', { handle, offset: 0, length: 16 }) - ).rejects.toSatisfy((error) => refusalOf(error) === 'native_media_handle_unknown') - }) -}) - -describe('releasing', () => { - it('deletes the staged file and answers false the second time', async () => { - const probe = harness() - probe.files.set(`${CACHE}/lib.png`, bytesOf(8)) - const result = mediaPickResultSchema.parse( - await probe.serve('native.media.pick', { source: 'library', multiple: false }) - ) - const handle = result.items[0]?.handle ?? '' - await expect(probe.serve('native.media.release', { handle })).resolves.toEqual({ - released: true - }) - expect(probe.discarded).toEqual([`${CACHE}/lib.png`]) - await expect(probe.serve('native.media.release', { handle })).resolves.toEqual({ - released: false - }) - }) }) describe('a provider uri the Android picker can answer', () => { diff --git a/mobile/src/session/mobile-session-route.test.ts b/mobile/src/session/mobile-session-route.test.ts index 7cbd6402b54..8481b760991 100644 --- a/mobile/src/session/mobile-session-route.test.ts +++ b/mobile/src/session/mobile-session-route.test.ts @@ -67,4 +67,35 @@ describe('mobile session route', () => { payload: target }) }) + + it('mounts the host, then puts a standalone session in place of its list', () => { + const harness = navigationHarness({ index: 0, routes: [{ name: 'index' }] }) + const target = mobileSessionRouteTarget({ + hostId: 'host/one', + worktreeId: 'repo::/tmp/wt', + standalone: true + }) + + navigateToHostStackRoute( + harness.navigation, + { push: vi.fn(), replace: vi.fn() }, + 'host/one', + target + ) + harness.setState(mountedHostState('host/one')) + + expect(harness.navigation.dispatch.mock.calls).toEqual([ + [ + { + type: 'REPLACE', + target: '/h', + source: 'host-index', + payload: { + name: '[hostId]/session/[worktreeId]', + params: { hostId: 'host/one', worktreeId: 'repo::/tmp/wt', standalone: '1' } + } + } + ] + ]) + }) }) diff --git a/mobile/src/session/mobile-session-route.ts b/mobile/src/session/mobile-session-route.ts index ae2dfc26253..da6e1b5099f 100644 --- a/mobile/src/session/mobile-session-route.ts +++ b/mobile/src/session/mobile-session-route.ts @@ -1,5 +1,9 @@ import type { ExecutionHostId } from '../../../src/shared/execution-host' -import { HOST_SESSION_ROUTE, type HostStackRouteTarget } from '../navigation/host-stack-navigation' +import { + HOST_SESSION_ROUTE, + STANDALONE_SESSION_PARAM, + type HostStackRouteTarget +} from '../navigation/host-stack-navigation' export type MobileSessionRouteParams = { hostId: string @@ -8,6 +12,8 @@ export type MobileSessionRouteParams = { name?: string /** The server a `runtime:` workspace runs on; absent for the desktop's own workspaces. */ executionHost?: ExecutionHostId + /** Opens in place of the host's list, so Back returns to the opener. */ + standalone?: boolean } // Leave identities raw because the navigator owns parameter encoding. @@ -16,7 +22,8 @@ export function mobileSessionRouteTarget({ worktreeId, name, paneKey, - executionHost + executionHost, + standalone }: MobileSessionRouteParams): HostStackRouteTarget { return { name: HOST_SESSION_ROUTE, @@ -25,7 +32,8 @@ export function mobileSessionRouteTarget({ worktreeId, ...(name ? { name } : {}), ...(paneKey ? { paneKey } : {}), - ...(executionHost ? { executionHost } : {}) + ...(executionHost ? { executionHost } : {}), + ...(standalone ? { [STANDALONE_SESSION_PARAM]: '1' } : {}) } } } diff --git a/mobile/src/session/native-chat/MobileNativeChatView.tsx b/mobile/src/session/native-chat/MobileNativeChatView.tsx index 5e701c297d3..be474530871 100644 --- a/mobile/src/session/native-chat/MobileNativeChatView.tsx +++ b/mobile/src/session/native-chat/MobileNativeChatView.tsx @@ -9,7 +9,7 @@ import { import { type NativeScrollEvent, type NativeSyntheticEvent, View } from 'react-native' import { MobileNativeChatSendErrorBanner } from './MobileNativeChatSendErrorBanner' import { useSafeAreaInsets } from 'react-native-safe-area-context' -import { GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler' +import { GestureHandlerRootView } from 'react-native-gesture-handler' import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' import type { NativeChatLiveTurnIndicator, @@ -31,7 +31,7 @@ import { } from './transcript/mobile-native-chat-render-data' import { useMobileNativeChatTransientData } from './transcript/use-mobile-native-chat-transient-data' import { useMobileNativeChatRowKeys } from './transcript/mobile-native-chat-row-keys' -import { useMobileNativeChatPinchGesture } from './transcript/use-mobile-native-chat-pinch-gesture' +import { useMobileNativeChatPinchGesture } from './transcript/mobile-native-chat-pinch-zoom' import { useMobileNativeChatTailFollow } from './transcript/use-mobile-native-chat-tail-follow' import { useMobileNativeChatTurnDisclosure } from './transcript/use-mobile-native-chat-turn-disclosure' import { mobileNativeChatComposerPlaceholder } from './composer/use-mobile-native-chat-input-lease' @@ -61,6 +61,8 @@ import type { MobileNativeChatStatus } from './mobile-native-chat-session-status import type { OlderPagePhase } from './transcript/use-mobile-older-page-loader' import { MobileNativeChatOpenFileContext } from './mobile-native-chat-open-file-context' import { MobileNativeChatLowerRegion } from './MobileNativeChatLowerRegion' +import { MobileNativeChatQueueAbovePromptContext } from './mobile-native-chat-lower-region-context' +import { MobileNativeChatPromptStrip } from './input/MobileNativeChatPromptStrip' import { MobileNativeChatOfflineQueue } from './input/MobileNativeChatOfflineQueue' import { useMobileNativeChatOfflineQueue } from './composer/use-mobile-native-chat-offline-sends' @@ -327,34 +329,31 @@ export function MobileNativeChatView({ ) const emptyStateView = emptyState ? : null + // The queue sits above a shown prompt card in a closed box, rather than tucking into the composer. const lowerContent = ( <> - 0} - {...{ askPending, askSendSource }} - {...{ - ask, - askKey, - onDismissAsk, - onAnswerAsk, - onCancelAsk, - onCancelPrompt, - onCollapseAsk - }} - requiresTerminal={askRequiresTerminal} - onAnswerInTerminal={onAnswerInTerminal} - {...{ permission, onRespondPermission, question, onAnswerQuestion, onCollapsePrompt }} - collapsedPrompt={collapsedPrompt} - /> + - {trayContent} - + + {trayContent} + + + 0} + {...{ askPending, askSendSource }} + {...{ ask, askKey, onDismissAsk, onAnswerAsk }} + {...{ onCancelAsk, onCancelPrompt, onCollapseAsk }} + requiresTerminal={askRequiresTerminal} + onAnswerInTerminal={onAnswerInTerminal} + {...{ permission, onRespondPermission, question, onAnswerQuestion, onCollapsePrompt }} + collapsedPrompt={collapsedPrompt} + /> - - - + & { preventDefault: () => void } -async function sizedForUpload(data: string, width: number, height: number): Promise { - const prepared = await prepareMobileClipboardImageBase64( - { data, size: { width, height } }, - resizeMobileClipboardImage - ) - return normalizeMobileClipboardImageBase64(prepared) -} - -async function readEventImage(file: Blob): Promise { - const base64 = encodeBase64Bytes(new Uint8Array(await file.arrayBuffer())) - const uri = `data:${file.type};base64,${base64}` - // Agents read only these formats; anything else (HEIC, TIFF) is re-encoded as PNG. - const readable = /^image\/(?:png|jpeg|gif|webp)$/.test(file.type) - if (readable && base64.length <= MOBILE_CLIPBOARD_IMAGE_MAX_BASE64_CHARS) { - return { base64, uri } - } - const image = new Image() - image.src = uri - await image.decode() - const size = { width: image.naturalWidth, height: image.naturalHeight } - const source = readable ? base64 : (await resizeMobileClipboardImage(base64, size)).data - return { base64: await sizedForUpload(source, size.width, size.height) } -} - -/** Sized for upload; the clipboard reader is the uploader's, so the composer needs no shell bridge. */ +/** Raw bytes; the uploader fits them for agents. The clipboard reader is the uploader's, so the composer needs no shell bridge. */ export async function readMobilePastedImages( { file }: MobilePastedImages, clipboard: Pick ): Promise { if (file) { - return [await readEventImage(file)] + return [ + { base64: encodeBase64Bytes(new Uint8Array(await file.arrayBuffer())), mime: file.type } + ] } if (!(await clipboard.contents()).image) { return [] } const image = await clipboard.readImage() - return image - ? [{ base64: await sizedForUpload(image.data, image.size.width, image.size.height) }] - : [] + return image ? [{ base64: image.data }] : [] } /** Text pastes stay native unless long; images attach as chips like Photos picks. A disabled composer leaves pastes to the field. */ diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-image-attachment.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-image-attachment.ts index 0aeebfd47af..31fd7ceaed1 100644 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-image-attachment.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-image-attachment.ts @@ -35,6 +35,8 @@ export type UploadNativeChatImagesDeps = { | AsyncIterable | Promise | AsyncIterable> readonly onUploadStart?: () => void + // Injected so this module stays free of the page's canvas. + readonly fitImage?: (image: PickedMobileImage) => Promise /** Retains each completed upload if a later image in the same selection fails. */ readonly onImageUploaded?: (image: Omit) => void } @@ -48,6 +50,7 @@ export async function uploadMobileNativeChatImages( getConnectionId, pickImages, onUploadStart, + fitImage, onImageUploaded }: UploadNativeChatImagesDeps ): Promise[]> { @@ -57,7 +60,7 @@ export async function uploadMobileNativeChatImages( if (canContinue?.() === false) { return uploaded } - for await (const image of picked) { + for await (const pickedImage of picked) { if (canContinue?.() === false) { break } @@ -68,6 +71,7 @@ export async function uploadMobileNativeChatImages( if (canContinue?.() === false) { break } + const image = fitImage ? await fitImage(pickedImage) : pickedImage const path = await saveMobileClipboardImageAsTempFile(client, image.base64, { connectionId }) const previewUri = image.uri ?? `data:image/png;base64,${image.base64}` const result = { diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-attachments.test.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-attachments.test.ts index cdae2e0d6e9..79badaa3ec9 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-attachments.test.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-attachments.test.ts @@ -16,6 +16,10 @@ vi.mock('../../../../../src/shared/non-secure-context-uuid', () => ({ createNonSecureContextUuid: () => `img-${++ids.next}` })) vi.mock('../../../platform/media-picker', () => ({ useMediaPicker: () => ({ pickImages: pick }) })) +// The canvas fit needs a WebView; this test is about the attaching counter. +vi.mock('../../../files/attachments/mobile-agent-image-fit', () => ({ + fitMobileAgentImage: async (image: unknown) => image +})) function ok(id: string, result: unknown): RpcSuccess { return { id, ok: true, result, _meta: { runtimeId: 'r' } } diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-upload.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-upload.ts index 2aaea4368f8..9e3fd851eef 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-upload.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-upload.ts @@ -22,6 +22,7 @@ import { type MobilePastedImages } from './mobile-native-chat-composer-paste' import { useClipboardReader } from '../../../platform/clipboard' +import { fitMobileAgentImage } from '../../../files/attachments/mobile-agent-image-fit' type CurrentRef = { readonly current: T } type UploadedNativeChatImage = Omit @@ -99,7 +100,8 @@ export function useMobileNativeChatImageUpload(args: { started = true attachingCount.current += 1 setIsAttaching(true) - } + }, + fitImage: fitMobileAgentImage }) } catch (error) { uploadError = error diff --git a/mobile/src/session/native-chat/input/MobileNativeChatAsk.styles.ts b/mobile/src/session/native-chat/input/MobileNativeChatAsk.styles.ts index cc895c5404f..fb5b9b1ad12 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatAsk.styles.ts +++ b/mobile/src/session/native-chat/input/MobileNativeChatAsk.styles.ts @@ -1,14 +1,24 @@ import { StyleSheet } from 'react-native' -import { colors, radii, spacing, typography } from '../../../theme/mobile-theme' +import { colors, concentricRadius, radii, spacing, typography } from '../../../theme/mobile-theme' import { themedStyleSheet } from '../../../theme/themed-styles' +// Footer buttons and the card's inner shapes follow the floating card's curve inward. +const MIN_TOUCH_TARGET = 44 +export const ASK_CARD_PADDING = spacing.md +export const ASK_CHOICE_RADIUS = concentricRadius(radii.floating, ASK_CARD_PADDING) + export const mobileNativeChatAskStyles = themedStyleSheet(() => ({ + // Floats like the composer it replaces, with its own edge instead of a full-width rule. card: { flexShrink: 1, minHeight: 0, - backgroundColor: colors.bgPanel, - borderTopWidth: StyleSheet.hairlineWidth, - borderTopColor: colors.borderSubtle + marginHorizontal: spacing.sm, + marginBottom: 6, + backgroundColor: colors.composerSurface, + borderRadius: radii.floating, + borderWidth: StyleSheet.hairlineWidth, + borderColor: colors.floatingCardBorder, + overflow: 'hidden' }, tabs: { flexGrow: 0, @@ -17,7 +27,7 @@ export const mobileNativeChatAskStyles = themedStyleSheet(() => ({ borderBottomColor: colors.borderSubtle }, tabsContent: { - paddingHorizontal: spacing.sm, + paddingHorizontal: ASK_CARD_PADDING, gap: spacing.xs, alignItems: 'center' }, @@ -43,12 +53,13 @@ export const mobileNativeChatAskStyles = themedStyleSheet(() => ({ color: colors.textPrimary }, scroll: { - paddingHorizontal: spacing.md + paddingHorizontal: ASK_CARD_PADDING, + paddingTop: spacing.xs }, questionRow: { flexDirection: 'row', alignItems: 'flex-start', gap: spacing.sm }, questionText: { flex: 1, - marginVertical: spacing.sm + marginVertical: 10 }, other: { marginBottom: spacing.xs @@ -57,32 +68,39 @@ export const mobileNativeChatAskStyles = themedStyleSheet(() => ({ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', - padding: spacing.md, - gap: spacing.sm, - borderTopWidth: StyleSheet.hairlineWidth, - borderTopColor: colors.borderSubtle + paddingTop: spacing.sm, + paddingHorizontal: ASK_CARD_PADDING, + paddingBottom: ASK_CARD_PADDING, + gap: spacing.sm }, cancel: { - paddingVertical: spacing.sm, - paddingHorizontal: spacing.sm + minHeight: MIN_TOUCH_TARGET, + justifyContent: 'center', + paddingHorizontal: spacing.sm, + borderRadius: ASK_CHOICE_RADIUS }, cancelText: { - color: colors.textSecondary, + color: colors.textPrimary, fontSize: typography.bodySize, fontWeight: '600' }, progress: { - color: colors.textMuted, + color: colors.textSecondary, fontSize: typography.metaSize }, next: { - paddingVertical: spacing.sm, + minHeight: MIN_TOUCH_TARGET, + justifyContent: 'center', paddingHorizontal: spacing.lg, - borderRadius: radii.control, + borderRadius: ASK_CHOICE_RADIUS, + borderWidth: 1, + borderColor: colors.textPrimary, backgroundColor: colors.textPrimary }, + // An outline, not a grey fill: Skip is a real choice and must not read as disabled. nextSkip: { - backgroundColor: colors.bgRaised + backgroundColor: 'transparent', + borderColor: colors.choiceBorder }, nextText: { color: colors.bgBase, @@ -90,6 +108,6 @@ export const mobileNativeChatAskStyles = themedStyleSheet(() => ({ fontWeight: '700' }, nextSkipText: { - color: colors.textMuted + color: colors.textPrimary } })) diff --git a/mobile/src/session/native-chat/input/MobileNativeChatAsk.tsx b/mobile/src/session/native-chat/input/MobileNativeChatAsk.tsx index 3ec989ff1ee..b9f5ce808a2 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatAsk.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatAsk.tsx @@ -261,7 +261,11 @@ export function MobileNativeChatAsk({ keyboardShouldPersistTaps="always" > - + ({ option: { flexDirection: 'row', alignItems: 'center', - gap: spacing.sm, - padding: spacing.sm, - borderRadius: concentricRadius(radii.surface, spacing.xs), - backgroundColor: colors.bgRaised, + gap: CHOICE_GAP, + paddingVertical: 10, + paddingHorizontal: CHOICE_PADDING_X, + borderRadius: ASK_CHOICE_RADIUS, + backgroundColor: 'transparent', borderWidth: 1, - borderColor: colors.borderSubtle, - marginBottom: spacing.xs + borderColor: colors.choiceBorder, + marginBottom: 6 }, optionSelected: { - borderColor: colors.statusGreen + borderColor: colors.statusGreen, + backgroundColor: colors.choiceSelectedFill }, check: { - width: 18, - height: 18, + width: CHECK_SIZE, + height: CHECK_SIZE, borderWidth: 1.5, - borderColor: colors.textMuted, + borderColor: colors.textSecondary, alignItems: 'center', justifyContent: 'center' }, @@ -123,19 +124,25 @@ const styles = themedStyleSheet(() => ({ }, optionDescription: { color: colors.textSecondary, - fontSize: typography.metaSize + fontSize: 13, + lineHeight: 18 }, optionCard: { borderWidth: 1, - borderColor: colors.borderSubtle, - borderRadius: concentricRadius(radii.surface, spacing.xs), - backgroundColor: colors.bgRaised, - marginBottom: spacing.xs + borderColor: colors.choiceBorder, + borderRadius: ASK_CHOICE_RADIUS, + backgroundColor: 'transparent', + marginBottom: 6 + }, + // The card carries the edge and fill; the row inside it draws neither. + optionWithPreview: { + borderWidth: 0, + marginBottom: 0, + backgroundColor: 'transparent' }, - optionWithPreview: { borderWidth: 0, marginBottom: 0 }, previewInset: { - marginLeft: 18 + spacing.sm * 2, - marginRight: spacing.sm, - marginBottom: spacing.sm + marginLeft: CHOICE_PADDING_X + CHECK_SIZE + CHOICE_GAP, + marginRight: CHOICE_PADDING_X, + marginBottom: 10 } })) diff --git a/mobile/src/session/native-chat/input/MobileNativeChatPromptCard.tsx b/mobile/src/session/native-chat/input/MobileNativeChatPromptCard.tsx index 8c45ee91c9d..794f8f4287a 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatPromptCard.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatPromptCard.tsx @@ -26,7 +26,6 @@ import type { MobileChatPermission } from './mobile-native-chat-permission' import { MobileNativeChatQuestion } from './MobileNativeChatQuestion' import { MobileNativeChatStructuredAsk } from './MobileNativeChatStructuredAsk' import { mobileChatQuestionKey, type MobileChatQuestion } from './mobile-native-chat-question' -import { MobileNativeChatPromptStrip } from './MobileNativeChatPromptStrip' import { useMobileNativeChatLowerGeometry, useMobileNativeChatLowerRegion @@ -147,24 +146,16 @@ export function MobileNativeChatPromptCard({ /> ) : null const arrival = usePromptCardArrival(card !== null) - // Hide without remounting so a collapsed prompt keeps partial selections. + // Hide without remounting so a collapsed prompt keeps partial selections; the view draws its strip. return ( - <> - - {card} - - {collapsedPrompt ? ( - - ) : null} - + + {card} + ) } diff --git a/mobile/src/session/native-chat/input/MobileNativeChatPromptStrip.tsx b/mobile/src/session/native-chat/input/MobileNativeChatPromptStrip.tsx index e310acc98bd..52d2760fff1 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatPromptStrip.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatPromptStrip.tsx @@ -5,26 +5,28 @@ import { themedStyleSheet } from '../../../theme/themed-styles' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' import { useMobileTranslation } from '../../../i18n/use-mobile-translation' +/** A collapsed prompt's one line, above the queue; nothing while no prompt is collapsed. */ export function MobileNativeChatPromptStrip({ - title, - onExpand + prompt }: { - title: string - onExpand: () => void -}): React.JSX.Element { + prompt?: { title: string; expand: () => void } | null +}): React.JSX.Element | null { useMobileColorScheme() const t = useMobileTranslation() + if (!prompt) { + return null + } return ( - {title} + {prompt.title} [styles.action, pressed && pressedStyle]} - onPress={onExpand} + onPress={prompt.expand} > diff --git a/mobile/src/session/native-chat/input/MobileNativeChatQueueFrame.tsx b/mobile/src/session/native-chat/input/MobileNativeChatQueueFrame.tsx index de541c570a1..165e0610455 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatQueueFrame.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatQueueFrame.tsx @@ -1,6 +1,9 @@ import { useContext, type ReactNode } from 'react' import { View } from 'react-native' -import { MobileNativeChatComposerPresenceContext } from '../mobile-native-chat-lower-region-context' +import { + MobileNativeChatComposerPresenceContext, + MobileNativeChatQueueAbovePromptContext +} from '../mobile-native-chat-lower-region-context' import { queuedMessageStyles as styles } from './mobile-native-chat-queued-message-styles' export function MobileNativeChatQueueFrame({ @@ -13,14 +16,16 @@ export function MobileNativeChatQueueFrame({ children: ReactNode }) { const composerPresent = useContext(MobileNativeChatComposerPresenceContext) - const untucked = editing || !composerPresent + // Native keeps the composer mounted (hidden) under a prompt, so presence alone cannot untuck it. + const abovePrompt = useContext(MobileNativeChatQueueAbovePromptContext) + const untucked = editing || !composerPresent || abovePrompt return ( {children} diff --git a/mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.test.tsx b/mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.test.tsx index 2aa3100d182..b756a46cef6 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.test.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.test.tsx @@ -2,14 +2,21 @@ import { activateMobileUiLocale } from '../../../i18n/mobile-i18n' import type { MobileQueuedMessageCard } from './mobile-structured-queued-message-cards' -import { createElement } from 'react' +import { createElement, type ReactElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' import { afterEach, describe, expect, it, vi } from 'vitest' import { MobileNativeChatQueuedMessages } from './MobileNativeChatQueuedMessages' +import type { ActionSheetAction } from '../../../components/ActionSheetModal' +import { MobileNativeChatQueueAbovePromptContext } from '../mobile-native-chat-lower-region-context' +import { createMobileQueuedHeadLight } from './mobile-queued-head-light' +import { QUEUED_ROW_SHOW_SETTLE_MS } from './mobile-queued-row-frame' +import { queuedMessageStyles as styles } from './mobile-native-chat-queued-message-styles' +import { pressedStyle } from '../../../theme/mobile-theme' let fontScale = 1 +let windowWidth = 390 vi.mock('../../../components/DragReorderList', () => ({ DragReorderList: 'DragReorderList' })) vi.mock('react-native-reanimated', async () => { const { useRef } = await import('react') @@ -21,7 +28,7 @@ vi.mock('react-native-reanimated', async () => { }) vi.mock('react-native', () => ({ - useWindowDimensions: () => ({ fontScale }), + useWindowDimensions: () => ({ fontScale, width: windowWidth }), ActivityIndicator: 'ActivityIndicator', Platform: { OS: 'ios' }, Pressable: 'Pressable', @@ -38,7 +45,7 @@ vi.mock('lucide-react-native', () => ({ ArrowUpRight: 'ArrowUpRight', Check: 'Check', ChevronDown: 'ChevronDown', - ChevronRight: 'ChevronRight', + ChevronUp: 'ChevronUp', CornerDownRight: 'CornerDownRight', ListEnd: 'ListEnd', MoreHorizontal: 'MoreHorizontal', @@ -82,22 +89,54 @@ describe('MobileNativeChatQueuedMessages', () => { afterEach(async () => { vi.restoreAllMocks() + windowWidth = 390 act(() => renderer?.unmount()) renderer = null await activateMobileUiLocale('en') }) - async function mount( - props: Parameters[0] - ): Promise { + type Props = Parameters[0] + + function element(props: Props, abovePrompt = false): ReactElement { + return createElement( + MobileNativeChatQueueAbovePromptContext, + { value: abovePrompt }, + createElement(MobileNativeChatQueuedMessages, props) + ) + } + + async function mount(props: Props, abovePrompt = false): Promise { const mounted = create(createElement('View')) renderer = mounted await act(async () => { - mounted.update(createElement(MobileNativeChatQueuedMessages, props)) + mounted.update(element(props, abovePrompt)) }) return mounted } + function rows(mounted: ReactTestRenderer) { + return mounted.root.findAll( + (node) => typeof node.type === 'string' && node.props.testID === 'queued-card-row' + ) + } + + function foldToggle(mounted: ReactTestRenderer) { + return mounted.root.find( + (node) => typeof node.type === 'string' && node.props.testID === 'queued-fold-toggle' + ) + } + + function menuAction(mounted: ReactTestRenderer, id: string) { + const actions: ActionSheetAction[] = sheet(mounted).props.actions + return actions.find((action) => action.id === id) + } + + function dragList(mounted: ReactTestRenderer) { + return mounted.root.findAll((node) => String(node.type) === 'DragReorderList') + } + + const three = () => [card({ messageId: 'a' }), card({ messageId: 'b' }), card({ messageId: 'c' })] + function control(mounted: ReactTestRenderer, label: string, index = 0) { return mounted.root.findAll( (node) => typeof node.type === 'string' && node.props.accessibilityLabel === label @@ -115,17 +154,11 @@ describe('MobileNativeChatQueuedMessages', () => { ) expect(sheet(mounted).props.visible).toBe(true) await act(async () => { - mounted.update( - createElement(MobileNativeChatQueuedMessages, { cards: [card({ messageId: 'b' })] }) - ) + mounted.update(element({ cards: [card({ messageId: 'b' })] })) }) expect(sheet(mounted).props.visible).toBe(false) await act(async () => { - mounted.update( - createElement(MobileNativeChatQueuedMessages, { - cards: [card({ messageId: 'a' }), card({ messageId: 'b' })] - }) - ) + mounted.update(element({ cards: [card({ messageId: 'a' }), card({ messageId: 'b' })] })) }) expect(sheet(mounted).props.visible).toBe(false) }) @@ -135,19 +168,466 @@ describe('MobileNativeChatQueuedMessages', () => { const onSend = vi.fn(() => new Promise((resolve) => (answer = resolve))) const onDelete = vi.fn(async () => true) const mounted = await mount({ cards: [card({ messageId: 'w' })], onSend, onDelete }) + await act(async () => control(mounted, 'More actions').props.onPress()) // Tap all actions before disabled state renders to expose same-frame duplication. await act(async () => { control(mounted, 'Send this message').props.onPress() control(mounted, 'Send this message').props.onPress() - control(mounted, 'Delete this queued message').props.onPress() + menuAction(mounted, 'deleteMessage')!.onPress() }) expect(onSend).toHaveBeenCalledTimes(1) expect(onDelete).not.toHaveBeenCalled() expect(control(mounted, 'More actions').props.disabled).toBe(true) + expect(menuAction(mounted, 'deleteMessage')!.disabled).toBe(true) await act(async () => answer(true)) expect(control(mounted, 'Send this message').props.disabled).toBe(false) }) + it('folds to the first message above a prompt card and opens from the more row', async () => { + const mounted = await mount({ cards: three() }, true) + expect(rows(mounted)).toHaveLength(1) + expect(foldToggle(mounted).props.accessibilityState).toEqual({ expanded: false }) + await act(async () => foldToggle(mounted).props.onPress()) + expect(rows(mounted)).toHaveLength(3) + expect(foldToggle(mounted).props.accessibilityState).toEqual({ expanded: true }) + await act(async () => foldToggle(mounted).props.onPress()) + expect(rows(mounted)).toHaveLength(1) + }) + + it.each([390, 320])( + 'lets the open list, not the fold row, give up height on a short %ipt screen', + async (width) => { + windowWidth = width + const mounted = await mount({ cards: three() }, true) + await act(async () => foldToggle(mounted).props.onPress()) + const flat = (style: unknown): Record => + Object.assign({}, ...[style].flat(Infinity).filter(Boolean)) + const box = mounted.root.find( + (node) => typeof node.type === 'string' && node.props.testID === 'queued-box' + ) + const scroll = mounted.root.find((node) => String(node.type) === 'ScrollView') + // The box shrinks under a height limit; the list scrolls so Show less below it stays whole. + expect(flat(box.props.style)).toMatchObject({ flexShrink: 1, minHeight: 0 }) + expect(flat(scroll.parent!.props.style)).toMatchObject({ flexShrink: 1, minHeight: 0 }) + expect(flat(scroll.props.style)).toMatchObject({ + maxHeight: width < 340 ? 264 : 212, + flexShrink: 1, + minHeight: 0 + }) + expect(flat(foldToggle(mounted).props.style({ pressed: false })).flexShrink).toBeUndefined() + } + ) + + it('opens by default above the composer, and folds again when a prompt card arrives', async () => { + const mounted = await mount({ cards: three() }) + expect(rows(mounted)).toHaveLength(3) + await act(async () => mounted.update(element({ cards: three() }, true))) + expect(rows(mounted)).toHaveLength(1) + }) + + it('folds again for a later prompt after the person opened the list above an earlier one', async () => { + const mounted = await mount({ cards: three() }, true) + await act(async () => foldToggle(mounted).props.onPress()) + expect(rows(mounted)).toHaveLength(3) + await act(async () => mounted.update(element({ cards: three() }))) + await act(async () => mounted.update(element({ cards: three() }, true))) + expect(rows(mounted)).toHaveLength(1) + }) + + it('opens for a message queued in the same render a prompt arrives', async () => { + const mounted = await mount({ cards: three() }) + // Folded by hand above the composer, then a prompt and a new own message arrive together. + await act(async () => foldToggle(mounted).props.onPress()) + expect(rows(mounted)).toHaveLength(1) + await act(async () => + mounted.update(element({ cards: [...three(), card({ messageId: 'd' })] }, true)) + ) + expect(rows(mounted)).toHaveLength(4) + }) + + it('scrolls a message the person queues into a folded list into view', async () => { + const scrollTo = vi.fn() + const mounted = create(createElement('View'), { + createNodeMock: (node) => + node.type === 'ScrollView' + ? { scrollTo, scrollToEnd: vi.fn(), flashScrollIndicators: vi.fn() } + : null + }) + renderer = mounted + await act(async () => mounted.update(element({ cards: three() }, true))) + await act(async () => + mounted.update(element({ cards: [...three(), card({ messageId: 'd' })] }, true)) + ) + expect(rows(mounted)).toHaveLength(4) + const scroll = mounted.root.find((node) => String(node.type) === 'ScrollView') + await act(async () => { + rows(mounted).forEach((row) => + row.props.onLayout({ nativeEvent: { layout: { height: 60 } } }) + ) + scroll.props.onLayout({ nativeEvent: { layout: { height: 100 } } }) + scroll.props.onContentSizeChange(0, 240) + }) + // The new last row spans 180–240 of a 100pt list. + expect(scrollTo).toHaveBeenLastCalledWith({ y: 140, animated: false }) + }) + + it("opens a folded list for a message the person queues, not for an agent's or a delete", async () => { + const mounted = await mount({ cards: three() }, true) + await act(async () => + mounted.update( + element( + { + cards: [ + ...three(), + card({ messageId: 'x', from: { kind: 'agent', senders: [], orchestration: null } }) + ] + }, + true + ) + ) + ) + expect(rows(mounted)).toHaveLength(1) + await act(async () => mounted.update(element({ cards: three().slice(0, 2) }, true))) + expect(rows(mounted)).toHaveLength(1) + await act(async () => + mounted.update(element({ cards: [...three().slice(0, 2), card({ messageId: 'd' })] }, true)) + ) + expect(rows(mounted)).toHaveLength(3) + }) + + it('opens a folded list for a failed message behind the fold, with its Send in reach', async () => { + const foldText = (mounted: ReactTestRenderer) => + foldToggle(mounted) + .findAll((node) => String(node.type) === 'Text') + .flatMap((node) => node.props.children) + .join('') + const failed = (messageId: string) => + card({ messageId, needsAttention: true, caption: "Couldn't send" }) + const mounted = await mount( + { + cards: [card({ messageId: 'a' }), failed('b'), card({ messageId: 'c' })], + agentWorking: true + }, + true + ) + expect(rows(mounted)).toHaveLength(3) + // Mid-turn the others steer, but the failed card offers its retry, Send. + const pills = mounted.root.findAll( + (node) => + typeof node.type === 'string' && + typeof node.props.accessibilityLabel === 'string' && + node.props.hitSlop !== undefined + ) + expect(pills.map((node) => node.props.accessibilityLabel)).toEqual([ + 'Submit without interrupting the model', + 'Send this message', + 'Submit without interrupting the model' + ]) + expect(pills[1]!.props.disabled).toBe(false) + expect(foldText(mounted)).not.toContain("Couldn't send") + // Folding is still the person's call, and the fold row only counts. + await act(async () => foldToggle(mounted).props.onPress()) + expect(rows(mounted)).toHaveLength(1) + expect(foldText(mounted)).toBe('2 more') + expect( + foldToggle(mounted).findAll((node) => String(node.type) === 'Text')[0]!.props + .accessibilityLabel + ).toBe('2 more, a message needs attention') + // An agent's new message does not reopen it for a failure the person already folded away. + await act(async () => + mounted.update( + element( + { + cards: [ + card({ messageId: 'a' }), + failed('b'), + card({ messageId: 'c' }), + card({ messageId: 'z', from: { kind: 'agent', senders: [], orchestration: null } }) + ] + }, + true + ) + ) + ) + expect(rows(mounted)).toHaveLength(1) + // A second card failing later opens it again. + await act(async () => + mounted.update(element({ cards: [card({ messageId: 'a' }), failed('b'), failed('c')] }, true)) + ) + expect(rows(mounted)).toHaveLength(3) + }) + + it('scrolls a failure that opens a short list into view', async () => { + const scrollTo = vi.fn() + const mounted = create(createElement('View'), { + createNodeMock: (node) => + node.type === 'ScrollView' + ? { scrollTo, scrollToEnd: vi.fn(), flashScrollIndicators: vi.fn() } + : null + }) + renderer = mounted + await act(async () => mounted.update(element({ cards: three() }, true))) + const failedThird = [ + card({ messageId: 'a' }), + card({ messageId: 'b' }), + card({ messageId: 'c', needsAttention: true, caption: "Couldn't send" }) + ] + await act(async () => mounted.update(element({ cards: failedThird }, true))) + expect(rows(mounted)).toHaveLength(3) + // Rows report before the list knows its own size, as when it has just opened. + await act(async () => { + rows(mounted).forEach((row, index) => + row.props.onLayout({ nativeEvent: { layout: { height: index === 2 ? 80 : 60 } } }) + ) + }) + expect(scrollTo).not.toHaveBeenCalled() + const scroll = mounted.root.find((node) => String(node.type) === 'ScrollView') + await act(async () => { + scroll.props.onLayout({ nativeEvent: { layout: { height: 100 } } }) + scroll.props.onContentSizeChange(0, 200) + }) + // The failed row spans 120–200 of a 100pt list, so the list scrolls to its end. + expect(scrollTo).toHaveBeenCalledWith({ y: 100, animated: false }) + }) + + it('places a failed row by the current order after a reorder that lays nothing out', async () => { + vi.useFakeTimers() + try { + const scrollTo = vi.fn() + const mounted = create(createElement('View'), { + createNodeMock: (node) => + node.type === 'ScrollView' + ? { scrollTo, scrollToEnd: vi.fn(), flashScrollIndicators: vi.fn() } + : null + }) + renderer = mounted + const ids = (order: string) => [...order].map((messageId) => card({ messageId })) + await act(async () => mounted.update(element({ cards: ids('abcd') }))) + const scroll = mounted.root.find((node) => String(node.type) === 'ScrollView') + await act(async () => { + scroll.props.onLayout({ nativeEvent: { layout: { height: 100 } } }) + scroll.props.onContentSizeChange(0, 240) + rows(mounted).forEach((row) => + row.props.onLayout({ nativeEvent: { layout: { height: 60 } } }) + ) + }) + // Equal-height rows reordered by transform: no row lays out again. + await act(async () => mounted.update(element({ cards: ids('bcda') }))) + scrollTo.mockClear() + await act(async () => + mounted.update( + element({ + cards: [...ids('bcd'), card({ messageId: 'a', needsAttention: true })] + }) + ) + ) + await act(async () => { + vi.advanceTimersByTime(QUEUED_ROW_SHOW_SETTLE_MS) + }) + // a is now last, spanning 180–240 of a 100pt list, not first. + expect(scrollTo).toHaveBeenCalledWith({ y: 140, animated: false }) + } finally { + vi.useRealTimers() + } + }) + + it('scrolls to a failure the list mounts open for, and settles when no row lays out again', async () => { + vi.useFakeTimers() + try { + const scrollTo = vi.fn() + const mounted = create(createElement('View'), { + createNodeMock: (node) => + node.type === 'ScrollView' + ? { scrollTo, scrollToEnd: vi.fn(), flashScrollIndicators: vi.fn() } + : null + }) + renderer = mounted + const failed = (messageId: string) => + card({ messageId, needsAttention: true, caption: "Couldn't send" }) + const lay = async (heights: number[]) => { + const scroll = mounted.root.find((node) => String(node.type) === 'ScrollView') + await act(async () => { + scroll.props.onLayout({ nativeEvent: { layout: { height: 100 } } }) + scroll.props.onContentSizeChange(0, 200) + rows(mounted).forEach((row, index) => + row.props.onLayout({ nativeEvent: { layout: { height: heights[index] } } }) + ) + }) + } + // Mounted above a prompt with a failure behind the fold: open, and its row is shown. + const opened = [card({ messageId: 'a' }), card({ messageId: 'b' }), failed('c')] + await act(async () => mounted.update(element({ cards: opened }, true))) + expect(rows(mounted)).toHaveLength(3) + await lay([60, 60, 80]) + expect(scrollTo).toHaveBeenLastCalledWith({ y: 100, animated: false }) + // Open above the composer, a row fails without changing height: no row lays out again, + // so the request settles on the heights the list already has. + await act(async () => + mounted.update( + element({ + cards: [card({ messageId: 'p' }), card({ messageId: 'q' }), card({ messageId: 'r' })] + }) + ) + ) + await lay([60, 60, 80]) + scrollTo.mockClear() + await act(async () => + mounted.update( + element({ cards: [card({ messageId: 'p' }), card({ messageId: 'q' }), failed('r')] }) + ) + ) + expect(scrollTo).not.toHaveBeenCalled() + await act(async () => { + vi.advanceTimersByTime(QUEUED_ROW_SHOW_SETTLE_MS) + }) + expect(scrollTo).toHaveBeenCalledWith({ y: 100, animated: false }) + } finally { + vi.useRealTimers() + } + }) + + it("places a failed row below an open inline editor at the editor's height", async () => { + const scrollTo = vi.fn() + const mounted = create(createElement('View'), { + createNodeMock: (node) => + node.type === 'ScrollView' + ? { scrollTo, scrollToEnd: vi.fn(), flashScrollIndicators: vi.fn() } + : null + }) + renderer = mounted + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: only messageId is read; the editor composer is mocked, so the RPC client is never touched. + const editor = { messageId: 'a' } as unknown as Props['editor'] + const cards = [card({ messageId: 'a' }), card({ messageId: 'b' }), card({ messageId: 'c' })] + await act(async () => mounted.update(element({ cards, editor }))) + await act(async () => + mounted.update( + element({ + cards: [cards[0]!, cards[1]!, card({ messageId: 'c', needsAttention: true })], + editor + }) + ) + ) + const scroll = mounted.root.find((node) => String(node.type) === 'ScrollView') + await act(async () => { + // The editor row is 200pt tall; the compact rows 60pt. + rows(mounted).forEach((row, index) => + row.props.onLayout({ + nativeEvent: { layout: { x: 0, y: 0, width: 0, height: index === 0 ? 200 : 60 } } + }) + ) + scroll.props.onLayout({ nativeEvent: { layout: { height: 100 } } }) + scroll.props.onContentSizeChange(0, 320) + }) + // The failed row spans 260–320, past the editor. + expect(scrollTo).toHaveBeenLastCalledWith({ y: 220, animated: false }) + }) + + it("fills the head's Steer pill while the composer previews Steer queued", async () => { + const headLight = createMobileQueuedHeadLight() + const mounted = await mount({ cards: three(), agentWorking: true, headLight }) + const pills = () => + mounted.root.findAll( + (node) => + typeof node.type === 'string' && + node.props.accessibilityLabel === 'Submit without interrupting the model' + ) + const label = (pill: ReturnType[number]) => + pill.find((node) => String(node.type) === 'Text').props.style + expect(pills()[0]!.props.style({ pressed: false })).not.toContain(styles.litAction) + await act(async () => headLight.set(true)) + const [head, second] = pills() + expect(head!.props.style({ pressed: false })).toContain(styles.litAction) + expect(label(head!)).toContain(styles.litActionLabel) + // A press still dims the filled pill. + const pressed = head!.props.style({ pressed: true }) + expect(pressed.indexOf(pressedStyle)).toBeGreaterThan(pressed.indexOf(styles.litAction)) + expect(second!.props.style({ pressed: false })).not.toContain(styles.litAction) + }) + + it('keeps a folded list folded when a whole new queue replaces it', async () => { + const mounted = await mount({ cards: three() }, true) + await act(async () => + mounted.update(element({ cards: [card({ messageId: 'p' }), card({ messageId: 'q' })] }, true)) + ) + expect(rows(mounted)).toHaveLength(1) + }) + + it('leads the first row with Queued and the spoken count, but not on a returned head', async () => { + const lead = (mounted: ReactTestRenderer) => + mounted.root.findAll( + (node) => typeof node.type === 'string' && node.props.accessibilityLiveRegion === 'polite' + ) + const mounted = await mount({ cards: three() }) + const [label] = lead(mounted) + expect(label!.props.accessibilityLabel).toBe('3 queued messages') + expect(label!.props.children).toBe('Queued') + await act(async () => mounted.update(element({ cards: [card({ messageId: 'a' })] }))) + expect(lead(mounted)[0]!.props.accessibilityLabel).toBe('1 queued message') + await act(async () => + mounted.update( + element({ cards: [card({ messageId: 'a', state: 'returned', caption: 'Returned' })] }) + ) + ) + expect(lead(mounted).some((node) => node.props.children === 'Queued')).toBe(false) + }) + + it('keeps an expanded message open across a fold and back', async () => { + const mounted = await mount({ cards: three() }) + const text = () => + mounted.root.findAll( + (node) => typeof node.type === 'function' && node.type.name === 'MobileQueuedCardText' + ) + await act(async () => text()[0]!.props.onToggle()) + expect(text()[0]!.props.expanded).toBe(true) + await act(async () => foldToggle(mounted).props.onPress()) + await act(async () => foldToggle(mounted).props.onPress()) + expect(text().map((node) => node.props.expanded)).toEqual([true, false, false]) + }) + + it('draws one message as a single row with no fold row', async () => { + const mounted = await mount({ cards: [card({ messageId: 'a' })] }, true) + expect(rows(mounted)).toHaveLength(1) + expect(mounted.root.findAll((node) => node.props.testID === 'queued-fold-toggle')).toHaveLength( + 0 + ) + }) + + it('offers drag only while two or more messages are open', async () => { + const onMove = vi.fn(async () => true) + const one = await mount({ cards: [card({ messageId: 'a' })], onMove }) + expect(dragList(one)).toHaveLength(0) + act(() => one.unmount()) + const folded = await mount({ cards: three(), onMove }, true) + expect(dragList(folded)).toHaveLength(0) + await act(async () => foldToggle(folded).props.onPress()) + expect(dragList(folded)).toHaveLength(1) + }) + + it("moves Delete into the row's menu and keeps Edit off a goal", async () => { + const onDelete = vi.fn(async () => true) + const onEdit = vi.fn(async () => true) + const mounted = await mount({ + cards: [card({ messageId: 'goal', command: true }), card({ messageId: 'text' })], + onDelete, + onEdit + }) + await act(async () => control(mounted, 'More actions', 0).props.onPress()) + expect(menuAction(mounted, 'editMessage')).toBeUndefined() + await act(async () => menuAction(mounted, 'deleteMessage')!.onPress()) + expect(onDelete).toHaveBeenCalledWith('goal') + await act(async () => control(mounted, 'More actions', 1).props.onPress()) + await act(async () => menuAction(mounted, 'editMessage')!.onPress()) + expect(onEdit).toHaveBeenCalledWith('text') + }) + + it('offers Clear all in the menu of a queue that still sends on its own', async () => { + const onClearAll = vi.fn(async () => true) + const mounted = await mount({ cards: three(), onClearAll, clearable: true }) + await act(async () => control(mounted, 'More actions').props.onPress()) + await act(async () => menuAction(mounted, 'clearAll')!.onPress()) + expect(onClearAll).toHaveBeenCalledWith(['a', 'b', 'c']) + }) + describe('a paused queue', () => { const waiting = card({ messageId: 'waiting-1', text: 'next' }) diff --git a/mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.tsx b/mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.tsx index b2a8d678a9e..c8443e60077 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.tsx @@ -1,9 +1,9 @@ import { MobileNativeChatQueueFrame } from './MobileNativeChatQueueFrame' import { DragReorderList } from '../../../components/DragReorderList' import type { DragReorderMove } from '../../../components/drag-reorder-positions' -import { useLayoutEffect, useState } from 'react' -import { Pressable, Text, View } from 'react-native' -import { ChevronDown, ChevronRight, Pencil, Play, Trash2 } from 'lucide-react-native' +import { useContext, useLayoutEffect, useState, type ReactNode } from 'react' +import { Pressable, Text, View, type LayoutRectangle } from 'react-native' +import { ChevronDown, ChevronUp, Pencil, Play, Trash2 } from 'lucide-react-native' import { ActionSheetModal } from '../../../components/ActionSheetModal' import { colors } from '../../../theme/mobile-theme' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' @@ -22,8 +22,12 @@ import type { MobileQueuedMessageEdit } from './use-mobile-structured-queued-mes import type { MobileQueuedMessageInlineEditor } from './mobile-queued-message-edit-draft' import { MobileQueuedMessageCardRow } from './MobileQueuedMessageCardRow' import { MobileQueuedMessageScrollList } from './MobileQueuedMessageScrollList' +import { useQueuedRowShow } from './mobile-queued-row-frame' import { queuedMessageStyles as styles } from './mobile-native-chat-queued-message-styles' -import { useMobileNativeChatLowerRegion } from '../mobile-native-chat-lower-region-context' +import { + MobileNativeChatQueueAbovePromptContext, + useMobileNativeChatLowerRegion +} from '../mobile-native-chat-lower-region-context' // Use NUL-prefixed header keys because message ids cannot contain NUL. // Resume and Clear all share one key: a Resume would send the cards a Clear is deleting. @@ -93,26 +97,93 @@ export function MobileNativeChatQueuedMessages({ const ownActions = useMobileQueuedCardActions(ownStore, '') const { busyIds, run } = actions ?? ownActions const [menuFor, setMenuFor] = useState(null) - const [expanded, setExpanded] = useState(true) + // Folded by default above a prompt card, open above the composer; a choice holds until that changes. + const abovePrompt = useContext(MobileNativeChatQueueAbovePromptContext) + const [openChoice, setOpenChoice] = useState<{ open: boolean; abovePrompt: boolean } | null>(null) + const [expandedIds, setExpandedIds] = useState>(() => new Set()) + const liveIds = cards?.map((card) => card.messageId) ?? [] + const attentionIds = + cards?.filter((card) => card.needsAttention).map((card) => card.messageId) ?? [] + const liveKey = `${liveIds.join('\u0000')}\u0001${attentionIds.join('\u0000')}` + const [seen, setSeen] = useState({ key: liveKey, ids: liveIds, attentionIds }) const largeText = useLargeSystemText() + // The card a failure opened the list for, scrolled into view once its row lays out. + const [showRowId, setShowRowId] = useState( + () => cards?.slice(1).find((card) => card.needsAttention)?.messageId ?? null + ) + const measureRow = useQueuedRowShow(showRowId, setShowRowId, liveIds) + // A choice made in one placement never comes back in a later one (a new prompt folds again); + // checked first, so a choice this render makes below wins. + if (openChoice !== null && openChoice.abovePrompt !== abovePrompt) { + setOpenChoice(null) + } + if (liveKey !== seen.key) { + setSeen({ key: liveKey, ids: liveIds, attentionIds }) + const newest = cards?.at(-1) + // A message the person just queued opens the list, so it never lands folded out of sight; + // a delete or reorder that leaves an older card last does not, nor a whole new queue (a switch). + if ( + newest && + !newest.from && + !seen.ids.includes(newest.messageId) && + seen.ids.some((messageId) => liveIds.includes(messageId)) + ) { + setOpenChoice({ open: true, abovePrompt }) + setShowRowId(newest.messageId) + } + // A card that newly needs attention (failed or returned) behind the fold opens the list, + // so its own Send is in reach. + const failedBehindFold = attentionIds.find( + (messageId) => messageId !== liveIds[0] && !seen.attentionIds.includes(messageId) + ) + if (failedBehindFold !== undefined) { + setOpenChoice({ open: true, abovePrompt }) + setShowRowId(failedBehindFold) + } + // Forget expanded ids of cards that left the queue. + if ([...expandedIds].some((messageId) => !liveIds.includes(messageId))) { + setExpandedIds(new Set([...expandedIds].filter((messageId) => liveIds.includes(messageId)))) + } + } if (!cards || cards.length === 0) { - if (!expanded) { - setExpanded(true) + if (openChoice !== null) { + setOpenChoice(null) } return null } + const toggleExpanded = (messageId: string) => + setExpandedIds((current) => { + const next = new Set(current) + if (!next.delete(messageId)) { + next.add(messageId) + } + return next + }) + // Folded by default only while nothing behind the fold needs attention. + const attentionHidden = cards.slice(1).some((card) => card.needsAttention) + const open = + openChoice?.abovePrompt === abovePrompt ? openChoice.open : !abovePrompt || attentionHidden + // An inline editor on a folded-away card keeps the list open so the edit stays in view. + const editingHidden = editor !== undefined && editor.messageId !== cards[0]!.messageId + const showAll = open || cards.length === 1 || editingHidden + const shownCards = showAll ? cards : cards.slice(0, 1) const queueBusy = busyIds.has(QUEUE_KEY) const headId = headSteerableQueuedMessageCard(cards)?.messageId const messageIds = cards.map((card) => card.messageId) // Clear all takes every card, so it waits for any card's own action rather than skip that card. const clearBusy = queueBusy || messageIds.some((messageId) => busyIds.has(messageId)) + const clearAll = () => { + if (onClearAll) { + void run(QUEUE_KEY, () => onClearAll(messageIds), messageIds) + } + } // Forget closed menu identity so a Stop-requeued draft with the same id cannot reopen it. const menuCard = cards.find((card) => card.messageId === menuFor) if (menuFor !== null && !menuCard) { setMenuFor(null) } - const actionable = pause || clearable - const headerActions = actionable ? ( + // A paused queue keeps a header for Resume and Clear all; an unpaused one offers Clear all in each menu. + const headerActions = pause ? ( <> {onClearAll ? ( void run(QUEUE_KEY, () => onClearAll(messageIds), messageIds)} + onPress={clearAll} > {t('chat.queuedMessages.clearAll', 'Clear all')} ) : null} - {pause ? ( - [ - styles.headerAction, - pressed && styles.pressed, - queueBusy && styles.disabled - ]} - disabled={queueBusy} - onPress={() => void run(QUEUE_KEY, onResume && (() => onResume()))} - > - - {t('chat.queuedMessages.resume', 'Resume')} - - ) : null} + [ + styles.headerAction, + pressed && styles.pressed, + queueBusy && styles.disabled + ]} + disabled={queueBusy} + onPress={() => void run(QUEUE_KEY, onResume && (() => onResume()))} + > + + {t('chat.queuedMessages.resume', 'Resume')} + ) : null - const attentionCaption = !expanded ? cards.find((card) => card.needsAttention)?.caption : null - const headerCountStyle = [styles.headerCount, attentionCaption && styles.captionReturned] + const hiddenCount = cards.length - 1 + const foldLabel = showAll + ? t('chat.queuedMessages.showLess', 'Show less') + : hiddenCount === 1 + ? t('chat.queuedMessages.moreCount_one', '{{count}} more', { count: hiddenCount }) + : t('chat.queuedMessages.moreCount_other', '{{count}} more', { count: hiddenCount }) + const renderRow = ( + card: MobileQueuedMessageCard, + reveal: (row: LayoutRectangle) => void, + show: (row: LayoutRectangle) => void, + handle?: ReactNode + ) => { + const first = card.messageId === cards[0]!.messageId + return ( + toggleExpanded(card.messageId)} + onSend={() => void run(card.messageId, onSend)} + onMore={() => setMenuFor(card.messageId)} + onEditorLayout={reveal} + onRowHeight={(height) => measureRow({ messageIds, showAll }, card.messageId, height, show)} + /> + ) + } + const menuEditable = + menuCard !== undefined && + !menuCard.command && + onEdit !== undefined && + editor === undefined && + !busyIds.has(menuCard.messageId) return ( - {} - {/* A polite region, as the app's other notices: React Native has no status role. */} - - {/* The whole row folds the cards. It sits behind the labels rather than around the - header's buttons, which VoiceOver could not reach inside another button. */} - [styles.headerToggle, pressed && styles.pressed]} - onPress={() => setExpanded(!expanded)} - /> - - - {pause - ? t('chat.queuedMessages.pausedState', 'Paused') - : t('chat.queuedMessages.queuedState', 'Queued')} - - + {/* A polite region, as the app's other notices: React Native has no status role. */} + - · - - {cards.length} - {attentionCaption ? ( - - {`· ${attentionCaption}`} - + + + {t('chat.queuedMessages.pausedState', 'Paused')} + + + · + + {cards.length} + + {largeText ? null : headerActions} + + {largeText ? ( + {headerActions} ) : null} - - {largeText ? null : headerActions} - - {expanded ? ( - - ) : ( - - )} - - - {largeText && headerActions ? ( - {headerActions} + ) : null} - {expanded ? ( - card.messageId)} - newestIsPersons={!cards.at(-1)?.from} - inlineEditorActive={editor !== undefined} - > - {(reveal, drag) => { - const renderRow = (card: MobileQueuedMessageCard, handle?: React.ReactNode) => ( - void run(card.messageId, onSend)} - onDelete={() => void run(card.messageId, onDelete)} - onMore={() => setMenuFor(card.messageId)} - onEditorLayout={reveal} - /> - ) - return onMove && !editor ? ( - card.messageId} - isMoveDisabled={(card) => busyIds.has(MOVE_KEY) || busyIds.has(card.messageId)} - rowPresentation="plain" - renderRow={renderRow} - onMove={(move) => run(move.movedId, () => onMove(move), [MOVE_KEY])} - {...drag} - /> - ) : ( - cards.map((card) => renderRow(card)) - ) + + {(reveal, drag, show) => { + // Order matters only with two or more cards in view, so the grip shows only then. + return onMove && !editor && showAll && cards.length > 1 ? ( + card.messageId} + isMoveDisabled={(card) => busyIds.has(MOVE_KEY) || busyIds.has(card.messageId)} + rowPresentation="plain" + liftFromRow + renderRow={(card, handle) => renderRow(card, reveal, show, handle)} + onMove={(move) => run(move.movedId, () => onMove(move), [MOVE_KEY])} + {...drag} + /> + ) : ( + shownCards.map((card) => renderRow(card, reveal, show)) + ) + }} + + {cards.length > 1 && !editingHidden ? ( + [styles.foldToggle, pressed && styles.pressed]} + onPress={() => { + setShowRowId(null) + setOpenChoice({ open: !showAll, abovePrompt }) }} - + > + + {foldLabel} + + {showAll ? ( + + ) : ( + + )} + ) : null} { + if (menuCard) { + void run(menuCard.messageId, onEdit) + } + } + } + ]), { - id: 'editMessage', - label: t('chat.queuedMessages.editMessage', 'Edit message'), - icon: Pencil, - // Runs once the sheet's Modal is gone, so the composer Edit fills can take focus. - closeBeforePress: true, + id: 'deleteMessage', + label: t('chat.queuedMessages.deleteMessage', 'Delete message'), + icon: Trash2, + destructive: true, + disabled: menuCard === undefined || busyIds.has(menuCard.messageId), onPress: () => { if (menuCard) { - void run(menuCard.messageId, onEdit) + void run(menuCard.messageId, onDelete) } } - } + }, + ...(clearable && !pause && onClearAll && cards.length > 1 + ? [ + { + id: 'clearAll', + label: t('chat.queuedMessages.deleteAll', 'Delete every queued message'), + icon: Trash2, + destructive: true, + disabled: clearBusy, + onPress: clearAll + } + ] + : []) ]} onClose={() => setMenuFor(null)} /> diff --git a/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.test.ts b/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.test.ts index f43f8762553..25be1ddaadc 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.test.ts +++ b/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.test.ts @@ -148,6 +148,14 @@ describe('MobileNativeChatSessionOptionPickers', () => { renderer = null }) + it('shows the selected model when legacy answering-model metadata names another model', () => { + const legacyDescriptor = { ...MODEL_DESCRIPTOR, reportedModel: 'claude-opus-4-8' } + mount([legacyDescriptor], true) + const label = findAllByHostType(pill('Model'), 'Text').map((node) => node.props.children) + expect(label).toContain('Sonnet 5') + expect(label).not.toContain('Opus 4.8') + }) + it('consumes a refused page without replay, then permits a fresh open and permission pick', async () => { const placeholder: SessionOptionDescriptor = { ...MODEL_DESCRIPTOR, diff --git a/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionRows.tsx b/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionRows.tsx index 00dbbe2b6dc..391211f20f5 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionRows.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionRows.tsx @@ -221,10 +221,11 @@ export function descriptorRowElements( onPress={() => onSetOption(choice.value)} /> ) - // No search here: search-only aliases follow a More models toggle, as compact pickers show them. - const more = moreChoices ? choices.filter((choice) => choice.legacy) : [] + // No search here, so search-only rows stay out; folded ones follow a More models toggle. + const listed = choices.filter((choice) => !choice.hidden || choice.value === currentValue) + const more = moreChoices ? listed.filter((choice) => choice.legacy) : [] return [ - ...choices.filter((choice) => !choice.legacy).map(choiceRow), + ...listed.filter((choice) => !choice.legacy).map(choiceRow), ...(more.length > 0 && moreChoices ? [ ...(moreChoices.shown ? more.map(choiceRow) : []), diff --git a/mobile/src/session/native-chat/input/MobileQueuedCardText.tsx b/mobile/src/session/native-chat/input/MobileQueuedCardText.tsx index d97d8e1beeb..8c3d910602a 100644 --- a/mobile/src/session/native-chat/input/MobileQueuedCardText.tsx +++ b/mobile/src/session/native-chat/input/MobileQueuedCardText.tsx @@ -1,18 +1,21 @@ import { useState } from 'react' import { Pressable, Text, View } from 'react-native' -import { colors, typography, pressedStyle } from '../../../theme/mobile-theme' +import { pressedStyle } from '../../../theme/mobile-theme' import { themedStyleSheet } from '../../../theme/themed-styles' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' import { queuedMessageStyles } from './mobile-native-chat-queued-message-styles' import { useMobileTranslation } from '../../../i18n/use-mobile-translation' -// Expand clipped queued text before Steer/Delete; use the queue’s capped scroller rather than nesting another scroll box. +// A clipped message opens in place on tap, inside the queue's own capped scroller. export function MobileQueuedCardText({ text, + lines, expanded, onToggle }: { text: string + /** Lines shown before the ellipsis. */ + lines: number expanded: boolean onToggle: () => void }): React.JSX.Element { @@ -25,50 +28,37 @@ export function MobileQueuedCardText({ pointerEvents="none" accessibilityElementsHidden importantForAccessibility="no-hide-descendants" - onTextLayout={(event) => setClipped(event.nativeEvent.lines.length > 2)} + onTextLayout={(event) => setClipped(event.nativeEvent.lines.length > lines)} > {text} ) - if (!clipped && !expanded) { - return ( - - {measure} - - {text} - - - ) - } - const toggle = ( - pressed && pressedStyle} - testID="queued-card-text" - accessibilityRole="button" - accessibilityState={{ expanded }} - accessibilityHint={ - expanded - ? t('session.queuedCardText.showLessHint', 'Shows less of the message') - : t('session.queuedCardText.showMoreHint', 'Shows the whole message') - } - onPress={onToggle} - > - {expanded ? null : ( - - {text} - - )} - - {expanded - ? t('session.queuedCardText.showLess', 'Show less') - : t('session.queuedCardText.showMore', 'Show more')} - - + const shown = ( + + {text} + ) return ( - {expanded ? null : measure} - {toggle} + {measure} + {clipped || expanded ? ( + pressed && pressedStyle} + testID="queued-card-text" + accessibilityRole="button" + accessibilityState={{ expanded }} + accessibilityHint={ + expanded + ? t('session.queuedCardText.showLessHint', 'Shows less of the message') + : t('session.queuedCardText.showMoreHint', 'Shows the whole message') + } + onPress={onToggle} + > + {shown} + + ) : ( + shown + )} ) } @@ -83,9 +73,5 @@ const styles = themedStyleSheet(() => ({ left: 0, right: 0, opacity: 0 - }, - caption: { - color: colors.textMuted, - fontSize: typography.metaSize } })) diff --git a/mobile/src/session/native-chat/input/MobileQueuedMessageCardRow.tsx b/mobile/src/session/native-chat/input/MobileQueuedMessageCardRow.tsx index 550e7e68305..4ea8789961d 100644 --- a/mobile/src/session/native-chat/input/MobileQueuedMessageCardRow.tsx +++ b/mobile/src/session/native-chat/input/MobileQueuedMessageCardRow.tsx @@ -1,14 +1,12 @@ import type { ReactNode } from 'react' -import { useState, useSyncExternalStore } from 'react' -import { Pressable, Text, View, type LayoutRectangle } from 'react-native' +import { useSyncExternalStore } from 'react' +import { Pressable, Text, View, useWindowDimensions, type LayoutRectangle } from 'react-native' import { AlertCircle, CornerDownRight, - ListEnd, Image as ImageIcon, MoreHorizontal, - Send, - Trash2 + Send } from 'lucide-react-native' import { colors, pressedStyle } from '../../../theme/mobile-theme' import { queuedMessageCardSteers } from '../../../../../src/shared/agent-session/view/structured-agent-session-queued-cards' @@ -18,11 +16,16 @@ import type { MobileQueuedMessageInlineEditor } from './mobile-queued-message-ed import { MobileQueuedMessageComposer } from './MobileQueuedMessageComposer' import { MobileQueuedCardText } from './MobileQueuedCardText' import type { MobileQueuedHeadLight } from './mobile-queued-head-light' +import { MobileAgentMessageSenders } from '../transcript/MobileAgentMessageSenders' +import { + QUEUED_ROW_NARROW_WIDTH, + queuedMessageStyles as styles +} from './mobile-native-chat-queued-message-styles' +import { useMobileTranslation } from '../../../i18n/use-mobile-translation' const subscribeNever = () => () => undefined -import { MobileAgentMessageSenders } from '../transcript/MobileAgentMessageSenders' -import { queuedMessageStyles as styles } from './mobile-native-chat-queued-message-styles' -import { useMobileTranslation } from '../../../i18n/use-mobile-translation' +// The 32pt pill reaches 44pt inside the row's own height; Android drops touches outside the parent. +const STEER_HIT_SLOP = { top: 6, bottom: 6 } type QueuedMessageCardRowProps = { dragHandle?: ReactNode @@ -31,14 +34,23 @@ type QueuedMessageCardRowProps = { busy: boolean /** Set on the card the composer's Steer queued preview would send. */ headLight?: MobileQueuedHeadLight - editBlocked: boolean steerHeld: boolean /** Steer only into a running turn; an idle agent's card reads Send. */ agentWorking: boolean + /** Leads the first row's meta line ("Queued ·"); later rows show only the sender. */ + lead?: string + /** Spoken for the lead, and announced as the count changes: the queue has no header of its own. */ + leadLabel?: string + /** Draws the hairline above the row: every row but the box's first. */ + divided: boolean + /** The whole message is open; held by the list so folding, which remounts rows, keeps it. */ + expanded: boolean + onToggleExpanded: () => void onSend: () => void - onDelete: () => void onMore: () => void onEditorLayout: (row: LayoutRectangle) => void + /** The compact row's height, so the list can scroll to a row that needs attention. */ + onRowHeight?: (height: number) => void } export function MobileQueuedMessageCardRow({ @@ -52,8 +64,12 @@ export function MobileQueuedMessageCardRow({ return ( onEditorLayout(event.nativeEvent.layout)} + style={actions.divided && styles.divided} + onLayout={(event) => { + onEditorLayout(event.nativeEvent.layout) + // An open editor still stacks above later rows, so the list places them past it. + actions.onRowHeight?.(event.nativeEvent.layout.height) + }} > @@ -66,157 +82,157 @@ function QueuedMessageCardContents({ card, busy, headLight, - editBlocked, steerHeld, agentWorking, + lead, + leadLabel, + divided, + expanded, + onToggleExpanded, onSend, - onDelete, onMore, + onRowHeight, dragHandle }: Omit): React.JSX.Element { useMobileColorScheme() const t = useMobileTranslation() - const [expanded, setExpanded] = useState(false) + const narrow = useWindowDimensions().width < QUEUED_ROW_NARROW_WIDTH const returned = card.state === 'returned' - const steers = agentWorking && queuedMessageCardSteers(card) + // A card that needs attention offers its retry, Send, which is what its caption names. + const steers = agentWorking && !card.needsAttention && queuedMessageCardSteers(card) const count = card.images?.length ?? 0 const lit = useSyncExternalStore( headLight?.subscribe ?? subscribeNever, () => headLight?.get() === true ) return ( - - + onRowHeight(event.nativeEvent.layout.height))} + > + {dragHandle} - {card.needsAttention ? ( - - ) : ( - - )} - {card.from ? : null} + + {card.needsAttention ? ( + + ) : null} + {lead ? ( + <> + + {lead} + + + · + + + ) : null} + {card.from ? ( + + + + ) : ( + + {t('session.queuedMessageCardRow.you', 'You')} + + )} + {card.images ? ( + + + {count} + + ) : null} + setExpanded(!expanded)} + onToggle={onToggleExpanded} /> {card.caption && !returned ? ( - + {card.caption} ) : null} - - {card.images ? ( - - - {card.images.length} - - ) : null} - {card.waitsForAgent ? null : ( - [ - styles.textAction, - pressed && styles.pressed, - // Filled like the composer's primary while Steer queued would press it. - lit && styles.litAction, - (busy || steerHeld) && styles.disabled - ]} - disabled={busy || steerHeld} - onPress={onSend} - > - {steers ? ( - - ) : ( - - )} - - {steers - ? t('session.queuedMessageCardRow.steer', 'Steer') - : t('session.queuedMessageCardRow.send', 'Send')} - - - )} + {card.waitsForAgent ? null : ( [ - styles.iconAction, - card.command && styles.lastIconAction, - pressed && styles.pressed, - busy && styles.disabled + styles.steerPill, + // Filled like the composer's primary while Steer queued would press it. + lit && styles.litAction, + // Opacity, so a lit pill still answers a press. + pressed && pressedStyle, + (busy || steerHeld) && styles.disabled ]} - disabled={busy} - onPress={onDelete} + disabled={busy || steerHeld} + onPress={onSend} > - + {narrow ? null : steers ? ( + + ) : ( + + )} + + {steers + ? t('session.queuedMessageCardRow.steer', 'Steer') + : t('session.queuedMessageCardRow.send', 'Send')} + - {card.command ? null : ( - [ - styles.iconAction, - styles.lastIconAction, - pressed && styles.pressed, - editBlocked && styles.disabled - ]} - disabled={editBlocked} - onPress={onMore} - > - - - )} - + )} + [ + styles.moreButton, + pressed && styles.pressed, + busy && styles.disabled + ]} + disabled={busy} + onPress={onMore} + > + + - {expanded || (returned && card.caption) ? ( + {returned && card.caption ? ( - {expanded ? ( - pressed && pressedStyle} - accessibilityRole="button" - accessibilityState={{ expanded: true }} - accessibilityHint={t( - 'session.queuedMessageCardRow.showLessHint', - 'Shows less of the message' - )} - onPress={() => setExpanded(false)} - > - {card.line} - - ) : null} - {returned && card.caption ? ( - {card.caption} - ) : null} + {card.caption} ) : null} diff --git a/mobile/src/session/native-chat/input/MobileQueuedMessageScrollList.tsx b/mobile/src/session/native-chat/input/MobileQueuedMessageScrollList.tsx index c7a05ffed9d..2593a271ecd 100644 --- a/mobile/src/session/native-chat/input/MobileQueuedMessageScrollList.tsx +++ b/mobile/src/session/native-chat/input/MobileQueuedMessageScrollList.tsx @@ -1,5 +1,5 @@ -import { useLayoutEffect, useRef, useState, type ReactNode } from 'react' -import { Platform, StyleSheet, View, type LayoutRectangle } from 'react-native' +import { useEffect, useLayoutEffect, useRef, useState, type ReactNode } from 'react' +import { Platform, StyleSheet, View, useWindowDimensions, type LayoutRectangle } from 'react-native' import Animated, { useAnimatedRef, useSharedValue, @@ -9,10 +9,15 @@ import Animated, { import { spacing } from '../../../theme/mobile-theme' import { MobileEdgeFade } from '../../../components/MobileEdgeFade' import { useMobileNativeChatLowerRegion } from '../mobile-native-chat-lower-region-context' +import { QUEUED_ROW_NARROW_WIDTH } from './mobile-native-chat-queued-message-styles' -/** Desktop's `max-h-40`: three one-line cards and part of a fourth, whose cut-off edge is the - * sign that the list scrolls. */ -export const QUEUE_LIST_MAX_HEIGHT = 160 +/** + * Three 60pt message rows and part of a fourth, whose cut-off edge is the sign that the list scrolls; + * room too for three when one carries a two-line failure caption, so three are never cut. + */ +export const QUEUE_LIST_MAX_HEIGHT = 212 +/** The same below the narrow width, where each message takes two lines and a row grows to about 73pt. */ +export const QUEUE_LIST_NARROW_MAX_HEIGHT = 264 export type MobileQueueDragViewport = { scrollRef: AnimatedRef @@ -21,6 +26,9 @@ export type MobileQueueDragViewport = { onDragActiveChange: (active: boolean) => void } +/** A list that has not measured itself by then has moved on (folded, or the row left). */ +const SHOW_PENDING_MS = 1000 + type Metrics = { offset: number; viewport: number; content: number } /** Compact cards are capped; the full editor yields to the available chat viewport. */ @@ -34,10 +42,15 @@ export function MobileQueuedMessageScrollList({ /** The newest card has no sender: the person just queued it, so the list shows it. */ newestIsPersons: boolean inlineEditorActive?: boolean - /** Rows, given `reveal` to keep an edited row in view. */ - children: (reveal: (row: LayoutRectangle) => void, drag: MobileQueueDragViewport) => ReactNode + /** Rows, given `reveal` to keep an edited row in view and `show` to scroll the list to a row. */ + children: ( + reveal: (row: LayoutRectangle) => void, + drag: MobileQueueDragViewport, + show: (row: LayoutRectangle) => void + ) => ReactNode }): React.JSX.Element { const scrollRef = useAnimatedRef() + const narrow = useWindowDimensions().width < QUEUED_ROW_NARROW_WIDTH const lowerRegion = useMobileNativeChatLowerRegion() const scrollOffsetY = useSharedValue(0) const scrollContentHeight = useSharedValue(0) @@ -46,11 +59,22 @@ export function MobileQueuedMessageScrollList({ const shownIds = useRef>(new Set(messageIds)) const flashed = useRef(false) const [cues, setCues] = useState({ above: false, below: false }) + // A list that just opened may not have measured itself yet; show the row once it has, if soon. + const pendingShow = useRef(null) + const pendingExpiry = useRef | undefined>(undefined) + useEffect(() => () => clearTimeout(pendingExpiry.current), []) useLayoutEffect(() => { const newest = messageIds.at(-1) const appended = shownIds.current.size > 0 && newest !== undefined && !shownIds.current.has(newest) + const changed = + messageIds.length !== shownIds.current.size || + messageIds.some((messageId) => !shownIds.current.has(messageId)) shownIds.current = new Set(messageIds) + // A row asked for before the queue changed is not where it was. + if (changed) { + pendingShow.current = null + } // Reveal the committed own append even when a simultaneous removal keeps content size equal. if (appended && newestIsPersons) { scrollRef.current?.scrollToEnd({ animated: false }) @@ -61,6 +85,10 @@ export function MobileQueuedMessageScrollList({ const above = m.offset > 1 const below = m.offset + m.viewport < m.content - 1 setCues((prev) => (prev.above === above && prev.below === below ? prev : { above, below })) + const pending = pendingShow.current + if (pending && m.viewport > 0 && m.content >= pending.y + pending.height) { + show(pending) + } if (!flashed.current && m.viewport > 0 && m.content > m.viewport + 1) { flashed.current = true if (Platform.OS === 'ios') { @@ -69,11 +97,7 @@ export function MobileQueuedMessageScrollList({ } } // The nearest scroll that shows the whole row, as desktop's editor does, clear of the edge fades. - const reveal = (row: LayoutRectangle) => { - if (lowerRegion) { - lowerRegion.layoutChanged() - return - } + const scrollIntoView = (row: LayoutRectangle) => { const { offset, viewport, content } = metrics.current if (viewport === 0) { return @@ -88,11 +112,35 @@ export function MobileQueuedMessageScrollList({ scrollRef.current?.scrollTo({ y: bottom - viewport, animated: false }) } } + const show = (row: LayoutRectangle) => { + const { viewport, content } = metrics.current + if (viewport === 0 || content < row.y + row.height) { + pendingShow.current = row + clearTimeout(pendingExpiry.current) + pendingExpiry.current = setTimeout(() => { + pendingShow.current = null + }, SHOW_PENDING_MS) + return + } + pendingShow.current = null + clearTimeout(pendingExpiry.current) + scrollIntoView(row) + } + // An inline editor inside a lower region lets that region scroll instead. + const reveal = (row: LayoutRectangle) => { + if (lowerRegion) { + lowerRegion.layoutChanged() + return + } + scrollIntoView(row) + } return ( - + // Always shrinkable: under a height limit the list gives up rows (and scrolls) before the box + // clips the fold row below it. + - {children(reveal, { - scrollRef, - scrollOffsetY, - scrollContentHeight, - onDragActiveChange: setDragging - })} + {children( + reveal, + { + scrollRef, + scrollOffsetY, + scrollContentHeight, + onDragActiveChange: setDragging + }, + show + )} {cues.above ? : null} {cues.below ? : null} @@ -123,6 +175,7 @@ export function MobileQueuedMessageScrollList({ } const styles = StyleSheet.create({ - scroll: { maxHeight: QUEUE_LIST_MAX_HEIGHT }, + scroll: { maxHeight: QUEUE_LIST_MAX_HEIGHT, flexShrink: 1, minHeight: 0 }, + scrollNarrow: { maxHeight: QUEUE_LIST_NARROW_MAX_HEIGHT, flexShrink: 1, minHeight: 0 }, inline: { flexShrink: 1, minHeight: 0 } }) diff --git a/mobile/src/session/native-chat/input/mobile-native-chat-queued-message-styles.ts b/mobile/src/session/native-chat/input/mobile-native-chat-queued-message-styles.ts index 6c6f0732dcf..84ba0a13dde 100644 --- a/mobile/src/session/native-chat/input/mobile-native-chat-queued-message-styles.ts +++ b/mobile/src/session/native-chat/input/mobile-native-chat-queued-message-styles.ts @@ -7,6 +7,11 @@ import { themedStyleSheet } from '../../../theme/themed-styles' const MIN_TOUCH_TARGET = 44 const HEADER_HEIGHT = spacing.xl + spacing.sm const META_LINE_HEIGHT = typography.metaSize + spacing.xs +const QUEUE_BOX_RADIUS = 20 +const ROW_MIN_HEIGHT = 52 +/** Below this width a one-line message shows too little, so it takes two and the pill drops its arrow. */ +export const QUEUED_ROW_NARROW_WIDTH = 340 +const STEER_PILL_HEIGHT = 32 export const queuedMessageStyles = themedStyleSheet(() => ({ list: { @@ -27,6 +32,17 @@ export const queuedMessageStyles = themedStyleSheet(() => ({ // Full editors and menus scroll above the ordinary composer instead of tucking under it. inlineList: { flexShrink: 1, minHeight: 0, marginBottom: 0 }, inlineBox: { flexShrink: 1, minHeight: 0, paddingBottom: 0 }, + // Above a prompt card: a closed box of its own, matching the card's surface and inset. + closedList: { marginHorizontal: spacing.sm, marginTop: 0, marginBottom: 6 }, + closedBox: { + backgroundColor: colors.composerSurface, + // Every corner: the tucked box's own top corners would outrank a plain borderRadius. + borderTopLeftRadius: QUEUE_BOX_RADIUS, + borderTopRightRadius: QUEUE_BOX_RADIUS, + borderBottomLeftRadius: QUEUE_BOX_RADIUS, + borderBottomRightRadius: QUEUE_BOX_RADIUS, + borderBottomWidth: StyleSheet.hairlineWidth + }, header: { minHeight: HEADER_HEIGHT, flexDirection: 'row', @@ -42,13 +58,6 @@ export const queuedMessageStyles = themedStyleSheet(() => ({ gap: spacing.xs, paddingHorizontal: spacing.xs }, - headerToggle: { - position: 'absolute', - top: 0, - right: 0, - bottom: 0, - left: 0 - }, headerLabels: { flex: 1, minWidth: 0, @@ -76,14 +85,6 @@ export const queuedMessageStyles = themedStyleSheet(() => ({ paddingVertical: spacing.sm, fontVariant: ['tabular-nums'] }, - headerCaption: { - flex: 1, - minWidth: 0, - color: colors.statusRed, - fontSize: typography.metaSize, - lineHeight: META_LINE_HEIGHT, - paddingVertical: spacing.sm - }, // minHeight, not height: rows grow with the system text size instead of clipping. headerAction: { minHeight: HEADER_HEIGHT, @@ -95,21 +96,22 @@ export const queuedMessageStyles = themedStyleSheet(() => ({ paddingHorizontal: spacing.sm, borderRadius: radii.control }, - chevron: { - width: 36, - minHeight: HEADER_HEIGHT, - alignItems: 'center', - justifyContent: 'center' - }, card: { minHeight: MIN_TOUCH_TARGET }, row: { - minHeight: MIN_TOUCH_TARGET, + minHeight: ROW_MIN_HEIGHT, flexDirection: 'row', alignItems: 'center', - gap: spacing.sm, - paddingLeft: spacing.md + gap: 10, + paddingVertical: spacing.sm, + paddingLeft: spacing.md, + paddingRight: 6 + }, + // The grip takes the leading inset, so the row starts at its edge. + rowWithHandle: { + paddingLeft: 0, + gap: 6 }, divided: { borderTopWidth: StyleSheet.hairlineWidth, @@ -118,21 +120,46 @@ export const queuedMessageStyles = themedStyleSheet(() => ({ textColumn: { flex: 1, minWidth: 0, - paddingVertical: spacing.sm, gap: 2 }, + metaLine: { + flexDirection: 'row', + alignItems: 'center', + gap: spacing.xs, + minWidth: 0 + }, + metaLead: { + color: colors.textPrimary, + fontSize: typography.metaSize, + lineHeight: META_LINE_HEIGHT, + fontWeight: '600', + flexShrink: 1 + }, + metaText: { + color: colors.textSecondary, + fontSize: typography.metaSize, + lineHeight: META_LINE_HEIGHT, + flexShrink: 1 + }, + metaFixed: { + flexShrink: 0 + }, + metaSenders: { + flexShrink: 1, + minWidth: 0 + }, bodyText: { color: colors.textPrimary, fontSize: typography.bodySize, - lineHeight: typography.bodySize + 6 + lineHeight: typography.bodySize + 5 }, expandedBody: { - paddingLeft: spacing.md + 14 + spacing.sm, + paddingLeft: spacing.md, paddingRight: spacing.md, paddingBottom: spacing.sm }, caption: { - color: colors.textMuted, + color: colors.textSecondary, fontSize: typography.metaSize }, editorHeading: { @@ -144,28 +171,47 @@ export const queuedMessageStyles = themedStyleSheet(() => ({ captionReturned: { color: colors.statusRed }, - actions: { - flexDirection: 'row' - }, - textAction: { - minHeight: MIN_TOUCH_TARGET, - minWidth: MIN_TOUCH_TARGET, + // 32pt tall to sit light in the row; hitSlop carries it to 44pt inside the row's own height. + steerPill: { + minHeight: STEER_PILL_HEIGHT, flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: spacing.xs, - paddingHorizontal: spacing.sm, - borderRadius: radii.control + paddingHorizontal: 11, + borderRadius: radii.pill, + backgroundColor: colors.cardPillFill, + flexShrink: 0 }, - iconAction: { + steerLabel: { + color: colors.textPrimary, + fontSize: 13, + fontWeight: '600' + }, + moreButton: { + width: MIN_TOUCH_TARGET, minHeight: MIN_TOUCH_TARGET, - width: 40, alignItems: 'center', justifyContent: 'center', - borderRadius: radii.control + borderRadius: radii.pill, + flexShrink: 0 }, - lastIconAction: { - width: MIN_TOUCH_TARGET + // The fold row: "N more ▼" under the first message, "Show less ▲" under the open list. + foldToggle: { + minHeight: MIN_TOUCH_TARGET, + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + gap: 6, + paddingHorizontal: spacing.md, + borderTopWidth: StyleSheet.hairlineWidth, + borderTopColor: colors.composerBorder + }, + foldLabel: { + color: colors.textSecondary, + fontSize: typography.metaSize, + fontWeight: '500', + flexShrink: 1 }, actionLabel: { color: colors.textPrimary, @@ -175,6 +221,11 @@ export const queuedMessageStyles = themedStyleSheet(() => ({ pressed: { backgroundColor: colors.bgRaised }, + // The head card the composer's Steer queued would send; translucent so its Steer pill still shows. + lit: { + backgroundColor: colors.translucentFill + }, + // The lit row's Steer pill fills like the composer's primary (orca #40820). litAction: { backgroundColor: colors.surfaceBright }, diff --git a/mobile/src/session/native-chat/input/mobile-queued-row-frame.ts b/mobile/src/session/native-chat/input/mobile-queued-row-frame.ts new file mode 100644 index 00000000000..75e169bec58 --- /dev/null +++ b/mobile/src/session/native-chat/input/mobile-queued-row-frame.ts @@ -0,0 +1,91 @@ +import { useEffect, useLayoutEffect, useRef } from 'react' +import type { LayoutRectangle } from 'react-native' + +/** Where a row sits in the queue's scroll content: rows stack in order, so it starts below those before it. */ +export function queuedRowFrame( + messageIds: readonly string[], + heights: ReadonlyMap, + targetId: string | null +): LayoutRectangle | null { + const index = targetId === null ? -1 : messageIds.indexOf(targetId) + if (index === -1) { + return null + } + let top = 0 + for (const [at, messageId] of messageIds.entries()) { + const height = heights.get(messageId) + // Not every row has laid out yet. + if (height === undefined) { + return null + } + if (at === index) { + return { x: 0, y: top, width: 0, height } + } + top += height + } + return null +} + +/** How long a requested row waits for its own fresh height before the list settles on the heights it has. */ +export const QUEUED_ROW_SHOW_SETTLE_MS = 300 + +type ShowRow = (row: LayoutRectangle) => void + +/** + * Scrolls the queue to one row (a failure that opened the list) once that row has laid out again. + * A row whose height never changes reports no layout, so the request settles shortly after either way. + */ +export function useQueuedRowShow( + showId: string | null, + setShowId: (messageId: null) => void, + /** The queue's current order; a reorder moves rows by transform and lays none of them out. */ + messageIds: readonly string[] +) { + const heights = useRef(new Map()) + // Rows that reported since the current request, so an old height never places the row asked for. + const fresh = useRef(new Set()) + const lastShow = useRef(null) + // Whether the list was open when its rows last laid out; only shown rows lay out. + const shownAll = useRef(false) + const order = useRef(messageIds) + useLayoutEffect(() => { + order.current = messageIds + }) + useLayoutEffect(() => { + fresh.current.clear() + }, [showId]) + useEffect(() => { + if (showId === null) { + return + } + const timer = setTimeout(() => { + const frame = shownAll.current ? queuedRowFrame(order.current, heights.current, showId) : null + setShowId(null) + if (frame) { + lastShow.current?.(frame) + } + }, QUEUED_ROW_SHOW_SETTLE_MS) + return () => clearTimeout(timer) + }, [showId, setShowId]) + const measureRow = ( + list: { messageIds: readonly string[]; showAll: boolean }, + messageId: string, + height: number, + show: ShowRow + ) => { + const { showAll } = list + shownAll.current = showAll + heights.current.set(messageId, height) + fresh.current.add(messageId) + lastShow.current = show + if (showId === null || !showAll || !fresh.current.has(showId)) { + return + } + const frame = queuedRowFrame(list.messageIds, heights.current, showId) + if (frame) { + setShowId(null) + show(frame) + } + } + return measureRow +} diff --git a/mobile/src/session/native-chat/mobile-native-chat-lower-region-context.ts b/mobile/src/session/native-chat/mobile-native-chat-lower-region-context.ts index 7f509992cf1..b91e835cfc2 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-lower-region-context.ts +++ b/mobile/src/session/native-chat/mobile-native-chat-lower-region-context.ts @@ -26,6 +26,9 @@ export const MobileNativeChatLowerGeometryContext = createContext<{ export const MobileNativeChatComposerPresenceContext = createContext(true) +/** A prompt card sits under the queue: the queue closes its own box instead of tucking into a composer. */ +export const MobileNativeChatQueueAbovePromptContext = createContext(false) + export function useMobileNativeChatLowerGeometry() { return useContext(MobileNativeChatLowerGeometryContext) } diff --git a/mobile/src/session/native-chat/transcript/MobileAgentMessageSenders.tsx b/mobile/src/session/native-chat/transcript/MobileAgentMessageSenders.tsx index 15a43c29405..c504ab8c905 100644 --- a/mobile/src/session/native-chat/transcript/MobileAgentMessageSenders.tsx +++ b/mobile/src/session/native-chat/transcript/MobileAgentMessageSenders.tsx @@ -20,11 +20,14 @@ const QUEUED_HIT_SLOP = { top: 8, bottom: 8 } export function MobileAgentMessageSenders({ from, compact = false, - queued = false + queued = false, + bare = false }: { from: AgentMessageSource compact?: boolean queued?: boolean + /** Names only, without the queued line's "From": the row draws its own lead. */ + bare?: boolean }) { const open = useContext(MobileAgentMessageOpenContext) const t = useMobileTranslation() @@ -36,7 +39,7 @@ export function MobileAgentMessageSenders({ pointerEvents="box-none" style={[styles.senders, compact && styles.compactSenders, queued && styles.queuedSenders]} > - {queued ? ( + {queued && !bare ? ( {t('session.agentMessageAttribution.fromSender', 'From')} @@ -45,7 +48,7 @@ export function MobileAgentMessageSenders({ {unnamed} @@ -67,7 +70,7 @@ export function MobileAgentMessageSenders({ /> {/* Outside the name, so truncating a long name keeps "A…, B". */} {queued && index < shown.length - 1 ? ( - , + , ) : null} ) @@ -75,7 +78,7 @@ export function MobileAgentMessageSenders({ {more > 0 ? ( +{more} @@ -119,7 +122,11 @@ function SenderName({ > {name} diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatRowList.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatRowList.tsx index 23e0a96d184..f7cbe97c7d3 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatRowList.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatRowList.tsx @@ -1,5 +1,7 @@ import type { ComponentProps, ReactElement } from 'react' import { FlatList, Platform } from 'react-native' +import type { LegacyComposedGesture } from 'react-native-gesture-handler' +import { MobileNativeChatPinchZoom } from './mobile-native-chat-pinch-zoom' import type { MobileNativeChatRowKeys } from './mobile-native-chat-row-keys' import { MobileNativeChatPageList } from './MobileNativeChatPageList' import { @@ -27,6 +29,7 @@ type Props = Pick< rowKeys: MobileNativeChatRowKeys /** With a header, the row below it anchors the native list's visible content. */ hasHeader: boolean + pinchGesture: LegacyComposedGesture } export function MobileNativeChatRowList(props: Props): ReactElement { @@ -35,35 +38,39 @@ export function MobileNativeChatRowList(props: Props): ReactElement { if (Platform.OS === 'web') { const { roots, runs, layoutKey, onNearTop } = props return ( - + + + ) } return ( - + + + ) } diff --git a/mobile/src/session/native-chat/transcript/mobile-agent-message-card-styles.ts b/mobile/src/session/native-chat/transcript/mobile-agent-message-card-styles.ts index 4eb7c38f6ec..d7918d8da7e 100644 --- a/mobile/src/session/native-chat/transcript/mobile-agent-message-card-styles.ts +++ b/mobile/src/session/native-chat/transcript/mobile-agent-message-card-styles.ts @@ -37,6 +37,7 @@ export const styles = themedStyleSheet(() => ({ queuedSenders: { flexWrap: 'nowrap', alignItems: 'center', maxWidth: '100%' }, queuedSender: { minWidth: 0, flexShrink: 1 }, queuedLead: { flexShrink: 0 }, + queuedMeta: { color: colors.textSecondary }, queuedComma: { flexShrink: 0, marginLeft: -spacing.xs }, queuedOpenableName: { color: colors.textPrimary }, name: { diff --git a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-pinch-gesture.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-pinch-zoom.tsx similarity index 64% rename from mobile/src/session/native-chat/transcript/use-mobile-native-chat-pinch-gesture.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-pinch-zoom.tsx index 13dc49e9ee1..b6e60b0cc4e 100644 --- a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-pinch-gesture.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-pinch-zoom.tsx @@ -1,5 +1,5 @@ -import { useMemo, useRef, useState } from 'react' -import { Gesture } from 'react-native-gesture-handler' +import { useMemo, useRef, useState, type ComponentProps, type ReactNode } from 'react' +import { Gesture, GestureDetector } from 'react-native-gesture-handler' import type { LegacyComposedGesture } from 'react-native-gesture-handler' import { quantizeFontScale } from './mobile-native-chat-message-text' @@ -39,3 +39,21 @@ export function useMobileNativeChatPinchGesture(scopeKey: string): { return { fontScale, pinchGesture } } + +// Web: gesture handler 3 defaults to touch-action: none (froze touch scrolling); auto would let a pinch zoom the page instead of the text. +// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: valid CSS that the handler copies verbatim to style.touchAction; its union lists single keywords only. +const PAN_WITHOUT_PAGE_ZOOM = 'pan-x pan-y' as ComponentProps['touchAction'] + +export function MobileNativeChatPinchZoom({ + gesture, + children +}: { + gesture: LegacyComposedGesture + children: ReactNode +}) { + return ( + + {children} + + ) +} diff --git a/mobile/src/session/native-chat/use-mobile-native-chat-markdown-links.ts b/mobile/src/session/native-chat/use-mobile-native-chat-markdown-links.ts index d8ad6f990d2..a6a992793d9 100644 --- a/mobile/src/session/native-chat/use-mobile-native-chat-markdown-links.ts +++ b/mobile/src/session/native-chat/use-mobile-native-chat-markdown-links.ts @@ -4,8 +4,8 @@ import { relativePathInsideRoot } from '../../../../src/shared/cross-platform-pa import { githubReferenceRepo, type GitHubRepoReference -} from '../../../../src/shared/github/github-reference-links' -import { githubRepoIdentityKey } from '../../../../src/shared/github/repository-identity-key' +} from '../../../../src/shared/github/markdown/github-reference-links' +import { githubRepoIdentityKey } from '../../../../src/shared/github/repositories/repository-identity-key' import { createNativeChatFileLinkChecker, type NativeChatFileLinkExistence diff --git a/mobile/src/session/use-mobile-session-foundation.ts b/mobile/src/session/use-mobile-session-foundation.ts index cdc21bbabb0..9f54449fcda 100644 --- a/mobile/src/session/use-mobile-session-foundation.ts +++ b/mobile/src/session/use-mobile-session-foundation.ts @@ -2,6 +2,7 @@ import { useState } from 'react' import { useSafeAreaInsets } from 'react-native-safe-area-context' import { useLocalSearchParams } from 'expo-router' import { useRouteHandoff } from '../navigation/route-handoff' +import { STANDALONE_SESSION_PARAM } from '../navigation/host-stack-navigation' import { HOST_DOCK_MIN_WIDTH } from '../storage/preferences' import { useForceReconnect } from '../transport/connection/host-client-hooks' import { useWorkspaceClient } from '../worktree/use-workspace-client' @@ -24,13 +25,15 @@ export function useMobileSessionFoundation() { worktreeId, name: routeWorktreeName, created, - warning: createdWarning + warning: createdWarning, + [STANDALONE_SESSION_PARAM]: standaloneParam } = useLocalSearchParams<{ hostId: string worktreeId: string name?: string created?: string warning?: string + [STANDALONE_SESSION_PARAM]?: string }>() const isFolderWorkspaceRoute = worktreeId.startsWith('folder:') const isFloatingWorkspaceRoute = isFloatingWorkspaceWorktreeId(worktreeId) @@ -102,6 +105,7 @@ export function useMobileSessionFoundation() { isFolderWorkspaceRoute, isFloatingWorkspaceRoute, router, + standalone: standaloneParam === '1', insets, client, clientId, diff --git a/mobile/src/source-control/mobile-open-pr-prefill.test.ts b/mobile/src/source-control/mobile-open-pr-prefill.test.ts deleted file mode 100644 index a3f67fde7f1..00000000000 --- a/mobile/src/source-control/mobile-open-pr-prefill.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import { readFreshGitStatus } from './mobile-open-pr-prefill' -import type { MobileGitStatusResult } from './mobile-git-status' - -const fallback = { branch: 'old', entries: [] } as unknown as MobileGitStatusResult - -describe('readFreshGitStatus', () => { - it('returns the freshly-read status when parseable', async () => { - const fresh = { - branch: 'feat', - head: 'sha', - entries: [], - upstreamStatus: { hasUpstream: true, ahead: 1, behind: 0 } - } - const send = vi.fn(async () => fresh) - const out = await readFreshGitStatus('w', fallback, send as never) - expect(out?.branch).toBe('feat') - expect(out?.upstreamStatus).toEqual({ hasUpstream: true, ahead: 1, behind: 0 }) - expect(send).toHaveBeenCalledWith('git.status', { worktree: 'id:w' }) - }) - - it('falls back to the captured status when the read is unparseable', async () => { - const send = vi.fn(async () => null) - const out = await readFreshGitStatus('w', fallback, send as never) - expect(out).toBe(fallback) - }) - - it('falls back to the captured status when the read rejects', async () => { - const send = vi.fn(async () => { - throw new Error('transport closed') - }) - const out = await readFreshGitStatus('w', fallback, send as never) - expect(out).toBe(fallback) - }) -}) diff --git a/mobile/src/source-control/mobile-source-control-next-step.ts b/mobile/src/source-control/mobile-source-control-next-step.ts index 5cff6d51750..e0588541413 100644 --- a/mobile/src/source-control/mobile-source-control-next-step.ts +++ b/mobile/src/source-control/mobile-source-control-next-step.ts @@ -1,8 +1,8 @@ import { translate } from '../i18n/mobile-i18n' -import type { PRInfo } from '../../../src/shared/github/pull-request-types' -import { resolveGitHubPRMergeMethods } from '../../../src/shared/github/pull-request-merge-methods' -import { getGitHubPRPrimaryReviewer } from '../../../src/shared/github/pr-reviewer-display' -import type { GitHubWorkItemDetails } from '../../../src/shared/github/work-item-types' +import type { PRInfo } from '../../../src/shared/github/pull-requests/pull-request-types' +import { resolveGitHubPRMergeMethods } from '../../../src/shared/github/pull-requests/merge/pull-request-merge-methods' +import { getGitHubPRPrimaryReviewer } from '../../../src/shared/github/pull-requests/pr-reviewer-display' +import type { GitHubWorkItemDetails } from '../../../src/shared/github/work-items/work-item-types' import type { SourceControlNextStep } from '../../../src/shared/source-control/decisions/source-control-next-step-decision' import { presentPrMerge } from '../components/pr-sidebar/pr-actions-state' import type { MobileCreatePrAction } from './mobile-create-pr-action' diff --git a/mobile/src/source-control/mobile-source-control-primary-action.ts b/mobile/src/source-control/mobile-source-control-primary-action.ts index 673a3a3c28e..7e0e77f4e1f 100644 --- a/mobile/src/source-control/mobile-source-control-primary-action.ts +++ b/mobile/src/source-control/mobile-source-control-primary-action.ts @@ -12,7 +12,7 @@ import { hasResolvableHostedReviewPushTargetLink, resolveHostedReviewPushTargetForActions } from '../../../src/shared/source-control/hosted-review/hosted-review-push-target' -import type { PRState } from '../../../src/shared/github/pull-request-types' +import type { PRState } from '../../../src/shared/github/pull-requests/pull-request-types' import type { GitPushTarget } from '../../../src/shared/worktree/types' import type { PrSidebarState } from './review/mobile-pr-sidebar-state' import type { MobileGitBranchCompareResult } from './mobile-branch-compare' diff --git a/mobile/src/source-control/review/github-pr-check-reply-schema.ts b/mobile/src/source-control/review/github-pr-check-reply-schema.ts index 91e1a30fd5d..cf6bc977975 100644 --- a/mobile/src/source-control/review/github-pr-check-reply-schema.ts +++ b/mobile/src/source-control/review/github-pr-check-reply-schema.ts @@ -5,7 +5,7 @@ import type { PRCheckJob, PRCheckRunDetails, PRCheckStep -} from '../../../../src/shared/github/check-types' +} from '../../../../src/shared/github/checks/check-types' import { prCount, prText } from './github-pr-entity-reply-schema' // Require check name; default optional details because hosts may omit fields the panel renders unguarded. diff --git a/mobile/src/source-control/review/github-pr-entity-reply-schema.ts b/mobile/src/source-control/review/github-pr-entity-reply-schema.ts index f8e94b6e966..d573c6c4035 100644 --- a/mobile/src/source-control/review/github-pr-entity-reply-schema.ts +++ b/mobile/src/source-control/review/github-pr-entity-reply-schema.ts @@ -1,16 +1,19 @@ -import { normalizePRCheckHeadSha } from '../../../../src/shared/github/pr-check-head' +import { normalizePRCheckHeadSha } from '../../../../src/shared/github/checks/pr-check-head' import * as z from 'zod' import { openEnum, salvagedOptional, salvagingArray } from '../../../../src/shared/zod-salvage' -import type { GitHubReaction, PRComment } from '../../../../src/shared/github/comment-types' +import type { + GitHubReaction, + PRComment +} from '../../../../src/shared/github/comments/comment-types' import type { GitHubAssignableUser, GitHubPRFile, GitHubPRMergeMethodSettings, GitHubPRReviewSummary, - GitHubRepositoryIdentity, ProviderCheckSummary -} from '../../../../src/shared/github/pull-request-types' -import type { PRCheckDetail } from '../../../../src/shared/github/check-types' +} from '../../../../src/shared/github/pull-requests/pull-request-types' +import type { GitHubRepositoryIdentity } from '../../../../src/shared/github/repositories/repository-identity' +import type { PRCheckDetail } from '../../../../src/shared/github/checks/check-types' // Require entity identity, salvage malformed list members, and default other fields for unguarded renderers. diff --git a/mobile/src/source-control/review/github-pr-mutations.ts b/mobile/src/source-control/review/github-pr-mutations.ts index 0c2ba0cd587..7c418ffc17b 100644 --- a/mobile/src/source-control/review/github-pr-mutations.ts +++ b/mobile/src/source-control/review/github-pr-mutations.ts @@ -1,4 +1,4 @@ -import type { GitHubPRMergeMethod } from '../../../../src/shared/github/pull-request-types' +import type { GitHubPRMergeMethod } from '../../../../src/shared/github/pull-requests/pull-request-types' import { githubPrAutoMergeSet, githubPrBodySet, diff --git a/mobile/src/source-control/review/github-pr-read-reply-schema.ts b/mobile/src/source-control/review/github-pr-read-reply-schema.ts index ce0776e0c9f..fd64231a220 100644 --- a/mobile/src/source-control/review/github-pr-read-reply-schema.ts +++ b/mobile/src/source-control/review/github-pr-read-reply-schema.ts @@ -1,10 +1,10 @@ import * as z from 'zod' import { salvagedOptional, salvagingArray } from '../../../../src/shared/zod-salvage' -import type { PRInfo } from '../../../../src/shared/github/pull-request-types' +import type { PRInfo } from '../../../../src/shared/github/pull-requests/pull-request-types' import type { GitHubWorkItem, GitHubWorkItemDetails -} from '../../../../src/shared/github/work-item-types' +} from '../../../../src/shared/github/work-items/work-item-types' import type { HostedReviewInfo } from '../../../../src/shared/source-control/hosted-review/hosted-review-contracts' import { CHECK_STATUS, diff --git a/mobile/src/source-control/review/github-pr-rpc.ts b/mobile/src/source-control/review/github-pr-rpc.ts index d8140cc14f4..99e0e2b281b 100644 --- a/mobile/src/source-control/review/github-pr-rpc.ts +++ b/mobile/src/source-control/review/github-pr-rpc.ts @@ -1,16 +1,19 @@ import { GITHUB_CONNECTION_CHANGED, githubOperationResponse } from './github-target-invocation' import { captureMobilePRCheckContract } from './pr-check-observation-contract' -import { acceptPRCheckObservation } from '../../../../src/shared/github/complete-pr-check-owner' +import { acceptPRCheckObservation } from '../../../../src/shared/github/checks/complete-pr-check-owner' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' import { withGitHubTargetOperation } from './github-work-item-operation' -import { requireGitHubWorkItemTargetDetails } from '../../../../src/shared/github/work-item-target' -import type { PRCheckDetail, PRCheckRunDetails } from '../../../../src/shared/github/check-types' +import { requireGitHubWorkItemTargetDetails } from '../../../../src/shared/github/work-items/work-item-target' +import type { + PRCheckDetail, + PRCheckRunDetails +} from '../../../../src/shared/github/checks/check-types' import type { GitHubAssignableUser, - GitHubOwnerRepo, PRInfo -} from '../../../../src/shared/github/pull-request-types' -import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-item-types' +} from '../../../../src/shared/github/pull-requests/pull-request-types' +import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../../../../src/shared/github/repositories/repository-identity' +import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-items/work-item-types' import type { HostedReviewInfo } from '../../../../src/shared/source-control/hosted-review/hosted-review-contracts' import { refusedRpcMessageOrFallback } from '../../transport/rpc/rpc-refusal-message' import type { RpcResponse } from '../../transport/rpc/rpc-wire-types' diff --git a/mobile/src/source-control/review/github-target-invocation.ts b/mobile/src/source-control/review/github-target-invocation.ts index d36bd67fe48..ba534434a69 100644 --- a/mobile/src/source-control/review/github-target-invocation.ts +++ b/mobile/src/source-control/review/github-target-invocation.ts @@ -6,7 +6,7 @@ import type { SendRequestOptions } from '../../transport/rpc/unvalidated-rpc-req import type { RpcResponse } from '../../transport/rpc/rpc-wire-types' import { readConnectionStatusProbe } from '../../transport/connection/runtime-status-probe' import { GITHUB_EXACT_WORK_ITEM_TARGET_RUNTIME_CAPABILITY } from '../../../../src/shared/source-control/runtime/source-control-runtime-capabilities' -import { GITHUB_EXACT_OPERATION_UNSUPPORTED } from '../../../../src/shared/github/work-item-target' +import { GITHUB_EXACT_OPERATION_UNSUPPORTED } from '../../../../src/shared/github/work-items/work-item-target' export const GITHUB_CONNECTION_CHANGED = 'The Orca server connection changed. Try again.' export const GITHUB_TARGET_CHECK_TIMED_OUT = 'Timed out confirming the executing Orca server.' diff --git a/mobile/src/source-control/review/github-work-item-operation.ts b/mobile/src/source-control/review/github-work-item-operation.ts index a7acc260312..01ce2fc1789 100644 --- a/mobile/src/source-control/review/github-work-item-operation.ts +++ b/mobile/src/source-control/review/github-work-item-operation.ts @@ -1,12 +1,12 @@ import type { RpcClient } from '../../transport/rpc/rpc-client-contract' import type { SendRequestOptions } from '../../transport/rpc/unvalidated-rpc-request-port' -import type { GitHubOwnerRepo } from '../../../../src/shared/github/pull-request-types' +import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../../../../src/shared/github/repositories/repository-identity' import { hasReachedAppVersion } from '../../../../src/shared/app-version' import { GITHUB_EXACT_OPERATION_UNSUPPORTED, matchesGitHubWorkItemTarget, type GitHubWorkItemTarget -} from '../../../../src/shared/github/work-item-target' +} from '../../../../src/shared/github/work-items/work-item-target' import { captureGitHubInvocation, GITHUB_DESKTOP_UPDATE_REQUIRED, diff --git a/mobile/src/source-control/review/mobile-diff-review-github.test.ts b/mobile/src/source-control/review/mobile-diff-review-github.test.ts index d9562349ab7..f54b9059306 100644 --- a/mobile/src/source-control/review/mobile-diff-review-github.test.ts +++ b/mobile/src/source-control/review/mobile-diff-review-github.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import type { PRComment } from '../../../../src/shared/github/comment-types' -import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-item-types' +import type { PRComment } from '../../../../src/shared/github/comments/comment-types' +import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-items/work-item-types' import { buildMobileDiffReviewQueue } from './mobile-diff-review-queue' import { buildMobileDiffReviewGitHub, canCommentOnGitHub } from './mobile-diff-review-github' diff --git a/mobile/src/source-control/review/mobile-diff-review-github.ts b/mobile/src/source-control/review/mobile-diff-review-github.ts index cf06b10ec2b..c8d5e220d0a 100644 --- a/mobile/src/source-control/review/mobile-diff-review-github.ts +++ b/mobile/src/source-control/review/mobile-diff-review-github.ts @@ -1,6 +1,6 @@ -import type { GitHubPRFile } from '../../../../src/shared/github/pull-request-types' -import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-item-types' -import { getPRInlineCommentPlacement } from '../../../../src/shared/github/pr-inline-comment-placement' +import type { GitHubPRFile } from '../../../../src/shared/github/pull-requests/pull-request-types' +import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-items/work-item-types' +import { getPRInlineCommentPlacement } from '../../../../src/shared/github/comments/pr-inline-comment-placement' import { groupPRComments, type PRCommentGroup diff --git a/mobile/src/source-control/review/mobile-diff-review-state.test.ts b/mobile/src/source-control/review/mobile-diff-review-state.test.ts index 20e73ecedc3..774529c1ec4 100644 --- a/mobile/src/source-control/review/mobile-diff-review-state.test.ts +++ b/mobile/src/source-control/review/mobile-diff-review-state.test.ts @@ -14,15 +14,6 @@ const descriptor = { } as const describe('mobile diff review state', () => { - it('invalidates reviewed state when refreshed identity changes', () => { - const reviewed = markMobileDiffReviewFileReviewed(createMobileDiffReviewState(1), descriptor, 5) - - const merged = mergeMobileDiffReviewState(reviewed, [{ ...descriptor, diffIdentity: 'd2' }], 8) - - expect(merged.files[descriptor.key]?.reviewedAt).toBeUndefined() - expect(merged.files[descriptor.key]?.reviewDiffIdentity).toBeUndefined() - }) - it('drops completion when a refreshed identity invalidates a reviewed file', () => { const reviewed = markMobileDiffReviewFileReviewed(createMobileDiffReviewState(1), descriptor, 5) const completed = completeMobileDiffReviewState(reviewed, 6) diff --git a/mobile/src/source-control/review/mobile-pr-queries.ts b/mobile/src/source-control/review/mobile-pr-queries.ts index adec08baecd..358c53055fa 100644 --- a/mobile/src/source-control/review/mobile-pr-queries.ts +++ b/mobile/src/source-control/review/mobile-pr-queries.ts @@ -1,20 +1,20 @@ import type { QueryClient, QueryKey } from '@tanstack/react-query' -import type { PRComment } from '../../../../src/shared/github/comment-types' -import type { PRCheckDetail } from '../../../../src/shared/github/check-types' +import type { PRComment } from '../../../../src/shared/github/comments/comment-types' +import type { PRCheckDetail } from '../../../../src/shared/github/checks/check-types' import { acceptPRCheckObservation, completePRCheckOwnerScope -} from '../../../../src/shared/github/complete-pr-check-owner' +} from '../../../../src/shared/github/checks/complete-pr-check-owner' import type { GitHubAssignableUser, - GitHubOwnerRepo, PRInfo -} from '../../../../src/shared/github/pull-request-types' +} from '../../../../src/shared/github/pull-requests/pull-request-types' +import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../../../../src/shared/github/repositories/repository-identity' import { matchesGitHubWorkItemTarget, resolveGitHubWorkItemTarget -} from '../../../../src/shared/github/work-item-target' -import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-item-types' +} from '../../../../src/shared/github/work-items/work-item-target' +import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-items/work-item-types' import { LOCAL_EXECUTION_HOST_ID } from '../../../../src/shared/execution-host' import { worktreeIdsEqual } from '../../../../src/shared/worktree/id' import { defineHostQuery, type HostQuerySignal, type HostSignalEvent } from '../../query/host-query' diff --git a/mobile/src/source-control/review/mobile-pr-sidebar-state.ts b/mobile/src/source-control/review/mobile-pr-sidebar-state.ts index 5038ee8801d..40e8dd0c50d 100644 --- a/mobile/src/source-control/review/mobile-pr-sidebar-state.ts +++ b/mobile/src/source-control/review/mobile-pr-sidebar-state.ts @@ -1,11 +1,11 @@ import { resolveGitHubWorkItemTarget, githubWorkItemTargetKey -} from '../../../../src/shared/github/work-item-target' -import type { PRCheckDetail } from '../../../../src/shared/github/check-types' -import type { PRInfo } from '../../../../src/shared/github/pull-request-types' +} from '../../../../src/shared/github/work-items/work-item-target' +import type { PRCheckDetail } from '../../../../src/shared/github/checks/check-types' +import type { PRInfo } from '../../../../src/shared/github/pull-requests/pull-request-types' import type { GitPushTarget } from '../../../../src/shared/worktree/types' -import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-item-types' +import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-items/work-item-types' import type { HostedReviewInfo } from '../../../../src/shared/source-control/hosted-review/hosted-review-contracts' import type { GitHubPrReadOutcome } from './github-pr-rpc' import { isGitHubPRSuppressed } from '../../../../src/shared/worktree/github-pr-suppression' @@ -13,13 +13,13 @@ import { prBranchFallbackNeedsHint, resolvePRBranchFallback, shouldAcceptMergedFallbackPR -} from '../../../../src/shared/github/pr-branch-fallback-rule' +} from '../../../../src/shared/github/pull-requests/refresh/pr-branch-fallback-rule' import { shouldApplyBranchMismatchedLinkedPRClear, shouldApplyDivergedLinkedPRClear, shouldClearBranchMismatchedLinkedOpenPR, shouldClearDivergedLinkedMergedPR -} from '../../../../src/shared/github/linked-pr-staleness' +} from '../../../../src/shared/github/pull-requests/refresh/linked-pr-staleness' import type { MobileWorktreeSummary } from '../mobile-worktree-metadata-operations' import type { WorktreeGitHubPRLink } from '../mobile-pr-link' import { translate } from '../../i18n/mobile-i18n' diff --git a/mobile/src/source-control/review/pr-action-mutation-contract.ts b/mobile/src/source-control/review/pr-action-mutation-contract.ts index 89e97dd8185..83322cf9961 100644 --- a/mobile/src/source-control/review/pr-action-mutation-contract.ts +++ b/mobile/src/source-control/review/pr-action-mutation-contract.ts @@ -1,4 +1,4 @@ -import type { GitHubPRMergeMethod } from '../../../../src/shared/github/pull-request-types' +import type { GitHubPRMergeMethod } from '../../../../src/shared/github/pull-requests/pull-request-types' import type { GitHubPrMutationOutcome } from './github-pr-mutation-outcome' import type { GitHubPrRepoSlug } from './github-pr-repo-slug' diff --git a/mobile/src/source-control/review/pr-actions-engine.ts b/mobile/src/source-control/review/pr-actions-engine.ts index 1adcd578666..d916ccbf0e2 100644 --- a/mobile/src/source-control/review/pr-actions-engine.ts +++ b/mobile/src/source-control/review/pr-actions-engine.ts @@ -1,5 +1,8 @@ -import type { GitHubPRMergeMethod, PRState } from '../../../../src/shared/github/pull-request-types' -import { githubRepoIdentityKey } from '../../../../src/shared/github/repository-identity-key' +import type { + GitHubPRMergeMethod, + PRState +} from '../../../../src/shared/github/pull-requests/pull-request-types' +import { githubRepoIdentityKey } from '../../../../src/shared/github/repositories/repository-identity-key' import { classifyPrSidebarFailure } from './mobile-pr-sidebar-state' import { createOptimisticField, type OptimisticField } from './optimistic-write-sequence' import type { GitHubPrMutationOutcome } from './github-pr-mutation-outcome' diff --git a/mobile/src/source-control/review/pr-ai-triage-prompt.ts b/mobile/src/source-control/review/pr-ai-triage-prompt.ts index d5712e1b2d5..4f74eb71aa8 100644 --- a/mobile/src/source-control/review/pr-ai-triage-prompt.ts +++ b/mobile/src/source-control/review/pr-ai-triage-prompt.ts @@ -3,12 +3,15 @@ import { collectFixChecksPromptDetails, hasGitHubCheckHandle } from '../../../../src/shared/source-control/checks/pr-checks-fix-prompt' -import type { PRInfo } from '../../../../src/shared/github/pull-request-types' +import type { PRInfo } from '../../../../src/shared/github/pull-requests/pull-request-types' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' import { fetchPRCheckDetails } from './github-pr-rpc' import { splitWorktreeIdForFilesystem } from '../../../../src/shared/worktree/id' import { buildResolvePullRequestConflictsPrompt } from '../../../../src/shared/source-control/recovery/source-control-conflict-prompts' -import type { PRCheckDetail, PRCheckRunDetails } from '../../../../src/shared/github/check-types' +import type { + PRCheckDetail, + PRCheckRunDetails +} from '../../../../src/shared/github/checks/check-types' // Like desktop, the agent gets the failing steps' log tails, not just check names. export async function buildFixChecksPrompt(input: { diff --git a/mobile/src/source-control/review/pr-comment-actions.ts b/mobile/src/source-control/review/pr-comment-actions.ts index 536edb7c4e1..96f02cc8d8a 100644 --- a/mobile/src/source-control/review/pr-comment-actions.ts +++ b/mobile/src/source-control/review/pr-comment-actions.ts @@ -1,6 +1,7 @@ -import type { PRComment } from '../../../../src/shared/github/comment-types' -import { isMutablePRConversationComment } from '../../../../src/shared/github/pr-comment-mutability' -import type { GitHubOwnerRepo, PRState } from '../../../../src/shared/github/pull-request-types' +import type { PRComment } from '../../../../src/shared/github/comments/comment-types' +import { isMutablePRConversationComment } from '../../../../src/shared/github/comments/pr-comment-mutability' +import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../../../../src/shared/github/repositories/repository-identity' +import type { PRState } from '../../../../src/shared/github/pull-requests/pull-request-types' // Only inline review threads have resolvable node ids; conversation comments cannot resolve. export function isResolvableComment(comment: Pick): boolean { diff --git a/mobile/src/source-control/review/pr-comment-writes.ts b/mobile/src/source-control/review/pr-comment-writes.ts index 8aacbe331f7..85f722bdb3d 100644 --- a/mobile/src/source-control/review/pr-comment-writes.ts +++ b/mobile/src/source-control/review/pr-comment-writes.ts @@ -1,6 +1,6 @@ import { hashKey, type QueryClient, type QueryKey } from '@tanstack/react-query' -import type { PRComment } from '../../../../src/shared/github/comment-types' -import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-item-types' +import type { PRComment } from '../../../../src/shared/github/comments/comment-types' +import type { GitHubWorkItemDetails } from '../../../../src/shared/github/work-items/work-item-types' import { defineHostMutation } from '../../query/host-mutation' import { translate } from '../../i18n/mobile-i18n' import { isLogicalClientCutoverError } from '../../transport/connection/logical-client-cutover-error' diff --git a/mobile/src/source-control/review/pr-title-edit.ts b/mobile/src/source-control/review/pr-title-edit.ts index 13dde88cf05..add4fc90b0a 100644 --- a/mobile/src/source-control/review/pr-title-edit.ts +++ b/mobile/src/source-control/review/pr-title-edit.ts @@ -1,4 +1,4 @@ -import type { PRState } from '../../../../src/shared/github/pull-request-types' +import type { PRState } from '../../../../src/shared/github/pull-requests/pull-request-types' export function canEditPRTitle(state: PRState | null | undefined): boolean { return state === 'open' || state === 'draft' diff --git a/mobile/src/source-control/review/use-mobile-pr-comment-actions.ts b/mobile/src/source-control/review/use-mobile-pr-comment-actions.ts index d1f83cd1e96..de7ca0658c3 100644 --- a/mobile/src/source-control/review/use-mobile-pr-comment-actions.ts +++ b/mobile/src/source-control/review/use-mobile-pr-comment-actions.ts @@ -1,5 +1,5 @@ import { useCallback, useMemo, useRef, useState } from 'react' -import type { PRComment } from '../../../../src/shared/github/comment-types' +import type { PRComment } from '../../../../src/shared/github/comments/comment-types' import type { ConnectionState } from '../../transport/connection/connection-state' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' import type { GitHubPrRepoSlug } from './github-pr-repo-slug' diff --git a/mobile/src/source-control/review/use-mobile-pr-sidebar-controller.ts b/mobile/src/source-control/review/use-mobile-pr-sidebar-controller.ts index cc7973fcca1..70f70ebe2aa 100644 --- a/mobile/src/source-control/review/use-mobile-pr-sidebar-controller.ts +++ b/mobile/src/source-control/review/use-mobile-pr-sidebar-controller.ts @@ -1,6 +1,6 @@ import { useCallback, useEffect, useMemo, useState } from 'react' import { useQueryClient, type UseQueryResult } from '@tanstack/react-query' -import type { GitHubPRFileViewedState } from '../../../../src/shared/github/pull-request-types' +import type { GitHubPRFileViewedState } from '../../../../src/shared/github/pull-requests/pull-request-types' import { useWorkspaceExecutionHost } from '../../navigation/workspace-execution-host' import { readHostQueryLive, useHostQuery } from '../../query/host-query' import { isHostNotConnectedError } from '../../query/host-query-errors' diff --git a/mobile/src/source-control/review/use-mobile-pr-text-action.ts b/mobile/src/source-control/review/use-mobile-pr-text-action.ts index 1cdbb6cea44..c77b49bc46f 100644 --- a/mobile/src/source-control/review/use-mobile-pr-text-action.ts +++ b/mobile/src/source-control/review/use-mobile-pr-text-action.ts @@ -1,6 +1,6 @@ import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react' import type { QueryClient, QueryKey } from '@tanstack/react-query' -import { githubRepoIdentityKey } from '../../../../src/shared/github/repository-identity-key' +import { githubRepoIdentityKey } from '../../../../src/shared/github/repositories/repository-identity-key' import type { ConnectionState } from '../../transport/connection/connection-state' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' import type { GitHubPrRepoSlug } from './github-pr-repo-slug' diff --git a/mobile/src/source-control/use-mobile-source-control-next-step.ts b/mobile/src/source-control/use-mobile-source-control-next-step.ts index de02dc11052..a845e1f421c 100644 --- a/mobile/src/source-control/use-mobile-source-control-next-step.ts +++ b/mobile/src/source-control/use-mobile-source-control-next-step.ts @@ -13,8 +13,8 @@ import { } from './review/pr-ai-triage-prompt' import type { PrSidebarState } from './review/mobile-pr-sidebar-state' import { buildResolveConflictsPrompt } from '../../../src/shared/source-control/recovery/source-control-conflict-prompts' -import { resolveGitHubPRMergeMethods } from '../../../src/shared/github/pull-request-merge-methods' -import type { GitHubPRMergeMethod } from '../../../src/shared/github/pull-request-types' +import { resolveGitHubPRMergeMethods } from '../../../src/shared/github/pull-requests/merge/pull-request-merge-methods' +import type { GitHubPRMergeMethod } from '../../../src/shared/github/pull-requests/pull-request-types' import { summarizeProviderChecks } from '../../../src/shared/source-control/checks/provider-check-summary' import { getBrokenChecks } from '../../../src/shared/source-control/checks/pr-checks-fix-prompt' import { resolveSourceControlCommitAreaPrimaryActionDecision } from '../../../src/shared/source-control/decisions/source-control-primary-action-decision' diff --git a/mobile/src/tasks/hosted-review/github-check-summary.ts b/mobile/src/tasks/hosted-review/github-check-summary.ts index 352b10c9ea4..c19ea8a7a21 100644 --- a/mobile/src/tasks/hosted-review/github-check-summary.ts +++ b/mobile/src/tasks/hosted-review/github-check-summary.ts @@ -1,5 +1,5 @@ import { summarizeProviderChecks } from '../../../../src/shared/source-control/checks/provider-check-summary' -import type { ProviderCheckSummary as GitHubCheckSummary } from '../../../../src/shared/github/pull-request-types' +import type { ProviderCheckSummary as GitHubCheckSummary } from '../../../../src/shared/github/pull-requests/pull-request-types' export type GitHubCheckLike = { status: string diff --git a/mobile/src/tasks/hosted-review/gitlab-check-summary.ts b/mobile/src/tasks/hosted-review/gitlab-check-summary.ts index 396c9512d1d..b72bf8e61fd 100644 --- a/mobile/src/tasks/hosted-review/gitlab-check-summary.ts +++ b/mobile/src/tasks/hosted-review/gitlab-check-summary.ts @@ -3,7 +3,7 @@ import { gitLabPipelineJobOutcome } from '../../../../src/shared/source-control/checks/gitlab/gitlab-pipeline-checks' import { summarizeProviderChecks } from '../../../../src/shared/source-control/checks/provider-check-summary' -import type { ProviderCheckSummary } from '../../../../src/shared/github/pull-request-types' +import type { ProviderCheckSummary } from '../../../../src/shared/github/pull-requests/pull-request-types' import type { GitLabPipeline } from '../../../../src/shared/gitlab-types' type GitLabPipelineJobLike = { status: string; allowFailure?: boolean } diff --git a/mobile/src/tasks/hosted-review/mobile-hosted-check-status.ts b/mobile/src/tasks/hosted-review/mobile-hosted-check-status.ts index 50b4cad3845..78c7fecbee8 100644 --- a/mobile/src/tasks/hosted-review/mobile-hosted-check-status.ts +++ b/mobile/src/tasks/hosted-review/mobile-hosted-check-status.ts @@ -1,9 +1,9 @@ import type { PRMergeableState, ProviderCheckSummary -} from '../../../../src/shared/github/pull-request-types' +} from '../../../../src/shared/github/pull-requests/pull-request-types' import { translate } from '../../i18n/mobile-i18n' -import { resolveGitHubPRMergeState } from '../../../../src/shared/github/pull-request-merge-state' +import { resolveGitHubPRMergeState } from '../../../../src/shared/github/pull-requests/merge/pull-request-merge-state' import { getProviderChecksLabel, getProviderChecksOutcome diff --git a/mobile/src/tasks/hosted-review/mobile-task-pr-check-refresh.ts b/mobile/src/tasks/hosted-review/mobile-task-pr-check-refresh.ts index 4f63d8833f4..044dfb615c4 100644 --- a/mobile/src/tasks/hosted-review/mobile-task-pr-check-refresh.ts +++ b/mobile/src/tasks/hosted-review/mobile-task-pr-check-refresh.ts @@ -1,6 +1,6 @@ -import type { GitHubWorkItem } from '../../../../src/shared/github/work-item-types' -import { matchesGitHubWorkItemTarget } from '../../../../src/shared/github/work-item-target' -import { acceptPRCheckObservation } from '../../../../src/shared/github/complete-pr-check-owner' +import type { GitHubWorkItem } from '../../../../src/shared/github/work-items/work-item-types' +import { matchesGitHubWorkItemTarget } from '../../../../src/shared/github/work-items/work-item-target' +import { acceptPRCheckObservation } from '../../../../src/shared/github/checks/complete-pr-check-owner' import { captureMobilePRCheckContract } from '../../source-control/review/pr-check-observation-contract' import { githubWorkItemBySlugRead } from '../providers/mobile-task-source-search-operations' import { diff --git a/mobile/src/tasks/hosted-review/mobile-tasks-hosted-review.ts b/mobile/src/tasks/hosted-review/mobile-tasks-hosted-review.ts index 21ca23ad892..c9885684939 100644 --- a/mobile/src/tasks/hosted-review/mobile-tasks-hosted-review.ts +++ b/mobile/src/tasks/hosted-review/mobile-tasks-hosted-review.ts @@ -13,7 +13,7 @@ import type { GitHubPRReviewerRow, GitHubWorkItem } from '../mobile-tasks-provider-detail-types' -import { GITHUB_PR_MERGE_METHOD_I18N_KEYS } from '../../../../src/shared/github/pull-request-merge-methods' +import { GITHUB_PR_MERGE_METHOD_I18N_KEYS } from '../../../../src/shared/github/pull-requests/merge/pull-request-merge-methods' import { translate } from '../../i18n/mobile-i18n' export const LINEAR_PRIORITY_LABELS: Record = { diff --git a/mobile/src/tasks/item-detail/github-task-identity.ts b/mobile/src/tasks/item-detail/github-task-identity.ts index eaccda22c40..2b9092ba3bf 100644 --- a/mobile/src/tasks/item-detail/github-task-identity.ts +++ b/mobile/src/tasks/item-detail/github-task-identity.ts @@ -8,7 +8,7 @@ import { githubWorkItemTargetKey, resolveGitHubWorkItemTarget, matchesGitHubWorkItemTarget -} from '../../../../src/shared/github/work-item-target' +} from '../../../../src/shared/github/work-items/work-item-target' export function githubTaskKey(source: GitHubWorkItem): string { const target = resolveGitHubWorkItemTarget(source) diff --git a/mobile/src/tasks/item-detail/mobile-tasks-item-mapping.ts b/mobile/src/tasks/item-detail/mobile-tasks-item-mapping.ts index 5df36ae4332..cf0b0d4db87 100644 --- a/mobile/src/tasks/item-detail/mobile-tasks-item-mapping.ts +++ b/mobile/src/tasks/item-detail/mobile-tasks-item-mapping.ts @@ -1,7 +1,7 @@ import { getGitHubTaskKind } from '../../../../src/shared/work-items/task-github-search' import type { RpcSuccess } from '../../transport/rpc/rpc-wire-types' -import type { GitHubOwnerRepo } from '../../../../src/shared/github/pull-request-types' +import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../../../../src/shared/github/repositories/repository-identity' import { colors } from '../../theme/mobile-theme' import type { GitHubPreset, diff --git a/mobile/src/tasks/item-detail/mobile-tasks-reviewer-linear.ts b/mobile/src/tasks/item-detail/mobile-tasks-reviewer-linear.ts index e8a58464dd2..c8784b6815a 100644 --- a/mobile/src/tasks/item-detail/mobile-tasks-reviewer-linear.ts +++ b/mobile/src/tasks/item-detail/mobile-tasks-reviewer-linear.ts @@ -1,4 +1,4 @@ -import type { GitHubOwnerRepo } from '../../../../src/shared/github/pull-request-types' +import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../../../../src/shared/github/repositories/repository-identity' import { colors } from '../../theme/mobile-theme' import { getLinearPriorityLabel, diff --git a/mobile/src/tasks/item-detail/use-mobile-tasks-item-detail-loading.tsx b/mobile/src/tasks/item-detail/use-mobile-tasks-item-detail-loading.tsx index 6363efa7479..9512034d15f 100644 --- a/mobile/src/tasks/item-detail/use-mobile-tasks-item-detail-loading.tsx +++ b/mobile/src/tasks/item-detail/use-mobile-tasks-item-detail-loading.tsx @@ -3,8 +3,8 @@ import { githubTaskKey, requireGitHubTaskTarget } from './github-task-identity' import { matchesGitHubWorkItemTarget, GitHubWorkItemTargetError -} from '../../../../src/shared/github/work-item-target' -import type { ProviderCheckSummary } from '../../../../src/shared/github/pull-request-types' +} from '../../../../src/shared/github/work-items/work-item-target' +import type { ProviderCheckSummary } from '../../../../src/shared/github/pull-requests/pull-request-types' import type { GitLabWorkItem } from '../mobile-tasks-provider-detail-types' import type { ItemDetailMetadataEffectsModel } from './use-mobile-tasks-item-detail-metadata-effects' import { fetchJiraIssueDetail } from '../providers/jira/mobile-jira-task-source' diff --git a/mobile/src/tasks/item-detail/use-mobile-tasks-item-detail-metadata-effects.tsx b/mobile/src/tasks/item-detail/use-mobile-tasks-item-detail-metadata-effects.tsx index 37d80813328..c692ca0a1d7 100644 --- a/mobile/src/tasks/item-detail/use-mobile-tasks-item-detail-metadata-effects.tsx +++ b/mobile/src/tasks/item-detail/use-mobile-tasks-item-detail-metadata-effects.tsx @@ -1,4 +1,4 @@ -import type { GitHubOwnerRepo } from '../../../../src/shared/github/pull-request-types' +import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../../../../src/shared/github/repositories/repository-identity' import type { SendRequestOptions } from '../../transport/rpc/unvalidated-rpc-request-port' import { SHOW_MOBILE_DETAIL_METADATA_EDITORS, diff --git a/mobile/src/tasks/mobile-tasks-provider-detail-types.ts b/mobile/src/tasks/mobile-tasks-provider-detail-types.ts index b0b87212442..d6eada7657c 100644 --- a/mobile/src/tasks/mobile-tasks-provider-detail-types.ts +++ b/mobile/src/tasks/mobile-tasks-provider-detail-types.ts @@ -1,8 +1,6 @@ import type { ExecutionHostId } from '../../../src/shared/execution-host' -import type { - ProviderCheckSummary, - GitHubOwnerRepo -} from '../../../src/shared/github/pull-request-types' +import type { ProviderCheckSummary } from '../../../src/shared/github/pull-requests/pull-request-types' +import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../../../src/shared/github/repositories/repository-identity' import type { RpcClient } from '../transport/rpc/rpc-client-contract' import type { HostedReviewDecision } from '../../../src/shared/source-control/hosted-review/hosted-review-contracts' diff --git a/mobile/src/tasks/mobile-tasks-view-state-types.ts b/mobile/src/tasks/mobile-tasks-view-state-types.ts index 27800645925..e965a680089 100644 --- a/mobile/src/tasks/mobile-tasks-view-state-types.ts +++ b/mobile/src/tasks/mobile-tasks-view-state-types.ts @@ -2,8 +2,8 @@ import type { DetailComment } from './mobile-tasks-provider-detail-types' import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import type { TaskProvider } from '../../../src/shared/work-items/task-providers' import type { GitHubProjectSettings } from './project-board/github-project-reference' -import type { GitHubProjectIdentity as GitHubProjectRef } from '../../../src/shared/github/project-identity' -import type { GitHubProjectSortDirection } from '../../../src/shared/github/project-types' +import type { GitHubProjectIdentity as GitHubProjectRef } from '../../../src/shared/github/projects/project-identity' +import type { GitHubProjectSortDirection } from '../../../src/shared/github/projects/project-types' import type { JiraIssueFilter } from '../../../src/shared/jira/jira-types' export type GitHubTaskKind = 'issues' | 'prs' diff --git a/mobile/src/tasks/project-board/github-project-reference.ts b/mobile/src/tasks/project-board/github-project-reference.ts index b57eac4dd76..ca658df3d7e 100644 --- a/mobile/src/tasks/project-board/github-project-reference.ts +++ b/mobile/src/tasks/project-board/github-project-reference.ts @@ -1,11 +1,11 @@ import { GITHUB_OWNER_NUMBER_SHORTHAND_RE, GITHUB_OWNER_SLUG_RE -} from '../../../../src/shared/github/owner-slug' +} from '../../../../src/shared/github/repositories/owner-slug' import type { GitHubProjectIdentity, GitHubProjectIdentity as GitHubProjectRef -} from '../../../../src/shared/github/project-identity' +} from '../../../../src/shared/github/projects/project-identity' export type GitHubProjectOwnerType = GitHubProjectIdentity['ownerType'] diff --git a/mobile/src/tasks/project-board/github-project-repo-match.ts b/mobile/src/tasks/project-board/github-project-repo-match.ts index fa3c7047614..f81014be34f 100644 --- a/mobile/src/tasks/project-board/github-project-repo-match.ts +++ b/mobile/src/tasks/project-board/github-project-repo-match.ts @@ -1,7 +1,7 @@ import { githubRepoIdentityKey, isDefaultGitHubHost -} from '../../../../src/shared/github/repository-identity-key' +} from '../../../../src/shared/github/repositories/repository-identity-key' export type GitHubProjectRepoMatch = { id: string diff --git a/mobile/src/tasks/project-board/mobile-tasks-github-project-list.tsx b/mobile/src/tasks/project-board/mobile-tasks-github-project-list.tsx index 77f2803ba0a..a83e734afca 100644 --- a/mobile/src/tasks/project-board/mobile-tasks-github-project-list.tsx +++ b/mobile/src/tasks/project-board/mobile-tasks-github-project-list.tsx @@ -1,4 +1,4 @@ -import { projectContentField } from '../../../../src/shared/github/project-content-field' +import { projectContentField } from '../../../../src/shared/github/projects/project-content-field' import type { ConnectionPresentationModel } from '../screen-state/use-mobile-tasks-connection-presentation' import { translate } from '../../i18n/mobile-i18n' import { View, Text, Pressable, FlatList } from 'react-native' diff --git a/mobile/src/tasks/project-board/mobile-tasks-github-project-pickers.tsx b/mobile/src/tasks/project-board/mobile-tasks-github-project-pickers.tsx index f9b63427764..1c06924726a 100644 --- a/mobile/src/tasks/project-board/mobile-tasks-github-project-pickers.tsx +++ b/mobile/src/tasks/project-board/mobile-tasks-github-project-pickers.tsx @@ -10,7 +10,7 @@ import { githubProjectIdentityKey as githubProjectKey, toGitHubProjectIdentity, type GitHubProjectIdentity as GitHubProjectRef -} from '../../../../src/shared/github/project-identity' +} from '../../../../src/shared/github/projects/project-identity' import { PickerModal } from '../../components/PickerModal' import { ListGroup, SectionHeader, ListRow } from '../../components/list/ListGroup' import { styles } from '../mobile-tasks-legacy-styles' diff --git a/mobile/src/tasks/project-board/mobile-tasks-project-fields.ts b/mobile/src/tasks/project-board/mobile-tasks-project-fields.ts index 3be86502923..b71bb5b4745 100644 --- a/mobile/src/tasks/project-board/mobile-tasks-project-fields.ts +++ b/mobile/src/tasks/project-board/mobile-tasks-project-fields.ts @@ -1,11 +1,14 @@ import { projectContentField, projectContentFieldLabel -} from '../../../../src/shared/github/project-content-field' +} from '../../../../src/shared/github/projects/project-content-field' import { translate } from '../../i18n/mobile-i18n' -import type { GitHubProjectTable as SharedGitHubProjectTable } from '../../../../src/shared/github/project-types' -import { isIterationCurrent } from '../../../../src/shared/github/project-group-sort' -import type { ProjectGroup } from '../../../../src/shared/github/project-group-sort' +import type { GitHubProjectTable as SharedGitHubProjectTable } from '../../../../src/shared/github/projects/project-types' +import { + isIterationCurrent, + type ProjectGroup +} from '../../../../src/shared/github/projects/project-group-sort' + import type { ProjectSortOverride } from '../task-list/mobile-tasks-options' import type { GitHubProjectField, diff --git a/mobile/src/tasks/project-board/task-project-board-reply-schema.ts b/mobile/src/tasks/project-board/task-project-board-reply-schema.ts index 38248ba70fd..b8393c1e6ed 100644 --- a/mobile/src/tasks/project-board/task-project-board-reply-schema.ts +++ b/mobile/src/tasks/project-board/task-project-board-reply-schema.ts @@ -1,5 +1,5 @@ import * as z from 'zod' -import type { GitHubProjectOwnerType } from '../../../../src/shared/github/project-types' +import type { GitHubProjectOwnerType } from '../../../../src/shared/github/projects/project-types' import { hostUnionArms, salvagedOptional, salvagingArray } from '../../../../src/shared/zod-salvage' import { assignableUserListSchema, diff --git a/mobile/src/tasks/project-board/use-mobile-tasks-project-loading-actions.tsx b/mobile/src/tasks/project-board/use-mobile-tasks-project-loading-actions.tsx index cd678b2d035..110b3445046 100644 --- a/mobile/src/tasks/project-board/use-mobile-tasks-project-loading-actions.tsx +++ b/mobile/src/tasks/project-board/use-mobile-tasks-project-loading-actions.tsx @@ -11,7 +11,7 @@ import { githubProjectHost, githubProjectIdentityKey as githubProjectKey, toGitHubProjectIdentity -} from '../../../../src/shared/github/project-identity' +} from '../../../../src/shared/github/projects/project-identity' import { useCallback, useRef } from 'react' import type { GitHubProjectTable } from '../mobile-tasks-view-state-types' import { diff --git a/mobile/src/tasks/project-board/use-mobile-tasks-project-projection.tsx b/mobile/src/tasks/project-board/use-mobile-tasks-project-projection.tsx index f83968ced9e..bbeeb26f711 100644 --- a/mobile/src/tasks/project-board/use-mobile-tasks-project-projection.tsx +++ b/mobile/src/tasks/project-board/use-mobile-tasks-project-projection.tsx @@ -3,12 +3,16 @@ import { filterGitHubProjectRowsForRepos, findRepoForGitHubProjectRepository } from './github-project-repo-match' -import { githubProjectHost } from '../../../../src/shared/github/project-identity' +import { githubProjectHost } from '../../../../src/shared/github/projects/project-identity' import { hasSettledHostRepoList } from '../repositories/host-repo-list' import { isHostedTaskRepo } from '../repositories/hosted-repo-selection' import { useCallback, useMemo } from 'react' -import { groupRows, sortRows } from '../../../../src/shared/github/project-group-sort' -import type { ProjectGroup } from '../../../../src/shared/github/project-group-sort' +import { + groupRows, + sortRows, + type ProjectGroup +} from '../../../../src/shared/github/projects/project-group-sort' + import type { GitHubProjectRow } from '../mobile-tasks-view-state-types' import type { ProjectListEntry } from '../task-list/mobile-tasks-options' import type { RepoSummary } from '../mobile-tasks-provider-detail-types' diff --git a/mobile/src/tasks/project-board/use-mobile-tasks-project-repository-resolution.tsx b/mobile/src/tasks/project-board/use-mobile-tasks-project-repository-resolution.tsx index 0d350135d7b..61dfbeab98b 100644 --- a/mobile/src/tasks/project-board/use-mobile-tasks-project-repository-resolution.tsx +++ b/mobile/src/tasks/project-board/use-mobile-tasks-project-repository-resolution.tsx @@ -1,5 +1,5 @@ import type { ProjectProjectionModel } from './use-mobile-tasks-project-projection' -import { githubProjectIdentityKey as githubProjectKey } from '../../../../src/shared/github/project-identity' +import { githubProjectIdentityKey as githubProjectKey } from '../../../../src/shared/github/projects/project-identity' import { useEffect, useMemo } from 'react' import { GITHUB_REPO_CONCURRENCY } from '../task-list/mobile-tasks-options' import { diff --git a/mobile/src/tasks/project-board/use-mobile-tasks-provider-view-projection.tsx b/mobile/src/tasks/project-board/use-mobile-tasks-provider-view-projection.tsx index 46493616781..12d5af852a4 100644 --- a/mobile/src/tasks/project-board/use-mobile-tasks-provider-view-projection.tsx +++ b/mobile/src/tasks/project-board/use-mobile-tasks-provider-view-projection.tsx @@ -3,7 +3,7 @@ import { JIRA_FILTER_LABELS } from '../providers/jira/mobile-jira-issue-filters' import { jiraSiteLabel } from '../providers/jira/jira-mobile-connection' import { useMobileTranslation } from '../../i18n/use-mobile-translation' import type { PickerOption } from '../../components/PickerModal' -import { githubProjectIdentityKey as githubProjectKey } from '../../../../src/shared/github/project-identity' +import { githubProjectIdentityKey as githubProjectKey } from '../../../../src/shared/github/projects/project-identity' import { useCallback, useMemo } from 'react' import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' import { diff --git a/mobile/src/tasks/project-board/use-mobile-tasks-workspace-and-project-state.tsx b/mobile/src/tasks/project-board/use-mobile-tasks-workspace-and-project-state.tsx index da4a7a3f033..0be43209263 100644 --- a/mobile/src/tasks/project-board/use-mobile-tasks-workspace-and-project-state.tsx +++ b/mobile/src/tasks/project-board/use-mobile-tasks-workspace-and-project-state.tsx @@ -10,7 +10,7 @@ import type { GitHubProjectSummary, GitHubProjectViewSummary } from './github-project-reference' -import type { GitHubProjectIdentity as GitHubProjectRef } from '../../../../src/shared/github/project-identity' +import type { GitHubProjectIdentity as GitHubProjectRef } from '../../../../src/shared/github/projects/project-identity' import type { PersistedTrustedOrcaHooks } from '../../../../src/shared/orca-yaml-hook-types' import type { SparsePreset } from '../../../../src/shared/worktree/create-types' import type { WorkspaceAgentChoice } from '../../new-workspace/creation/workspace-agent-selection' diff --git a/mobile/src/tasks/providers/mobile-task-source-search-operations.ts b/mobile/src/tasks/providers/mobile-task-source-search-operations.ts index 611d0829f4b..56c92661178 100644 --- a/mobile/src/tasks/providers/mobile-task-source-search-operations.ts +++ b/mobile/src/tasks/providers/mobile-task-source-search-operations.ts @@ -1,4 +1,4 @@ -import type { GitHubWorkItem } from '../../../../src/shared/github/work-item-types' +import type { GitHubWorkItem } from '../../../../src/shared/github/work-items/work-item-types' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' import type { SendRequestOptions } from '../../transport/rpc/unvalidated-rpc-request-port' import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rpc/rpc-operation' diff --git a/mobile/src/tasks/task-list/mobile-tasks-options.tsx b/mobile/src/tasks/task-list/mobile-tasks-options.tsx index 1236b9c49a3..e2132258242 100644 --- a/mobile/src/tasks/task-list/mobile-tasks-options.tsx +++ b/mobile/src/tasks/task-list/mobile-tasks-options.tsx @@ -4,8 +4,8 @@ import { colors } from '../../theme/mobile-theme' import { getLinkedWorkItemSuggestedName } from '../../new-workspace/creation/mobile-workspace-name' import type { GitHubProjectSettings } from '../project-board/github-project-reference' import type { TaskProvider } from '../../../../src/shared/work-items/task-providers' -import type { GitHubProjectSortDirection } from '../../../../src/shared/github/project-types' -import type { ProjectGroup } from '../../../../src/shared/github/project-group-sort' +import type { GitHubProjectSortDirection } from '../../../../src/shared/github/projects/project-types' +import type { ProjectGroup } from '../../../../src/shared/github/projects/project-group-sort' import type { GitHubMode, GitHubPreset, diff --git a/mobile/src/tasks/task-list/use-mobile-tasks-provider-load-actions.tsx b/mobile/src/tasks/task-list/use-mobile-tasks-provider-load-actions.tsx index a4563f66d7e..9803c3ebda6 100644 --- a/mobile/src/tasks/task-list/use-mobile-tasks-provider-load-actions.tsx +++ b/mobile/src/tasks/task-list/use-mobile-tasks-provider-load-actions.tsx @@ -1,5 +1,5 @@ import type { ClassifiedError } from '../../../../src/shared/classified-error' -import { getWorkItemPageErrorTypes } from '../../../../src/shared/github/work-item-page-errors' +import { getWorkItemPageErrorTypes } from '../../../../src/shared/github/work-items/work-item-page-errors' import type { RuntimeHydrationModel } from '../screen-state/use-mobile-tasks-runtime-hydration' import { readJiraConnection, @@ -12,7 +12,7 @@ import { getWorkItemCountedTotalPages, taskPageToGitHubApiPage } from '../../../../src/shared/work-items/work-item-pagination' -import { isGitHubWorkItemsSshRemoteRequiredError } from '../../../../src/shared/github/work-item-ssh-error' +import { isGitHubWorkItemsSshRemoteRequiredError } from '../../../../src/shared/github/work-items/work-item-ssh-error' import { type GitHubIssueSourceError, type GitHubIssueSourceFallback, diff --git a/mobile/src/tasks/task-provider-entity-reply-schema.ts b/mobile/src/tasks/task-provider-entity-reply-schema.ts index 2b6809dd2cb..b0cb46731da 100644 --- a/mobile/src/tasks/task-provider-entity-reply-schema.ts +++ b/mobile/src/tasks/task-provider-entity-reply-schema.ts @@ -1,6 +1,6 @@ -import { normalizePRCheckHeadSha } from '../../../src/shared/github/pr-check-head' +import { normalizePRCheckHeadSha } from '../../../src/shared/github/checks/pr-check-head' import * as z from 'zod' -import type { GitHubPRFile } from '../../../src/shared/github/pull-request-types' +import type { GitHubPRFile } from '../../../src/shared/github/pull-requests/pull-request-types' import { hostUnionArms, salvagedOptional, salvagingArray } from '../../../src/shared/zod-salvage' import { prCount, diff --git a/mobile/src/terminal/document/document-host-root.test.ts b/mobile/src/terminal/document/document-host-root.test.ts deleted file mode 100644 index f08ac77329a..00000000000 --- a/mobile/src/terminal/document/document-host-root.test.ts +++ /dev/null @@ -1,167 +0,0 @@ -// @vitest-environment happy-dom -import { beforeEach, describe, expect, it } from 'vitest' -import { createTerminalDocument } from './create-terminal-document' -import { terminalDocumentDouble } from './document-terminal-double.test-support' -import { TERMINAL_DOCUMENT_MARKUP } from '../terminal-webview-html' - -function plantHost(id: string) { - const host = document.createElement('div') - host.id = id - host.innerHTML = TERMINAL_DOCUMENT_MARKUP - document.body.appendChild(host) - return host -} - -function startDocumentIn(host: HTMLElement) { - const engine = terminalDocumentDouble() - const posted: Array> = [] - const started = createTerminalDocument({ - root: host, - postToHost: (message) => { - posted.push(message) - }, - hasEngine: () => true, - installHostTransport: () => () => {}, - installErrorReporter: () => () => {}, - paintDocumentBackground: () => {}, - createTerminal: () => engine.terminal, - createUnicode11Addon: () => null, - createWebglAddon: () => null - }) - started.send({ type: 'init', cols: 80, rows: 24, initialData: '', preserveScroll: false }) - return { started, openedOn: engine.openedOn, posted } -} - -type PlantedFinger = { surface: HTMLElement; identifier: number; x?: number; y?: number } - -// Dispatch on document with page-wide touches so both terminal scopes receive the event and must filter ownership. -function fireTouch(type: string, fingers: PlantedFinger[], target: HTMLElement) { - const event = new Event(type, { bubbles: true, cancelable: true }) - Object.defineProperty(event, 'touches', { - value: fingers.map((finger) => ({ - identifier: finger.identifier, - clientX: finger.x ?? 10, - clientY: finger.y ?? 10, - target: finger.surface - })) - }) - Object.defineProperty(event, 'target', { value: target }) - document.dispatchEvent(event) -} - -function fireTwoFingerTouchStart(surface: HTMLElement) { - fireTouch( - 'touchstart', - [ - { surface, identifier: 0, x: 10 }, - { surface, identifier: 1, x: 30 } - ], - surface - ) -} - -function elementOf(host: HTMLElement, id: string) { - const element = host.querySelector(`#${id}`) - if (element === null) { - throw new Error(`${host.id} carries no #${id}`) - } - return element -} - -const surfaceOf = (host: HTMLElement) => elementOf(host, 'terminal-surface') - -function selectAllInBoth(...documents: Array>) { - for (const started of documents) { - started.started.send({ type: 'do-select-all' }) - expect(started.posted.map((message) => message.type)).toContain('set-select-mode') - started.posted.length = 0 - } -} - -const pinchCancels = (posted: Array>) => - posted.filter((message) => message.type === 'mobile-clip-cancel-by-pinch') - -// Stack transitions overlap terminal mounts with duplicate markup ids; assert each engine opens its own host surface. -describe('two terminal documents on one page', () => { - beforeEach(() => { - document.body.innerHTML = '' - }) - - it('opens each engine on the surface inside its own host', () => { - const first = plantHost('first-host') - const second = plantHost('second-host') - - expect(first.querySelector('#terminal-surface')).not.toBe(null) - expect(second.querySelector('#terminal-surface')).not.toBe(null) - - const one = startDocumentIn(first) - const two = startDocumentIn(second) - - expect(first.contains(one.openedOn() ?? null)).toBe(true) - expect(second.contains(two.openedOn() ?? null)).toBe(true) - - one.started.stop() - two.started.stop() - }) - - // A pinch in another host must not clear this terminal’s selection before target filtering. - it('leaves the other document alone when two fingers land in that other host', () => { - const first = plantHost('first-host') - const second = plantHost('second-host') - const one = startDocumentIn(first) - const two = startDocumentIn(second) - selectAllInBoth(one, two) - - fireTwoFingerTouchStart(surfaceOf(second)) - - expect(pinchCancels(one.posted)).toHaveLength(0) - expect(one.posted).toEqual([]) - expect(pinchCancels(two.posted)).toHaveLength(1) - - one.started.stop() - two.started.stop() - }) - - // Event ownership is not enough: page-wide touches must also exclude fingers in the other terminal. - it("does not read another host's finger as its own second one", () => { - const first = plantHost('first-host') - const second = plantHost('second-host') - const one = startDocumentIn(first) - const two = startDocumentIn(second) - selectAllInBoth(two) - const held = { surface: surfaceOf(first), identifier: 0 } - // Use B’s menu pill so a local tap preserves selection; surface taps dismiss it by design. - const pill = elementOf(second, 'selection-overlay') - - fireTouch('touchstart', [held], held.surface) - one.posted.length = 0 - two.posted.length = 0 - fireTouch('touchstart', [held, { surface: pill, identifier: 1 }], pill) - - expect(pinchCancels(two.posted)).toHaveLength(0) - expect(two.posted).toEqual([]) - - one.started.stop() - two.started.stop() - }) - - // A finger in A must not prevent B’s last-finger touchend from firing its tap. - it('fires its own surface tap while the other host still has a finger down', () => { - const first = plantHost('first-host') - const second = plantHost('second-host') - const one = startDocumentIn(first) - const two = startDocumentIn(second) - const held = { surface: surfaceOf(first), identifier: 0 } - const tapping = { surface: surfaceOf(second), identifier: 1, x: 20, y: 5 } - - fireTouch('touchstart', [held], held.surface) - fireTouch('touchstart', [held, tapping], tapping.surface) - two.posted.length = 0 - fireTouch('touchend', [held], tapping.surface) - - expect(two.posted.map((message) => message.type)).toContain('terminal-tap') - - one.started.stop() - two.started.stop() - }) -}) diff --git a/mobile/src/terminal/document/viewport/viewport-frame.test.ts b/mobile/src/terminal/document/viewport/viewport-frame.test.ts deleted file mode 100644 index 3eab8712a04..00000000000 --- a/mobile/src/terminal/document/viewport/viewport-frame.test.ts +++ /dev/null @@ -1,44 +0,0 @@ -// @vitest-environment happy-dom -import { describe, expect, it } from 'vitest' -import { createTerminalDocumentScope, type TerminalDocumentScope } from '../document-scope' -import type { TerminalDocumentHost } from '../document-host-seams' -import { terminalDocumentDouble } from '../document-terminal-double.test-support' -import { computeFitScale } from './viewport-transform' - -const CELL = { width: 7.5, height: 15 } - -function scopeWithGrid(host: TerminalDocumentHost = {}): TerminalDocumentScope { - const scope = createTerminalDocumentScope(host) - const terminal = terminalDocumentDouble().terminal - const cell = () => { - const k = terminal.options.fontSize / 13 - return { width: CELL.width * k, height: CELL.height * k } - } - const grid = Object.assign(terminal, { - cols: 55, - rows: 40, - _core: { - _renderService: { - get dimensions() { - return { css: { cell: cell() } } - } - } - } - }) - grid.resize = (cols: number, rows: number) => { - grid.cols = cols - grid.rows = rows - } - scope.term = grid - return scope -} - -describe("the document's frame on the page", () => { - it('keeps the fit at 1 while the host is hidden and measures 0x0', () => { - // Inactive react-native-screens routes use display:none and have no measurable host box. - const scope = scopeWithGrid({ - viewportRect: () => ({ left: 0, top: 0, width: 0, height: 0 }) - }) - expect(computeFitScale(scope)).toBe(1) - }) -}) diff --git a/mobile/src/terminal/session/use-mobile-terminal-paste.ts b/mobile/src/terminal/session/use-mobile-terminal-paste.ts index fd0ef30d0ef..8d61401c0b3 100644 --- a/mobile/src/terminal/session/use-mobile-terminal-paste.ts +++ b/mobile/src/terminal/session/use-mobile-terminal-paste.ts @@ -12,10 +12,9 @@ import type { RpcClient } from '../../transport/rpc/rpc-client-contract' import type { ConnectionState } from '../../transport/connection/connection-state' import { buildMobileTerminalImagePastePayload, - prepareMobileClipboardImageBase64, saveMobileClipboardImageAsTempFile } from '../../files/attachments/mobile-clipboard-image' -import { resizeMobileClipboardImage } from '../../files/attachments/mobile-clipboard-image-resize' +import { fitMobileAgentImageBase64 } from '../../files/attachments/mobile-agent-image-fit' // Match xterm's paste(): newlines become CR, and DECSET 2004 frames the text with ESC made inert. function buildMobileTerminalClipboardTextPayload( @@ -99,7 +98,7 @@ export function useMobileTerminalPaste({ return } const connectionId = await getActiveWorktreeConnectionId() - const base64 = await prepareMobileClipboardImageBase64(image, resizeMobileClipboardImage) + const base64 = await fitMobileAgentImageBase64(image.data) const imagePath = await saveMobileClipboardImageAsTempFile(client, base64, { connectionId }) diff --git a/mobile/src/terminal/terminal-webview-replay-coast.test.ts b/mobile/src/terminal/terminal-webview-replay-coast.test.ts deleted file mode 100644 index 445d0cc056e..00000000000 --- a/mobile/src/terminal/terminal-webview-replay-coast.test.ts +++ /dev/null @@ -1,357 +0,0 @@ -// @vitest-environment happy-dom -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { createTerminalDocument } from './document/create-terminal-document' -import { terminalDocumentDouble } from './document/document-terminal-double.test-support' -import { TERMINAL_DOCUMENT_SCRIPT } from './terminal-webview-document-script.generated' -import { TERMINAL_DOCUMENT_MARKUP } from './terminal-webview-html' - -describe('snapshot replacement ends the previous terminal scroll', () => { - let now: number - let nextFrame: number - let frames: Map - let scrolls: number[] - let inputs: string[] - let alternate: boolean - let messages: Array<{ type: string; enabled?: boolean }> - let oldSurface: HTMLElement - let stopDocument: (() => void) | undefined - - function frame() { - now += 16 - const pending = [...frames] - for (const [id, callback] of pending) { - if (frames.delete(id)) { - callback(now) - } - } - } - - function settle() { - for (let count = 0; count < 20 && frames.size; count++) { - frame() - } - } - - function init(preserveScroll = false) { - window.dispatchEvent( - new MessageEvent('message', { - data: JSON.stringify({ - type: 'init', - cols: 40, - rows: 24, - initialData: alternate ? '\x1b[?1049h\x1b[?1000h\x1b[?1006h' : '', - preserveScroll - }) - }) - ) - } - - function touchPoints( - type: string, - points: Array<{ x: number; y: number }>, - surface = oldSurface - ) { - const event = new Event(type, { bubbles: true, cancelable: true }) - Object.defineProperty(event, 'touches', { - value: points.map((point, identifier) => ({ - identifier, - clientX: point.x, - clientY: point.y, - target: surface - })) - }) - Object.defineProperty(event, 'timeStamp', { value: now }) - surface.dispatchEvent(event) - } - - function touch(type: string, y: number, surface = oldSurface) { - touchPoints(type, type === 'touchend' ? [] : [{ x: 40, y }], surface) - } - - function boot(program: boolean, disposable = false) { - alternate = program - document.body.innerHTML = TERMINAL_DOCUMENT_MARKUP - if (disposable) { - stopDocument = createTerminalDocument().stop - } else { - new Function(TERMINAL_DOCUMENT_SCRIPT)() - } - init() - settle() - oldSurface = document.getElementById('terminal-surface')! - if (program) { - window.dispatchEvent( - new MessageEvent('message', { - data: JSON.stringify({ type: 'write', data: '\x1b[?1000h\x1b[?1006h' }) - }) - ) - } - settle() - scrolls.length = 0 - inputs.length = 0 - } - - function fling() { - touch('touchstart', 400) - for (let step = 1; step <= 4; step++) { - now += 16 - touch('touchmove', 400 - step * 25) - frame() - } - touch('touchend', 300) - frame() - expect(alternate ? inputs.length : scrolls.length).toBeGreaterThan(0) - scrolls.length = 0 - inputs.length = 0 - } - - beforeEach(() => { - now = 1000 - nextFrame = 1 - frames = new Map() - scrolls = [] - inputs = [] - alternate = false - messages = [] - stopDocument = undefined - vi.spyOn(window, 'addEventListener') - vi.spyOn(document, 'addEventListener') - vi.spyOn(performance, 'now').mockImplementation(() => now) - vi.spyOn(Date, 'now').mockImplementation(() => now) - vi.stubGlobal('requestAnimationFrame', (callback: FrameRequestCallback) => { - const id = nextFrame++ - frames.set(id, callback) - return id - }) - vi.stubGlobal('cancelAnimationFrame', (id: number) => frames.delete(id)) - Object.defineProperty(window, 'innerWidth', { configurable: true, value: 381 }) - Object.defineProperty(window, 'innerHeight', { configurable: true, value: 612 }) - Object.assign(window, { - ReactNativeWebView: { - postMessage(raw: string) { - const msg = JSON.parse(raw) - messages.push(msg) - if (msg.type === 'terminal-input') { - inputs.push(msg.bytes) - } - } - }, - Terminal: function () { - const buffer = { - baseY: 1000, - viewportY: 500, - type: alternate ? 'alternate' : 'normal', - cursorY: 0, - length: 1000, - getLine: () => undefined - } - let element: HTMLElement | undefined - return { - ...terminalDocumentDouble().terminal, - cols: 40, - rows: 24, - modes: { mouseTrackingMode: alternate ? 'vt200' : 'none' }, - _core: { _renderService: { dimensions: { css: { cell: { width: 8, height: 15 } } } } }, - buffer: { active: buffer }, - get element() { - return element - }, - open(surface: HTMLElement) { - element = surface - }, - scrollLines(rows: number) { - buffer.viewportY += rows - scrolls.push(rows) - }, - setViewportPixelOffset() { - return true - } - } - } - }) - }) - - afterEach(() => { - stopDocument?.() - for (const [type, listener, options] of vi.mocked(window.addEventListener).mock.calls) { - window.removeEventListener(type, listener, options) - } - for (const [type, listener, options] of vi.mocked(document.addEventListener).mock.calls) { - document.removeEventListener(type, listener, options) - } - vi.useRealTimers() - vi.restoreAllMocks() - vi.unstubAllGlobals() - }) - - it.each([ - [false, false], - [false, true], - [true, false], - [true, true] - ])( - 'does not coast into the replacement (program=%s, preserveScroll=%s)', - (program, preserveScroll) => { - boot(program) - fling() - init(preserveScroll) - settle() - expect(inputs).toEqual([]) - expect(scrolls).toEqual([]) - } - ) - - it('drops an unpainted normal-buffer drag when the snapshot is replaced', () => { - boot(false) - touch('touchstart', 400) - now += 16 - touch('touchmove', 360) - expect(scrolls).toEqual([]) - init(true) - settle() - expect(scrolls).toEqual([]) - }) - - it('ignores movement from a finger on the retired surface', () => { - boot(false) - touch('touchstart', 400) - init(true) - settle() - now += 16 - touch('touchmove', 360) - settle() - touch('touchend', 360) - settle() - expect(scrolls).toEqual([]) - }) - - it('does not launch an old finger’s velocity after snapshot replacement', () => { - boot(false) - touch('touchstart', 400) - now += 16 - touch('touchmove', 360) - frame() - init(true) - settle() - scrolls.length = 0 - touch('touchend', 360) - settle() - expect(scrolls).toEqual([]) - }) - - it('retires an unfinished pinch while allowing a new pinch after replay', () => { - boot(false) - touchPoints('touchstart', [ - { x: 40, y: 300 }, - { x: 80, y: 300 } - ]) - touchPoints('touchmove', [ - { x: 30, y: 300 }, - { x: 90, y: 300 } - ]) - init(true) - settle() - messages.length = 0 - touch('touchend', 300) - expect(messages.filter((message) => message.type === 'font-scale-changed')).toEqual([]) - - oldSurface = document.getElementById('terminal-surface')! - touchPoints('touchstart', [ - { x: 40, y: 300 }, - { x: 80, y: 300 } - ]) - touchPoints('touchmove', [ - { x: 20, y: 300 }, - { x: 100, y: 300 } - ]) - touch('touchend', 300) - expect(messages.filter((message) => message.type === 'font-scale-changed')).toHaveLength(1) - }) - - it('keeps long presses usable after repeated replacements', () => { - vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] }) - boot(false) - touch('touchstart', 400) - init(true) - init() - settle() - messages.length = 0 - vi.advanceTimersByTime(500) - expect( - messages.filter((message) => message.type === 'set-select-mode' && message.enabled) - ).toEqual([]) - - oldSurface = document.getElementById('terminal-surface')! - touch('touchstart', 400) - vi.advanceTimersByTime(500) - expect( - messages.filter((message) => message.type === 'set-select-mode' && message.enabled) - ).toHaveLength(1) - }) - - it.each(['coast', 'queued drag'])( - 'stops %s on dispose without affecting a later mount', - (motion) => { - boot(false, true) - if (motion === 'coast') { - fling() - } else { - touch('touchstart', 400) - now += 16 - touch('touchmove', 360) - } - const stopPrevious = stopDocument - if (!stopPrevious) { - throw new Error('Disposable document did not start') - } - stopPrevious() - scrolls.length = 0 - inputs.length = 0 - touch('touchend', 360) - settle() - expect(scrolls).toEqual([]) - expect(inputs).toEqual([]) - - boot(false, true) - stopPrevious() - fling() - frame() - expect(scrolls.length).toBeGreaterThan(0) - } - ) - - it('drops a pending long press on dispose', () => { - vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] }) - boot(false, true) - touch('touchstart', 400) - stopDocument?.() - messages.length = 0 - vi.advanceTimersByTime(500) - touch('touchend', 400) - settle() - expect(messages).toEqual([]) - }) - - it.each([false, true])('still accepts a new fling after replacement (program=%s)', (program) => { - boot(program) - fling() - init() - settle() - oldSurface = document.getElementById('terminal-surface')! - if (program) { - window.dispatchEvent( - new MessageEvent('message', { - data: JSON.stringify({ type: 'write', data: '\x1b[?1000h\x1b[?1006h' }) - }) - ) - } - settle() - scrolls.length = 0 - inputs.length = 0 - fling() - for (let count = 0; count < 4; count++) { - frame() - } - expect(alternate ? inputs.length : scrolls.length).toBeGreaterThan(0) - }) -}) diff --git a/mobile/src/terminal/terminal-webview-touch-scroll.test.ts b/mobile/src/terminal/terminal-webview-touch-scroll.test.ts deleted file mode 100644 index bfe618b6672..00000000000 --- a/mobile/src/terminal/terminal-webview-touch-scroll.test.ts +++ /dev/null @@ -1,284 +0,0 @@ -// @vitest-environment happy-dom -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { terminalDocumentDouble } from './document/document-terminal-double.test-support' -import type { TerminalDocumentTerminal } from './document/document-terminal-shape' -import { TERMINAL_DOCUMENT_SCRIPT } from './terminal-webview-document-script.generated' -import { TERMINAL_DOCUMENT_MARKUP } from './terminal-webview-html' - -type BufferState = { - baseY: number - type: 'alternate' | 'normal' - viewportY: number -} - -const CELL_HEIGHT = 15 -const FRAME_MS = 16 -const ESC_ARROW_DOWN = '\u001b[B' - -function makeTerminal( - buffer: BufferState, - scrollLines: (lines: number) => void -): TerminalDocumentTerminal { - let openedOn: HTMLElement | undefined - return { - ...terminalDocumentDouble().terminal, - cols: 40, - rows: 24, - modes: { mouseTrackingMode: 'none' }, - _core: { - _renderService: { dimensions: { css: { cell: { width: 8, height: CELL_HEIGHT } } } } - }, - buffer: { - active: { - get baseY() { - return buffer.baseY - }, - get type() { - return buffer.type - }, - get viewportY() { - return buffer.viewportY - }, - cursorY: 0, - length: 1, - getLine: () => undefined - } - }, - get element() { - return openedOn - }, - open(surface: HTMLElement) { - openedOn = surface - }, - scrollLines - } -} - -describe('terminal WebView touch scrolling', () => { - let animationFrames: Map void> - let nextFrameId: number - let buffer: BufferState - let now: number - let postMessage: ReturnType void>> - let scrollLines: ReturnType void>> - - function boot(): void { - document.body.innerHTML = TERMINAL_DOCUMENT_MARKUP - new Function(TERMINAL_DOCUMENT_SCRIPT)() - window.dispatchEvent( - new MessageEvent('message', { - data: JSON.stringify({ type: 'init', cols: 40, rows: 24, initialData: '' }) - }) - ) - // Wait for init’s next-frame surface commit. - runFrames(8) - } - - function runFrames(count: number): void { - for (let i = 0; i < count && animationFrames.size > 0; i++) { - now += FRAME_MS - const currentFrames = [...animationFrames] - for (const [id, callback] of currentFrames) { - if (animationFrames.delete(id)) { - callback(now) - } - } - } - } - - function fireTouch(type: string, point: { x: number; y: number } | null): void { - fireTouches(type, point ? [point] : []) - } - - function fireTouches(type: string, points: Array<{ x: number; y: number }>): void { - const surface = document.getElementById('terminal-surface') - if (!surface) { - throw new Error('terminal surface missing') - } - const event = new Event(type, { bubbles: true, cancelable: true }) - const touches = points.map((point, identifier) => ({ - identifier, - clientX: point.x, - clientY: point.y, - target: surface - })) - Object.defineProperty(event, 'touches', { value: touches }) - surface.dispatchEvent(event) - } - - function dragUp(fromY: number, stepPx: number, steps: number): number { - let y = fromY - for (let i = 0; i < steps; i++) { - y -= stepPx - now += FRAME_MS - fireTouch('touchmove', { x: 40, y }) - runFrames(1) - } - return y - } - - function scrolledRows(): number { - return scrollLines.mock.calls.reduce((total, [lines]) => total + lines, 0) - } - - function terminalInputBytes(): string { - return postMessage.mock.calls - .map(([raw]): { bytes?: string; type?: string } => JSON.parse(raw)) - .filter((msg) => msg.type === 'terminal-input') - .map((msg) => msg.bytes ?? '') - .join('') - } - - beforeEach(() => { - vi.spyOn(window, 'addEventListener') - vi.spyOn(document, 'addEventListener') - animationFrames = new Map() - nextFrameId = 1 - buffer = { baseY: 500, type: 'normal', viewportY: 100 } - now = 1_000 - scrollLines = vi.fn<(lines: number) => void>() - postMessage = vi.fn<(data: string) => void>() - vi.spyOn(Date, 'now').mockImplementation(() => now) - vi.spyOn(performance, 'now').mockImplementation(() => now) - vi.stubGlobal('requestAnimationFrame', (callback: (frameTime: number) => void) => { - const id = nextFrameId++ - animationFrames.set(id, callback) - return id - }) - vi.stubGlobal('cancelAnimationFrame', (id: number) => { - animationFrames.delete(id) - }) - Object.defineProperty(window, 'innerWidth', { value: 381, configurable: true }) - Object.defineProperty(window, 'innerHeight', { value: 612, configurable: true }) - Object.assign(window, { - Terminal: function () { - return makeTerminal(buffer, scrollLines) - }, - ReactNativeWebView: { postMessage } - }) - }) - - afterEach(() => { - for (const [type, listener, options] of vi.mocked(window.addEventListener).mock.calls) { - window.removeEventListener(type, listener, options) - } - for (const [type, listener, options] of vi.mocked(document.addEventListener).mock.calls) { - document.removeEventListener(type, listener, options) - } - vi.restoreAllMocks() - vi.unstubAllGlobals() - vi.useRealTimers() - }) - - it('carries the sub-row remainder of a fast drag into the next move', () => { - boot() - - fireTouch('touchstart', { x: 40, y: 400 }) - const y = dragUp(400, 100, 1) - expect(scrolledRows()).toBe(6) - - dragUp(y, 5, 1) - expect(scrolledRows()).toBe(7) - }) - - it('does not coast when the finger rested before lifting', () => { - boot() - - fireTouch('touchstart', { x: 40, y: 400 }) - dragUp(400, 20, 5) - const rowsWhileTouching = scrolledRows() - now += 500 - fireTouch('touchend', null) - runFrames(30) - - expect(scrolledRows()).toBe(rowsWhileTouching) - }) - - it('does not send a resting finger’s momentum to an alternate-screen app', () => { - buffer = { baseY: 0, type: 'alternate', viewportY: 0 } - boot() - - fireTouch('touchstart', { x: 40, y: 400 }) - dragUp(400, 20, 5) - const bytesWhileTouching = terminalInputBytes() - expect(bytesWhileTouching).toContain(ESC_ARROW_DOWN) - now += 500 - fireTouch('touchend', null) - runFrames(30) - - expect(terminalInputBytes()).toBe(bytesWhileTouching) - }) - - it('drops an uncommitted scroll when a second finger starts a pinch', () => { - boot() - fireTouch('touchstart', { x: 40, y: 400 }) - now += FRAME_MS - fireTouch('touchmove', { x: 40, y: 380 }) - fireTouches('touchstart', [ - { x: 40, y: 380 }, - { x: 140, y: 380 } - ]) - runFrames(1) - fireTouch('touchend', null) - runFrames(30) - - expect(scrolledRows()).toBe(0) - expect(terminalInputBytes()).toBe('') - }) - - it('drops queued scroll and velocity when the platform cancels a touch', () => { - boot() - fireTouch('touchstart', { x: 40, y: 400 }) - now += FRAME_MS - fireTouch('touchmove', { x: 40, y: 320 }) - fireTouch('touchcancel', null) - fireTouch('touchend', null) - runFrames(30) - - expect(scrolledRows()).toBe(0) - expect(terminalInputBytes()).toBe('') - fireTouch('touchstart', { x: 40, y: 320 }) - fireTouch('touchend', null) - expect( - postMessage.mock.calls.filter(([raw]) => JSON.parse(raw).type === 'terminal-tap') - ).toHaveLength(1) - }) - - it('does not send cancelled momentum to an alternate-screen app', () => { - buffer = { baseY: 0, type: 'alternate', viewportY: 0 } - boot() - fireTouch('touchstart', { x: 40, y: 400 }) - dragUp(400, 20, 5) - const bytesBeforeCancel = terminalInputBytes() - expect(bytesBeforeCancel).toContain(ESC_ARROW_DOWN) - fireTouch('touchcancel', null) - fireTouch('touchend', null) - runFrames(30) - - expect(terminalInputBytes()).toBe(bytesBeforeCancel) - }) - - it('retires subthreshold scroll velocity when a long press enters selection', () => { - boot() - vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] }) - fireTouch('touchstart', { x: 40, y: 400 }) - now += 480 - fireTouch('touchmove', { x: 40, y: 399.5 }) - now += 19 - fireTouch('touchmove', { x: 40, y: 391.5 }) - now += 1 - vi.advanceTimersByTime(500) - expect( - postMessage.mock.calls.some(([raw]) => { - const message = JSON.parse(raw) - return message.type === 'set-select-mode' && message.enabled - }) - ).toBe(true) - - fireTouch('touchend', null) - runFrames(30) - - expect(scrolledRows()).toBe(0) - expect(terminalInputBytes()).toBe('') - }) -}) diff --git a/mobile/src/terminal/use-terminal-live-input-commit.test.ts b/mobile/src/terminal/use-terminal-live-input-commit.test.ts index 6662b029e64..69927053d8e 100644 --- a/mobile/src/terminal/use-terminal-live-input-commit.test.ts +++ b/mobile/src/terminal/use-terminal-live-input-commit.test.ts @@ -6,10 +6,8 @@ import type { TerminalLiveInputSender } from './terminal-live-input-sender' import { TERMINAL_LIVE_HELD_PREEDIT_COMMIT_DELAY_MS } from './terminal-live-preedit-mirror' import { useTerminalLiveInputCommit } from './use-terminal-live-input-commit' -const composingRange = vi.hoisted(() => ({ hostReportsNone: false })) vi.mock('../platform/live-input-composing-range', () => ({ - reportedLiveInputComposing: (isComposing: boolean | undefined) => - composingRange.hostReportsNone ? undefined : isComposing + reportedLiveInputComposing: (isComposing: boolean | undefined) => isComposing })) type TerminalLiveInputCommitHandlers = ReturnType> @@ -159,61 +157,6 @@ describe('terminal live input commit hook', () => { } ) - it('keeps a retired delivery failure from clearing or reporting in a fresh field session', async () => { - let rejectRetired = (_error: Error): void => {} - const retired = new Promise((_resolve, reject) => { - rejectRetired = reject - }) - const sender = vi - .fn() - .mockReturnValueOnce(retired) - .mockResolvedValue(true) - const { getHandlers, captures, sent, failures, setConnected, unmount } = - createTerminalLiveInputCommitHarness({ sender }) - changeLiveInput(getHandlers(), 'old', false) - setConnected(false) - setConnected(true) - changeLiveInput(getHandlers(), 'new', false) - await vi.waitFor(() => expect(sent).toEqual(['old', 'new'])) - - rejectRetired(new Error('retired timeout')) - await new Promise((resolve) => setImmediate(resolve)) - - expect(captures.at(-1)).toBe('new') - expect(failures).not.toHaveBeenCalled() - unmount() - }) - - it('frames a long OS paste, then ends the field session so later edits never erase into it', async () => { - // Agents such as Codex collapse a framed paste into one token, so per-character DELs would desync. - const { handlers, sent, captures } = createTerminalLiveInputCommitHarness({ - bracketedPaste: true - }) - const text = 'This sentence is filler text that mimics ordinary dictated prose. '.repeat(25) - changeLiveInput(handlers, 'ab', false) - await vi.waitFor(() => expect(sent).toEqual(['ab'])) - changeLiveInput(handlers, `ab${text}`, false) - await vi.waitFor(() => expect(sent).toHaveLength(2)) - expect(captures.at(-1)).toBe('') - changeLiveInput(handlers, '!', false) - await vi.waitFor(() => expect(sent).toHaveLength(3)) - changeLiveInput(handlers, '', false) - await vi.waitFor(() => expect(sent).toHaveLength(4)) - await handlers.handleLiveInputSubmit() - expect(sent).toEqual(['ab', `\x1b[200~${text}\x1b[201~`, '!', '\x7f', '\r']) - }) - - it('drops a late native echo of the pasted field so the paste is not sent twice', async () => { - const { handlers, sent } = createTerminalLiveInputCommitHarness({ bracketedPaste: true }) - const text = 'This sentence is filler text that mimics ordinary dictated prose. '.repeat(25) - changeLiveInput(handlers, text, false) - await vi.waitFor(() => expect(sent).toHaveLength(1)) - changeLiveInput(handlers, text, false) - changeLiveInput(handlers, 'x', false) - await vi.waitFor(() => expect(sent).toHaveLength(2)) - expect(sent).toEqual([`\x1b[200~${text}\x1b[201~`, 'x']) - }) - it('frames held unreported paste before an immediate click and starts the next mirror clean', async () => { vi.useFakeTimers() const { handlers, sent, captures, unmount } = createTerminalLiveInputCommitHarness({ @@ -234,314 +177,7 @@ describe('terminal live input commit hook', () => { } }) - it('keeps mirror deletion controls outside the pasted replacement frame', async () => { - const { handlers, sent } = createTerminalLiveInputCommitHarness({ bracketedPaste: true }) - changeLiveInput(handlers, 'abc', false) - await vi.waitFor(() => expect(sent).toEqual(['abc'])) - const pasted = `${'é'.repeat(600)}\x1b[201~unsafe` - changeLiveInput(handlers, `a${pasted}`, false) - await vi.waitFor(() => expect(sent).toHaveLength(2)) - expect(sent[1]).toBe(`\x7f\x7f\x1b[200~${'é'.repeat(600)}␛[201~unsafe\x1b[201~`) - }) - afterEach(() => { vi.useRealTimers() - composingRange.hostReportsNone = false - }) - - it('Given Cheonjiin jamo reported as not composing When typing pauses Then the jamo stay held', async () => { - vi.useFakeTimers() - const { handlers, sent, captures, unmount } = createTerminalLiveInputCommitHarness() - try { - changeLiveInput(handlers, '안녕하', false) - changeLiveInput(handlers, '안녕하ᄉᆞ', false) - await vi.advanceTimersByTimeAsync(3000) - expect(sent.join('')).toBe('안녕하') - expect(captures.at(-1)).toBe('안녕하ᄉᆞ') - } finally { - unmount() - } - }) - - it('Given held Cheonjiin jamo When submit is requested Then sends them once before carriage return', async () => { - vi.useFakeTimers() - const { handlers, sent, captures, unmount } = createTerminalLiveInputCommitHarness() - try { - changeLiveInput(handlers, '안녕하', false) - changeLiveInput(handlers, '안녕하ᄉᆞ', false) - await vi.advanceTimersByTimeAsync(0) - expect(sent.join('')).toBe('안녕하') - expect(await handlers.handleLiveInputSubmit()).toBe(true) - expect(sent.join('')).toBe('안녕하ᄉᆞ\r') - expect(captures.at(-1)).toBe('') - } finally { - unmount() - } - }) - - it('Given Hangul composition and no marked-text report When steps arrive Then no jamo leaks', async () => { - vi.useFakeTimers() - const { handlers, sent } = createTerminalLiveInputCommitHarness() - - for (const fieldText of ['ㅎ', '하', '한', '한ㄱ', '한그', '한글']) { - changeLiveInput(handlers, fieldText) - await vi.advanceTimersByTimeAsync(50) - } - - await vi.waitFor(() => expect(sent).toEqual(['한글'])) - }) - - it('Given Japanese romaji When the marked-text range is reported Then no reading reaches the terminal', async () => { - vi.useFakeTimers() - const { handlers, sent } = createTerminalLiveInputCommitHarness() - - for (const fieldText of ['s', 'さ', 'さく', 'さくら']) { - changeLiveInput(handlers, fieldText, true) - await vi.advanceTimersByTimeAsync(50) - } - await vi.advanceTimersByTimeAsync(TERMINAL_LIVE_HELD_PREEDIT_COMMIT_DELAY_MS * 4) - changeLiveInput(handlers, '桜', false) - - await vi.waitFor(() => expect(sent).toEqual(['桜'])) - }) - - it('Given a reported preedit that goes idle When the settle delay passes Then nothing is committed on a timer', async () => { - // Explicit preedit is not committed text and must never be promoted by an idle timer. - vi.useFakeTimers() - const { handlers, sent } = createTerminalLiveInputCommitHarness() - - changeLiveInput(handlers, 'nihao', true) - await vi.advanceTimersByTimeAsync(TERMINAL_LIVE_HELD_PREEDIT_COMMIT_DELAY_MS * 10) - - expect(sent).toEqual([]) - }) - - it('Given an Android WebView composing each word When letters follow a slash Then each reaches the terminal as typed', async () => { - composingRange.hostReportsNone = true - const { handlers, sent } = createTerminalLiveInputCommitHarness() - - changeLiveInput(handlers, '/', false) - await vi.waitFor(() => expect(sent).toHaveLength(1)) - for (const fieldText of ['/t', '/tu', '/tui']) { - changeLiveInput(handlers, fieldText, true) - // Await each keystroke so batching cannot hide a held character. - await vi.waitFor(() => expect(sent).toHaveLength(fieldText.length)) - } - - await vi.waitFor(() => expect(sent).toEqual(['/', 't', 'u', 'i'])) - }) - - it('Given an Android WebView composing Hangul When steps arrive Then the non-ASCII run still settles on the timer', async () => { - vi.useFakeTimers() - composingRange.hostReportsNone = true - const { handlers, sent } = createTerminalLiveInputCommitHarness() - - for (const fieldText of ['ㅎ', '하', '한']) { - changeLiveInput(handlers, fieldText, true) - await vi.advanceTimersByTimeAsync(50) - } - await vi.advanceTimersByTimeAsync(TERMINAL_LIVE_HELD_PREEDIT_COMMIT_DELAY_MS) - - await vi.waitFor(() => expect(sent).toEqual(['한'])) - }) - - it('Given an iOS pinyin preedit When accessory Backspace edits it Then only the candidate reaches the terminal', async () => { - vi.useFakeTimers() - const { handlers, sent } = createTerminalLiveInputCommitHarness() - changeLiveInput(handlers, 'ni hao', true) - - await handlers.handleLiveInputAccessoryBytes({ bytes: '\x7f', localEdit: 'backspace' }) - await vi.advanceTimersByTimeAsync(TERMINAL_LIVE_HELD_PREEDIT_COMMIT_DELAY_MS * 2) - changeLiveInput(handlers, '你好', false) - - await vi.waitFor(() => expect(sent).toEqual(['你好'])) - }) - - it('Given an Android heuristic hold When accessory Backspace edits it Then the remaining text still settles', async () => { - vi.useFakeTimers() - const { handlers, sent } = createTerminalLiveInputCommitHarness() - changeLiveInput(handlers, '한글') - - await handlers.handleLiveInputAccessoryBytes({ bytes: '\x7f', localEdit: 'backspace' }) - await vi.advanceTimersByTimeAsync(TERMINAL_LIVE_HELD_PREEDIT_COMMIT_DELAY_MS) - - await vi.waitFor(() => expect(sent).toEqual(['한'])) - }) - - it('Given a held syllable When an accessory Esc arrives Then commits the syllable before the Esc', async () => { - const { handlers, sent } = createTerminalLiveInputCommitHarness() - changeLiveInput(handlers, '한') - - await handlers.handleLiveInputAccessoryBytes({ bytes: '\x1b' }) - - expect(sent).toEqual(['한', '\x1b']) - }) - - it('Given mirrored text When an accessory Enter arrives Then later typing starts a new line', async () => { - const { handlers, sent } = createTerminalLiveInputCommitHarness() - changeLiveInput(handlers, 'ls') - - await handlers.handleLiveInputAccessoryBytes({ bytes: '\r' }) - changeLiveInput(handlers, 'x') - - await vi.waitFor(() => expect(sent).toEqual(['ls', '\r', 'x'])) - }) - - it('Given a failed mirrored Backspace When accessory input commits Then reports failure', async () => { - const { handlers, sent, setSendResult } = createTerminalLiveInputCommitHarness() - changeLiveInput(handlers, 'a', false) - await vi.waitFor(() => expect(sent).toEqual(['a'])) - setSendResult(false) - - const result = await handlers.handleLiveInputAccessoryBytes({ - bytes: '\x7f', - localEdit: 'backspace' - }) - - expect(sent).toEqual(['a', '\x7f']) - expect(result).toEqual({ kind: 'suppress-raw' }) - }) - - it('Given a timer-committed syllable When composition continues Then corrects with DEL and recommits', async () => { - vi.useFakeTimers() - const { handlers, sent } = createTerminalLiveInputCommitHarness() - changeLiveInput(handlers, '하') - await vi.advanceTimersByTimeAsync(TERMINAL_LIVE_HELD_PREEDIT_COMMIT_DELAY_MS) - await vi.waitFor(() => expect(sent).toEqual(['하'])) - - changeLiveInput(handlers, '한') - await vi.advanceTimersByTimeAsync(TERMINAL_LIVE_HELD_PREEDIT_COMMIT_DELAY_MS) - - await vi.waitFor(() => expect(sent).toEqual(['하', '\x7f', '한'])) - }) - - it('Given a rejected held-text send When submit is requested Then suppresses the carriage return', async () => { - const { handlers, sent } = createTerminalLiveInputCommitHarness({ sendResult: false }) - changeLiveInput(handlers, '한') - - const accepted = await handlers.handleLiveInputSubmit() - - expect(accepted).toBe(false) - await vi.waitFor(() => expect(sent).toEqual(['한'])) - }) - - it('Given iOS smart-dash text When the change arrives Then the capture echoes the raw field text and the PTY gets normalized bytes', async () => { - const { captures, handlers, sent } = createTerminalLiveInputCommitHarness() - - changeLiveInput(handlers, 'a–') - - // Echo native smart punctuation verbatim; controlled write-back would kill active iOS dictation/IME. - expect(captures).toEqual(['a–']) - await vi.waitFor(() => expect(sent).toEqual(['a--'])) - }) - - it('Given dictation-style hypothesis revisions When changes arrive Then the field is never rewritten and the PTY converges', async () => { - const { captures, handlers, sent } = createTerminalLiveInputCommitHarness() - - changeLiveInput(handlers, 'high') - changeLiveInput(handlers, 'hi there') - - expect(captures).toEqual(['high', 'hi there']) - await vi.waitFor(() => expect(sent).toEqual(['high', '\x7f\x7f there'])) - }) - - it('Given Hangul pending text When an external terminal send is requested Then flushes composed text first', async () => { - const { handlers, sent } = createTerminalLiveInputCommitHarness() - changeLiveInput(handlers, '한') - - const flushed = await handlers.flushPendingLiveInputBeforeExternalSend('terminal-a') - - expect(flushed).toBe(true) - expect(sent).toEqual(['한']) - }) - - it('Given pending text cannot be sent When an external terminal send is requested Then reports failure', async () => { - const { handlers, sent } = createTerminalLiveInputCommitHarness({ sendResult: false }) - changeLiveInput(handlers, '한') - - const flushed = await handlers.flushPendingLiveInputBeforeExternalSend('terminal-a') - - expect(flushed).toBe(false) - expect(sent).toEqual(['한']) - }) - - it('Given a held syllable When the hook unmounts Then cancels the settle timer', async () => { - vi.useFakeTimers() - const { handlers, sent, unmount } = createTerminalLiveInputCommitHarness() - changeLiveInput(handlers, '한') - - unmount() - await vi.advanceTimersByTimeAsync(1_000) - - expect(sent).toEqual([]) - }) - - it('Given Backspace with field text When the key arrives Then edits locally without terminal bytes', async () => { - const { handlers, sent } = createTerminalLiveInputCommitHarness() - changeLiveInput(handlers, '한') - - handlers.handleLiveInputKeyPress({ nativeEvent: { key: 'Backspace' } }) - - await vi.waitFor(() => expect(sent).toEqual([])) - }) - - it('Given Tab with a held syllable When the key arrives Then commits the syllable before the tab bytes', async () => { - const { handlers, sent } = createTerminalLiveInputCommitHarness() - changeLiveInput(handlers, '한') - - handlers.handleLiveInputKeyPress({ nativeEvent: { key: 'Tab' } }) - - await vi.waitFor(() => expect(sent).toEqual(['한', '\t'])) - }) - - it('Given Hangul pending When the tab type lags to undefined Then keeps the composition state', async () => { - const { handlers, sent, setActiveSessionTabType } = createTerminalLiveInputCommitHarness() - changeLiveInput(handlers, '한') - - setActiveSessionTabType(undefined) - handlers.handleLiveInputSubmit() - - await vi.waitFor(() => expect(sent).toEqual(['한', '\r'])) - }) - - it('Given Hangul pending When the tab genuinely changes to non-terminal Then clears the composition state', async () => { - const { handlers, sent, setActiveSessionTabType } = createTerminalLiveInputCommitHarness() - changeLiveInput(handlers, '한') - - setActiveSessionTabType('chat') - handlers.handleLiveInputSubmit() - - await vi.waitFor(() => expect(sent).toEqual(['\r'])) - }) - - it('Given bytes lost in a silent stall When the disconnect is detected Then the first post-recovery send carries no stale fragment or phantom erases', async () => { - // Simulate a stalled link where mirror bytes never reach PTY acceptance. - const { captures, handlers, sent, setConnected, setSendResult } = - createTerminalLiveInputCommitHarness({ sendResult: false }) - changeLiveInput(handlers, 'XYZZY') - await vi.waitFor(() => expect(sent).toEqual(['XYZZY'])) - - setConnected(false) - setSendResult(true) - setConnected(true) - - // Fresh typing after reconnect must neither replay stale bytes nor DEL characters that never arrived. - expect(captures.at(-1)).toBe('') - const sentBeforeRecovery = sent.length - changeLiveInput(handlers, 'echo CLEANLINE') - await vi.waitFor(() => expect(sent.slice(sentBeforeRecovery)).toEqual(['echo CLEANLINE'])) - }) - - it('Given a held syllable during an outage When the disconnect is detected Then the settle timer cannot commit it later', async () => { - vi.useFakeTimers() - const { handlers, sent, setConnected } = createTerminalLiveInputCommitHarness({ - sendResult: false - }) - changeLiveInput(handlers, '한') - - setConnected(false) - await vi.advanceTimersByTimeAsync(TERMINAL_LIVE_HELD_PREEDIT_COMMIT_DELAY_MS) - - expect(sent).toEqual([]) }) }) diff --git a/mobile/src/test-support/rpc-recording/changed-page-outcomes.ts b/mobile/src/test-support/rpc-recording/changed-page-outcomes.ts index 61f8ddd9977..64b085089e3 100644 --- a/mobile/src/test-support/rpc-recording/changed-page-outcomes.ts +++ b/mobile/src/test-support/rpc-recording/changed-page-outcomes.ts @@ -1,4 +1,4 @@ -import { GITHUB_EXACT_OPERATION_UNSUPPORTED } from '../../../../src/shared/github/work-item-target' +import { GITHUB_EXACT_OPERATION_UNSUPPORTED } from '../../../../src/shared/github/work-items/work-item-target' import { GITHUB_CONNECTION_CHANGED } from '../../source-control/review/github-target-invocation' import { isKeyedObject, scriptsAbsentResultReply } from '../bridged-parity/divergence-evidence' import { rows } from './changed-bridge-outcomes' diff --git a/mobile/src/theme/mobile-theme.ts b/mobile/src/theme/mobile-theme.ts index 7d53f8422eb..3d51be01e1e 100644 --- a/mobile/src/theme/mobile-theme.ts +++ b/mobile/src/theme/mobile-theme.ts @@ -20,6 +20,13 @@ const darkColors = { composerSurface: '#1f1f1f', composerBorder: 'rgba(250, 250, 250, 0.09)', composerControl: '#262626', + // A floating card's hairline edge (the answer card), a step stronger than the composer's. + floatingCardBorder: 'rgba(250, 250, 250, 0.16)', + // An unfilled choice's edge on a card, 3:1 against it (WCAG 1.4.11), and the faint fill of the picked one. + choiceBorder: 'rgba(255, 255, 255, 0.34)', + choiceSelectedFill: 'rgba(134, 239, 172, 0.08)', + // A small filled pill on a card (a queued row's Steer): light needs more than bgRaised to read on white. + cardPillFill: '#262626', // A text field's edge, 3:1 on the screen, a sheet and a sheet group (WCAG 1.4.11): desktop's dark --ring. inputBorder: '#737373', skillToken: '#8ab4f8', @@ -103,6 +110,10 @@ const lightColors: MobilePalette = { composerSurface: '#ffffff', composerBorder: 'rgba(10, 10, 10, 0.11)', composerControl: '#f5f5f5', + floatingCardBorder: 'rgba(10, 10, 10, 0.14)', + choiceBorder: 'rgba(0, 0, 0, 0.44)', + choiceSelectedFill: 'rgba(20, 118, 56, 0.06)', + cardPillFill: 'rgba(120, 120, 128, 0.16)', // Desktop's light --ring (#a1a1a1) is under 3:1 on white, so both schemes share the dark one. inputBorder: '#737373', skillToken: '#1d4ed8', diff --git a/mobile/src/transport/encryption/mobile-e2ee-legacy-fixtures.test.ts b/mobile/src/transport/encryption/mobile-e2ee-legacy-fixtures.test.ts deleted file mode 100644 index 4a7a277d14e..00000000000 --- a/mobile/src/transport/encryption/mobile-e2ee-legacy-fixtures.test.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import nacl from 'tweetnacl' -import { MOBILE_E2EE_LEGACY_FIXTURE } from '../../../../src/shared/remote-runtime/e2ee/mobile-e2ee-legacy-fixtures' - -vi.mock('expo-crypto', () => ({ - getRandomBytes: (length: number) => new Uint8Array(length).fill(9) -})) - -import { decrypt, decryptBytes, deriveSharedKey } from './e2ee' - -describe('mobile legacy E2EE fixtures', () => { - it('matches the captured desktop key and text/binary frames', () => { - const fixture = MOBILE_E2EE_LEGACY_FIXTURE - const server = nacl.box.keyPair.fromSecretKey(fixture.serverSecretKey) - const client = nacl.box.keyPair.fromSecretKey(fixture.clientSecretKey) - const shared = deriveSharedKey(client.secretKey, server.publicKey) - - expect(hex(shared)).toBe(fixture.sharedKeyHex) - expect(decrypt(fixture.authFrameB64, shared)).toBe(fixture.authPlaintext) - expect(decryptBytes(fromHex(fixture.binaryFrameHex), shared)).toEqual(fixture.binaryPlaintext) - }) -}) - -function hex(bytes: Uint8Array): string { - return Array.from(bytes, (byte) => byte.toString(16).padStart(2, '0')).join('') -} - -function fromHex(value: string): Uint8Array { - return Uint8Array.from(value.match(/../g) ?? [], (byte) => Number.parseInt(byte, 16)) -} diff --git a/mobile/src/worktree/workspace-details-model.ts b/mobile/src/worktree/workspace-details-model.ts index e2f4e33dee1..a5b23629f09 100644 --- a/mobile/src/worktree/workspace-details-model.ts +++ b/mobile/src/worktree/workspace-details-model.ts @@ -1,5 +1,5 @@ import { getProviderChecksOutcome } from '../../../src/shared/source-control/checks/provider-check-summary' -import type { CheckStatus } from '../../../src/shared/github/pull-request-types' +import type { CheckStatus } from '../../../src/shared/github/pull-requests/pull-request-types' import { getWorkspaceAttachmentKey, getWorkspaceAttachmentUrlScope diff --git a/mobile/src/worktree/workspace-filter-repos.ts b/mobile/src/worktree/workspace-filter-repos.ts index 6ce5a9da17e..c202459d94c 100644 --- a/mobile/src/worktree/workspace-filter-repos.ts +++ b/mobile/src/worktree/workspace-filter-repos.ts @@ -1,6 +1,7 @@ import { getRepoExecutionHostId } from '../../../src/shared/execution-host' import { resolveRepoBadgeColor } from '../../../src/shared/repo-badge-color' import { buildSectionRepoMap, type SectionRepo, type Worktree } from './workspace-list-sections' +import { isRepoHidden } from '../../../src/shared/hidden-projects' export type WorkspaceSectionRepo = { /** Unique per host: two hosts can each hold a repo of the same name. */ @@ -26,7 +27,7 @@ export function buildFilterRepos( const seen = new Set() return repos.flatMap((repo) => { const key = `${getRepoExecutionHostId(repo)}|${repo.id}` - if (seen.has(key)) { + if (seen.has(key) || isRepoHidden(repo)) { return [] } seen.add(key) diff --git a/mobile/src/worktree/workspace-list-sections.ts b/mobile/src/worktree/workspace-list-sections.ts index 5952a3b3ad0..01a688ad759 100644 --- a/mobile/src/worktree/workspace-list-sections.ts +++ b/mobile/src/worktree/workspace-list-sections.ts @@ -27,9 +27,9 @@ import type { } from '../../../src/shared/workspace-view/workspace-view-options' import { hostSortsByStamps, sortWorktrees } from './workspace-list-ordering' import { getWorktreeRowIdentity } from './worktree-host-row-identity' -import { NO_WORKTREE_HOST_CONTEXT, resolveWorktreeHostId } from './worktree-host-context-labels' +import { NO_WORKTREE_HOST_CONTEXT } from './worktree-host-context-labels' import type { WorktreeHostContextOf } from './worktree-host-context-labels' -import type { ExecutionHostId } from '../../../src/shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../src/shared/execution-host' import { buildProjectGroupingIndex, buildProjectSections, @@ -38,11 +38,13 @@ import { } from '../../../src/shared/project-section-grouping' import { withRepoSectionDisplayLabels } from '../../../src/shared/project-section-order' import type { ProjectOrderBy } from '../../../src/shared/ui-chrome-types' -import { - filterWorkspaceRows, - type WorkspaceRowFactReader -} from '../../../src/shared/workspace-view/workspace-row-filters' import { translate } from '../i18n/mobile-i18n' +import { + indexHiddenProjects, + isRepoHidden, + withoutHiddenFilterRepoIds +} from '../../../src/shared/hidden-projects' +import { filterWorktrees } from './workspace-row-filtering' export type { FilterState, Section, SectionRepo, Worktree } from './workspace-list-types' @@ -82,6 +84,7 @@ export function buildSectionRepoMap( return repoMap } export { getWorktreeStatus, sortWorktrees } from './workspace-list-ordering' +export { filterWorktrees, isWorktreeActive } from './workspace-row-filtering' // A section before lineage expansion: host rows only, no per-row view yet. type PlannedSection = Omit & { data: Worktree[] } @@ -101,64 +104,6 @@ function makeSection( } } -// Idle prompts have no recent output; live terminals or unread output still count as active. -export function isWorktreeActive( - w: Pick & { - unread?: boolean - } -): boolean { - return w.hasHostSidebarActivity !== undefined - ? w.hasHostSidebarActivity - : Boolean(w.unread) || (w.status ? w.status !== 'inactive' : w.liveTerminalCount > 0) -} - -// Older hosts omit the main-worktree flag; use the legacy branch heuristic. -function guessDefaultBranchWorkspace(w: Worktree): boolean { - if (w.isMainWorktree !== undefined) { - return w.isMainWorktree && w.branch.trim() !== '' - } - const branch = w.branch.replace(/^refs\/heads\//, '') - return branch === 'main' || branch === 'master' -} - -function phoneRowFacts( - repoHostIdByRepoId: ReadonlyMap -): WorkspaceRowFactReader { - return { - isArchived: (w) => w.isArchived === true, - isFolderWorkspace: (w) => w.workspaceKind === 'folder-workspace', - repoId: (w) => w.repoId, - hostId: (w) => resolveWorktreeHostId(w, repoHostIdByRepoId), - isOtherClient: (w) => w.desktopOtherClient === true, - isDefaultBranch: (w) => w.defaultBranch ?? guessDefaultBranchWorkspace(w), - isAutomationCreated: (w) => w.automationCreated === true, - isCliCreated: (w) => w.cliCreated === true, - isDetachedHead: (w) => w.detachedHead === true, - // Why the guess: #8873's exemption must fail open on hosts that predate isMainWorktree. - isMainWorktree: (w) => w.isMainWorktree ?? guessDefaultBranchWorkspace(w), - isSleeping: (w) => !isWorktreeActive(w) - } -} - -export function filterWorktrees( - worktrees: Worktree[], - filters: FilterState, - search: string, - repoHostIdByRepoId: ReadonlyMap = new Map() -): Worktree[] { - const result = filterWorkspaceRows(worktrees, filters, phoneRowFacts(repoHostIdByRepoId)) - const q = search.trim().toLowerCase() - if (!q) { - return result - } - return result.filter( - (w) => - w.displayName.toLowerCase().includes(q) || - w.branch.toLowerCase().includes(q) || - w.repo.toLowerCase().includes(q) - ) -} - export function isWorktreePinned(w: Worktree, localPins: Set): boolean { return w.isPinned || localPins.has(w.worktreeId) } @@ -185,12 +130,14 @@ export function buildMobileWorkspacePlan( 'in-progress': translate('worktree.workspaceListSections.inProgress', 'In progress'), closed: translate('worktree.workspaceListSections.closed', 'Closed') } - const filtered = filterWorktrees(worktrees, filters, search, repoHostIdByRepoId) + const hiddenProjects = indexHiddenProjects(projectCatalog.repos, LOCAL_EXECUTION_HOST_ID) + const filtered = filterWorktrees(worktrees, filters, search, repoHostIdByRepoId, hiddenProjects) + const listedFilterIds = withoutHiddenFilterRepoIds(filters.filterRepoIds, hiddenProjects) const sorted = sortWorktrees(filtered, sortMode, Date.now(), hostSortsByStamps(worktrees)) const childrenByParentIdentity = getMobileWorkspaceLineageChildren( worktrees, lineageStores, - filters.filterRepoIds + listedFilterIds ) const repoMap = buildSectionRepoMap(projectCatalog.repos, worktrees) const projectIndex = buildProjectGroupingIndex(projectCatalog.grouping ?? undefined) @@ -221,7 +168,8 @@ export function buildMobileWorkspacePlan( .filter( (repo) => !representedRepoIds.has(repo.id) && - (filters.filterRepoIds.length === 0 || filters.filterRepoIds.includes(repo.id)) && + !isRepoHidden(repo) && + (listedFilterIds.length === 0 || listedFilterIds.includes(repo.id)) && (!query || repo.displayName.toLowerCase().includes(query)) ) .map((repo) => repo.id) diff --git a/mobile/src/worktree/workspace-list-types.ts b/mobile/src/worktree/workspace-list-types.ts index 3a451878550..f8a0269b155 100644 --- a/mobile/src/worktree/workspace-list-types.ts +++ b/mobile/src/worktree/workspace-list-types.ts @@ -63,6 +63,7 @@ export type SectionRepo = ProjectSectionRepo & { repoIcon?: unknown projectGroupId?: string | null projectGroupOrder?: number + hiddenAt?: number } // Pending creations name only their project; null belongs under the list’s own header. diff --git a/mobile/src/worktree/workspace-row-filtering.ts b/mobile/src/worktree/workspace-row-filtering.ts new file mode 100644 index 00000000000..f01a7eacc1b --- /dev/null +++ b/mobile/src/worktree/workspace-row-filtering.ts @@ -0,0 +1,79 @@ +import type { ExecutionHostId } from '../../../src/shared/execution-host' +import { NO_HIDDEN_PROJECTS, type HiddenProjects } from '../../../src/shared/hidden-projects' +import { + filterWorkspaceRows, + type WorkspaceRowFactReader +} from '../../../src/shared/workspace-view/workspace-row-filters' +import type { FilterState, Worktree } from './workspace-list-types' +import { resolveWorktreeHostId } from './worktree-host-context-labels' + +// Idle prompts have no recent output; live terminals or unread output still count as active. +export function isWorktreeActive( + w: Pick & { + unread?: boolean + } +): boolean { + return w.hasHostSidebarActivity !== undefined + ? w.hasHostSidebarActivity + : Boolean(w.unread) || (w.status ? w.status !== 'inactive' : w.liveTerminalCount > 0) +} + +// Older hosts omit the main-worktree flag; use the legacy branch heuristic. +function guessDefaultBranchWorkspace(w: Worktree): boolean { + if (w.isMainWorktree !== undefined) { + return w.isMainWorktree && w.branch.trim() !== '' + } + const branch = w.branch.replace(/^refs\/heads\//, '') + return branch === 'main' || branch === 'master' +} + +function phoneRowFacts( + repoHostIdByRepoId: ReadonlyMap, + hiddenProjects: HiddenProjects +): WorkspaceRowFactReader { + return { + isArchived: (w) => w.isArchived === true, + // The same host the phone resolves for the row; unknown hosts fall to the shared check's own rule. + isInHiddenProject: (w) => + hiddenProjects.isRowHidden({ + repoId: w.repoId, + hostId: w.hostId ?? repoHostIdByRepoId.get(w.repoId) + }), + isProjectHidden: hiddenProjects.isProjectHidden, + isFolderWorkspace: (w) => w.workspaceKind === 'folder-workspace', + repoId: (w) => w.repoId, + hostId: (w) => resolveWorktreeHostId(w, repoHostIdByRepoId), + isOtherClient: (w) => w.desktopOtherClient === true, + isDefaultBranch: (w) => w.defaultBranch ?? guessDefaultBranchWorkspace(w), + isAutomationCreated: (w) => w.automationCreated === true, + isCliCreated: (w) => w.cliCreated === true, + isDetachedHead: (w) => w.detachedHead === true, + // Why the guess: #8873's exemption must fail open on hosts that predate isMainWorktree. + isMainWorktree: (w) => w.isMainWorktree ?? guessDefaultBranchWorkspace(w), + isSleeping: (w) => !isWorktreeActive(w) + } +} + +export function filterWorktrees( + worktrees: Worktree[], + filters: FilterState, + search: string, + repoHostIdByRepoId: ReadonlyMap = new Map(), + hiddenProjects: HiddenProjects = NO_HIDDEN_PROJECTS +): Worktree[] { + const result = filterWorkspaceRows( + worktrees, + filters, + phoneRowFacts(repoHostIdByRepoId, hiddenProjects) + ) + const q = search.trim().toLowerCase() + if (!q) { + return result + } + return result.filter( + (w) => + w.displayName.toLowerCase().includes(q) || + w.branch.toLowerCase().includes(q) || + w.repo.toLowerCase().includes(q) + ) +} diff --git a/native/computer-use-linux/runtime.py b/native/computer-use-linux/runtime.py index 9cfb2be2b53..22851711576 100644 --- a/native/computer-use-linux/runtime.py +++ b/native/computer-use-linux/runtime.py @@ -1414,7 +1414,7 @@ def insert_focused_text(window, value): raise RuntimeError("text_caret_unconfirmed: text was inserted but caret movement did not confirm success; inspect state before retrying") action = {"path": "accessibility", "actionName": "insertText", "fallbackReason": None} if attempt(lambda: Atspi.Text.get_text(text, start, caret)) == value: - action["verification"] = {"state": "verified", "property": "focusedText", "expected": value} + action["verification"] = {"state": "verified", "property": "focusedText"} return action diff --git a/native/computer-use-macos/Sources/OrcaComputerUseMacOS/main.swift b/native/computer-use-macos/Sources/OrcaComputerUseMacOS/main.swift index f25b5e8b7c9..1b47ed97355 100644 --- a/native/computer-use-macos/Sources/OrcaComputerUseMacOS/main.swift +++ b/native/computer-use-macos/Sources/OrcaComputerUseMacOS/main.swift @@ -899,12 +899,15 @@ final class Provider { return true } switch coercion.compare(readback: readback) { - case let .match(actualPreview): - verification = verifiedAction(property: "value", expected: expected, actualPreview: actualPreview) + case .match: + verification = verifiedAction(property: "value") case let .mismatch(actualPreview): - verification = unverifiedAction(reason: "value_mismatch", expected: expected, actualPreview: actualPreview) + // Why: a secure field can read back masked, so its value neither disproves the write nor gets shown. + verification = AXSnapshotReader().isSecureTextElement(record.element) + ? unverifiedAction(reason: "readback_unsupported") + : unverifiedAction(reason: "value_mismatch", actualPreview: actualPreview) case .unsupported: - verification = unverifiedAction(reason: "readback_unsupported", expected: expected) + verification = unverifiedAction(reason: "readback_unsupported") } return actionMetadata(path: "accessibility", actionName: "AXSetValue", verification: verification) } @@ -2426,6 +2429,10 @@ private final class AXSnapshotReader { return Array((visible.isEmpty ? rows : visible).prefix(20)) } + func isSecureTextElement(_ element: AXUIElement) -> Bool { + isSecureTextElement(element, role: stringAttribute(element, kAXRoleAttribute as String) ?? "") + } + private func isSecureTextElement(_ element: AXUIElement, role: String) -> Bool { guard SnapshotRenderHeuristics.shouldProbeSecureTextMetadata(role: role) else { return false @@ -2550,20 +2557,15 @@ private func actionMetadata( return metadata } -private func verifiedAction(property: String, expected: String? = nil, actualPreview: String? = nil) -> [String: Any] { - [ - "state": "verified", - "property": property, - "expected": jsonNullable(expected), - "actualPreview": jsonNullable(actualPreview), - ] +// Why: results never repeat the written text or field contents, so --value-stdin / --text-stdin secrets stay out of transcripts. +private func verifiedAction(property: String) -> [String: Any] { + ["state": "verified", "property": property] } -private func unverifiedAction(reason: String, expected: String? = nil, actualPreview: String? = nil) -> [String: Any] { +private func unverifiedAction(reason: String, actualPreview: String? = nil) -> [String: Any] { [ "state": "unverified", "reason": reason, - "expected": jsonNullable(expected), "actualPreview": jsonNullable(actualPreview), ] } @@ -2976,21 +2978,18 @@ private enum TextInput { guard result == .success else { return nil } - setSelectedTextRange(element, CFRange(location: startOffset + text.utf16.count, length: 0)) // Why: a cached, out-of-process AX tree can show the old value for a moment; any other value is final. let readback = settledValueReadback(element) { next == current || ($0 as? String) != current } as? String - guard readback == next else { - // Why: typing the text as keys after a write that landed enters it twice, so only an unchanged field falls back. - if readback == current { - return nil - } - return unverifiedAction(reason: "accessibility_action_unasserted", expected: text, actualPreview: readback.map { preview($0) }) + // Why: typing the text as keys after a write that landed enters it twice, so only an unchanged field falls back. + if readback == current && next != current { + return nil } - return verifiedAction( - property: "focusedText", - expected: text, - actualPreview: preview(next) - ) + // Why: moving the caret before a refused write would send the fallback keys to the wrong place. + setSelectedTextRange(element, CFRange(location: startOffset + text.utf16.count, length: 0)) + guard readback == next else { + return unverifiedAction(reason: "accessibility_action_unasserted") + } + return verifiedAction(property: "focusedText") } static func selectAll(_ element: AXUIElement) -> Bool { @@ -3008,7 +3007,7 @@ private enum TextInput { else { return unverifiedAction(reason: "provider_unavailable") } - return verifiedAction(property: "selection", actualPreview: preview(current)) + return verifiedAction(property: "selection") } private static func selectedTextRange(_ element: AXUIElement) -> CFRange? { diff --git a/native/computer-use-macos/Sources/OrcaComputerUseMacOSCore/AttributeValueCoercion.swift b/native/computer-use-macos/Sources/OrcaComputerUseMacOSCore/AttributeValueCoercion.swift index 974e6b99d73..c58a4ce53cc 100644 --- a/native/computer-use-macos/Sources/OrcaComputerUseMacOSCore/AttributeValueCoercion.swift +++ b/native/computer-use-macos/Sources/OrcaComputerUseMacOSCore/AttributeValueCoercion.swift @@ -23,7 +23,7 @@ public struct AttributeValueCoercion: Equatable { } public enum ReadbackComparison: Equatable { - case match(actualPreview: String) + case match case mismatch(actualPreview: String) case unsupported } @@ -44,7 +44,7 @@ public struct AttributeValueCoercion: Equatable { return .unsupported } return actual == writeValue - ? .match(actualPreview: actual.preview) + ? .match : .mismatch(actualPreview: actual.preview) } diff --git a/native/computer-use-macos/Tests/OrcaComputerUseMacOSTests/AgentConnectionRequestLoopTests.swift b/native/computer-use-macos/Tests/OrcaComputerUseMacOSTests/AgentConnectionRequestLoopTests.swift index 90d8a45137f..6dac0321b91 100644 --- a/native/computer-use-macos/Tests/OrcaComputerUseMacOSTests/AgentConnectionRequestLoopTests.swift +++ b/native/computer-use-macos/Tests/OrcaComputerUseMacOSTests/AgentConnectionRequestLoopTests.swift @@ -23,16 +23,5 @@ final class AgentConnectionRequestLoopTests: XCTestCase { XCTAssertEqual(releasedBeforeNextRequest, true) } - func testStopsReadingWhenTheHandlerClosesTheConnection() { - var lines = ["a", "b", "c"] - var handled: [String] = [] - AgentConnectionRequestLoop.run(readLine: { lines.isEmpty ? nil : lines.removeFirst() }) { line in - handled.append(line) - return line != "b" - } - - XCTAssertEqual(handled, ["a", "b"]) - XCTAssertEqual(lines, ["c"]) - } } diff --git a/native/computer-use-macos/Tests/OrcaComputerUseMacOSTests/AuthenticatedConnectionHangupMonitorTests.swift b/native/computer-use-macos/Tests/OrcaComputerUseMacOSTests/AuthenticatedConnectionHangupMonitorTests.swift index e848fe93135..8b685b897e6 100644 --- a/native/computer-use-macos/Tests/OrcaComputerUseMacOSTests/AuthenticatedConnectionHangupMonitorTests.swift +++ b/native/computer-use-macos/Tests/OrcaComputerUseMacOSTests/AuthenticatedConnectionHangupMonitorTests.swift @@ -6,36 +6,7 @@ import XCTest final class AuthenticatedConnectionHangupMonitorTests: XCTestCase { - func testReportsPeerCloseWhileRequestHandlingIsBlocked() throws { - let descriptors = try makeSocketPair() - let hangup = expectation(description: "peer hangup") - let processingStarted = expectation(description: "processing started") - let releaseProcessing = DispatchSemaphore(value: 0) - let processingFinished = DispatchSemaphore(value: 0) - let monitor = try AuthenticatedConnectionHangupMonitor( - fileDescriptor: descriptors.local, - onHangup: { - hangup.fulfill() - } - ) - monitor.start() - DispatchQueue.global().async { - processingStarted.fulfill() - releaseProcessing.wait() - processingFinished.signal() - } - wait(for: [processingStarted], timeout: 1) - close(descriptors.peer) - - wait(for: [hangup], timeout: 1) - XCTAssertEqual(processingFinished.wait(timeout: .now() + 0.05), .timedOut) - - releaseProcessing.signal() - XCTAssertEqual(processingFinished.wait(timeout: .now() + 1), .success) - monitor.cancel() - close(descriptors.local) - } diff --git a/native/computer-use-macos/Tests/OrcaComputerUseMacOSTests/StableElementIndexesTests.swift b/native/computer-use-macos/Tests/OrcaComputerUseMacOSTests/StableElementIndexesTests.swift deleted file mode 100644 index 657c8ab90c7..00000000000 --- a/native/computer-use-macos/Tests/OrcaComputerUseMacOSTests/StableElementIndexesTests.swift +++ /dev/null @@ -1,36 +0,0 @@ -import OrcaComputerUseMacOSCore -import XCTest - -final class StableElementIndexesTests: XCTestCase { - private typealias Previous = (key: String, index: Int, signature: String) - - private func assign(_ current: [(String, String)], previous: [Previous] = [], nextFresh: Int = 0) -> (indexes: [Int], nextFreshIndex: Int) { - StableElementIndexes.assign( - current: current.map { $0.0 }, - previous: previous.map { (key: $0.key, index: $0.index) }, - previousNextFreshIndex: nextFresh - ) - } - - func testAnElementInsertedEarlyLeavesEveryOtherIndexAlone() { - let previous: [Previous] = [("window", 0, "AXWindow"), ("search", 1, "AXTextField"), ("row", 2, "AXRow")] - - let result = assign( - [("window", "AXWindow"), ("clear", "AXButton"), ("search", "AXTextField"), ("row", "AXRow")], - previous: previous, - nextFresh: 3 - ) - - XCTAssertEqual(result.indexes, [0, 3, 1, 2]) - XCTAssertEqual(result.nextFreshIndex, 4) - } - - func testARemovedIndexIsNeverHandedToADifferentNewElement() { - let previous: [Previous] = [("window", 0, "AXWindow"), ("search", 1, "AXTextField")] - - let result = assign([("window", "AXWindow"), ("new row", "AXRow")], previous: previous, nextFresh: 7) - - XCTAssertEqual(result.indexes, [0, 7]) - } - -} diff --git a/native/wayland-clipboard/protocol_test.py b/native/wayland-clipboard/protocol_test.py index 4c0086fd0e7..ca845f36f5d 100644 --- a/native/wayland-clipboard/protocol_test.py +++ b/native/wayland-clipboard/protocol_test.py @@ -33,7 +33,6 @@ class DataControlServer: self.source = None self.registry = None self.device = None - self.destroyed_offers = [] self.selected = threading.Event() self.disconnected = threading.Event() self.errors = [] @@ -129,8 +128,6 @@ class DataControlServer: self.send(self.device, 2) elif self.selection_event == "seat removal": self.send(self.registry, 1, number(10)) - elif kind == "offer" and opcode == 1: - self.destroyed_offers.append(object_id) elif kind != "source": raise RuntimeError(f"Unexpected request {kind}/{opcode}") @@ -177,10 +174,6 @@ class ClipboardProtocolTests(unittest.TestCase): server.send(server.source, 1) self.assertTrue(server.disconnected.wait(1)) - def test_size_limit_precedes_selection_publication(self): - with DataControlServer("ext_data_control") as server: - self.assertEqual(server.copy(b"x" * (16 * 1024 * 1024 + 1)).returncode, 65) - self.assertIsNone(server.source) def test_replacement_during_ack_is_success_but_device_loss_is_failure(self): for event, status in (("cancelled", 0), ("finished", 70), ("seat removal", 70)): @@ -237,22 +230,6 @@ pid_t fork(void) { finally: os.close(stalled) - def test_incoming_clipboard_and_primary_offers_are_released(self): - with DataControlServer("ext_data_control") as server: - self.assertEqual(server.copy(b"copy").returncode, 0) - for index, event in enumerate((1, 3)): - offer = 0xFF000000 + index - server.objects[offer] = "offer" - server.send(server.device, 0, number(offer)) - server.send(offer, 0, string("text/plain")) - server.send(server.device, event, number(offer)) - self.assertEqual(server.paste(), b"copy") - deadline = time.monotonic() + 1 - while len(server.destroyed_offers) < 2 and time.monotonic() < deadline: - time.sleep(0.01) - self.assertEqual(server.destroyed_offers, [0xFF000000, 0xFF000001]) - server.send(server.source, 1) - self.assertTrue(server.disconnected.wait(1)) def test_device_finished_and_seat_removal_stop_the_owner(self): for event in ("finished", "seat removal"): diff --git a/native/wayland-clipboard/x11_test.py b/native/wayland-clipboard/x11_test.py index bb72a242e04..c7425e0e6a3 100644 --- a/native/wayland-clipboard/x11_test.py +++ b/native/wayland-clipboard/x11_test.py @@ -64,11 +64,6 @@ class X11PublisherTest(unittest.TestCase): self.assertEqual(self.read(), text) self.assertEqual(self.read(), text) - def test_repeated_owners_survive_parent_exit_and_publish_in_order(self): - for index in range(20): - text = ("copy " + str(index)).encode() - self.copy(text) - self.assertEqual(self.read(), text) if __name__ == "__main__": diff --git a/resources/plugins/declarative/orca-testing.mjs b/resources/plugins/declarative/orca-testing.mjs index 05e98fa9f45..8a1efbd7081 100644 --- a/resources/plugins/declarative/orca-testing.mjs +++ b/resources/plugins/declarative/orca-testing.mjs @@ -1,44 +1,44 @@ // Generated by config/scripts/plugin-build/declarative-runtime/build-plugin-declarative-runtime.mjs from // src/shared/plugins/declarative/testing/. Do not edit. -var vb=Object.defineProperty;var Ke=(e,n)=>{for(var i in n)vb(e,i,{get:n[i],enumerable:!0})};import{readFileSync as aT}from"node:fs";import{dirname as fb,join as sT}from"node:path";var l={};Ke(l,{$brand:()=>Ja,$input:()=>$c,$output:()=>_c,INVALID:()=>fe,NEVER:()=>Ka,TimePrecision:()=>zc,ZodAny:()=>_d,ZodArray:()=>wd,ZodBase64:()=>Qo,ZodBase64URL:()=>ea,ZodBigInt:()=>En,ZodBigIntFormat:()=>ra,ZodBoolean:()=>Tn,ZodCIDRv4:()=>qo,ZodCIDRv6:()=>Yo,ZodCUID:()=>Go,ZodCUID2:()=>Bo,ZodCatch:()=>Bd,ZodCodec:()=>jr,ZodCompileAsyncError:()=>De,ZodCompileUnsupportedError:()=>F,ZodCreditCard:()=>pd,ZodCustom:()=>Ur,ZodCustomStringFormat:()=>jt,ZodDate:()=>Or,ZodDefault:()=>Rd,ZodDiscriminatedUnion:()=>Sd,ZodE164:()=>ta,ZodEmail:()=>Mo,ZodEmoji:()=>Fo,ZodEnum:()=>In,ZodError:()=>Lx,ZodExactOptional:()=>sa,ZodFile:()=>Cd,ZodFirstPartyTypeKind:()=>op,ZodFunction:()=>tp,ZodGUID:()=>Zo,ZodIBAN:()=>md,ZodIPv4:()=>Jo,ZodIPv6:()=>Xo,ZodISODate:()=>mt,ZodISODateTime:()=>pt,ZodISODuration:()=>gt,ZodISOTime:()=>ft,ZodInstanceOf:()=>ip,ZodIntersection:()=>Pd,ZodIssueCode:()=>Rx,ZodJWT:()=>na,ZodKSUID:()=>Ko,ZodLazy:()=>Yd,ZodLiteral:()=>Dd,ZodMAC:()=>dd,ZodMap:()=>Nd,ZodNaN:()=>Wd,ZodNanoID:()=>Vo,ZodNever:()=>kd,ZodNonOptional:()=>ua,ZodNull:()=>yd,ZodNullable:()=>Ud,ZodNumber:()=>Pn,ZodNumberFormat:()=>Ut,ZodObject:()=>zr,ZodOptional:()=>Cr,ZodPipe:()=>Lr,ZodPrefault:()=>Zd,ZodPreprocess:()=>Kd,ZodPromise:()=>ep,ZodReadonly:()=>Jd,ZodRealError:()=>xe,ZodRecord:()=>wn,ZodSet:()=>zd,ZodString:()=>Sn,ZodStringFormat:()=>X,ZodSuccess:()=>Gd,ZodSymbol:()=>hd,ZodTemplateLiteral:()=>qd,ZodTransform:()=>Ld,ZodTuple:()=>Ed,ZodType:()=>M,ZodULID:()=>Ho,ZodURL:()=>Ar,ZodUUID:()=>Ge,ZodUndefined:()=>vd,ZodUnion:()=>Dr,ZodUnknown:()=>$d,ZodVoid:()=>xd,ZodXID:()=>Wo,ZodXor:()=>Id,_ZodString:()=>Ro,_default:()=>Md,_function:()=>zh,any:()=>lh,array:()=>Nr,base64:()=>Gg,base64url:()=>Bg,bigint:()=>oh,boolean:()=>gd,catch:()=>Hd,check:()=>Dh,cidrv4:()=>Fg,cidrv6:()=>Vg,clone:()=>W,codec:()=>Eh,coerce:()=>sp,compile:()=>Ic,config:()=>te,core:()=>Qe,creditCard:()=>Wg,cuid:()=>Dg,cuid2:()=>Cg,currencyCode:()=>Qg,custom:()=>Ch,date:()=>ph,decode:()=>id,decodeAsync:()=>ad,deepPartial:()=>Kh,describe:()=>Lh,discriminatedUnion:()=>yh,e164:()=>Hg,email:()=>wg,emoji:()=>Ng,encode:()=>rd,encodeAsync:()=>od,endsWith:()=>mn,enum:()=>oa,exactOptional:()=>jd,file:()=>Ih,flattenError:()=>Qn,float32:()=>th,float64:()=>nh,formatError:()=>er,fromJSONSchema:()=>Hh,function:()=>zh,getDiscriminatedOption:()=>Ku,getErrorMap:()=>Zx,globalRegistry:()=>ue,gt:()=>Fe,gte:()=>Ie,guid:()=>Ig,hash:()=>eh,hex:()=>Yg,hostname:()=>qg,httpUrl:()=>Og,iban:()=>Kg,includes:()=>dn,input:()=>Xh,instanceof:()=>Uh,int:()=>jo,int32:()=>rh,int64:()=>ah,intersection:()=>Td,invertCodec:()=>Ah,ipv4:()=>Rg,ipv6:()=>Zg,iso:()=>Rr,json:()=>Mh,jwt:()=>Jg,keyof:()=>mh,ksuid:()=>Ug,lazy:()=>Qd,length:()=>Nt,literal:()=>wh,locales:()=>_r,looseObject:()=>hh,looseRecord:()=>_h,lowercase:()=>cn,lt:()=>Ze,lte:()=>we,mac:()=>Mg,map:()=>$h,maxLength:()=>Ot,maxSize:()=>ut,memoizer:()=>yr,meta:()=>jh,mime:()=>gn,minLength:()=>Ye,minSize:()=>Ve,multipleOf:()=>st,nan:()=>Th,nanoid:()=>zg,nativeEnum:()=>xh,negative:()=>So,never:()=>ia,nonnegative:()=>To,nonoptional:()=>Vd,nonpositive:()=>Po,normalize:()=>hn,null:()=>bd,nullable:()=>Er,nullish:()=>Sh,number:()=>fd,object:()=>fh,optional:()=>Ct,output:()=>qh,overwrite:()=>Ce,parse:()=>Ql,parseAsync:()=>ed,partialRecord:()=>bh,pipe:()=>Uo,positive:()=>Io,prefault:()=>Fd,preprocess:()=>Zh,prettifyError:()=>es,promise:()=>Nh,properties:()=>fn,property:()=>Eo,readonly:()=>Xd,record:()=>Od,refine:()=>np,regex:()=>un,regexes:()=>Te,registry:()=>Qi,safeDecode:()=>ud,safeDecodeAsync:()=>ld,safeEncode:()=>sd,safeEncodeAsync:()=>cd,safeParse:()=>td,safeParseAsync:()=>nd,set:()=>kh,setErrorMap:()=>Mx,size:()=>At,slugify:()=>_n,startsWith:()=>pn,strictObject:()=>gh,string:()=>Tr,stringFormat:()=>Xg,stringbool:()=>Rh,success:()=>Ph,superRefine:()=>rp,symbol:()=>uh,templateLiteral:()=>Oh,toJSONSchema:()=>zo,toLowerCase:()=>yn,toUpperCase:()=>bn,toZod:()=>Vn,transform:()=>aa,treeifyError:()=>Qa,trim:()=>vn,tuple:()=>Ad,uint32:()=>ih,uint64:()=>sh,ulid:()=>Lg,undefined:()=>ch,union:()=>An,unknown:()=>Dt,uppercase:()=>ln,url:()=>Ag,util:()=>_,uuid:()=>Sg,uuidv4:()=>Pg,uuidv6:()=>Tg,uuidv7:()=>Eg,validate:()=>tr,validateAsync:()=>nr,void:()=>dh,withParser:()=>eo,xid:()=>jg,xor:()=>vh});var Qe={};Ke(Qe,{$ZodAny:()=>Ru,$ZodArray:()=>Bu,$ZodAsyncError:()=>$e,$ZodBase64:()=>Pu,$ZodBase64URL:()=>Tu,$ZodBigInt:()=>Ri,$ZodBigIntFormat:()=>Cu,$ZodBoolean:()=>pr,$ZodCIDRv4:()=>Iu,$ZodCIDRv6:()=>Su,$ZodCUID:()=>mu,$ZodCUID2:()=>fu,$ZodCatch:()=>lc,$ZodCheck:()=>q,$ZodCheckBigIntFormat:()=>Ms,$ZodCheckEndsWith:()=>Ys,$ZodCheckGreaterThan:()=>xi,$ZodCheckIncludes:()=>Xs,$ZodCheckLengthEquals:()=>Hs,$ZodCheckLessThan:()=>ki,$ZodCheckLowerCase:()=>Ks,$ZodCheckMaxLength:()=>Gs,$ZodCheckMaxSize:()=>Zs,$ZodCheckMimeType:()=>tu,$ZodCheckMinLength:()=>Bs,$ZodCheckMinSize:()=>Fs,$ZodCheckMultipleOf:()=>Us,$ZodCheckNumberFormat:()=>Rs,$ZodCheckOverwrite:()=>nu,$ZodCheckProperties:()=>eu,$ZodCheckProperty:()=>Qs,$ZodCheckRegex:()=>Ws,$ZodCheckSizeEquals:()=>Vs,$ZodCheckStartsWith:()=>qs,$ZodCheckStringFormat:()=>nn,$ZodCheckUpperCase:()=>Js,$ZodCodec:()=>fr,$ZodCreditCard:()=>Au,$ZodCustom:()=>vc,$ZodCustomStringFormat:()=>zu,$ZodCyclicError:()=>Hi,$ZodDate:()=>Vu,$ZodDefault:()=>ac,$ZodDiscriminatedUnion:()=>Ju,$ZodE164:()=>Eu,$ZodEmail:()=>su,$ZodEmoji:()=>du,$ZodEncodeError:()=>ot,$ZodEnum:()=>ec,$ZodError:()=>Ya,$ZodExactOptional:()=>ic,$ZodFile:()=>nc,$ZodFunction:()=>gc,$ZodGUID:()=>ou,$ZodIBAN:()=>Ou,$ZodIPv4:()=>ku,$ZodIPv6:()=>xu,$ZodISODate:()=>bu,$ZodISODateTime:()=>yu,$ZodISODuration:()=>$u,$ZodISOTime:()=>_u,$ZodIntersection:()=>Xu,$ZodJWT:()=>Nu,$ZodKSUID:()=>vu,$ZodLazy:()=>gr,$ZodLiteral:()=>tc,$ZodMAC:()=>wu,$ZodMap:()=>Yu,$ZodNaN:()=>dc,$ZodNanoID:()=>pu,$ZodNever:()=>Zu,$ZodNonOptional:()=>uc,$ZodNull:()=>Uu,$ZodNullable:()=>oc,$ZodNumber:()=>Ui,$ZodNumberFormat:()=>Du,$ZodObject:()=>zm,$ZodObjectJIT:()=>Hu,$ZodOptional:()=>Zi,$ZodPipe:()=>Fi,$ZodPrefault:()=>sc,$ZodPreprocess:()=>pc,$ZodPromise:()=>hc,$ZodReadonly:()=>mc,$ZodRealError:()=>ke,$ZodRecord:()=>qu,$ZodRegistry:()=>Yi,$ZodSet:()=>Qu,$ZodString:()=>St,$ZodStringFormat:()=>K,$ZodSuccess:()=>cc,$ZodSymbol:()=>Lu,$ZodTemplateLiteral:()=>fc,$ZodTransform:()=>rc,$ZodTuple:()=>Mi,$ZodType:()=>U,$ZodULID:()=>gu,$ZodURL:()=>lu,$ZodUUID:()=>au,$ZodUndefined:()=>ju,$ZodUnion:()=>mr,$ZodUnknown:()=>Mu,$ZodVoid:()=>Fu,$ZodXID:()=>hu,$ZodXor:()=>Wu,$brand:()=>Ja,$constructor:()=>h,$input:()=>$c,$output:()=>_c,Doc:()=>It,INVALID:()=>fe,JSONSchema:()=>$g,JSONSchemaGenerator:()=>Do,NEVER:()=>Ka,TimePrecision:()=>zc,URL_BAD_FORMAT:()=>uu,URL_UNPARSEABLE:()=>sr,ZodCompileAsyncError:()=>De,ZodCompileUnsupportedError:()=>F,_any:()=>Xc,_array:()=>rl,_base64:()=>$o,_base64url:()=>ko,_bigint:()=>Vc,_boolean:()=>Zc,_catch:()=>wx,_check:()=>og,_cidrv4:()=>bo,_cidrv6:()=>_o,_coercedBigint:()=>Gc,_coercedBoolean:()=>Fc,_coercedDate:()=>tl,_coercedNumber:()=>Cc,_coercedString:()=>Ec,_creditCard:()=>Oc,_cuid:()=>po,_cuid2:()=>mo,_custom:()=>ol,_date:()=>el,_decode:()=>di,_decodeAsync:()=>mi,_default:()=>$x,_discriminatedUnion:()=>cx,_e164:()=>xo,_email:()=>ro,_emoji:()=>co,_encode:()=>li,_encodeAsync:()=>pi,_endsWith:()=>mn,_enum:()=>gx,_file:()=>il,_float32:()=>jc,_float64:()=>Uc,_gt:()=>Fe,_gte:()=>Ie,_guid:()=>io,_iban:()=>Nc,_includes:()=>dn,_int:()=>Lc,_int32:()=>Rc,_int64:()=>Bc,_intersection:()=>lx,_ipv4:()=>vo,_ipv6:()=>yo,_isoDate:()=>xr,_isoDateTime:()=>kr,_isoDuration:()=>Ir,_isoTime:()=>wr,_jwt:()=>wo,_ksuid:()=>ho,_lazy:()=>Tx,_length:()=>Nt,_literal:()=>vx,_lowercase:()=>cn,_lt:()=>Ze,_lte:()=>we,_mac:()=>Ac,_map:()=>mx,_max:()=>we,_maxLength:()=>Ot,_maxSize:()=>ut,_mime:()=>gn,_min:()=>Ie,_minLength:()=>Ye,_minSize:()=>Ve,_multipleOf:()=>st,_nan:()=>nl,_nanoid:()=>lo,_nativeEnum:()=>hx,_negative:()=>So,_never:()=>Yc,_nonnegative:()=>To,_nonoptional:()=>kx,_nonpositive:()=>Po,_normalize:()=>hn,_null:()=>Jc,_nullable:()=>_x,_number:()=>Dc,_optional:()=>bx,_overwrite:()=>Ce,_parse:()=>Yt,_parseAsync:()=>Qt,_pipe:()=>Ix,_positive:()=>Io,_promise:()=>Ex,_properties:()=>fn,_property:()=>Eo,_readonly:()=>Sx,_record:()=>px,_refine:()=>al,_regex:()=>un,_safeDecode:()=>gi,_safeDecodeAsync:()=>vi,_safeEncode:()=>fi,_safeEncodeAsync:()=>hi,_safeParse:()=>en,_safeParseAsync:()=>tn,_set:()=>fx,_size:()=>At,_slugify:()=>_n,_startsWith:()=>pn,_string:()=>Tc,_stringFormat:()=>zt,_stringbool:()=>ll,_success:()=>xx,_superRefine:()=>sl,_symbol:()=>Wc,_templateLiteral:()=>Px,_toLowerCase:()=>yn,_toUpperCase:()=>bn,_transform:()=>yx,_trim:()=>vn,_tuple:()=>dx,_uint32:()=>Mc,_uint64:()=>Hc,_ulid:()=>fo,_undefined:()=>Kc,_union:()=>sx,_unknown:()=>qc,_uppercase:()=>ln,_url:()=>$r,_uuid:()=>oo,_uuidv4:()=>ao,_uuidv6:()=>so,_uuidv7:()=>uo,_void:()=>Qc,_xid:()=>go,_xor:()=>ux,base64Charset:()=>zi,base64urlCharset:()=>dr,canParseURL:()=>cu,clone:()=>W,compile:()=>Ic,compileFn:()=>to,config:()=>te,createStandardJSONSchemaMethod:()=>$n,createToJSONSchemaMethod:()=>pl,decode:()=>u_,decodeAsync:()=>l_,describe:()=>ul,encode:()=>s_,encodeAsync:()=>c_,extractDefs:()=>lt,finalize:()=>dt,flattenError:()=>Qn,formatError:()=>er,getDiscriminatedOption:()=>Ku,globalConfig:()=>ae,globalRegistry:()=>ue,handleUnrepresentable:()=>ie,initializeContext:()=>ct,isBackEdge:()=>Ki,isRecursiveSchema:()=>Wi,isValidBase64:()=>lr,isValidBase64URL:()=>Di,isValidCIDRv6:()=>Ni,isValidCreditCard:()=>Ci,isValidIBAN:()=>Li,isValidIPv6:()=>cr,isValidJWT:()=>ji,locales:()=>_r,memoizer:()=>yr,mergeValues:()=>rn,meta:()=>cl,parse:()=>ui,parseAsync:()=>ci,parseURLObject:()=>Am,prettifyError:()=>es,process:()=>J,processSchema:()=>J,regexes:()=>Te,registry:()=>Qi,safeDecode:()=>p_,safeDecodeAsync:()=>f_,safeEncode:()=>d_,safeEncodeAsync:()=>m_,safeParse:()=>n_,safeParseAsync:()=>r_,standardProps:()=>Ti,stripTabAndNewline:()=>ur,toDotPath:()=>cm,toJSONSchema:()=>zo,toZod:()=>Vn,treeifyError:()=>Qa,urlHostnameOk:()=>Ai,urlProtocolOk:()=>Oi,util:()=>_,validate:()=>tr,validateAsync:()=>nr,validateURL:()=>Ei,version:()=>ru,withParser:()=>eo});var _={};Ke(_,{BIGINT_FORMAT_RANGES:()=>Kn,CONSTANT_CATCH:()=>ai,Class:()=>Ua,NUMBER_FORMAT_RANGES:()=>Wn,aborted:()=>me,allowsEval:()=>Za,assert:()=>kb,assertEqual:()=>yb,assertIs:()=>_b,assertNever:()=>$b,assertNotEqual:()=>bb,assignProp:()=>se,attachSchema:()=>Jn,base64ToUint8Array:()=>rm,base64urlToUint8Array:()=>Zb,cached:()=>Kt,captureStackTrace:()=>ii,cleanEnum:()=>Mb,cleanRegex:()=>Xe,clone:()=>W,cloneDef:()=>Ib,codePointLength:()=>xt,constantCatch:()=>Ha,createTransparentProxy:()=>Ob,defineLazy:()=>Ra,defineLazyInternal:()=>Z,derived:()=>Bb,esc:()=>pe,escapeRegex:()=>Pe,explicitlyAborted:()=>Ga,extend:()=>Db,finalizeIssue:()=>_e,floatSafeRemainder:()=>Gn,getElementAtPath:()=>Sb,getEnumValues:()=>Ht,getLengthableOrigin:()=>qn,getParsedType:()=>Ab,getSizableOrigin:()=>Xn,hexToUint8Array:()=>Vb,hide:()=>Yn,installLazyProp:()=>Jb,isObject:()=>kt,isPlainObject:()=>Se,issue:()=>qt,joinValues:()=>v,jsonStringifyReplacer:()=>Wt,members:()=>Ba,merge:()=>Lb,mergeDefs:()=>ze,normalizeParams:()=>S,nullish:()=>ri,numKeys:()=>Eb,objectClone:()=>xb,omit:()=>zb,optionalKeys:()=>Va,own:()=>it,parsedType:()=>k,partial:()=>jb,pick:()=>Nb,prefixIssues:()=>be,primitiveTypes:()=>Fa,promiseAllObject:()=>Pb,propertyKeyTypes:()=>Hn,randomString:()=>Tb,rawShape:()=>Jt,required:()=>Ub,safeExtend:()=>Cb,shallowClone:()=>Bn,sizeCaps:()=>Xt,slugify:()=>Ma,stringifyPrimitive:()=>$,toZod:()=>Vn,uint8ArrayToBase64:()=>im,uint8ArrayToBase64url:()=>Fb,uint8ArrayToHex:()=>Gb,unwrapMessage:()=>Bt});function yb(e){return e}function bb(e){return e}function Vn(){return e=>e}function _b(e){}function $b(e){throw new Error("Unexpected value in exhaustive check")}function kb(e){}function Ht(e){let n=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,t])=>n.indexOf(+o)===-1).map(([o,t])=>t)}function v(e,n="|"){return e.map(i=>$(i)).join(n)}function Wt(e,n){return typeof n=="bigint"?n.toString():n}var ja=class{constructor(n){this._getter=n,this._value=void 0}get value(){let n=this._getter;return n!==void 0&&(this._value=n(),this._getter=void 0),this._value}};function Kt(e){return new ja(e)}function ri(e){return e==null}function Xe(e){let n=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(n,i)}function Gn(e,n){let i=e/n,o=Math.round(i),t=4*Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-o){let s=n._zod.def.shape[r];return o?o(s,r):s}):tm(e,r,o?o(a.value,r):a.value))}}function wb(e,n){for(let i of Reflect.ownKeys(n)){let o=Object.getOwnPropertyDescriptor(n,i);o.enumerable&&(o.get?em(e,i,()=>n[i]):tm(e,i,o.value))}}function ze(...e){let n={};for(let i of e){let o=Object.getOwnPropertyDescriptors(i);Object.assign(n,o)}return Object.defineProperties({},n)}function Ib(e){return ze(e._zod.def)}function Sb(e,n){return n?n.reduce((i,o)=>i?.[o],e):e}function Pb(e){let n=Object.keys(e),i=n.map(o=>e[o]);return Promise.all(i).then(o=>{let t={};for(let r=0;r{};function kt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Za=Kt(()=>{if(ae.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Se(e){if(kt(e)===!1)return!1;let n=e.constructor;if(n===void 0||typeof n!="function")return!0;let i=n.prototype;return!(kt(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Bn(e){return Se(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Eb(e){let n=0;for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&n++;return n}var Ab=e=>{let n=typeof e;switch(n){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${n}`)}},Hn=new Set(["string","number","symbol"]),Fa=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Pe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function W(e,n,i){let o=new e._zod.constr(n??e._zod.def);return(!n||i?.parent)&&(o._zod.parent=e),o}function S(e){let n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function Ob(e){let n;return new Proxy({},{get(i,o,t){return n??(n=e()),Reflect.get(n,o,t)},set(i,o,t,r){return n??(n=e()),Reflect.set(n,o,t,r)},has(i,o){return n??(n=e()),Reflect.has(n,o)},deleteProperty(i,o){return n??(n=e()),Reflect.deleteProperty(n,o)},ownKeys(i){return n??(n=e()),Reflect.ownKeys(n)},getOwnPropertyDescriptor(i,o){return n??(n=e()),Reflect.getOwnPropertyDescriptor(n,o)},defineProperty(i,o,t){return n??(n=e()),Reflect.defineProperty(n,o,t)}})}function $(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Va(e){return Object.keys(e).filter(n=>e[n]._zod.optin!==void 0&&e[n]._zod.optout==="optional")}var Wn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Kn={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Nb(e,n){let i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let r={};return $t(r,e,oi(e,n)),W(e,ze(i,{shape:r,checks:[]}))}function oi(e,n){let i=Je(e),o=[];for(let t of Reflect.ownKeys(n)){if(!Object.getOwnPropertyDescriptor(i,t)?.enumerable)throw new Error(`Unrecognized key: "${String(t)}"`);n[t]&&o.push(t)}return o}function zb(e,n){let i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let r=new Set(oi(e,n)),a={};return $t(a,e,Reflect.ownKeys(Je(e)).filter(s=>!r.has(s))),W(e,ze(i,{shape:a,checks:[]}))}function Db(e,n){if(!Se(n))throw new Error("Invalid input to extend: expected a plain object");let i=e._zod.def.checks;if(i&&i.length>0){let t=Je(e);for(let r of Reflect.ownKeys(n))if(Object.getOwnPropertyDescriptor(t,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return W(e,ze(e._zod.def,{shape:nm(e,n)}))}function nm(e,n){let i={};return $t(i,e,Reflect.ownKeys(Je(e))),wb(i,n),i}function Cb(e,n){if(!Se(n))throw new Error("Invalid input to safeExtend: expected a plain object");return W(e,ze(e._zod.def,{shape:nm(e,n)}))}function Lb(e,n){if(!n?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let i={};$t(i,e,Reflect.ownKeys(Je(e))),$t(i,n,Reflect.ownKeys(Je(n)));let o=ze(e._zod.def,{shape:i,get catchall(){return n._zod.def.catchall},checks:n._zod.def.checks??[]});return W(e,o)}function jb(e,n,i,o="partial"){let r=n._zod.def.checks;if(r&&r.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let s=i?new Set(oi(n,i)):void 0,u={};return $t(u,n,Reflect.ownKeys(Je(n)),e&&((c,d)=>s&&!s.has(d)?c:new e({type:"optional",innerType:c}))),W(n,ze(n._zod.def,{shape:u,checks:[]}))}function Ub(e,n,i){let o=i?new Set(oi(n,i)):void 0,t={};return $t(t,n,Reflect.ownKeys(Je(n)),(r,a)=>o&&!o.has(a)?r:new e({type:"nonoptional",innerType:r})),W(n,ze(n._zod.def,{shape:t}))}function me(e,n=0){if(e.aborted===!0)return!0;for(let i=n;i{var o;return(o=i).path??(o.path=[]),i.path.unshift(e),i})}function Bt(e){return typeof e=="string"?e:e?.message}function Xt(e){let n=[];for(let i of e??[]){let o=i._zod.def;if(!/_(length|size)$|_equals$/.test(o.check))break;let t=o.maximum??o.length??o.size;t>=0&&n.push([t,i])}return n}function Jn(e,n,i){var o;for(let t=n;tNumber.isNaN(Number.parseInt(n,10))).map(n=>n[1])}function rm(e){let n=atob(e),i=new Uint8Array(n.length);for(let o=0;on.toString(16).padStart(2,"0")).join("")}var Ua=class{constructor(...n){}};function Ba(e,n){for(let i in n){let o=Object.getOwnPropertyDescriptor(n,i);o.get?Object.defineProperty(e,i,{...o,enumerable:!1}):Hb(e,i,o.value)}}function it(e,n,i,o=!0){return Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:o,value:i}),i}function Yn(e,n,i){return it(e,n,i,!1)}function Bb(e,n){for(let i in e){let o=e[i];Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get(){return it(this,i,o(this))},set(t){it(this,i,t)}})}return n}function Hb(e,n,i){Object.defineProperty(e,n,{configurable:!0,get(){return this==null?i:it(this,n,i.bind(this))},set(o){it(this,n,o)}})}function Wb(e,n){let i=Object.getPrototypeOf(e);return n in i?void 0:i}var La,rt=!1,Kb={configurable:!0,get(){rt=!0}};function Z(e,n,i){let o=Object.getPrototypeOf(e._zod);if(n in o&&La!==e._zod){La=void 0;return}La=e._zod,Object.defineProperty(o,n,{configurable:!0,get(){Object.defineProperty(this,n,Kb);let t=rt;rt=!1;try{let r=i(this);return rt?delete this[n]:Object.defineProperty(this,n,{configurable:!0,writable:!0,value:r}),rt=rt||t,r}catch(r){throw delete this[n],rt=rt||t,r}},set(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t})}})}function Jb(e,n,i,o){let t=Wb(e,n);t&&Object.defineProperty(t,n,{configurable:!0,get(){let r={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,n,r),r.value=i(this),Object.defineProperty(this,n,r),r.value},set(r){Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:o,value:r})}})}var ai="~constantCatch";function Ha(e){let n=()=>e;return n[ai]=!0,n}var om,Ka=Object.freeze({status:"aborted"}),Wa={value:void 0,enumerable:!1},am="captureStackTrace"in Error?Error:null;function Xb(e){let n=am;if(n){let i=n.stackTraceLimit;if(typeof i=="number"){try{n.stackTraceLimit=0}catch{return am=null,new e}try{return new e}finally{n.stackTraceLimit=i}}}return new e}function h(e,n,i,o){let t={};function r(m){this.def=m,this.constr=p,this.traits=new Set}r.prototype=t;let a=i,s=a&&new WeakSet;function u(m,f){if(m._zod){if(m._zod.traits.has(e))return}else{Wa.value=new r(f);try{Object.defineProperty(m,"_zod",Wa)}finally{Wa.value=void 0}}if(m._zod.traits.add(e),n(m,f),s){let y=Object.getPrototypeOf(m),x=m._zod.constr.prototype,I=y;for(;I&&I!==x;)I=Object.getPrototypeOf(I);let b=I??y;s.has(b)||(s.add(b),Ba(b,a))}let g=p.prototype;for(let y in g)Object.prototype.hasOwnProperty.call(g,y)&&(y in m||(m[y]=g[y].bind(m)))}let c=o?.Parent??Object;class d extends c{}Object.defineProperty(d,"name",{value:e});function p(m){let f=o?.Parent?Xb(d):this;u(f,m);let g=f._zod.deferred;if(g){for(let x of g)x();f._zod.deferred=void 0}let y=globalThis.__zod_globalConfig?.postProcessor;return y&&y(f),f}return Object.defineProperty(p,"init",{value:u}),Object.defineProperty(p,Symbol.hasInstance,{value:m=>o?.Parent&&m instanceof o.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(p,"name",{value:e}),p}var Ja=Symbol("zod_brand"),$e=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ot=class extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}};(om=globalThis).__zod_globalConfig??(om.__zod_globalConfig={});var ae=globalThis.__zod_globalConfig;function te(e){return e&&Object.assign(ae,e),ae}function qb(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Wt,2)),e.message}function Yb(e){this._zod.message=e}var Qb={get:qb,set:Yb,enumerable:!0,configurable:!0},qa={value:void 0,enumerable:!1},sm=new WeakSet([Object.prototype,Error.prototype]),um=(e,n)=>{e.name="$ZodError",qa.value=n,Object.defineProperty(e,"issues",qa),qa.value=void 0,Object.defineProperty(e,"message",Qb);let i=Object.getPrototypeOf(e);sm.has(i)||(sm.add(i),Object.defineProperty(i,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},Ya=h("$ZodError",um),ke=h("$ZodError",um,void 0,{Parent:Error});function e_(e,n,i){return Object.prototype.hasOwnProperty.call(e,n)||(n==="__proto__"?Object.defineProperty(e,n,{value:i(),writable:!0,enumerable:!0,configurable:!0}):e[n]=i()),e[n]}function Qn(e,n=i=>i.message){let i={},o=[];for(let t of e.issues)t.path.length>0?e_(i,t.path[0],()=>[]).push(n(t)):o.push(n(t));return{formErrors:o,fieldErrors:i}}function er(e,n=i=>i.message){let i={_errors:[]},o=(t,r=[])=>{for(let a of t.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...r,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...r,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...r,...a.path]);else{let s=[...r,...a.path];if(s.length===0)i._errors.push(n(a));else{let u=i,c=0;for(;ci.message){let i={errors:[]},o=(t,r=[])=>{var a;for(let s of t.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(u=>o({issues:u},[...r,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...r,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...r,...s.path]);else{let u=[...r,...s.path];if(u.length===0){i.errors.push(n(s));continue}let c=i,d=0;for(;dtypeof o=="object"?o.key:o);for(let o of i)typeof o=="number"?n.push(`[${o}]`):typeof o=="symbol"?n.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?n.push(`[${JSON.stringify(o)}]`):(n.length&&n.push("."),n.push(o));return n.join("")}function es(e){let n=[],i=[...e.issues].sort((o,t)=>(o.path??[]).length-(t.path??[]).length);for(let o of i)n.push(`✖ ${o.message}`),o.path?.length&&n.push(` → at ${cm(o.path)}`);return n.join(` -`)}function si(e,n){return{callee:n?.callee??e,Err:n?.Err}}var Yt=e=>{let n=(i,o,t,r)=>{let a=t?{...t,async:!1}:{async:!1},s=i._zod.run({value:o,issues:[]},a);if(s instanceof Promise)throw new $e;if(s.issues.length){let u=new(r?.Err??e)(s.issues.map(c=>_e(c,a,te())));throw ii(u,r?.callee??n),u}return s.value};return n},ui=Yt(ke),Qt=e=>{let n=async(i,o,t,r)=>{let a=t?{...t,async:!0}:{async:!0},s=i._zod.run({value:o,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let u=new(r?.Err??e)(s.issues.map(c=>_e(c,a,te())));throw ii(u,r?.callee??n),u}return s.value};return n},ci=Qt(ke),en=e=>(n,i,o)=>{let t=o?{...o,async:!1}:{async:!1},r=n._zod.run({value:i,issues:[]},t);if(r instanceof Promise)throw new $e;return r.issues.length?lm(e,r.issues,t):{success:!0,data:r.value}},n_=en(ke);function lm(e,n,i){let o;return{success:!1,get error(){return o||(o=new e(n.map(t=>_e(t,i,te()))),n=void 0,i=void 0),o},set error(t){o=t,n=void 0,i=void 0}}}var tn=e=>async(n,i,o)=>{let t=o?{...o,async:!0}:{async:!0},r=n._zod.run({value:i,issues:[]},t);return r instanceof Promise&&(r=await r),r.issues.length?lm(e,r.issues,t):{success:!0,data:r.value}},r_=tn(ke),i_=Symbol.for("zod.compile.invalid"),o_=Symbol.for("zod.compile.fallback"),tr=((e,n,i)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(n)!==i_)return!0;if(o.definite===!0&&i===void 0)return!1}return a_(e,n,i)});function a_(e,n,i){let o=i?{...i,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},t=e._zod.bag.fallbackRun,r;if(t?(o[o_]=!0,r=t({value:n,issues:[]},o)):r=e._zod.run({value:n,issues:[]},o),r instanceof Promise)throw new $e;return r.issues.length===0}var nr=async(e,n,i)=>{let o=i?{...i,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},t=e._zod.run({value:n,issues:[]},o);return t instanceof Promise&&(t=await t),t.issues.length===0},li=e=>{let n=Yt(e),i=(o,t,r,a)=>{let s=r?{...r,direction:"backward"}:{direction:"backward"};return n(o,t,s,si(i,a))};return i},s_=li(ke),di=e=>{let n=Yt(e),i=(o,t,r,a)=>n(o,t,r,si(i,a));return i},u_=di(ke),pi=e=>{let n=Qt(e),i=async(o,t,r,a)=>{let s=r?{...r,direction:"backward"}:{direction:"backward"};return await n(o,t,s,si(i,a))};return i},c_=pi(ke),mi=e=>{let n=Qt(e),i=async(o,t,r,a)=>await n(o,t,r,si(i,a));return i},l_=mi(ke),fi=e=>(n,i,o)=>{let t=o?{...o,direction:"backward"}:{direction:"backward"};return en(e)(n,i,t)},d_=fi(ke),gi=e=>(n,i,o)=>en(e)(n,i,o),p_=gi(ke),hi=e=>async(n,i,o)=>{let t=o?{...o,direction:"backward"}:{direction:"backward"};return tn(e)(n,i,t)},m_=hi(ke),vi=e=>async(n,i,o)=>tn(e)(n,i,o),f_=vi(ke);var Te={};Ke(Te,{anyString:()=>Ps,base64:()=>ys,base64url:()=>bs,bigint:()=>Es,boolean:()=>As,browserEmail:()=>k_,cidrv4:()=>hs,cidrv6:()=>vs,creditCard:()=>yi,cuid:()=>ns,cuid2:()=>rs,currencyCode:()=>xs,date:()=>ws,datetime:()=>Ss,domain:()=>$s,duration:()=>cs,e164:()=>ks,email:()=>ds,emoji:()=>ps,extendedDuration:()=>g_,guid:()=>ls,hex:()=>Cs,hostname:()=>_s,html5Email:()=>b_,httpProtocol:()=>rr,iban:()=>bi,idnEmail:()=>$_,integer:()=>ir,ipv4:()=>ms,ipv6:()=>fs,ksuid:()=>as,lowercase:()=>zs,mac:()=>gs,md5_base64:()=>S_,md5_base64url:()=>P_,md5_hex:()=>I_,nanoid:()=>ss,nanoidOfLength:()=>us,null:()=>Os,number:()=>qe,rfc5322Email:()=>__,sha1_base64:()=>E_,sha1_base64url:()=>A_,sha1_hex:()=>T_,sha256_base64:()=>N_,sha256_base64url:()=>z_,sha256_hex:()=>O_,sha384_base64:()=>C_,sha384_base64url:()=>L_,sha384_hex:()=>D_,sha512_base64:()=>U_,sha512_base64url:()=>R_,sha512_hex:()=>j_,string:()=>Ts,time:()=>Is,ulid:()=>is,undefined:()=>Ns,unicodeEmail:()=>dm,uppercase:()=>Ds,uuid:()=>wt,uuid4:()=>h_,uuid6:()=>v_,uuid7:()=>y_,xid:()=>os});var ns=/^[cC][0-9a-z]{6,}$/,rs=/^[0-9a-z]+$/,is=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,os=/^[0-9a-vA-V]{20}$/,as=/^[A-Za-z0-9]{27}$/,ss=/^[a-zA-Z0-9_-]{21}$/;function us(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var cs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,g_=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ls=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,wt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,h_=wt(4),v_=wt(6),y_=wt(7),ds=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,b_=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,__=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,dm=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,$_=dm,k_=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,x_="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function ps(){return new RegExp(x_,"u")}var ms=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,fs=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,gs=e=>{let n=Pe(e??":");return new RegExp(`^(?:[0-9A-F]{2}${n}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${n}){5}[0-9a-f]{2}$`)},hs=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,vs=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ys=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,bs=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,_s=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,$s=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,rr=/^https?$/,ks=/^\+[1-9]\d{6,14}$/,yi=/^\d(?:[ -]?\d){11,18}$/,xs=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,bi=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,pm="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function w_(e){return new RegExp(`^${e}$`)}var ws=w_(pm);function ts(e){let n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${n}:[0-5]\\d(?:\\.\\d+)?`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Is(e){return new RegExp(`^${ts(e)}$`)}function Ss(e){let n=["Z"];e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${ts({precision:e.precision,seconds:!0})}(?:${n.join("|")})`,o=e.local?`${i}|${ts({precision:e.precision})}`:i;return new RegExp(`^${pm}T(?:${o})$`)}var Ps=/^[\s\S]{0,}$/,Ts=e=>{let n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},Es=/^-?\d+n?$/,ir=/^-?\d+$/,qe=/^-?\d+(?:\.\d+)?$/,As=/^(?:true|false)$/i,Os=/^null$/i;var Ns=/^undefined$/i;var zs=/^[^A-Z]*$/,Ds=/^[^a-z]*$/,Cs=/^[0-9a-fA-F]*$/;function or(e,n){return new RegExp(`^[A-Za-z0-9+/]{${e}}${n}$`)}function ar(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var I_=/^[0-9a-fA-F]{32}$/,S_=or(22,"=="),P_=ar(22),T_=/^[0-9a-fA-F]{40}$/,E_=or(27,"="),A_=ar(27),O_=/^[0-9a-fA-F]{64}$/,N_=or(43,"="),z_=ar(43),D_=/^[0-9a-fA-F]{96}$/,C_=or(64,""),L_=ar(64),j_=/^[0-9a-fA-F]{128}$/,U_=or(86,"=="),R_=ar(86);var q=h("$ZodCheck",(e,n)=>{var i;e._zod??(e._zod={}),e._zod.def=n,(i=e._zod).onattach??(i.onattach=[])}),Ls=e=>{let n=e.value;return!ri(n)&&n.size!==void 0},js=e=>{let n=e.value;return!ri(n)&&n.length!==void 0},_i={number:"number",bigint:"bigint",object:"date"},ki=h("$ZodCheckLessThan",(e,n)=>{q.init(e,n);let i=_i[typeof n.value];e._zod.check=o=>{(n.inclusive?o.value<=n.value:o.value{q.init(e,n);let i=_i[typeof n.value];e._zod.check=o=>{(n.inclusive?o.value>=n.value:o.value>n.value)||o.issues.push({origin:_i[typeof o.value]??i,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:o.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Us=h("$ZodCheckMultipleOf",(e,n)=>{q.init(e,n),e._zod.check=i=>{if(typeof i.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?n.value!==BigInt(0)&&i.value%n.value===BigInt(0):Gn(i.value,n.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:n.value,input:i.value,inst:e,continue:!n.abort})}}),Rs=h("$ZodCheckNumberFormat",(e,n)=>{q.init(e,n),n.format=n.format||"float64";let i=n.format?.includes("int"),o=i?"int":"number",[t,r]=Wn[n.format];e._zod.check=a=>{let s=a.value;if(i){if(!Number.isInteger(s)){a.issues.push({expected:o,format:n.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!n.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!n.abort});return}}sr&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!n.abort})}}),Ms=h("$ZodCheckBigIntFormat",(e,n)=>{q.init(e,n);let[i,o]=Kn[n.format];e._zod.check=t=>{let r=t.value;ro&&t.issues.push({origin:"bigint",input:r,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!n.abort})}}),Zs=h("$ZodCheckMaxSize",(e,n)=>{var i;q.init(e,n),(i=e._zod.def).when??(i.when=Ls),e._zod.check=o=>{let t=o.value;t.size<=n.maximum||o.issues.push({origin:Xn(t),code:"too_big",maximum:n.maximum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),Fs=h("$ZodCheckMinSize",(e,n)=>{var i;q.init(e,n),(i=e._zod.def).when??(i.when=Ls),e._zod.check=o=>{let t=o.value;t.size>=n.minimum||o.issues.push({origin:Xn(t),code:"too_small",minimum:n.minimum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),Vs=h("$ZodCheckSizeEquals",(e,n)=>{var i;q.init(e,n),(i=e._zod.def).when??(i.when=Ls),e._zod.check=o=>{let t=o.value,r=t.size;if(r===n.size)return;let a=r>n.size;o.issues.push({origin:Xn(t),...a?{code:"too_big",maximum:n.size}:{code:"too_small",minimum:n.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!n.abort})}}),Gs=h("$ZodCheckMaxLength",(e,n)=>{var i;q.init(e,n),(i=e._zod.def).when??(i.when=js),e._zod.check=o=>{let t=o.value,r=t.length;if((typeof t=="string"&&r>n.maximum?xt(t):r)<=n.maximum)return;let s=qn(t);o.issues.push({origin:s,code:"too_big",maximum:n.maximum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),Bs=h("$ZodCheckMinLength",(e,n)=>{var i;q.init(e,n),(i=e._zod.def).when??(i.when=js),e._zod.check=o=>{let t=o.value,r=t.length;if((typeof t=="string"&&r>=n.minimum&&r=n.minimum)return;let s=qn(t);o.issues.push({origin:s,code:"too_small",minimum:n.minimum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),Hs=h("$ZodCheckLengthEquals",(e,n)=>{var i;q.init(e,n),(i=e._zod.def).when??(i.when=js),e._zod.check=o=>{let t=o.value,r=t.length,a=typeof t=="string"&&r>=n.length&&r<=n.length*2?xt(t):r;if(a===n.length)return;let s=qn(t),u=a>n.length;o.issues.push({origin:s,...u?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!n.abort})}}),nn=h("$ZodCheckStringFormat",(e,n)=>{var i,o;q.init(e,n),n.pattern?(i=e._zod).check??(i.check=t=>{n.pattern.lastIndex=0,!n.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:n.format,input:t.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(o=e._zod).check??(o.check=()=>{})}),Ws=h("$ZodCheckRegex",(e,n)=>{nn.init(e,n),e._zod.check=i=>{n.pattern.lastIndex=0,!n.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),Ks=h("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=zs),nn.init(e,n)}),Js=h("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=Ds),nn.init(e,n)}),Xs=h("$ZodCheckIncludes",(e,n)=>{q.init(e,n);let i=Pe(n.includes),o=new RegExp(typeof n.position=="number"?`^.{${n.position},}${i}`:i);n.pattern=o,e._zod.check=t=>{t.value.includes(n.includes,n.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:t.value,inst:e,continue:!n.abort})}}),qs=h("$ZodCheckStartsWith",(e,n)=>{q.init(e,n);let i=new RegExp(`^${Pe(n.prefix)}.*`);n.pattern??(n.pattern=i),e._zod.check=o=>{o.value.startsWith(n.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:o.value,inst:e,continue:!n.abort})}}),Ys=h("$ZodCheckEndsWith",(e,n)=>{q.init(e,n);let i=new RegExp(`.*${Pe(n.suffix)}$`);n.pattern??(n.pattern=i),e._zod.check=o=>{o.value.endsWith(n.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:o.value,inst:e,continue:!n.abort})}});function $i(e,n,i){e.issues.length&&n.issues.push(...be(i,e.issues))}var Qs=h("$ZodCheckProperty",(e,n)=>{q.init(e,n),e._zod.check=i=>{let o=n.schema._zod.run({value:i.value[n.property],issues:[]},{});if(o instanceof Promise)return o.then(t=>$i(t,i,n.property));$i(o,i,n.property)}}),eu=h("$ZodCheckProperties",(e,n)=>{q.init(e,n),Yn(e,Symbol.iterator,function*(){yield e});let i;e._zod.check=o=>{if(o.value==null){o.issues.push({expected:"object",code:"invalid_type",input:o.value,inst:e});return}i??(i=Reflect.ownKeys(n.shape).map(a=>[a,n.shape[a]]));let t=o.value,r;for(let[a,s]of i){let u=s._zod.run({value:t[a],issues:[]},{});u instanceof Promise?(r??(r=[]),r.push(u.then(c=>$i(c,o,a)))):$i(u,o,a)}if(r)return Promise.all(r).then(()=>{})}}),tu=h("$ZodCheckMimeType",(e,n)=>{q.init(e,n);let i=new Set(n.mime);e._zod.check=o=>{i.has(o.value.type)||o.issues.push({code:"invalid_value",values:n.mime,input:o.value.type,inst:e,continue:!n.abort})}}),nu=h("$ZodCheckOverwrite",(e,n)=>{q.init(e,n),e._zod.check=i=>{i.value=n.tx(i.value)}});var It=class{constructor(n=[],i={}){this.content=[],this.indent=0,this.args=n,this.closed=i}indented(n){this.indent+=1;try{n(this)}finally{this.indent-=1}}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}let o=n.split(` -`).filter(a=>a),t=Math.min(...o.map(a=>a.length-a.trimStart().length)),r=o.map(a=>a.slice(t)).map(a=>" ".repeat(this.indent*2)+a);for(let a of r)this.content.push(a)}compile(){let n=Function,i=this?.content??[""];return new n(...Object.keys(this.closed),`return function (${this.args.join(", ")}) { -${i.join(` +var s_=Object.defineProperty;var qe=(e,n)=>{for(var o in n)s_(e,o,{get:n[o],enumerable:!0})};import{readFileSync as ME}from"node:fs";import{dirname as o_,join as FE}from"node:path";var u={};qe(u,{$brand:()=>ls,$input:()=>Lc,$output:()=>Dc,INVALID:()=>fe,NEVER:()=>cs,TimePrecision:()=>Kc,ZodAny:()=>Dd,ZodArray:()=>Rd,ZodBase64:()=>da,ZodBase64URL:()=>pa,ZodBigInt:()=>Dn,ZodBigIntFormat:()=>ga,ZodBoolean:()=>Cn,ZodCIDRv4:()=>ca,ZodCIDRv6:()=>la,ZodCUID:()=>na,ZodCUID2:()=>ra,ZodCatch:()=>ap,ZodCodec:()=>Wr,ZodCompileAsyncError:()=>Le,ZodCompileUnsupportedError:()=>G,ZodCreditCard:()=>Pd,ZodCustom:()=>Kr,ZodCustomStringFormat:()=>Zt,ZodDate:()=>Fr,ZodDefault:()=>ep,ZodDiscriminatedUnion:()=>Fd,ZodE164:()=>ma,ZodEmail:()=>Yi,ZodEmoji:()=>ea,ZodEnum:()=>On,ZodError:()=>SI,ZodExactOptional:()=>ba,ZodFile:()=>Xd,ZodFirstPartyTypeKind:()=>_p,ZodFunction:()=>hp,ZodGUID:()=>Qi,ZodIBAN:()=>Td,ZodIPv4:()=>sa,ZodIPv6:()=>ua,ZodISODate:()=>gt,ZodISODateTime:()=>ft,ZodISODuration:()=>vt,ZodISOTime:()=>ht,ZodInstanceOf:()=>bp,ZodIntersection:()=>Zd,ZodIssueCode:()=>EI,ZodJWT:()=>fa,ZodKSUID:()=>aa,ZodLazy:()=>mp,ZodLiteral:()=>Jd,ZodMAC:()=>Sd,ZodMap:()=>Wd,ZodNaN:()=>up,ZodNanoID:()=>ta,ZodNever:()=>Ud,ZodNonOptional:()=>_a,ZodNull:()=>zd,ZodNullable:()=>Qd,ZodNumber:()=>zn,ZodNumberFormat:()=>Gt,ZodObject:()=>Gr,ZodOptional:()=>Hr,ZodPipe:()=>Br,ZodPrefault:()=>np,ZodPreprocess:()=>cp,ZodPromise:()=>gp,ZodReadonly:()=>lp,ZodRealError:()=>Ie,ZodRecord:()=>An,ZodSet:()=>Kd,ZodString:()=>Nn,ZodStringFormat:()=>q,ZodSuccess:()=>ip,ZodSymbol:()=>Od,ZodTemplateLiteral:()=>pp,ZodTransform:()=>qd,ZodTuple:()=>Vd,ZodType:()=>F,ZodULID:()=>oa,ZodURL:()=>Mr,ZodUUID:()=>We,ZodUndefined:()=>Nd,ZodUnion:()=>Vr,ZodUnknown:()=>Ld,ZodVoid:()=>jd,ZodXID:()=>ia,ZodXor:()=>Md,_ZodString:()=>qi,_default:()=>tp,_function:()=>Xh,any:()=>Ph,array:()=>Zr,base64:()=>sh,base64url:()=>uh,bigint:()=>kh,boolean:()=>Ad,catch:()=>sp,check:()=>qh,cidrv4:()=>ih,cidrv6:()=>ah,clone:()=>K,codec:()=>Bh,coerce:()=>kp,compile:()=>Mc,config:()=>ne,core:()=>nt,creditCard:()=>lh,cuid:()=>qg,cuid2:()=>Yg,currencyCode:()=>hh,custom:()=>Yh,date:()=>Eh,decode:()=>bd,decodeAsync:()=>$d,deepPartial:()=>dv,describe:()=>Qh,discriminatedUnion:()=>Dh,e164:()=>ch,email:()=>Fg,emoji:()=>Jg,encode:()=>yd,encodeAsync:()=>_d,endsWith:()=>bn,enum:()=>va,exactOptional:()=>Yd,file:()=>Zh,flattenError:()=>cr,float32:()=>yh,float64:()=>bh,formatError:()=>lr,fromJSONSchema:()=>cv,function:()=>Xh,getDiscriminatedOption:()=>cc,getErrorMap:()=>OI,globalRegistry:()=>ce,gt:()=>He,gte:()=>Se,guid:()=>Zg,hash:()=>vh,hex:()=>gh,hostname:()=>fh,httpUrl:()=>Kg,iban:()=>dh,includes:()=>vn,input:()=>mv,instanceof:()=>tv,int:()=>Ji,int32:()=>_h,int64:()=>xh,intersection:()=>Gd,invertCodec:()=>Wh,ipv4:()=>nh,ipv6:()=>oh,iso:()=>Jr,json:()=>rv,jwt:()=>ph,keyof:()=>Ah,ksuid:()=>th,lazy:()=>fp,length:()=>Ut,literal:()=>Fh,locales:()=>Ar,looseObject:()=>zh,looseRecord:()=>Uh,lowercase:()=>gn,lt:()=>Ve,lte:()=>we,mac:()=>rh,map:()=>jh,maxLength:()=>Lt,maxSize:()=>lt,memoizer:()=>Tr,meta:()=>ev,mime:()=>$n,minLength:()=>tt,minSize:()=>Be,multipleOf:()=>ct,nan:()=>Hh,nanoid:()=>Xg,nativeEnum:()=>Mh,negative:()=>ji,never:()=>ha,nonnegative:()=>Mi,nonoptional:()=>op,nonpositive:()=>Ri,normalize:()=>kn,null:()=>Cd,nullable:()=>Rr,nullish:()=>Gh,number:()=>Ed,object:()=>Oh,optional:()=>Mt,output:()=>fv,overwrite:()=>Ue,parse:()=>fd,parseAsync:()=>gd,partialRecord:()=>Lh,pipe:()=>Xi,positive:()=>Ui,prefault:()=>rp,preprocess:()=>ov,prettifyError:()=>gs,promise:()=>Jh,properties:()=>_n,property:()=>Fi,readonly:()=>dp,record:()=>Bd,refine:()=>vp,regex:()=>fn,regexes:()=>Ee,registry:()=>pi,safeDecode:()=>xd,safeDecodeAsync:()=>wd,safeEncode:()=>kd,safeEncodeAsync:()=>Id,safeParse:()=>hd,safeParseAsync:()=>vd,set:()=>Rh,setErrorMap:()=>AI,size:()=>Dt,slugify:()=>Sn,startsWith:()=>yn,strictObject:()=>Nh,string:()=>jr,stringFormat:()=>mh,stringbool:()=>nv,success:()=>Vh,superRefine:()=>yp,symbol:()=>wh,templateLiteral:()=>Kh,toJSONSchema:()=>Hi,toLowerCase:()=>In,toUpperCase:()=>wn,toZod:()=>Qn,transform:()=>ya,treeifyError:()=>fs,trim:()=>xn,tuple:()=>Hd,uint32:()=>$h,uint64:()=>Ih,ulid:()=>Qg,undefined:()=>Sh,union:()=>Ln,unknown:()=>Rt,uppercase:()=>hn,url:()=>Wg,util:()=>_,uuid:()=>Gg,uuidv4:()=>Vg,uuidv6:()=>Hg,uuidv7:()=>Bg,validate:()=>dr,validateAsync:()=>pr,void:()=>Th,withParser:()=>mi,xid:()=>eh,xor:()=>Ch});var nt={};qe(nt,{$ZodAny:()=>ec,$ZodArray:()=>ac,$ZodAsyncError:()=>ke,$ZodBase64:()=>Zu,$ZodBase64URL:()=>Gu,$ZodBigInt:()=>Yo,$ZodBigIntFormat:()=>Xu,$ZodBoolean:()=>kr,$ZodCIDRv4:()=>Mu,$ZodCIDRv6:()=>Fu,$ZodCUID:()=>Tu,$ZodCUID2:()=>Eu,$ZodCatch:()=>wc,$ZodCheck:()=>Y,$ZodCheckBigIntFormat:()=>tu,$ZodCheckEndsWith:()=>mu,$ZodCheckGreaterThan:()=>Lo,$ZodCheckIncludes:()=>du,$ZodCheckLengthEquals:()=>su,$ZodCheckLessThan:()=>Do,$ZodCheckLowerCase:()=>cu,$ZodCheckMaxLength:()=>iu,$ZodCheckMaxSize:()=>nu,$ZodCheckMimeType:()=>hu,$ZodCheckMinLength:()=>au,$ZodCheckMinSize:()=>ru,$ZodCheckMultipleOf:()=>Qs,$ZodCheckNumberFormat:()=>eu,$ZodCheckOverwrite:()=>vu,$ZodCheckProperties:()=>gu,$ZodCheckProperty:()=>fu,$ZodCheckRegex:()=>uu,$ZodCheckSizeEquals:()=>ou,$ZodCheckStartsWith:()=>pu,$ZodCheckStringFormat:()=>cn,$ZodCheckUpperCase:()=>lu,$ZodCodec:()=>Ir,$ZodCreditCard:()=>Hu,$ZodCustom:()=>Nc,$ZodCustomStringFormat:()=>Ku,$ZodCyclicError:()=>ii,$ZodDate:()=>oc,$ZodDefault:()=>$c,$ZodDiscriminatedUnion:()=>lc,$ZodE164:()=>Vu,$ZodEmail:()=>ku,$ZodEmoji:()=>Su,$ZodEncodeError:()=>st,$ZodEnum:()=>gc,$ZodError:()=>ms,$ZodExactOptional:()=>bc,$ZodFile:()=>vc,$ZodFunction:()=>Ac,$ZodGUID:()=>_u,$ZodIBAN:()=>Bu,$ZodIPv4:()=>Uu,$ZodIPv6:()=>ju,$ZodISODate:()=>Cu,$ZodISODateTime:()=>zu,$ZodISODuration:()=>Lu,$ZodISOTime:()=>Du,$ZodIntersection:()=>dc,$ZodJWT:()=>Wu,$ZodKSUID:()=>Nu,$ZodLazy:()=>wr,$ZodLiteral:()=>hc,$ZodMAC:()=>Ru,$ZodMap:()=>mc,$ZodNaN:()=>Sc,$ZodNanoID:()=>Pu,$ZodNever:()=>nc,$ZodNonOptional:()=>xc,$ZodNull:()=>Qu,$ZodNullable:()=>_c,$ZodNumber:()=>qo,$ZodNumberFormat:()=>Ju,$ZodObject:()=>Xm,$ZodObjectJIT:()=>sc,$ZodOptional:()=>ei,$ZodPipe:()=>ti,$ZodPrefault:()=>kc,$ZodPreprocess:()=>Pc,$ZodPromise:()=>Oc,$ZodReadonly:()=>Tc,$ZodRealError:()=>xe,$ZodRecord:()=>pc,$ZodRegistry:()=>di,$ZodSet:()=>fc,$ZodString:()=>Ot,$ZodStringFormat:()=>J,$ZodSuccess:()=>Ic,$ZodSymbol:()=>qu,$ZodTemplateLiteral:()=>Ec,$ZodTransform:()=>yc,$ZodTuple:()=>Qo,$ZodType:()=>R,$ZodULID:()=>Au,$ZodURL:()=>wu,$ZodUUID:()=>$u,$ZodUndefined:()=>Yu,$ZodUnion:()=>xr,$ZodUnknown:()=>tc,$ZodVoid:()=>rc,$ZodXID:()=>Ou,$ZodXor:()=>uc,$brand:()=>ls,$constructor:()=>h,$input:()=>Lc,$output:()=>Dc,Doc:()=>At,INVALID:()=>fe,JSONSchema:()=>jg,JSONSchemaGenerator:()=>Bi,NEVER:()=>cs,TimePrecision:()=>Kc,URL_BAD_FORMAT:()=>xu,URL_UNPARSEABLE:()=>vr,ZodCompileAsyncError:()=>Le,ZodCompileUnsupportedError:()=>G,_any:()=>dl,_array:()=>yl,_base64:()=>zi,_base64url:()=>Ci,_bigint:()=>ol,_boolean:()=>nl,_catch:()=>fI,_check:()=>kg,_cidrv4:()=>Oi,_cidrv6:()=>Ni,_coercedBigint:()=>il,_coercedBoolean:()=>rl,_coercedDate:()=>hl,_coercedNumber:()=>Xc,_coercedString:()=>Vc,_creditCard:()=>Bc,_cuid:()=>Ii,_cuid2:()=>wi,_custom:()=>_l,_date:()=>gl,_decode:()=>Io,_decodeAsync:()=>So,_default:()=>dI,_discriminatedUnion:()=>Qx,_e164:()=>Di,_email:()=>hi,_emoji:()=>ki,_encode:()=>xo,_encodeAsync:()=>wo,_endsWith:()=>bn,_enum:()=>iI,_file:()=>bl,_float32:()=>Yc,_float64:()=>Qc,_gt:()=>He,_gte:()=>Se,_guid:()=>vi,_iban:()=>Wc,_includes:()=>vn,_int:()=>qc,_int32:()=>el,_int64:()=>al,_intersection:()=>eI,_ipv4:()=>Ei,_ipv6:()=>Ai,_isoDate:()=>zr,_isoDateTime:()=>Nr,_isoDuration:()=>Dr,_isoTime:()=>Cr,_jwt:()=>Li,_ksuid:()=>Ti,_lazy:()=>yI,_length:()=>Ut,_literal:()=>sI,_lowercase:()=>gn,_lt:()=>Ve,_lte:()=>we,_mac:()=>Hc,_map:()=>rI,_max:()=>we,_maxLength:()=>Lt,_maxSize:()=>lt,_mime:()=>$n,_min:()=>Se,_minLength:()=>tt,_minSize:()=>Be,_multipleOf:()=>ct,_nan:()=>vl,_nanoid:()=>xi,_nativeEnum:()=>aI,_negative:()=>ji,_never:()=>ml,_nonnegative:()=>Mi,_nonoptional:()=>pI,_nonpositive:()=>Ri,_normalize:()=>kn,_null:()=>ll,_nullable:()=>lI,_number:()=>Jc,_optional:()=>cI,_overwrite:()=>Ue,_parse:()=>on,_parseAsync:()=>an,_pipe:()=>gI,_positive:()=>Ui,_promise:()=>bI,_properties:()=>_n,_property:()=>Fi,_readonly:()=>hI,_record:()=>nI,_refine:()=>$l,_regex:()=>fn,_safeDecode:()=>To,_safeDecodeAsync:()=>Ao,_safeEncode:()=>Po,_safeEncodeAsync:()=>Eo,_safeParse:()=>sn,_safeParseAsync:()=>un,_set:()=>oI,_size:()=>Dt,_slugify:()=>Sn,_startsWith:()=>yn,_string:()=>Gc,_stringFormat:()=>jt,_stringbool:()=>wl,_success:()=>mI,_superRefine:()=>kl,_symbol:()=>ul,_templateLiteral:()=>vI,_toLowerCase:()=>In,_toUpperCase:()=>wn,_transform:()=>uI,_trim:()=>xn,_tuple:()=>tI,_uint32:()=>tl,_uint64:()=>sl,_ulid:()=>Si,_undefined:()=>cl,_union:()=>qx,_unknown:()=>pl,_uppercase:()=>hn,_url:()=>Or,_uuid:()=>yi,_uuidv4:()=>bi,_uuidv6:()=>_i,_uuidv7:()=>$i,_void:()=>fl,_xid:()=>Pi,_xor:()=>Yx,base64Charset:()=>Bo,base64urlCharset:()=>$r,canParseURL:()=>Iu,clone:()=>K,compile:()=>Mc,compileFn:()=>fi,config:()=>ne,createStandardJSONSchemaMethod:()=>Pn,createToJSONSchemaMethod:()=>Pl,decode:()=>Y_,decodeAsync:()=>e$,describe:()=>xl,encode:()=>q_,encodeAsync:()=>Q_,extractDefs:()=>pt,finalize:()=>mt,flattenError:()=>cr,formatError:()=>lr,getDiscriminatedOption:()=>cc,globalConfig:()=>se,globalRegistry:()=>ce,handleUnrepresentable:()=>ie,initializeContext:()=>dt,isBackEdge:()=>si,isRecursiveSchema:()=>ai,isValidBase64:()=>_r,isValidBase64URL:()=>Wo,isValidCIDRv6:()=>Ho,isValidCreditCard:()=>Ko,isValidIBAN:()=>Jo,isValidIPv6:()=>br,isValidJWT:()=>Xo,locales:()=>Ar,memoizer:()=>Tr,mergeValues:()=>ln,meta:()=>Il,parse:()=>$o,parseAsync:()=>ko,parseURLObject:()=>Wm,prettifyError:()=>gs,process:()=>X,processSchema:()=>X,regexes:()=>Ee,registry:()=>pi,safeDecode:()=>n$,safeDecodeAsync:()=>o$,safeEncode:()=>t$,safeEncodeAsync:()=>r$,safeParse:()=>B_,safeParseAsync:()=>W_,standardProps:()=>Fo,stripTabAndNewline:()=>yr,toDotPath:()=>Sm,toJSONSchema:()=>Hi,toZod:()=>Qn,treeifyError:()=>fs,urlHostnameOk:()=>Go,urlProtocolOk:()=>Vo,util:()=>_,validate:()=>dr,validateAsync:()=>pr,validateURL:()=>Zo,version:()=>yu,withParser:()=>mi});var _={};qe(_,{BIGINT_FORMAT_RANGES:()=>or,CONSTANT_CATCH:()=>bo,Class:()=>Qa,NUMBER_FORMAT_RANGES:()=>rr,aborted:()=>me,allowsEval:()=>ns,assert:()=>p_,assertEqual:()=>u_,assertIs:()=>l_,assertNever:()=>d_,assertNotEqual:()=>c_,assignProp:()=>ue,attachSchema:()=>ir,base64ToUint8Array:()=>_m,base64urlToUint8Array:()=>O_,cached:()=>en,captureStackTrace:()=>vo,cleanEnum:()=>A_,cleanRegex:()=>Qe,clone:()=>K,cloneDef:()=>g_,codePointLength:()=>Tt,constantCatch:()=>ss,createTransparentProxy:()=>$_,defineLazy:()=>es,defineLazyInternal:()=>Z,derived:()=>D_,esc:()=>pe,escapeRegex:()=>Te,explicitlyAborted:()=>is,extend:()=>I_,finalizeIssue:()=>$e,floatSafeRemainder:()=>er,getElementAtPath:()=>h_,getEnumValues:()=>Yt,getLengthableOrigin:()=>sr,getParsedType:()=>__,getSizableOrigin:()=>ar,hexToUint8Array:()=>z_,hide:()=>ur,installLazyProp:()=>R_,isObject:()=>Pt,isPlainObject:()=>Pe,issue:()=>rn,joinValues:()=>v,jsonStringifyReplacer:()=>Qt,members:()=>as,merge:()=>S_,mergeDefs:()=>De,normalizeParams:()=>S,nullish:()=>ho,numKeys:()=>b_,objectClone:()=>m_,omit:()=>x_,optionalKeys:()=>os,own:()=>at,parsedType:()=>k,partial:()=>P_,pick:()=>k_,prefixIssues:()=>_e,primitiveTypes:()=>rs,promiseAllObject:()=>v_,propertyKeyTypes:()=>nr,randomString:()=>y_,rawShape:()=>tn,required:()=>T_,safeExtend:()=>w_,shallowClone:()=>tr,sizeCaps:()=>nn,slugify:()=>ts,stringifyPrimitive:()=>$,toZod:()=>Qn,uint8ArrayToBase64:()=>$m,uint8ArrayToBase64url:()=>N_,uint8ArrayToHex:()=>C_,unwrapMessage:()=>qt});function u_(e){return e}function c_(e){return e}function Qn(){return e=>e}function l_(e){}function d_(e){throw new Error("Unexpected value in exhaustive check")}function p_(e){}function Yt(e){let n=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,t])=>n.indexOf(+i)===-1).map(([i,t])=>t)}function v(e,n="|"){return e.map(o=>$(o)).join(n)}function Qt(e,n){return typeof n=="bigint"?n.toString():n}var Ya=class{constructor(n){this._getter=n,this._value=void 0}get value(){let n=this._getter;return n!==void 0&&(this._value=n(),this._getter=void 0),this._value}};function en(e){return new Ya(e)}function ho(e){return e==null}function Qe(e){let n=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(n,o)}function er(e,n){let o=e/n,i=Math.round(o),t=4*Number.EPSILON*Math.max(Math.abs(o),1);return Math.abs(o-i){let s=n._zod.def.shape[r];return i?i(s,r):s}):ym(e,r,i?i(a.value,r):a.value))}}function f_(e,n){for(let o of Reflect.ownKeys(n)){let i=Object.getOwnPropertyDescriptor(n,o);i.enumerable&&(i.get?vm(e,o,()=>n[o]):ym(e,o,i.value))}}function De(...e){let n={};for(let o of e){let i=Object.getOwnPropertyDescriptors(o);Object.assign(n,i)}return Object.defineProperties({},n)}function g_(e){return De(e._zod.def)}function h_(e,n){return n?n.reduce((o,i)=>o?.[i],e):e}function v_(e){let n=Object.keys(e),o=n.map(i=>e[i]);return Promise.all(o).then(i=>{let t={};for(let r=0;r{};function Pt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ns=en(()=>{if(se.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Pe(e){if(Pt(e)===!1)return!1;let n=e.constructor;if(n===void 0||typeof n!="function")return!0;let o=n.prototype;return!(Pt(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function tr(e){return Pe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function b_(e){let n=0;for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&n++;return n}var __=e=>{let n=typeof e;switch(n){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${n}`)}},nr=new Set(["string","number","symbol"]),rs=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Te(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function K(e,n,o){let i=new e._zod.constr(n??e._zod.def);return(!n||o?.parent)&&(i._zod.parent=e),i}function S(e){let n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function $_(e){let n;return new Proxy({},{get(o,i,t){return n??(n=e()),Reflect.get(n,i,t)},set(o,i,t,r){return n??(n=e()),Reflect.set(n,i,t,r)},has(o,i){return n??(n=e()),Reflect.has(n,i)},deleteProperty(o,i){return n??(n=e()),Reflect.deleteProperty(n,i)},ownKeys(o){return n??(n=e()),Reflect.ownKeys(n)},getOwnPropertyDescriptor(o,i){return n??(n=e()),Reflect.getOwnPropertyDescriptor(n,i)},defineProperty(o,i,t){return n??(n=e()),Reflect.defineProperty(n,i,t)}})}function $(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function os(e){return Object.keys(e).filter(n=>e[n]._zod.optin!==void 0&&e[n]._zod.optout==="optional")}var rr={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},or={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function k_(e,n){let o=e._zod.def,i=o.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let r={};return St(r,e,yo(e,n)),K(e,De(o,{shape:r,checks:[]}))}function yo(e,n){let o=Ye(e),i=[];for(let t of Reflect.ownKeys(n)){if(!Object.getOwnPropertyDescriptor(o,t)?.enumerable)throw new Error(`Unrecognized key: "${String(t)}"`);n[t]&&i.push(t)}return i}function x_(e,n){let o=e._zod.def,i=o.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let r=new Set(yo(e,n)),a={};return St(a,e,Reflect.ownKeys(Ye(e)).filter(s=>!r.has(s))),K(e,De(o,{shape:a,checks:[]}))}function I_(e,n){if(!Pe(n))throw new Error("Invalid input to extend: expected a plain object");let o=e._zod.def.checks;if(o&&o.length>0){let t=Ye(e);for(let r of Reflect.ownKeys(n))if(Object.getOwnPropertyDescriptor(t,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return K(e,De(e._zod.def,{shape:bm(e,n)}))}function bm(e,n){let o={};return St(o,e,Reflect.ownKeys(Ye(e))),f_(o,n),o}function w_(e,n){if(!Pe(n))throw new Error("Invalid input to safeExtend: expected a plain object");return K(e,De(e._zod.def,{shape:bm(e,n)}))}function S_(e,n){if(!n?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let o={};St(o,e,Reflect.ownKeys(Ye(e))),St(o,n,Reflect.ownKeys(Ye(n)));let i=De(e._zod.def,{shape:o,get catchall(){return n._zod.def.catchall},checks:n._zod.def.checks??[]});return K(e,i)}function P_(e,n,o,i="partial"){let r=n._zod.def.checks;if(r&&r.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let s=o?new Set(yo(n,o)):void 0,c={};return St(c,n,Reflect.ownKeys(Ye(n)),e&&((l,d)=>s&&!s.has(d)?l:new e({type:"optional",innerType:l}))),K(n,De(n._zod.def,{shape:c,checks:[]}))}function T_(e,n,o){let i=o?new Set(yo(n,o)):void 0,t={};return St(t,n,Reflect.ownKeys(Ye(n)),(r,a)=>i&&!i.has(a)?r:new e({type:"nonoptional",innerType:r})),K(n,De(n._zod.def,{shape:t}))}function me(e,n=0){if(e.aborted===!0)return!0;for(let o=n;o{var i;return(i=o).path??(i.path=[]),o.path.unshift(e),o})}function qt(e){return typeof e=="string"?e:e?.message}function nn(e){let n=[];for(let o of e??[]){let i=o._zod.def;if(!/_(length|size)$|_equals$/.test(i.check))break;let t=i.maximum??i.length??i.size;t>=0&&n.push([t,o])}return n}function ir(e,n,o){var i;for(let t=n;tNumber.isNaN(Number.parseInt(n,10))).map(n=>n[1])}function _m(e){let n=atob(e),o=new Uint8Array(n.length);for(let i=0;in.toString(16).padStart(2,"0")).join("")}var Qa=class{constructor(...n){}};function as(e,n){for(let o in n){let i=Object.getOwnPropertyDescriptor(n,o);i.get?Object.defineProperty(e,o,{...i,enumerable:!1}):L_(e,o,i.value)}}function at(e,n,o,i=!0){return Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:i,value:o}),o}function ur(e,n,o){return at(e,n,o,!1)}function D_(e,n){for(let o in e){let i=e[o];Object.defineProperty(n,o,{configurable:!0,enumerable:!0,get(){return at(this,o,i(this))},set(t){at(this,o,t)}})}return n}function L_(e,n,o){Object.defineProperty(e,n,{configurable:!0,get(){return this==null?o:at(this,n,o.bind(this))},set(i){at(this,n,i)}})}function U_(e,n){let o=Object.getPrototypeOf(e);return n in o?void 0:o}var qa,it=!1,j_={configurable:!0,get(){it=!0}};function Z(e,n,o){let i=Object.getPrototypeOf(e._zod);if(n in i&&qa!==e._zod){qa=void 0;return}qa=e._zod,Object.defineProperty(i,n,{configurable:!0,get(){Object.defineProperty(this,n,j_);let t=it;it=!1;try{let r=o(this);return it?delete this[n]:Object.defineProperty(this,n,{configurable:!0,writable:!0,value:r}),it=it||t,r}catch(r){throw delete this[n],it=it||t,r}},set(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t})}})}function R_(e,n,o,i){let t=U_(e,n);t&&Object.defineProperty(t,n,{configurable:!0,get(){let r={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,n,r),r.value=o(this),Object.defineProperty(this,n,r),r.value},set(r){Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:i,value:r})}})}var bo="~constantCatch";function ss(e){let n=()=>e;return n[bo]=!0,n}var km,cs=Object.freeze({status:"aborted"}),us={value:void 0,enumerable:!1},xm="captureStackTrace"in Error?Error:null;function M_(e){let n=xm;if(n){let o=n.stackTraceLimit;if(typeof o=="number"){try{n.stackTraceLimit=0}catch{return xm=null,new e}try{return new e}finally{n.stackTraceLimit=o}}}return new e}function h(e,n,o,i){let t={};function r(m){this.def=m,this.constr=p,this.traits=new Set}r.prototype=t;let a=o,s=a&&new WeakSet;function c(m,f){if(m._zod){if(m._zod.traits.has(e))return}else{us.value=new r(f);try{Object.defineProperty(m,"_zod",us)}finally{us.value=void 0}}if(m._zod.traits.add(e),n(m,f),s){let y=Object.getPrototypeOf(m),x=m._zod.constr.prototype,w=y;for(;w&&w!==x;)w=Object.getPrototypeOf(w);let b=w??y;s.has(b)||(s.add(b),as(b,a))}let g=p.prototype;for(let y in g)Object.prototype.hasOwnProperty.call(g,y)&&(y in m||(m[y]=g[y].bind(m)))}let l=i?.Parent??Object;class d extends l{}Object.defineProperty(d,"name",{value:e});function p(m){let f=i?.Parent?M_(d):this;c(f,m);let g=f._zod.deferred;if(g){for(let x of g)x();f._zod.deferred=void 0}let y=globalThis.__zod_globalConfig?.postProcessor;return y&&y(f),f}return Object.defineProperty(p,"init",{value:c}),Object.defineProperty(p,Symbol.hasInstance,{value:m=>i?.Parent&&m instanceof i.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(p,"name",{value:e}),p}var ls=Symbol("zod_brand"),ke=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},st=class extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}};(km=globalThis).__zod_globalConfig??(km.__zod_globalConfig={});var se=globalThis.__zod_globalConfig;function ne(e){return e&&Object.assign(se,e),se}function F_(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Qt,2)),e.message}function Z_(e){this._zod.message=e}var G_={get:F_,set:Z_,enumerable:!0,configurable:!0},ps={value:void 0,enumerable:!1},Im=new WeakSet([Object.prototype,Error.prototype]),wm=(e,n)=>{e.name="$ZodError",ps.value=n,Object.defineProperty(e,"issues",ps),ps.value=void 0,Object.defineProperty(e,"message",G_);let o=Object.getPrototypeOf(e);Im.has(o)||(Im.add(o),Object.defineProperty(o,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},ms=h("$ZodError",wm),xe=h("$ZodError",wm,void 0,{Parent:Error});function V_(e,n,o){return Object.prototype.hasOwnProperty.call(e,n)||(n==="__proto__"?Object.defineProperty(e,n,{value:o(),writable:!0,enumerable:!0,configurable:!0}):e[n]=o()),e[n]}function cr(e,n=o=>o.message){let o={},i=[];for(let t of e.issues)t.path.length>0?V_(o,t.path[0],()=>[]).push(n(t)):i.push(n(t));return{formErrors:i,fieldErrors:o}}function lr(e,n=o=>o.message){let o={_errors:[]},i=(t,r=[])=>{for(let a of t.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>i({issues:s},[...r,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...r,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...r,...a.path]);else{let s=[...r,...a.path];if(s.length===0)o._errors.push(n(a));else{let c=o,l=0;for(;lo.message){let o={errors:[]},i=(t,r=[])=>{var a;for(let s of t.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>i({issues:c},[...r,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...r,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...r,...s.path]);else{let c=[...r,...s.path];if(c.length===0){o.errors.push(n(s));continue}let l=o,d=0;for(;dtypeof i=="object"?i.key:i);for(let i of o)typeof i=="number"?n.push(`[${i}]`):typeof i=="symbol"?n.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?n.push(`[${JSON.stringify(i)}]`):(n.length&&n.push("."),n.push(i));return n.join("")}function gs(e){let n=[],o=[...e.issues].sort((i,t)=>(i.path??[]).length-(t.path??[]).length);for(let i of o)n.push(`✖ ${i.message}`),i.path?.length&&n.push(` → at ${Sm(i.path)}`);return n.join(` +`)}function _o(e,n){return{callee:n?.callee??e,Err:n?.Err}}var on=e=>{let n=(o,i,t,r)=>{let a=t?{...t,async:!1}:{async:!1},s=o._zod.run({value:i,issues:[]},a);if(s instanceof Promise)throw new ke;if(s.issues.length){let c=new(r?.Err??e)(s.issues.map(l=>$e(l,a,ne())));throw vo(c,r?.callee??n),c}return s.value};return n},$o=on(xe),an=e=>{let n=async(o,i,t,r)=>{let a=t?{...t,async:!0}:{async:!0},s=o._zod.run({value:i,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(r?.Err??e)(s.issues.map(l=>$e(l,a,ne())));throw vo(c,r?.callee??n),c}return s.value};return n},ko=an(xe),sn=e=>(n,o,i)=>{let t=i?{...i,async:!1}:{async:!1},r=n._zod.run({value:o,issues:[]},t);if(r instanceof Promise)throw new ke;return r.issues.length?Pm(e,r.issues,t):{success:!0,data:r.value}},B_=sn(xe);function Pm(e,n,o){let i;return{success:!1,get error(){return i||(i=new e(n.map(t=>$e(t,o,ne()))),n=void 0,o=void 0),i},set error(t){i=t,n=void 0,o=void 0}}}var un=e=>async(n,o,i)=>{let t=i?{...i,async:!0}:{async:!0},r=n._zod.run({value:o,issues:[]},t);return r instanceof Promise&&(r=await r),r.issues.length?Pm(e,r.issues,t):{success:!0,data:r.value}},W_=un(xe),K_=Symbol.for("zod.compile.invalid"),J_=Symbol.for("zod.compile.fallback"),dr=((e,n,o)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(n)!==K_)return!0;if(i.definite===!0&&o===void 0)return!1}return X_(e,n,o)});function X_(e,n,o){let i=o?{...o,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},t=e._zod.bag.fallbackRun,r;if(t?(i[J_]=!0,r=t({value:n,issues:[]},i)):r=e._zod.run({value:n,issues:[]},i),r instanceof Promise)throw new ke;return r.issues.length===0}var pr=async(e,n,o)=>{let i=o?{...o,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},t=e._zod.run({value:n,issues:[]},i);return t instanceof Promise&&(t=await t),t.issues.length===0},xo=e=>{let n=on(e),o=(i,t,r,a)=>{let s=r?{...r,direction:"backward"}:{direction:"backward"};return n(i,t,s,_o(o,a))};return o},q_=xo(xe),Io=e=>{let n=on(e),o=(i,t,r,a)=>n(i,t,r,_o(o,a));return o},Y_=Io(xe),wo=e=>{let n=an(e),o=async(i,t,r,a)=>{let s=r?{...r,direction:"backward"}:{direction:"backward"};return await n(i,t,s,_o(o,a))};return o},Q_=wo(xe),So=e=>{let n=an(e),o=async(i,t,r,a)=>await n(i,t,r,_o(o,a));return o},e$=So(xe),Po=e=>(n,o,i)=>{let t=i?{...i,direction:"backward"}:{direction:"backward"};return sn(e)(n,o,t)},t$=Po(xe),To=e=>(n,o,i)=>sn(e)(n,o,i),n$=To(xe),Eo=e=>async(n,o,i)=>{let t=i?{...i,direction:"backward"}:{direction:"backward"};return un(e)(n,o,t)},r$=Eo(xe),Ao=e=>async(n,o,i)=>un(e)(n,o,i),o$=Ao(xe);var Ee={};qe(Ee,{anyString:()=>Zs,base64:()=>zs,base64url:()=>Cs,bigint:()=>Vs,boolean:()=>Hs,browserEmail:()=>p$,cidrv4:()=>Os,cidrv6:()=>Ns,creditCard:()=>Oo,cuid:()=>vs,cuid2:()=>ys,currencyCode:()=>js,date:()=>Rs,datetime:()=>Fs,domain:()=>Ls,duration:()=>Is,e164:()=>Us,email:()=>Ss,emoji:()=>Ps,extendedDuration:()=>i$,guid:()=>ws,hex:()=>Xs,hostname:()=>Ds,html5Email:()=>c$,httpProtocol:()=>mr,iban:()=>No,idnEmail:()=>d$,integer:()=>fr,ipv4:()=>Ts,ipv6:()=>Es,ksuid:()=>$s,lowercase:()=>Ks,mac:()=>As,md5_base64:()=>h$,md5_base64url:()=>v$,md5_hex:()=>g$,nanoid:()=>ks,nanoidOfLength:()=>xs,null:()=>Bs,number:()=>et,rfc5322Email:()=>l$,sha1_base64:()=>b$,sha1_base64url:()=>_$,sha1_hex:()=>y$,sha256_base64:()=>k$,sha256_base64url:()=>x$,sha256_hex:()=>$$,sha384_base64:()=>w$,sha384_base64url:()=>S$,sha384_hex:()=>I$,sha512_base64:()=>T$,sha512_base64url:()=>E$,sha512_hex:()=>P$,string:()=>Gs,time:()=>Ms,ulid:()=>bs,undefined:()=>Ws,unicodeEmail:()=>Tm,uppercase:()=>Js,uuid:()=>Et,uuid4:()=>a$,uuid6:()=>s$,uuid7:()=>u$,xid:()=>_s});var vs=/^[cC][0-9a-z]{6,}$/,ys=/^[0-9a-z]+$/,bs=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,_s=/^[0-9a-vA-V]{20}$/,$s=/^[A-Za-z0-9]{27}$/,ks=/^[a-zA-Z0-9_-]{21}$/;function xs(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Is=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,i$=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ws=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Et=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,a$=Et(4),s$=Et(6),u$=Et(7),Ss=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,c$=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,l$=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Tm=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,d$=Tm,p$=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,m$="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Ps(){return new RegExp(m$,"u")}var Ts=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Es=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,As=e=>{let n=Te(e??":");return new RegExp(`^(?:[0-9A-F]{2}${n}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${n}){5}[0-9a-f]{2}$`)},Os=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ns=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,zs=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Cs=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Ds=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Ls=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,mr=/^https?$/,Us=/^\+[1-9]\d{6,14}$/,Oo=/^\d(?:[ -]?\d){11,18}$/,js=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,No=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,Em="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function f$(e){return new RegExp(`^${e}$`)}var Rs=f$(Em);function hs(e){let n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${n}:[0-5]\\d(?:\\.\\d+)?`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ms(e){return new RegExp(`^${hs(e)}$`)}function Fs(e){let n=["Z"];e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${hs({precision:e.precision,seconds:!0})}(?:${n.join("|")})`,i=e.local?`${o}|${hs({precision:e.precision})}`:o;return new RegExp(`^${Em}T(?:${i})$`)}var Zs=/^[\s\S]{0,}$/,Gs=e=>{let n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},Vs=/^-?\d+n?$/,fr=/^-?\d+$/,et=/^-?\d+(?:\.\d+)?$/,Hs=/^(?:true|false)$/i,Bs=/^null$/i;var Ws=/^undefined$/i;var Ks=/^[^A-Z]*$/,Js=/^[^a-z]*$/,Xs=/^[0-9a-fA-F]*$/;function gr(e,n){return new RegExp(`^[A-Za-z0-9+/]{${e}}${n}$`)}function hr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var g$=/^[0-9a-fA-F]{32}$/,h$=gr(22,"=="),v$=hr(22),y$=/^[0-9a-fA-F]{40}$/,b$=gr(27,"="),_$=hr(27),$$=/^[0-9a-fA-F]{64}$/,k$=gr(43,"="),x$=hr(43),I$=/^[0-9a-fA-F]{96}$/,w$=gr(64,""),S$=hr(64),P$=/^[0-9a-fA-F]{128}$/,T$=gr(86,"=="),E$=hr(86);var Y=h("$ZodCheck",(e,n)=>{var o;e._zod??(e._zod={}),e._zod.def=n,(o=e._zod).onattach??(o.onattach=[])}),qs=e=>{let n=e.value;return!ho(n)&&n.size!==void 0},Ys=e=>{let n=e.value;return!ho(n)&&n.length!==void 0},zo={number:"number",bigint:"bigint",object:"date"},Do=h("$ZodCheckLessThan",(e,n)=>{Y.init(e,n);let o=zo[typeof n.value];e._zod.check=i=>{(n.inclusive?i.value<=n.value:i.value{Y.init(e,n);let o=zo[typeof n.value];e._zod.check=i=>{(n.inclusive?i.value>=n.value:i.value>n.value)||i.issues.push({origin:zo[typeof i.value]??o,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:i.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Qs=h("$ZodCheckMultipleOf",(e,n)=>{Y.init(e,n),e._zod.check=o=>{if(typeof o.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof o.value=="bigint"?n.value!==BigInt(0)&&o.value%n.value===BigInt(0):er(o.value,n.value)===0)||o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:n.value,input:o.value,inst:e,continue:!n.abort})}}),eu=h("$ZodCheckNumberFormat",(e,n)=>{Y.init(e,n),n.format=n.format||"float64";let o=n.format?.includes("int"),i=o?"int":"number",[t,r]=rr[n.format];e._zod.check=a=>{let s=a.value;if(o){if(!Number.isInteger(s)){a.issues.push({expected:i,format:n.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!n.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!n.abort});return}}sr&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!n.abort})}}),tu=h("$ZodCheckBigIntFormat",(e,n)=>{Y.init(e,n);let[o,i]=or[n.format];e._zod.check=t=>{let r=t.value;ri&&t.issues.push({origin:"bigint",input:r,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!n.abort})}}),nu=h("$ZodCheckMaxSize",(e,n)=>{var o;Y.init(e,n),(o=e._zod.def).when??(o.when=qs),e._zod.check=i=>{let t=i.value;t.size<=n.maximum||i.issues.push({origin:ar(t),code:"too_big",maximum:n.maximum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),ru=h("$ZodCheckMinSize",(e,n)=>{var o;Y.init(e,n),(o=e._zod.def).when??(o.when=qs),e._zod.check=i=>{let t=i.value;t.size>=n.minimum||i.issues.push({origin:ar(t),code:"too_small",minimum:n.minimum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),ou=h("$ZodCheckSizeEquals",(e,n)=>{var o;Y.init(e,n),(o=e._zod.def).when??(o.when=qs),e._zod.check=i=>{let t=i.value,r=t.size;if(r===n.size)return;let a=r>n.size;i.issues.push({origin:ar(t),...a?{code:"too_big",maximum:n.size}:{code:"too_small",minimum:n.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!n.abort})}}),iu=h("$ZodCheckMaxLength",(e,n)=>{var o;Y.init(e,n),(o=e._zod.def).when??(o.when=Ys),e._zod.check=i=>{let t=i.value,r=t.length;if((typeof t=="string"&&r>n.maximum?Tt(t):r)<=n.maximum)return;let s=sr(t);i.issues.push({origin:s,code:"too_big",maximum:n.maximum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),au=h("$ZodCheckMinLength",(e,n)=>{var o;Y.init(e,n),(o=e._zod.def).when??(o.when=Ys),e._zod.check=i=>{let t=i.value,r=t.length;if((typeof t=="string"&&r>=n.minimum&&r=n.minimum)return;let s=sr(t);i.issues.push({origin:s,code:"too_small",minimum:n.minimum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),su=h("$ZodCheckLengthEquals",(e,n)=>{var o;Y.init(e,n),(o=e._zod.def).when??(o.when=Ys),e._zod.check=i=>{let t=i.value,r=t.length,a=typeof t=="string"&&r>=n.length&&r<=n.length*2?Tt(t):r;if(a===n.length)return;let s=sr(t),c=a>n.length;i.issues.push({origin:s,...c?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!n.abort})}}),cn=h("$ZodCheckStringFormat",(e,n)=>{var o,i;Y.init(e,n),n.pattern?(o=e._zod).check??(o.check=t=>{n.pattern.lastIndex=0,!n.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:n.format,input:t.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(i=e._zod).check??(i.check=()=>{})}),uu=h("$ZodCheckRegex",(e,n)=>{cn.init(e,n),e._zod.check=o=>{n.pattern.lastIndex=0,!n.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),cu=h("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=Ks),cn.init(e,n)}),lu=h("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=Js),cn.init(e,n)}),du=h("$ZodCheckIncludes",(e,n)=>{Y.init(e,n);let o=Te(n.includes),i=new RegExp(typeof n.position=="number"?`^.{${n.position},}${o}`:o);n.pattern=i,e._zod.check=t=>{t.value.includes(n.includes,n.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:t.value,inst:e,continue:!n.abort})}}),pu=h("$ZodCheckStartsWith",(e,n)=>{Y.init(e,n);let o=new RegExp(`^${Te(n.prefix)}.*`);n.pattern??(n.pattern=o),e._zod.check=i=>{i.value.startsWith(n.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:i.value,inst:e,continue:!n.abort})}}),mu=h("$ZodCheckEndsWith",(e,n)=>{Y.init(e,n);let o=new RegExp(`.*${Te(n.suffix)}$`);n.pattern??(n.pattern=o),e._zod.check=i=>{i.value.endsWith(n.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:i.value,inst:e,continue:!n.abort})}});function Co(e,n,o){e.issues.length&&n.issues.push(..._e(o,e.issues))}var fu=h("$ZodCheckProperty",(e,n)=>{Y.init(e,n),e._zod.check=o=>{let i=n.schema._zod.run({value:o.value[n.property],issues:[]},{});if(i instanceof Promise)return i.then(t=>Co(t,o,n.property));Co(i,o,n.property)}}),gu=h("$ZodCheckProperties",(e,n)=>{Y.init(e,n),ur(e,Symbol.iterator,function*(){yield e});let o;e._zod.check=i=>{if(i.value==null){i.issues.push({expected:"object",code:"invalid_type",input:i.value,inst:e});return}o??(o=Reflect.ownKeys(n.shape).map(a=>[a,n.shape[a]]));let t=i.value,r;for(let[a,s]of o){let c=s._zod.run({value:t[a],issues:[]},{});c instanceof Promise?(r??(r=[]),r.push(c.then(l=>Co(l,i,a)))):Co(c,i,a)}if(r)return Promise.all(r).then(()=>{})}}),hu=h("$ZodCheckMimeType",(e,n)=>{Y.init(e,n);let o=new Set(n.mime);e._zod.check=i=>{o.has(i.value.type)||i.issues.push({code:"invalid_value",values:n.mime,input:i.value.type,inst:e,continue:!n.abort})}}),vu=h("$ZodCheckOverwrite",(e,n)=>{Y.init(e,n),e._zod.check=o=>{o.value=n.tx(o.value)}});var At=class{constructor(n=[],o={}){this.content=[],this.indent=0,this.args=n,this.closed=o}indented(n){this.indent+=1;try{n(this)}finally{this.indent-=1}}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}let i=n.split(` +`).filter(a=>a),t=Math.min(...i.map(a=>a.length-a.trimStart().length)),r=i.map(a=>a.slice(t)).map(a=>" ".repeat(this.indent*2)+a);for(let a of r)this.content.push(a)}compile(){let n=Function,o=this?.content??[""];return new n(...Object.keys(this.closed),`return function (${this.args.join(", ")}) { +${o.join(` `)} -};`)(...Object.values(this.closed))}};var ru={major:4,minor:6,patch:7};var U=h("$ZodType",(e,n)=>{var i;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=ru;let o=e._zod.def.checks,t=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let r of t)for(let a of r._zod.onattach)a(e);if(t.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(s,u,c)=>{if(s.memo)return s;let d=me(s),p;for(let m of u){if(m._zod.def.when){if(Ga(s)||!m._zod.def.when(s))continue}else if(d)continue;let f=s.issues.length,g=m._zod.check(s);if(g instanceof Promise&&c?.async===!1)throw new $e;if(p||g instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await g,s.issues.length!==f&&(Jn(s.issues,f,e),d||(d=me(s,f)))});else{if(s.issues.length===f)continue;Jn(s.issues,f,e),d||(d=me(s,f))}}return p?p.then(()=>s):s},a=(s,u,c)=>{if(me(s))return s.aborted=!0,s;let d=r(u,t,c);if(d instanceof Promise){if(c.async===!1)throw new $e;return d.then(p=>e._zod.parse(p,c))}return e._zod.parse(d,c)};e._zod.run=(s,u)=>{if(u.skipChecks)return e._zod.parse(s,u);if(u.direction==="backward"){let d=e._zod.parse({value:s.value,issues:[]},{...u,skipChecks:!0});return d instanceof Promise?d.then(p=>a(p,s,u)):a(d,s,u)}let c=e._zod.parse(s,u);if(c instanceof Promise){if(u.async===!1)throw new $e;return c.then(d=>r(d,t,u))}return r(c,t,u)}}},{get"~standard"(){return Yn(this,"~standard",Ti(this))},set"~standard"(e){it(this,"~standard",e)}}),Em=(e,n)=>e.issues.length?{issues:e.issues.map(i=>_e(i,n,te()))}:{value:e.value};async function M_(e,n){let i={async:!0};return Em(await e._zod.run({value:n,issues:[]},i),i)}function Ti(e){return{validate:n=>{let i={async:!1};try{let o=e._zod.run({value:n,issues:[]},i);if(!(o instanceof Promise))return Em(o,i)}catch{}return M_(e,n)},vendor:"zod",version:1}}var St=h("$ZodString",(e,n)=>{U.init(e,n),e._zod.pattern=n.pattern??Ps,e._zod.parse=(i,o)=>{if(n.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),K=h("$ZodStringFormat",(e,n)=>{nn.init(e,n),St.init(e,n)}),ou=h("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=ls),K.init(e,n)}),au=h("$ZodUUID",(e,n)=>{if(n.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(o===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=wt(o))}else n.pattern??(n.pattern=wt());K.init(e,n)}),su=h("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=ds),K.init(e,n)}),uu=1,sr=2;function cu(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Ei(e,n){return!("normalize"in n)&&!("hostname"in n)&&!("protocol"in n)?cu(e)||sr:Am(e,n)}function Am(e,n){if(!n.normalize&&n.protocol?.source===rr.source&&!/^https?:\/\//i.test(e))return uu;try{if(typeof URL<"u"){let i=URL;if(typeof i.parse=="function")return i.parse(e)??sr}return new URL(e)}catch{return sr}}var Z_=/[\t\n\r]/g;function ur(e){return e.replace(Z_,"")}function Ai(e,n){return n.lastIndex=0,n.test(e.hostname)}function Oi(e,n){return n.lastIndex=0,n.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var lu=h("$ZodURL",(e,n)=>{K.init(e,n),e._zod.check=i=>{try{let o=i.value.trim(),t=Ei(o,n);if(t===uu){i.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:i.value,inst:e,continue:!n.abort});return}if(t===sr){i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!n.abort});return}if(t===!0){i.value=ur(o);return}n.hostname&&!Ai(t,n.hostname)&&i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:i.value,inst:e,continue:!n.abort}),n.protocol&&!Oi(t,n.protocol)&&i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:i.value,inst:e,continue:!n.abort}),i.value=n.normalize?t.href:ur(o);return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!n.abort})}}}),du=h("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=ps()),K.init(e,n)}),pu=h("$ZodNanoID",(e,n)=>{if(n.length!==void 0&&(!Number.isInteger(n.length)||n.length<1))throw new Error(`Invalid nanoid length: ${n.length}`);n.pattern??(n.pattern=n.length===void 0?ss:us(n.length)),K.init(e,n)}),mu=h("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=ns),K.init(e,n)}),fu=h("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=rs),K.init(e,n)}),gu=h("$ZodULID",(e,n)=>{n.pattern??(n.pattern=is),K.init(e,n)}),hu=h("$ZodXID",(e,n)=>{n.pattern??(n.pattern=os),K.init(e,n)}),vu=h("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=as),K.init(e,n)}),yu=h("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=Ss(n)),K.init(e,n)}),bu=h("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=ws),K.init(e,n)}),_u=h("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=Is(n)),K.init(e,n)}),$u=h("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=cs),K.init(e,n)}),ku=h("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=ms),K.init(e,n)}),F_=/^[0-9a-fA-F:.]+$/;function cr(e){return F_.test(e)?cu(`http://[${e}]`):!1}var xu=h("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=fs),K.init(e,n),e._zod.check=i=>{cr(i.value)||i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!n.abort})}}),wu=h("$ZodMAC",(e,n)=>{n.pattern??(n.pattern=gs(n.delimiter)),K.init(e,n)}),Iu=h("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=hs),K.init(e,n)});function Ni(e){let n=e.split("/");if(n.length!==2)return!1;let[i,o]=n;if(!o)return!1;let t=Number(o);return`${t}`!==o||t<0||t>128?!1:cr(i)}var Su=h("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=vs),K.init(e,n),e._zod.check=i=>{Ni(i.value)||i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!n.abort})}});function lr(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var zi=/^[0-9a-zA-Z+/]*={0,2}$/,Pu=h("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=zi),K.init(e,n),e._zod.check=i=>{lr(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!n.abort})}}),dr=/^[A-Za-z0-9_-]*$/;function Di(e){if(!dr.test(e))return!1;let n=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),i=n.padEnd(Math.ceil(n.length/4)*4,"=");return lr(i)}var Tu=h("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=dr),K.init(e,n),e._zod.check=i=>{Di(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!n.abort})}}),Eu=h("$ZodE164",(e,n)=>{n.pattern??(n.pattern=ks),K.init(e,n)}),V_=/[- ]/g;function G_(e){let n=e.length,i=1,o=0;for(;n;){let t=e.charCodeAt(--n)-48;i^=1,o+=i?[0,2,4,6,8,1,3,5,7,9][t]:t}return o%10===0}function Ci(e){return yi.test(e)?G_(e.replace(V_,"")):!1}var Au=h("$ZodCreditCard",(e,n)=>{n.pattern??(n.pattern=yi),K.init(e,n),e._zod.check=i=>{Ci(i.value)||i.issues.push({code:"invalid_format",format:"credit_card",input:i.value,inst:e,continue:!n.abort})}});function B_(e){let n=0,i=e.length;for(let o=4;o=65?n*100+(t-55):n*10+(t-48))%97}for(let o=0;o<4;o++){let t=e.charCodeAt(o);n=(t>=65?n*100+(t-55):n*10+(t-48))%97}return n===1}function Li(e){return bi.test(e)?B_(e):!1}var Ou=h("$ZodIBAN",(e,n)=>{n.pattern??(n.pattern=bi),K.init(e,n),e._zod.check=i=>{Li(i.value)||i.issues.push({code:"invalid_format",format:"iban",input:i.value,inst:e,continue:!n.abort})}});function ji(e,n=null){try{let i=e.split(".");if(i.length!==3)return!1;let[o]=i;if(!o)return!1;let t=JSON.parse(atob(o));return!("typ"in t&&t?.typ!=="JWT"||!t.alg||n&&(!("alg"in t)||t.alg!==n))}catch{return!1}}var Nu=h("$ZodJWT",(e,n)=>{K.init(e,n),e._zod.check=i=>{ji(i.value,n.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!n.abort})}}),zu=h("$ZodCustomStringFormat",(e,n)=>{K.init(e,n),e._zod.check=i=>{n.fn(i.value)||i.issues.push({code:"invalid_format",format:n.format,input:i.value,inst:e,continue:!n.abort})}}),Ui=h("$ZodNumber",(e,n)=>{U.init(e,n),e._zod.pattern=qe,e._zod.parse=(i,o)=>{if(n.coerce)try{i.value=Number(i.value)}catch{}let t=i.value;if(typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t))return i;let r=typeof t=="number"?Number.isNaN(t)?"NaN":Number.isFinite(t)?void 0:String(t):void 0;return i.issues.push({expected:"number",code:"invalid_type",input:t,inst:e,...r?{received:r}:{}}),i}}),Du=h("$ZodNumberFormat",(e,n)=>{Rs.init(e,n),Ui.init(e,n)}),pr=h("$ZodBoolean",(e,n)=>{U.init(e,n),e._zod.pattern=As,e._zod.parse=(i,o)=>{if(n.coerce)try{i.value=!!i.value}catch{}let t=i.value;return typeof t=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:t,inst:e}),i}}),Ri=h("$ZodBigInt",(e,n)=>{U.init(e,n),e._zod.pattern=Es,e._zod.parse=(i,o)=>{if(n.coerce)try{i.value=BigInt(i.value)}catch{}return typeof i.value=="bigint"||i.issues.push({expected:"bigint",code:"invalid_type",input:i.value,inst:e}),i}}),Cu=h("$ZodBigIntFormat",(e,n)=>{Ms.init(e,n),Ri.init(e,n)}),Lu=h("$ZodSymbol",(e,n)=>{U.init(e,n),e._zod.parse=(i,o)=>{let t=i.value;return typeof t=="symbol"||i.issues.push({expected:"symbol",code:"invalid_type",input:t,inst:e}),i}}),ju=h("$ZodUndefined",(e,n)=>{U.init(e,n),e._zod.pattern=Ns,e._zod.values=new Set([void 0]),e._zod.parse=(i,o)=>{let t=i.value;return typeof t>"u"||i.issues.push({expected:"undefined",code:"invalid_type",input:t,inst:e}),i}}),Uu=h("$ZodNull",(e,n)=>{U.init(e,n),e._zod.pattern=Os,e._zod.values=new Set([null]),e._zod.parse=(i,o)=>{let t=i.value;return t===null||i.issues.push({expected:"null",code:"invalid_type",input:t,inst:e}),i}}),Ru=h("$ZodAny",(e,n)=>{U.init(e,n),e._zod.parse=i=>i}),Mu=h("$ZodUnknown",(e,n)=>{U.init(e,n),e._zod.parse=i=>i}),Zu=h("$ZodNever",(e,n)=>{U.init(e,n),e._zod.parse=(i,o)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)}),Fu=h("$ZodVoid",(e,n)=>{U.init(e,n),e._zod.parse=(i,o)=>{let t=i.value;return typeof t>"u"||i.issues.push({expected:"void",code:"invalid_type",input:t,inst:e}),i}}),Vu=h("$ZodDate",(e,n)=>{U.init(e,n),e._zod.parse=(i,o)=>{if(n.coerce)try{i.value=new Date(i.value)}catch{}let t=i.value,r=t instanceof Date;return r&&!Number.isNaN(t.getTime())||i.issues.push({expected:"date",code:"invalid_type",input:t,...r?{received:"Invalid Date"}:{},inst:e}),i}});function Gu(e,n){let i=Xt(e._zod.def.checks);if(!i.length)return;let o=Math.min(...i.map(r=>r[0])),t=e._zod.parse;e._zod.parse=(r,a)=>{let s=n(r.value);if(s>o&&!a?.skipChecks&&a?.direction!=="backward"){for(let[u,c]of Xt(e._zod.def.checks))if(s>u&&c._zod.def.when(r)){let d=r.issues.length;return c._zod.check(r),r.issues[d].continue=!1,Jn(r.issues,d,e),r}}return t(r,a)}}var H_=e=>Array.isArray(e)?e.length:-1,W_=e=>e instanceof Map?e.size:-1,K_=e=>e instanceof Set?e.size:-1;function fm(e,n,i){e.issues.length&&n.issues.push(...be(i,e.issues)),n.value[i]=e.value}var Bu=h("$ZodArray",(e,n)=>{U.init(e,n);let i=ae.memoizer;i?.attach(e),e._zod.parse=(o,t)=>{let r=o.value;if(!Array.isArray(r))return o.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),o;o.value=i?i.alloc(e,o,Array(r.length),t):Array(r.length);let a=[],s=t?.abortEarly;for(let u=0;ufm(p,o,u)));else if(fm(d,o,u),s&&d.issues.length!==0&&me(d))break}return a.length?Promise.all(a).then(()=>o):o},Gu(e,H_)});function Pi(e,n,i,o,t,r){let a=i in o,s=r==="optional";if(!(!a&&s&&t==="optional")){if(e.issues.length){if(t!==void 0&&s&&!a)return;n.issues.push(...be(i,e.issues))}if(!a&&t===void 0){e.issues.length||n.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[i]});return}e.value===void 0?(a||t==="defaulted"&&!s)&&(n.value[i]=void 0):n.value[i]=e.value}}var J_=[];function Om(e){let n=Object.keys(e.shape),i=Object.getOwnPropertySymbols(e.shape),o=i.length?i:J_,t=o.length?[...n,...o]:n;for(let a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(a)}": expected a Zod schema`);let r=Va(e.shape);return{...e,allKeys:t,symbolKeys:o,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function Nm(e,n,i,o,t,r,a){let s=[],u=t.keySet,c=t.catchall._zod,d=c.def.type,p=c.optin,m=c.optout,f=0;for(let g in n){if(a&&i.issues.length!==f){if(me(i,f))break;f=i.issues.length}if(u.has(g))continue;if(g==="__proto__"){d==="never"&&s.push(g);continue}if(d==="never"){s.push(g);continue}let y=c.run({value:n[g],issues:[]},o);y instanceof Promise?e.push(y.then(x=>Pi(x,i,g,n,p,m))):Pi(y,i,g,n,p,m)}return s.length&&i.issues.push({code:"unrecognized_keys",keys:s,input:n,inst:r,continue:!0}),e.length?Promise.all(e).then(()=>i):i}var zm=h("$ZodObject",(e,n)=>{U.init(e,n);let i=Object.getOwnPropertyDescriptor(n,"shape"),o=i?.get?i.get.raw:n.shape??{};if(o){let c=()=>{let d={...o};return Object.defineProperty(n,"shape",{value:d}),c.raw=d,d};c.raw=o,Object.defineProperty(n,"shape",{get:c})}let t=Kt(()=>Om(n));Z(e,"propValues",c=>{let d=c.def.shape,p={};for(let m in d){let f=d[m]._zod;if(f.values){Object.prototype.hasOwnProperty.call(p,m)||se(p,m,new Set);for(let g of f.values)p[m].add(g);f.optin!==void 0&&p[m].add(void 0)}}return p});let r=kt,a=n.catchall,s,u=ae.memoizer;u?.attach(e),e._zod.parse=(c,d)=>{s??(s=t.value);let p=c.value;if(!r(p))return c.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),c;c.value=u?u.alloc(e,c,{},d):{};let m=[],f=s.shape,g=d?.abortEarly,y=c.issues.length;for(let x of s.allKeys){if(g&&c.issues.length!==y){if(me(c,y))break;y=c.issues.length}if(x==="__proto__")continue;let I=f[x],b=I._zod.optin,T=I._zod.optout,A=I._zod.run({value:p[x],issues:[]},d);A instanceof Promise?m.push(A.then(D=>Pi(D,c,x,p,b,T))):Pi(A,c,x,p,b,T)}return a?Nm(m,p,c,d,t.value,e,g===!0):m.length?Promise.all(m).then(()=>c):c}}),Hu=h("$ZodObjectJIT",(e,n)=>{zm.init(e,n);let i=e._zod.parse,o=Kt(()=>Om(n)),t=ae.memoizer,r=f=>{let g=o.value,y=g.symbolKeys,x=new It(["payload","ctx"],{shape:f,inst:e,memo:t,syms:y}),I=D=>`shape[${D}]._zod.run({ value: input[${D}], issues: [] }, ctx)`,b=(D,w)=>` +};`)(...Object.values(this.closed))}};var yu={major:4,minor:6,patch:7};var R=h("$ZodType",(e,n)=>{var o;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=yu;let i=e._zod.def.checks,t=e._zod.traits.has("$ZodCheck")?[e,...i??[]]:i?.length?[...i]:[];for(let r of t)for(let a of r._zod.onattach)a(e);if(t.length===0)(o=e._zod).deferred??(o.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(s,c,l)=>{if(s.memo)return s;let d=me(s),p;for(let m of c){if(m._zod.def.when){if(is(s)||!m._zod.def.when(s))continue}else if(d)continue;let f=s.issues.length,g=m._zod.check(s);if(g instanceof Promise&&l?.async===!1)throw new ke;if(p||g instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await g,s.issues.length!==f&&(ir(s.issues,f,e),d||(d=me(s,f)))});else{if(s.issues.length===f)continue;ir(s.issues,f,e),d||(d=me(s,f))}}return p?p.then(()=>s):s},a=(s,c,l)=>{if(me(s))return s.aborted=!0,s;let d=r(c,t,l);if(d instanceof Promise){if(l.async===!1)throw new ke;return d.then(p=>e._zod.parse(p,l))}return e._zod.parse(d,l)};e._zod.run=(s,c)=>{if(c.skipChecks)return e._zod.parse(s,c);if(c.direction==="backward"){let d=e._zod.parse({value:s.value,issues:[]},{...c,skipChecks:!0});return d instanceof Promise?d.then(p=>a(p,s,c)):a(d,s,c)}let l=e._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new ke;return l.then(d=>r(d,t,c))}return r(l,t,c)}}},{get"~standard"(){return ur(this,"~standard",Fo(this))},set"~standard"(e){at(this,"~standard",e)}}),Bm=(e,n)=>e.issues.length?{issues:e.issues.map(o=>$e(o,n,ne()))}:{value:e.value};async function A$(e,n){let o={async:!0};return Bm(await e._zod.run({value:n,issues:[]},o),o)}function Fo(e){return{validate:n=>{let o={async:!1};try{let i=e._zod.run({value:n,issues:[]},o);if(!(i instanceof Promise))return Bm(i,o)}catch{}return A$(e,n)},vendor:"zod",version:1}}var Ot=h("$ZodString",(e,n)=>{R.init(e,n),e._zod.pattern=n.pattern??Zs,e._zod.parse=(o,i)=>{if(n.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),J=h("$ZodStringFormat",(e,n)=>{cn.init(e,n),Ot.init(e,n)}),_u=h("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=ws),J.init(e,n)}),$u=h("$ZodUUID",(e,n)=>{if(n.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(i===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=Et(i))}else n.pattern??(n.pattern=Et());J.init(e,n)}),ku=h("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=Ss),J.init(e,n)}),xu=1,vr=2;function Iu(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Zo(e,n){return!("normalize"in n)&&!("hostname"in n)&&!("protocol"in n)?Iu(e)||vr:Wm(e,n)}function Wm(e,n){if(!n.normalize&&n.protocol?.source===mr.source&&!/^https?:\/\//i.test(e))return xu;try{if(typeof URL<"u"){let o=URL;if(typeof o.parse=="function")return o.parse(e)??vr}return new URL(e)}catch{return vr}}var O$=/[\t\n\r]/g;function yr(e){return e.replace(O$,"")}function Go(e,n){return n.lastIndex=0,n.test(e.hostname)}function Vo(e,n){return n.lastIndex=0,n.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var wu=h("$ZodURL",(e,n)=>{J.init(e,n),e._zod.check=o=>{try{let i=o.value.trim(),t=Zo(i,n);if(t===xu){o.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:o.value,inst:e,continue:!n.abort});return}if(t===vr){o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!n.abort});return}if(t===!0){o.value=yr(i);return}n.hostname&&!Go(t,n.hostname)&&o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:o.value,inst:e,continue:!n.abort}),n.protocol&&!Vo(t,n.protocol)&&o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:o.value,inst:e,continue:!n.abort}),o.value=n.normalize?t.href:yr(i);return}catch{o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!n.abort})}}}),Su=h("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=Ps()),J.init(e,n)}),Pu=h("$ZodNanoID",(e,n)=>{if(n.length!==void 0&&(!Number.isInteger(n.length)||n.length<1))throw new Error(`Invalid nanoid length: ${n.length}`);n.pattern??(n.pattern=n.length===void 0?ks:xs(n.length)),J.init(e,n)}),Tu=h("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=vs),J.init(e,n)}),Eu=h("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=ys),J.init(e,n)}),Au=h("$ZodULID",(e,n)=>{n.pattern??(n.pattern=bs),J.init(e,n)}),Ou=h("$ZodXID",(e,n)=>{n.pattern??(n.pattern=_s),J.init(e,n)}),Nu=h("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=$s),J.init(e,n)}),zu=h("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=Fs(n)),J.init(e,n)}),Cu=h("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=Rs),J.init(e,n)}),Du=h("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=Ms(n)),J.init(e,n)}),Lu=h("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=Is),J.init(e,n)}),Uu=h("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=Ts),J.init(e,n)}),N$=/^[0-9a-fA-F:.]+$/;function br(e){return N$.test(e)?Iu(`http://[${e}]`):!1}var ju=h("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=Es),J.init(e,n),e._zod.check=o=>{br(o.value)||o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!n.abort})}}),Ru=h("$ZodMAC",(e,n)=>{n.pattern??(n.pattern=As(n.delimiter)),J.init(e,n)}),Mu=h("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=Os),J.init(e,n)});function Ho(e){let n=e.split("/");if(n.length!==2)return!1;let[o,i]=n;if(!i)return!1;let t=Number(i);return`${t}`!==i||t<0||t>128?!1:br(o)}var Fu=h("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=Ns),J.init(e,n),e._zod.check=o=>{Ho(o.value)||o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!n.abort})}});function _r(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Bo=/^[0-9a-zA-Z+/]*={0,2}$/,Zu=h("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=Bo),J.init(e,n),e._zod.check=o=>{_r(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!n.abort})}}),$r=/^[A-Za-z0-9_-]*$/;function Wo(e){if(!$r.test(e))return!1;let n=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),o=n.padEnd(Math.ceil(n.length/4)*4,"=");return _r(o)}var Gu=h("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=$r),J.init(e,n),e._zod.check=o=>{Wo(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!n.abort})}}),Vu=h("$ZodE164",(e,n)=>{n.pattern??(n.pattern=Us),J.init(e,n)}),z$=/[- ]/g;function C$(e){let n=e.length,o=1,i=0;for(;n;){let t=e.charCodeAt(--n)-48;o^=1,i+=o?[0,2,4,6,8,1,3,5,7,9][t]:t}return i%10===0}function Ko(e){return Oo.test(e)?C$(e.replace(z$,"")):!1}var Hu=h("$ZodCreditCard",(e,n)=>{n.pattern??(n.pattern=Oo),J.init(e,n),e._zod.check=o=>{Ko(o.value)||o.issues.push({code:"invalid_format",format:"credit_card",input:o.value,inst:e,continue:!n.abort})}});function D$(e){let n=0,o=e.length;for(let i=4;i=65?n*100+(t-55):n*10+(t-48))%97}for(let i=0;i<4;i++){let t=e.charCodeAt(i);n=(t>=65?n*100+(t-55):n*10+(t-48))%97}return n===1}function Jo(e){return No.test(e)?D$(e):!1}var Bu=h("$ZodIBAN",(e,n)=>{n.pattern??(n.pattern=No),J.init(e,n),e._zod.check=o=>{Jo(o.value)||o.issues.push({code:"invalid_format",format:"iban",input:o.value,inst:e,continue:!n.abort})}});function Xo(e,n=null){try{let o=e.split(".");if(o.length!==3)return!1;let[i]=o;if(!i)return!1;let t=JSON.parse(atob(i));return!("typ"in t&&t?.typ!=="JWT"||!t.alg||n&&(!("alg"in t)||t.alg!==n))}catch{return!1}}var Wu=h("$ZodJWT",(e,n)=>{J.init(e,n),e._zod.check=o=>{Xo(o.value,n.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!n.abort})}}),Ku=h("$ZodCustomStringFormat",(e,n)=>{J.init(e,n),e._zod.check=o=>{n.fn(o.value)||o.issues.push({code:"invalid_format",format:n.format,input:o.value,inst:e,continue:!n.abort})}}),qo=h("$ZodNumber",(e,n)=>{R.init(e,n),e._zod.pattern=et,e._zod.parse=(o,i)=>{if(n.coerce)try{o.value=Number(o.value)}catch{}let t=o.value;if(typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t))return o;let r=typeof t=="number"?Number.isNaN(t)?"NaN":Number.isFinite(t)?void 0:String(t):void 0;return o.issues.push({expected:"number",code:"invalid_type",input:t,inst:e,...r?{received:r}:{}}),o}}),Ju=h("$ZodNumberFormat",(e,n)=>{eu.init(e,n),qo.init(e,n)}),kr=h("$ZodBoolean",(e,n)=>{R.init(e,n),e._zod.pattern=Hs,e._zod.parse=(o,i)=>{if(n.coerce)try{o.value=!!o.value}catch{}let t=o.value;return typeof t=="boolean"||o.issues.push({expected:"boolean",code:"invalid_type",input:t,inst:e}),o}}),Yo=h("$ZodBigInt",(e,n)=>{R.init(e,n),e._zod.pattern=Vs,e._zod.parse=(o,i)=>{if(n.coerce)try{o.value=BigInt(o.value)}catch{}return typeof o.value=="bigint"||o.issues.push({expected:"bigint",code:"invalid_type",input:o.value,inst:e}),o}}),Xu=h("$ZodBigIntFormat",(e,n)=>{tu.init(e,n),Yo.init(e,n)}),qu=h("$ZodSymbol",(e,n)=>{R.init(e,n),e._zod.parse=(o,i)=>{let t=o.value;return typeof t=="symbol"||o.issues.push({expected:"symbol",code:"invalid_type",input:t,inst:e}),o}}),Yu=h("$ZodUndefined",(e,n)=>{R.init(e,n),e._zod.pattern=Ws,e._zod.values=new Set([void 0]),e._zod.parse=(o,i)=>{let t=o.value;return typeof t>"u"||o.issues.push({expected:"undefined",code:"invalid_type",input:t,inst:e}),o}}),Qu=h("$ZodNull",(e,n)=>{R.init(e,n),e._zod.pattern=Bs,e._zod.values=new Set([null]),e._zod.parse=(o,i)=>{let t=o.value;return t===null||o.issues.push({expected:"null",code:"invalid_type",input:t,inst:e}),o}}),ec=h("$ZodAny",(e,n)=>{R.init(e,n),e._zod.parse=o=>o}),tc=h("$ZodUnknown",(e,n)=>{R.init(e,n),e._zod.parse=o=>o}),nc=h("$ZodNever",(e,n)=>{R.init(e,n),e._zod.parse=(o,i)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)}),rc=h("$ZodVoid",(e,n)=>{R.init(e,n),e._zod.parse=(o,i)=>{let t=o.value;return typeof t>"u"||o.issues.push({expected:"void",code:"invalid_type",input:t,inst:e}),o}}),oc=h("$ZodDate",(e,n)=>{R.init(e,n),e._zod.parse=(o,i)=>{if(n.coerce)try{o.value=new Date(o.value)}catch{}let t=o.value,r=t instanceof Date;return r&&!Number.isNaN(t.getTime())||o.issues.push({expected:"date",code:"invalid_type",input:t,...r?{received:"Invalid Date"}:{},inst:e}),o}});function ic(e,n){let o=nn(e._zod.def.checks);if(!o.length)return;let i=Math.min(...o.map(r=>r[0])),t=e._zod.parse;e._zod.parse=(r,a)=>{let s=n(r.value);if(s>i&&!a?.skipChecks&&a?.direction!=="backward"){for(let[c,l]of nn(e._zod.def.checks))if(s>c&&l._zod.def.when(r)){let d=r.issues.length;return l._zod.check(r),r.issues[d].continue=!1,ir(r.issues,d,e),r}}return t(r,a)}}var L$=e=>Array.isArray(e)?e.length:-1,U$=e=>e instanceof Map?e.size:-1,j$=e=>e instanceof Set?e.size:-1;function Om(e,n,o){e.issues.length&&n.issues.push(..._e(o,e.issues)),n.value[o]=e.value}var ac=h("$ZodArray",(e,n)=>{R.init(e,n);let o=se.memoizer;o?.attach(e),e._zod.parse=(i,t)=>{let r=i.value;if(!Array.isArray(r))return i.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),i;i.value=o?o.alloc(e,i,Array(r.length),t):Array(r.length);let a=[],s=t?.abortEarly;for(let c=0;cOm(p,i,c)));else if(Om(d,i,c),s&&d.issues.length!==0&&me(d))break}return a.length?Promise.all(a).then(()=>i):i},ic(e,L$)});function Mo(e,n,o,i,t,r){let a=o in i,s=r==="optional";if(!(!a&&s&&t==="optional")){if(e.issues.length){if(t!==void 0&&s&&!a)return;n.issues.push(..._e(o,e.issues))}if(!a&&t===void 0){e.issues.length||n.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[o]});return}e.value===void 0?(a||t==="defaulted"&&!s)&&(n.value[o]=void 0):n.value[o]=e.value}}var R$=[];function Km(e){let n=Object.keys(e.shape),o=Object.getOwnPropertySymbols(e.shape),i=o.length?o:R$,t=i.length?[...n,...i]:n;for(let a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(a)}": expected a Zod schema`);let r=os(e.shape);return{...e,allKeys:t,symbolKeys:i,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function Jm(e,n,o,i,t,r,a){let s=[],c=t.keySet,l=t.catchall._zod,d=l.def.type,p=l.optin,m=l.optout,f=0;for(let g in n){if(a&&o.issues.length!==f){if(me(o,f))break;f=o.issues.length}if(c.has(g))continue;if(g==="__proto__"){d==="never"&&s.push(g);continue}if(d==="never"){s.push(g);continue}let y=l.run({value:n[g],issues:[]},i);y instanceof Promise?e.push(y.then(x=>Mo(x,o,g,n,p,m))):Mo(y,o,g,n,p,m)}return s.length&&o.issues.push({code:"unrecognized_keys",keys:s,input:n,inst:r,continue:!0}),e.length?Promise.all(e).then(()=>o):o}var Xm=h("$ZodObject",(e,n)=>{R.init(e,n);let o=Object.getOwnPropertyDescriptor(n,"shape"),i=o?.get?o.get.raw:n.shape??{};if(i){let l=()=>{let d={...i};return Object.defineProperty(n,"shape",{value:d}),l.raw=d,d};l.raw=i,Object.defineProperty(n,"shape",{get:l})}let t=en(()=>Km(n));Z(e,"propValues",l=>{let d=l.def.shape,p={};for(let m in d){let f=d[m]._zod;if(f.values){Object.prototype.hasOwnProperty.call(p,m)||ue(p,m,new Set);for(let g of f.values)p[m].add(g);f.optin!==void 0&&p[m].add(void 0)}}return p});let r=Pt,a=n.catchall,s,c=se.memoizer;c?.attach(e),e._zod.parse=(l,d)=>{s??(s=t.value);let p=l.value;if(!r(p))return l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l;l.value=c?c.alloc(e,l,{},d):{};let m=[],f=s.shape,g=d?.abortEarly,y=l.issues.length;for(let x of s.allKeys){if(g&&l.issues.length!==y){if(me(l,y))break;y=l.issues.length}if(x==="__proto__")continue;let w=f[x],b=w._zod.optin,P=w._zod.optout,A=w._zod.run({value:p[x],issues:[]},d);A instanceof Promise?m.push(A.then(D=>Mo(D,l,x,p,b,P))):Mo(A,l,x,p,b,P)}return a?Jm(m,p,l,d,t.value,e,g===!0):m.length?Promise.all(m).then(()=>l):l}}),sc=h("$ZodObjectJIT",(e,n)=>{Xm.init(e,n);let o=e._zod.parse,i=en(()=>Km(n)),t=se.memoizer,r=f=>{let g=i.value,y=g.symbolKeys,x=new At(["payload","ctx"],{shape:f,inst:e,memo:t,syms:y}),w=D=>`shape[${D}]._zod.run({ value: input[${D}], issues: [] }, ctx)`,b=(D,I)=>` let ${D}_ab = false; for (let i = 0; i < ${D}.issues.length; i++) { const iss = ${D}.issues[i]; - iss.path = iss.path ? [${w}, ...iss.path] : [${w}]; + iss.path = iss.path ? [${I}, ...iss.path] : [${I}]; payload.issues.push(iss); if (iss.continue !== true) ${D}_ab = true; } if (${D}_ab && ctx && ctx.abortEarly) { payload.value = newResult; return payload; - }`;x.write("const input = payload.value;");let T=Object.create(null),A=0;for(let D of g.allKeys)T[D]=`key_${A++}`;x.write(t?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let D of g.allKeys){if(D==="__proto__")continue;let w=T[D],O=typeof D=="symbol"?`syms[${y.indexOf(D)}]`:pe(D),E=`${O} in input`,B=f[D],C=B?._zod?.optin,re=C!==void 0,ye=B?._zod?.optout==="optional";if(x.write(`const ${w} = ${I(O)};`),re&&ye){let Oe=C==="optional"?`${w}_present`:`${w}.value !== undefined || ${w}_present`;x.write(` - const ${w}_present = ${E}; - if (!${w}.issues.length || ${w}_present) { - if (${w}.issues.length) {${b(w,O)} + }`;x.write("const input = payload.value;");let P=Object.create(null),A=0;for(let D of g.allKeys)P[D]=`key_${A++}`;x.write(t?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let D of g.allKeys){if(D==="__proto__")continue;let I=P[D],O=typeof D=="symbol"?`syms[${y.indexOf(D)}]`:pe(D),E=`${O} in input`,H=f[D],L=H?._zod?.optin,oe=L!==void 0,be=H?._zod?.optout==="optional";if(x.write(`const ${I} = ${w(O)};`),oe&&be){let ze=L==="optional"?`${I}_present`:`${I}.value !== undefined || ${I}_present`;x.write(` + const ${I}_present = ${E}; + if (!${I}.issues.length || ${I}_present) { + if (${I}.issues.length) {${b(I,O)} } - if (${Oe}) { - newResult[${O}] = ${w}.value; + if (${ze}) { + newResult[${O}] = ${I}.value; } } - `)}else re?(x.write(` - if (${w}.issues.length) {${b(w,O)} + `)}else oe?(x.write(` + if (${I}.issues.length) {${b(I,O)} } - `),C==="defaulted"?x.write(`newResult[${O}] = ${w}.value;`):x.write(` - if (${w}.value !== undefined || ${E}) { - newResult[${O}] = ${w}.value; + `),L==="defaulted"?x.write(`newResult[${O}] = ${I}.value;`):x.write(` + if (${I}.value !== undefined || ${E}) { + newResult[${O}] = ${I}.value; } `)):x.write(` - const ${w}_present = ${E}; - if (${w}.issues.length) {${b(w,O)} + const ${I}_present = ${E}; + if (${I}.issues.length) {${b(I,O)} } - if (!${w}_present && !${w}.issues.length) { + if (!${I}_present && !${I}.issues.length) { payload.issues.push({ code: "invalid_type", expected: "nonoptional", @@ -51,18 +51,18 @@ ${i.join(` } } - if (${w}_present) { - newResult[${O}] = ${w}.value; + if (${I}_present) { + newResult[${O}] = ${I}.value; } - `)}return x.write("payload.value = newResult;"),x.write("return payload;"),x.compile()},a,s=kt,u=!ae.jitless,d=u&&Za.value,p=n.catchall,m;e._zod.parse=(f,g)=>{m??(m=o.value);let y=f.value;return s(y)?u&&d&&g?.async===!1&&g.jitless!==!0?(a||(a=r(n.shape)),f=a(f,g),p?Nm([],y,f,g,m,e,g?.abortEarly===!0):f):i(f,g):(f.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),f)}});function gm(e,n,i,o){for(let r of e)if(r.issues.length===0)return n.value=r.value,n;let t=e.filter(r=>!me(r));return t.length===1?(n.value=t[0].value,t[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:i,errors:e.map(r=>r.issues.map(a=>_e(a,o,te())))}),n)}var mr=h("$ZodUnion",(e,n)=>{U.init(e,n),Z(e,"optin",o=>o.def.options.some(t=>t._zod.optin==="defaulted")?"defaulted":o.def.options.some(t=>t._zod.optin!==void 0)?"optional":void 0),Z(e,"optout",o=>o.def.options.some(t=>t._zod.optout==="optional")?"optional":void 0),Z(e,"values",o=>{if(o.def.options.every(t=>t._zod.values))return new Set(o.def.options.flatMap(t=>Array.from(t._zod.values)))}),Z(e,"pattern",o=>{if(o.def.options.every(t=>t._zod.pattern)){let t=o.def.options.map(r=>r._zod.pattern);return new RegExp(`^(${t.map(r=>Xe(r.source)).join("|")})$`)}});let i=n.options.length===1?n.options[0]._zod.run:null;e._zod.parse=(o,t)=>{if(i)return i(o,t);let r=!1,a=[];for(let s of n.options){let u=s._zod.run({value:o.value,issues:[]},t);if(u instanceof Promise)a.push(u),r=!0;else{if(u.issues.length===0)return u;a.push(u)}}return r?Promise.all(a).then(s=>gm(s,o,e,t)):gm(a,o,e,t)}});function hm(e,n,i,o){let t=[];for(let r=0;rr.issues.map(a=>_e(a,o,te())))}):n.issues.push({code:"invalid_union",input:n.value,inst:i,errors:[],inclusive:!1,matches:t}),n)}var Wu=h("$ZodXor",(e,n)=>{mr.init(e,n),n.inclusive=!1;let i=n.options.length===1?n.options[0]._zod.run:null;e._zod.parse=(o,t)=>{if(i)return i(o,t);let r=!1,a=[];for(let s of n.options){let u=s._zod.run({value:o.value,issues:[]},t);u instanceof Promise?(a.push(u),r=!0):a.push(u)}return r?Promise.all(a).then(s=>hm(s,o,e,t)):hm(a,o,e,t)}});function Ku(e,n){let i=e._zod,o=i.bag.optionsMap;o||(o=Dm(i.def),i.bag.optionsMap=o);let t=o.get(n);if(t===null)throw new Error(`Ambiguous discriminator value "${String(n)}"`);return t}function Dm(e){let n=new Map;for(let i of e.options){let o=i._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let t of o)if(n.has(t)){if(t!==void 0)throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,null)}else n.set(t,i)}return n}var Ju=h("$ZodDiscriminatedUnion",(e,n)=>{n.inclusive=!1,mr.init(e,n);let i=e._zod.parse;Z(e,"propValues",t=>{let r={},a=0;for(let s of t.def.options){let u=s._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.def.options.indexOf(s)}"`);u[t.def.discriminator]?.has(void 0)&&a++;for(let[c,d]of Object.entries(u)){Object.prototype.hasOwnProperty.call(r,c)||se(r,c,new Set);for(let p of d)r[c].add(p)}}return!t.def.unionFallback&&a>1&&r[t.def.discriminator]?.delete(void 0),r}),n.options.forEach((t,r)=>{let a=Jt(t._zod.def);if(a&&!Object.prototype.hasOwnProperty.call(a,n.discriminator))throw new Error(`Invalid discriminated union option at index "${r}"`)});let o=Kt(()=>Dm(n));e._zod.parse=(t,r)=>{let a=t.value;if(!kt(a))return t.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),t;let s=a?.[n.discriminator],u=o.value.get(s);return u&&(s!==void 0||r.direction!=="backward")?u._zod.run(t,r):n.unionFallback||r.direction==="backward"?i(t,r):(t.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:n.discriminator,options:Array.from(o.value.keys()).filter(c=>o.value.get(c)!==null),input:a,path:[n.discriminator],inst:e}),t)}}),Xu=h("$ZodIntersection",(e,n)=>{U.init(e,n),e._zod.parse=(i,o)=>{let t=i.value,r=n.left._zod.run({value:t,issues:[]},o),a=n.right._zod.run({value:t,issues:[]},o);return r instanceof Promise||a instanceof Promise?Promise.all([r,a]).then(([u,c])=>vm(i,u,c)):vm(i,r,a)}});function rn(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(Se(e)&&Se(n)){let i=Object.keys(n),o=Object.keys(e).filter(r=>i.indexOf(r)!==-1),t={...e,...n};Object.prototype.hasOwnProperty.call(t,"__proto__")&&delete t.__proto__;for(let r of o){if(r==="__proto__")continue;let a=rn(e[r],n[r]);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};t[r]=a.data}return{valid:!0,data:t}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};let i=[];for(let o=0;o{let p;if(c.code==="unrecognized_keys"&&!c.path?.length)t??(t=c),p=c.keys;else if(c.code==="invalid_key"&&c.origin==="record"&&c.path?.length===1){let m=String(c.path[0]);r.has(m)||r.set(m,c),p=[m]}else return!1;for(let m of p)o.has(m)||o.set(m,{}),o.get(m)[d]=!0;return!0};for(let c of n.issues)a(c,"l")||e.issues.push(c);for(let c of i.issues)a(c,"r")||e.issues.push(c);let s=[...o].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length){let c=t?s.filter(d=>t.keys.includes(d)):[];c.length&&e.issues.push({...t,keys:c});for(let d of s)!c.includes(d)&&r.has(d)&&e.issues.push(r.get(d))}let u=rn(n.value,i.value);if(!u.valid){if(me(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}var Mi=h("$ZodTuple",(e,n)=>{U.init(e,n);let i=n.items,o=ae.memoizer;o?.attach(e),e._zod.parse=(t,r)=>{let a=t.value;if(!Array.isArray(a))return t.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),t;t.value=o?o.alloc(e,t,[],r):[];let s=[],u=ym(i,"optin"),c=ym(i,"optout");if(!n.rest){if(a.lengthi.length&&t.issues.push({code:"too_big",maximum:i.length,inclusive:!0,input:a,inst:e,origin:"array"})}let d=new Array(i.length),p=n.rest?r?.abortEarly:void 0,m=!1;for(let f=0;f{d[f]=y})):(d[f]=g,p&&!m&&g.issues.length&&(m=me(g)))}if(n.rest&&!m){let f=i.length-1,g=a.slice(i.length),y=t.issues.length;for(let x of g){if(p&&t.issues.length!==y){if(me(t,y))break;y=t.issues.length}f++;let I=n.rest._zod.run({value:x,issues:[]},r);I instanceof Promise?s.push(I.then(b=>bm(b,t,f))):bm(I,t,f)}}return s.length?Promise.all(s).then(()=>_m(d,t,i,a,c)):_m(d,t,i,a,c)}});function ym(e,n){for(let i=e.length-1;i>=0;i--)if(!(n==="optin"?e[i]._zod.optin!==void 0:e[i]._zod.optout==="optional"))return i+1;return 0}function bm(e,n,i){e.issues.length&&n.issues.push(...be(i,e.issues)),n.value[i]=e.value}function _m(e,n,i,o,t){for(let r=0;r=t&&i[r]._zod.optin==="optional"){n.value.length=r;break}if(a.issues.length){if(!s&&r>=t){n.value.length=r;break}n.issues.push(...be(r,a.issues))}n.value[r]=a.value}for(let r=n.value.length-1;r>=o.length&&(i[r]._zod.optout==="optional"&&n.value[r]===void 0);r--)n.value.length=r;return n}var qu=h("$ZodRecord",(e,n)=>{U.init(e,n);let i=ae.memoizer;i?.attach(e),e._zod.parse=(o,t)=>{let r=o.value;if(!Se(r))return o.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),o;let a=[],s=n.keyType._zod.values;if(s&&!n.partial){o.value=i?i.alloc(e,o,{},t):{};let u=new Set;for(let d of s)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){if(u.add(typeof d=="number"?d.toString():d),d==="__proto__")continue;let p=n.keyType._zod.run({value:d,issues:[]},t);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(g=>_e(g,t,te())),input:d,path:[d],inst:e});continue}let m=p.value;if(m==="__proto__")continue;let f=n.valueType._zod.run({value:r[d],issues:[]},t);f instanceof Promise?a.push(f.then(g=>{g.issues.length&&o.issues.push(...be(d,g.issues)),o.value[m]=g.value})):(f.issues.length&&o.issues.push(...be(d,f.issues)),o.value[m]=f.value)}let c;for(let d in r)if(!u.has(d))if(n.mode==="loose"){if(d==="__proto__")continue;o.value[d]=r[d]}else c=c??[],c.push(d);c&&c.length>0&&o.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:c,continue:!0})}else{o.value=i?i.alloc(e,o,{},t):{};let u;for(let c of Reflect.ownKeys(r)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(r,c))continue;let d=n.keyType._zod.run({value:c,issues:[]},t);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&qe.test(c)&&d.issues.length){let g=n.keyType._zod.run({value:Number(c),issues:[]},t);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(d=g)}if(d.issues.length){n.mode==="loose"?o.value[c]=r[c]:s?(u=u??[],u.push(c)):o.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(g=>_e(g,t,te())),input:c,path:[c],inst:e});continue}let m=d.value;if(m==="__proto__")continue;let f=n.valueType._zod.run({value:r[c],issues:[]},t);f instanceof Promise?a.push(f.then(g=>{g.issues.length&&o.issues.push(...be(c,g.issues)),o.value[m]=g.value})):(f.issues.length&&o.issues.push(...be(c,f.issues)),o.value[m]=f.value)}u&&u.length>0&&o.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:u,continue:!0})}return a.length?Promise.all(a).then(()=>o):o}}),Yu=h("$ZodMap",(e,n)=>{U.init(e,n);let i=ae.memoizer;i?.attach(e),e._zod.parse=(o,t)=>{let r=o.value;if(!(r instanceof Map))return o.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),o;let a=[];o.value=i?i.alloc(e,o,new Map,t):new Map;let s=t?.abortEarly,u=o.issues.length;for(let[c,d]of r){if(s&&o.issues.length!==u){if(me(o,u))break;u=o.issues.length}let p=n.keyType._zod.run({value:c,issues:[]},t),m=n.valueType._zod.run({value:d,issues:[]},t);p instanceof Promise||m instanceof Promise?a.push(Promise.all([p,m]).then(([f,g])=>{$m(f,g,o,c,r,e,t)})):$m(p,m,o,c,r,e,t)}return a.length?Promise.all(a).then(()=>o):o},Gu(e,W_)});function $m(e,n,i,o,t,r,a){e.issues.length&&(Hn.has(typeof o)?i.issues.push(...be(o,e.issues)):i.issues.push({code:"invalid_key",origin:"map",input:t,inst:r,issues:e.issues.map(s=>_e(s,a,te()))})),n.issues.length&&(Hn.has(typeof o)?i.issues.push(...be(o,n.issues)):i.issues.push({origin:"map",code:"invalid_element",input:t,inst:r,key:o,issues:n.issues.map(s=>_e(s,a,te()))})),i.value.set(e.value,n.value)}var Qu=h("$ZodSet",(e,n)=>{U.init(e,n);let i=ae.memoizer;i?.attach(e),e._zod.parse=(o,t)=>{let r=o.value;if(!(r instanceof Set))return o.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),o;let a=[];o.value=i?i.alloc(e,o,new Set,t):new Set;let s=t?.abortEarly,u=o.issues.length;for(let c of r){if(s&&o.issues.length!==u){if(me(o,u))break;u=o.issues.length}let d=n.valueType._zod.run({value:c,issues:[]},t);d instanceof Promise?a.push(d.then(p=>km(p,o))):km(d,o)}return a.length?Promise.all(a).then(()=>o):o},Gu(e,K_)});function km(e,n){e.issues.length&&n.issues.push(...e.issues),n.value.add(e.value)}var ec=h("$ZodEnum",(e,n)=>{U.init(e,n);let i=Ht(n.entries),o=new Set(i);e._zod.values=o,Z(e,"pattern",t=>{let r=Ht(t.def.entries).filter(a=>Hn.has(typeof a));return new RegExp(r.length?`^(${r.map(a=>Pe(a.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(t,r)=>{let a=t.value;return o.has(a)||t.issues.push({code:"invalid_value",values:i,input:a,inst:e}),t}}),tc=h("$ZodLiteral",(e,n)=>{U.init(e,n);let i=new Set(n.values);e._zod.values=i,Z(e,"pattern",o=>{let t=o.def.values;return new RegExp(t.length?`^(${t.map(r=>typeof r=="string"?Pe(r):r?Pe(r.toString()):String(r)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,t)=>{let r=o.value;return i.has(r)||o.issues.push({code:"invalid_value",values:n.values,input:r,inst:e}),o}}),nc=h("$ZodFile",(e,n)=>{U.init(e,n),e._zod.parse=(i,o)=>{let t=i.value;return t instanceof File||i.issues.push({expected:"file",code:"invalid_type",input:t,inst:e}),i}}),rc=h("$ZodTransform",(e,n)=>{U.init(e,n),e._zod.optin="optional",ae.memoizer?.guard(e),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new ot(e.constructor.name);let t=n.transform(i.value,i);if(o.async)return(t instanceof Promise?t:Promise.resolve(t)).then(a=>(i.value=a,i));if(t instanceof Promise)throw new $e;return i.value=t,i}});function xm(e,n){return e.value=n.issues.length?void 0:n.value,e}var Zi=h("$ZodOptional",(e,n)=>{U.init(e,n),Z(e,"optin",i=>i.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Z(e,"values",i=>{let o=i.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),Z(e,"pattern",i=>{let o=i.def.innerType._zod.pattern;return o?new RegExp(`^(${Xe(o.source)})?$`):void 0}),e._zod.parse=(i,o)=>{if(i.value===void 0){if(n.innerType._zod.optin!=="defaulted")return i;let t=n.innerType._zod.run({value:i.value,issues:[]},o);return t instanceof Promise?t.then(r=>xm(i,r)):xm(i,t)}return n.innerType._zod.run(i,o)}}),ic=h("$ZodExactOptional",(e,n)=>{Zi.init(e,n),Z(e,"values",i=>i.def.innerType._zod.values),Z(e,"pattern",i=>i.def.innerType._zod.pattern),e._zod.parse=(i,o)=>n.innerType._zod.run(i,o)}),oc=h("$ZodNullable",(e,n)=>{U.init(e,n),Z(e,"optin",i=>i.def.innerType._zod.optin),Z(e,"optout",i=>i.def.innerType._zod.optout),Z(e,"pattern",i=>{let o=i.def.innerType._zod.pattern;return o?new RegExp(`^(${Xe(o.source)}|null)$`):void 0}),Z(e,"values",i=>i.def.innerType._zod.values?new Set([...i.def.innerType._zod.values,null]):void 0),e._zod.parse=(i,o)=>i.value===null?i:n.innerType._zod.run(i,o)}),ac=h("$ZodDefault",(e,n)=>{U.init(e,n),e._zod.optin="defaulted",Z(e,"values",i=>i.def.innerType._zod.values),e._zod.parse=(i,o)=>{if(o.direction==="backward")return n.innerType._zod.run(i,o);if(i.value===void 0)return i.value=n.defaultValue,i;let t=n.innerType._zod.run(i,o);return t instanceof Promise?t.then(r=>wm(r,n)):wm(t,n)}});function wm(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}var sc=h("$ZodPrefault",(e,n)=>{U.init(e,n),e._zod.optin="defaulted",Z(e,"values",i=>i.def.innerType._zod.values),e._zod.parse=(i,o)=>(o.direction==="backward"||i.value===void 0&&(i.value=n.defaultValue),n.innerType._zod.run(i,o))}),uc=h("$ZodNonOptional",(e,n)=>{U.init(e,n),Z(e,"values",i=>{let o=i.def.innerType._zod.values;return o?new Set([...o].filter(t=>t!==void 0)):void 0}),e._zod.parse=(i,o)=>{let t=n.innerType._zod.run(i,o);return t instanceof Promise?t.then(r=>Im(r,e)):Im(t,e)}});function Im(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}var cc=h("$ZodSuccess",(e,n)=>{U.init(e,n),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new ot("ZodSuccess");let t=n.innerType._zod.run(i,o);return t instanceof Promise?t.then(r=>(i.value=r.issues.length===0,i)):(i.value=t.issues.length===0,i)}});function Sm(e,n,i,o){return n.issues.length?(e.value=i.catchValue({...n,value:e.value,error:{issues:n.issues.map(t=>_e(t,o,te()))},input:e.value}),e):(e.value=n.value,n.memo&&(e.memo=!0),e)}var lc=h("$ZodCatch",(e,n)=>{U.init(e,n),Z(e,"optin",i=>i.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Z(e,"optout",i=>i.def.innerType._zod.optout),Z(e,"values",i=>i.def.innerType._zod.values),e._zod.parse=(i,o)=>{if(o.direction==="backward")return n.innerType._zod.run(i,o);let t=n.innerType._zod.run({value:i.value,issues:[]},o);return t instanceof Promise?t.then(r=>Sm(i,r,n,o)):Sm(i,t,n,o)}}),dc=h("$ZodNaN",(e,n)=>{U.init(e,n),e._zod.parse=(i,o)=>((typeof i.value!="number"||!Number.isNaN(i.value))&&i.issues.push({input:i.value,inst:e,expected:"nan",code:"invalid_type"}),i)}),Fi=h("$ZodPipe",(e,n)=>{U.init(e,n),Z(e,"values",i=>i.def.in._zod.values),Z(e,"optin",i=>i.def.in._zod.optin),Z(e,"optout",i=>i.def.out._zod.optout),Z(e,"propValues",i=>i.def.in._zod.propValues),e._zod.parse=(i,o)=>{if(o.direction==="backward"){let r=n.out._zod.run(i,o);return r instanceof Promise?r.then(a=>wi(a,n.in,o)):wi(r,n.in,o)}let t=n.in._zod.run(i,o);return t instanceof Promise?t.then(r=>wi(r,n.out,o)):wi(t,n.out,o)}});function wi(e,n,i){return e.issues.some(o=>o.code!=="unrecognized_keys")?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},i)}var fr=h("$ZodCodec",(e,n)=>{U.init(e,n),Z(e,"values",i=>i.def.in._zod.values),Z(e,"optin",i=>i.def.in._zod.optin),Z(e,"optout",i=>i.def.out._zod.optout),Z(e,"propValues",i=>i.def.in._zod.propValues),e._zod.parse=(i,o)=>{if((o.direction||"forward")==="forward"){let r=n.in._zod.run(i,o);return r instanceof Promise?r.then(a=>Ii(a,n,o)):Ii(r,n,o)}else{let r=n.out._zod.run(i,o);return r instanceof Promise?r.then(a=>Ii(a,n,o)):Ii(r,n,o)}}});function Ii(e,n,i){if(e.issues.length)return e.aborted=!0,e;if((i.direction||"forward")==="forward"){let t=n.transform(e.value,e);return t instanceof Promise?t.then(r=>Si(e,r,n.out,i)):Si(e,t,n.out,i)}else{let t=n.reverseTransform(e.value,e);return t instanceof Promise?t.then(r=>Si(e,r,n.in,i)):Si(e,t,n.in,i)}}function Si(e,n,i,o){return e.issues.length?(e.aborted=!0,e):i._zod.run({value:n,issues:e.issues},o)}var pc=h("$ZodPreprocess",(e,n)=>{Fi.init(e,n)}),mc=h("$ZodReadonly",(e,n)=>{U.init(e,n),Z(e,"propValues",i=>i.def.innerType._zod.propValues),Z(e,"values",i=>i.def.innerType._zod.values),Z(e,"optin",i=>i.def.innerType?._zod?.optin),Z(e,"optout",i=>i.def.innerType?._zod?.optout),e._zod.parse=(i,o)=>{if(o.direction==="backward")return n.innerType._zod.run(i,o);let t=n.innerType._zod.run(i,o);return t instanceof Promise?t.then(Pm):Pm(t)}});function Pm(e){return e.memo||(e.value=Object.freeze(e.value)),e}function X_(e){let n=e._zod.def,i=n.pattern,o=!!n.format?.includes("int"),t,r;for(let s of n.checks??[]){let u=s._zod.def;u.pattern&&(i=u.pattern),o||(o=!!u.format?.includes("int"));let c=u.minimum??u.length,d=u.maximum??u.length;c!==void 0&&(t===void 0||c>t)&&(t=c),d!==void 0&&(r===void 0||dr)return"(?!)";if(t!==void 0||r!==void 0)return Ts({minimum:t,maximum:r}).source;let a=e._zod.pattern;return(o&&a===qe?ir:a)?.source}function iu(e){let n=e._zod.def,i=e._zod.pattern?.source,o=n.innerType??e._zod.innerType;if(o){let t=o._zod.pattern?.source,r=iu(o);return i&&t&&r&&r!==t?i.replace(Xe(t),()=>Xe(r)):i}if(n.options){let t=n.options.map(iu);if(t.every(Boolean))return`^(${t.map(r=>Xe(r)).join("|")})$`}return X_(e)}var fc=h("$ZodTemplateLiteral",(e,n)=>{U.init(e,n);let i=[];for(let o of n.parts)if(typeof o=="object"&&o!==null){let t=iu(o);if(!t)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);i.push(Xe(t))}else if(o===null||Fa.has(typeof o))i.push(Pe(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${i.join("")}$`),e._zod.parse=(o,t)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:n.format??"template_literal",pattern:e._zod.pattern.source}),o)}),gc=h("$ZodFunction",(e,n)=>(U.init(e,n),Object.defineProperty(e,"_def",{value:n}),e._zod.def=n,e.implement=i=>{if(typeof i!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...o){let t=e._def.input?ui(e._def.input,o):o,r=Reflect.apply(i,this,t);return e._def.output?ui(e._def.output,r):r},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=i=>{if(typeof i!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...o){let t=e._def.input?await ci(e._def.input,o):o,r=await Reflect.apply(i,this,t);return e._def.output?await ci(e._def.output,r):r},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(i,o)=>typeof i.value!="function"?(i.issues.push({code:"invalid_type",expected:"function",input:i.value,inst:e}),i):(e._def.output&&e._def.output._zod.def.type==="promise"?i.value=e.implementAsync(i.value):i.value=e.implement(i.value),i),e.input=(...i)=>{let o=e.constructor;return Array.isArray(i[0])?new o({type:"function",input:new Mi({type:"tuple",items:i[0],rest:i[1]}),output:e._def.output}):new o({type:"function",input:i[0],output:e._def.output})},e.output=i=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:i})},e)),hc=h("$ZodPromise",(e,n)=>{U.init(e,n),e._zod.parse=(i,o)=>Promise.resolve(i.value).then(t=>n.innerType._zod.run({value:t,issues:[]},o))}),gr=h("$ZodLazy",(e,n)=>{U.init(e,n),Ra(e._zod,"innerType",()=>{let i=n;return i._cachedInner||(i._cachedInner=n.getter()),i._cachedInner}),Z(e,"pattern",i=>i.innerType?._zod?.pattern),Z(e,"propValues",i=>i.innerType?._zod?.propValues),Z(e,"optin",i=>i.innerType?._zod?.optin??void 0),Z(e,"optout",i=>i.innerType?._zod?.optout??void 0),e._zod.parse=(i,o)=>e._zod.innerType._zod.run(i,o)}),vc=h("$ZodCustom",(e,n)=>{q.init(e,n),U.init(e,n),e._zod.parse=(i,o)=>i,e._zod.check=i=>{let o=i.value,t=n.fn(o);if(t instanceof Promise)return t.then(r=>Tm(r,i,o,e));Tm(t,i,o,e)}});function Tm(e,n,i,o){if(!e){let t={code:"custom",input:i,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(t.params=o._zod.def.params),n.issues.push(qt(t))}}var Hi=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},bc="~memo",Lm=[];function jm(e){return e!==null&&typeof e=="object"}function yc(e){return e.map(n=>n.path?{...n,path:n.path.slice()}:{...n})}var Um=new WeakMap,on=0,Bi=1,hr=2;function vr(e,n,i){let o=Um.get(e);if(o!==void 0)return o?hr:on;if(n.has(e))return hr;n.add(e);let t=on,r=d=>{if(t!==hr&&d?._zod){let p=vr(d,n,i);p>t&&(t=p)}},a=(d,p)=>{let m=on;for(let f of Reflect.ownKeys(d)){let g=Object.getOwnPropertyDescriptor(d,f);if(p&&!g.enumerable)continue;let y=g.get?Bi:g.value?._zod?vr(g.value,n,i):on;y>m&&(m=y)}return m},s=d=>{d>t&&(t=d)},u=e._zod.def,c=u.type;switch(c){case"object":{let d=Jt(u);s(d?a(d,!0):Bi),r(u.catchall);break}case"array":r(u.element);break;case"tuple":for(let d of u.items)r(d);r(u.rest);break;case"record":case"map":r(u.keyType),r(u.valueType);break;case"set":r(u.valueType);break;case"union":for(let d of u.options)r(d);break;case"intersection":r(u.left),r(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":r(u.innerType);break;case"pipe":r(u.in),r(u.out);break;case"function":r(u.input),r(u.output);break;case"lazy":{let d=u._cachedInner??(i?e._zod.innerType:void 0);s(d?vr(d,n,!1):Bi);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let d in u){let p=Object.getOwnPropertyDescriptor(u,d);if(!p||p.get)continue;let m=p.value;if(!(!m||typeof m!="object")){if(m._zod)r(m);else if(Array.isArray(m))for(let f of m)r(f)}}}return n.delete(e),q_(e,t)}function q_(e,n){return n!==Bi&&Um.set(e,n===hr),n}function Wi(e){return vr(e,new Set,!0)!==on}function Y_(e,n){let i=e.buckets.get(n);return i||(i=new WeakMap,e.buckets.set(n,i)),i}var Vi,Gi=[],Q_={alloc(e,n,i){let o=Vi;if(!o)return i;Vi=void 0;let t={value:i,issues:null};return o.set(n.value,t),Gi.push(t),i},guard(e){var n;(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred.push(()=>{let i=e._zod.parse,o=(t,r)=>{if(r.direction!=="backward"&&Ki(r,t.value))throw new Hi;return i(t,r)};e._zod.parse=o,e._zod.run===i&&(e._zod.run=o)})},attach(e){var n;let i,o=!1,t,r;(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred.push(()=>{let a=e._zod.parse,s=(u,c)=>{if(i===void 0){let I=vr(e,new Set,!1);if(I===on)return e._zod.parse=a,e._zod.run===s&&(e._zod.run=a),a(u,c);I===hr||o?i=!0:o=!0}let d=u.value;if(!jm(d))return a(u,c);let p=c[bc];p||(p={buckets:new WeakMap,backEdges:void 0},c[bc]=p);let m;t===c?m=r:(m=Y_(p,e),t=c,r=m);let f=m.get(d);if(f)return u.value=f.value,f.issues?f.issues.length&&u.issues.push(...yc(f.issues)):(u.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(f.value)),u;Vi=m;let g=Gi.length,y=a(u,c);Vi=void 0;let x=Gi.length>g?Gi.pop():void 0;return y instanceof Promise?y.then(I=>(x&&(x.issues=I.issues.length?yc(I.issues):Lm),I)):(x&&(x.issues=y.issues.length?yc(y.issues):Lm),y)};e._zod.parse=s,e._zod.run===a&&(e._zod.run=s)})}};function yr(){return Q_}function Ki(e,n){let i=e[bc]?.backEdges;return i!==void 0&&jm(n)&&i.has(n)}var _r={};Ke(_r,{ar:()=>Rm,az:()=>Mm,be:()=>Fm,bg:()=>Vm,bn:()=>Gm,ca:()=>Bm,ckb:()=>Hm,cs:()=>Wm,da:()=>Km,de:()=>Jm,el:()=>Xm,en:()=>Ji,eo:()=>qm,es:()=>Ym,fa:()=>Qm,fi:()=>ef,fr:()=>tf,frCA:()=>nf,gu:()=>rf,he:()=>of,hi:()=>af,hr:()=>sf,hu:()=>uf,hy:()=>lf,id:()=>df,is:()=>pf,it:()=>mf,ja:()=>ff,ka:()=>gf,kh:()=>hf,km:()=>Xi,kn:()=>vf,ko:()=>yf,lt:()=>_f,mk:()=>$f,ms:()=>kf,ne:()=>xf,nl:()=>wf,nn:()=>If,no:()=>Sf,ota:()=>Pf,pl:()=>Ef,ps:()=>Tf,pt:()=>Af,ptBR:()=>Of,ro:()=>Nf,ru:()=>Df,sk:()=>Cf,sl:()=>Lf,sv:()=>jf,ta:()=>Uf,tg:()=>Rf,th:()=>Mf,tk:()=>Zf,tr:()=>Ff,ua:()=>Vf,uk:()=>qi,ur:()=>Gf,uz:()=>Bf,vi:()=>Hf,yo:()=>Jf,zhCN:()=>Wf,zhTW:()=>Kf});var e$=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"},map:{unit:"عنصر",verb:"أن يحوي"}};function n(t){return e[t]??null}let i={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",mac:"عنوان MAC",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",credit_card:"رقم بطاقة الائتمان",currency_code:"رمز العملة",iban:"IBAN",jwt:"JWT",template_literal:"مدخل"},o={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${t.expected}، ولكن تم إدخال ${s}`:`مدخلات غير مقبولة: يفترض إدخال ${r}، ولكن تم إدخال ${s}`}case"invalid_value":return t.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${$(t.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?` أكبر من اللازم: يفترض أن تكون ${t.origin??"القيمة"} ${r} ${t.maximum.toString()} ${a.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${t.origin??"القيمة"} ${r} ${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`أصغر من اللازم: يفترض لـ ${t.origin} أن يكون ${r} ${t.minimum.toString()} ${a.unit}`:`أصغر من اللازم: يفترض لـ ${t.origin} أن يكون ${r} ${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${t.prefix}"`:r.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${r.suffix}"`:r.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${r.includes}"`:r.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${r.pattern}`:`${i[r.format]??t.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${t.divisor}`;case"unrecognized_keys":return`معرف${t.keys.length>1?"ات":""} غريب${t.keys.length>1?"ة":""}: ${v(t.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${t.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${t.origin}`;default:return"مدخل غير مقبول"}}};function Rm(){return{localeError:e$()}}var t$=()=>{let e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"},map:{unit:"element",verb:"olmalıdır"}};function n(t){return e[t]??null}let i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"kredit kartı nömrəsi",currency_code:"valyuta kodu",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Yanlış dəyər: gözlənilən instanceof ${t.expected}, daxil olan ${s}`:`Yanlış dəyər: gözlənilən ${r}, daxil olan ${s}`}case"invalid_value":return t.values.length===1?`Yanlış dəyər: gözlənilən ${$(t.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Çox böyük: gözlənilən ${t.origin??"dəyər"} ${r}${t.maximum.toString()} ${a.unit??"element"}`:`Çox böyük: gözlənilən ${t.origin??"dəyər"} ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Çox kiçik: gözlənilən ${t.origin} ${r}${t.minimum.toString()} ${a.unit}`:`Çox kiçik: gözlənilən ${t.origin} ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Yanlış mətn: "${r.prefix}" ilə başlamalıdır`:r.format==="ends_with"?`Yanlış mətn: "${r.suffix}" ilə bitməlidir`:r.format==="includes"?`Yanlış mətn: "${r.includes}" daxil olmalıdır`:r.format==="regex"?`Yanlış mətn: ${r.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${i[r.format]??t.format}`}case"not_multiple_of":return`Yanlış ədəd: ${t.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${t.keys.length>1?"lar":""}: ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${t.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function Mm(){return{localeError:t$()}}function Zm(e,n,i,o){let t=Math.abs(e),r=t%10,a=t%100;return a>=11&&a<=19?o:r===1?n:r>=2&&r<=4?i:o}var n$=()=>{let e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},map:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function n(t){return e[t]??null}let i={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",mac:"MAC адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",credit_card:"нумар крэдытнай карты",currency_code:"код валюты",iban:"IBAN",jwt:"JWT",template_literal:"увод"},o={nan:"NaN",number:"лік",array:"масіў"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Няправільны ўвод: чакаўся instanceof ${t.expected}, атрымана ${s}`:`Няправільны ўвод: чакаўся ${r}, атрымана ${s}`}case"invalid_value":return t.values.length===1?`Няправільны ўвод: чакалася ${$(t.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);if(a){let s=Number(t.maximum),u=Zm(s,a.unit.one,a.unit.few,a.unit.many);return`Занадта вялікі: чакалася, што ${t.origin??"значэнне"} павінна ${a.verb} ${r}${t.maximum.toString()} ${u}`}return`Занадта вялікі: чакалася, што ${t.origin??"значэнне"} павінна быць ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);if(a){let s=Number(t.minimum),u=Zm(s,a.unit.one,a.unit.few,a.unit.many);return`Занадта малы: чакалася, што ${t.origin} павінна ${a.verb} ${r}${t.minimum.toString()} ${u}`}return`Занадта малы: чакалася, што ${t.origin} павінна быць ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${r.prefix}"`:r.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${r.suffix}"`:r.format==="includes"?`Няправільны радок: павінен змяшчаць "${r.includes}"`:r.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${r.pattern}`:`Няправільны ${i[r.format]??t.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${t.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${t.keys.length>1?"ключы":"ключ"}: ${v(t.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${t.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${t.origin}`;default:return"Няправільны ўвод"}}};function Fm(){return{localeError:n$()}}var r$=()=>{let e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"},map:{unit:"елемента",verb:"да съдържа"}};function n(t){return e[t]??null}let i={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",mac:"MAC адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",credit_card:"номер на кредитна карта",currency_code:"код на валута",iban:"IBAN",jwt:"JWT",template_literal:"вход"},o={nan:"NaN",number:"число",array:"масив"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Невалиден вход: очакван instanceof ${t.expected}, получен ${s}`:`Невалиден вход: очакван ${r}, получен ${s}`}case"invalid_value":return t.values.length===1?`Невалиден вход: очакван ${$(t.values[0])}`:`Невалидна опция: очаквано едно от ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Твърде голямо: очаква се ${t.origin??"стойност"} да съдържа ${r}${t.maximum.toString()} ${a.unit??"елемента"}`:`Твърде голямо: очаква се ${t.origin??"стойност"} да бъде ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Твърде малко: очаква се ${t.origin} да съдържа ${r}${t.minimum.toString()} ${a.unit}`:`Твърде малко: очаква се ${t.origin} да бъде ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;if(r.format==="starts_with")return`Невалиден низ: трябва да започва с "${r.prefix}"`;if(r.format==="ends_with")return`Невалиден низ: трябва да завършва с "${r.suffix}"`;if(r.format==="includes")return`Невалиден низ: трябва да включва "${r.includes}"`;if(r.format==="regex")return`Невалиден низ: трябва да съвпада с ${r.pattern}`;let a="Невалиден";return r.format==="emoji"&&(a="Невалидно"),r.format==="datetime"&&(a="Невалидно"),r.format==="date"&&(a="Невалидна"),r.format==="time"&&(a="Невалидно"),r.format==="duration"&&(a="Невалидна"),`${a} ${i[r.format]??t.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${t.divisor}`;case"unrecognized_keys":return`Неразпознат${t.keys.length>1?"и":""} ключ${t.keys.length>1?"ове":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${t.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${t.origin}`;default:return"Невалиден вход"}}};function Vm(){return{localeError:r$()}}var i$=()=>{let e={string:{unit:"অক্ষর",verb:"থাকতে হবে"},file:{unit:"বাইট",verb:"থাকতে হবে"},array:{unit:"আইটেম",verb:"থাকতে হবে"},set:{unit:"আইটেম",verb:"থাকতে হবে"},map:{unit:"এন্ট্রি",verb:"থাকতে হবে"}};function n(t){return e[t]??null}let i={regex:"ইনপুট",email:"ইমেইল ঠিকানা",url:"URL",emoji:"ইমোজি",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO তারিখ ও সময়",date:"ISO তারিখ",time:"ISO সময়",duration:"ISO সময়কাল",ipv4:"IPv4 ঠিকানা",ipv6:"IPv6 ঠিকানা",mac:"MAC ঠিকানা",cidrv4:"IPv4 রেঞ্জ",cidrv6:"IPv6 রেঞ্জ",base64:"base64-এনকোডেড স্ট্রিং",base64url:"base64url-এনকোডেড স্ট্রিং",json_string:"JSON স্ট্রিং",e164:"E.164 নম্বর",credit_card:"ক্রেডিট কার্ড নম্বর",currency_code:"মুদ্রা কোড",iban:"IBAN",jwt:"JWT",template_literal:"ইনপুট"},o={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return`অবৈধ ইনপুট: প্রত্যাশিত ${r}, প্রাপ্ত ${s}`}case"invalid_value":return t.values.length===1?`অবৈধ ইনপুট: প্রত্যাশিত ${$(t.values[0])}`:`অবৈধ অপশন: ${v(t.values," | ")} এর মধ্যে একটি প্রত্যাশিত`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`অনেক বড়: ${t.origin??"মান"} ${r}${t.maximum.toString()} ${a.unit??"এলিমেন্ট"} হতে হবে`:`অনেক বড়: ${t.origin??"মান"} ${r}${t.maximum.toString()} হতে হবে`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`অনেক ছোট: ${t.origin} ${r}${t.minimum.toString()} ${a.unit} হতে হবে`:`অনেক ছোট: ${t.origin} ${r}${t.minimum.toString()} হতে হবে`}case"invalid_format":{let r=t;return r.format==="starts_with"?`অবৈধ স্ট্রিং: "${r.prefix}" দিয়ে শুরু হতে হবে`:r.format==="ends_with"?`অবৈধ স্ট্রিং: "${r.suffix}" দিয়ে শেষ হতে হবে`:r.format==="includes"?`অবৈধ স্ট্রিং: "${r.includes}" অন্তর্ভুক্ত থাকতে হবে`:r.format==="regex"?`অবৈধ স্ট্রিং: ${r.pattern} প্যাটার্ন মিলতে হবে`:`অবৈধ ${i[r.format]??t.format}`}case"not_multiple_of":return`অবৈধ নম্বর: ${t.divisor} এর গুণিতক হতে হবে`;case"unrecognized_keys":return`অচেনা কী${t.keys.length>1?"গুলো":""}: ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} এ অবৈধ কী`;case"invalid_union":return t.options&&Array.isArray(t.options)&&t.options.length>0?`অবৈধ ডিসক্রিমিনেটর মান। প্রত্যাশিত ${t.options.map(a=>`'${a}'`).join(" | ")}`:"অবৈধ ইনপুট";case"invalid_element":return`${t.origin} এ অবৈধ মান`;default:return"অবৈধ ইনপুট"}}};function Gm(){return{localeError:i$()}}var o$=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"},map:{unit:"elements",verb:"contenir"}};function n(t){return e[t]??null}let i={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",mac:"adreça MAC",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",credit_card:"número de targeta de crèdit",currency_code:"codi de moneda",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Tipus invàlid: s'esperava instanceof ${t.expected}, s'ha rebut ${s}`:`Tipus invàlid: s'esperava ${r}, s'ha rebut ${s}`}case"invalid_value":return t.values.length===1?`Valor invàlid: s'esperava ${$(t.values[0])}`:`Opció invàlida: s'esperava una de ${v(t.values," o ")}`;case"too_big":{let r=t.inclusive?"com a màxim":"menys de",a=n(t.origin);return a?`Massa gran: s'esperava que ${t.origin??"el valor"} contingués ${r} ${t.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${t.origin??"el valor"} fos ${r} ${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?"com a mínim":"més de",a=n(t.origin);return a?`Massa petit: s'esperava que ${t.origin} contingués ${r} ${t.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${t.origin} fos ${r} ${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Format invàlid: ha de començar amb "${r.prefix}"`:r.format==="ends_with"?`Format invàlid: ha d'acabar amb "${r.suffix}"`:r.format==="includes"?`Format invàlid: ha d'incloure "${r.includes}"`:r.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${r.pattern}`:`Format invàlid per a ${i[r.format]??t.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${t.divisor}`;case"unrecognized_keys":return`Clau${t.keys.length>1?"s":""} no reconeguda${t.keys.length>1?"s":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${t.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${t.origin}`;default:return"Entrada invàlida"}}};function Bm(){return{localeError:o$()}}var a$=()=>{let e={string:{unit:"پیت",verb:"بێت"},file:{unit:"بایت",verb:"بێت"},array:{unit:"دانە",verb:"بێت"},set:{unit:"دانە",verb:"بێت"},map:{unit:"دانە",verb:"بێت"}};function n(t){return e[t]??null}let i={regex:"regex",email:"ئیمەیڵ",url:"بەستەر (URL)",emoji:"ئیمۆجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ڕێکەوت و کات",date:"ڕێکەوت",time:"کات",duration:"ماوە",ipv4:"ناونیشانی IPv4",ipv6:"ناونیشانی IPv6",mac:"ناونیشانی MAC",cidrv4:"مەودای IPv4",cidrv6:"مەودای IPv6",base64:"دەقی base64",base64url:"دەقی base64url",json_string:"دەقی JSON",e164:"ژمارەی E.164",credit_card:"ژمارەی کارتی کرێدیت",currency_code:"کۆدی دراو",iban:"IBAN",jwt:"JWT",template_literal:"تێکردە"},o={nan:"NaN",string:"نووسین",number:"ژمارە",boolean:"boolean",array:"array",object:"object",date:"ڕێکەوت",integer:"ژمارە",float:"ژمارە",null:"null",undefined:"undefined",function:"function",symbol:"symbol",unknown:"unknown",promise:"promise",void:"void",never:"never",map:"map",set:"set"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a,u=["ا","و","ۆ","وو","ە","ی","ێ"].some(d=>s.endsWith(d))?"یە":"ە",c=/^[a-zA-Z]+$/.test(s);return a==="null"||a==="undefined"?"داواکراوە":`چاوەڕوانکراوە ${r} بێت، بەڵام ${s}${c?"":u}`}case"invalid_value":return t.values.length===1?`بەهاکە نادرووستە: چاوەڕوانکراوە ${$(t.values[0])} بێت`:`هەڵبژاردەی نادروست: چاوەڕوانکراوە یەکێک بێت لە ${v(t.values,"|")}`;case"too_big":{let r=n(t.origin);return r?`پێویستە بە لایەنی زۆرەوە ${t.maximum.toString()} ${r.unit} ${r.verb}`:`پێویستە بە لایەنی زۆرەوە ${t.maximum.toString()} بێت`}case"too_small":{let r=n(t.origin);return r?`پێویستە بە لایەنی کەمەوە ${t.minimum.toString()} ${r.unit} ${r.verb}`:`پێویستە بە لایەنی کەمەوە ${t.minimum.toString()} بێت`}case"invalid_format":{let r=t;return r.format==="starts_with"?`دەقی نادروست: پێویستە دەستپێبکات بە "${r.prefix}"`:r.format==="ends_with"?`دەقی نادروست: پێویستە کۆتاییبێت بە "${r.suffix}"`:r.format==="includes"?`دەقی نادروست: پێویستە "${r.includes}" لەخۆبگرێت`:r.format==="regex"?`دەقی نادروست: پێویستە لەگەڵ پاتێرنی ${r.pattern} بگونجێت`:`بەهای ${i[r.format]??t.format} نادروستە`}case"not_multiple_of":return`ژمارەی نادروست: دەبێت چەند هێندە بێت بۆ ${t.divisor}`;case"unrecognized_keys":return`کلیلی نەناسراو: ${v(t.keys,", ")}`;case"invalid_key":return`کلیلی نادروست لە ${t.origin}`;case"invalid_union":return t.options&&Array.isArray(t.options)&&t.options.length>0?`بەهای نەناسراو هەیە. بەهای چاوەڕوانکراو: ${t.options.map(a=>`'${a}'`).join(" | ")}`:"یەکگرتنی نادروست";case"invalid_element":return`${t.origin} بەهاکە نادروستە`;default:return"تێکردەی نادروست"}}};function Hm(){return{localeError:a$()}}var s$=()=>{let e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"},map:{unit:"prvků",verb:"mít"}};function n(t){return e[t]??null}let i={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",credit_card:"číslo kreditní karty",currency_code:"kód měny",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Neplatný vstup: očekáváno instanceof ${t.expected}, obdrženo ${s}`:`Neplatný vstup: očekáváno ${r}, obdrženo ${s}`}case"invalid_value":return t.values.length===1?`Neplatný vstup: očekáváno ${$(t.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Hodnota je příliš velká: ${t.origin??"hodnota"} musí mít ${r}${t.maximum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš velká: ${t.origin??"hodnota"} musí být ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Hodnota je příliš malá: ${t.origin??"hodnota"} musí mít ${r}${t.minimum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš malá: ${t.origin??"hodnota"} musí být ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Neplatný řetězec: musí začínat na "${r.prefix}"`:r.format==="ends_with"?`Neplatný řetězec: musí končit na "${r.suffix}"`:r.format==="includes"?`Neplatný řetězec: musí obsahovat "${r.includes}"`:r.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${r.pattern}`:`Neplatný formát ${i[r.format]??t.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${t.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${v(t.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${t.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${t.origin}`;default:return"Neplatný vstup"}}};function Wm(){return{localeError:s$()}}var u$=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"},map:{unit:"elementer",verb:"indeholdt"}};function n(t){return e[t]??null}let i={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kreditkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Ugyldigt input: forventede instanceof ${t.expected}, fik ${s}`:`Ugyldigt input: forventede ${r}, fik ${s}`}case"invalid_value":return t.values.length===1?`Ugyldig værdi: forventede ${$(t.values[0])}`:`Ugyldigt valg: forventede en af følgende ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin),s=o[t.origin]??t.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${r} ${t.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${r} ${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin),s=o[t.origin]??t.origin;return a?`For lille: forventede ${s} ${a.verb} ${r} ${t.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${r} ${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ugyldig streng: skal starte med "${r.prefix}"`:r.format==="ends_with"?`Ugyldig streng: skal ende med "${r.suffix}"`:r.format==="includes"?`Ugyldig streng: skal indeholde "${r.includes}"`:r.format==="regex"?`Ugyldig streng: skal matche mønsteret ${r.pattern}`:`Ugyldig ${i[r.format]??t.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${v(t.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${t.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${t.origin}`;default:return"Ugyldigt input"}}};function Km(){return{localeError:u$()}}var c$=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"},map:{unit:"Elemente",verb:"zu haben"}};function n(t){return e[t]??null}let i={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",mac:"MAC-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",credit_card:"Kreditkartennummer",currency_code:"Währungscode",iban:"IBAN",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Ungültige Eingabe: erwartet instanceof ${t.expected}, erhalten ${s}`:`Ungültige Eingabe: erwartet ${r}, erhalten ${s}`}case"invalid_value":return t.values.length===1?`Ungültige Eingabe: erwartet ${$(t.values[0])}`:`Ungültige Option: erwartet eine von ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Zu groß: erwartet, dass ${t.origin??"Wert"} ${r}${t.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${t.origin??"Wert"} ${r}${t.maximum.toString()} ist`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Zu klein: erwartet, dass ${t.origin} ${r}${t.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${t.origin} ${r}${t.minimum.toString()} ist`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ungültiger String: muss mit "${r.prefix}" beginnen`:r.format==="ends_with"?`Ungültiger String: muss mit "${r.suffix}" enden`:r.format==="includes"?`Ungültiger String: muss "${r.includes}" enthalten`:r.format==="regex"?`Ungültiger String: muss dem Muster ${r.pattern} entsprechen`:`Ungültig: ${i[r.format]??t.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${t.divisor} sein`;case"unrecognized_keys":return`${t.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${v(t.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${t.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${t.origin}`;default:return"Ungültige Eingabe"}}};function Jm(){return{localeError:c$()}}var l$=()=>{let e={string:{unit:"χαρακτήρες",verb:"να έχει"},file:{unit:"bytes",verb:"να έχει"},array:{unit:"στοιχεία",verb:"να έχει"},set:{unit:"στοιχεία",verb:"να έχει"},map:{unit:"καταχωρήσεις",verb:"να έχει"}};function n(t){return e[t]??null}let i={regex:"είσοδος",email:"διεύθυνση email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ημερομηνία και ώρα",date:"ISO ημερομηνία",time:"ISO ώρα",duration:"ISO διάρκεια",ipv4:"διεύθυνση IPv4",ipv6:"διεύθυνση IPv6",mac:"διεύθυνση MAC",cidrv4:"εύρος IPv4",cidrv6:"εύρος IPv6",base64:"συμβολοσειρά κωδικοποιημένη σε base64",base64url:"συμβολοσειρά κωδικοποιημένη σε base64url",json_string:"συμβολοσειρά JSON",e164:"αριθμός E.164",credit_card:"αριθμός πιστωτικής κάρτας",currency_code:"κωδικός νομίσματος",iban:"IBAN",jwt:"JWT",template_literal:"είσοδος"},o={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return typeof t.expected=="string"&&/^[A-Z]/.test(t.expected)?`Μη έγκυρη είσοδος: αναμενόταν instanceof ${t.expected}, λήφθηκε ${s}`:`Μη έγκυρη είσοδος: αναμενόταν ${r}, λήφθηκε ${s}`}case"invalid_value":return t.values.length===1?`Μη έγκυρη είσοδος: αναμενόταν ${$(t.values[0])}`:`Μη έγκυρη επιλογή: αναμενόταν ένα από ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Πολύ μεγάλο: αναμενόταν ${t.origin??"τιμή"} να έχει ${r}${t.maximum.toString()} ${a.unit??"στοιχεία"}`:`Πολύ μεγάλο: αναμενόταν ${t.origin??"τιμή"} να είναι ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Πολύ μικρό: αναμενόταν ${t.origin} να έχει ${r}${t.minimum.toString()} ${a.unit}`:`Πολύ μικρό: αναμενόταν ${t.origin} να είναι ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${r.prefix}"`:r.format==="ends_with"?`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${r.suffix}"`:r.format==="includes"?`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${r.includes}"`:r.format==="regex"?`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${r.pattern}`:`Μη έγκυρο: ${i[r.format]??t.format}`}case"not_multiple_of":return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${t.divisor}`;case"unrecognized_keys":return`Άγνωστ${t.keys.length>1?"α":"ο"} κλειδ${t.keys.length>1?"ιά":"ί"}: ${v(t.keys,", ")}`;case"invalid_key":return`Μη έγκυρο κλειδί στο ${t.origin}`;case"invalid_union":return"Μη έγκυρη είσοδος";case"invalid_element":return`Μη έγκυρη τιμή στο ${t.origin}`;default:return"Μη έγκυρη είσοδος"}}};function Xm(){return{localeError:l$()}}var d$=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function n(r){return e[r]??null}let i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};function t(r,a){return r==="number"&&typeof a=="number"&&!Number.isFinite(a)?String(a):o[r]??r}return r=>{switch(r.code){case"invalid_type":{let a=t(r.expected),s=k(r.input),u=t(s,r.input);return`Invalid input: expected ${a}, received ${u}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${$(r.values[0])}`:`Invalid option: expected one of ${v(r.values,"|")}`;case"too_big":{let a=r.exact?"exactly ":r.inclusive?"<=":"<",s=n(r.origin);return s?`Too big: expected ${r.origin??"value"} to have ${a}${r.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${a}${r.maximum.toString()}`}case"too_small":{let a=r.exact?"exactly ":r.inclusive?">=":">",s=n(r.origin);return s?`Too small: expected ${r.origin} to have ${a}${r.minimum.toString()} ${s.unit}`:`Too small: expected ${r.origin} to be ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${i[a.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${v(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`Invalid discriminator value. Expected ${r.options.map(s=>`'${s}'`).join(" | ")}`:r.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function Ji(){return{localeError:d$()}}var p$=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"},map:{unit:"elementojn",verb:"havi"}};function n(t){return e[t]??null}let i={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",mac:"MAC-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",credit_card:"kreditkarta numero",currency_code:"valuta kodo",iban:"IBAN",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Nevalida enigo: atendiĝis instanceof ${t.expected}, riceviĝis ${s}`:`Nevalida enigo: atendiĝis ${r}, riceviĝis ${s}`}case"invalid_value":return t.values.length===1?`Nevalida enigo: atendiĝis ${$(t.values[0])}`:`Nevalida opcio: atendiĝis unu el ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Tro granda: atendiĝis ke ${t.origin??"valoro"} havu ${r}${t.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${t.origin??"valoro"} havu ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Tro malgranda: atendiĝis ke ${t.origin} havu ${r}${t.minimum.toString()} ${a.unit}`:`Tro malgranda: atendiĝis ke ${t.origin} estu ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${r.prefix}"`:r.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${r.suffix}"`:r.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${r.includes}"`:r.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${r.pattern}`:`Nevalida ${i[r.format]??t.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${t.divisor}`;case"unrecognized_keys":return`Nekonata${t.keys.length>1?"j":""} ŝlosilo${t.keys.length>1?"j":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${t.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${t.origin}`;default:return"Nevalida enigo"}}};function qm(){return{localeError:p$()}}var m$=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function n(t){return e[t]??null}let i={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",mac:"dirección MAC",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",credit_card:"número de tarjeta de crédito",currency_code:"código de moneda",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Entrada inválida: se esperaba instanceof ${t.expected}, recibido ${s}`:`Entrada inválida: se esperaba ${r}, recibido ${s}`}case"invalid_value":return t.values.length===1?`Entrada inválida: se esperaba ${$(t.values[0])}`:`Opción inválida: se esperaba una de ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin),s=o[t.origin]??t.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${r}${t.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin),s=o[t.origin]??t.origin;return a?`Demasiado pequeño: se esperaba que ${s} tuviera ${r}${t.minimum.toString()} ${a.unit}`:`Demasiado pequeño: se esperaba que ${s} fuera ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Cadena inválida: debe comenzar con "${r.prefix}"`:r.format==="ends_with"?`Cadena inválida: debe terminar en "${r.suffix}"`:r.format==="includes"?`Cadena inválida: debe incluir "${r.includes}"`:r.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${r.pattern}`:`Inválido ${i[r.format]??t.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${t.divisor}`;case"unrecognized_keys":return`Llave${t.keys.length>1?"s":""} desconocida${t.keys.length>1?"s":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Llave inválida en ${o[t.origin]??t.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${o[t.origin]??t.origin}`;default:return"Entrada inválida"}}};function Ym(){return{localeError:m$()}}var f$=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"},map:{unit:"آیتم",verb:"داشته باشد"}};function n(t){return e[t]??null}let i={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",mac:"MAC آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",credit_card:"شماره کارت اعتباری",currency_code:"کد ارز",iban:"IBAN",jwt:"JWT",template_literal:"ورودی"},o={nan:"NaN",number:"عدد",array:"آرایه"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`ورودی نامعتبر: می‌بایست instanceof ${t.expected} می‌بود، ${s} دریافت شد`:`ورودی نامعتبر: می‌بایست ${r} می‌بود، ${s} دریافت شد`}case"invalid_value":return t.values.length===1?`ورودی نامعتبر: می‌بایست ${$(t.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${v(t.values,"|")} می‌بود`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`خیلی بزرگ: ${t.origin??"مقدار"} باید ${r}${t.maximum.toString()} ${a.unit??"عنصر"} باشد`:`خیلی بزرگ: ${t.origin??"مقدار"} باید ${r}${t.maximum.toString()} باشد`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`خیلی کوچک: ${t.origin} باید ${r}${t.minimum.toString()} ${a.unit} باشد`:`خیلی کوچک: ${t.origin} باید ${r}${t.minimum.toString()} باشد`}case"invalid_format":{let r=t;return r.format==="starts_with"?`رشته نامعتبر: باید با "${r.prefix}" شروع شود`:r.format==="ends_with"?`رشته نامعتبر: باید با "${r.suffix}" تمام شود`:r.format==="includes"?`رشته نامعتبر: باید شامل "${r.includes}" باشد`:r.format==="regex"?`رشته نامعتبر: باید با الگوی ${r.pattern} مطابقت داشته باشد`:`${i[r.format]??t.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${t.divisor} باشد`;case"unrecognized_keys":return`کلید${t.keys.length>1?"های":""} ناشناس: ${v(t.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${t.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${t.origin}`;default:return"ورودی نامعتبر"}}};function Qm(){return{localeError:f$()}}var g$=()=>{let e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},map:{unit:"alkiota",subject:"kuvauksen"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function n(t){return e[t]??null}let i={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",mac:"MAC-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",credit_card:"luottokortin numero",currency_code:"valuuttakoodi",iban:"IBAN",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Virheellinen tyyppi: odotettiin instanceof ${t.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${r}, oli ${s}`}case"invalid_value":return t.values.length===1?`Virheellinen syöte: täytyy olla ${$(t.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Liian suuri: ${a.subject} täytyy olla ${r}${t.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon täytyy olla ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Liian pieni: ${a.subject} täytyy olla ${r}${t.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon täytyy olla ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${r.prefix}"`:r.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${r.suffix}"`:r.format==="includes"?`Virheellinen syöte: täytyy sisältää "${r.includes}"`:r.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${r.pattern}`:`Virheellinen ${i[r.format]??t.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${t.divisor} monikerta`;case"unrecognized_keys":return`${t.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${v(t.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function ef(){return{localeError:g$()}}var h$=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function n(t){return e[t]??null}let i={regex:"expression régulière",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne de caractères encodée en base64",base64url:"chaîne de caractères encodée en base64url",json_string:"chaîne de caractères JSON",e164:"numéro au format E.164",credit_card:"numéro de carte de crédit",currency_code:"code de devise",iban:"IBAN",jwt:"JWT",template_literal:"entrée"},o={string:"chaîne de caractères",number:"nombre",int:"entier",boolean:"booléen",bigint:"grand entier",symbol:"symbole",undefined:"indéfini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"record",map:"map",set:"ensemble",file:"fichier",nonoptional:"non optionnel",nan:"NaN",function:"fonction"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Entrée invalide : instance de ${t.expected} attendu, ${s} reçu`:`Entrée invalide : ${r} attendu, ${s} reçu`}case"invalid_value":return t.values.length===1?`Entrée invalide : ${$(t.values[0])} attendu`:`Option invalide : une valeur parmi ${v(t.values,"|")} attendue`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Trop grand : ${o[t.origin]??"valeur"} doit ${a.verb} ${r}${t.maximum.toString()} ${a.unit??"élément(s)"}`:`Trop grand : ${o[t.origin]??"valeur"} doit être ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Trop petit : ${o[t.origin]??"valeur"} doit ${a.verb} ${r}${t.minimum.toString()} ${a.unit}`:`Trop petit : ${o[t.origin]??"valeur"} doit être ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Chaîne de caractères invalide : doit commencer par "${r.prefix}"`:r.format==="ends_with"?`Chaîne de caractères invalide : doit se terminer par "${r.suffix}"`:r.format==="includes"?`Chaîne de caractères invalide : doit inclure "${r.includes}"`:r.format==="regex"?`Chaîne de caractères invalide : doit correspondre au motif ${r.pattern}`:`${i[r.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${t.divisor}`;case"unrecognized_keys":return`Clé${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${v(t.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${t.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entrée invalide"}}};function tf(){return{localeError:h$()}}var v$=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"},map:{unit:"éléments",verb:"avoir"}};function n(t){return e[t]??null}let i={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",credit_card:"numéro de carte de crédit",currency_code:"code de devise",iban:"IBAN",jwt:"JWT",template_literal:"entrée"},o={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Entrée invalide : attendu instanceof ${t.expected}, reçu ${s}`:`Entrée invalide : attendu ${r}, reçu ${s}`}case"invalid_value":return t.values.length===1?`Entrée invalide : attendu ${$(t.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"≤":"<",a=n(t.origin);return a?`Trop grand : attendu que ${t.origin??"la valeur"} ait ${r}${t.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${t.origin??"la valeur"} soit ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?"≥":">",a=n(t.origin);return a?`Trop petit : attendu que ${t.origin} ait ${r}${t.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${t.origin} soit ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Chaîne invalide : doit commencer par "${r.prefix}"`:r.format==="ends_with"?`Chaîne invalide : doit se terminer par "${r.suffix}"`:r.format==="includes"?`Chaîne invalide : doit inclure "${r.includes}"`:r.format==="regex"?`Chaîne invalide : doit correspondre au motif ${r.pattern}`:`${i[r.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${t.divisor}`;case"unrecognized_keys":return`Clé${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${v(t.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${t.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entrée invalide"}}};function nf(){return{localeError:v$()}}var y$=()=>{let e={string:{unit:"અક્ષર",verb:"હોવા જોઈએ"},file:{unit:"બાયટ",verb:"હોવા જોઈએ"},array:{unit:"આઇટમ",verb:"હોવા જોઈએ"},set:{unit:"આઇટમ",verb:"હોવા જોઈએ"},map:{unit:"એન્ટ્રી",verb:"હોવા જોઈએ"}};function n(t){return e[t]??null}let i={regex:"ઇનપુટ",email:"ઈમેઇલ એડ્રેસ",url:"URL",emoji:"ઇમોજી",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO તારીખ અને સમય",date:"ISO તારીખ",time:"ISO સમય",duration:"ISO અવધિ",ipv4:"IPv4 એડ્રેસ",ipv6:"IPv6 એડ્રેસ",mac:"MAC એડ્રેસ",cidrv4:"IPv4 શ્રેણી",cidrv6:"IPv6 શ્રેણી",base64:"base64-એન્કોડેડ સ્ટ્રિંગ",base64url:"base64url-એન્કોડેડ સ્ટ્રિંગ",json_string:"JSON સ્ટ્રિંગ",e164:"E.164 નંબર",credit_card:"ક્રેડિટ કાર્ડ નંબર",currency_code:"ચલણ કોડ",iban:"IBAN",jwt:"JWT",template_literal:"ઇનપુટ"},o={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return`અમાન્ય ઇનપુટ: અપેક્ષિત ${r}, પ્રાપ્ત ${s}`}case"invalid_value":return t.values.length===1?`અમાન્ય ઇનપુટ: અપેક્ષિત ${$(t.values[0])}`:`અમાન્ય વિકલ્પ: ${v(t.values," | ")} માધ્યમથી એક અપેક્ષિત`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`ખૂબ મોટું: ${t.origin??"મૂલ્ય"} ${r}${t.maximum.toString()} ${a.unit??"એલિમેન્ટ"} હોવા જોઈએ`:`ખૂબ મોટું: ${t.origin??"મૂલ્ય"} ${r}${t.maximum.toString()} હોવું જોઈએ`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`ખૂબ નાનું: ${t.origin} ${r}${t.minimum.toString()} ${a.unit} હોવા જોઈએ`:`ખૂબ નાનું: ${t.origin} ${r}${t.minimum.toString()} હોવું જોઈએ`}case"invalid_format":{let r=t;return r.format==="starts_with"?`અમાન્ય સ્ટ્રિંગ: "${r.prefix}" થી શરૂ થવું જોઈએ`:r.format==="ends_with"?`અમાન્ય સ્ટ્રિંગ: "${r.suffix}" પર સમાપ્ત થવું જોઈએ`:r.format==="includes"?`અમાન્ય સ્ટ્રિંગ: "${r.includes}" શામેલ હોવું જોઈએ`:r.format==="regex"?`અમાન્ય સ્ટ્રિંગ: પેટર્ન ${r.pattern} સાથે મેળ ખાવું જોઈએ`:`અમાન્ય ${i[r.format]??t.format}`}case"not_multiple_of":return`અમાન્ય નંબર: ${t.divisor} નો ગુણાંક હોવો જોઈએ`;case"unrecognized_keys":return`ઓળખી શકાતા નહીં તે કી${t.keys.length>1?"ઓ":""}: ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} માં અમાન્ય કી`;case"invalid_union":return t.options&&Array.isArray(t.options)&&t.options.length>0?`અમાન્ય ડિસ્ક્રિમિનેટર મૂલ્ય. અપેક્ષિત ${t.options.map(a=>`'${a}'`).join(" | ")}`:"અમાન્ય ઇનપુટ";case"invalid_element":return`${t.origin} માં અમાન્ય મૂલ્ય`;default:return"અમાન્ય ઇનપુટ"}}};function rf(){return{localeError:y$()}}var b$=()=>{let e={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},n={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},i=c=>c?e[c]:void 0,o=c=>{let d=i(c);return d?d.label:c??e.unknown.label},t=c=>`ה${o(c)}`,r=c=>(i(c)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות",a=c=>c?n[c]??null:null,s={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},uuidv4:{label:"UUIDv4",gender:"m"},uuidv6:{label:"UUIDv6",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},mac:{label:"כתובת MAC",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},credit_card:{label:"מספר כרטיס אשראי",gender:"m"},currency_code:{label:"קוד מטבע",gender:"m"},iban:{label:"IBAN",gender:"m"},jwt:{label:"JWT",gender:"m"},template_literal:{label:"קלט",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},u={nan:"NaN"};return c=>{switch(c.code){case"invalid_type":{let d=c.expected,p=u[d??""]??o(d),m=k(c.input),f=u[m]??e[m]?.label??m;return/^[A-Z]/.test(c.expected)?`קלט לא תקין: צריך להיות instanceof ${c.expected}, התקבל ${f}`:`קלט לא תקין: צריך להיות ${p}, התקבל ${f}`}case"invalid_value":{if(c.values.length===1)return`ערך לא תקין: הערך חייב להיות ${$(c.values[0])}`;let d=c.values.map(f=>$(f));if(c.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${d[0]} או ${d[1]}`;let p=d[d.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${d.slice(0,-1).join(", ")} או ${p}`}case"too_big":{let d=a(c.origin),p=t(c.origin??"value");if(c.origin==="string")return`${d?.longLabel??"ארוך"} מדי: ${p} צריכה להכיל ${c.maximum.toString()} ${d?.unit??""} ${c.inclusive?"או פחות":"לכל היותר"}`.trim();if(c.origin==="number"){let g=c.inclusive?`קטן או שווה ל-${c.maximum}`:`קטן מ-${c.maximum}`;return`גדול מדי: ${p} צריך להיות ${g}`}if(c.origin==="array"||c.origin==="set"){let g=c.origin==="set"?"צריכה":"צריך",y=c.inclusive?`${c.maximum} ${d?.unit??""} או פחות`:`פחות מ-${c.maximum} ${d?.unit??""}`;return`גדול מדי: ${p} ${g} להכיל ${y}`.trim()}let m=c.inclusive?"<=":"<",f=r(c.origin??"value");return d?.unit?`${d.longLabel} מדי: ${p} ${f} ${m}${c.maximum.toString()} ${d.unit}`:`${d?.longLabel??"גדול"} מדי: ${p} ${f} ${m}${c.maximum.toString()}`}case"too_small":{let d=a(c.origin),p=t(c.origin??"value");if(c.origin==="string")return`${d?.shortLabel??"קצר"} מדי: ${p} צריכה להכיל ${c.minimum.toString()} ${d?.unit??""} ${c.inclusive?"או יותר":"לפחות"}`.trim();if(c.origin==="number"){let g=c.inclusive?`גדול או שווה ל-${c.minimum}`:`גדול מ-${c.minimum}`;return`קטן מדי: ${p} צריך להיות ${g}`}if(c.origin==="array"||c.origin==="set"){let g=c.origin==="set"?"צריכה":"צריך";if(c.minimum===1&&c.inclusive){let x=(c.origin==="set","לפחות פריט אחד");return`קטן מדי: ${p} ${g} להכיל ${x}`}let y=c.inclusive?`${c.minimum} ${d?.unit??""} או יותר`:`יותר מ-${c.minimum} ${d?.unit??""}`;return`קטן מדי: ${p} ${g} להכיל ${y}`.trim()}let m=c.inclusive?">=":">",f=r(c.origin??"value");return d?.unit?`${d.shortLabel} מדי: ${p} ${f} ${m}${c.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"קטן"} מדי: ${p} ${f} ${m}${c.minimum.toString()}`}case"invalid_format":{let d=c;if(d.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${d.prefix}"`;if(d.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${d.suffix}"`;if(d.format==="includes")return`המחרוזת חייבת לכלול "${d.includes}"`;if(d.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${d.pattern}`;let p=s[d.format],m=p?.label??d.format,g=(p?.gender??"m")==="f"?"תקינה":"תקין";return`${m} לא ${g}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${c.divisor}`;case"unrecognized_keys":return`מפתח${c.keys.length>1?"ות":""} לא מזוה${c.keys.length>1?"ים":"ה"}: ${v(c.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${t(c.origin??"array")}`;default:return"קלט לא תקין"}}};function of(){return{localeError:b$()}}var _$=()=>{let e={string:{unit:"अक्षर",verb:"रखने के लिए"},file:{unit:"बाइट्स",verb:"रखने के लिए"},array:{unit:"तत्व",verb:"रखने के लिए"},set:{unit:"तत्व",verb:"रखने के लिए"},map:{unit:"प्रविष्टियाँ",verb:"रखने के लिए"}};function n(t){return e[t]??null}let i={regex:"इनपुट",email:"ईमेल पता",url:"URL",emoji:"इमोजी",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO तिथि और समय",date:"ISO तिथि",time:"ISO समय",duration:"ISO अवधि",ipv4:"IPv4 पता",ipv6:"IPv6 पता",mac:"MAC पता",cidrv4:"IPv4 श्रेणी",cidrv6:"IPv6 श्रेणी",base64:"Base64-एन्कोडेड स्ट्रिंग",base64url:"Base64URL-एन्कोडेड स्ट्रिंग",json_string:"JSON स्ट्रिंग",e164:"E.164 संख्या",credit_card:"क्रेडिट कार्ड संख्या",currency_code:"मुद्रा कोड",iban:"IBAN",jwt:"JWT",template_literal:"इनपुट"},o={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return`अमान्य इनपुट: अपेक्षित ${r}, प्राप्त ${s}`}case"invalid_value":return t.values.length===1?`अमान्य इनपुट: अपेक्षित ${$(t.values[0])}`:`अमान्य विकल्प: अपेक्षित मानों में से एक ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`बहुत बड़ा: अपेक्षित था कि ${t.origin??"मान"} में ${r}${t.maximum} ${a.unit} हों`:`बहुत बड़ा: अपेक्षित था कि ${t.origin??"मान"} ${r}${t.maximum} हो`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`बहुत छोटा: अपेक्षित था कि ${t.origin} में ${r}${t.minimum} ${a.unit} हों`:`बहुत छोटा: अपेक्षित था कि ${t.origin} ${r}${t.minimum} हो`}case"invalid_format":{let r=t;return r.format==="starts_with"?`अमान्य स्ट्रिंग: "${r.prefix}" से शुरू होना चाहिए`:r.format==="ends_with"?`अमान्य स्ट्रिंग: "${r.suffix}" पर समाप्त होना चाहिए`:r.format==="includes"?`अमान्य स्ट्रिंग: इसमें "${r.includes}" शामिल होना चाहिए`:r.format==="regex"?`अमान्य स्ट्रिंग: पैटर्न ${r.pattern} से मेल खाना चाहिए`:`अमान्य ${i[r.format]??t.format}`}case"not_multiple_of":return`अमान्य संख्या: यह ${t.divisor} का गुणज होना चाहिए`;case"unrecognized_keys":return`अपरिचित कुंजी${t.keys.length>1?"याँ":""}: ${v(t.keys,", ")}`;case"invalid_key":return`अमान्य कुंजी: ${t.origin} में`;case"invalid_union":return t.options&&Array.isArray(t.options)&&t.options.length>0?`अमान्य डिस्क्रिमिनेटर मान: अपेक्षित ${t.options.map(a=>`'${a}'`).join(" | ")}`:"अमान्य इनपुट";case"invalid_element":return`अमान्य मान: ${t.origin} में`;default:return"अमान्य इनपुट"}}};function af(){return{localeError:_$()}}var $$=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function n(t){return e[t]??null}let i={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",credit_card:"broj kreditne kartice",currency_code:"kod valute",iban:"IBAN",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Neispravan unos: očekuje se instanceof ${t.expected}, a primljeno je ${s}`:`Neispravan unos: očekuje se ${r}, a primljeno je ${s}`}case"invalid_value":return t.values.length===1?`Neispravna vrijednost: očekivano ${$(t.values[0])}`:`Neispravna opcija: očekivano jedno od ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin),s=o[t.origin]??t.origin;return a?`Preveliko: očekivano da ${s??"vrijednost"} ima ${r}${t.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: očekivano da ${s??"vrijednost"} bude ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin),s=o[t.origin]??t.origin;return a?`Premalo: očekivano da ${s} ima ${r}${t.minimum.toString()} ${a.unit}`:`Premalo: očekivano da ${s} bude ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Neispravan tekst: mora započinjati s "${r.prefix}"`:r.format==="ends_with"?`Neispravan tekst: mora završavati s "${r.suffix}"`:r.format==="includes"?`Neispravan tekst: mora sadržavati "${r.includes}"`:r.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${r.pattern}`:`Neispravna ${i[r.format]??t.format}`}case"not_multiple_of":return`Neispravan broj: mora biti višekratnik od ${t.divisor}`;case"unrecognized_keys":return`Neprepoznat${t.keys.length>1?"i ključevi":" ključ"}: ${v(t.keys,", ")}`;case"invalid_key":return`Neispravan ključ u ${o[t.origin]??t.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[t.origin]??t.origin}`;default:return"Neispravan unos"}}};function sf(){return{localeError:$$()}}var k$=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"},map:{unit:"elem",verb:"legyen"}};function n(t){return e[t]??null}let i={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",mac:"MAC cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",credit_card:"hitelkártyaszám",currency_code:"pénznemkód",iban:"IBAN",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"szám",array:"tömb"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Érvénytelen bemenet: a várt érték instanceof ${t.expected}, a kapott érték ${s}`:`Érvénytelen bemenet: a várt érték ${r}, a kapott érték ${s}`}case"invalid_value":return t.values.length===1?`Érvénytelen bemenet: a várt érték ${$(t.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Túl nagy: ${t.origin??"érték"} mérete túl nagy ${r}${t.maximum.toString()} ${a.unit??"elem"}`:`Túl nagy: a bemeneti érték ${t.origin??"érték"} túl nagy: ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Túl kicsi: a bemeneti érték ${t.origin} mérete túl kicsi ${r}${t.minimum.toString()} ${a.unit}`:`Túl kicsi: a bemeneti érték ${t.origin} túl kicsi ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Érvénytelen string: "${r.prefix}" értékkel kell kezdődnie`:r.format==="ends_with"?`Érvénytelen string: "${r.suffix}" értékkel kell végződnie`:r.format==="includes"?`Érvénytelen string: "${r.includes}" értéket kell tartalmaznia`:r.format==="regex"?`Érvénytelen string: ${r.pattern} mintának kell megfelelnie`:`Érvénytelen ${i[r.format]??t.format}`}case"not_multiple_of":return`Érvénytelen szám: ${t.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${t.keys.length>1?"s":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${t.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${t.origin}`;default:return"Érvénytelen bemenet"}}};function uf(){return{localeError:k$()}}function cf(e,n,i){return Math.abs(e)===1?n:i}function an(e){if(!e)return"";let n=["ա","ե","ը","ի","ո","ու","օ"],i=e[e.length-1];return e+(n.includes(i)?"ն":"ը")}var x$=()=>{let e={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},map:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function n(t){return e[t]??null}let i={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",mac:"MAC հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",credit_card:"կրեդիտ քարտի համար",currency_code:"արժույթի կոդ",iban:"IBAN",jwt:"JWT",template_literal:"մուտք"},o={nan:"NaN",number:"թիվ",array:"զանգված"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${t.expected}, ստացվել է ${s}`:`Սխալ մուտքագրում․ սպասվում էր ${r}, ստացվել է ${s}`}case"invalid_value":return t.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${$(t.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);if(a){let s=Number(t.maximum),u=cf(s,a.unit.one,a.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${an(t.origin??"արժեք")} կունենա ${r}${t.maximum.toString()} ${u}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${an(t.origin??"արժեք")} լինի ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);if(a){let s=Number(t.minimum),u=cf(s,a.unit.one,a.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${an(t.origin)} կունենա ${r}${t.minimum.toString()} ${u}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${an(t.origin)} լինի ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Սխալ տող․ պետք է սկսվի "${r.prefix}"-ով`:r.format==="ends_with"?`Սխալ տող․ պետք է ավարտվի "${r.suffix}"-ով`:r.format==="includes"?`Սխալ տող․ պետք է պարունակի "${r.includes}"`:r.format==="regex"?`Սխալ տող․ պետք է համապատասխանի ${r.pattern} ձևաչափին`:`Սխալ ${i[r.format]??t.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${t.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${t.keys.length>1?"ներ":""}. ${v(t.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${an(t.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${an(t.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function lf(){return{localeError:x$()}}var w$=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"},map:{unit:"item",verb:"memiliki"}};function n(t){return e[t]??null}let i={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",mac:"alamat MAC",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",credit_card:"nomor kartu kredit",currency_code:"kode mata uang",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Input tidak valid: diharapkan instanceof ${t.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${r}, diterima ${s}`}case"invalid_value":return t.values.length===1?`Input tidak valid: diharapkan ${$(t.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Terlalu besar: diharapkan ${t.origin??"value"} memiliki ${r}${t.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${t.origin??"value"} menjadi ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Terlalu kecil: diharapkan ${t.origin} memiliki ${r}${t.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${t.origin} menjadi ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`String tidak valid: harus dimulai dengan "${r.prefix}"`:r.format==="ends_with"?`String tidak valid: harus berakhir dengan "${r.suffix}"`:r.format==="includes"?`String tidak valid: harus menyertakan "${r.includes}"`:r.format==="regex"?`String tidak valid: harus sesuai pola ${r.pattern}`:`${i[r.format]??t.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${t.keys.length>1?"s":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${t.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${t.origin}`;default:return"Input tidak valid"}}};function df(){return{localeError:w$()}}var I$=()=>{let e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"},map:{unit:"hluti",verb:"að hafa"}};function n(t){return e[t]??null}let i={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",credit_card:"kreditkortanúmer",currency_code:"gjaldmiðilskóði",iban:"IBAN",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"númer",array:"fylki"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Rangt gildi: Þú slóst inn ${s} þar sem á að vera instanceof ${t.expected}`:`Rangt gildi: Þú slóst inn ${s} þar sem á að vera ${r}`}case"invalid_value":return t.values.length===1?`Rangt gildi: gert ráð fyrir ${$(t.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Of stórt: gert er ráð fyrir að ${t.origin??"gildi"} hafi ${r}${t.maximum.toString()} ${a.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${t.origin??"gildi"} sé ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Of lítið: gert er ráð fyrir að ${t.origin} hafi ${r}${t.minimum.toString()} ${a.unit}`:`Of lítið: gert er ráð fyrir að ${t.origin} sé ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ógildur strengur: verður að byrja á "${r.prefix}"`:r.format==="ends_with"?`Ógildur strengur: verður að enda á "${r.suffix}"`:r.format==="includes"?`Ógildur strengur: verður að innihalda "${r.includes}"`:r.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${r.pattern}`:`Rangt ${i[r.format]??t.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${t.divisor}`;case"unrecognized_keys":return`Óþekkt ${t.keys.length>1?"ir lyklar":"ur lykill"}: ${v(t.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${t.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${t.origin}`;default:return"Rangt gildi"}}};function pf(){return{localeError:I$()}}var S$=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"},map:{unit:"elementi",verb:"avere"}};function n(t){return e[t]??null}let i={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",mac:"indirizzo MAC",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",credit_card:"numero di carta di credito",currency_code:"codice valuta",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Input non valido: atteso instanceof ${t.expected}, ricevuto ${s}`:`Input non valido: atteso ${r}, ricevuto ${s}`}case"invalid_value":return t.values.length===1?`Input non valido: atteso ${$(t.values[0])}`:`Opzione non valida: atteso uno tra ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Troppo grande: ${t.origin??"valore"} deve avere ${r}${t.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${t.origin??"valore"} deve essere ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Troppo piccolo: ${t.origin} deve avere ${r}${t.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${t.origin} deve essere ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Stringa non valida: deve iniziare con "${r.prefix}"`:r.format==="ends_with"?`Stringa non valida: deve terminare con "${r.suffix}"`:r.format==="includes"?`Stringa non valida: deve includere "${r.includes}"`:r.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${r.pattern}`:`Input non valido: ${i[r.format]??t.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${t.divisor}`;case"unrecognized_keys":return`Chiav${t.keys.length>1?"i":"e"} non riconosciut${t.keys.length>1?"e":"a"}: ${v(t.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${t.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${t.origin}`;default:return"Input non valido"}}};function mf(){return{localeError:S$()}}var P$=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"},map:{unit:"要素",verb:"である"}};function n(t){return e[t]??null}let i={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",mac:"MACアドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",credit_card:"クレジットカード番号",currency_code:"通貨コード",iban:"IBAN",jwt:"JWT",template_literal:"入力値"},o={nan:"NaN",number:"数値",array:"配列"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`無効な入力: instanceof ${t.expected}が期待されましたが、${s}が入力されました`:`無効な入力: ${r}が期待されましたが、${s}が入力されました`}case"invalid_value":return t.values.length===1?`無効な入力: ${$(t.values[0])}が期待されました`:`無効な選択: ${v(t.values,"、")}のいずれかである必要があります`;case"too_big":{let r=t.inclusive?"以下である":"より小さい",a=n(t.origin);return a?`大きすぎる値: ${t.origin??"値"}は${t.maximum.toString()}${a.unit??"要素"}${r}必要があります`:`大きすぎる値: ${t.origin??"値"}は${t.maximum.toString()}${r}必要があります`}case"too_small":{let r=t.inclusive?"以上である":"より大きい",a=n(t.origin);return a?`小さすぎる値: ${t.origin}は${t.minimum.toString()}${a.unit}${r}必要があります`:`小さすぎる値: ${t.origin}は${t.minimum.toString()}${r}必要があります`}case"invalid_format":{let r=t;return r.format==="starts_with"?`無効な文字列: "${r.prefix}"で始まる必要があります`:r.format==="ends_with"?`無効な文字列: "${r.suffix}"で終わる必要があります`:r.format==="includes"?`無効な文字列: "${r.includes}"を含む必要があります`:r.format==="regex"?`無効な文字列: パターン${r.pattern}に一致する必要があります`:`無効な${i[r.format]??t.format}`}case"not_multiple_of":return`無効な数値: ${t.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${t.keys.length>1?"群":""}: ${v(t.keys,"、")}`;case"invalid_key":return`${t.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${t.origin}内の無効な値`;default:return"無効な入力"}}};function ff(){return{localeError:P$()}}var T$=()=>{let e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},map:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function n(t){return e[t]??null}let i={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",mac:"MAC მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული ველი",base64url:"base64url-კოდირებული ველი",json_string:"JSON ველი",e164:"E.164 ნომერი",credit_card:"საკრედიტო ბარათის ნომერი",currency_code:"ვალუტის კოდი",iban:"IBAN",jwt:"JWT",template_literal:"შეყვანა"},o={nan:"NaN",number:"რიცხვი",string:"ველი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${t.expected}, მიღებული ${s}`:`არასწორი შეყვანა: მოსალოდნელი ${r}, მიღებული ${s}`}case"invalid_value":return t.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${$(t.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${v(t.values,"|")}-დან`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`ზედმეტად დიდი: მოსალოდნელი ${t.origin??"მნიშვნელობა"} ${a.verb} ${r}${t.maximum.toString()} ${a.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${t.origin??"მნიშვნელობა"} იყოს ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`ზედმეტად პატარა: მოსალოდნელი ${t.origin} ${a.verb} ${r}${t.minimum.toString()} ${a.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${t.origin} იყოს ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`არასწორი ველი: უნდა იწყებოდეს "${r.prefix}"-ით`:r.format==="ends_with"?`არასწორი ველი: უნდა მთავრდებოდეს "${r.suffix}"-ით`:r.format==="includes"?`არასწორი ველი: უნდა შეიცავდეს "${r.includes}"-ს`:r.format==="regex"?`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${r.pattern}`:`არასწორი ${i[r.format]??t.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${t.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${t.keys.length>1?"ები":"ი"}: ${v(t.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${t.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${t.origin}-ში`;default:return"არასწორი შეყვანა"}}};function gf(){return{localeError:T$()}}var E$=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"},map:{unit:"ធាតុ",verb:"គួរមាន"}};function n(t){return e[t]??null}let i={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",mac:"អាសយដ្ឋាន MAC",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",credit_card:"លេខប័ណ្ណឥណទាន",currency_code:"កូដរូបិយប័ណ្ណ",iban:"IBAN",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},o={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${t.expected} ប៉ុន្តែទទួលបាន ${s}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${r} ប៉ុន្តែទទួលបាន ${s}`}case"invalid_value":return t.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${$(t.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`ធំពេក៖ ត្រូវការ ${t.origin??"តម្លៃ"} ${r} ${t.maximum.toString()} ${a.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${t.origin??"តម្លៃ"} ${r} ${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`តូចពេក៖ ត្រូវការ ${t.origin} ${r} ${t.minimum.toString()} ${a.unit}`:`តូចពេក៖ ត្រូវការ ${t.origin} ${r} ${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${r.prefix}"`:r.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${r.suffix}"`:r.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${r.includes}"`:r.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${r.pattern}`:`មិនត្រឹមត្រូវ៖ ${i[r.format]??t.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${t.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${v(t.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${t.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${t.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function Xi(){return{localeError:E$()}}function hf(){return Xi()}var A$=()=>{let e={string:{unit:"ಅಕ್ಷರಗಳು",verb:"ಹೊಂದಲು"},file:{unit:"ಬೈಟ್‌ಗಳು",verb:"ಹೊಂದಲು"},array:{unit:"ವಸ್ತುಗಳು",verb:"ಹೊಂದಲು"},set:{unit:"ವಸ್ತುಗಳು",verb:"ಹೊಂದಲು"},map:{unit:"entries",verb:"ಹೊಂದಲು"}};function n(t){return e[t]??null}let i={regex:"ಇನ್ಪುಟ್",email:"email ವಿಳಾಸ",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ದಿನಾಂಕದ ಸಮಯ",date:"ISO ದಿನಾಂಕ",time:"ISO ಸಮಯ",duration:"ISO ಅವಧಿ",ipv4:"IPv4 ವಿಳಾಸ",ipv6:"IPv6 ವಿಳಾಸ",mac:"MAC ವಿಳಾಸ",cidrv4:"IPv4 ವ್ಯಾಪ್ತಿಯ",cidrv6:"IPv6 ವ್ಯಾಪ್ತಿಯ",base64:"base64-encodedಸ್ಟ್ರಿಂಗ್",base64url:"base64url-encodedಸ್ಟ್ರಿಂಗ್",json_string:"JSONಸ್ಟ್ರಿಂಗ್",e164:"E.164 ಸಂಖ್ಯೆ",credit_card:"ಕ್ರೆಡಿಟ್ ಕಾರ್ಡ್ ಸಂಖ್ಯೆ",currency_code:"ಕರೆನ್ಸಿ ಕೋಡ್",iban:"IBAN",jwt:"JWT",template_literal:"ಇನ್ಪುಟ್"},o={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return`ಅಮಾನ್ಯ ಇನ್‌ಪುಟ್: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${r}, ಸ್ವೀಕರಿಸಿದನು ${s}`}case"invalid_value":return t.values.length===1?`ಅಮಾನ್ಯ ಇನ್‌ಪುಟ್: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${$(t.values[0])}`:`ಅಮಾನ್ಯ ಆಯ್ಕೆ: ಇವುಗಳಲ್ಲಿ ಒಂದನ್ನು ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`ತುಂಬಾ ದೊಡ್ಡದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${t.origin??"value"} ಹೊಂದಲು ${r}${t.maximum.toString()} ${a.unit??"ಅಂಶಗಳು"}`:`ತುಂಬಾ ದೊಡ್ಡದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${t.origin??"value"} ಎಂದು ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`ತುಂಬಾ ಚಿಕ್ಕದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${t.origin} ಹೊಂದಲು ${r}${t.minimum.toString()} ${a.unit}`:`ತುಂಬಾ ಚಿಕ್ಕದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${t.origin} ಎಂದು ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`ಅಮಾನ್ಯವಾದ ಸ್ಟ್ರಿಂಗ್: ಇದರೊಂದಿಗೆ ಪ್ರಾರಂಭಿಸಬೇಕು "${r.prefix}"`:r.format==="ends_with"?`ಅಮಾನ್ಯವಾದ ಸ್ಟ್ರಿಂಗ್: ಇದರೊಂದಿಗೆ ಕೊನೆಗೊಳ್ಳಬೇಕು "${r.suffix}"`:r.format==="includes"?`ಅಮಾನ್ಯ ಸ್ಟ್ರಿಂಗ್: ಒಳಗೊಂಡಿರಬೇಕು "${r.includes}"`:r.format==="regex"?`ಅಮಾನ್ಯವಾದ ಸ್ಟ್ರಿಂಗ್: ಮಾದರಿಗೆ ಹೊಂದಿಕೆಯಾಗಬೇಕು ${r.pattern}`:`ಅಮಾನ್ಯ ${i[r.format]??t.format}`}case"not_multiple_of":return`ಅಮಾನ್ಯ ಸಂಖ್ಯೆ: ಬಹುಸಂಖ್ಯೆಯಾಗಿರಬೇಕು ${t.divisor}`;case"unrecognized_keys":return`ಗುರುತಿಸಲಾಗದ ಕೀ ${t.keys.length>1?"s":""}: ${v(t.keys,", ")}`;case"invalid_key":return`ಅಮಾನ್ಯವಾದ ಕೀ ಇನ್ ${t.origin}`;case"invalid_union":return t.options&&Array.isArray(t.options)&&t.options.length>0?`ಅಮಾನ್ಯ ತಾರತಮ್ಯ ಮೌಲ್ಯ. ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${t.options.map(a=>`'${a}'`).join(" | ")}`:"ಅಮಾನ್ಯ ಇನ್‌ಪುಟ್";case"invalid_element":return`ರಲ್ಲಿ ಅಮಾನ್ಯ ಮೌಲ್ಯ ${t.origin}`;default:return"ಅಮಾನ್ಯ ಇನ್‌ಪುಟ್"}}};function vf(){return{localeError:A$()}}var O$=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"},map:{unit:"개",verb:"to have"}};function n(t){return e[t]??null}let i={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",mac:"MAC 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",credit_card:"신용카드 번호",currency_code:"통화 코드",iban:"IBAN",jwt:"JWT",template_literal:"입력"},o={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`잘못된 입력: 예상 타입은 instanceof ${t.expected}, 받은 타입은 ${s}입니다`:`잘못된 입력: 예상 타입은 ${r}, 받은 타입은 ${s}입니다`}case"invalid_value":return t.values.length===1?`잘못된 입력: 값은 ${$(t.values[0])} 이어야 합니다`:`잘못된 옵션: ${v(t.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let r=t.inclusive?"이하":"미만",a=r==="미만"?"이어야 합니다":"여야 합니다",s=n(t.origin),u=s?.unit??"요소";return s?`${t.origin??"값"}이 너무 큽니다: ${t.maximum.toString()}${u} ${r}${a}`:`${t.origin??"값"}이 너무 큽니다: ${t.maximum.toString()} ${r}${a}`}case"too_small":{let r=t.inclusive?"이상":"초과",a=r==="이상"?"이어야 합니다":"여야 합니다",s=n(t.origin),u=s?.unit??"요소";return s?`${t.origin??"값"}이 너무 작습니다: ${t.minimum.toString()}${u} ${r}${a}`:`${t.origin??"값"}이 너무 작습니다: ${t.minimum.toString()} ${r}${a}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`잘못된 문자열: "${r.prefix}"(으)로 시작해야 합니다`:r.format==="ends_with"?`잘못된 문자열: "${r.suffix}"(으)로 끝나야 합니다`:r.format==="includes"?`잘못된 문자열: "${r.includes}"을(를) 포함해야 합니다`:r.format==="regex"?`잘못된 문자열: 정규식 ${r.pattern} 패턴과 일치해야 합니다`:`잘못된 ${i[r.format]??t.format}`}case"not_multiple_of":return`잘못된 숫자: ${t.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${v(t.keys,", ")}`;case"invalid_key":return`잘못된 키: ${t.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${t.origin}`;default:return"잘못된 입력"}}};function yf(){return{localeError:O$()}}var br=e=>e.charAt(0).toUpperCase()+e.slice(1);function bf(e){let n=Math.abs(e),i=n%10,o=n%100;return o>=11&&o<=19||i===0?"many":i===1?"one":"few"}var N$=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function n(t,r,a,s){let u=e[t]??null;return u===null?u:{unit:u.unit[r],verb:u.verb[s][a?"inclusive":"notInclusive"]}}let i={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",mac:"MAC adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",credit_card:"kredito kortelės numeris",currency_code:"valiutos kodas",iban:"IBAN",jwt:"JWT",template_literal:"įvestis"},o={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Gautas tipas ${s}, o tikėtasi - instanceof ${t.expected}`:`Gautas tipas ${s}, o tikėtasi - ${r}`}case"invalid_value":return t.values.length===1?`Privalo būti ${$(t.values[0])}`:`Privalo būti vienas iš ${v(t.values,"|")} pasirinkimų`;case"too_big":{let r=o[t.origin]??t.origin,a=n(t.origin,bf(Number(t.maximum)),t.inclusive??!1,"smaller");if(a?.verb)return`${br(r??t.origin??"reikšmė")} ${a.verb} ${t.maximum.toString()} ${a.unit??"elementų"}`;let s=t.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${br(r??t.origin??"reikšmė")} turi būti ${s} ${t.maximum.toString()} ${a?.unit}`}case"too_small":{let r=o[t.origin]??t.origin,a=n(t.origin,bf(Number(t.minimum)),t.inclusive??!1,"bigger");if(a?.verb)return`${br(r??t.origin??"reikšmė")} ${a.verb} ${t.minimum.toString()} ${a.unit??"elementų"}`;let s=t.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${br(r??t.origin??"reikšmė")} turi būti ${s} ${t.minimum.toString()} ${a?.unit}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Eilutė privalo prasidėti "${r.prefix}"`:r.format==="ends_with"?`Eilutė privalo pasibaigti "${r.suffix}"`:r.format==="includes"?`Eilutė privalo įtraukti "${r.includes}"`:r.format==="regex"?`Eilutė privalo atitikti ${r.pattern}`:`Neteisingas ${i[r.format]??t.format}`}case"not_multiple_of":return`Skaičius privalo būti ${t.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${t.keys.length>1?"i":"as"} rakt${t.keys.length>1?"ai":"as"}: ${v(t.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let r=o[t.origin]??t.origin;return`${br(r??t.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function _f(){return{localeError:N$()}}var z$=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"},map:{unit:"ставки",verb:"да имаат"}};function n(t){return e[t]??null}let i={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",mac:"MAC адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",credit_card:"број на кредитна картичка",currency_code:"код на валута",iban:"IBAN",jwt:"JWT",template_literal:"внес"},o={nan:"NaN",number:"број",array:"низа"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Грешен внес: се очекува instanceof ${t.expected}, примено ${s}`:`Грешен внес: се очекува ${r}, примено ${s}`}case"invalid_value":return t.values.length===1?`Invalid input: expected ${$(t.values[0])}`:`Грешана опција: се очекува една ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Премногу голем: се очекува ${t.origin??"вредноста"} да има ${r}${t.maximum.toString()} ${a.unit??"елементи"}`:`Премногу голем: се очекува ${t.origin??"вредноста"} да биде ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Премногу мал: се очекува ${t.origin} да има ${r}${t.minimum.toString()} ${a.unit}`:`Премногу мал: се очекува ${t.origin} да биде ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Неважечка низа: мора да започнува со "${r.prefix}"`:r.format==="ends_with"?`Неважечка низа: мора да завршува со "${r.suffix}"`:r.format==="includes"?`Неважечка низа: мора да вклучува "${r.includes}"`:r.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${r.pattern}`:`Invalid ${i[r.format]??t.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${v(t.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${t.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${t.origin}`;default:return"Грешен внес"}}};function $f(){return{localeError:z$()}}var D$=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"},map:{unit:"elemen",verb:"mempunyai"}};function n(t){return e[t]??null}let i={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",mac:"alamat MAC",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",credit_card:"nombor kad kredit",currency_code:"kod mata wang",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Input tidak sah: dijangka instanceof ${t.expected}, diterima ${s}`:`Input tidak sah: dijangka ${r}, diterima ${s}`}case"invalid_value":return t.values.length===1?`Input tidak sah: dijangka ${$(t.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Terlalu besar: dijangka ${t.origin??"nilai"} ${a.verb} ${r}${t.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${t.origin??"nilai"} adalah ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Terlalu kecil: dijangka ${t.origin} ${a.verb} ${r}${t.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${t.origin} adalah ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`String tidak sah: mesti bermula dengan "${r.prefix}"`:r.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${r.suffix}"`:r.format==="includes"?`String tidak sah: mesti mengandungi "${r.includes}"`:r.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${r.pattern}`:`${i[r.format]??t.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${v(t.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${t.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${t.origin}`;default:return"Input tidak sah"}}};function kf(){return{localeError:D$()}}var C$=()=>{let e={string:{unit:"अक्षर",verb:"हुनुपर्छ"},file:{unit:"बाइट",verb:"हुनुपर्छ"},array:{unit:"तत्व",verb:"हुनुपर्छ"},set:{unit:"तत्व",verb:"हुनुपर्छ"},map:{unit:"प्रविष्टि",verb:"हुनुपर्छ"}};function n(t){return e[t]??null}let i={regex:"इनपुट",email:"इमेल ठेगाना",url:"URL",emoji:"इमोजी",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO मिति र समय",date:"ISO मिति",time:"ISO समय",duration:"ISO अवधि",ipv4:"IPv4 ठेगाना",ipv6:"IPv6 ठेगाना",mac:"MAC ठेगाना",cidrv4:"IPv4 दायरा",cidrv6:"IPv6 दायरा",base64:"base64-इन्कोड गरिएको स्ट्रिङ",base64url:"base64url-इन्कोड गरिएको स्ट्रिङ",json_string:"JSON स्ट्रिङ",e164:"E.164 नम्बर",credit_card:"क्रेडिट कार्ड नम्बर",currency_code:"मुद्रा कोड",iban:"IBAN",jwt:"JWT",template_literal:"इनपुट"},o={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return`अमान्य इनपुट: अपेक्षित ${r}, प्राप्त ${s}`}case"invalid_value":return t.values.length===1?`अमान्य इनपुट: अपेक्षित ${$(t.values[0])}`:`अमान्य विकल्प: अपेक्षित मानहरू मध्ये एक ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`धेरै ठूलो: ${t.origin??"मान"} मा ${r}${t.maximum.toString()} ${a.unit} ${a.verb}`:`धेरै ठूलो: ${t.origin??"मान"} ${r}${t.maximum.toString()} हुनुपर्छ`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`धेरै सानो: ${t.origin} मा ${r}${t.minimum.toString()} ${a.unit} ${a.verb}`:`धेरै सानो: ${t.origin} ${r}${t.minimum.toString()} हुनुपर्छ`}case"invalid_format":{let r=t;return r.format==="starts_with"?`अमान्य स्ट्रिङ: "${r.prefix}" बाट सुरु हुनुपर्छ`:r.format==="ends_with"?`अमान्य स्ट्रिङ: "${r.suffix}" मा समाप्त हुनुपर्छ`:r.format==="includes"?`अमान्य स्ट्रिङ: "${r.includes}" समावेश हुनुपर्छ`:r.format==="regex"?`अमान्य स्ट्रिङ: ढाँचा ${r.pattern} सँग मेल खानुपर्छ`:`अमान्य ${i[r.format]??t.format}`}case"not_multiple_of":return`अमान्य संख्या: ${t.divisor} को गुणज हुनुपर्छ`;case"unrecognized_keys":return`अपरिचित कुञ्जी${t.keys.length>1?"हरू":""}: ${v(t.keys,", ")}`;case"invalid_key":return`अमान्य कुञ्जी: ${t.origin} मा`;case"invalid_union":return t.options&&Array.isArray(t.options)&&t.options.length>0?`अमान्य डिस्क्रिमिनेटर मान: अपेक्षित ${t.options.map(a=>`'${a}'`).join(" | ")}`:"अमान्य इनपुट";case"invalid_element":return`अमान्य मान: ${t.origin} मा`;default:return"अमान्य इनपुट"}}};function xf(){return{localeError:C$()}}var L$=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"},map:{unit:"elementen",verb:"heeft"}};function n(t){return e[t]??null}let i={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",mac:"MAC-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",credit_card:"creditcardnummer",currency_code:"valutacode",iban:"IBAN",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Ongeldige invoer: verwacht instanceof ${t.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${r}, ontving ${s}`}case"invalid_value":return t.values.length===1?`Ongeldige invoer: verwacht ${$(t.values[0])}`:`Ongeldige optie: verwacht één van ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin),s=t.origin==="date"?"laat":t.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${t.origin??"waarde"} ${r}${t.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${t.origin??"waarde"} ${r}${t.maximum.toString()} is`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin),s=t.origin==="date"?"vroeg":t.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${t.origin} ${r}${t.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${t.origin} ${r}${t.minimum.toString()} is`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ongeldige tekst: moet met "${r.prefix}" beginnen`:r.format==="ends_with"?`Ongeldige tekst: moet op "${r.suffix}" eindigen`:r.format==="includes"?`Ongeldige tekst: moet "${r.includes}" bevatten`:r.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${r.pattern}`:`Ongeldig: ${i[r.format]??t.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${t.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${t.keys.length>1?"s":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${t.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${t.origin}`;default:return"Ongeldige invoer"}}};function wf(){return{localeError:L$()}}var j$=()=>{let e={string:{unit:"teikn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"element",verb:"å innehalde"},set:{unit:"element",verb:"å innehalde"},map:{unit:"element",verb:"å innehalde"}};function n(t){return e[t]??null}let i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varigheit",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkoda streng",base64url:"base64url-enkoda streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tal",array:"liste"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Ugyldig input: forventa instanceof ${t.expected}, fekk ${s}`:`Ugyldig input: forventa ${r}, fekk ${s}`}case"invalid_value":return t.values.length===1?`Ugyldig verdi: forventa ${$(t.values[0])}`:`Ugyldig val: forventa eitt av ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`For stor(t): forventa ${t.origin??"value"} til å ha ${r}${t.maximum.toString()} ${a.unit??"element"}`:`For stor(t): forventa ${t.origin??"value"} til å ha ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`For lite(n): forventa ${t.origin} til å ha ${r}${t.minimum.toString()} ${a.unit}`:`For lite(n): forventa ${t.origin} til å ha ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ugyldig streng: må starte med "${r.prefix}"`:r.format==="ends_with"?`Ugyldig streng: må slutte med "${r.suffix}"`:r.format==="includes"?`Ugyldig streng: må innehalde "${r.includes}"`:r.format==="regex"?`Ugyldig streng: må matche mønsteret ${r.pattern}`:`Ugyldig ${i[r.format]??t.format}`}case"not_multiple_of":return`Ugyldig tal: må vere eit multiplum av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukjende nøklar":"Ukjend nøkkel"}: ${v(t.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${t.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${t.origin}`;default:return"Ugyldig input"}}};function If(){return{localeError:j$()}}var U$=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"},map:{unit:"elementer",verb:"å inneholde"}};function n(t){return e[t]??null}let i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Ugyldig input: forventet instanceof ${t.expected}, fikk ${s}`:`Ugyldig input: forventet ${r}, fikk ${s}`}case"invalid_value":return t.values.length===1?`Ugyldig verdi: forventet ${$(t.values[0])}`:`Ugyldig valg: forventet en av ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`For stor(t): forventet ${t.origin??"value"} til å ha ${r}${t.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${t.origin??"value"} til å ha ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`For lite(n): forventet ${t.origin} til å ha ${r}${t.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${t.origin} til å ha ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ugyldig streng: må starte med "${r.prefix}"`:r.format==="ends_with"?`Ugyldig streng: må ende med "${r.suffix}"`:r.format==="includes"?`Ugyldig streng: må inneholde "${r.includes}"`:r.format==="regex"?`Ugyldig streng: må matche mønsteret ${r.pattern}`:`Ugyldig ${i[r.format]??t.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${v(t.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${t.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${t.origin}`;default:return"Ugyldig input"}}};function Sf(){return{localeError:U$()}}var R$=()=>{let e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"},map:{unit:"unsur",verb:"olmalıdır"}};function n(t){return e[t]??null}let i={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",mac:"MAC nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",credit_card:"i'tibâr kartı numarası",currency_code:"para birimi kodu",iban:"IBAN",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Fâsit giren: umulan instanceof ${t.expected}, alınan ${s}`:`Fâsit giren: umulan ${r}, alınan ${s}`}case"invalid_value":return t.values.length===1?`Fâsit giren: umulan ${$(t.values[0])}`:`Fâsit tercih: mûteberler ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Fazla büyük: ${t.origin??"value"}, ${r}${t.maximum.toString()} ${a.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${t.origin??"value"}, ${r}${t.maximum.toString()} olmalıydı.`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Fazla küçük: ${t.origin}, ${r}${t.minimum.toString()} ${a.unit} sahip olmalıydı.`:`Fazla küçük: ${t.origin}, ${r}${t.minimum.toString()} olmalıydı.`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Fâsit metin: "${r.prefix}" ile başlamalı.`:r.format==="ends_with"?`Fâsit metin: "${r.suffix}" ile bitmeli.`:r.format==="includes"?`Fâsit metin: "${r.includes}" ihtivâ etmeli.`:r.format==="regex"?`Fâsit metin: ${r.pattern} nakşına uymalı.`:`Fâsit ${i[r.format]??t.format}`}case"not_multiple_of":return`Fâsit sayı: ${t.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${t.keys.length>1?"s":""}: ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${t.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function Pf(){return{localeError:R$()}}var M$=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"},map:{unit:"توکي",verb:"ولري"}};function n(t){return e[t]??null}let i={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",mac:"د MAC پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",credit_card:"د کریډیټ کارت شمیره",currency_code:"د اسعارو کوډ",iban:"IBAN",jwt:"JWT",template_literal:"ورودي"},o={nan:"NaN",number:"عدد",array:"ارې"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`ناسم ورودي: باید instanceof ${t.expected} وای, مګر ${s} ترلاسه شو`:`ناسم ورودي: باید ${r} وای, مګر ${s} ترلاسه شو`}case"invalid_value":return t.values.length===1?`ناسم ورودي: باید ${$(t.values[0])} وای`:`ناسم انتخاب: باید یو له ${v(t.values,"|")} څخه وای`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`ډیر لوی: ${t.origin??"ارزښت"} باید ${r}${t.maximum.toString()} ${a.unit??"عنصرونه"} ولري`:`ډیر لوی: ${t.origin??"ارزښت"} باید ${r}${t.maximum.toString()} وي`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`ډیر کوچنی: ${t.origin} باید ${r}${t.minimum.toString()} ${a.unit} ولري`:`ډیر کوچنی: ${t.origin} باید ${r}${t.minimum.toString()} وي`}case"invalid_format":{let r=t;return r.format==="starts_with"?`ناسم متن: باید د "${r.prefix}" سره پیل شي`:r.format==="ends_with"?`ناسم متن: باید د "${r.suffix}" سره پای ته ورسيږي`:r.format==="includes"?`ناسم متن: باید "${r.includes}" ولري`:r.format==="regex"?`ناسم متن: باید د ${r.pattern} سره مطابقت ولري`:`${i[r.format]??t.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${t.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${t.keys.length>1?"کلیډونه":"کلیډ"}: ${v(t.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${t.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${t.origin} کې`;default:return"ناسمه ورودي"}}};function Tf(){return{localeError:M$()}}var Z$=()=>{let e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"},map:{unit:"elementów",verb:"mieć"}};function n(t){return e[t]??null}let i={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",mac:"adres MAC",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",credit_card:"numer karty kredytowej",currency_code:"kod waluty",iban:"IBAN",jwt:"JWT",template_literal:"wejście"},o={nan:"NaN",number:"liczba",array:"tablica"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${t.expected}, otrzymano ${s}`:`Nieprawidłowe dane wejściowe: oczekiwano ${r}, otrzymano ${s}`}case"invalid_value":return t.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${$(t.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Za duża wartość: oczekiwano, że ${t.origin??"wartość"} będzie mieć ${r}${t.maximum.toString()} ${a.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${t.origin??"wartość"} będzie wynosić ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Za mała wartość: oczekiwano, że ${t.origin??"wartość"} będzie mieć ${r}${t.minimum.toString()} ${a.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${t.origin??"wartość"} będzie wynosić ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${r.prefix}"`:r.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${r.suffix}"`:r.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${r.includes}"`:r.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${r.pattern}`:`Nieprawidłow(y/a/e) ${i[r.format]??t.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${t.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${t.keys.length>1?"s":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${t.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${t.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function Ef(){return{localeError:Z$()}}var F$=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function n(a){return e[a]??null}let i={regex:"a entrada",email:"o endereço de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a duração ISO",ipv4:"o endereço IPv4",ipv6:"o endereço IPv6",mac:"o endereço MAC",cidrv4:"o intervalo de endereços IPv4",cidrv6:"o intervalo de endereços IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o número E.164",credit_card:"o número de cartão de crédito",currency_code:"o código de moeda",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},o={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},t={string:{name:"texto",articles:o.masculine},number:{name:"número",articles:o.masculine},int:{name:"número inteiro",articles:o.masculine},boolean:{name:"valor booleano",articles:o.masculine},bigint:{name:"número bigint",articles:o.masculine},symbol:{name:"símbolo",articles:o.masculine},undefined:{name:'valor "undefined"',articles:o.masculine},null:{name:'valor "nulo"',articles:o.masculine},never:{name:'valor "never"',articles:o.masculine},void:{name:'valor "void"',articles:o.masculine},date:{name:"data",articles:o.feminine},array:{name:"vetor",articles:o.masculine},object:{name:"objeto",articles:o.masculine},tuple:{name:"tuplo",articles:o.masculine},record:{name:"registo",articles:o.masculine},map:{name:"mapa",articles:o.masculine},set:{name:"conjunto",articles:o.masculine},file:{name:"ficheiro",articles:o.masculine},nonoptional:{name:"valor não opcional",articles:o.masculine},nan:{name:'valor "NaN"',articles:o.masculine},function:{name:"função",articles:o.feminine}};function r(a,s){let u=t[a]??{name:`valor "${a}"`,articles:o.masculine};return`${u.articles[s]} ${u.name}`}return a=>{switch(a.code){case"invalid_type":{let s=r(a.expected,"indefinite"),u=k(a.input),c=r(u,"indefinite");return`Entrada inválida: esperava ${s}, recebeu ${c}`}case"invalid_value":return a.values.length===1?`Entrada inválida: esperava ${$(a.values[0])}`:`Opção inválida: esperava uma das seguintes opções: ${v(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",u=n(a.origin);return u?`Demasiado grande: esperava que ${r(a.origin,"definite")} tivesse ${s} ${a.maximum.toString()} ${u.unit??"elementos"}`:`Demasiado grande: esperava que ${r(a.origin,"definite")} fosse ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",u=n(a.origin);return u?`Demasiado pequeno: esperava que ${r(a.origin,"definite")} tivesse ${s} ${a.minimum.toString()} ${u.unit??"elementos"}`:`Demasiado pequeno: esperava que ${r(a.origin,"definite")} fosse ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Texto inválido: deve começar por "${s.prefix}"`:s.format==="ends_with"?`Texto inválido: deve terminar em "${s.suffix}"`:s.format==="includes"?`Texto inválido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inválido: deve corresponder ao padrão ${s.pattern}`:`Formato d${i[s.format]??a.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${a.divisor}`;case"unrecognized_keys":{let s=a.keys.length>1?"s":"";return`Chave${s} inválida${s}: ${v(a.keys,", ")}`}case"invalid_key":return`Entrada inválida n${r(a.origin,"definite")}`;case"invalid_union":return a.options&&Array.isArray(a.options)&&a.options.length>0?`Valor de discriminação inválido. Esperava ${a.options.map(u=>`'${u}'`).join(" | ")}`:"Entrada inválida";case"invalid_element":return`Entrada inválida n${r(a.origin,"definite")}`;default:return"Entrada inválida"}}};function Af(){return{localeError:F$()}}var V$=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function n(a){return e[a]??null}let i={regex:"a entrada",email:"o endereço de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a duração ISO",ipv4:"o endereço IPv4",ipv6:"o endereço IPv6",mac:"o endereço MAC",cidrv4:"a faixa de endereços IPv4",cidrv6:"a faixa de endereços IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o número E.164",credit_card:"o número de cartão de crédito",currency_code:"o código de moeda",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},o={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},t={string:{name:"texto",articles:o.masculine},number:{name:"número",articles:o.masculine},int:{name:"número inteiro",articles:o.masculine},boolean:{name:"valor booleano",articles:o.masculine},bigint:{name:"número bigint",articles:o.masculine},symbol:{name:"símbolo",articles:o.masculine},undefined:{name:'valor "undefined"',articles:o.masculine},null:{name:'valor "nulo"',articles:o.masculine},never:{name:'valor "never"',articles:o.masculine},void:{name:'valor "void"',articles:o.masculine},date:{name:"data",articles:o.feminine},array:{name:"vetor",articles:o.masculine},object:{name:"objeto",articles:o.masculine},tuple:{name:"tupla",articles:o.feminine},record:{name:"registro",articles:o.masculine},map:{name:"mapa",articles:o.masculine},set:{name:"conjunto",articles:o.masculine},file:{name:"arquivo",articles:o.masculine},nonoptional:{name:"valor não opcional",articles:o.masculine},nan:{name:'valor "NaN"',articles:o.masculine},function:{name:"função",articles:o.feminine}};function r(a,s){let u=t[a]??{name:`valor "${a}"`,articles:o.masculine};return`${u.articles[s]} ${u.name}`}return a=>{switch(a.code){case"invalid_type":{let s=r(a.expected,"indefinite"),u=k(a.input),c=r(u,"indefinite");return`Entrada inválida: esperava ${s}, recebeu ${c}`}case"invalid_value":return a.values.length===1?`Entrada inválida: esperava ${$(a.values[0])}`:`Opção inválida: esperava uma das seguintes opções: ${v(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",u=n(a.origin);return u?`Grande demais: esperava que ${r(a.origin,"definite")} tivesse ${s} ${a.maximum.toString()} ${u.unit??"elementos"}`:`Grande demais: esperava que ${r(a.origin,"definite")} fosse ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",u=n(a.origin);return u?`Pequeno demais: esperava que ${r(a.origin,"definite")} tivesse ${s} ${a.minimum.toString()} ${u.unit??"elementos"}`:`Pequeno demais: esperava que ${r(a.origin,"definite")} fosse ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Texto inválido: deve começar com "${s.prefix}"`:s.format==="ends_with"?`Texto inválido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inválido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inválido: deve corresponder ao padrão ${s.pattern}`:`Formato d${i[s.format]??a.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${a.divisor}`;case"unrecognized_keys":{let s=a.keys.length>1?"s":"";return`Chave${s} inválida${s}: ${v(a.keys,", ")}`}case"invalid_key":return`Entrada inválida n${r(a.origin,"definite")}`;case"invalid_union":return a.options&&Array.isArray(a.options)&&a.options.length>0?`Valor de discriminação inválido. Esperava ${a.options.map(u=>`'${u}'`).join(" | ")}`:"Entrada inválida";case"invalid_element":return`Entrada inválida n${r(a.origin,"definite")}`;default:return"Entrada inválida"}}};function Of(){return{localeError:V$()}}var G$=()=>{let e={string:{unit:"caractere",verb:"să aibă"},file:{unit:"octeți",verb:"să aibă"},array:{unit:"elemente",verb:"să aibă"},set:{unit:"elemente",verb:"să aibă"},map:{unit:"intrări",verb:"să aibă"}};function n(t){return e[t]??null}let i={regex:"intrare",email:"adresă de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dată și oră ISO",date:"dată ISO",time:"oră ISO",duration:"durată ISO",ipv4:"adresă IPv4",ipv6:"adresă IPv6",mac:"adresă MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"șir codat base64",base64url:"șir codat base64url",json_string:"șir JSON",e164:"număr E.164",credit_card:"număr de card de credit",currency_code:"cod valutar",iban:"IBAN",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"șir",number:"număr",boolean:"boolean",function:"funcție",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"număr mare",void:"void",never:"never",map:"hartă",set:"set"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return`Intrare invalidă: așteptat ${r}, primit ${s}`}case"invalid_value":return t.values.length===1?`Intrare invalidă: așteptat ${$(t.values[0])}`:`Opțiune invalidă: așteptat una dintre ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Prea mare: așteptat ca ${t.origin??"valoarea"} ${a.verb} ${r}${t.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: așteptat ca ${t.origin??"valoarea"} să fie ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Prea mic: așteptat ca ${t.origin} ${a.verb} ${r}${t.minimum.toString()} ${a.unit}`:`Prea mic: așteptat ca ${t.origin} să fie ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Șir invalid: trebuie să înceapă cu "${r.prefix}"`:r.format==="ends_with"?`Șir invalid: trebuie să se termine cu "${r.suffix}"`:r.format==="includes"?`Șir invalid: trebuie să includă "${r.includes}"`:r.format==="regex"?`Șir invalid: trebuie să se potrivească cu modelul ${r.pattern}`:`Format invalid: ${i[r.format]??t.format}`}case"not_multiple_of":return`Număr invalid: trebuie să fie multiplu de ${t.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${v(t.keys,", ")}`;case"invalid_key":return`Cheie invalidă în ${t.origin}`;case"invalid_union":return"Intrare invalidă";case"invalid_element":return`Valoare invalidă în ${t.origin}`;default:return"Intrare invalidă"}}};function Nf(){return{localeError:G$()}}function zf(e,n,i,o){let t=Math.abs(e),r=t%10,a=t%100;return a>=11&&a<=19?o:r===1?n:r>=2&&r<=4?i:o}var B$=()=>{let e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},map:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function n(t){return e[t]??null}let i={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",mac:"MAC адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",credit_card:"номер кредитной карты",currency_code:"код валюты",iban:"IBAN",jwt:"JWT",template_literal:"ввод"},o={nan:"NaN",number:"число",array:"массив"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Неверный ввод: ожидалось instanceof ${t.expected}, получено ${s}`:`Неверный ввод: ожидалось ${r}, получено ${s}`}case"invalid_value":return t.values.length===1?`Неверный ввод: ожидалось ${$(t.values[0])}`:`Неверный вариант: ожидалось одно из ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);if(a){let s=Number(t.maximum),u=zf(s,a.unit.one,a.unit.few,a.unit.many);return`Слишком большое значение: ожидалось, что ${t.origin??"значение"} будет иметь ${r}${t.maximum.toString()} ${u}`}return`Слишком большое значение: ожидалось, что ${t.origin??"значение"} будет ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);if(a){let s=Number(t.minimum),u=zf(s,a.unit.one,a.unit.few,a.unit.many);return`Слишком маленькое значение: ожидалось, что ${t.origin} будет иметь ${r}${t.minimum.toString()} ${u}`}return`Слишком маленькое значение: ожидалось, что ${t.origin} будет ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Неверная строка: должна начинаться с "${r.prefix}"`:r.format==="ends_with"?`Неверная строка: должна заканчиваться на "${r.suffix}"`:r.format==="includes"?`Неверная строка: должна содержать "${r.includes}"`:r.format==="regex"?`Неверная строка: должна соответствовать шаблону ${r.pattern}`:`Неверный ${i[r.format]??t.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${t.divisor}`;case"unrecognized_keys":return`Нераспознанн${t.keys.length>1?"ые":"ый"} ключ${t.keys.length>1?"и":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${t.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${t.origin}`;default:return"Неверные входные данные"}}};function Df(){return{localeError:B$()}}var H$=()=>{let e={string:{unit:"znakov",verb:"mať"},file:{unit:"bajtov",verb:"mať"},array:{unit:"prvkov",verb:"mať"},set:{unit:"prvkov",verb:"mať"},map:{unit:"položiek",verb:"mať"}};function n(t){return e[t]??null}let i={regex:"regulárny výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dátum a čas vo formáte ISO",date:"dátum vo formáte ISO",time:"čas vo formáte ISO",duration:"doba trvania ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"reťazec zakódovaný vo formáte base64",base64url:"reťazec zakódovaný vo formáte base64url",json_string:"reťazec vo formáte JSON",e164:"číslo E.164",credit_card:"číslo kreditnej karty",currency_code:"kód meny",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"číslo",string:"reťazec",function:"funkcia",array:"pole"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Neplatný vstup: očakávané instanceof ${t.expected}, obdržané ${s}`:`Neplatný vstup: očakávané ${r}, obdržané ${s}`}case"invalid_value":return t.values.length===1?`Neplatný vstup: očakávané ${$(t.values[0])}`:`Neplatný vstup: očakávaná jedna z hodnôt ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Hodnota je príliš veľká: ${t.origin??"hodnota"} musí mať ${r}${t.maximum.toString()} ${a.unit??"prvkov"}`:`Hodnota je príliš veľká: ${t.origin??"hodnota"} musí byť ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Hodnota je príliš malá: ${t.origin??"hodnota"} musí mať ${r}${t.minimum.toString()} ${a.unit??"prvkov"}`:`Hodnota je príliš malá: ${t.origin??"hodnota"} musí byť ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Neplatný reťazec: musí začínať na "${r.prefix}"`:r.format==="ends_with"?`Neplatný reťazec: musí končiť na "${r.suffix}"`:r.format==="includes"?`Neplatný reťazec: musí obsahovať "${r.includes}"`:r.format==="regex"?`Neplatný reťazec: musí zodpovedať vzoru ${r.pattern}`:`Neplatný formát ${i[r.format]??t.format}`}case"not_multiple_of":return`Neplatné číslo: musí byť násobkom ${t.divisor}`;case"unrecognized_keys":return`Neznáme klúče: ${v(t.keys,", ")}`;case"invalid_key":return`Neplatný klúč v ${t.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${t.origin}`;default:return"Neplatný vstup"}}};function Cf(){return{localeError:H$()}}var W$=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"},map:{unit:"elementov",verb:"imeti"}};function n(t){return e[t]??null}let i={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",mac:"MAC naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",credit_card:"številka kreditne kartice",currency_code:"koda valute",iban:"IBAN",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"število",array:"tabela"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Neveljaven vnos: pričakovano instanceof ${t.expected}, prejeto ${s}`:`Neveljaven vnos: pričakovano ${r}, prejeto ${s}`}case"invalid_value":return t.values.length===1?`Neveljaven vnos: pričakovano ${$(t.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Preveliko: pričakovano, da bo ${t.origin??"vrednost"} imelo ${r}${t.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${t.origin??"vrednost"} ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Premajhno: pričakovano, da bo ${t.origin} imelo ${r}${t.minimum.toString()} ${a.unit}`:`Premajhno: pričakovano, da bo ${t.origin} ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Neveljaven niz: mora se začeti z "${r.prefix}"`:r.format==="ends_with"?`Neveljaven niz: mora se končati z "${r.suffix}"`:r.format==="includes"?`Neveljaven niz: mora vsebovati "${r.includes}"`:r.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${r.pattern}`:`Neveljaven ${i[r.format]??t.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${t.divisor}`;case"unrecognized_keys":return`Neprepoznan${t.keys.length>1?"i ključi":" ključ"}: ${v(t.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${t.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${t.origin}`;default:return"Neveljaven vnos"}}};function Lf(){return{localeError:W$()}}var K$=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"},map:{unit:"objekt",verb:"att innehålla"}};function n(t){return e[t]??null}let i={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-adress",ipv6:"IPv6-adress",mac:"MAC-adress",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",credit_card:"kreditkortsnummer",currency_code:"valutakod",iban:"IBAN",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Ogiltig inmatning: förväntat instanceof ${t.expected}, fick ${s}`:`Ogiltig inmatning: förväntat ${r}, fick ${s}`}case"invalid_value":return t.values.length===1?`Ogiltig inmatning: förväntat ${$(t.values[0])}`:`Ogiltigt val: förväntade en av ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`För stor(t): förväntade ${t.origin??"värdet"} att ha ${r}${t.maximum.toString()} ${a.unit??"element"}`:`För stor(t): förväntat ${t.origin??"värdet"} att ha ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`För lite(t): förväntade ${t.origin??"värdet"} att ha ${r}${t.minimum.toString()} ${a.unit}`:`För lite(t): förväntade ${t.origin??"värdet"} att ha ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ogiltig sträng: måste börja med "${r.prefix}"`:r.format==="ends_with"?`Ogiltig sträng: måste sluta med "${r.suffix}"`:r.format==="includes"?`Ogiltig sträng: måste innehålla "${r.includes}"`:r.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${r.pattern}"`:`Ogiltig(t) ${i[r.format]??t.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${v(t.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${t.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${t.origin??"värdet"}`;default:return"Ogiltig input"}}};function jf(){return{localeError:K$()}}var J$=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},map:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function n(t){return e[t]??null}let i={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",mac:"MAC முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",credit_card:"கடன் அட்டை எண்",currency_code:"நாணயக் குறியீடு",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${t.expected}, பெறப்பட்டது ${s}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${r}, பெறப்பட்டது ${s}`}case"invalid_value":return t.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${$(t.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${v(t.values,"|")} இல் ஒன்று`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${t.origin??"மதிப்பு"} ${r}${t.maximum.toString()} ${a.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${t.origin??"மதிப்பு"} ${r}${t.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${t.origin} ${r}${t.minimum.toString()} ${a.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${t.origin} ${r}${t.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let r=t;return r.format==="starts_with"?`தவறான சரம்: "${r.prefix}" இல் தொடங்க வேண்டும்`:r.format==="ends_with"?`தவறான சரம்: "${r.suffix}" இல் முடிவடைய வேண்டும்`:r.format==="includes"?`தவறான சரம்: "${r.includes}" ஐ உள்ளடக்க வேண்டும்`:r.format==="regex"?`தவறான சரம்: ${r.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${i[r.format]??t.format}`}case"not_multiple_of":return`தவறான எண்: ${t.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${t.keys.length>1?"கள்":""}: ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${t.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function Uf(){return{localeError:J$()}}var X$=()=>{let e={string:{unit:"аломат",verb:"дошта бошад"},file:{unit:"байт",verb:"дошта бошад"},array:{unit:"унсур",verb:"дошта бошад"},set:{unit:"унсур",verb:"дошта бошад"},map:{unit:"сабт",verb:"дошта бошад"}};function n(t){return e[t]??null}let i={regex:"вуруд",email:"суроғаи email",url:"URL",emoji:"эмоҷи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"санаву вақти ISO",date:"санаи ISO",time:"вақти ISO",duration:"давомнокии ISO",ipv4:"суроғаи IPv4",ipv6:"суроғаи IPv6",mac:"суроғаи MAC",cidrv4:"маҳдудаи IPv4",cidrv6:"маҳдудаи IPv6",base64:"сатри дар формати base64",base64url:"сатри дар формати base64url",json_string:"сатри JSON",e164:"рақами E.164",credit_card:"рақами корти кредитӣ",currency_code:"рамзи асъор",iban:"IBAN",jwt:"JWT",template_literal:"вуруд"},o={nan:"NaN",number:"рақам",string:"сатр",array:"массив",object:"объект",date:"сана"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return`Вуруди нодуруст: ${r} интизор мерафт, ${s} гирифта шуд`}case"invalid_value":return t.values.length===1?`Вуруди нодуруст: ${$(t.values[0])} интизор мерафт`:`Интихоби нодуруст: яке аз ${v(t.values,"|")} интизор мерафт`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Хеле калон: ${t.origin??"қимат"} бояд ${r}${t.maximum.toString()} ${a.unit} ${a.verb}`:`Хеле калон: ${t.origin??"қимат"} бояд ${r}${t.maximum.toString()} бошад`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Хеле хурд: ${t.origin} бояд ${r}${t.minimum.toString()} ${a.unit} ${a.verb}`:`Хеле хурд: ${t.origin} бояд ${r}${t.minimum.toString()} бошад`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Сатри нодуруст: бояд бо "${r.prefix}" оғоз шавад`:r.format==="ends_with"?`Сатри нодуруст: бояд бо "${r.suffix}" анҷом ёбад`:r.format==="includes"?`Сатри нодуруст: бояд "${r.includes}"-ро дар бар гирад`:r.format==="regex"?`Сатри нодуруст: бояд ба намунаи ${r.pattern} мувофиқат кунад`:`${i[r.format]??t.format}-и нодуруст`}case"not_multiple_of":return`Рақами нодуруст: бояд ба ${t.divisor} бе бақия тақсим шавад`;case"unrecognized_keys":return`Калид${t.keys.length>1?"ҳои":"и"} номаълум: ${v(t.keys,", ")}`;case"invalid_key":return`Калиди нодуруст дар ${t.origin}`;case"invalid_union":return t.options&&Array.isArray(t.options)&&t.options.length>0?`Қимати нодурусти дискриминатор: ${t.options.map(a=>`'${a}'`).join(" | ")} интизор мерафт`:"Вуруди нодуруст";case"invalid_element":return`Қимати нодуруст дар ${t.origin}`;default:return"Вуруди нодуруст"}}};function Rf(){return{localeError:X$()}}var q$=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"},map:{unit:"รายการ",verb:"ควรมี"}};function n(t){return e[t]??null}let i={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",mac:"ที่อยู่ MAC",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",credit_card:"หมายเลขบัตรเครดิต",currency_code:"รหัสสกุลเงิน",iban:"IBAN",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},o={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${t.expected} แต่ได้รับ ${s}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${r} แต่ได้รับ ${s}`}case"invalid_value":return t.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${$(t.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"ไม่เกิน":"น้อยกว่า",a=n(t.origin);return a?`เกินกำหนด: ${t.origin??"ค่า"} ควรมี${r} ${t.maximum.toString()} ${a.unit??"รายการ"}`:`เกินกำหนด: ${t.origin??"ค่า"} ควรมี${r} ${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?"อย่างน้อย":"มากกว่า",a=n(t.origin);return a?`น้อยกว่ากำหนด: ${t.origin} ควรมี${r} ${t.minimum.toString()} ${a.unit}`:`น้อยกว่ากำหนด: ${t.origin} ควรมี${r} ${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${r.prefix}"`:r.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${r.suffix}"`:r.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${r.includes}" อยู่ในข้อความ`:r.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${r.pattern}`:`รูปแบบไม่ถูกต้อง: ${i[r.format]??t.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${t.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${v(t.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${t.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${t.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function Mf(){return{localeError:q$()}}var Y$=()=>{let e={string:{unit:"simwol",verb:"bolmaly"},file:{unit:"baýt",verb:"bolmaly"},array:{unit:"elementler",verb:"bolmaly"},set:{unit:"elementler",verb:"bolmaly"},map:{unit:"elementler",verb:"bolmaly"}};function n(t){return e[t]??null}let i={regex:"giriş",email:"e-poçta salgysy",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sene we wagt",date:"ISO sene",time:"ISO wagt",duration:"ISO wagt aralygy",ipv4:"IPv4 salgysy",ipv6:"IPv6 salgysy",mac:"MAC salgysy",cidrv4:"IPv4 aralygy",cidrv6:"IPv6 aralygy",base64:"base64 bilen şifrlenen setir",base64url:"base64url bilen şifrlenen setir",json_string:"JSON setiri",e164:"E.164 nomeri",credit_card:"kredit kartynyň nomeri",currency_code:"walýuta kody",iban:"IBAN",jwt:"JWT",template_literal:"şablon"},o={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return`Nädogry baha: garaşylan ${r} ýerine ${s} alyndy`}case"invalid_value":return t.values.length===1?`Nädogry baha: ${$(t.values[0])} bolmaly`:`Nädogry saýlaw: aşakdakylardan biri bolmaly: ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Has uly: garaşylýan ${t.origin??"baha"} ${r} ${t.maximum.toString()} ${a.unit??"element"}`:`Has uly: garaşylýan ${t.origin??"baha"} ${r} ${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Has kiçi: garaşylýan ${t.origin} ${r} ${t.minimum.toString()} ${a.unit}`:`Has kiçi: garaşylýan ${t.origin} ${r} ${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Nädogry setir: "${r.prefix}" bilen başlamaly`:r.format==="ends_with"?`Nädogry setir: "${r.suffix}" bilen gutarmaly`:r.format==="includes"?`Nädogry setir: "${r.includes}" saklamaly`:r.format==="regex"?`Nädogry setir: ${r.pattern} nusga laýyk bolmaly`:`Nädogry ${i[r.format]??t.format}`}case"not_multiple_of":return`Nädogry san: ${t.divisor} bilen galyndysyz bölünmeli`;case"unrecognized_keys":return`Tanalmaýan açar${t.keys.length>1?"lar":""}: ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} içinde nädogry açar`;case"invalid_union":return"Nädogry baha";case"invalid_element":return`${t.origin} içinde nädogry baha`;default:return"Nädogry baha"}}};function Zf(){return{localeError:Y$()}}var Q$=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"},map:{unit:"öğe",verb:"olmalı"}};function n(t){return e[t]??null}let i={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",mac:"MAC adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",credit_card:"kredi kartı numarası",currency_code:"para birimi kodu",iban:"IBAN",jwt:"JWT",template_literal:"Şablon dizesi"},o={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Geçersiz değer: beklenen instanceof ${t.expected}, alınan ${s}`:`Geçersiz değer: beklenen ${r}, alınan ${s}`}case"invalid_value":return t.values.length===1?`Geçersiz değer: beklenen ${$(t.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Çok büyük: beklenen ${t.origin??"değer"} ${r}${t.maximum.toString()} ${a.unit??"öğe"}`:`Çok büyük: beklenen ${t.origin??"değer"} ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Çok küçük: beklenen ${t.origin} ${r}${t.minimum.toString()} ${a.unit}`:`Çok küçük: beklenen ${t.origin} ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Geçersiz metin: "${r.prefix}" ile başlamalı`:r.format==="ends_with"?`Geçersiz metin: "${r.suffix}" ile bitmeli`:r.format==="includes"?`Geçersiz metin: "${r.includes}" içermeli`:r.format==="regex"?`Geçersiz metin: ${r.pattern} desenine uymalı`:`Geçersiz ${i[r.format]??t.format}`}case"not_multiple_of":return`Geçersiz sayı: ${t.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${t.keys.length>1?"lar":""}: ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${t.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function Ff(){return{localeError:Q$()}}var ek=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"},map:{unit:"елементів",verb:"матиме"}};function n(t){return e[t]??null}let i={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",mac:"адреса MAC",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",credit_card:"номер кредитної картки",currency_code:"код валюти",iban:"IBAN",jwt:"JWT",template_literal:"вхідні дані"},o={nan:"NaN",number:"число",array:"масив"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Неправильні вхідні дані: очікується instanceof ${t.expected}, отримано ${s}`:`Неправильні вхідні дані: очікується ${r}, отримано ${s}`}case"invalid_value":return t.values.length===1?`Неправильні вхідні дані: очікується ${$(t.values[0])}`:`Неправильна опція: очікується одне з ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Занадто велике: очікується, що ${t.origin??"значення"} ${a.verb} ${r}${t.maximum.toString()} ${a.unit??"елементів"}`:`Занадто велике: очікується, що ${t.origin??"значення"} буде ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Занадто мале: очікується, що ${t.origin} ${a.verb} ${r}${t.minimum.toString()} ${a.unit}`:`Занадто мале: очікується, що ${t.origin} буде ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Неправильний рядок: повинен починатися з "${r.prefix}"`:r.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${r.suffix}"`:r.format==="includes"?`Неправильний рядок: повинен містити "${r.includes}"`:r.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${r.pattern}`:`Неправильний ${i[r.format]??t.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${t.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${t.keys.length>1?"і":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${t.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${t.origin}`;default:return"Неправильні вхідні дані"}}};function qi(){return{localeError:ek()}}function Vf(){return qi()}var tk=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"},map:{unit:"آئٹمز",verb:"ہونا"}};function n(t){return e[t]??null}let i={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",mac:"ایم اے سی ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",credit_card:"کریڈٹ کارڈ نمبر",currency_code:"کرنسی کوڈ",iban:"IBAN",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},o={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`غلط ان پٹ: instanceof ${t.expected} متوقع تھا، ${s} موصول ہوا`:`غلط ان پٹ: ${r} متوقع تھا، ${s} موصول ہوا`}case"invalid_value":return t.values.length===1?`غلط ان پٹ: ${$(t.values[0])} متوقع تھا`:`غلط آپشن: ${v(t.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`بہت بڑا: ${t.origin??"ویلیو"} کے ${r}${t.maximum.toString()} ${a.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${t.origin??"ویلیو"} کا ${r}${t.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`بہت چھوٹا: ${t.origin} کے ${r}${t.minimum.toString()} ${a.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${t.origin} کا ${r}${t.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let r=t;return r.format==="starts_with"?`غلط سٹرنگ: "${r.prefix}" سے شروع ہونا چاہیے`:r.format==="ends_with"?`غلط سٹرنگ: "${r.suffix}" پر ختم ہونا چاہیے`:r.format==="includes"?`غلط سٹرنگ: "${r.includes}" شامل ہونا چاہیے`:r.format==="regex"?`غلط سٹرنگ: پیٹرن ${r.pattern} سے میچ ہونا چاہیے`:`غلط ${i[r.format]??t.format}`}case"not_multiple_of":return`غلط نمبر: ${t.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${t.keys.length>1?"ز":""}: ${v(t.keys,"، ")}`;case"invalid_key":return`${t.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${t.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function Gf(){return{localeError:tk()}}var nk=()=>{let e={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"},map:{unit:"yozuv",verb:"bo‘lishi kerak"}};function n(t){return e[t]??null}let i={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",credit_card:"kredit karta raqami",currency_code:"valyuta kodi",iban:"IBAN",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${t.expected}, qabul qilingan ${s}`:`Noto‘g‘ri kirish: kutilgan ${r}, qabul qilingan ${s}`}case"invalid_value":return t.values.length===1?`Noto‘g‘ri kirish: kutilgan ${$(t.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Juda katta: kutilgan ${t.origin??"qiymat"} ${r}${t.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${t.origin??"qiymat"} ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Juda kichik: kutilgan ${t.origin} ${r}${t.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${t.origin} ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Noto‘g‘ri satr: "${r.prefix}" bilan boshlanishi kerak`:r.format==="ends_with"?`Noto‘g‘ri satr: "${r.suffix}" bilan tugashi kerak`:r.format==="includes"?`Noto‘g‘ri satr: "${r.includes}" ni o‘z ichiga olishi kerak`:r.format==="regex"?`Noto‘g‘ri satr: ${r.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${i[r.format]??t.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${t.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${t.keys.length>1?"lar":""}: ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${t.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function Bf(){return{localeError:nk()}}var rk=()=>{let e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"},map:{unit:"phần tử",verb:"có"}};function n(t){return e[t]??null}let i={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",mac:"địa chỉ MAC",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",credit_card:"số thẻ tín dụng",currency_code:"mã tiền tệ",iban:"IBAN",jwt:"JWT",template_literal:"đầu vào"},o={nan:"NaN",number:"số",array:"mảng"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${t.expected}, nhận được ${s}`:`Đầu vào không hợp lệ: mong đợi ${r}, nhận được ${s}`}case"invalid_value":return t.values.length===1?`Đầu vào không hợp lệ: mong đợi ${$(t.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Quá lớn: mong đợi ${t.origin??"giá trị"} ${a.verb} ${r}${t.maximum.toString()} ${a.unit??"phần tử"}`:`Quá lớn: mong đợi ${t.origin??"giá trị"} ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Quá nhỏ: mong đợi ${t.origin} ${a.verb} ${r}${t.minimum.toString()} ${a.unit}`:`Quá nhỏ: mong đợi ${t.origin} ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${r.prefix}"`:r.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${r.suffix}"`:r.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${r.includes}"`:r.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${r.pattern}`:`${i[r.format]??t.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${t.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${v(t.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${t.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${t.origin}`;default:return"Đầu vào không hợp lệ"}}};function Hf(){return{localeError:rk()}}var ik=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"},map:{unit:"项",verb:"包含"}};function n(t){return e[t]??null}let i={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",mac:"MAC地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",credit_card:"信用卡号",currency_code:"货币代码",iban:"IBAN",jwt:"JWT",template_literal:"输入"},o={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`无效输入:期望 instanceof ${t.expected},实际接收 ${s}`:`无效输入:期望 ${r},实际接收 ${s}`}case"invalid_value":return t.values.length===1?`无效输入:期望 ${$(t.values[0])}`:`无效选项:期望以下之一 ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`数值过大:期望 ${t.origin??"值"} ${r}${t.maximum.toString()} ${a.unit??"个元素"}`:`数值过大:期望 ${t.origin??"值"} ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`数值过小:期望 ${t.origin} ${r}${t.minimum.toString()} ${a.unit}`:`数值过小:期望 ${t.origin} ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`无效字符串:必须以 "${r.prefix}" 开头`:r.format==="ends_with"?`无效字符串:必须以 "${r.suffix}" 结尾`:r.format==="includes"?`无效字符串:必须包含 "${r.includes}"`:r.format==="regex"?`无效字符串:必须满足正则表达式 ${r.pattern}`:`无效${i[r.format]??t.format}`}case"not_multiple_of":return`无效数字:必须是 ${t.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${t.origin} 中包含无效值(value)`;default:return"无效输入"}}};function Wf(){return{localeError:ik()}}var ok=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"},map:{unit:"項目",verb:"擁有"}};function n(t){return e[t]??null}let i={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",mac:"MAC 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",credit_card:"信用卡號",currency_code:"貨幣代碼",iban:"IBAN",jwt:"JWT",template_literal:"輸入"},o={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`無效的輸入值:預期為 instanceof ${t.expected},但收到 ${s}`:`無效的輸入值:預期為 ${r},但收到 ${s}`}case"invalid_value":return t.values.length===1?`無效的輸入值:預期為 ${$(t.values[0])}`:`無效的選項:預期為以下其中之一 ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`數值過大:預期 ${t.origin??"值"} 應為 ${r}${t.maximum.toString()} ${a.unit??"個元素"}`:`數值過大:預期 ${t.origin??"值"} 應為 ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`數值過小:預期 ${t.origin} 應為 ${r}${t.minimum.toString()} ${a.unit}`:`數值過小:預期 ${t.origin} 應為 ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`無效的字串:必須以 "${r.prefix}" 開頭`:r.format==="ends_with"?`無效的字串:必須以 "${r.suffix}" 結尾`:r.format==="includes"?`無效的字串:必須包含 "${r.includes}"`:r.format==="regex"?`無效的字串:必須符合格式 ${r.pattern}`:`無效的 ${i[r.format]??t.format}`}case"not_multiple_of":return`無效的數字:必須為 ${t.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${t.keys.length>1?"們":""}:${v(t.keys,"、")}`;case"invalid_key":return`${t.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${t.origin} 中有無效的值`;default:return"無效的輸入值"}}};function Kf(){return{localeError:ok()}}var ak=()=>{let e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"},map:{unit:"nkan",verb:"ní"}};function n(t){return e[t]??null}let i={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",mac:"àdírẹ́sì MAC",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",credit_card:"nọmba kaadi gbese",currency_code:"koodu owó",iban:"IBAN",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},o={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return t=>{switch(t.code){case"invalid_type":{let r=o[t.expected]??t.expected,a=k(t.input),s=o[a]??a;return/^[A-Z]/.test(t.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${t.expected}, àmọ̀ a rí ${s}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${r}, àmọ̀ a rí ${s}`}case"invalid_value":return t.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${$(t.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Tó pọ̀ jù: a ní láti jẹ́ pé ${t.origin??"iye"} ${a.verb} ${r}${t.maximum} ${a.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${r}${t.maximum}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Kéré ju: a ní láti jẹ́ pé ${t.origin} ${a.verb} ${r}${t.minimum} ${a.unit}`:`Kéré ju: a ní láti jẹ́ ${r}${t.minimum}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${r.prefix}"`:r.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${r.suffix}"`:r.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${r.includes}"`:r.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${r.pattern}`:`Aṣìṣe: ${i[r.format]??t.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${t.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${v(t.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${t.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${t.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function Jf(){return{localeError:ak()}}var Xf,_c=Symbol("ZodOutput"),$c=Symbol("ZodInput"),Yi=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...i){let o=i[0];return this._map.set(n,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){let i=this._map.get(n);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(n),this}get(n){let i=n._zod.parent;if(i){let o={...this.get(i)??{}};delete o.id;let t={...o,...this._map.get(n)};return Object.keys(t).length?t:void 0}return this._map.get(n)}has(n){return this._map.has(n)}};function Qi(){return new Yi}(Xf=globalThis).__zod_globalRegistry??(Xf.__zod_globalRegistry=Qi());var ue=globalThis.__zod_globalRegistry;var fe=Symbol.for("zod.compile.invalid"),qf=Symbol.for("zod.compile.fallback"),De=class extends Error{constructor(n="z.compile does not support async refinements, transforms, or checks"){super(n),this.name="ZodCompileAsyncError"}},F=class extends Error{constructor(n,i=!0){super(`z.compile does not support ${n}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=i}};function uk(e,n){try{return to(e,{assertOnly:!0})}catch{return n}}function Ic(e,n){try{let i=to(e),o=eo(e,i);return o._zod.bag.validator=uk(e,i),o}catch(i){if(n?.strict)throw i;return e}}function eo(e,n){if(Wi(e))throw new F("a schema whose subtree contains a reference cycle");let i=W(e),o=e._zod.run,t=o.__originalRun??o,r=(a,s)=>{if(s?.async||s?.direction==="backward"||s?.skipChecks||s?.[qf]||s&&Ki(s,a.value))return t(a,s);let u=n(a.value);return u!==fe?(a.value=u,a):(s&&(s[qf]=!0),t(a,s))};return r.__originalRun=t,i._zod.bag.fallbackRun=t,i._zod.bag.validator=n,i._zod.run=r,o.__originalRun||ck(i,e,n),i}function ck(e,n,i){let o=e,t=n;if(typeof t.safeParse=="function"){let r=t.safeParse;o.safeParse=(a,s)=>{let u=i(a);return u!==fe?{success:!0,data:u}:r(a,s)}}if(typeof t.parse=="function"){let r=t.parse;o.parse=(a,s)=>{let u=i(a);return u!==fe?u:r(a,s)}}}function to(e,n){let i=!0;try{i=Wi(e)}catch{}if(i)throw new F("a schema whose subtree contains a reference cycle");let o={constants:new Map,constantCounter:0,varCounter:0,definite:!0},t=new It(["input"]),r=Q(t,o,e,"input",!n?.assertOnly);t.write(r===null?"return true;":`return ${r};`);let a=["INVALID",...o.constants.keys()],s=[fe,...o.constants.values()],u=t.content.join(` -`),c=n?.debug?a.length>0?`// Constants: ${a.join(", ")} -${u}`:u:"",d=Function,p=`return (input) => { -${u} -}`,m;try{m=new d(...a,p)(...s)}catch(f){throw new F(`this schema (generated code failed to evaluate: ${f.message})`)}return n?.debug&&(m.code=c),m.definite=o.definite,m}function j(e,n){for(let[o,t]of e.constants)if(t===n)return o;let i=`c${e.constantCounter++}`;return e.constants.set(i,n),i}function Tt(e,n){return e.definite=!1,j(e,n)}function z(e){return`v${e.varCounter++}`}function lk(e,n){let i=e._zod.run({value:n,issues:[]},{});if(i&&typeof i.then=="function")return fe;let o=i;return o.issues.length===0?o.value:fe}function le(e,n,i,o,t=!0){let r=e.content.length,a=n.constants.size,s=n.constantCounter,u=n.varCounter;try{return Q(e,n,i,o,t)}catch(c){if(!(c instanceof F)||!c.islandable)throw c;if(e.content.length=r,n.constants.size>a){let d=Array.from(n.constants.keys()).slice(a);for(let p of d)n.constants.delete(p)}return n.constantCounter=s,n.varCounter=u,dk(e,n,i,o)}}function dk(e,n,i,o){n.definite=!1;let t=j(n,i),r=j(n,lk),a=z(n);return e.write(`const ${a} = ${r}(${t}, ${o});`),e.write(`if (${a} === INVALID) return INVALID;`),a}var pk=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function mk(e,n,i,o){let t=i._zod.def.checks;if(!t||t.length===0)return o;let r=o;for(let a of t){let s=a._zod.def;if(s.when&&!pk.has(s.check))throw new F('check with a custom "when" condition');switch(s.check){case"greater_than":fk(e,n,s,r);break;case"less_than":gk(e,n,s,r);break;case"multiple_of":hk(e,n,s,r);break;case"number_format":rg(e,s,r);break;case"min_length":{let u=at(s.minimum,"min_length"),c=kc(e,n,r,`${r}.length >= ${u} && ${r}.length < ${s.minimum*2}`);e.write(`if (${c} < ${u}) return INVALID;`);break}case"max_length":{let u=at(s.maximum,"max_length"),c=kc(e,n,r,`${r}.length > ${u}`);e.write(`if (${c} > ${u}) return INVALID;`);break}case"length_equals":{let u=at(s.length,"length_equals"),c=kc(e,n,r,`${r}.length >= ${u} && ${r}.length <= ${s.length*2}`);e.write(`if (${c} !== ${u}) return INVALID;`);break}case"min_size":e.write(`if (${r}.size < ${at(s.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${r}.size > ${at(s.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${r}.size !== ${at(s.size,"size_equals")}) return INVALID;`);break;case"string_format":r=ig(e,n,s,r);break;case"custom":r=kk(e,n,a,r);break;case"bigint_format":vk(e,s,r);break;case"mime_type":yk(e,n,s,r);break;case"property":_k(e,n,s,r);break;case"properties":bk(e,n,s,r);break;case"overwrite":{let u=z(n);$k(e,n,a,r,u),r=u;break}default:throw new F(`check type ${s.check}`)}}return r}function kc(e,n,i,o){let t=j(n,xt),r=z(n);return e.write(`const ${r} = typeof ${i} === "string" && ${o} ? ${t}(${i}) : ${i}.length;`),r}function at(e,n){if(typeof e!="number"||!Number.isFinite(e))throw new F(`${n} bound of type ${typeof e}`);return`${e}`}function ng(e,n){if(typeof n=="bigint")return`${n}n`;if(typeof n=="number"){if(Number.isNaN(n))throw new F("comparison check with NaN bound");return`${n}`}if(n instanceof Date){if(Number.isNaN(n.getTime()))throw new F("comparison check with Invalid Date bound");return j(e,n)}throw new F(`comparison check bound of type ${typeof n}`)}function fk(e,n,i,o){let t=i.inclusive?"<":"<=";e.write(`if (${o} ${t} ${ng(n,i.value)}) return INVALID;`)}function gk(e,n,i,o){let t=i.inclusive?">":">=";e.write(`if (${o} ${t} ${ng(n,i.value)}) return INVALID;`)}function hk(e,n,i,o){if(typeof i.value=="bigint"){if(i.value===BigInt(0))throw new F("multiple_of check with a zero divisor");e.write(`if (${o} % ${i.value}n !== 0n) return INVALID;`)}else{let t=j(n,Gn);e.write(`if (${t}(${o}, ${at(i.value,"multiple_of")}) !== 0) return INVALID;`)}}function rg(e,n,i){let o=n.format;switch(o){case"safeint":e.write(`if (!Number.isSafeInteger(${i})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${i}) || ${i} < -2147483648 || ${i} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${i}) || ${i} < 0 || ${i} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${i}) || ${i} < -3.4028234663852886e38 || ${i} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${i})) return INVALID;`);break;default:throw new F(`number format ${o}`)}}function vk(e,n,i){let o=n.format;if(o)switch(o){case"int64":e.write(`if (${i} < -9223372036854775808n || ${i} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${i} < 0n || ${i} > 18446744073709551615n) return INVALID;`);break;default:throw new F(`bigint format ${o}`)}}function yk(e,n,i,o){let t=i.mime;if(t&&t.length>0){let r=j(n,new Set(t));e.write(`if (!${r}.has(${o}.type)) return INVALID;`)}}function bk(e,n,i,o){if(i.when)throw new F('check with a custom "when" condition');e.write(`if (${o} == null) return INVALID;`);let t=i.shape;for(let r of Reflect.ownKeys(t)){let a=typeof r=="symbol"?j(n,r):pe(r),s=z(n);e.write(`const ${s} = ${o}[${a}];`),le(e,n,t[r],s,!1)}}function _k(e,n,i,o){let t=`${o}[${JSON.stringify(i.property)}]`;Q(e,n,i.schema,t)}function $k(e,n,i,o,t){let r=i._zod.def.tx;if(!r)throw new F("overwrite check without a transform function");if(Et(r))throw new De("z.compile: async overwrite transforms are not supported");let a=j(n,r);e.write(`const ${t} = ${a}(${o});`)}function xc(){throw new $e}function Sc(e){this.issues.push(e)}function kk(e,n,i,o){let t=i._zod.def;if(t.fn){if(Et(t.fn))throw new De("z.compile: async .refine() predicates are not supported");let r=Tt(n,t.fn),a=j(n,xc),s=z(n);return e.write(`const ${s} = ${r}(${o});`),e.write(`if (${s} instanceof Promise) ${a}();`),e.write(`if (!${s}) return INVALID;`),o}if(i._zod.check){if(Et(i._zod.check))throw new De("z.compile: async .superRefine() / check functions are not supported");let r=i._zod.check,s=Tt(n,c=>{let d={value:c,issues:[],addIssue:Sc};return r(d)instanceof Promise&&xc(),d.issues.length===0?d.value:fe}),u=z(n);return e.write(`const ${u} = ${s}(${o});`),e.write(`if (${u} === INVALID) return INVALID;`),u}throw new F("custom check without a predicate or check function")}var xk=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function ig(e,n,i,o,t=!0){let r=i.format;if(r==="base64"){let c=j(n,lr);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(r==="base64url"){let c=j(n,Di);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(r==="jwt"){let c=j(n,ji),d=j(n,i.alg??null);return e.write(`if (!${c}(${o}, ${d})) return INVALID;`),o}if(r==="ipv6"){let c=j(n,cr);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(r==="cidrv6"){let c=j(n,Ni);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(r==="credit_card"){let c=j(n,Ci);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(r==="iban"){let c=j(n,Li);return e.write(`if (!${c}(${o})) return INVALID;`),o}let a=i;if(r==="url"||r==="httpurl"||a.normalize||a.hostname!==void 0||a.protocol!==void 0){let c=j(n,Ei),d=j(n,i),p=z(n),m=z(n);if(e.write(`const ${p} = ${o}.trim();`),e.write(`const ${m} = ${c}(${p}, ${d});`),e.write(`if (typeof ${m} === "number") return INVALID;`),a.hostname!==void 0){let y=j(n,Ai);e.write(`if (!${y}(${m}, ${d}.hostname)) return INVALID;`)}if(a.protocol!==void 0){let y=j(n,Oi);e.write(`if (!${y}(${m}, ${d}.protocol)) return INVALID;`)}if(!t)return null;let f=z(n),g=a.normalize?`${m}.href`:`${j(n,ur)}(${p})`;return e.write(`const ${f} = ${g};`),f}let s=i.fn;if(s){if(Et(s))throw new F(`async string format ${r}`);let c=j(n,s);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(xk.has(r)&&i.pattern){let c=j(n,i.pattern);return e.write(`${c}.lastIndex = 0;`),e.write(`if (!${c}.test(${o})) return INVALID;`),o}let u=i.format;switch(u){case"regex":throw new F("regex format without a pattern");case"lowercase":e.write(`if (${o} !== ${o}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${o} !== ${o}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${o}.includes(${pe(i.includes)})) return INVALID;`);break;case"starts_with":{let c=i.prefix;e.write(`if (${o}.slice(0, ${c.length}) !== ${pe(c)}) return INVALID;`);break}case"ends_with":{let c=i.suffix;e.write(`if (${o}.slice(-${c.length}) !== ${pe(c)}) return INVALID;`);break}default:throw new F(`string format ${u}`)}return o}function Q(e,n,i,o,t=!0){let r=i._zod.def,a=r.type;if(r.coerce)throw new F(`coercion (z.coerce.${a}())`);let s=t||!!r.checks?.length,u;switch(a){case"string":u=wk(e,n,i,o,s);break;case"number":u=Ik(e,i,o);break;case"boolean":u=Sk(e,o);break;case"bigint":u=Pk(e,i,o);break;case"symbol":u=Tk(e,o);break;case"undefined":u=Ek(e,o);break;case"null":u=Ak(e,o);break;case"any":case"unknown":u=o;break;case"never":e.write("return INVALID;"),u=o;break;case"void":u=Ok(e,o);break;case"nan":u=Nk(e,o);break;case"date":u=zk(e,o);break;case"object":u=Dk(e,n,i,o,s);break;case"optional":u=Ck(e,n,i,o,s);break;case"nullable":u=Uk(e,n,i,o,s);break;case"array":u=Rk(e,n,i,o,s);break;case"literal":u=Mk(e,n,i,o);break;case"enum":u=Zk(e,n,i,o);break;case"readonly":{let c=Qf(e,n,i,o),d=z(n);e.write(`const ${d} = Object.freeze(${c});`),u=d;break}case"success":Qf(e,n,i,o),u="true";break;case"default":case"prefault":u=Fk(e,n,i,o);break;case"nonoptional":u=Vk(e,n,i,o);break;case"tuple":u=Gk(e,n,i,o);break;case"union":u=Bk(e,n,i,o);break;case"intersection":u=Kk(e,n,i,o);break;case"record":u=Jk(e,n,i,o);break;case"map":u=qk(e,n,i,o);break;case"set":u=Yk(e,n,i,o);break;case"file":u=Qk(e,o);break;case"template_literal":u=ex(e,n,i,o);break;case"lazy":u=tx(e,n,i,o);break;case"pipe":u=nx(e,n,i,o);break;case"custom":u=rx(e,n,i,o);break;case"transform":u=ax(e,n,i,o);break;case"catch":u=ox(e,n,i,o);break;default:throw new F(`schema type ${a}`)}return u===null?null:mk(e,n,i,u)}function wk(e,n,i,o,t=!0){e.write(`if (typeof ${o} !== "string") return INVALID;`);let r=i._zod.def;return r.format===void 0?o:ig(e,n,r,o,t)}function Ik(e,n,i){e.write(`if (typeof ${i} !== "number" || !Number.isFinite(${i})) return INVALID;`);let o=n._zod.def;return o.check==="number_format"&&o.format&&rg(e,{format:o.format},i),i}function Sk(e,n){return e.write(`if (typeof ${n} !== "boolean") return INVALID;`),n}function Pk(e,n,i){e.write(`if (typeof ${i} !== "bigint") return INVALID;`);let o=n._zod.def;if(o.format)switch(o.format){case"int64":e.write(`if (${i} < -9223372036854775808n || ${i} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${i} < 0n || ${i} > 18446744073709551615n) return INVALID;`);break}return i}function Tk(e,n){return e.write(`if (typeof ${n} !== "symbol") return INVALID;`),n}function Ek(e,n){return e.write(`if (${n} !== undefined) return INVALID;`),n}function Ak(e,n){return e.write(`if (${n} !== null) return INVALID;`),n}function Ok(e,n){return e.write(`if (${n} !== undefined) return INVALID;`),n}function Nk(e,n){return e.write(`if (typeof ${n} !== "number" || !Number.isNaN(${n})) return INVALID;`),n}function zk(e,n){return e.write(`if (!(${n} instanceof Date) || Number.isNaN(${n}.getTime())) return INVALID;`),n}function Dk(e,n,i,o,t=!0){let r=i._zod.def;e.write(`if (typeof ${o} !== "object" || ${o} === null || Array.isArray(${o})) return INVALID;`);let a=r.shape,s=Object.keys(a),u=Object.getOwnPropertySymbols(a),c=u.length?[...s,...u]:s,d=b=>typeof b=="symbol"?j(n,b):pe(b),p=b=>typeof b=="symbol"?`[${d(b)}]`:pe(b),m=a;if(s.includes("__proto__"))throw new F('object shape key "__proto__"');let f=new Map;for(let b of c){let T=m[b],A=d(b),D=z(n);if(e.write(`const ${D} = ${o}[${A}];`),T._zod.optin!==void 0){let w=z(n);e.write(`let ${w} = (() => {`),e.indented(O=>{let E=le(O,n,T,D);O.write(`return ${E};`)}),e.write("})();"),T._zod.optout==="optional"?(e.write(`if (${w} === INVALID) {`),e.indented(O=>{O.write(`if (${A} in ${o}) return INVALID;`),O.write(`${w} = undefined;`)}),e.write("}")):e.write(`if (${w} === INVALID) return INVALID;`),f.set(b,w)}else{jk(T)&&e.write(`if (!(${A} in ${o})) return INVALID;`);let w=le(e,n,T,D,t);w!==null&&f.set(b,w)}}let g=r.catchall,y="none";if(g){let b=g._zod.def.type;if(b==="never"){let T=s.map(A=>`k !== ${pe(A)}`).join(" && ")||"true";e.write(`for (const k in ${o}) {`),e.indented(A=>{A.write(`if (${T}) return INVALID;`)}),e.write("}")}else(b==="unknown"||b==="any")&&!g._zod.def.checks?.length?y="passthrough":y="schema"}let x=z(n),I=c.some(b=>Yf(m[b])||wc(m[b]));if(!t){if(y==="schema"){let b=s.length>0?j(n,new Set(s)):null;e.write(`for (const k in ${o}) {`),e.indented(T=>{T.write('if (k === "__proto__") continue;'),b&&T.write(`if (${b}.has(k)) continue;`);let A=z(n);T.write(`const ${A} = ${o}[k];`),le(T,n,g,A,!1)}),e.write("}")}return null}if(I){e.write(`const ${x} = {};`);for(let b of c){let T=d(b),A=f.get(b);wc(m[b])?e.write(`if (${T} in ${o}) ${x}[${T}] = ${A};`):Yf(m[b])?e.write(`if (${A} !== undefined || ${T} in ${o}) ${x}[${T}] = ${A};`):e.write(`${x}[${T}] = ${A};`)}}else{let b=c.map(T=>`${p(T)}: ${f.get(T)}`).join(", ");e.write(`const ${x} = { ${b} };`)}if(y!=="none"){let b=s.length>0?j(n,new Set(s)):null;e.write(`for (const k in ${o}) {`),e.indented(T=>{if(T.write('if (k === "__proto__") continue;'),b&&T.write(`if (${b}.has(k)) continue;`),y==="passthrough")T.write(`${x}[k] = ${o}[k];`);else{let A=z(n);T.write(`const ${A} = ${o}[k];`);let D=le(T,n,g,A);T.write(`${x}[k] = ${D};`)}}),e.write("}")}return x}function Ck(e,n,i,o,t=!0){let r=i._zod.def;if(Lk(i))return Q(e,n,r.innerType,o,t);if(r.innerType._zod.optin==="defaulted"){let s=z(n),u=z(n);return e.write(`let ${s};`),e.write(`if (${o} === undefined) {`),e.indented(c=>{c.write(`const ${u} = (() => {`),c.indented(d=>{let p=Q(d,n,r.innerType,o);d.write(`return ${p};`)}),c.write("})();"),c.write(`if (${u} !== INVALID) ${s} = ${u};`)}),e.write("} else {"),e.indented(c=>{let d=Q(c,n,r.innerType,o);c.write(`${s} = ${d};`)}),e.write("}"),s}let a=t?z(n):null;return a&&e.write(`let ${a};`),e.write(`if (${o} !== undefined) {`),e.indented(s=>{let u=Q(s,n,r.innerType,o,t);a&&u!==null&&s.write(`${a} = ${u};`)}),e.write("}"),a}function Lk(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function jk(e){return e._zod.optin===void 0&&Pt(e)}function Pt(e){if(e._zod.def.coerce)return!0;let n=e._zod.def;switch(n.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return n.innerType?Pt(n.innerType):!1;case"literal":return!!n.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return n.innerType?Pt(n.innerType):!0;case"catch":return!0;case"union":return n.options?n.options.some(Pt):!0;case"intersection":return!n.left||!n.right?!0:Pt(n.left)&&Pt(n.right);case"pipe":return n.in?Pt(n.in):!0;default:return!0}}function wc(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function Yf(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&sn(e)}function sn(e){let n=e._zod.def;switch(n.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!n.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return n.innerType?sn(n.innerType):!0;case"union":return n.options?n.options.some(sn):!0;case"intersection":return!n.left||!n.right||sn(n.left)||sn(n.right);case"pipe":return n.out?sn(n.out):!0;default:return!0}}function Uk(e,n,i,o,t=!0){let r=i._zod.def,a=t?z(n):null;return a&&e.write(`let ${a} = null;`),e.write(`if (${o} !== null) {`),e.indented(s=>{let u=Q(s,n,r.innerType,o,t);a&&u!==null&&s.write(`${a} = ${u};`)}),e.write("}"),a}function Pc(e,n,i){for(let[o,t]of Xt(n._zod.def.checks))e.write(`if (${i} > ${at(o,t._zod.def.check)}) return INVALID;`)}function Rk(e,n,i,o,t=!0){let r=i._zod.def;e.write(`if (!Array.isArray(${o})) return INVALID;`),Pc(e,i,`${o}.length`);let a=t?z(n):null,s=z(n),u=z(n);return a&&e.write(`const ${a} = new Array(${o}.length);`),e.write(`for (let ${s} = 0; ${s} < ${o}.length; ${s}++) {`),e.indented(c=>{c.write(`const ${u} = ${o}[${s}];`);let d=le(c,n,r.element,u,t);a&&d!==null&&c.write(`${a}[${s}] = ${d};`)}),e.write("}"),a}function Mk(e,n,i,o){let r=i._zod.def.values;if(r.length!==1){let s=j(n,new Set(r));return e.write(`if (!${s}.has(${o})) return INVALID;`),o}let a=r[0];if(typeof a=="number"&&Number.isNaN(a)){let s=j(n,new Set(r));return e.write(`if (!${s}.has(${o})) return INVALID;`),o}if(typeof a=="string")e.write(`if (${o} !== ${pe(a)}) return INVALID;`);else if(typeof a=="number"||typeof a=="boolean")e.write(`if (${o} !== ${a}) return INVALID;`);else if(a===null)e.write(`if (${o} !== null) return INVALID;`);else if(a===void 0)e.write(`if (${o} !== undefined) return INVALID;`);else if(typeof a=="bigint")e.write(`if (${o} !== ${a}n) return INVALID;`);else throw new F(`literal type ${typeof a}`);return o}function Zk(e,n,i,o){let t=i._zod.values;if(!t)throw new F("enum schema without enumerated values");let r=j(n,t);return e.write(`if (!${r}.has(${o})) return INVALID;`),o}function Qf(e,n,i,o){let t=i._zod.def;return Q(e,n,t.innerType,o)}function Fk(e,n,i,o){let t=i._zod.def,a=Object.getOwnPropertyDescriptor(i._zod.def,"defaultValue")?()=>i._zod.def.defaultValue:void 0;if(i._zod.def.type==="prefault"){if(!a)return Q(e,n,t.innerType,o);let u=j(n,a),c=z(n);return e.write(`let ${c} = ${o};`),e.write(`if (${o} === undefined) ${c} = ${u}();`),Q(e,n,t.innerType,c)}let s=z(n);if(a){let u=j(n,a),c=j(n,Bn);e.write(`let ${s};`),e.write(`if (${o} === undefined) {`),e.indented(d=>{d.write(`${s} = ${c}(${u}());`)}),e.write("} else {"),e.indented(d=>{let p=Q(d,n,t.innerType,o);d.write(`${s} = ${p} === undefined ? ${c}(${u}()) : ${p};`)}),e.write("}")}else e.write(`let ${s};`),e.write(`if (${o} !== undefined) {`),e.indented(u=>{let c=Q(u,n,t.innerType,o);u.write(`${s} = ${c};`)}),e.write("}");return s}function Vk(e,n,i,o){let t=i._zod.def,r=Q(e,n,t.innerType,o),a=z(n);return e.write(`const ${a} = ${r};`),e.write(`if (${a} === undefined) return INVALID;`),a}function Gk(e,n,i,o){let t=i._zod.def,r=t.items,a=t.rest;e.write(`if (!Array.isArray(${o})) return INVALID;`);let s=eg(r,"optin"),u=eg(r,"optout");a?e.write(`if (${o}.length < ${s}) return INVALID;`):e.write(`if (${o}.length < ${s} || ${o}.length > ${r.length}) return INVALID;`);let c=z(n);e.write(`const ${c} = [];`);for(let d=0;d=u)e.write(`if (${c}.length === ${d}) {`),e.indented(m=>{m.write(`if (${d} < ${o}.length) {`),m.indented(f=>{let g=z(n);f.write(`const ${g} = ${o}[${d}];`);let y=le(f,n,p,g);f.write(`${c}[${d}] = ${y};`)}),m.write("} else {"),m.indented(f=>{if(wc(p)){f.write(`${c}.length = ${d};`);return}let g=z(n),y=z(n);f.write(`const ${g} = undefined;`),f.write(`const ${y} = (() => {`),f.indented(x=>{let I=le(x,n,p,g);x.write(`return ${I};`)}),f.write("})();"),f.write(`if (${y} === INVALID || ${y} === undefined) ${c}.length = ${d};`),f.write(`else ${c}[${d}] = ${y};`)}),m.write("}")}),e.write("}");else{let m=z(n);e.write(`const ${m} = ${o}[${d}];`);let f=le(e,n,p,m);e.write(`${c}[${d}] = ${f};`)}}if(a){let d=z(n),p=z(n);e.write(`for (let ${d} = ${r.length}; ${d} < ${o}.length; ${d}++) {`),e.indented(m=>{m.write(`const ${p} = ${o}[${d}];`);let f=le(m,n,a,p);m.write(`${c}[${d}] = ${f};`)}),e.write("}")}return c}function eg(e,n){for(let i=e.length-1;i>=0;i--)if(!(n==="optin"?e[i]._zod.optin!==void 0:e[i]._zod.optout==="optional"))return i+1;return 0}function Bk(e,n,i,o){let t=i._zod.def,r=t.options;if(t.discriminator)return Hk(e,n,t,o);if(t.inclusive===!1)throw new F("exclusive unions (z.xor)");if(r.length===0)return e.write("return INVALID;"),o;if(r.length===1)return Q(e,n,r[0],o);if(r.every(u=>u._zod.def.type==="literal"&&!u._zod.def.checks?.length)){let u=new Set(r.flatMap(d=>d._zod.def.values)),c=j(n,u);return e.write(`if (!${c}.has(${o})) return INVALID;`),o}let s=z(n);e.write(`let ${s};`);for(let u=0;u {`):e.write(`if (${s} === INVALID) ${s} = (() => {`),e.indented(d=>{let p=Q(d,n,c,o);d.write(`return ${p};`)}),e.write("})();")}return e.write(`if (${s} === INVALID) return INVALID;`),s}function Hk(e,n,i,o){if(i.unionFallback)throw new F("discriminated union with unionFallback");if(i.options.length===0)return e.write("return INVALID;"),o;let t=z(n),r=z(n);e.write(`const ${t} = ${o}?.[${pe(i.discriminator)}];`),e.write(`let ${r};`);let a=!0,s=new Set;for(let u of i.options){let c=u._zod.propValues?.[i.discriminator];if(!c||c.size===0)throw new F("discriminated union option without static discriminator values");for(let m of c){if(s.has(m))throw new F(`duplicate discriminator value ${String(m)}`);s.add(m)}let d=Array.from(c,m=>Wk(n,t,m)),p=a?"if":"else if";e.write(`${p} (${d.join(" || ")}) {`),e.indented(m=>{let f=Q(m,n,u,o);m.write(`${r} = ${f};`)}),e.write("}"),a=!1}return e.write("else { return INVALID; }"),r}function Wk(e,n,i){if(typeof i=="string")return`${n} === ${pe(i)}`;if(typeof i=="number")return Number.isNaN(i)?`Number.isNaN(${n})`:`${n} === ${i}`;if(typeof i=="boolean")return`${n} === ${i}`;if(i===null)return`${n} === null`;if(i===void 0)return`${n} === undefined`;if(typeof i=="bigint")return`${n} === ${i}n`;if(typeof i=="symbol"){let o=j(e,i);return`${n} === ${o}`}throw new F(`literal discriminator value ${String(i)}`)}function Kk(e,n,i,o){let t=i._zod.def;n.definite=!1;let r=le(e,n,t.left,o),a=le(e,n,t.right,o),s=j(n,rn),u=z(n);return e.write(`const ${u} = ${s}(${r}, ${a});`),e.write(`if (!${u}.valid) return INVALID;`),`${u}.data`}function Jk(e,n,i,o){let t=i._zod.def,r=j(n,Se);e.write(`if (!${r}(${o})) return INVALID;`);let a=z(n),s=z(n),u=z(n);e.write(`const ${a} = {};`);let c=t,d=c.partial?void 0:t.keyType._zod.values;if(d){let f=[];for(let y of d){if(!(typeof y=="string"||typeof y=="number"||typeof y=="symbol"))throw new F(`record key value ${String(y)}`);let x=typeof y=="number"?y.toString():y;if(x==="__proto__")throw new F('record key "__proto__"');f.push(x);let I=j(n,y),b=Q(e,n,t.keyType,I),T=z(n);e.write(`const ${T} = ${o}[${Xk(n,x)}];`);let A=le(e,n,t.valueType,T);e.write(`${a}[${b}] = ${A};`)}let g=j(n,new Set(f));return e.write(`for (const ${s} in ${o}) {`),e.indented(y=>{y.write(`if (${g}.has(${s})) continue;`),c.mode==="loose"?y.write(`if (${s} !== "__proto__") ${a}[${s}] = ${o}[${s}];`):y.write("return INVALID;")}),e.write("}"),a}let p=t.keyType._zod.def;if(!(p.type==="string"&&p.format===void 0&&!p.coerce&&(p.checks?.length??0)===0)){let f=t.mode==="loose",g=to(t.keyType);g.definite===!1&&(n.definite=!1);let y=j(n,g),x=j(n,qe),I=z(n);return tg(e,n,o,s,b=>{b.write(`let ${I} = ${y}(${s});`),b.write(`if (${I} === INVALID && typeof ${s} === "string" && ${x}.test(${s})) ${I} = ${y}(Number(${s}));`),f?b.write(`if (${I} === INVALID) { ${a}[${s}] = ${o}[${s}]; continue; }`):b.write(`if (${I} === INVALID) return INVALID;`),b.write(`if (${I} === "__proto__") continue;`);let T=z(n);b.write(`const ${T} = ${o}[${s}];`);let A=le(b,n,t.valueType,T);b.write(`${a}[${I}] = ${A};`)}),a}return tg(e,n,o,s,f=>{f.write(`const ${u} = ${o}[${s}];`);let g=le(f,n,t.valueType,u);f.write(`${a}[${s}] = ${g};`)},"return INVALID;"),a}function tg(e,n,i,o,t,r){let a=j(n,Object.prototype.propertyIsEnumerable),s=z(n),u=z(n),c=z(n);e.write(`const ${s} = Object.getOwnPropertySymbols(${i});`),e.write(`const ${u} = Object.getOwnPropertyNames(${i});`),e.write(`for (let ${c} = 0; ${c} < ${u}.length; ${c}++) {`),e.indented(d=>{d.write(`const ${o} = ${u}[${c}];`),d.write(`if (${o} === "__proto__" || !${a}.call(${i}, ${o})) continue;`),t(d)}),e.write("}"),e.write(`for (let ${c} = 0; ${c} < ${s}.length; ${c}++) {`),e.indented(d=>{d.write(`const ${o} = ${s}[${c}];`),d.write(`if (!${a}.call(${i}, ${o})) continue;`),r?d.write(r):t(d)}),e.write("}")}function Xk(e,n){return typeof n=="string"?pe(n):j(e,n)}function qk(e,n,i,o){let t=i._zod.def;e.write(`if (!(${o} instanceof Map)) return INVALID;`),Pc(e,i,`${o}.size`);let r=z(n),a=z(n),s=z(n);return e.write(`const ${r} = new Map();`),e.write(`for (const [${a}, ${s}] of ${o}) {`),e.indented(u=>{let c=Q(u,n,t.keyType,a),d=Q(u,n,t.valueType,s);u.write(`${r}.set(${c}, ${d});`)}),e.write("}"),r}function Yk(e,n,i,o){let t=i._zod.def;e.write(`if (!(${o} instanceof Set)) return INVALID;`),Pc(e,i,`${o}.size`);let r=z(n),a=z(n);return e.write(`const ${r} = new Set();`),e.write(`for (const ${a} of ${o}) {`),e.indented(s=>{let u=Q(s,n,t.valueType,a);s.write(`${r}.add(${u});`)}),e.write("}"),r}function Qk(e,n){return e.write(`if (!(${n} instanceof File)) return INVALID;`),n}function ex(e,n,i,o){e.write(`if (typeof ${o} !== "string") return INVALID;`);let t=i._zod.pattern;if(t){let r=j(n,t);e.write(`${r}.lastIndex = 0;`),e.write(`if (!${r}.test(${o})) return INVALID;`)}return o}function tx(e,n,i,o){let t=i._zod.def,r=Tt(n,t.getter),a=j(n,{parser:null});e.write(`if (!${a}.parser) {`),e.indented(u=>{u.write(`const inner = ${r}();`),u.write(`${a}.parser = function(input) {`),u.indented(c=>{c.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),c.write("return result.issues.length === 0 ? result.value : INVALID;")}),u.write("};")}),e.write("}");let s=z(n);return e.write(`const ${s} = ${a}.parser(${o});`),e.write(`if (${s} === INVALID) return INVALID;`),s}function nx(e,n,i,o){let t=i._zod.def,r=Q(e,n,t.in,o);if(t.transform){if(Et(t.transform))throw new De("z.compile: async transforms in pipes are not supported");let a=t.transform,u=Tt(n,d=>{let p={value:d,issues:[],addIssue:Sc},m=a(d,p);return m instanceof Promise?fe:p.issues.length===0?m:fe}),c=z(n);return e.write(`const ${c} = ${u}(${r});`),e.write(`if (${c} === INVALID) return INVALID;`),Q(e,n,t.out,c)}else return Q(e,n,t.out,r)}function Et(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function rx(e,n,i,o){let t=i._zod.def;if(t.fn){if(Et(t.fn))throw new De("z.compile: async custom predicates are not supported");let r=Tt(n,t.fn),a=j(n,xc),s=z(n);e.write(`const ${s} = ${r}(${o});`),e.write(`if (${s} instanceof Promise) ${a}();`),e.write(`if (!${s}) return INVALID;`)}else throw new F("custom schema without a predicate function");return o}function ix(e,n,i){let o=e._zod.run({value:i,issues:[]},{});if(o&&typeof o.then=="function")return fe;let t=o;return t.issues.length===0?t.value:n()}function ox(e,n,i,o){let t=i._zod.def;if(!t.catchValue[ai])throw new F("catch with a callback (only a constant catch value compiles)",!1);let r=z(n);e.write(`let ${r} = (() => {`),e.indented(c=>{let d=le(c,n,t.innerType,o);c.write(`return ${d};`)}),e.write("})();");let a=j(n,t.innerType),s=Tt(n,t.catchValue),u=j(n,ix);return e.write(`if (${r} === INVALID) {`),e.indented(c=>{c.write(`${r} = ${u}(${a}, ${s}, ${o});`),c.write(`if (${r} === INVALID) return INVALID;`)}),e.write("}"),r}function ax(e,n,i,o){let t=i._zod.def;if(t.transform){if(Et(t.transform))throw new De("z.compile: async transforms are not supported");let r=t.transform,s=Tt(n,c=>{let d={value:c,issues:[],addIssue:Sc},p=r(c,d);return p instanceof Promise?fe:d.issues.length===0?p:fe}),u=z(n);return e.write(`const ${u} = ${s}(${o});`),e.write(`if (${u} === INVALID) return INVALID;`),u}return o}function no(e){return e.checks&&(e.checks=[...e.checks]),e}function Tc(e,n){return new e(no({type:"string",...S(n)}))}function Ec(e,n){return new e(no({type:"string",coerce:!0,...S(n)}))}function ro(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...S(n)})}function io(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...S(n)})}function oo(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...S(n)})}function ao(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(n)})}function so(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(n)})}function uo(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(n)})}function $r(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...S(n)})}function co(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...S(n)})}function lo(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(n)})}function po(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...S(n)})}function mo(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(n)})}function fo(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...S(n)})}function go(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...S(n)})}function ho(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(n)})}function vo(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(n)})}function yo(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(n)})}function Ac(e,n){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...S(n)})}function bo(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(n)})}function _o(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(n)})}function $o(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...S(n)})}function ko(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...S(n)})}function xo(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...S(n)})}function Oc(e,n){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...S(n)})}function Nc(e,n){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...S(n)})}function wo(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...S(n)})}var zc={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function kr(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(n)})}function xr(e,n){return new e({type:"string",format:"date",check:"string_format",...S(n)})}function wr(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...S(n)})}function Ir(e,n){return new e({type:"string",format:"duration",check:"string_format",...S(n)})}function Dc(e,n){return new e(no({type:"number",checks:[],...S(n)}))}function Cc(e,n){return new e(no({type:"number",coerce:!0,checks:[],...S(n)}))}function Lc(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...S(n)})}function jc(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...S(n)})}function Uc(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...S(n)})}function Rc(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...S(n)})}function Mc(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...S(n)})}function Zc(e,n){return new e({type:"boolean",...S(n)})}function Fc(e,n){return new e({type:"boolean",coerce:!0,...S(n)})}function Vc(e,n){return new e({type:"bigint",...S(n)})}function Gc(e,n){return new e({type:"bigint",coerce:!0,...S(n)})}function Bc(e,n){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...S(n)})}function Hc(e,n){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...S(n)})}function Wc(e,n){return new e({type:"symbol",...S(n)})}function Kc(e,n){return new e({type:"undefined",...S(n)})}function Jc(e,n){return new e({type:"null",...S(n)})}function Xc(e){return new e({type:"any"})}function qc(e){return new e({type:"unknown"})}function Yc(e,n){return new e({type:"never",...S(n)})}function Qc(e,n){return new e({type:"void",...S(n)})}function el(e,n){return new e({type:"date",...S(n)})}function tl(e,n){return new e({type:"date",coerce:!0,...S(n)})}function nl(e,n){return new e({type:"nan",...S(n)})}function Ze(e,n){return new ki({check:"less_than",...S(n),value:e,inclusive:!1})}function we(e,n){return new ki({check:"less_than",...S(n),value:e,inclusive:!0})}function Fe(e,n){return new xi({check:"greater_than",...S(n),value:e,inclusive:!1})}function Ie(e,n){return new xi({check:"greater_than",...S(n),value:e,inclusive:!0})}function Io(e){return Fe(0,e)}function So(e){return Ze(0,e)}function Po(e){return we(0,e)}function To(e){return Ie(0,e)}function st(e,n){return new Us({check:"multiple_of",...S(n),value:e})}function ut(e,n){return new Zs({check:"max_size",...S(n),maximum:e})}function Ve(e,n){return new Fs({check:"min_size",...S(n),minimum:e})}function At(e,n){return new Vs({check:"size_equals",...S(n),size:e})}function Ot(e,n){return new Gs({check:"max_length",...S(n),maximum:e})}function Ye(e,n){return new Bs({check:"min_length",...S(n),minimum:e})}function Nt(e,n){return new Hs({check:"length_equals",...S(n),length:e})}function un(e,n){return new Ws({check:"string_format",format:"regex",...S(n),pattern:e})}function cn(e){return new Ks({check:"string_format",format:"lowercase",...S(e)})}function ln(e){return new Js({check:"string_format",format:"uppercase",...S(e)})}function dn(e,n){return new Xs({check:"string_format",format:"includes",...S(n),includes:e})}function pn(e,n){return new qs({check:"string_format",format:"starts_with",...S(n),prefix:e})}function mn(e,n){return new Ys({check:"string_format",format:"ends_with",...S(n),suffix:e})}function Eo(e,n,i){return new Qs({check:"property",property:e,schema:n,...S(i)})}function fn(e,n){return new eu({check:"properties",shape:e,...S(n)})}function gn(e,n){return new tu({check:"mime_type",mime:e,...S(n)})}function Ce(e){return new nu({check:"overwrite",tx:e})}function hn(e){return Ce(n=>n.normalize(e))}function vn(){return Ce(e=>e.trim())}function yn(){return Ce(e=>e.toLowerCase())}function bn(){return Ce(e=>e.toUpperCase())}function _n(){return Ce(e=>Ma(e))}function rl(e,n,i){return new e({type:"array",element:n,...S(i)})}function sx(e,n,i){return new e({type:"union",options:n,...S(i)})}function ux(e,n,i){return new e({type:"union",options:n,inclusive:!1,...S(i)})}function cx(e,n,i,o){return new e({type:"union",options:i,discriminator:n,...S(o)})}function lx(e,n,i){return new e({type:"intersection",left:n,right:i})}function dx(e,n,i,o){let t=i instanceof U,r=t?o:i,a=t?i:null;return new e({type:"tuple",items:n,rest:a,...S(r)})}function px(e,n,i,o){return new e({type:"record",keyType:n,valueType:i,...S(o)})}function mx(e,n,i,o){return new e({type:"map",keyType:n,valueType:i,...S(o)})}function fx(e,n,i){return new e({type:"set",valueType:n,...S(i)})}function gx(e,n,i){let o=Array.isArray(n)?Object.fromEntries(n.map(t=>[t,t])):n;return new e({type:"enum",entries:o,...S(i)})}function hx(e,n,i){return new e({type:"enum",entries:n,...S(i)})}function vx(e,n,i){return new e({type:"literal",values:Array.isArray(n)?n:[n],...S(i)})}function il(e,n){return new e({type:"file",...S(n)})}function yx(e,n){return new e({type:"transform",transform:n})}function bx(e,n){return new e({type:"optional",innerType:n})}function _x(e,n){return new e({type:"nullable",innerType:n})}function $x(e,n,i){return new e({type:"default",innerType:n,get defaultValue(){return typeof i=="function"?i():Bn(i)}})}function kx(e,n,i){return new e({type:"nonoptional",innerType:n,...S(i)})}function xx(e,n){return new e({type:"success",innerType:n})}function wx(e,n,i){return new e({type:"catch",innerType:n,catchValue:typeof i=="function"?i:Ha(i)})}function Ix(e,n,i){return new e({type:"pipe",in:n,out:i})}function Sx(e,n){return new e({type:"readonly",innerType:n})}function Px(e,n,i){return new e({type:"template_literal",parts:n,...S(i)})}function Tx(e,n){return new e({type:"lazy",getter:n})}function Ex(e,n){return new e({type:"promise",innerType:n})}function ol(e,n,i){let o=S(i);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:n,...o})}function al(e,n,i){return new e({type:"custom",check:"custom",fn:n,...S(i)})}function sl(e,n){let i=og(o=>(o.addIssue=t=>{if(typeof t=="string")o.issues.push(qt(t,o.value,i._zod.def));else{let r=t;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),"input"in r||(r.input=o.value),r.inst??(r.inst=i),r.continue??(r.continue=!i._zod.def.abort),o.issues.push(qt(r))}},e(o.value,o)),n);return i}function og(e,n){let i=new q({check:"custom",...S(n)});return i._zod.check=e,i}function ul(e){let n=new q({check:"describe"});return n._zod.onattach=[i=>{let o=ue.get(i)??{};ue.add(i,{...o,description:e})}],n._zod.check=()=>{},n}function cl(e){let n=new q({check:"meta"});return n._zod.onattach=[i=>{let o=ue.get(i)??{};ue.add(i,{...o,...e})}],n._zod.check=()=>{},n}function ll(e,n){let i=S(n),o=i.truthy??["true","1","yes","on","y","enabled"],t=i.falsy??["false","0","no","off","n","disabled"];i.case!=="sensitive"&&(o=o.map(f=>typeof f=="string"?f.toLowerCase():f),t=t.map(f=>typeof f=="string"?f.toLowerCase():f));let r=new Set(o),a=new Set(t),s=e.Codec??fr,u=e.Boolean??pr,c=e.String??St,d=new c({type:"string",error:i.error}),p=new u({type:"boolean",error:i.error}),m=new s({type:"pipe",in:d,out:p,transform:((f,g)=>{let y=f;return i.case!=="sensitive"&&(y=y.toLowerCase()),r.has(y)?!0:a.has(y)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...r,...a],input:g.value,inst:m,continue:!1}),{})}),reverseTransform:((f,g)=>f===!0?o[0]||"true":t[0]||"false"),error:i.error});return m._zod.bag.truthy=o,m._zod.bag.falsy=t,m._zod.bag.case=i.case??"insensitive",m}function zt(e,n,i,o={}){let t=S(o),r={check:"string_format",type:"string",format:n,fn:typeof i=="function"?i:s=>i.test(s),...t};return i instanceof RegExp&&(r.pattern=i),new e(r)}function Sr(e,...n){for(let i of n)for(let o of Reflect.ownKeys(i))Object.prototype.propertyIsEnumerable.call(i,o)&&se(e,o,i[o]);return e}function ct(e){let n=e?.target??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ue,target:n,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function ie(e,n,i,o,t){let r=typeof n.unrepresentable=="function"?n.unrepresentable({zodSchema:e,path:o.path,message:t}):n.unrepresentable;if(r==="any")return!1;if(r===void 0||r==="throw")throw new Error(t);return Object.assign(i,r),!0}function J(e,n,i={path:[],schemaPath:[]}){var o;let t=e._zod.def,r=n.seen.get(e);if(r)return r.count++,i.schemaPath.includes(e)&&(r.cycle=i.path),r.schema;let a={schema:{},count:1,cycle:void 0,path:i.path};n.seen.set(e,a),n.sharedDefsExtractedFor=void 0,n.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let d={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,a.schema,d);else{let m=a.schema,f=n.processors[t.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${t.type}`);f(e,n,m,d)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),J(p,n,d),n.seen.get(p).isParent=!0)}let u=n.metadataRegistry.get(e);return u&&Sr(a.schema,u),n.io==="input"&&ge(e)&&(delete a.schema.examples,delete a.schema.default),n.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,n.seen.get(e).schema}function ag(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function lt(e,n){let i=e.seen.get(n);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let u=o.get(s);if(u&&u!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}let t=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,m=e.external.uri??(g=>g);if(p)return{ref:m(p)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${s}/${ag(f)}`}}let u="#",c=`${u}/${s}/`;if(a[1]===i&&!a[1].schema.id)return{ref:u};let d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:c+ag(d)}},r=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:u,defId:c}=t(a);s.def={...s.schema},c&&(s.defId=c);let d=s.schema;for(let p in d)delete d[p];d.$ref=u};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/ + `)}return x.write("payload.value = newResult;"),x.write("return payload;"),x.compile()},a,s=Pt,c=!se.jitless,d=c&&ns.value,p=n.catchall,m;e._zod.parse=(f,g)=>{m??(m=i.value);let y=f.value;return s(y)?c&&d&&g?.async===!1&&g.jitless!==!0?(a||(a=r(n.shape)),f=a(f,g),p?Jm([],y,f,g,m,e,g?.abortEarly===!0):f):o(f,g):(f.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),f)}});function Nm(e,n,o,i){for(let r of e)if(r.issues.length===0)return n.value=r.value,n;let t=e.filter(r=>!me(r));return t.length===1?(n.value=t[0].value,t[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:o,errors:e.map(r=>r.issues.map(a=>$e(a,i,ne())))}),n)}var xr=h("$ZodUnion",(e,n)=>{R.init(e,n),Z(e,"optin",i=>i.def.options.some(t=>t._zod.optin==="defaulted")?"defaulted":i.def.options.some(t=>t._zod.optin!==void 0)?"optional":void 0),Z(e,"optout",i=>i.def.options.some(t=>t._zod.optout==="optional")?"optional":void 0),Z(e,"values",i=>{if(i.def.options.every(t=>t._zod.values))return new Set(i.def.options.flatMap(t=>Array.from(t._zod.values)))}),Z(e,"pattern",i=>{if(i.def.options.every(t=>t._zod.pattern)){let t=i.def.options.map(r=>r._zod.pattern);return new RegExp(`^(${t.map(r=>Qe(r.source)).join("|")})$`)}});let o=n.options.length===1?n.options[0]._zod.run:null;e._zod.parse=(i,t)=>{if(o)return o(i,t);let r=!1,a=[];for(let s of n.options){let c=s._zod.run({value:i.value,issues:[]},t);if(c instanceof Promise)a.push(c),r=!0;else{if(c.issues.length===0)return c;a.push(c)}}return r?Promise.all(a).then(s=>Nm(s,i,e,t)):Nm(a,i,e,t)}});function zm(e,n,o,i){let t=[];for(let r=0;rr.issues.map(a=>$e(a,i,ne())))}):n.issues.push({code:"invalid_union",input:n.value,inst:o,errors:[],inclusive:!1,matches:t}),n)}var uc=h("$ZodXor",(e,n)=>{xr.init(e,n),n.inclusive=!1;let o=n.options.length===1?n.options[0]._zod.run:null;e._zod.parse=(i,t)=>{if(o)return o(i,t);let r=!1,a=[];for(let s of n.options){let c=s._zod.run({value:i.value,issues:[]},t);c instanceof Promise?(a.push(c),r=!0):a.push(c)}return r?Promise.all(a).then(s=>zm(s,i,e,t)):zm(a,i,e,t)}});function cc(e,n){let o=e._zod,i=o.bag.optionsMap;i||(i=qm(o.def),o.bag.optionsMap=i);let t=i.get(n);if(t===null)throw new Error(`Ambiguous discriminator value "${String(n)}"`);return t}function qm(e){let n=new Map;for(let o of e.options){let i=o._zod.propValues?.[e.discriminator];if(!i||i.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let t of i)if(n.has(t)){if(t!==void 0)throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,null)}else n.set(t,o)}return n}var lc=h("$ZodDiscriminatedUnion",(e,n)=>{n.inclusive=!1,xr.init(e,n);let o=e._zod.parse;Z(e,"propValues",t=>{let r={},a=0;for(let s of t.def.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.def.options.indexOf(s)}"`);c[t.def.discriminator]?.has(void 0)&&a++;for(let[l,d]of Object.entries(c)){Object.prototype.hasOwnProperty.call(r,l)||ue(r,l,new Set);for(let p of d)r[l].add(p)}}return!t.def.unionFallback&&a>1&&r[t.def.discriminator]?.delete(void 0),r}),n.options.forEach((t,r)=>{let a=tn(t._zod.def);if(a&&!Object.prototype.hasOwnProperty.call(a,n.discriminator))throw new Error(`Invalid discriminated union option at index "${r}"`)});let i=en(()=>qm(n));e._zod.parse=(t,r)=>{let a=t.value;if(!Pt(a))return t.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),t;let s=a?.[n.discriminator],c=i.value.get(s);return c&&(s!==void 0||r.direction!=="backward")?c._zod.run(t,r):n.unionFallback||r.direction==="backward"?o(t,r):(t.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:n.discriminator,options:Array.from(i.value.keys()).filter(l=>i.value.get(l)!==null),input:a,path:[n.discriminator],inst:e}),t)}}),dc=h("$ZodIntersection",(e,n)=>{R.init(e,n),e._zod.parse=(o,i)=>{let t=o.value,r=n.left._zod.run({value:t,issues:[]},i),a=n.right._zod.run({value:t,issues:[]},i);return r instanceof Promise||a instanceof Promise?Promise.all([r,a]).then(([c,l])=>Cm(o,c,l)):Cm(o,r,a)}});function ln(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(Pe(e)&&Pe(n)){let o=Object.keys(n),i=Object.keys(e).filter(r=>o.indexOf(r)!==-1),t={...e,...n};Object.prototype.hasOwnProperty.call(t,"__proto__")&&delete t.__proto__;for(let r of i){if(r==="__proto__")continue;let a=ln(e[r],n[r]);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};t[r]=a.data}return{valid:!0,data:t}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};let o=[];for(let i=0;i{let p;if(l.code==="unrecognized_keys"&&!l.path?.length)t??(t=l),p=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let m=String(l.path[0]);r.has(m)||r.set(m,l),p=[m]}else return!1;for(let m of p)i.has(m)||i.set(m,{}),i.get(m)[d]=!0;return!0};for(let l of n.issues)a(l,"l")||e.issues.push(l);for(let l of o.issues)a(l,"r")||e.issues.push(l);let s=[...i].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length){let l=t?s.filter(d=>t.keys.includes(d)):[];l.length&&e.issues.push({...t,keys:l});for(let d of s)!l.includes(d)&&r.has(d)&&e.issues.push(r.get(d))}let c=ln(n.value,o.value);if(!c.valid){if(me(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Qo=h("$ZodTuple",(e,n)=>{R.init(e,n);let o=n.items,i=se.memoizer;i?.attach(e),e._zod.parse=(t,r)=>{let a=t.value;if(!Array.isArray(a))return t.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),t;t.value=i?i.alloc(e,t,[],r):[];let s=[],c=Dm(o,"optin"),l=Dm(o,"optout");if(!n.rest){if(a.lengtho.length&&t.issues.push({code:"too_big",maximum:o.length,inclusive:!0,input:a,inst:e,origin:"array"})}let d=new Array(o.length),p=n.rest?r?.abortEarly:void 0,m=!1;for(let f=0;f{d[f]=y})):(d[f]=g,p&&!m&&g.issues.length&&(m=me(g)))}if(n.rest&&!m){let f=o.length-1,g=a.slice(o.length),y=t.issues.length;for(let x of g){if(p&&t.issues.length!==y){if(me(t,y))break;y=t.issues.length}f++;let w=n.rest._zod.run({value:x,issues:[]},r);w instanceof Promise?s.push(w.then(b=>Lm(b,t,f))):Lm(w,t,f)}}return s.length?Promise.all(s).then(()=>Um(d,t,o,a,l)):Um(d,t,o,a,l)}});function Dm(e,n){for(let o=e.length-1;o>=0;o--)if(!(n==="optin"?e[o]._zod.optin!==void 0:e[o]._zod.optout==="optional"))return o+1;return 0}function Lm(e,n,o){e.issues.length&&n.issues.push(..._e(o,e.issues)),n.value[o]=e.value}function Um(e,n,o,i,t){for(let r=0;r=t&&o[r]._zod.optin==="optional"){n.value.length=r;break}if(a.issues.length){if(!s&&r>=t){n.value.length=r;break}n.issues.push(..._e(r,a.issues))}n.value[r]=a.value}for(let r=n.value.length-1;r>=i.length&&(o[r]._zod.optout==="optional"&&n.value[r]===void 0);r--)n.value.length=r;return n}var pc=h("$ZodRecord",(e,n)=>{R.init(e,n);let o=se.memoizer;o?.attach(e),e._zod.parse=(i,t)=>{let r=i.value;if(!Pe(r))return i.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),i;let a=[],s=n.keyType._zod.values;if(s&&!n.partial){i.value=o?o.alloc(e,i,{},t):{};let c=new Set;for(let d of s)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){if(c.add(typeof d=="number"?d.toString():d),d==="__proto__")continue;let p=n.keyType._zod.run({value:d,issues:[]},t);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){i.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(g=>$e(g,t,ne())),input:d,path:[d],inst:e});continue}let m=p.value;if(m==="__proto__")continue;let f=n.valueType._zod.run({value:r[d],issues:[]},t);f instanceof Promise?a.push(f.then(g=>{g.issues.length&&i.issues.push(..._e(d,g.issues)),i.value[m]=g.value})):(f.issues.length&&i.issues.push(..._e(d,f.issues)),i.value[m]=f.value)}let l;for(let d in r)if(!c.has(d))if(n.mode==="loose"){if(d==="__proto__")continue;i.value[d]=r[d]}else l=l??[],l.push(d);l&&l.length>0&&i.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:l,continue:!0})}else{i.value=o?o.alloc(e,i,{},t):{};let c;for(let l of Reflect.ownKeys(r)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(r,l))continue;let d=n.keyType._zod.run({value:l,issues:[]},t);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&et.test(l)&&d.issues.length){let g=n.keyType._zod.run({value:Number(l),issues:[]},t);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(d=g)}if(d.issues.length){n.mode==="loose"?i.value[l]=r[l]:s?(c=c??[],c.push(l)):i.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(g=>$e(g,t,ne())),input:l,path:[l],inst:e});continue}let m=d.value;if(m==="__proto__")continue;let f=n.valueType._zod.run({value:r[l],issues:[]},t);f instanceof Promise?a.push(f.then(g=>{g.issues.length&&i.issues.push(..._e(l,g.issues)),i.value[m]=g.value})):(f.issues.length&&i.issues.push(..._e(l,f.issues)),i.value[m]=f.value)}c&&c.length>0&&i.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:c,continue:!0})}return a.length?Promise.all(a).then(()=>i):i}}),mc=h("$ZodMap",(e,n)=>{R.init(e,n);let o=se.memoizer;o?.attach(e),e._zod.parse=(i,t)=>{let r=i.value;if(!(r instanceof Map))return i.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),i;let a=[];i.value=o?o.alloc(e,i,new Map,t):new Map;let s=t?.abortEarly,c=i.issues.length;for(let[l,d]of r){if(s&&i.issues.length!==c){if(me(i,c))break;c=i.issues.length}let p=n.keyType._zod.run({value:l,issues:[]},t),m=n.valueType._zod.run({value:d,issues:[]},t);p instanceof Promise||m instanceof Promise?a.push(Promise.all([p,m]).then(([f,g])=>{jm(f,g,i,l,r,e,t)})):jm(p,m,i,l,r,e,t)}return a.length?Promise.all(a).then(()=>i):i},ic(e,U$)});function jm(e,n,o,i,t,r,a){e.issues.length&&(nr.has(typeof i)?o.issues.push(..._e(i,e.issues)):o.issues.push({code:"invalid_key",origin:"map",input:t,inst:r,issues:e.issues.map(s=>$e(s,a,ne()))})),n.issues.length&&(nr.has(typeof i)?o.issues.push(..._e(i,n.issues)):o.issues.push({origin:"map",code:"invalid_element",input:t,inst:r,key:i,issues:n.issues.map(s=>$e(s,a,ne()))})),o.value.set(e.value,n.value)}var fc=h("$ZodSet",(e,n)=>{R.init(e,n);let o=se.memoizer;o?.attach(e),e._zod.parse=(i,t)=>{let r=i.value;if(!(r instanceof Set))return i.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),i;let a=[];i.value=o?o.alloc(e,i,new Set,t):new Set;let s=t?.abortEarly,c=i.issues.length;for(let l of r){if(s&&i.issues.length!==c){if(me(i,c))break;c=i.issues.length}let d=n.valueType._zod.run({value:l,issues:[]},t);d instanceof Promise?a.push(d.then(p=>Rm(p,i))):Rm(d,i)}return a.length?Promise.all(a).then(()=>i):i},ic(e,j$)});function Rm(e,n){e.issues.length&&n.issues.push(...e.issues),n.value.add(e.value)}var gc=h("$ZodEnum",(e,n)=>{R.init(e,n);let o=Yt(n.entries),i=new Set(o);e._zod.values=i,Z(e,"pattern",t=>{let r=Yt(t.def.entries).filter(a=>nr.has(typeof a));return new RegExp(r.length?`^(${r.map(a=>Te(a.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(t,r)=>{let a=t.value;return i.has(a)||t.issues.push({code:"invalid_value",values:o,input:a,inst:e}),t}}),hc=h("$ZodLiteral",(e,n)=>{R.init(e,n);let o=new Set(n.values);e._zod.values=o,Z(e,"pattern",i=>{let t=i.def.values;return new RegExp(t.length?`^(${t.map(r=>typeof r=="string"?Te(r):r?Te(r.toString()):String(r)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(i,t)=>{let r=i.value;return o.has(r)||i.issues.push({code:"invalid_value",values:n.values,input:r,inst:e}),i}}),vc=h("$ZodFile",(e,n)=>{R.init(e,n),e._zod.parse=(o,i)=>{let t=o.value;return t instanceof File||o.issues.push({expected:"file",code:"invalid_type",input:t,inst:e}),o}}),yc=h("$ZodTransform",(e,n)=>{R.init(e,n),e._zod.optin="optional",se.memoizer?.guard(e),e._zod.parse=(o,i)=>{if(i.direction==="backward")throw new st(e.constructor.name);let t=n.transform(o.value,o);if(i.async)return(t instanceof Promise?t:Promise.resolve(t)).then(a=>(o.value=a,o));if(t instanceof Promise)throw new ke;return o.value=t,o}});function Mm(e,n){return e.value=n.issues.length?void 0:n.value,e}var ei=h("$ZodOptional",(e,n)=>{R.init(e,n),Z(e,"optin",o=>o.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Z(e,"values",o=>{let i=o.def.innerType._zod.values;return i?new Set([...i,void 0]):void 0}),Z(e,"pattern",o=>{let i=o.def.innerType._zod.pattern;return i?new RegExp(`^(${Qe(i.source)})?$`):void 0}),e._zod.parse=(o,i)=>{if(o.value===void 0){if(n.innerType._zod.optin!=="defaulted")return o;let t=n.innerType._zod.run({value:o.value,issues:[]},i);return t instanceof Promise?t.then(r=>Mm(o,r)):Mm(o,t)}return n.innerType._zod.run(o,i)}}),bc=h("$ZodExactOptional",(e,n)=>{ei.init(e,n),Z(e,"values",o=>o.def.innerType._zod.values),Z(e,"pattern",o=>o.def.innerType._zod.pattern),e._zod.parse=(o,i)=>n.innerType._zod.run(o,i)}),_c=h("$ZodNullable",(e,n)=>{R.init(e,n),Z(e,"optin",o=>o.def.innerType._zod.optin),Z(e,"optout",o=>o.def.innerType._zod.optout),Z(e,"pattern",o=>{let i=o.def.innerType._zod.pattern;return i?new RegExp(`^(${Qe(i.source)}|null)$`):void 0}),Z(e,"values",o=>o.def.innerType._zod.values?new Set([...o.def.innerType._zod.values,null]):void 0),e._zod.parse=(o,i)=>o.value===null?o:n.innerType._zod.run(o,i)}),$c=h("$ZodDefault",(e,n)=>{R.init(e,n),e._zod.optin="defaulted",Z(e,"values",o=>o.def.innerType._zod.values),e._zod.parse=(o,i)=>{if(i.direction==="backward")return n.innerType._zod.run(o,i);if(o.value===void 0)return o.value=n.defaultValue,o;let t=n.innerType._zod.run(o,i);return t instanceof Promise?t.then(r=>Fm(r,n)):Fm(t,n)}});function Fm(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}var kc=h("$ZodPrefault",(e,n)=>{R.init(e,n),e._zod.optin="defaulted",Z(e,"values",o=>o.def.innerType._zod.values),e._zod.parse=(o,i)=>(i.direction==="backward"||o.value===void 0&&(o.value=n.defaultValue),n.innerType._zod.run(o,i))}),xc=h("$ZodNonOptional",(e,n)=>{R.init(e,n),Z(e,"values",o=>{let i=o.def.innerType._zod.values;return i?new Set([...i].filter(t=>t!==void 0)):void 0}),e._zod.parse=(o,i)=>{let t=n.innerType._zod.run(o,i);return t instanceof Promise?t.then(r=>Zm(r,e)):Zm(t,e)}});function Zm(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}var Ic=h("$ZodSuccess",(e,n)=>{R.init(e,n),e._zod.parse=(o,i)=>{if(i.direction==="backward")throw new st("ZodSuccess");let t=n.innerType._zod.run(o,i);return t instanceof Promise?t.then(r=>(o.value=r.issues.length===0,o)):(o.value=t.issues.length===0,o)}});function Gm(e,n,o,i){return n.issues.length?(e.value=o.catchValue({...n,value:e.value,error:{issues:n.issues.map(t=>$e(t,i,ne()))},input:e.value}),e):(e.value=n.value,n.memo&&(e.memo=!0),e)}var wc=h("$ZodCatch",(e,n)=>{R.init(e,n),Z(e,"optin",o=>o.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Z(e,"optout",o=>o.def.innerType._zod.optout),Z(e,"values",o=>o.def.innerType._zod.values),e._zod.parse=(o,i)=>{if(i.direction==="backward")return n.innerType._zod.run(o,i);let t=n.innerType._zod.run({value:o.value,issues:[]},i);return t instanceof Promise?t.then(r=>Gm(o,r,n,i)):Gm(o,t,n,i)}}),Sc=h("$ZodNaN",(e,n)=>{R.init(e,n),e._zod.parse=(o,i)=>((typeof o.value!="number"||!Number.isNaN(o.value))&&o.issues.push({input:o.value,inst:e,expected:"nan",code:"invalid_type"}),o)}),ti=h("$ZodPipe",(e,n)=>{R.init(e,n),Z(e,"values",o=>o.def.in._zod.values),Z(e,"optin",o=>o.def.in._zod.optin),Z(e,"optout",o=>o.def.out._zod.optout),Z(e,"propValues",o=>o.def.in._zod.propValues),e._zod.parse=(o,i)=>{if(i.direction==="backward"){let r=n.out._zod.run(o,i);return r instanceof Promise?r.then(a=>Uo(a,n.in,i)):Uo(r,n.in,i)}let t=n.in._zod.run(o,i);return t instanceof Promise?t.then(r=>Uo(r,n.out,i)):Uo(t,n.out,i)}});function Uo(e,n,o){return e.issues.some(i=>i.code!=="unrecognized_keys")?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},o)}var Ir=h("$ZodCodec",(e,n)=>{R.init(e,n),Z(e,"values",o=>o.def.in._zod.values),Z(e,"optin",o=>o.def.in._zod.optin),Z(e,"optout",o=>o.def.out._zod.optout),Z(e,"propValues",o=>o.def.in._zod.propValues),e._zod.parse=(o,i)=>{if((i.direction||"forward")==="forward"){let r=n.in._zod.run(o,i);return r instanceof Promise?r.then(a=>jo(a,n,i)):jo(r,n,i)}else{let r=n.out._zod.run(o,i);return r instanceof Promise?r.then(a=>jo(a,n,i)):jo(r,n,i)}}});function jo(e,n,o){if(e.issues.length)return e.aborted=!0,e;if((o.direction||"forward")==="forward"){let t=n.transform(e.value,e);return t instanceof Promise?t.then(r=>Ro(e,r,n.out,o)):Ro(e,t,n.out,o)}else{let t=n.reverseTransform(e.value,e);return t instanceof Promise?t.then(r=>Ro(e,r,n.in,o)):Ro(e,t,n.in,o)}}function Ro(e,n,o,i){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:n,issues:e.issues},i)}var Pc=h("$ZodPreprocess",(e,n)=>{ti.init(e,n)}),Tc=h("$ZodReadonly",(e,n)=>{R.init(e,n),Z(e,"propValues",o=>o.def.innerType._zod.propValues),Z(e,"values",o=>o.def.innerType._zod.values),Z(e,"optin",o=>o.def.innerType?._zod?.optin),Z(e,"optout",o=>o.def.innerType?._zod?.optout),e._zod.parse=(o,i)=>{if(i.direction==="backward")return n.innerType._zod.run(o,i);let t=n.innerType._zod.run(o,i);return t instanceof Promise?t.then(Vm):Vm(t)}});function Vm(e){return e.memo||(e.value=Object.freeze(e.value)),e}function M$(e){let n=e._zod.def,o=n.pattern,i=!!n.format?.includes("int"),t,r;for(let s of n.checks??[]){let c=s._zod.def;c.pattern&&(o=c.pattern),i||(i=!!c.format?.includes("int"));let l=c.minimum??c.length,d=c.maximum??c.length;l!==void 0&&(t===void 0||l>t)&&(t=l),d!==void 0&&(r===void 0||dr)return"(?!)";if(t!==void 0||r!==void 0)return Gs({minimum:t,maximum:r}).source;let a=e._zod.pattern;return(i&&a===et?fr:a)?.source}function bu(e){let n=e._zod.def,o=e._zod.pattern?.source,i=n.innerType??e._zod.innerType;if(i){let t=i._zod.pattern?.source,r=bu(i);return o&&t&&r&&r!==t?o.replace(Qe(t),()=>Qe(r)):o}if(n.options){let t=n.options.map(bu);if(t.every(Boolean))return`^(${t.map(r=>Qe(r)).join("|")})$`}return M$(e)}var Ec=h("$ZodTemplateLiteral",(e,n)=>{R.init(e,n);let o=[];for(let i of n.parts)if(typeof i=="object"&&i!==null){let t=bu(i);if(!t)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);o.push(Qe(t))}else if(i===null||rs.has(typeof i))o.push(Te(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${o.join("")}$`),e._zod.parse=(i,t)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"string",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:n.format??"template_literal",pattern:e._zod.pattern.source}),i)}),Ac=h("$ZodFunction",(e,n)=>(R.init(e,n),Object.defineProperty(e,"_def",{value:n}),e._zod.def=n,e.implement=o=>{if(typeof o!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...i){let t=e._def.input?$o(e._def.input,i):i,r=Reflect.apply(o,this,t);return e._def.output?$o(e._def.output,r):r},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=o=>{if(typeof o!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...i){let t=e._def.input?await ko(e._def.input,i):i,r=await Reflect.apply(o,this,t);return e._def.output?await ko(e._def.output,r):r},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(o,i)=>typeof o.value!="function"?(o.issues.push({code:"invalid_type",expected:"function",input:o.value,inst:e}),o):(e._def.output&&e._def.output._zod.def.type==="promise"?o.value=e.implementAsync(o.value):o.value=e.implement(o.value),o),e.input=(...o)=>{let i=e.constructor;return Array.isArray(o[0])?new i({type:"function",input:new Qo({type:"tuple",items:o[0],rest:o[1]}),output:e._def.output}):new i({type:"function",input:o[0],output:e._def.output})},e.output=o=>{let i=e.constructor;return new i({type:"function",input:e._def.input,output:o})},e)),Oc=h("$ZodPromise",(e,n)=>{R.init(e,n),e._zod.parse=(o,i)=>Promise.resolve(o.value).then(t=>n.innerType._zod.run({value:t,issues:[]},i))}),wr=h("$ZodLazy",(e,n)=>{R.init(e,n),es(e._zod,"innerType",()=>{let o=n;return o._cachedInner||(o._cachedInner=n.getter()),o._cachedInner}),Z(e,"pattern",o=>o.innerType?._zod?.pattern),Z(e,"propValues",o=>o.innerType?._zod?.propValues),Z(e,"optin",o=>o.innerType?._zod?.optin??void 0),Z(e,"optout",o=>o.innerType?._zod?.optout??void 0),e._zod.parse=(o,i)=>e._zod.innerType._zod.run(o,i)}),Nc=h("$ZodCustom",(e,n)=>{Y.init(e,n),R.init(e,n),e._zod.parse=(o,i)=>o,e._zod.check=o=>{let i=o.value,t=n.fn(i);if(t instanceof Promise)return t.then(r=>Hm(r,o,i,e));Hm(t,o,i,e)}});function Hm(e,n,o,i){if(!e){let t={code:"custom",input:o,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(t.params=i._zod.def.params),n.issues.push(rn(t))}}var ii=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},Cc="~memo",Qm=[];function ef(e){return e!==null&&typeof e=="object"}function zc(e){return e.map(n=>n.path?{...n,path:n.path.slice()}:{...n})}var tf=new WeakMap,dn=0,oi=1,Sr=2;function Pr(e,n,o){let i=tf.get(e);if(i!==void 0)return i?Sr:dn;if(n.has(e))return Sr;n.add(e);let t=dn,r=d=>{if(t!==Sr&&d?._zod){let p=Pr(d,n,o);p>t&&(t=p)}},a=(d,p)=>{let m=dn;for(let f of Reflect.ownKeys(d)){let g=Object.getOwnPropertyDescriptor(d,f);if(p&&!g.enumerable)continue;let y=g.get?oi:g.value?._zod?Pr(g.value,n,o):dn;y>m&&(m=y)}return m},s=d=>{d>t&&(t=d)},c=e._zod.def,l=c.type;switch(l){case"object":{let d=tn(c);s(d?a(d,!0):oi),r(c.catchall);break}case"array":r(c.element);break;case"tuple":for(let d of c.items)r(d);r(c.rest);break;case"record":case"map":r(c.keyType),r(c.valueType);break;case"set":r(c.valueType);break;case"union":for(let d of c.options)r(d);break;case"intersection":r(c.left),r(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":r(c.innerType);break;case"pipe":r(c.in),r(c.out);break;case"function":r(c.input),r(c.output);break;case"lazy":{let d=c._cachedInner??(o?e._zod.innerType:void 0);s(d?Pr(d,n,!1):oi);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let d in c){let p=Object.getOwnPropertyDescriptor(c,d);if(!p||p.get)continue;let m=p.value;if(!(!m||typeof m!="object")){if(m._zod)r(m);else if(Array.isArray(m))for(let f of m)r(f)}}}return n.delete(e),F$(e,t)}function F$(e,n){return n!==oi&&tf.set(e,n===Sr),n}function ai(e){return Pr(e,new Set,!0)!==dn}function Z$(e,n){let o=e.buckets.get(n);return o||(o=new WeakMap,e.buckets.set(n,o)),o}var ni,ri=[],G$={alloc(e,n,o){let i=ni;if(!i)return o;ni=void 0;let t={value:o,issues:null};return i.set(n.value,t),ri.push(t),o},guard(e){var n;(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred.push(()=>{let o=e._zod.parse,i=(t,r)=>{if(r.direction!=="backward"&&si(r,t.value))throw new ii;return o(t,r)};e._zod.parse=i,e._zod.run===o&&(e._zod.run=i)})},attach(e){var n;let o,i=!1,t,r;(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred.push(()=>{let a=e._zod.parse,s=(c,l)=>{if(o===void 0){let w=Pr(e,new Set,!1);if(w===dn)return e._zod.parse=a,e._zod.run===s&&(e._zod.run=a),a(c,l);w===Sr||i?o=!0:i=!0}let d=c.value;if(!ef(d))return a(c,l);let p=l[Cc];p||(p={buckets:new WeakMap,backEdges:void 0},l[Cc]=p);let m;t===l?m=r:(m=Z$(p,e),t=l,r=m);let f=m.get(d);if(f)return c.value=f.value,f.issues?f.issues.length&&c.issues.push(...zc(f.issues)):(c.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(f.value)),c;ni=m;let g=ri.length,y=a(c,l);ni=void 0;let x=ri.length>g?ri.pop():void 0;return y instanceof Promise?y.then(w=>(x&&(x.issues=w.issues.length?zc(w.issues):Qm),w)):(x&&(x.issues=y.issues.length?zc(y.issues):Qm),y)};e._zod.parse=s,e._zod.run===a&&(e._zod.run=s)})}};function Tr(){return G$}function si(e,n){let o=e[Cc]?.backEdges;return o!==void 0&&ef(n)&&o.has(n)}var Ar={};qe(Ar,{ar:()=>nf,az:()=>rf,be:()=>af,bg:()=>sf,bn:()=>uf,ca:()=>cf,ckb:()=>lf,cs:()=>df,da:()=>pf,de:()=>mf,el:()=>ff,en:()=>ui,eo:()=>gf,es:()=>hf,fa:()=>vf,fi:()=>yf,fr:()=>bf,frCA:()=>_f,gu:()=>$f,he:()=>kf,hi:()=>xf,hr:()=>If,hu:()=>wf,hy:()=>Pf,id:()=>Tf,is:()=>Ef,it:()=>Af,ja:()=>Of,ka:()=>Nf,kh:()=>zf,km:()=>ci,kn:()=>Cf,ko:()=>Df,lt:()=>Uf,mk:()=>jf,ms:()=>Rf,ne:()=>Mf,nl:()=>Ff,nn:()=>Zf,no:()=>Gf,ota:()=>Vf,pl:()=>Bf,ps:()=>Hf,pt:()=>Wf,ptBR:()=>Kf,ro:()=>Jf,ru:()=>qf,sk:()=>Yf,sl:()=>Qf,sv:()=>eg,ta:()=>tg,tg:()=>ng,th:()=>rg,tk:()=>og,tr:()=>ig,ua:()=>ag,uk:()=>li,ur:()=>sg,uz:()=>ug,vi:()=>cg,yo:()=>pg,zhCN:()=>lg,zhTW:()=>dg});var V$=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"},map:{unit:"عنصر",verb:"أن يحوي"}};function n(t){return e[t]??null}let o={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",mac:"عنوان MAC",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",credit_card:"رقم بطاقة الائتمان",currency_code:"رمز العملة",iban:"IBAN",jwt:"JWT",template_literal:"مدخل"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${t.expected}، ولكن تم إدخال ${s}`:`مدخلات غير مقبولة: يفترض إدخال ${r}، ولكن تم إدخال ${s}`}case"invalid_value":return t.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${$(t.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?` أكبر من اللازم: يفترض أن تكون ${t.origin??"القيمة"} ${r} ${t.maximum.toString()} ${a.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${t.origin??"القيمة"} ${r} ${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`أصغر من اللازم: يفترض لـ ${t.origin} أن يكون ${r} ${t.minimum.toString()} ${a.unit}`:`أصغر من اللازم: يفترض لـ ${t.origin} أن يكون ${r} ${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${t.prefix}"`:r.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${r.suffix}"`:r.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${r.includes}"`:r.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${r.pattern}`:`${o[r.format]??t.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${t.divisor}`;case"unrecognized_keys":return`معرف${t.keys.length>1?"ات":""} غريب${t.keys.length>1?"ة":""}: ${v(t.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${t.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${t.origin}`;default:return"مدخل غير مقبول"}}};function nf(){return{localeError:V$()}}var H$=()=>{let e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"},map:{unit:"element",verb:"olmalıdır"}};function n(t){return e[t]??null}let o={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"kredit kartı nömrəsi",currency_code:"valyuta kodu",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Yanlış dəyər: gözlənilən instanceof ${t.expected}, daxil olan ${s}`:`Yanlış dəyər: gözlənilən ${r}, daxil olan ${s}`}case"invalid_value":return t.values.length===1?`Yanlış dəyər: gözlənilən ${$(t.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Çox böyük: gözlənilən ${t.origin??"dəyər"} ${r}${t.maximum.toString()} ${a.unit??"element"}`:`Çox böyük: gözlənilən ${t.origin??"dəyər"} ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Çox kiçik: gözlənilən ${t.origin} ${r}${t.minimum.toString()} ${a.unit}`:`Çox kiçik: gözlənilən ${t.origin} ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Yanlış mətn: "${r.prefix}" ilə başlamalıdır`:r.format==="ends_with"?`Yanlış mətn: "${r.suffix}" ilə bitməlidir`:r.format==="includes"?`Yanlış mətn: "${r.includes}" daxil olmalıdır`:r.format==="regex"?`Yanlış mətn: ${r.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${o[r.format]??t.format}`}case"not_multiple_of":return`Yanlış ədəd: ${t.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${t.keys.length>1?"lar":""}: ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${t.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function rf(){return{localeError:H$()}}function of(e,n,o,i){let t=Math.abs(e),r=t%10,a=t%100;return a>=11&&a<=19?i:r===1?n:r>=2&&r<=4?o:i}var B$=()=>{let e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},map:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function n(t){return e[t]??null}let o={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",mac:"MAC адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",credit_card:"нумар крэдытнай карты",currency_code:"код валюты",iban:"IBAN",jwt:"JWT",template_literal:"увод"},i={nan:"NaN",number:"лік",array:"масіў"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Няправільны ўвод: чакаўся instanceof ${t.expected}, атрымана ${s}`:`Няправільны ўвод: чакаўся ${r}, атрымана ${s}`}case"invalid_value":return t.values.length===1?`Няправільны ўвод: чакалася ${$(t.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);if(a){let s=Number(t.maximum),c=of(s,a.unit.one,a.unit.few,a.unit.many);return`Занадта вялікі: чакалася, што ${t.origin??"значэнне"} павінна ${a.verb} ${r}${t.maximum.toString()} ${c}`}return`Занадта вялікі: чакалася, што ${t.origin??"значэнне"} павінна быць ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);if(a){let s=Number(t.minimum),c=of(s,a.unit.one,a.unit.few,a.unit.many);return`Занадта малы: чакалася, што ${t.origin} павінна ${a.verb} ${r}${t.minimum.toString()} ${c}`}return`Занадта малы: чакалася, што ${t.origin} павінна быць ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${r.prefix}"`:r.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${r.suffix}"`:r.format==="includes"?`Няправільны радок: павінен змяшчаць "${r.includes}"`:r.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${r.pattern}`:`Няправільны ${o[r.format]??t.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${t.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${t.keys.length>1?"ключы":"ключ"}: ${v(t.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${t.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${t.origin}`;default:return"Няправільны ўвод"}}};function af(){return{localeError:B$()}}var W$=()=>{let e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"},map:{unit:"елемента",verb:"да съдържа"}};function n(t){return e[t]??null}let o={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",mac:"MAC адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",credit_card:"номер на кредитна карта",currency_code:"код на валута",iban:"IBAN",jwt:"JWT",template_literal:"вход"},i={nan:"NaN",number:"число",array:"масив"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Невалиден вход: очакван instanceof ${t.expected}, получен ${s}`:`Невалиден вход: очакван ${r}, получен ${s}`}case"invalid_value":return t.values.length===1?`Невалиден вход: очакван ${$(t.values[0])}`:`Невалидна опция: очаквано едно от ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Твърде голямо: очаква се ${t.origin??"стойност"} да съдържа ${r}${t.maximum.toString()} ${a.unit??"елемента"}`:`Твърде голямо: очаква се ${t.origin??"стойност"} да бъде ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Твърде малко: очаква се ${t.origin} да съдържа ${r}${t.minimum.toString()} ${a.unit}`:`Твърде малко: очаква се ${t.origin} да бъде ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;if(r.format==="starts_with")return`Невалиден низ: трябва да започва с "${r.prefix}"`;if(r.format==="ends_with")return`Невалиден низ: трябва да завършва с "${r.suffix}"`;if(r.format==="includes")return`Невалиден низ: трябва да включва "${r.includes}"`;if(r.format==="regex")return`Невалиден низ: трябва да съвпада с ${r.pattern}`;let a="Невалиден";return r.format==="emoji"&&(a="Невалидно"),r.format==="datetime"&&(a="Невалидно"),r.format==="date"&&(a="Невалидна"),r.format==="time"&&(a="Невалидно"),r.format==="duration"&&(a="Невалидна"),`${a} ${o[r.format]??t.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${t.divisor}`;case"unrecognized_keys":return`Неразпознат${t.keys.length>1?"и":""} ключ${t.keys.length>1?"ове":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${t.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${t.origin}`;default:return"Невалиден вход"}}};function sf(){return{localeError:W$()}}var K$=()=>{let e={string:{unit:"অক্ষর",verb:"থাকতে হবে"},file:{unit:"বাইট",verb:"থাকতে হবে"},array:{unit:"আইটেম",verb:"থাকতে হবে"},set:{unit:"আইটেম",verb:"থাকতে হবে"},map:{unit:"এন্ট্রি",verb:"থাকতে হবে"}};function n(t){return e[t]??null}let o={regex:"ইনপুট",email:"ইমেইল ঠিকানা",url:"URL",emoji:"ইমোজি",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO তারিখ ও সময়",date:"ISO তারিখ",time:"ISO সময়",duration:"ISO সময়কাল",ipv4:"IPv4 ঠিকানা",ipv6:"IPv6 ঠিকানা",mac:"MAC ঠিকানা",cidrv4:"IPv4 রেঞ্জ",cidrv6:"IPv6 রেঞ্জ",base64:"base64-এনকোডেড স্ট্রিং",base64url:"base64url-এনকোডেড স্ট্রিং",json_string:"JSON স্ট্রিং",e164:"E.164 নম্বর",credit_card:"ক্রেডিট কার্ড নম্বর",currency_code:"মুদ্রা কোড",iban:"IBAN",jwt:"JWT",template_literal:"ইনপুট"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return`অবৈধ ইনপুট: প্রত্যাশিত ${r}, প্রাপ্ত ${s}`}case"invalid_value":return t.values.length===1?`অবৈধ ইনপুট: প্রত্যাশিত ${$(t.values[0])}`:`অবৈধ অপশন: ${v(t.values," | ")} এর মধ্যে একটি প্রত্যাশিত`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`অনেক বড়: ${t.origin??"মান"} ${r}${t.maximum.toString()} ${a.unit??"এলিমেন্ট"} হতে হবে`:`অনেক বড়: ${t.origin??"মান"} ${r}${t.maximum.toString()} হতে হবে`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`অনেক ছোট: ${t.origin} ${r}${t.minimum.toString()} ${a.unit} হতে হবে`:`অনেক ছোট: ${t.origin} ${r}${t.minimum.toString()} হতে হবে`}case"invalid_format":{let r=t;return r.format==="starts_with"?`অবৈধ স্ট্রিং: "${r.prefix}" দিয়ে শুরু হতে হবে`:r.format==="ends_with"?`অবৈধ স্ট্রিং: "${r.suffix}" দিয়ে শেষ হতে হবে`:r.format==="includes"?`অবৈধ স্ট্রিং: "${r.includes}" অন্তর্ভুক্ত থাকতে হবে`:r.format==="regex"?`অবৈধ স্ট্রিং: ${r.pattern} প্যাটার্ন মিলতে হবে`:`অবৈধ ${o[r.format]??t.format}`}case"not_multiple_of":return`অবৈধ নম্বর: ${t.divisor} এর গুণিতক হতে হবে`;case"unrecognized_keys":return`অচেনা কী${t.keys.length>1?"গুলো":""}: ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} এ অবৈধ কী`;case"invalid_union":return t.options&&Array.isArray(t.options)&&t.options.length>0?`অবৈধ ডিসক্রিমিনেটর মান। প্রত্যাশিত ${t.options.map(a=>`'${a}'`).join(" | ")}`:"অবৈধ ইনপুট";case"invalid_element":return`${t.origin} এ অবৈধ মান`;default:return"অবৈধ ইনপুট"}}};function uf(){return{localeError:K$()}}var J$=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"},map:{unit:"elements",verb:"contenir"}};function n(t){return e[t]??null}let o={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",mac:"adreça MAC",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",credit_card:"número de targeta de crèdit",currency_code:"codi de moneda",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Tipus invàlid: s'esperava instanceof ${t.expected}, s'ha rebut ${s}`:`Tipus invàlid: s'esperava ${r}, s'ha rebut ${s}`}case"invalid_value":return t.values.length===1?`Valor invàlid: s'esperava ${$(t.values[0])}`:`Opció invàlida: s'esperava una de ${v(t.values," o ")}`;case"too_big":{let r=t.inclusive?"com a màxim":"menys de",a=n(t.origin);return a?`Massa gran: s'esperava que ${t.origin??"el valor"} contingués ${r} ${t.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${t.origin??"el valor"} fos ${r} ${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?"com a mínim":"més de",a=n(t.origin);return a?`Massa petit: s'esperava que ${t.origin} contingués ${r} ${t.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${t.origin} fos ${r} ${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Format invàlid: ha de començar amb "${r.prefix}"`:r.format==="ends_with"?`Format invàlid: ha d'acabar amb "${r.suffix}"`:r.format==="includes"?`Format invàlid: ha d'incloure "${r.includes}"`:r.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${r.pattern}`:`Format invàlid per a ${o[r.format]??t.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${t.divisor}`;case"unrecognized_keys":return`Clau${t.keys.length>1?"s":""} no reconeguda${t.keys.length>1?"s":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${t.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${t.origin}`;default:return"Entrada invàlida"}}};function cf(){return{localeError:J$()}}var X$=()=>{let e={string:{unit:"پیت",verb:"بێت"},file:{unit:"بایت",verb:"بێت"},array:{unit:"دانە",verb:"بێت"},set:{unit:"دانە",verb:"بێت"},map:{unit:"دانە",verb:"بێت"}};function n(t){return e[t]??null}let o={regex:"regex",email:"ئیمەیڵ",url:"بەستەر (URL)",emoji:"ئیمۆجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ڕێکەوت و کات",date:"ڕێکەوت",time:"کات",duration:"ماوە",ipv4:"ناونیشانی IPv4",ipv6:"ناونیشانی IPv6",mac:"ناونیشانی MAC",cidrv4:"مەودای IPv4",cidrv6:"مەودای IPv6",base64:"دەقی base64",base64url:"دەقی base64url",json_string:"دەقی JSON",e164:"ژمارەی E.164",credit_card:"ژمارەی کارتی کرێدیت",currency_code:"کۆدی دراو",iban:"IBAN",jwt:"JWT",template_literal:"تێکردە"},i={nan:"NaN",string:"نووسین",number:"ژمارە",boolean:"boolean",array:"array",object:"object",date:"ڕێکەوت",integer:"ژمارە",float:"ژمارە",null:"null",undefined:"undefined",function:"function",symbol:"symbol",unknown:"unknown",promise:"promise",void:"void",never:"never",map:"map",set:"set"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a,c=["ا","و","ۆ","وو","ە","ی","ێ"].some(d=>s.endsWith(d))?"یە":"ە",l=/^[a-zA-Z]+$/.test(s);return a==="null"||a==="undefined"?"داواکراوە":`چاوەڕوانکراوە ${r} بێت، بەڵام ${s}${l?"":c}`}case"invalid_value":return t.values.length===1?`بەهاکە نادرووستە: چاوەڕوانکراوە ${$(t.values[0])} بێت`:`هەڵبژاردەی نادروست: چاوەڕوانکراوە یەکێک بێت لە ${v(t.values,"|")}`;case"too_big":{let r=n(t.origin);return r?`پێویستە بە لایەنی زۆرەوە ${t.maximum.toString()} ${r.unit} ${r.verb}`:`پێویستە بە لایەنی زۆرەوە ${t.maximum.toString()} بێت`}case"too_small":{let r=n(t.origin);return r?`پێویستە بە لایەنی کەمەوە ${t.minimum.toString()} ${r.unit} ${r.verb}`:`پێویستە بە لایەنی کەمەوە ${t.minimum.toString()} بێت`}case"invalid_format":{let r=t;return r.format==="starts_with"?`دەقی نادروست: پێویستە دەستپێبکات بە "${r.prefix}"`:r.format==="ends_with"?`دەقی نادروست: پێویستە کۆتاییبێت بە "${r.suffix}"`:r.format==="includes"?`دەقی نادروست: پێویستە "${r.includes}" لەخۆبگرێت`:r.format==="regex"?`دەقی نادروست: پێویستە لەگەڵ پاتێرنی ${r.pattern} بگونجێت`:`بەهای ${o[r.format]??t.format} نادروستە`}case"not_multiple_of":return`ژمارەی نادروست: دەبێت چەند هێندە بێت بۆ ${t.divisor}`;case"unrecognized_keys":return`کلیلی نەناسراو: ${v(t.keys,", ")}`;case"invalid_key":return`کلیلی نادروست لە ${t.origin}`;case"invalid_union":return t.options&&Array.isArray(t.options)&&t.options.length>0?`بەهای نەناسراو هەیە. بەهای چاوەڕوانکراو: ${t.options.map(a=>`'${a}'`).join(" | ")}`:"یەکگرتنی نادروست";case"invalid_element":return`${t.origin} بەهاکە نادروستە`;default:return"تێکردەی نادروست"}}};function lf(){return{localeError:X$()}}var q$=()=>{let e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"},map:{unit:"prvků",verb:"mít"}};function n(t){return e[t]??null}let o={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",credit_card:"číslo kreditní karty",currency_code:"kód měny",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Neplatný vstup: očekáváno instanceof ${t.expected}, obdrženo ${s}`:`Neplatný vstup: očekáváno ${r}, obdrženo ${s}`}case"invalid_value":return t.values.length===1?`Neplatný vstup: očekáváno ${$(t.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Hodnota je příliš velká: ${t.origin??"hodnota"} musí mít ${r}${t.maximum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš velká: ${t.origin??"hodnota"} musí být ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Hodnota je příliš malá: ${t.origin??"hodnota"} musí mít ${r}${t.minimum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš malá: ${t.origin??"hodnota"} musí být ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Neplatný řetězec: musí začínat na "${r.prefix}"`:r.format==="ends_with"?`Neplatný řetězec: musí končit na "${r.suffix}"`:r.format==="includes"?`Neplatný řetězec: musí obsahovat "${r.includes}"`:r.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${r.pattern}`:`Neplatný formát ${o[r.format]??t.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${t.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${v(t.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${t.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${t.origin}`;default:return"Neplatný vstup"}}};function df(){return{localeError:q$()}}var Y$=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"},map:{unit:"elementer",verb:"indeholdt"}};function n(t){return e[t]??null}let o={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kreditkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Ugyldigt input: forventede instanceof ${t.expected}, fik ${s}`:`Ugyldigt input: forventede ${r}, fik ${s}`}case"invalid_value":return t.values.length===1?`Ugyldig værdi: forventede ${$(t.values[0])}`:`Ugyldigt valg: forventede en af følgende ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin),s=i[t.origin]??t.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${r} ${t.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${r} ${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin),s=i[t.origin]??t.origin;return a?`For lille: forventede ${s} ${a.verb} ${r} ${t.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${r} ${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ugyldig streng: skal starte med "${r.prefix}"`:r.format==="ends_with"?`Ugyldig streng: skal ende med "${r.suffix}"`:r.format==="includes"?`Ugyldig streng: skal indeholde "${r.includes}"`:r.format==="regex"?`Ugyldig streng: skal matche mønsteret ${r.pattern}`:`Ugyldig ${o[r.format]??t.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${v(t.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${t.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${t.origin}`;default:return"Ugyldigt input"}}};function pf(){return{localeError:Y$()}}var Q$=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"},map:{unit:"Elemente",verb:"zu haben"}};function n(t){return e[t]??null}let o={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",mac:"MAC-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",credit_card:"Kreditkartennummer",currency_code:"Währungscode",iban:"IBAN",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Ungültige Eingabe: erwartet instanceof ${t.expected}, erhalten ${s}`:`Ungültige Eingabe: erwartet ${r}, erhalten ${s}`}case"invalid_value":return t.values.length===1?`Ungültige Eingabe: erwartet ${$(t.values[0])}`:`Ungültige Option: erwartet eine von ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Zu groß: erwartet, dass ${t.origin??"Wert"} ${r}${t.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${t.origin??"Wert"} ${r}${t.maximum.toString()} ist`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Zu klein: erwartet, dass ${t.origin} ${r}${t.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${t.origin} ${r}${t.minimum.toString()} ist`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ungültiger String: muss mit "${r.prefix}" beginnen`:r.format==="ends_with"?`Ungültiger String: muss mit "${r.suffix}" enden`:r.format==="includes"?`Ungültiger String: muss "${r.includes}" enthalten`:r.format==="regex"?`Ungültiger String: muss dem Muster ${r.pattern} entsprechen`:`Ungültig: ${o[r.format]??t.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${t.divisor} sein`;case"unrecognized_keys":return`${t.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${v(t.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${t.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${t.origin}`;default:return"Ungültige Eingabe"}}};function mf(){return{localeError:Q$()}}var ek=()=>{let e={string:{unit:"χαρακτήρες",verb:"να έχει"},file:{unit:"bytes",verb:"να έχει"},array:{unit:"στοιχεία",verb:"να έχει"},set:{unit:"στοιχεία",verb:"να έχει"},map:{unit:"καταχωρήσεις",verb:"να έχει"}};function n(t){return e[t]??null}let o={regex:"είσοδος",email:"διεύθυνση email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ημερομηνία και ώρα",date:"ISO ημερομηνία",time:"ISO ώρα",duration:"ISO διάρκεια",ipv4:"διεύθυνση IPv4",ipv6:"διεύθυνση IPv6",mac:"διεύθυνση MAC",cidrv4:"εύρος IPv4",cidrv6:"εύρος IPv6",base64:"συμβολοσειρά κωδικοποιημένη σε base64",base64url:"συμβολοσειρά κωδικοποιημένη σε base64url",json_string:"συμβολοσειρά JSON",e164:"αριθμός E.164",credit_card:"αριθμός πιστωτικής κάρτας",currency_code:"κωδικός νομίσματος",iban:"IBAN",jwt:"JWT",template_literal:"είσοδος"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return typeof t.expected=="string"&&/^[A-Z]/.test(t.expected)?`Μη έγκυρη είσοδος: αναμενόταν instanceof ${t.expected}, λήφθηκε ${s}`:`Μη έγκυρη είσοδος: αναμενόταν ${r}, λήφθηκε ${s}`}case"invalid_value":return t.values.length===1?`Μη έγκυρη είσοδος: αναμενόταν ${$(t.values[0])}`:`Μη έγκυρη επιλογή: αναμενόταν ένα από ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Πολύ μεγάλο: αναμενόταν ${t.origin??"τιμή"} να έχει ${r}${t.maximum.toString()} ${a.unit??"στοιχεία"}`:`Πολύ μεγάλο: αναμενόταν ${t.origin??"τιμή"} να είναι ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Πολύ μικρό: αναμενόταν ${t.origin} να έχει ${r}${t.minimum.toString()} ${a.unit}`:`Πολύ μικρό: αναμενόταν ${t.origin} να είναι ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${r.prefix}"`:r.format==="ends_with"?`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${r.suffix}"`:r.format==="includes"?`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${r.includes}"`:r.format==="regex"?`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${r.pattern}`:`Μη έγκυρο: ${o[r.format]??t.format}`}case"not_multiple_of":return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${t.divisor}`;case"unrecognized_keys":return`Άγνωστ${t.keys.length>1?"α":"ο"} κλειδ${t.keys.length>1?"ιά":"ί"}: ${v(t.keys,", ")}`;case"invalid_key":return`Μη έγκυρο κλειδί στο ${t.origin}`;case"invalid_union":return"Μη έγκυρη είσοδος";case"invalid_element":return`Μη έγκυρη τιμή στο ${t.origin}`;default:return"Μη έγκυρη είσοδος"}}};function ff(){return{localeError:ek()}}var tk=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function n(r){return e[r]??null}let o={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};function t(r,a){return r==="number"&&typeof a=="number"&&!Number.isFinite(a)?String(a):i[r]??r}return r=>{switch(r.code){case"invalid_type":{let a=t(r.expected),s=k(r.input),c=t(s,r.input);return`Invalid input: expected ${a}, received ${c}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${$(r.values[0])}`:`Invalid option: expected one of ${v(r.values,"|")}`;case"too_big":{let a=r.exact?"exactly ":r.inclusive?"<=":"<",s=n(r.origin);return s?`Too big: expected ${r.origin??"value"} to have ${a}${r.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${a}${r.maximum.toString()}`}case"too_small":{let a=r.exact?"exactly ":r.inclusive?">=":">",s=n(r.origin);return s?`Too small: expected ${r.origin} to have ${a}${r.minimum.toString()} ${s.unit}`:`Too small: expected ${r.origin} to be ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${o[a.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${v(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`Invalid discriminator value. Expected ${r.options.map(s=>`'${s}'`).join(" | ")}`:r.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function ui(){return{localeError:tk()}}var nk=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"},map:{unit:"elementojn",verb:"havi"}};function n(t){return e[t]??null}let o={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",mac:"MAC-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",credit_card:"kreditkarta numero",currency_code:"valuta kodo",iban:"IBAN",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Nevalida enigo: atendiĝis instanceof ${t.expected}, riceviĝis ${s}`:`Nevalida enigo: atendiĝis ${r}, riceviĝis ${s}`}case"invalid_value":return t.values.length===1?`Nevalida enigo: atendiĝis ${$(t.values[0])}`:`Nevalida opcio: atendiĝis unu el ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Tro granda: atendiĝis ke ${t.origin??"valoro"} havu ${r}${t.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${t.origin??"valoro"} havu ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Tro malgranda: atendiĝis ke ${t.origin} havu ${r}${t.minimum.toString()} ${a.unit}`:`Tro malgranda: atendiĝis ke ${t.origin} estu ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${r.prefix}"`:r.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${r.suffix}"`:r.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${r.includes}"`:r.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${r.pattern}`:`Nevalida ${o[r.format]??t.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${t.divisor}`;case"unrecognized_keys":return`Nekonata${t.keys.length>1?"j":""} ŝlosilo${t.keys.length>1?"j":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${t.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${t.origin}`;default:return"Nevalida enigo"}}};function gf(){return{localeError:nk()}}var rk=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function n(t){return e[t]??null}let o={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",mac:"dirección MAC",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",credit_card:"número de tarjeta de crédito",currency_code:"código de moneda",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Entrada inválida: se esperaba instanceof ${t.expected}, recibido ${s}`:`Entrada inválida: se esperaba ${r}, recibido ${s}`}case"invalid_value":return t.values.length===1?`Entrada inválida: se esperaba ${$(t.values[0])}`:`Opción inválida: se esperaba una de ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin),s=i[t.origin]??t.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${r}${t.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin),s=i[t.origin]??t.origin;return a?`Demasiado pequeño: se esperaba que ${s} tuviera ${r}${t.minimum.toString()} ${a.unit}`:`Demasiado pequeño: se esperaba que ${s} fuera ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Cadena inválida: debe comenzar con "${r.prefix}"`:r.format==="ends_with"?`Cadena inválida: debe terminar en "${r.suffix}"`:r.format==="includes"?`Cadena inválida: debe incluir "${r.includes}"`:r.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${r.pattern}`:`Inválido ${o[r.format]??t.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${t.divisor}`;case"unrecognized_keys":return`Llave${t.keys.length>1?"s":""} desconocida${t.keys.length>1?"s":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Llave inválida en ${i[t.origin]??t.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${i[t.origin]??t.origin}`;default:return"Entrada inválida"}}};function hf(){return{localeError:rk()}}var ok=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"},map:{unit:"آیتم",verb:"داشته باشد"}};function n(t){return e[t]??null}let o={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",mac:"MAC آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",credit_card:"شماره کارت اعتباری",currency_code:"کد ارز",iban:"IBAN",jwt:"JWT",template_literal:"ورودی"},i={nan:"NaN",number:"عدد",array:"آرایه"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`ورودی نامعتبر: می‌بایست instanceof ${t.expected} می‌بود، ${s} دریافت شد`:`ورودی نامعتبر: می‌بایست ${r} می‌بود، ${s} دریافت شد`}case"invalid_value":return t.values.length===1?`ورودی نامعتبر: می‌بایست ${$(t.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${v(t.values,"|")} می‌بود`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`خیلی بزرگ: ${t.origin??"مقدار"} باید ${r}${t.maximum.toString()} ${a.unit??"عنصر"} باشد`:`خیلی بزرگ: ${t.origin??"مقدار"} باید ${r}${t.maximum.toString()} باشد`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`خیلی کوچک: ${t.origin} باید ${r}${t.minimum.toString()} ${a.unit} باشد`:`خیلی کوچک: ${t.origin} باید ${r}${t.minimum.toString()} باشد`}case"invalid_format":{let r=t;return r.format==="starts_with"?`رشته نامعتبر: باید با "${r.prefix}" شروع شود`:r.format==="ends_with"?`رشته نامعتبر: باید با "${r.suffix}" تمام شود`:r.format==="includes"?`رشته نامعتبر: باید شامل "${r.includes}" باشد`:r.format==="regex"?`رشته نامعتبر: باید با الگوی ${r.pattern} مطابقت داشته باشد`:`${o[r.format]??t.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${t.divisor} باشد`;case"unrecognized_keys":return`کلید${t.keys.length>1?"های":""} ناشناس: ${v(t.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${t.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${t.origin}`;default:return"ورودی نامعتبر"}}};function vf(){return{localeError:ok()}}var ik=()=>{let e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},map:{unit:"alkiota",subject:"kuvauksen"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function n(t){return e[t]??null}let o={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",mac:"MAC-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",credit_card:"luottokortin numero",currency_code:"valuuttakoodi",iban:"IBAN",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Virheellinen tyyppi: odotettiin instanceof ${t.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${r}, oli ${s}`}case"invalid_value":return t.values.length===1?`Virheellinen syöte: täytyy olla ${$(t.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Liian suuri: ${a.subject} täytyy olla ${r}${t.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon täytyy olla ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Liian pieni: ${a.subject} täytyy olla ${r}${t.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon täytyy olla ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${r.prefix}"`:r.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${r.suffix}"`:r.format==="includes"?`Virheellinen syöte: täytyy sisältää "${r.includes}"`:r.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${r.pattern}`:`Virheellinen ${o[r.format]??t.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${t.divisor} monikerta`;case"unrecognized_keys":return`${t.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${v(t.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function yf(){return{localeError:ik()}}var ak=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function n(t){return e[t]??null}let o={regex:"expression régulière",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne de caractères encodée en base64",base64url:"chaîne de caractères encodée en base64url",json_string:"chaîne de caractères JSON",e164:"numéro au format E.164",credit_card:"numéro de carte de crédit",currency_code:"code de devise",iban:"IBAN",jwt:"JWT",template_literal:"entrée"},i={string:"chaîne de caractères",number:"nombre",int:"entier",boolean:"booléen",bigint:"grand entier",symbol:"symbole",undefined:"indéfini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"record",map:"map",set:"ensemble",file:"fichier",nonoptional:"non optionnel",nan:"NaN",function:"fonction"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Entrée invalide : instance de ${t.expected} attendu, ${s} reçu`:`Entrée invalide : ${r} attendu, ${s} reçu`}case"invalid_value":return t.values.length===1?`Entrée invalide : ${$(t.values[0])} attendu`:`Option invalide : une valeur parmi ${v(t.values,"|")} attendue`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Trop grand : ${i[t.origin]??"valeur"} doit ${a.verb} ${r}${t.maximum.toString()} ${a.unit??"élément(s)"}`:`Trop grand : ${i[t.origin]??"valeur"} doit être ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Trop petit : ${i[t.origin]??"valeur"} doit ${a.verb} ${r}${t.minimum.toString()} ${a.unit}`:`Trop petit : ${i[t.origin]??"valeur"} doit être ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Chaîne de caractères invalide : doit commencer par "${r.prefix}"`:r.format==="ends_with"?`Chaîne de caractères invalide : doit se terminer par "${r.suffix}"`:r.format==="includes"?`Chaîne de caractères invalide : doit inclure "${r.includes}"`:r.format==="regex"?`Chaîne de caractères invalide : doit correspondre au motif ${r.pattern}`:`${o[r.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${t.divisor}`;case"unrecognized_keys":return`Clé${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${v(t.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${t.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entrée invalide"}}};function bf(){return{localeError:ak()}}var sk=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"},map:{unit:"éléments",verb:"avoir"}};function n(t){return e[t]??null}let o={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",credit_card:"numéro de carte de crédit",currency_code:"code de devise",iban:"IBAN",jwt:"JWT",template_literal:"entrée"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Entrée invalide : attendu instanceof ${t.expected}, reçu ${s}`:`Entrée invalide : attendu ${r}, reçu ${s}`}case"invalid_value":return t.values.length===1?`Entrée invalide : attendu ${$(t.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"≤":"<",a=n(t.origin);return a?`Trop grand : attendu que ${t.origin??"la valeur"} ait ${r}${t.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${t.origin??"la valeur"} soit ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?"≥":">",a=n(t.origin);return a?`Trop petit : attendu que ${t.origin} ait ${r}${t.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${t.origin} soit ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Chaîne invalide : doit commencer par "${r.prefix}"`:r.format==="ends_with"?`Chaîne invalide : doit se terminer par "${r.suffix}"`:r.format==="includes"?`Chaîne invalide : doit inclure "${r.includes}"`:r.format==="regex"?`Chaîne invalide : doit correspondre au motif ${r.pattern}`:`${o[r.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${t.divisor}`;case"unrecognized_keys":return`Clé${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${v(t.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${t.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entrée invalide"}}};function _f(){return{localeError:sk()}}var uk=()=>{let e={string:{unit:"અક્ષર",verb:"હોવા જોઈએ"},file:{unit:"બાયટ",verb:"હોવા જોઈએ"},array:{unit:"આઇટમ",verb:"હોવા જોઈએ"},set:{unit:"આઇટમ",verb:"હોવા જોઈએ"},map:{unit:"એન્ટ્રી",verb:"હોવા જોઈએ"}};function n(t){return e[t]??null}let o={regex:"ઇનપુટ",email:"ઈમેઇલ એડ્રેસ",url:"URL",emoji:"ઇમોજી",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO તારીખ અને સમય",date:"ISO તારીખ",time:"ISO સમય",duration:"ISO અવધિ",ipv4:"IPv4 એડ્રેસ",ipv6:"IPv6 એડ્રેસ",mac:"MAC એડ્રેસ",cidrv4:"IPv4 શ્રેણી",cidrv6:"IPv6 શ્રેણી",base64:"base64-એન્કોડેડ સ્ટ્રિંગ",base64url:"base64url-એન્કોડેડ સ્ટ્રિંગ",json_string:"JSON સ્ટ્રિંગ",e164:"E.164 નંબર",credit_card:"ક્રેડિટ કાર્ડ નંબર",currency_code:"ચલણ કોડ",iban:"IBAN",jwt:"JWT",template_literal:"ઇનપુટ"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return`અમાન્ય ઇનપુટ: અપેક્ષિત ${r}, પ્રાપ્ત ${s}`}case"invalid_value":return t.values.length===1?`અમાન્ય ઇનપુટ: અપેક્ષિત ${$(t.values[0])}`:`અમાન્ય વિકલ્પ: ${v(t.values," | ")} માધ્યમથી એક અપેક્ષિત`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`ખૂબ મોટું: ${t.origin??"મૂલ્ય"} ${r}${t.maximum.toString()} ${a.unit??"એલિમેન્ટ"} હોવા જોઈએ`:`ખૂબ મોટું: ${t.origin??"મૂલ્ય"} ${r}${t.maximum.toString()} હોવું જોઈએ`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`ખૂબ નાનું: ${t.origin} ${r}${t.minimum.toString()} ${a.unit} હોવા જોઈએ`:`ખૂબ નાનું: ${t.origin} ${r}${t.minimum.toString()} હોવું જોઈએ`}case"invalid_format":{let r=t;return r.format==="starts_with"?`અમાન્ય સ્ટ્રિંગ: "${r.prefix}" થી શરૂ થવું જોઈએ`:r.format==="ends_with"?`અમાન્ય સ્ટ્રિંગ: "${r.suffix}" પર સમાપ્ત થવું જોઈએ`:r.format==="includes"?`અમાન્ય સ્ટ્રિંગ: "${r.includes}" શામેલ હોવું જોઈએ`:r.format==="regex"?`અમાન્ય સ્ટ્રિંગ: પેટર્ન ${r.pattern} સાથે મેળ ખાવું જોઈએ`:`અમાન્ય ${o[r.format]??t.format}`}case"not_multiple_of":return`અમાન્ય નંબર: ${t.divisor} નો ગુણાંક હોવો જોઈએ`;case"unrecognized_keys":return`ઓળખી શકાતા નહીં તે કી${t.keys.length>1?"ઓ":""}: ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} માં અમાન્ય કી`;case"invalid_union":return t.options&&Array.isArray(t.options)&&t.options.length>0?`અમાન્ય ડિસ્ક્રિમિનેટર મૂલ્ય. અપેક્ષિત ${t.options.map(a=>`'${a}'`).join(" | ")}`:"અમાન્ય ઇનપુટ";case"invalid_element":return`${t.origin} માં અમાન્ય મૂલ્ય`;default:return"અમાન્ય ઇનપુટ"}}};function $f(){return{localeError:uk()}}var ck=()=>{let e={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},n={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},o=l=>l?e[l]:void 0,i=l=>{let d=o(l);return d?d.label:l??e.unknown.label},t=l=>`ה${i(l)}`,r=l=>(o(l)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות",a=l=>l?n[l]??null:null,s={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},uuidv4:{label:"UUIDv4",gender:"m"},uuidv6:{label:"UUIDv6",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},mac:{label:"כתובת MAC",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},credit_card:{label:"מספר כרטיס אשראי",gender:"m"},currency_code:{label:"קוד מטבע",gender:"m"},iban:{label:"IBAN",gender:"m"},jwt:{label:"JWT",gender:"m"},template_literal:{label:"קלט",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let d=l.expected,p=c[d??""]??i(d),m=k(l.input),f=c[m]??e[m]?.label??m;return/^[A-Z]/.test(l.expected)?`קלט לא תקין: צריך להיות instanceof ${l.expected}, התקבל ${f}`:`קלט לא תקין: צריך להיות ${p}, התקבל ${f}`}case"invalid_value":{if(l.values.length===1)return`ערך לא תקין: הערך חייב להיות ${$(l.values[0])}`;let d=l.values.map(f=>$(f));if(l.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${d[0]} או ${d[1]}`;let p=d[d.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${d.slice(0,-1).join(", ")} או ${p}`}case"too_big":{let d=a(l.origin),p=t(l.origin??"value");if(l.origin==="string")return`${d?.longLabel??"ארוך"} מדי: ${p} צריכה להכיל ${l.maximum.toString()} ${d?.unit??""} ${l.inclusive?"או פחות":"לכל היותר"}`.trim();if(l.origin==="number"){let g=l.inclusive?`קטן או שווה ל-${l.maximum}`:`קטן מ-${l.maximum}`;return`גדול מדי: ${p} צריך להיות ${g}`}if(l.origin==="array"||l.origin==="set"){let g=l.origin==="set"?"צריכה":"צריך",y=l.inclusive?`${l.maximum} ${d?.unit??""} או פחות`:`פחות מ-${l.maximum} ${d?.unit??""}`;return`גדול מדי: ${p} ${g} להכיל ${y}`.trim()}let m=l.inclusive?"<=":"<",f=r(l.origin??"value");return d?.unit?`${d.longLabel} מדי: ${p} ${f} ${m}${l.maximum.toString()} ${d.unit}`:`${d?.longLabel??"גדול"} מדי: ${p} ${f} ${m}${l.maximum.toString()}`}case"too_small":{let d=a(l.origin),p=t(l.origin??"value");if(l.origin==="string")return`${d?.shortLabel??"קצר"} מדי: ${p} צריכה להכיל ${l.minimum.toString()} ${d?.unit??""} ${l.inclusive?"או יותר":"לפחות"}`.trim();if(l.origin==="number"){let g=l.inclusive?`גדול או שווה ל-${l.minimum}`:`גדול מ-${l.minimum}`;return`קטן מדי: ${p} צריך להיות ${g}`}if(l.origin==="array"||l.origin==="set"){let g=l.origin==="set"?"צריכה":"צריך";if(l.minimum===1&&l.inclusive){let x=(l.origin==="set","לפחות פריט אחד");return`קטן מדי: ${p} ${g} להכיל ${x}`}let y=l.inclusive?`${l.minimum} ${d?.unit??""} או יותר`:`יותר מ-${l.minimum} ${d?.unit??""}`;return`קטן מדי: ${p} ${g} להכיל ${y}`.trim()}let m=l.inclusive?">=":">",f=r(l.origin??"value");return d?.unit?`${d.shortLabel} מדי: ${p} ${f} ${m}${l.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"קטן"} מדי: ${p} ${f} ${m}${l.minimum.toString()}`}case"invalid_format":{let d=l;if(d.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${d.prefix}"`;if(d.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${d.suffix}"`;if(d.format==="includes")return`המחרוזת חייבת לכלול "${d.includes}"`;if(d.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${d.pattern}`;let p=s[d.format],m=p?.label??d.format,g=(p?.gender??"m")==="f"?"תקינה":"תקין";return`${m} לא ${g}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${l.divisor}`;case"unrecognized_keys":return`מפתח${l.keys.length>1?"ות":""} לא מזוה${l.keys.length>1?"ים":"ה"}: ${v(l.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${t(l.origin??"array")}`;default:return"קלט לא תקין"}}};function kf(){return{localeError:ck()}}var lk=()=>{let e={string:{unit:"अक्षर",verb:"रखने के लिए"},file:{unit:"बाइट्स",verb:"रखने के लिए"},array:{unit:"तत्व",verb:"रखने के लिए"},set:{unit:"तत्व",verb:"रखने के लिए"},map:{unit:"प्रविष्टियाँ",verb:"रखने के लिए"}};function n(t){return e[t]??null}let o={regex:"इनपुट",email:"ईमेल पता",url:"URL",emoji:"इमोजी",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO तिथि और समय",date:"ISO तिथि",time:"ISO समय",duration:"ISO अवधि",ipv4:"IPv4 पता",ipv6:"IPv6 पता",mac:"MAC पता",cidrv4:"IPv4 श्रेणी",cidrv6:"IPv6 श्रेणी",base64:"Base64-एन्कोडेड स्ट्रिंग",base64url:"Base64URL-एन्कोडेड स्ट्रिंग",json_string:"JSON स्ट्रिंग",e164:"E.164 संख्या",credit_card:"क्रेडिट कार्ड संख्या",currency_code:"मुद्रा कोड",iban:"IBAN",jwt:"JWT",template_literal:"इनपुट"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return`अमान्य इनपुट: अपेक्षित ${r}, प्राप्त ${s}`}case"invalid_value":return t.values.length===1?`अमान्य इनपुट: अपेक्षित ${$(t.values[0])}`:`अमान्य विकल्प: अपेक्षित मानों में से एक ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`बहुत बड़ा: अपेक्षित था कि ${t.origin??"मान"} में ${r}${t.maximum} ${a.unit} हों`:`बहुत बड़ा: अपेक्षित था कि ${t.origin??"मान"} ${r}${t.maximum} हो`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`बहुत छोटा: अपेक्षित था कि ${t.origin} में ${r}${t.minimum} ${a.unit} हों`:`बहुत छोटा: अपेक्षित था कि ${t.origin} ${r}${t.minimum} हो`}case"invalid_format":{let r=t;return r.format==="starts_with"?`अमान्य स्ट्रिंग: "${r.prefix}" से शुरू होना चाहिए`:r.format==="ends_with"?`अमान्य स्ट्रिंग: "${r.suffix}" पर समाप्त होना चाहिए`:r.format==="includes"?`अमान्य स्ट्रिंग: इसमें "${r.includes}" शामिल होना चाहिए`:r.format==="regex"?`अमान्य स्ट्रिंग: पैटर्न ${r.pattern} से मेल खाना चाहिए`:`अमान्य ${o[r.format]??t.format}`}case"not_multiple_of":return`अमान्य संख्या: यह ${t.divisor} का गुणज होना चाहिए`;case"unrecognized_keys":return`अपरिचित कुंजी${t.keys.length>1?"याँ":""}: ${v(t.keys,", ")}`;case"invalid_key":return`अमान्य कुंजी: ${t.origin} में`;case"invalid_union":return t.options&&Array.isArray(t.options)&&t.options.length>0?`अमान्य डिस्क्रिमिनेटर मान: अपेक्षित ${t.options.map(a=>`'${a}'`).join(" | ")}`:"अमान्य इनपुट";case"invalid_element":return`अमान्य मान: ${t.origin} में`;default:return"अमान्य इनपुट"}}};function xf(){return{localeError:lk()}}var dk=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function n(t){return e[t]??null}let o={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",credit_card:"broj kreditne kartice",currency_code:"kod valute",iban:"IBAN",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Neispravan unos: očekuje se instanceof ${t.expected}, a primljeno je ${s}`:`Neispravan unos: očekuje se ${r}, a primljeno je ${s}`}case"invalid_value":return t.values.length===1?`Neispravna vrijednost: očekivano ${$(t.values[0])}`:`Neispravna opcija: očekivano jedno od ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin),s=i[t.origin]??t.origin;return a?`Preveliko: očekivano da ${s??"vrijednost"} ima ${r}${t.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: očekivano da ${s??"vrijednost"} bude ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin),s=i[t.origin]??t.origin;return a?`Premalo: očekivano da ${s} ima ${r}${t.minimum.toString()} ${a.unit}`:`Premalo: očekivano da ${s} bude ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Neispravan tekst: mora započinjati s "${r.prefix}"`:r.format==="ends_with"?`Neispravan tekst: mora završavati s "${r.suffix}"`:r.format==="includes"?`Neispravan tekst: mora sadržavati "${r.includes}"`:r.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${r.pattern}`:`Neispravna ${o[r.format]??t.format}`}case"not_multiple_of":return`Neispravan broj: mora biti višekratnik od ${t.divisor}`;case"unrecognized_keys":return`Neprepoznat${t.keys.length>1?"i ključevi":" ključ"}: ${v(t.keys,", ")}`;case"invalid_key":return`Neispravan ključ u ${i[t.origin]??t.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[t.origin]??t.origin}`;default:return"Neispravan unos"}}};function If(){return{localeError:dk()}}var pk=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"},map:{unit:"elem",verb:"legyen"}};function n(t){return e[t]??null}let o={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",mac:"MAC cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",credit_card:"hitelkártyaszám",currency_code:"pénznemkód",iban:"IBAN",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"szám",array:"tömb"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Érvénytelen bemenet: a várt érték instanceof ${t.expected}, a kapott érték ${s}`:`Érvénytelen bemenet: a várt érték ${r}, a kapott érték ${s}`}case"invalid_value":return t.values.length===1?`Érvénytelen bemenet: a várt érték ${$(t.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Túl nagy: ${t.origin??"érték"} mérete túl nagy ${r}${t.maximum.toString()} ${a.unit??"elem"}`:`Túl nagy: a bemeneti érték ${t.origin??"érték"} túl nagy: ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Túl kicsi: a bemeneti érték ${t.origin} mérete túl kicsi ${r}${t.minimum.toString()} ${a.unit}`:`Túl kicsi: a bemeneti érték ${t.origin} túl kicsi ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Érvénytelen string: "${r.prefix}" értékkel kell kezdődnie`:r.format==="ends_with"?`Érvénytelen string: "${r.suffix}" értékkel kell végződnie`:r.format==="includes"?`Érvénytelen string: "${r.includes}" értéket kell tartalmaznia`:r.format==="regex"?`Érvénytelen string: ${r.pattern} mintának kell megfelelnie`:`Érvénytelen ${o[r.format]??t.format}`}case"not_multiple_of":return`Érvénytelen szám: ${t.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${t.keys.length>1?"s":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${t.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${t.origin}`;default:return"Érvénytelen bemenet"}}};function wf(){return{localeError:pk()}}function Sf(e,n,o){return Math.abs(e)===1?n:o}function pn(e){if(!e)return"";let n=["ա","ե","ը","ի","ո","ու","օ"],o=e[e.length-1];return e+(n.includes(o)?"ն":"ը")}var mk=()=>{let e={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},map:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function n(t){return e[t]??null}let o={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",mac:"MAC հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",credit_card:"կրեդիտ քարտի համար",currency_code:"արժույթի կոդ",iban:"IBAN",jwt:"JWT",template_literal:"մուտք"},i={nan:"NaN",number:"թիվ",array:"զանգված"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${t.expected}, ստացվել է ${s}`:`Սխալ մուտքագրում․ սպասվում էր ${r}, ստացվել է ${s}`}case"invalid_value":return t.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${$(t.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);if(a){let s=Number(t.maximum),c=Sf(s,a.unit.one,a.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${pn(t.origin??"արժեք")} կունենա ${r}${t.maximum.toString()} ${c}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${pn(t.origin??"արժեք")} լինի ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);if(a){let s=Number(t.minimum),c=Sf(s,a.unit.one,a.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${pn(t.origin)} կունենա ${r}${t.minimum.toString()} ${c}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${pn(t.origin)} լինի ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Սխալ տող․ պետք է սկսվի "${r.prefix}"-ով`:r.format==="ends_with"?`Սխալ տող․ պետք է ավարտվի "${r.suffix}"-ով`:r.format==="includes"?`Սխալ տող․ պետք է պարունակի "${r.includes}"`:r.format==="regex"?`Սխալ տող․ պետք է համապատասխանի ${r.pattern} ձևաչափին`:`Սխալ ${o[r.format]??t.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${t.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${t.keys.length>1?"ներ":""}. ${v(t.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${pn(t.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${pn(t.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function Pf(){return{localeError:mk()}}var fk=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"},map:{unit:"item",verb:"memiliki"}};function n(t){return e[t]??null}let o={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",mac:"alamat MAC",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",credit_card:"nomor kartu kredit",currency_code:"kode mata uang",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Input tidak valid: diharapkan instanceof ${t.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${r}, diterima ${s}`}case"invalid_value":return t.values.length===1?`Input tidak valid: diharapkan ${$(t.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Terlalu besar: diharapkan ${t.origin??"value"} memiliki ${r}${t.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${t.origin??"value"} menjadi ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Terlalu kecil: diharapkan ${t.origin} memiliki ${r}${t.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${t.origin} menjadi ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`String tidak valid: harus dimulai dengan "${r.prefix}"`:r.format==="ends_with"?`String tidak valid: harus berakhir dengan "${r.suffix}"`:r.format==="includes"?`String tidak valid: harus menyertakan "${r.includes}"`:r.format==="regex"?`String tidak valid: harus sesuai pola ${r.pattern}`:`${o[r.format]??t.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${t.keys.length>1?"s":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${t.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${t.origin}`;default:return"Input tidak valid"}}};function Tf(){return{localeError:fk()}}var gk=()=>{let e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"},map:{unit:"hluti",verb:"að hafa"}};function n(t){return e[t]??null}let o={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",credit_card:"kreditkortanúmer",currency_code:"gjaldmiðilskóði",iban:"IBAN",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"númer",array:"fylki"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Rangt gildi: Þú slóst inn ${s} þar sem á að vera instanceof ${t.expected}`:`Rangt gildi: Þú slóst inn ${s} þar sem á að vera ${r}`}case"invalid_value":return t.values.length===1?`Rangt gildi: gert ráð fyrir ${$(t.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Of stórt: gert er ráð fyrir að ${t.origin??"gildi"} hafi ${r}${t.maximum.toString()} ${a.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${t.origin??"gildi"} sé ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Of lítið: gert er ráð fyrir að ${t.origin} hafi ${r}${t.minimum.toString()} ${a.unit}`:`Of lítið: gert er ráð fyrir að ${t.origin} sé ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ógildur strengur: verður að byrja á "${r.prefix}"`:r.format==="ends_with"?`Ógildur strengur: verður að enda á "${r.suffix}"`:r.format==="includes"?`Ógildur strengur: verður að innihalda "${r.includes}"`:r.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${r.pattern}`:`Rangt ${o[r.format]??t.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${t.divisor}`;case"unrecognized_keys":return`Óþekkt ${t.keys.length>1?"ir lyklar":"ur lykill"}: ${v(t.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${t.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${t.origin}`;default:return"Rangt gildi"}}};function Ef(){return{localeError:gk()}}var hk=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"},map:{unit:"elementi",verb:"avere"}};function n(t){return e[t]??null}let o={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",mac:"indirizzo MAC",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",credit_card:"numero di carta di credito",currency_code:"codice valuta",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Input non valido: atteso instanceof ${t.expected}, ricevuto ${s}`:`Input non valido: atteso ${r}, ricevuto ${s}`}case"invalid_value":return t.values.length===1?`Input non valido: atteso ${$(t.values[0])}`:`Opzione non valida: atteso uno tra ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Troppo grande: ${t.origin??"valore"} deve avere ${r}${t.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${t.origin??"valore"} deve essere ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Troppo piccolo: ${t.origin} deve avere ${r}${t.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${t.origin} deve essere ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Stringa non valida: deve iniziare con "${r.prefix}"`:r.format==="ends_with"?`Stringa non valida: deve terminare con "${r.suffix}"`:r.format==="includes"?`Stringa non valida: deve includere "${r.includes}"`:r.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${r.pattern}`:`Input non valido: ${o[r.format]??t.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${t.divisor}`;case"unrecognized_keys":return`Chiav${t.keys.length>1?"i":"e"} non riconosciut${t.keys.length>1?"e":"a"}: ${v(t.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${t.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${t.origin}`;default:return"Input non valido"}}};function Af(){return{localeError:hk()}}var vk=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"},map:{unit:"要素",verb:"である"}};function n(t){return e[t]??null}let o={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",mac:"MACアドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",credit_card:"クレジットカード番号",currency_code:"通貨コード",iban:"IBAN",jwt:"JWT",template_literal:"入力値"},i={nan:"NaN",number:"数値",array:"配列"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`無効な入力: instanceof ${t.expected}が期待されましたが、${s}が入力されました`:`無効な入力: ${r}が期待されましたが、${s}が入力されました`}case"invalid_value":return t.values.length===1?`無効な入力: ${$(t.values[0])}が期待されました`:`無効な選択: ${v(t.values,"、")}のいずれかである必要があります`;case"too_big":{let r=t.inclusive?"以下である":"より小さい",a=n(t.origin);return a?`大きすぎる値: ${t.origin??"値"}は${t.maximum.toString()}${a.unit??"要素"}${r}必要があります`:`大きすぎる値: ${t.origin??"値"}は${t.maximum.toString()}${r}必要があります`}case"too_small":{let r=t.inclusive?"以上である":"より大きい",a=n(t.origin);return a?`小さすぎる値: ${t.origin}は${t.minimum.toString()}${a.unit}${r}必要があります`:`小さすぎる値: ${t.origin}は${t.minimum.toString()}${r}必要があります`}case"invalid_format":{let r=t;return r.format==="starts_with"?`無効な文字列: "${r.prefix}"で始まる必要があります`:r.format==="ends_with"?`無効な文字列: "${r.suffix}"で終わる必要があります`:r.format==="includes"?`無効な文字列: "${r.includes}"を含む必要があります`:r.format==="regex"?`無効な文字列: パターン${r.pattern}に一致する必要があります`:`無効な${o[r.format]??t.format}`}case"not_multiple_of":return`無効な数値: ${t.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${t.keys.length>1?"群":""}: ${v(t.keys,"、")}`;case"invalid_key":return`${t.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${t.origin}内の無効な値`;default:return"無効な入力"}}};function Of(){return{localeError:vk()}}var yk=()=>{let e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},map:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function n(t){return e[t]??null}let o={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",mac:"MAC მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული ველი",base64url:"base64url-კოდირებული ველი",json_string:"JSON ველი",e164:"E.164 ნომერი",credit_card:"საკრედიტო ბარათის ნომერი",currency_code:"ვალუტის კოდი",iban:"IBAN",jwt:"JWT",template_literal:"შეყვანა"},i={nan:"NaN",number:"რიცხვი",string:"ველი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${t.expected}, მიღებული ${s}`:`არასწორი შეყვანა: მოსალოდნელი ${r}, მიღებული ${s}`}case"invalid_value":return t.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${$(t.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${v(t.values,"|")}-დან`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`ზედმეტად დიდი: მოსალოდნელი ${t.origin??"მნიშვნელობა"} ${a.verb} ${r}${t.maximum.toString()} ${a.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${t.origin??"მნიშვნელობა"} იყოს ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`ზედმეტად პატარა: მოსალოდნელი ${t.origin} ${a.verb} ${r}${t.minimum.toString()} ${a.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${t.origin} იყოს ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`არასწორი ველი: უნდა იწყებოდეს "${r.prefix}"-ით`:r.format==="ends_with"?`არასწორი ველი: უნდა მთავრდებოდეს "${r.suffix}"-ით`:r.format==="includes"?`არასწორი ველი: უნდა შეიცავდეს "${r.includes}"-ს`:r.format==="regex"?`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${r.pattern}`:`არასწორი ${o[r.format]??t.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${t.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${t.keys.length>1?"ები":"ი"}: ${v(t.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${t.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${t.origin}-ში`;default:return"არასწორი შეყვანა"}}};function Nf(){return{localeError:yk()}}var bk=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"},map:{unit:"ធាតុ",verb:"គួរមាន"}};function n(t){return e[t]??null}let o={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",mac:"អាសយដ្ឋាន MAC",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",credit_card:"លេខប័ណ្ណឥណទាន",currency_code:"កូដរូបិយប័ណ្ណ",iban:"IBAN",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},i={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${t.expected} ប៉ុន្តែទទួលបាន ${s}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${r} ប៉ុន្តែទទួលបាន ${s}`}case"invalid_value":return t.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${$(t.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`ធំពេក៖ ត្រូវការ ${t.origin??"តម្លៃ"} ${r} ${t.maximum.toString()} ${a.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${t.origin??"តម្លៃ"} ${r} ${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`តូចពេក៖ ត្រូវការ ${t.origin} ${r} ${t.minimum.toString()} ${a.unit}`:`តូចពេក៖ ត្រូវការ ${t.origin} ${r} ${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${r.prefix}"`:r.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${r.suffix}"`:r.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${r.includes}"`:r.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${r.pattern}`:`មិនត្រឹមត្រូវ៖ ${o[r.format]??t.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${t.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${v(t.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${t.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${t.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function ci(){return{localeError:bk()}}function zf(){return ci()}var _k=()=>{let e={string:{unit:"ಅಕ್ಷರಗಳು",verb:"ಹೊಂದಲು"},file:{unit:"ಬೈಟ್‌ಗಳು",verb:"ಹೊಂದಲು"},array:{unit:"ವಸ್ತುಗಳು",verb:"ಹೊಂದಲು"},set:{unit:"ವಸ್ತುಗಳು",verb:"ಹೊಂದಲು"},map:{unit:"entries",verb:"ಹೊಂದಲು"}};function n(t){return e[t]??null}let o={regex:"ಇನ್ಪುಟ್",email:"email ವಿಳಾಸ",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ದಿನಾಂಕದ ಸಮಯ",date:"ISO ದಿನಾಂಕ",time:"ISO ಸಮಯ",duration:"ISO ಅವಧಿ",ipv4:"IPv4 ವಿಳಾಸ",ipv6:"IPv6 ವಿಳಾಸ",mac:"MAC ವಿಳಾಸ",cidrv4:"IPv4 ವ್ಯಾಪ್ತಿಯ",cidrv6:"IPv6 ವ್ಯಾಪ್ತಿಯ",base64:"base64-encodedಸ್ಟ್ರಿಂಗ್",base64url:"base64url-encodedಸ್ಟ್ರಿಂಗ್",json_string:"JSONಸ್ಟ್ರಿಂಗ್",e164:"E.164 ಸಂಖ್ಯೆ",credit_card:"ಕ್ರೆಡಿಟ್ ಕಾರ್ಡ್ ಸಂಖ್ಯೆ",currency_code:"ಕರೆನ್ಸಿ ಕೋಡ್",iban:"IBAN",jwt:"JWT",template_literal:"ಇನ್ಪುಟ್"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return`ಅಮಾನ್ಯ ಇನ್‌ಪುಟ್: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${r}, ಸ್ವೀಕರಿಸಿದನು ${s}`}case"invalid_value":return t.values.length===1?`ಅಮಾನ್ಯ ಇನ್‌ಪುಟ್: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${$(t.values[0])}`:`ಅಮಾನ್ಯ ಆಯ್ಕೆ: ಇವುಗಳಲ್ಲಿ ಒಂದನ್ನು ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`ತುಂಬಾ ದೊಡ್ಡದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${t.origin??"value"} ಹೊಂದಲು ${r}${t.maximum.toString()} ${a.unit??"ಅಂಶಗಳು"}`:`ತುಂಬಾ ದೊಡ್ಡದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${t.origin??"value"} ಎಂದು ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`ತುಂಬಾ ಚಿಕ್ಕದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${t.origin} ಹೊಂದಲು ${r}${t.minimum.toString()} ${a.unit}`:`ತುಂಬಾ ಚಿಕ್ಕದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${t.origin} ಎಂದು ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`ಅಮಾನ್ಯವಾದ ಸ್ಟ್ರಿಂಗ್: ಇದರೊಂದಿಗೆ ಪ್ರಾರಂಭಿಸಬೇಕು "${r.prefix}"`:r.format==="ends_with"?`ಅಮಾನ್ಯವಾದ ಸ್ಟ್ರಿಂಗ್: ಇದರೊಂದಿಗೆ ಕೊನೆಗೊಳ್ಳಬೇಕು "${r.suffix}"`:r.format==="includes"?`ಅಮಾನ್ಯ ಸ್ಟ್ರಿಂಗ್: ಒಳಗೊಂಡಿರಬೇಕು "${r.includes}"`:r.format==="regex"?`ಅಮಾನ್ಯವಾದ ಸ್ಟ್ರಿಂಗ್: ಮಾದರಿಗೆ ಹೊಂದಿಕೆಯಾಗಬೇಕು ${r.pattern}`:`ಅಮಾನ್ಯ ${o[r.format]??t.format}`}case"not_multiple_of":return`ಅಮಾನ್ಯ ಸಂಖ್ಯೆ: ಬಹುಸಂಖ್ಯೆಯಾಗಿರಬೇಕು ${t.divisor}`;case"unrecognized_keys":return`ಗುರುತಿಸಲಾಗದ ಕೀ ${t.keys.length>1?"s":""}: ${v(t.keys,", ")}`;case"invalid_key":return`ಅಮಾನ್ಯವಾದ ಕೀ ಇನ್ ${t.origin}`;case"invalid_union":return t.options&&Array.isArray(t.options)&&t.options.length>0?`ಅಮಾನ್ಯ ತಾರತಮ್ಯ ಮೌಲ್ಯ. ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${t.options.map(a=>`'${a}'`).join(" | ")}`:"ಅಮಾನ್ಯ ಇನ್‌ಪುಟ್";case"invalid_element":return`ರಲ್ಲಿ ಅಮಾನ್ಯ ಮೌಲ್ಯ ${t.origin}`;default:return"ಅಮಾನ್ಯ ಇನ್‌ಪುಟ್"}}};function Cf(){return{localeError:_k()}}var $k=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"},map:{unit:"개",verb:"to have"}};function n(t){return e[t]??null}let o={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",mac:"MAC 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",credit_card:"신용카드 번호",currency_code:"통화 코드",iban:"IBAN",jwt:"JWT",template_literal:"입력"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`잘못된 입력: 예상 타입은 instanceof ${t.expected}, 받은 타입은 ${s}입니다`:`잘못된 입력: 예상 타입은 ${r}, 받은 타입은 ${s}입니다`}case"invalid_value":return t.values.length===1?`잘못된 입력: 값은 ${$(t.values[0])} 이어야 합니다`:`잘못된 옵션: ${v(t.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let r=t.inclusive?"이하":"미만",a=r==="미만"?"이어야 합니다":"여야 합니다",s=n(t.origin),c=s?.unit??"요소";return s?`${t.origin??"값"}이 너무 큽니다: ${t.maximum.toString()}${c} ${r}${a}`:`${t.origin??"값"}이 너무 큽니다: ${t.maximum.toString()} ${r}${a}`}case"too_small":{let r=t.inclusive?"이상":"초과",a=r==="이상"?"이어야 합니다":"여야 합니다",s=n(t.origin),c=s?.unit??"요소";return s?`${t.origin??"값"}이 너무 작습니다: ${t.minimum.toString()}${c} ${r}${a}`:`${t.origin??"값"}이 너무 작습니다: ${t.minimum.toString()} ${r}${a}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`잘못된 문자열: "${r.prefix}"(으)로 시작해야 합니다`:r.format==="ends_with"?`잘못된 문자열: "${r.suffix}"(으)로 끝나야 합니다`:r.format==="includes"?`잘못된 문자열: "${r.includes}"을(를) 포함해야 합니다`:r.format==="regex"?`잘못된 문자열: 정규식 ${r.pattern} 패턴과 일치해야 합니다`:`잘못된 ${o[r.format]??t.format}`}case"not_multiple_of":return`잘못된 숫자: ${t.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${v(t.keys,", ")}`;case"invalid_key":return`잘못된 키: ${t.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${t.origin}`;default:return"잘못된 입력"}}};function Df(){return{localeError:$k()}}var Er=e=>e.charAt(0).toUpperCase()+e.slice(1);function Lf(e){let n=Math.abs(e),o=n%10,i=n%100;return i>=11&&i<=19||o===0?"many":o===1?"one":"few"}var kk=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function n(t,r,a,s){let c=e[t]??null;return c===null?c:{unit:c.unit[r],verb:c.verb[s][a?"inclusive":"notInclusive"]}}let o={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",mac:"MAC adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",credit_card:"kredito kortelės numeris",currency_code:"valiutos kodas",iban:"IBAN",jwt:"JWT",template_literal:"įvestis"},i={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Gautas tipas ${s}, o tikėtasi - instanceof ${t.expected}`:`Gautas tipas ${s}, o tikėtasi - ${r}`}case"invalid_value":return t.values.length===1?`Privalo būti ${$(t.values[0])}`:`Privalo būti vienas iš ${v(t.values,"|")} pasirinkimų`;case"too_big":{let r=i[t.origin]??t.origin,a=n(t.origin,Lf(Number(t.maximum)),t.inclusive??!1,"smaller");if(a?.verb)return`${Er(r??t.origin??"reikšmė")} ${a.verb} ${t.maximum.toString()} ${a.unit??"elementų"}`;let s=t.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Er(r??t.origin??"reikšmė")} turi būti ${s} ${t.maximum.toString()} ${a?.unit}`}case"too_small":{let r=i[t.origin]??t.origin,a=n(t.origin,Lf(Number(t.minimum)),t.inclusive??!1,"bigger");if(a?.verb)return`${Er(r??t.origin??"reikšmė")} ${a.verb} ${t.minimum.toString()} ${a.unit??"elementų"}`;let s=t.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Er(r??t.origin??"reikšmė")} turi būti ${s} ${t.minimum.toString()} ${a?.unit}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Eilutė privalo prasidėti "${r.prefix}"`:r.format==="ends_with"?`Eilutė privalo pasibaigti "${r.suffix}"`:r.format==="includes"?`Eilutė privalo įtraukti "${r.includes}"`:r.format==="regex"?`Eilutė privalo atitikti ${r.pattern}`:`Neteisingas ${o[r.format]??t.format}`}case"not_multiple_of":return`Skaičius privalo būti ${t.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${t.keys.length>1?"i":"as"} rakt${t.keys.length>1?"ai":"as"}: ${v(t.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let r=i[t.origin]??t.origin;return`${Er(r??t.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function Uf(){return{localeError:kk()}}var xk=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"},map:{unit:"ставки",verb:"да имаат"}};function n(t){return e[t]??null}let o={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",mac:"MAC адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",credit_card:"број на кредитна картичка",currency_code:"код на валута",iban:"IBAN",jwt:"JWT",template_literal:"внес"},i={nan:"NaN",number:"број",array:"низа"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Грешен внес: се очекува instanceof ${t.expected}, примено ${s}`:`Грешен внес: се очекува ${r}, примено ${s}`}case"invalid_value":return t.values.length===1?`Invalid input: expected ${$(t.values[0])}`:`Грешана опција: се очекува една ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Премногу голем: се очекува ${t.origin??"вредноста"} да има ${r}${t.maximum.toString()} ${a.unit??"елементи"}`:`Премногу голем: се очекува ${t.origin??"вредноста"} да биде ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Премногу мал: се очекува ${t.origin} да има ${r}${t.minimum.toString()} ${a.unit}`:`Премногу мал: се очекува ${t.origin} да биде ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Неважечка низа: мора да започнува со "${r.prefix}"`:r.format==="ends_with"?`Неважечка низа: мора да завршува со "${r.suffix}"`:r.format==="includes"?`Неважечка низа: мора да вклучува "${r.includes}"`:r.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${r.pattern}`:`Invalid ${o[r.format]??t.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${v(t.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${t.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${t.origin}`;default:return"Грешен внес"}}};function jf(){return{localeError:xk()}}var Ik=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"},map:{unit:"elemen",verb:"mempunyai"}};function n(t){return e[t]??null}let o={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",mac:"alamat MAC",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",credit_card:"nombor kad kredit",currency_code:"kod mata wang",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Input tidak sah: dijangka instanceof ${t.expected}, diterima ${s}`:`Input tidak sah: dijangka ${r}, diterima ${s}`}case"invalid_value":return t.values.length===1?`Input tidak sah: dijangka ${$(t.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Terlalu besar: dijangka ${t.origin??"nilai"} ${a.verb} ${r}${t.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${t.origin??"nilai"} adalah ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Terlalu kecil: dijangka ${t.origin} ${a.verb} ${r}${t.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${t.origin} adalah ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`String tidak sah: mesti bermula dengan "${r.prefix}"`:r.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${r.suffix}"`:r.format==="includes"?`String tidak sah: mesti mengandungi "${r.includes}"`:r.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${r.pattern}`:`${o[r.format]??t.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${v(t.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${t.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${t.origin}`;default:return"Input tidak sah"}}};function Rf(){return{localeError:Ik()}}var wk=()=>{let e={string:{unit:"अक्षर",verb:"हुनुपर्छ"},file:{unit:"बाइट",verb:"हुनुपर्छ"},array:{unit:"तत्व",verb:"हुनुपर्छ"},set:{unit:"तत्व",verb:"हुनुपर्छ"},map:{unit:"प्रविष्टि",verb:"हुनुपर्छ"}};function n(t){return e[t]??null}let o={regex:"इनपुट",email:"इमेल ठेगाना",url:"URL",emoji:"इमोजी",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO मिति र समय",date:"ISO मिति",time:"ISO समय",duration:"ISO अवधि",ipv4:"IPv4 ठेगाना",ipv6:"IPv6 ठेगाना",mac:"MAC ठेगाना",cidrv4:"IPv4 दायरा",cidrv6:"IPv6 दायरा",base64:"base64-इन्कोड गरिएको स्ट्रिङ",base64url:"base64url-इन्कोड गरिएको स्ट्रिङ",json_string:"JSON स्ट्रिङ",e164:"E.164 नम्बर",credit_card:"क्रेडिट कार्ड नम्बर",currency_code:"मुद्रा कोड",iban:"IBAN",jwt:"JWT",template_literal:"इनपुट"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return`अमान्य इनपुट: अपेक्षित ${r}, प्राप्त ${s}`}case"invalid_value":return t.values.length===1?`अमान्य इनपुट: अपेक्षित ${$(t.values[0])}`:`अमान्य विकल्प: अपेक्षित मानहरू मध्ये एक ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`धेरै ठूलो: ${t.origin??"मान"} मा ${r}${t.maximum.toString()} ${a.unit} ${a.verb}`:`धेरै ठूलो: ${t.origin??"मान"} ${r}${t.maximum.toString()} हुनुपर्छ`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`धेरै सानो: ${t.origin} मा ${r}${t.minimum.toString()} ${a.unit} ${a.verb}`:`धेरै सानो: ${t.origin} ${r}${t.minimum.toString()} हुनुपर्छ`}case"invalid_format":{let r=t;return r.format==="starts_with"?`अमान्य स्ट्रिङ: "${r.prefix}" बाट सुरु हुनुपर्छ`:r.format==="ends_with"?`अमान्य स्ट्रिङ: "${r.suffix}" मा समाप्त हुनुपर्छ`:r.format==="includes"?`अमान्य स्ट्रिङ: "${r.includes}" समावेश हुनुपर्छ`:r.format==="regex"?`अमान्य स्ट्रिङ: ढाँचा ${r.pattern} सँग मेल खानुपर्छ`:`अमान्य ${o[r.format]??t.format}`}case"not_multiple_of":return`अमान्य संख्या: ${t.divisor} को गुणज हुनुपर्छ`;case"unrecognized_keys":return`अपरिचित कुञ्जी${t.keys.length>1?"हरू":""}: ${v(t.keys,", ")}`;case"invalid_key":return`अमान्य कुञ्जी: ${t.origin} मा`;case"invalid_union":return t.options&&Array.isArray(t.options)&&t.options.length>0?`अमान्य डिस्क्रिमिनेटर मान: अपेक्षित ${t.options.map(a=>`'${a}'`).join(" | ")}`:"अमान्य इनपुट";case"invalid_element":return`अमान्य मान: ${t.origin} मा`;default:return"अमान्य इनपुट"}}};function Mf(){return{localeError:wk()}}var Sk=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"},map:{unit:"elementen",verb:"heeft"}};function n(t){return e[t]??null}let o={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",mac:"MAC-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",credit_card:"creditcardnummer",currency_code:"valutacode",iban:"IBAN",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Ongeldige invoer: verwacht instanceof ${t.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${r}, ontving ${s}`}case"invalid_value":return t.values.length===1?`Ongeldige invoer: verwacht ${$(t.values[0])}`:`Ongeldige optie: verwacht één van ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin),s=t.origin==="date"?"laat":t.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${t.origin??"waarde"} ${r}${t.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${t.origin??"waarde"} ${r}${t.maximum.toString()} is`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin),s=t.origin==="date"?"vroeg":t.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${t.origin} ${r}${t.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${t.origin} ${r}${t.minimum.toString()} is`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ongeldige tekst: moet met "${r.prefix}" beginnen`:r.format==="ends_with"?`Ongeldige tekst: moet op "${r.suffix}" eindigen`:r.format==="includes"?`Ongeldige tekst: moet "${r.includes}" bevatten`:r.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${r.pattern}`:`Ongeldig: ${o[r.format]??t.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${t.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${t.keys.length>1?"s":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${t.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${t.origin}`;default:return"Ongeldige invoer"}}};function Ff(){return{localeError:Sk()}}var Pk=()=>{let e={string:{unit:"teikn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"element",verb:"å innehalde"},set:{unit:"element",verb:"å innehalde"},map:{unit:"element",verb:"å innehalde"}};function n(t){return e[t]??null}let o={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varigheit",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkoda streng",base64url:"base64url-enkoda streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tal",array:"liste"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Ugyldig input: forventa instanceof ${t.expected}, fekk ${s}`:`Ugyldig input: forventa ${r}, fekk ${s}`}case"invalid_value":return t.values.length===1?`Ugyldig verdi: forventa ${$(t.values[0])}`:`Ugyldig val: forventa eitt av ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`For stor(t): forventa ${t.origin??"value"} til å ha ${r}${t.maximum.toString()} ${a.unit??"element"}`:`For stor(t): forventa ${t.origin??"value"} til å ha ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`For lite(n): forventa ${t.origin} til å ha ${r}${t.minimum.toString()} ${a.unit}`:`For lite(n): forventa ${t.origin} til å ha ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ugyldig streng: må starte med "${r.prefix}"`:r.format==="ends_with"?`Ugyldig streng: må slutte med "${r.suffix}"`:r.format==="includes"?`Ugyldig streng: må innehalde "${r.includes}"`:r.format==="regex"?`Ugyldig streng: må matche mønsteret ${r.pattern}`:`Ugyldig ${o[r.format]??t.format}`}case"not_multiple_of":return`Ugyldig tal: må vere eit multiplum av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukjende nøklar":"Ukjend nøkkel"}: ${v(t.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${t.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${t.origin}`;default:return"Ugyldig input"}}};function Zf(){return{localeError:Pk()}}var Tk=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"},map:{unit:"elementer",verb:"å inneholde"}};function n(t){return e[t]??null}let o={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Ugyldig input: forventet instanceof ${t.expected}, fikk ${s}`:`Ugyldig input: forventet ${r}, fikk ${s}`}case"invalid_value":return t.values.length===1?`Ugyldig verdi: forventet ${$(t.values[0])}`:`Ugyldig valg: forventet en av ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`For stor(t): forventet ${t.origin??"value"} til å ha ${r}${t.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${t.origin??"value"} til å ha ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`For lite(n): forventet ${t.origin} til å ha ${r}${t.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${t.origin} til å ha ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ugyldig streng: må starte med "${r.prefix}"`:r.format==="ends_with"?`Ugyldig streng: må ende med "${r.suffix}"`:r.format==="includes"?`Ugyldig streng: må inneholde "${r.includes}"`:r.format==="regex"?`Ugyldig streng: må matche mønsteret ${r.pattern}`:`Ugyldig ${o[r.format]??t.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${v(t.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${t.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${t.origin}`;default:return"Ugyldig input"}}};function Gf(){return{localeError:Tk()}}var Ek=()=>{let e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"},map:{unit:"unsur",verb:"olmalıdır"}};function n(t){return e[t]??null}let o={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",mac:"MAC nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",credit_card:"i'tibâr kartı numarası",currency_code:"para birimi kodu",iban:"IBAN",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Fâsit giren: umulan instanceof ${t.expected}, alınan ${s}`:`Fâsit giren: umulan ${r}, alınan ${s}`}case"invalid_value":return t.values.length===1?`Fâsit giren: umulan ${$(t.values[0])}`:`Fâsit tercih: mûteberler ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Fazla büyük: ${t.origin??"value"}, ${r}${t.maximum.toString()} ${a.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${t.origin??"value"}, ${r}${t.maximum.toString()} olmalıydı.`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Fazla küçük: ${t.origin}, ${r}${t.minimum.toString()} ${a.unit} sahip olmalıydı.`:`Fazla küçük: ${t.origin}, ${r}${t.minimum.toString()} olmalıydı.`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Fâsit metin: "${r.prefix}" ile başlamalı.`:r.format==="ends_with"?`Fâsit metin: "${r.suffix}" ile bitmeli.`:r.format==="includes"?`Fâsit metin: "${r.includes}" ihtivâ etmeli.`:r.format==="regex"?`Fâsit metin: ${r.pattern} nakşına uymalı.`:`Fâsit ${o[r.format]??t.format}`}case"not_multiple_of":return`Fâsit sayı: ${t.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${t.keys.length>1?"s":""}: ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${t.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function Vf(){return{localeError:Ek()}}var Ak=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"},map:{unit:"توکي",verb:"ولري"}};function n(t){return e[t]??null}let o={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",mac:"د MAC پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",credit_card:"د کریډیټ کارت شمیره",currency_code:"د اسعارو کوډ",iban:"IBAN",jwt:"JWT",template_literal:"ورودي"},i={nan:"NaN",number:"عدد",array:"ارې"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`ناسم ورودي: باید instanceof ${t.expected} وای, مګر ${s} ترلاسه شو`:`ناسم ورودي: باید ${r} وای, مګر ${s} ترلاسه شو`}case"invalid_value":return t.values.length===1?`ناسم ورودي: باید ${$(t.values[0])} وای`:`ناسم انتخاب: باید یو له ${v(t.values,"|")} څخه وای`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`ډیر لوی: ${t.origin??"ارزښت"} باید ${r}${t.maximum.toString()} ${a.unit??"عنصرونه"} ولري`:`ډیر لوی: ${t.origin??"ارزښت"} باید ${r}${t.maximum.toString()} وي`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`ډیر کوچنی: ${t.origin} باید ${r}${t.minimum.toString()} ${a.unit} ولري`:`ډیر کوچنی: ${t.origin} باید ${r}${t.minimum.toString()} وي`}case"invalid_format":{let r=t;return r.format==="starts_with"?`ناسم متن: باید د "${r.prefix}" سره پیل شي`:r.format==="ends_with"?`ناسم متن: باید د "${r.suffix}" سره پای ته ورسيږي`:r.format==="includes"?`ناسم متن: باید "${r.includes}" ولري`:r.format==="regex"?`ناسم متن: باید د ${r.pattern} سره مطابقت ولري`:`${o[r.format]??t.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${t.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${t.keys.length>1?"کلیډونه":"کلیډ"}: ${v(t.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${t.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${t.origin} کې`;default:return"ناسمه ورودي"}}};function Hf(){return{localeError:Ak()}}var Ok=()=>{let e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"},map:{unit:"elementów",verb:"mieć"}};function n(t){return e[t]??null}let o={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",mac:"adres MAC",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",credit_card:"numer karty kredytowej",currency_code:"kod waluty",iban:"IBAN",jwt:"JWT",template_literal:"wejście"},i={nan:"NaN",number:"liczba",array:"tablica"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${t.expected}, otrzymano ${s}`:`Nieprawidłowe dane wejściowe: oczekiwano ${r}, otrzymano ${s}`}case"invalid_value":return t.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${$(t.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Za duża wartość: oczekiwano, że ${t.origin??"wartość"} będzie mieć ${r}${t.maximum.toString()} ${a.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${t.origin??"wartość"} będzie wynosić ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Za mała wartość: oczekiwano, że ${t.origin??"wartość"} będzie mieć ${r}${t.minimum.toString()} ${a.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${t.origin??"wartość"} będzie wynosić ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${r.prefix}"`:r.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${r.suffix}"`:r.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${r.includes}"`:r.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${r.pattern}`:`Nieprawidłow(y/a/e) ${o[r.format]??t.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${t.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${t.keys.length>1?"s":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${t.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${t.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function Bf(){return{localeError:Ok()}}var Nk=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function n(a){return e[a]??null}let o={regex:"a entrada",email:"o endereço de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a duração ISO",ipv4:"o endereço IPv4",ipv6:"o endereço IPv6",mac:"o endereço MAC",cidrv4:"o intervalo de endereços IPv4",cidrv6:"o intervalo de endereços IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o número E.164",credit_card:"o número de cartão de crédito",currency_code:"o código de moeda",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},t={string:{name:"texto",articles:i.masculine},number:{name:"número",articles:i.masculine},int:{name:"número inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"número bigint",articles:i.masculine},symbol:{name:"símbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tuplo",articles:i.masculine},record:{name:"registo",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"ficheiro",articles:i.masculine},nonoptional:{name:"valor não opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"função",articles:i.feminine}};function r(a,s){let c=t[a]??{name:`valor "${a}"`,articles:i.masculine};return`${c.articles[s]} ${c.name}`}return a=>{switch(a.code){case"invalid_type":{let s=r(a.expected,"indefinite"),c=k(a.input),l=r(c,"indefinite");return`Entrada inválida: esperava ${s}, recebeu ${l}`}case"invalid_value":return a.values.length===1?`Entrada inválida: esperava ${$(a.values[0])}`:`Opção inválida: esperava uma das seguintes opções: ${v(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",c=n(a.origin);return c?`Demasiado grande: esperava que ${r(a.origin,"definite")} tivesse ${s} ${a.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: esperava que ${r(a.origin,"definite")} fosse ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",c=n(a.origin);return c?`Demasiado pequeno: esperava que ${r(a.origin,"definite")} tivesse ${s} ${a.minimum.toString()} ${c.unit??"elementos"}`:`Demasiado pequeno: esperava que ${r(a.origin,"definite")} fosse ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Texto inválido: deve começar por "${s.prefix}"`:s.format==="ends_with"?`Texto inválido: deve terminar em "${s.suffix}"`:s.format==="includes"?`Texto inválido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inválido: deve corresponder ao padrão ${s.pattern}`:`Formato d${o[s.format]??a.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${a.divisor}`;case"unrecognized_keys":{let s=a.keys.length>1?"s":"";return`Chave${s} inválida${s}: ${v(a.keys,", ")}`}case"invalid_key":return`Entrada inválida n${r(a.origin,"definite")}`;case"invalid_union":return a.options&&Array.isArray(a.options)&&a.options.length>0?`Valor de discriminação inválido. Esperava ${a.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inválida";case"invalid_element":return`Entrada inválida n${r(a.origin,"definite")}`;default:return"Entrada inválida"}}};function Wf(){return{localeError:Nk()}}var zk=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function n(a){return e[a]??null}let o={regex:"a entrada",email:"o endereço de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a duração ISO",ipv4:"o endereço IPv4",ipv6:"o endereço IPv6",mac:"o endereço MAC",cidrv4:"a faixa de endereços IPv4",cidrv6:"a faixa de endereços IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o número E.164",credit_card:"o número de cartão de crédito",currency_code:"o código de moeda",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},t={string:{name:"texto",articles:i.masculine},number:{name:"número",articles:i.masculine},int:{name:"número inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"número bigint",articles:i.masculine},symbol:{name:"símbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tupla",articles:i.feminine},record:{name:"registro",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"arquivo",articles:i.masculine},nonoptional:{name:"valor não opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"função",articles:i.feminine}};function r(a,s){let c=t[a]??{name:`valor "${a}"`,articles:i.masculine};return`${c.articles[s]} ${c.name}`}return a=>{switch(a.code){case"invalid_type":{let s=r(a.expected,"indefinite"),c=k(a.input),l=r(c,"indefinite");return`Entrada inválida: esperava ${s}, recebeu ${l}`}case"invalid_value":return a.values.length===1?`Entrada inválida: esperava ${$(a.values[0])}`:`Opção inválida: esperava uma das seguintes opções: ${v(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",c=n(a.origin);return c?`Grande demais: esperava que ${r(a.origin,"definite")} tivesse ${s} ${a.maximum.toString()} ${c.unit??"elementos"}`:`Grande demais: esperava que ${r(a.origin,"definite")} fosse ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",c=n(a.origin);return c?`Pequeno demais: esperava que ${r(a.origin,"definite")} tivesse ${s} ${a.minimum.toString()} ${c.unit??"elementos"}`:`Pequeno demais: esperava que ${r(a.origin,"definite")} fosse ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Texto inválido: deve começar com "${s.prefix}"`:s.format==="ends_with"?`Texto inválido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inválido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inválido: deve corresponder ao padrão ${s.pattern}`:`Formato d${o[s.format]??a.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${a.divisor}`;case"unrecognized_keys":{let s=a.keys.length>1?"s":"";return`Chave${s} inválida${s}: ${v(a.keys,", ")}`}case"invalid_key":return`Entrada inválida n${r(a.origin,"definite")}`;case"invalid_union":return a.options&&Array.isArray(a.options)&&a.options.length>0?`Valor de discriminação inválido. Esperava ${a.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inválida";case"invalid_element":return`Entrada inválida n${r(a.origin,"definite")}`;default:return"Entrada inválida"}}};function Kf(){return{localeError:zk()}}var Ck=()=>{let e={string:{unit:"caractere",verb:"să aibă"},file:{unit:"octeți",verb:"să aibă"},array:{unit:"elemente",verb:"să aibă"},set:{unit:"elemente",verb:"să aibă"},map:{unit:"intrări",verb:"să aibă"}};function n(t){return e[t]??null}let o={regex:"intrare",email:"adresă de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dată și oră ISO",date:"dată ISO",time:"oră ISO",duration:"durată ISO",ipv4:"adresă IPv4",ipv6:"adresă IPv6",mac:"adresă MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"șir codat base64",base64url:"șir codat base64url",json_string:"șir JSON",e164:"număr E.164",credit_card:"număr de card de credit",currency_code:"cod valutar",iban:"IBAN",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"șir",number:"număr",boolean:"boolean",function:"funcție",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"număr mare",void:"void",never:"never",map:"hartă",set:"set"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return`Intrare invalidă: așteptat ${r}, primit ${s}`}case"invalid_value":return t.values.length===1?`Intrare invalidă: așteptat ${$(t.values[0])}`:`Opțiune invalidă: așteptat una dintre ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Prea mare: așteptat ca ${t.origin??"valoarea"} ${a.verb} ${r}${t.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: așteptat ca ${t.origin??"valoarea"} să fie ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Prea mic: așteptat ca ${t.origin} ${a.verb} ${r}${t.minimum.toString()} ${a.unit}`:`Prea mic: așteptat ca ${t.origin} să fie ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Șir invalid: trebuie să înceapă cu "${r.prefix}"`:r.format==="ends_with"?`Șir invalid: trebuie să se termine cu "${r.suffix}"`:r.format==="includes"?`Șir invalid: trebuie să includă "${r.includes}"`:r.format==="regex"?`Șir invalid: trebuie să se potrivească cu modelul ${r.pattern}`:`Format invalid: ${o[r.format]??t.format}`}case"not_multiple_of":return`Număr invalid: trebuie să fie multiplu de ${t.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${v(t.keys,", ")}`;case"invalid_key":return`Cheie invalidă în ${t.origin}`;case"invalid_union":return"Intrare invalidă";case"invalid_element":return`Valoare invalidă în ${t.origin}`;default:return"Intrare invalidă"}}};function Jf(){return{localeError:Ck()}}function Xf(e,n,o,i){let t=Math.abs(e),r=t%10,a=t%100;return a>=11&&a<=19?i:r===1?n:r>=2&&r<=4?o:i}var Dk=()=>{let e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},map:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function n(t){return e[t]??null}let o={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",mac:"MAC адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",credit_card:"номер кредитной карты",currency_code:"код валюты",iban:"IBAN",jwt:"JWT",template_literal:"ввод"},i={nan:"NaN",number:"число",array:"массив"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Неверный ввод: ожидалось instanceof ${t.expected}, получено ${s}`:`Неверный ввод: ожидалось ${r}, получено ${s}`}case"invalid_value":return t.values.length===1?`Неверный ввод: ожидалось ${$(t.values[0])}`:`Неверный вариант: ожидалось одно из ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);if(a){let s=Number(t.maximum),c=Xf(s,a.unit.one,a.unit.few,a.unit.many);return`Слишком большое значение: ожидалось, что ${t.origin??"значение"} будет иметь ${r}${t.maximum.toString()} ${c}`}return`Слишком большое значение: ожидалось, что ${t.origin??"значение"} будет ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);if(a){let s=Number(t.minimum),c=Xf(s,a.unit.one,a.unit.few,a.unit.many);return`Слишком маленькое значение: ожидалось, что ${t.origin} будет иметь ${r}${t.minimum.toString()} ${c}`}return`Слишком маленькое значение: ожидалось, что ${t.origin} будет ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Неверная строка: должна начинаться с "${r.prefix}"`:r.format==="ends_with"?`Неверная строка: должна заканчиваться на "${r.suffix}"`:r.format==="includes"?`Неверная строка: должна содержать "${r.includes}"`:r.format==="regex"?`Неверная строка: должна соответствовать шаблону ${r.pattern}`:`Неверный ${o[r.format]??t.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${t.divisor}`;case"unrecognized_keys":return`Нераспознанн${t.keys.length>1?"ые":"ый"} ключ${t.keys.length>1?"и":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${t.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${t.origin}`;default:return"Неверные входные данные"}}};function qf(){return{localeError:Dk()}}var Lk=()=>{let e={string:{unit:"znakov",verb:"mať"},file:{unit:"bajtov",verb:"mať"},array:{unit:"prvkov",verb:"mať"},set:{unit:"prvkov",verb:"mať"},map:{unit:"položiek",verb:"mať"}};function n(t){return e[t]??null}let o={regex:"regulárny výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dátum a čas vo formáte ISO",date:"dátum vo formáte ISO",time:"čas vo formáte ISO",duration:"doba trvania ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"reťazec zakódovaný vo formáte base64",base64url:"reťazec zakódovaný vo formáte base64url",json_string:"reťazec vo formáte JSON",e164:"číslo E.164",credit_card:"číslo kreditnej karty",currency_code:"kód meny",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"číslo",string:"reťazec",function:"funkcia",array:"pole"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Neplatný vstup: očakávané instanceof ${t.expected}, obdržané ${s}`:`Neplatný vstup: očakávané ${r}, obdržané ${s}`}case"invalid_value":return t.values.length===1?`Neplatný vstup: očakávané ${$(t.values[0])}`:`Neplatný vstup: očakávaná jedna z hodnôt ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Hodnota je príliš veľká: ${t.origin??"hodnota"} musí mať ${r}${t.maximum.toString()} ${a.unit??"prvkov"}`:`Hodnota je príliš veľká: ${t.origin??"hodnota"} musí byť ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Hodnota je príliš malá: ${t.origin??"hodnota"} musí mať ${r}${t.minimum.toString()} ${a.unit??"prvkov"}`:`Hodnota je príliš malá: ${t.origin??"hodnota"} musí byť ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Neplatný reťazec: musí začínať na "${r.prefix}"`:r.format==="ends_with"?`Neplatný reťazec: musí končiť na "${r.suffix}"`:r.format==="includes"?`Neplatný reťazec: musí obsahovať "${r.includes}"`:r.format==="regex"?`Neplatný reťazec: musí zodpovedať vzoru ${r.pattern}`:`Neplatný formát ${o[r.format]??t.format}`}case"not_multiple_of":return`Neplatné číslo: musí byť násobkom ${t.divisor}`;case"unrecognized_keys":return`Neznáme klúče: ${v(t.keys,", ")}`;case"invalid_key":return`Neplatný klúč v ${t.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${t.origin}`;default:return"Neplatný vstup"}}};function Yf(){return{localeError:Lk()}}var Uk=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"},map:{unit:"elementov",verb:"imeti"}};function n(t){return e[t]??null}let o={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",mac:"MAC naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",credit_card:"številka kreditne kartice",currency_code:"koda valute",iban:"IBAN",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"število",array:"tabela"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Neveljaven vnos: pričakovano instanceof ${t.expected}, prejeto ${s}`:`Neveljaven vnos: pričakovano ${r}, prejeto ${s}`}case"invalid_value":return t.values.length===1?`Neveljaven vnos: pričakovano ${$(t.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Preveliko: pričakovano, da bo ${t.origin??"vrednost"} imelo ${r}${t.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${t.origin??"vrednost"} ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Premajhno: pričakovano, da bo ${t.origin} imelo ${r}${t.minimum.toString()} ${a.unit}`:`Premajhno: pričakovano, da bo ${t.origin} ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Neveljaven niz: mora se začeti z "${r.prefix}"`:r.format==="ends_with"?`Neveljaven niz: mora se končati z "${r.suffix}"`:r.format==="includes"?`Neveljaven niz: mora vsebovati "${r.includes}"`:r.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${r.pattern}`:`Neveljaven ${o[r.format]??t.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${t.divisor}`;case"unrecognized_keys":return`Neprepoznan${t.keys.length>1?"i ključi":" ključ"}: ${v(t.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${t.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${t.origin}`;default:return"Neveljaven vnos"}}};function Qf(){return{localeError:Uk()}}var jk=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"},map:{unit:"objekt",verb:"att innehålla"}};function n(t){return e[t]??null}let o={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-adress",ipv6:"IPv6-adress",mac:"MAC-adress",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",credit_card:"kreditkortsnummer",currency_code:"valutakod",iban:"IBAN",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Ogiltig inmatning: förväntat instanceof ${t.expected}, fick ${s}`:`Ogiltig inmatning: förväntat ${r}, fick ${s}`}case"invalid_value":return t.values.length===1?`Ogiltig inmatning: förväntat ${$(t.values[0])}`:`Ogiltigt val: förväntade en av ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`För stor(t): förväntade ${t.origin??"värdet"} att ha ${r}${t.maximum.toString()} ${a.unit??"element"}`:`För stor(t): förväntat ${t.origin??"värdet"} att ha ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`För lite(t): förväntade ${t.origin??"värdet"} att ha ${r}${t.minimum.toString()} ${a.unit}`:`För lite(t): förväntade ${t.origin??"värdet"} att ha ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ogiltig sträng: måste börja med "${r.prefix}"`:r.format==="ends_with"?`Ogiltig sträng: måste sluta med "${r.suffix}"`:r.format==="includes"?`Ogiltig sträng: måste innehålla "${r.includes}"`:r.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${r.pattern}"`:`Ogiltig(t) ${o[r.format]??t.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${v(t.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${t.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${t.origin??"värdet"}`;default:return"Ogiltig input"}}};function eg(){return{localeError:jk()}}var Rk=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},map:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function n(t){return e[t]??null}let o={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",mac:"MAC முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",credit_card:"கடன் அட்டை எண்",currency_code:"நாணயக் குறியீடு",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${t.expected}, பெறப்பட்டது ${s}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${r}, பெறப்பட்டது ${s}`}case"invalid_value":return t.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${$(t.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${v(t.values,"|")} இல் ஒன்று`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${t.origin??"மதிப்பு"} ${r}${t.maximum.toString()} ${a.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${t.origin??"மதிப்பு"} ${r}${t.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${t.origin} ${r}${t.minimum.toString()} ${a.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${t.origin} ${r}${t.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let r=t;return r.format==="starts_with"?`தவறான சரம்: "${r.prefix}" இல் தொடங்க வேண்டும்`:r.format==="ends_with"?`தவறான சரம்: "${r.suffix}" இல் முடிவடைய வேண்டும்`:r.format==="includes"?`தவறான சரம்: "${r.includes}" ஐ உள்ளடக்க வேண்டும்`:r.format==="regex"?`தவறான சரம்: ${r.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${o[r.format]??t.format}`}case"not_multiple_of":return`தவறான எண்: ${t.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${t.keys.length>1?"கள்":""}: ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${t.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function tg(){return{localeError:Rk()}}var Mk=()=>{let e={string:{unit:"аломат",verb:"дошта бошад"},file:{unit:"байт",verb:"дошта бошад"},array:{unit:"унсур",verb:"дошта бошад"},set:{unit:"унсур",verb:"дошта бошад"},map:{unit:"сабт",verb:"дошта бошад"}};function n(t){return e[t]??null}let o={regex:"вуруд",email:"суроғаи email",url:"URL",emoji:"эмоҷи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"санаву вақти ISO",date:"санаи ISO",time:"вақти ISO",duration:"давомнокии ISO",ipv4:"суроғаи IPv4",ipv6:"суроғаи IPv6",mac:"суроғаи MAC",cidrv4:"маҳдудаи IPv4",cidrv6:"маҳдудаи IPv6",base64:"сатри дар формати base64",base64url:"сатри дар формати base64url",json_string:"сатри JSON",e164:"рақами E.164",credit_card:"рақами корти кредитӣ",currency_code:"рамзи асъор",iban:"IBAN",jwt:"JWT",template_literal:"вуруд"},i={nan:"NaN",number:"рақам",string:"сатр",array:"массив",object:"объект",date:"сана"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return`Вуруди нодуруст: ${r} интизор мерафт, ${s} гирифта шуд`}case"invalid_value":return t.values.length===1?`Вуруди нодуруст: ${$(t.values[0])} интизор мерафт`:`Интихоби нодуруст: яке аз ${v(t.values,"|")} интизор мерафт`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Хеле калон: ${t.origin??"қимат"} бояд ${r}${t.maximum.toString()} ${a.unit} ${a.verb}`:`Хеле калон: ${t.origin??"қимат"} бояд ${r}${t.maximum.toString()} бошад`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Хеле хурд: ${t.origin} бояд ${r}${t.minimum.toString()} ${a.unit} ${a.verb}`:`Хеле хурд: ${t.origin} бояд ${r}${t.minimum.toString()} бошад`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Сатри нодуруст: бояд бо "${r.prefix}" оғоз шавад`:r.format==="ends_with"?`Сатри нодуруст: бояд бо "${r.suffix}" анҷом ёбад`:r.format==="includes"?`Сатри нодуруст: бояд "${r.includes}"-ро дар бар гирад`:r.format==="regex"?`Сатри нодуруст: бояд ба намунаи ${r.pattern} мувофиқат кунад`:`${o[r.format]??t.format}-и нодуруст`}case"not_multiple_of":return`Рақами нодуруст: бояд ба ${t.divisor} бе бақия тақсим шавад`;case"unrecognized_keys":return`Калид${t.keys.length>1?"ҳои":"и"} номаълум: ${v(t.keys,", ")}`;case"invalid_key":return`Калиди нодуруст дар ${t.origin}`;case"invalid_union":return t.options&&Array.isArray(t.options)&&t.options.length>0?`Қимати нодурусти дискриминатор: ${t.options.map(a=>`'${a}'`).join(" | ")} интизор мерафт`:"Вуруди нодуруст";case"invalid_element":return`Қимати нодуруст дар ${t.origin}`;default:return"Вуруди нодуруст"}}};function ng(){return{localeError:Mk()}}var Fk=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"},map:{unit:"รายการ",verb:"ควรมี"}};function n(t){return e[t]??null}let o={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",mac:"ที่อยู่ MAC",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",credit_card:"หมายเลขบัตรเครดิต",currency_code:"รหัสสกุลเงิน",iban:"IBAN",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},i={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${t.expected} แต่ได้รับ ${s}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${r} แต่ได้รับ ${s}`}case"invalid_value":return t.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${$(t.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"ไม่เกิน":"น้อยกว่า",a=n(t.origin);return a?`เกินกำหนด: ${t.origin??"ค่า"} ควรมี${r} ${t.maximum.toString()} ${a.unit??"รายการ"}`:`เกินกำหนด: ${t.origin??"ค่า"} ควรมี${r} ${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?"อย่างน้อย":"มากกว่า",a=n(t.origin);return a?`น้อยกว่ากำหนด: ${t.origin} ควรมี${r} ${t.minimum.toString()} ${a.unit}`:`น้อยกว่ากำหนด: ${t.origin} ควรมี${r} ${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${r.prefix}"`:r.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${r.suffix}"`:r.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${r.includes}" อยู่ในข้อความ`:r.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${r.pattern}`:`รูปแบบไม่ถูกต้อง: ${o[r.format]??t.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${t.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${v(t.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${t.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${t.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function rg(){return{localeError:Fk()}}var Zk=()=>{let e={string:{unit:"simwol",verb:"bolmaly"},file:{unit:"baýt",verb:"bolmaly"},array:{unit:"elementler",verb:"bolmaly"},set:{unit:"elementler",verb:"bolmaly"},map:{unit:"elementler",verb:"bolmaly"}};function n(t){return e[t]??null}let o={regex:"giriş",email:"e-poçta salgysy",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sene we wagt",date:"ISO sene",time:"ISO wagt",duration:"ISO wagt aralygy",ipv4:"IPv4 salgysy",ipv6:"IPv6 salgysy",mac:"MAC salgysy",cidrv4:"IPv4 aralygy",cidrv6:"IPv6 aralygy",base64:"base64 bilen şifrlenen setir",base64url:"base64url bilen şifrlenen setir",json_string:"JSON setiri",e164:"E.164 nomeri",credit_card:"kredit kartynyň nomeri",currency_code:"walýuta kody",iban:"IBAN",jwt:"JWT",template_literal:"şablon"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return`Nädogry baha: garaşylan ${r} ýerine ${s} alyndy`}case"invalid_value":return t.values.length===1?`Nädogry baha: ${$(t.values[0])} bolmaly`:`Nädogry saýlaw: aşakdakylardan biri bolmaly: ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Has uly: garaşylýan ${t.origin??"baha"} ${r} ${t.maximum.toString()} ${a.unit??"element"}`:`Has uly: garaşylýan ${t.origin??"baha"} ${r} ${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Has kiçi: garaşylýan ${t.origin} ${r} ${t.minimum.toString()} ${a.unit}`:`Has kiçi: garaşylýan ${t.origin} ${r} ${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Nädogry setir: "${r.prefix}" bilen başlamaly`:r.format==="ends_with"?`Nädogry setir: "${r.suffix}" bilen gutarmaly`:r.format==="includes"?`Nädogry setir: "${r.includes}" saklamaly`:r.format==="regex"?`Nädogry setir: ${r.pattern} nusga laýyk bolmaly`:`Nädogry ${o[r.format]??t.format}`}case"not_multiple_of":return`Nädogry san: ${t.divisor} bilen galyndysyz bölünmeli`;case"unrecognized_keys":return`Tanalmaýan açar${t.keys.length>1?"lar":""}: ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} içinde nädogry açar`;case"invalid_union":return"Nädogry baha";case"invalid_element":return`${t.origin} içinde nädogry baha`;default:return"Nädogry baha"}}};function og(){return{localeError:Zk()}}var Gk=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"},map:{unit:"öğe",verb:"olmalı"}};function n(t){return e[t]??null}let o={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",mac:"MAC adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",credit_card:"kredi kartı numarası",currency_code:"para birimi kodu",iban:"IBAN",jwt:"JWT",template_literal:"Şablon dizesi"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Geçersiz değer: beklenen instanceof ${t.expected}, alınan ${s}`:`Geçersiz değer: beklenen ${r}, alınan ${s}`}case"invalid_value":return t.values.length===1?`Geçersiz değer: beklenen ${$(t.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Çok büyük: beklenen ${t.origin??"değer"} ${r}${t.maximum.toString()} ${a.unit??"öğe"}`:`Çok büyük: beklenen ${t.origin??"değer"} ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Çok küçük: beklenen ${t.origin} ${r}${t.minimum.toString()} ${a.unit}`:`Çok küçük: beklenen ${t.origin} ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Geçersiz metin: "${r.prefix}" ile başlamalı`:r.format==="ends_with"?`Geçersiz metin: "${r.suffix}" ile bitmeli`:r.format==="includes"?`Geçersiz metin: "${r.includes}" içermeli`:r.format==="regex"?`Geçersiz metin: ${r.pattern} desenine uymalı`:`Geçersiz ${o[r.format]??t.format}`}case"not_multiple_of":return`Geçersiz sayı: ${t.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${t.keys.length>1?"lar":""}: ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${t.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function ig(){return{localeError:Gk()}}var Vk=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"},map:{unit:"елементів",verb:"матиме"}};function n(t){return e[t]??null}let o={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",mac:"адреса MAC",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",credit_card:"номер кредитної картки",currency_code:"код валюти",iban:"IBAN",jwt:"JWT",template_literal:"вхідні дані"},i={nan:"NaN",number:"число",array:"масив"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Неправильні вхідні дані: очікується instanceof ${t.expected}, отримано ${s}`:`Неправильні вхідні дані: очікується ${r}, отримано ${s}`}case"invalid_value":return t.values.length===1?`Неправильні вхідні дані: очікується ${$(t.values[0])}`:`Неправильна опція: очікується одне з ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Занадто велике: очікується, що ${t.origin??"значення"} ${a.verb} ${r}${t.maximum.toString()} ${a.unit??"елементів"}`:`Занадто велике: очікується, що ${t.origin??"значення"} буде ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Занадто мале: очікується, що ${t.origin} ${a.verb} ${r}${t.minimum.toString()} ${a.unit}`:`Занадто мале: очікується, що ${t.origin} буде ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Неправильний рядок: повинен починатися з "${r.prefix}"`:r.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${r.suffix}"`:r.format==="includes"?`Неправильний рядок: повинен містити "${r.includes}"`:r.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${r.pattern}`:`Неправильний ${o[r.format]??t.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${t.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${t.keys.length>1?"і":""}: ${v(t.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${t.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${t.origin}`;default:return"Неправильні вхідні дані"}}};function li(){return{localeError:Vk()}}function ag(){return li()}var Hk=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"},map:{unit:"آئٹمز",verb:"ہونا"}};function n(t){return e[t]??null}let o={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",mac:"ایم اے سی ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",credit_card:"کریڈٹ کارڈ نمبر",currency_code:"کرنسی کوڈ",iban:"IBAN",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},i={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`غلط ان پٹ: instanceof ${t.expected} متوقع تھا، ${s} موصول ہوا`:`غلط ان پٹ: ${r} متوقع تھا، ${s} موصول ہوا`}case"invalid_value":return t.values.length===1?`غلط ان پٹ: ${$(t.values[0])} متوقع تھا`:`غلط آپشن: ${v(t.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`بہت بڑا: ${t.origin??"ویلیو"} کے ${r}${t.maximum.toString()} ${a.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${t.origin??"ویلیو"} کا ${r}${t.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`بہت چھوٹا: ${t.origin} کے ${r}${t.minimum.toString()} ${a.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${t.origin} کا ${r}${t.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let r=t;return r.format==="starts_with"?`غلط سٹرنگ: "${r.prefix}" سے شروع ہونا چاہیے`:r.format==="ends_with"?`غلط سٹرنگ: "${r.suffix}" پر ختم ہونا چاہیے`:r.format==="includes"?`غلط سٹرنگ: "${r.includes}" شامل ہونا چاہیے`:r.format==="regex"?`غلط سٹرنگ: پیٹرن ${r.pattern} سے میچ ہونا چاہیے`:`غلط ${o[r.format]??t.format}`}case"not_multiple_of":return`غلط نمبر: ${t.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${t.keys.length>1?"ز":""}: ${v(t.keys,"، ")}`;case"invalid_key":return`${t.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${t.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function sg(){return{localeError:Hk()}}var Bk=()=>{let e={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"},map:{unit:"yozuv",verb:"bo‘lishi kerak"}};function n(t){return e[t]??null}let o={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",credit_card:"kredit karta raqami",currency_code:"valyuta kodi",iban:"IBAN",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${t.expected}, qabul qilingan ${s}`:`Noto‘g‘ri kirish: kutilgan ${r}, qabul qilingan ${s}`}case"invalid_value":return t.values.length===1?`Noto‘g‘ri kirish: kutilgan ${$(t.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Juda katta: kutilgan ${t.origin??"qiymat"} ${r}${t.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${t.origin??"qiymat"} ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Juda kichik: kutilgan ${t.origin} ${r}${t.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${t.origin} ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Noto‘g‘ri satr: "${r.prefix}" bilan boshlanishi kerak`:r.format==="ends_with"?`Noto‘g‘ri satr: "${r.suffix}" bilan tugashi kerak`:r.format==="includes"?`Noto‘g‘ri satr: "${r.includes}" ni o‘z ichiga olishi kerak`:r.format==="regex"?`Noto‘g‘ri satr: ${r.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${o[r.format]??t.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${t.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${t.keys.length>1?"lar":""}: ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${t.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function ug(){return{localeError:Bk()}}var Wk=()=>{let e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"},map:{unit:"phần tử",verb:"có"}};function n(t){return e[t]??null}let o={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",mac:"địa chỉ MAC",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",credit_card:"số thẻ tín dụng",currency_code:"mã tiền tệ",iban:"IBAN",jwt:"JWT",template_literal:"đầu vào"},i={nan:"NaN",number:"số",array:"mảng"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${t.expected}, nhận được ${s}`:`Đầu vào không hợp lệ: mong đợi ${r}, nhận được ${s}`}case"invalid_value":return t.values.length===1?`Đầu vào không hợp lệ: mong đợi ${$(t.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Quá lớn: mong đợi ${t.origin??"giá trị"} ${a.verb} ${r}${t.maximum.toString()} ${a.unit??"phần tử"}`:`Quá lớn: mong đợi ${t.origin??"giá trị"} ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Quá nhỏ: mong đợi ${t.origin} ${a.verb} ${r}${t.minimum.toString()} ${a.unit}`:`Quá nhỏ: mong đợi ${t.origin} ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${r.prefix}"`:r.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${r.suffix}"`:r.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${r.includes}"`:r.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${r.pattern}`:`${o[r.format]??t.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${t.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${v(t.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${t.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${t.origin}`;default:return"Đầu vào không hợp lệ"}}};function cg(){return{localeError:Wk()}}var Kk=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"},map:{unit:"项",verb:"包含"}};function n(t){return e[t]??null}let o={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",mac:"MAC地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",credit_card:"信用卡号",currency_code:"货币代码",iban:"IBAN",jwt:"JWT",template_literal:"输入"},i={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`无效输入:期望 instanceof ${t.expected},实际接收 ${s}`:`无效输入:期望 ${r},实际接收 ${s}`}case"invalid_value":return t.values.length===1?`无效输入:期望 ${$(t.values[0])}`:`无效选项:期望以下之一 ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`数值过大:期望 ${t.origin??"值"} ${r}${t.maximum.toString()} ${a.unit??"个元素"}`:`数值过大:期望 ${t.origin??"值"} ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`数值过小:期望 ${t.origin} ${r}${t.minimum.toString()} ${a.unit}`:`数值过小:期望 ${t.origin} ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`无效字符串:必须以 "${r.prefix}" 开头`:r.format==="ends_with"?`无效字符串:必须以 "${r.suffix}" 结尾`:r.format==="includes"?`无效字符串:必须包含 "${r.includes}"`:r.format==="regex"?`无效字符串:必须满足正则表达式 ${r.pattern}`:`无效${o[r.format]??t.format}`}case"not_multiple_of":return`无效数字:必须是 ${t.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${v(t.keys,", ")}`;case"invalid_key":return`${t.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${t.origin} 中包含无效值(value)`;default:return"无效输入"}}};function lg(){return{localeError:Kk()}}var Jk=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"},map:{unit:"項目",verb:"擁有"}};function n(t){return e[t]??null}let o={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",mac:"MAC 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",credit_card:"信用卡號",currency_code:"貨幣代碼",iban:"IBAN",jwt:"JWT",template_literal:"輸入"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`無效的輸入值:預期為 instanceof ${t.expected},但收到 ${s}`:`無效的輸入值:預期為 ${r},但收到 ${s}`}case"invalid_value":return t.values.length===1?`無效的輸入值:預期為 ${$(t.values[0])}`:`無效的選項:預期為以下其中之一 ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`數值過大:預期 ${t.origin??"值"} 應為 ${r}${t.maximum.toString()} ${a.unit??"個元素"}`:`數值過大:預期 ${t.origin??"值"} 應為 ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`數值過小:預期 ${t.origin} 應為 ${r}${t.minimum.toString()} ${a.unit}`:`數值過小:預期 ${t.origin} 應為 ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`無效的字串:必須以 "${r.prefix}" 開頭`:r.format==="ends_with"?`無效的字串:必須以 "${r.suffix}" 結尾`:r.format==="includes"?`無效的字串:必須包含 "${r.includes}"`:r.format==="regex"?`無效的字串:必須符合格式 ${r.pattern}`:`無效的 ${o[r.format]??t.format}`}case"not_multiple_of":return`無效的數字:必須為 ${t.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${t.keys.length>1?"們":""}:${v(t.keys,"、")}`;case"invalid_key":return`${t.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${t.origin} 中有無效的值`;default:return"無效的輸入值"}}};function dg(){return{localeError:Jk()}}var Xk=()=>{let e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"},map:{unit:"nkan",verb:"ní"}};function n(t){return e[t]??null}let o={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",mac:"àdírẹ́sì MAC",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",credit_card:"nọmba kaadi gbese",currency_code:"koodu owó",iban:"IBAN",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},i={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return t=>{switch(t.code){case"invalid_type":{let r=i[t.expected]??t.expected,a=k(t.input),s=i[a]??a;return/^[A-Z]/.test(t.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${t.expected}, àmọ̀ a rí ${s}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${r}, àmọ̀ a rí ${s}`}case"invalid_value":return t.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${$(t.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${v(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=n(t.origin);return a?`Tó pọ̀ jù: a ní láti jẹ́ pé ${t.origin??"iye"} ${a.verb} ${r}${t.maximum} ${a.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${r}${t.maximum}`}case"too_small":{let r=t.inclusive?">=":">",a=n(t.origin);return a?`Kéré ju: a ní láti jẹ́ pé ${t.origin} ${a.verb} ${r}${t.minimum} ${a.unit}`:`Kéré ju: a ní láti jẹ́ ${r}${t.minimum}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${r.prefix}"`:r.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${r.suffix}"`:r.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${r.includes}"`:r.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${r.pattern}`:`Aṣìṣe: ${o[r.format]??t.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${t.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${v(t.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${t.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${t.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function pg(){return{localeError:Xk()}}var mg,Dc=Symbol("ZodOutput"),Lc=Symbol("ZodInput"),di=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...o){let i=o[0];return this._map.set(n,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){let o=this._map.get(n);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(n),this}get(n){let o=n._zod.parent;if(o){let i={...this.get(o)??{}};delete i.id;let t={...i,...this._map.get(n)};return Object.keys(t).length?t:void 0}return this._map.get(n)}has(n){return this._map.has(n)}};function pi(){return new di}(mg=globalThis).__zod_globalRegistry??(mg.__zod_globalRegistry=pi());var ce=globalThis.__zod_globalRegistry;var fe=Symbol.for("zod.compile.invalid"),fg=Symbol.for("zod.compile.fallback"),Le=class extends Error{constructor(n="z.compile does not support async refinements, transforms, or checks"){super(n),this.name="ZodCompileAsyncError"}},G=class extends Error{constructor(n,o=!0){super(`z.compile does not support ${n}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=o}};function Yk(e,n){try{return fi(e,{assertOnly:!0})}catch{return n}}function Mc(e,n){try{let o=fi(e),i=mi(e,o);return i._zod.bag.validator=Yk(e,o),i}catch(o){if(n?.strict)throw o;return e}}function mi(e,n){if(ai(e))throw new G("a schema whose subtree contains a reference cycle");let o=K(e),i=e._zod.run,t=i.__originalRun??i,r=(a,s)=>{if(s?.async||s?.direction==="backward"||s?.skipChecks||s?.[fg]||s&&si(s,a.value))return t(a,s);let c=n(a.value);return c!==fe?(a.value=c,a):(s&&(s[fg]=!0),t(a,s))};return r.__originalRun=t,o._zod.bag.fallbackRun=t,o._zod.bag.validator=n,o._zod.run=r,i.__originalRun||Qk(o,e,n),o}function Qk(e,n,o){let i=e,t=n;if(typeof t.safeParse=="function"){let r=t.safeParse;i.safeParse=(a,s)=>{let c=o(a);return c!==fe?{success:!0,data:c}:r(a,s)}}if(typeof t.parse=="function"){let r=t.parse;i.parse=(a,s)=>{let c=o(a);return c!==fe?c:r(a,s)}}}function fi(e,n){let o=!0;try{o=ai(e)}catch{}if(o)throw new G("a schema whose subtree contains a reference cycle");let i={constants:new Map,constantCounter:0,varCounter:0,definite:!0},t=new At(["input"]),r=ee(t,i,e,"input",!n?.assertOnly);t.write(r===null?"return true;":`return ${r};`);let a=["INVALID",...i.constants.keys()],s=[fe,...i.constants.values()],c=t.content.join(` +`),l=n?.debug?a.length>0?`// Constants: ${a.join(", ")} +${c}`:c:"",d=Function,p=`return (input) => { +${c} +}`,m;try{m=new d(...a,p)(...s)}catch(f){throw new G(`this schema (generated code failed to evaluate: ${f.message})`)}return n?.debug&&(m.code=l),m.definite=i.definite,m}function j(e,n){for(let[i,t]of e.constants)if(t===n)return i;let o=`c${e.constantCounter++}`;return e.constants.set(o,n),o}function zt(e,n){return e.definite=!1,j(e,n)}function z(e){return`v${e.varCounter++}`}function ex(e,n){let o=e._zod.run({value:n,issues:[]},{});if(o&&typeof o.then=="function")return fe;let i=o;return i.issues.length===0?i.value:fe}function de(e,n,o,i,t=!0){let r=e.content.length,a=n.constants.size,s=n.constantCounter,c=n.varCounter;try{return ee(e,n,o,i,t)}catch(l){if(!(l instanceof G)||!l.islandable)throw l;if(e.content.length=r,n.constants.size>a){let d=Array.from(n.constants.keys()).slice(a);for(let p of d)n.constants.delete(p)}return n.constantCounter=s,n.varCounter=c,tx(e,n,o,i)}}function tx(e,n,o,i){n.definite=!1;let t=j(n,o),r=j(n,ex),a=z(n);return e.write(`const ${a} = ${r}(${t}, ${i});`),e.write(`if (${a} === INVALID) return INVALID;`),a}var nx=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function rx(e,n,o,i){let t=o._zod.def.checks;if(!t||t.length===0)return i;let r=i;for(let a of t){let s=a._zod.def;if(s.when&&!nx.has(s.check))throw new G('check with a custom "when" condition');switch(s.check){case"greater_than":ox(e,n,s,r);break;case"less_than":ix(e,n,s,r);break;case"multiple_of":ax(e,n,s,r);break;case"number_format":_g(e,s,r);break;case"min_length":{let c=ut(s.minimum,"min_length"),l=Uc(e,n,r,`${r}.length >= ${c} && ${r}.length < ${s.minimum*2}`);e.write(`if (${l} < ${c}) return INVALID;`);break}case"max_length":{let c=ut(s.maximum,"max_length"),l=Uc(e,n,r,`${r}.length > ${c}`);e.write(`if (${l} > ${c}) return INVALID;`);break}case"length_equals":{let c=ut(s.length,"length_equals"),l=Uc(e,n,r,`${r}.length >= ${c} && ${r}.length <= ${s.length*2}`);e.write(`if (${l} !== ${c}) return INVALID;`);break}case"min_size":e.write(`if (${r}.size < ${ut(s.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${r}.size > ${ut(s.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${r}.size !== ${ut(s.size,"size_equals")}) return INVALID;`);break;case"string_format":r=$g(e,n,s,r);break;case"custom":r=px(e,n,a,r);break;case"bigint_format":sx(e,s,r);break;case"mime_type":ux(e,n,s,r);break;case"property":lx(e,n,s,r);break;case"properties":cx(e,n,s,r);break;case"overwrite":{let c=z(n);dx(e,n,a,r,c),r=c;break}default:throw new G(`check type ${s.check}`)}}return r}function Uc(e,n,o,i){let t=j(n,Tt),r=z(n);return e.write(`const ${r} = typeof ${o} === "string" && ${i} ? ${t}(${o}) : ${o}.length;`),r}function ut(e,n){if(typeof e!="number"||!Number.isFinite(e))throw new G(`${n} bound of type ${typeof e}`);return`${e}`}function bg(e,n){if(typeof n=="bigint")return`${n}n`;if(typeof n=="number"){if(Number.isNaN(n))throw new G("comparison check with NaN bound");return`${n}`}if(n instanceof Date){if(Number.isNaN(n.getTime()))throw new G("comparison check with Invalid Date bound");return j(e,n)}throw new G(`comparison check bound of type ${typeof n}`)}function ox(e,n,o,i){let t=o.inclusive?"<":"<=";e.write(`if (${i} ${t} ${bg(n,o.value)}) return INVALID;`)}function ix(e,n,o,i){let t=o.inclusive?">":">=";e.write(`if (${i} ${t} ${bg(n,o.value)}) return INVALID;`)}function ax(e,n,o,i){if(typeof o.value=="bigint"){if(o.value===BigInt(0))throw new G("multiple_of check with a zero divisor");e.write(`if (${i} % ${o.value}n !== 0n) return INVALID;`)}else{let t=j(n,er);e.write(`if (${t}(${i}, ${ut(o.value,"multiple_of")}) !== 0) return INVALID;`)}}function _g(e,n,o){let i=n.format;switch(i){case"safeint":e.write(`if (!Number.isSafeInteger(${o})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${o}) || ${o} < -2147483648 || ${o} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${o}) || ${o} < 0 || ${o} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${o}) || ${o} < -3.4028234663852886e38 || ${o} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${o})) return INVALID;`);break;default:throw new G(`number format ${i}`)}}function sx(e,n,o){let i=n.format;if(i)switch(i){case"int64":e.write(`if (${o} < -9223372036854775808n || ${o} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${o} < 0n || ${o} > 18446744073709551615n) return INVALID;`);break;default:throw new G(`bigint format ${i}`)}}function ux(e,n,o,i){let t=o.mime;if(t&&t.length>0){let r=j(n,new Set(t));e.write(`if (!${r}.has(${i}.type)) return INVALID;`)}}function cx(e,n,o,i){if(o.when)throw new G('check with a custom "when" condition');e.write(`if (${i} == null) return INVALID;`);let t=o.shape;for(let r of Reflect.ownKeys(t)){let a=typeof r=="symbol"?j(n,r):pe(r),s=z(n);e.write(`const ${s} = ${i}[${a}];`),de(e,n,t[r],s,!1)}}function lx(e,n,o,i){let t=`${i}[${JSON.stringify(o.property)}]`;ee(e,n,o.schema,t)}function dx(e,n,o,i,t){let r=o._zod.def.tx;if(!r)throw new G("overwrite check without a transform function");if(Ct(r))throw new Le("z.compile: async overwrite transforms are not supported");let a=j(n,r);e.write(`const ${t} = ${a}(${i});`)}function jc(){throw new ke}function Fc(e){this.issues.push(e)}function px(e,n,o,i){let t=o._zod.def;if(t.fn){if(Ct(t.fn))throw new Le("z.compile: async .refine() predicates are not supported");let r=zt(n,t.fn),a=j(n,jc),s=z(n);return e.write(`const ${s} = ${r}(${i});`),e.write(`if (${s} instanceof Promise) ${a}();`),e.write(`if (!${s}) return INVALID;`),i}if(o._zod.check){if(Ct(o._zod.check))throw new Le("z.compile: async .superRefine() / check functions are not supported");let r=o._zod.check,s=zt(n,l=>{let d={value:l,issues:[],addIssue:Fc};return r(d)instanceof Promise&&jc(),d.issues.length===0?d.value:fe}),c=z(n);return e.write(`const ${c} = ${s}(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new G("custom check without a predicate or check function")}var mx=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function $g(e,n,o,i,t=!0){let r=o.format;if(r==="base64"){let l=j(n,_r);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(r==="base64url"){let l=j(n,Wo);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(r==="jwt"){let l=j(n,Xo),d=j(n,o.alg??null);return e.write(`if (!${l}(${i}, ${d})) return INVALID;`),i}if(r==="ipv6"){let l=j(n,br);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(r==="cidrv6"){let l=j(n,Ho);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(r==="credit_card"){let l=j(n,Ko);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(r==="iban"){let l=j(n,Jo);return e.write(`if (!${l}(${i})) return INVALID;`),i}let a=o;if(r==="url"||r==="httpurl"||a.normalize||a.hostname!==void 0||a.protocol!==void 0){let l=j(n,Zo),d=j(n,o),p=z(n),m=z(n);if(e.write(`const ${p} = ${i}.trim();`),e.write(`const ${m} = ${l}(${p}, ${d});`),e.write(`if (typeof ${m} === "number") return INVALID;`),a.hostname!==void 0){let y=j(n,Go);e.write(`if (!${y}(${m}, ${d}.hostname)) return INVALID;`)}if(a.protocol!==void 0){let y=j(n,Vo);e.write(`if (!${y}(${m}, ${d}.protocol)) return INVALID;`)}if(!t)return null;let f=z(n),g=a.normalize?`${m}.href`:`${j(n,yr)}(${p})`;return e.write(`const ${f} = ${g};`),f}let s=o.fn;if(s){if(Ct(s))throw new G(`async string format ${r}`);let l=j(n,s);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(mx.has(r)&&o.pattern){let l=j(n,o.pattern);return e.write(`${l}.lastIndex = 0;`),e.write(`if (!${l}.test(${i})) return INVALID;`),i}let c=o.format;switch(c){case"regex":throw new G("regex format without a pattern");case"lowercase":e.write(`if (${i} !== ${i}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${i} !== ${i}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${i}.includes(${pe(o.includes)})) return INVALID;`);break;case"starts_with":{let l=o.prefix;e.write(`if (${i}.slice(0, ${l.length}) !== ${pe(l)}) return INVALID;`);break}case"ends_with":{let l=o.suffix;e.write(`if (${i}.slice(-${l.length}) !== ${pe(l)}) return INVALID;`);break}default:throw new G(`string format ${c}`)}return i}function ee(e,n,o,i,t=!0){let r=o._zod.def,a=r.type;if(r.coerce)throw new G(`coercion (z.coerce.${a}())`);let s=t||!!r.checks?.length,c;switch(a){case"string":c=fx(e,n,o,i,s);break;case"number":c=gx(e,o,i);break;case"boolean":c=hx(e,i);break;case"bigint":c=vx(e,o,i);break;case"symbol":c=yx(e,i);break;case"undefined":c=bx(e,i);break;case"null":c=_x(e,i);break;case"any":case"unknown":c=i;break;case"never":e.write("return INVALID;"),c=i;break;case"void":c=$x(e,i);break;case"nan":c=kx(e,i);break;case"date":c=xx(e,i);break;case"object":c=Ix(e,n,o,i,s);break;case"optional":c=wx(e,n,o,i,s);break;case"nullable":c=Tx(e,n,o,i,s);break;case"array":c=Ex(e,n,o,i,s);break;case"literal":c=Ax(e,n,o,i);break;case"enum":c=Ox(e,n,o,i);break;case"readonly":{let l=hg(e,n,o,i),d=z(n);e.write(`const ${d} = Object.freeze(${l});`),c=d;break}case"success":hg(e,n,o,i),c="true";break;case"default":case"prefault":c=Nx(e,n,o,i);break;case"nonoptional":c=zx(e,n,o,i);break;case"tuple":c=Cx(e,n,o,i);break;case"union":c=Dx(e,n,o,i);break;case"intersection":c=jx(e,n,o,i);break;case"record":c=Rx(e,n,o,i);break;case"map":c=Fx(e,n,o,i);break;case"set":c=Zx(e,n,o,i);break;case"file":c=Gx(e,i);break;case"template_literal":c=Vx(e,n,o,i);break;case"lazy":c=Hx(e,n,o,i);break;case"pipe":c=Bx(e,n,o,i);break;case"custom":c=Wx(e,n,o,i);break;case"transform":c=Xx(e,n,o,i);break;case"catch":c=Jx(e,n,o,i);break;default:throw new G(`schema type ${a}`)}return c===null?null:rx(e,n,o,c)}function fx(e,n,o,i,t=!0){e.write(`if (typeof ${i} !== "string") return INVALID;`);let r=o._zod.def;return r.format===void 0?i:$g(e,n,r,i,t)}function gx(e,n,o){e.write(`if (typeof ${o} !== "number" || !Number.isFinite(${o})) return INVALID;`);let i=n._zod.def;return i.check==="number_format"&&i.format&&_g(e,{format:i.format},o),o}function hx(e,n){return e.write(`if (typeof ${n} !== "boolean") return INVALID;`),n}function vx(e,n,o){e.write(`if (typeof ${o} !== "bigint") return INVALID;`);let i=n._zod.def;if(i.format)switch(i.format){case"int64":e.write(`if (${o} < -9223372036854775808n || ${o} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${o} < 0n || ${o} > 18446744073709551615n) return INVALID;`);break}return o}function yx(e,n){return e.write(`if (typeof ${n} !== "symbol") return INVALID;`),n}function bx(e,n){return e.write(`if (${n} !== undefined) return INVALID;`),n}function _x(e,n){return e.write(`if (${n} !== null) return INVALID;`),n}function $x(e,n){return e.write(`if (${n} !== undefined) return INVALID;`),n}function kx(e,n){return e.write(`if (typeof ${n} !== "number" || !Number.isNaN(${n})) return INVALID;`),n}function xx(e,n){return e.write(`if (!(${n} instanceof Date) || Number.isNaN(${n}.getTime())) return INVALID;`),n}function Ix(e,n,o,i,t=!0){let r=o._zod.def;e.write(`if (typeof ${i} !== "object" || ${i} === null || Array.isArray(${i})) return INVALID;`);let a=r.shape,s=Object.keys(a),c=Object.getOwnPropertySymbols(a),l=c.length?[...s,...c]:s,d=b=>typeof b=="symbol"?j(n,b):pe(b),p=b=>typeof b=="symbol"?`[${d(b)}]`:pe(b),m=a;if(s.includes("__proto__"))throw new G('object shape key "__proto__"');let f=new Map;for(let b of l){let P=m[b],A=d(b),D=z(n);if(e.write(`const ${D} = ${i}[${A}];`),P._zod.optin!==void 0){let I=z(n);e.write(`let ${I} = (() => {`),e.indented(O=>{let E=de(O,n,P,D);O.write(`return ${E};`)}),e.write("})();"),P._zod.optout==="optional"?(e.write(`if (${I} === INVALID) {`),e.indented(O=>{O.write(`if (${A} in ${i}) return INVALID;`),O.write(`${I} = undefined;`)}),e.write("}")):e.write(`if (${I} === INVALID) return INVALID;`),f.set(b,I)}else{Px(P)&&e.write(`if (!(${A} in ${i})) return INVALID;`);let I=de(e,n,P,D,t);I!==null&&f.set(b,I)}}let g=r.catchall,y="none";if(g){let b=g._zod.def.type;if(b==="never"){let P=s.map(A=>`k !== ${pe(A)}`).join(" && ")||"true";e.write(`for (const k in ${i}) {`),e.indented(A=>{A.write(`if (${P}) return INVALID;`)}),e.write("}")}else(b==="unknown"||b==="any")&&!g._zod.def.checks?.length?y="passthrough":y="schema"}let x=z(n),w=l.some(b=>gg(m[b])||Rc(m[b]));if(!t){if(y==="schema"){let b=s.length>0?j(n,new Set(s)):null;e.write(`for (const k in ${i}) {`),e.indented(P=>{P.write('if (k === "__proto__") continue;'),b&&P.write(`if (${b}.has(k)) continue;`);let A=z(n);P.write(`const ${A} = ${i}[k];`),de(P,n,g,A,!1)}),e.write("}")}return null}if(w){e.write(`const ${x} = {};`);for(let b of l){let P=d(b),A=f.get(b);Rc(m[b])?e.write(`if (${P} in ${i}) ${x}[${P}] = ${A};`):gg(m[b])?e.write(`if (${A} !== undefined || ${P} in ${i}) ${x}[${P}] = ${A};`):e.write(`${x}[${P}] = ${A};`)}}else{let b=l.map(P=>`${p(P)}: ${f.get(P)}`).join(", ");e.write(`const ${x} = { ${b} };`)}if(y!=="none"){let b=s.length>0?j(n,new Set(s)):null;e.write(`for (const k in ${i}) {`),e.indented(P=>{if(P.write('if (k === "__proto__") continue;'),b&&P.write(`if (${b}.has(k)) continue;`),y==="passthrough")P.write(`${x}[k] = ${i}[k];`);else{let A=z(n);P.write(`const ${A} = ${i}[k];`);let D=de(P,n,g,A);P.write(`${x}[k] = ${D};`)}}),e.write("}")}return x}function wx(e,n,o,i,t=!0){let r=o._zod.def;if(Sx(o))return ee(e,n,r.innerType,i,t);if(r.innerType._zod.optin==="defaulted"){let s=z(n),c=z(n);return e.write(`let ${s};`),e.write(`if (${i} === undefined) {`),e.indented(l=>{l.write(`const ${c} = (() => {`),l.indented(d=>{let p=ee(d,n,r.innerType,i);d.write(`return ${p};`)}),l.write("})();"),l.write(`if (${c} !== INVALID) ${s} = ${c};`)}),e.write("} else {"),e.indented(l=>{let d=ee(l,n,r.innerType,i);l.write(`${s} = ${d};`)}),e.write("}"),s}let a=t?z(n):null;return a&&e.write(`let ${a};`),e.write(`if (${i} !== undefined) {`),e.indented(s=>{let c=ee(s,n,r.innerType,i,t);a&&c!==null&&s.write(`${a} = ${c};`)}),e.write("}"),a}function Sx(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function Px(e){return e._zod.optin===void 0&&Nt(e)}function Nt(e){if(e._zod.def.coerce)return!0;let n=e._zod.def;switch(n.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return n.innerType?Nt(n.innerType):!1;case"literal":return!!n.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return n.innerType?Nt(n.innerType):!0;case"catch":return!0;case"union":return n.options?n.options.some(Nt):!0;case"intersection":return!n.left||!n.right?!0:Nt(n.left)&&Nt(n.right);case"pipe":return n.in?Nt(n.in):!0;default:return!0}}function Rc(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function gg(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&mn(e)}function mn(e){let n=e._zod.def;switch(n.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!n.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return n.innerType?mn(n.innerType):!0;case"union":return n.options?n.options.some(mn):!0;case"intersection":return!n.left||!n.right||mn(n.left)||mn(n.right);case"pipe":return n.out?mn(n.out):!0;default:return!0}}function Tx(e,n,o,i,t=!0){let r=o._zod.def,a=t?z(n):null;return a&&e.write(`let ${a} = null;`),e.write(`if (${i} !== null) {`),e.indented(s=>{let c=ee(s,n,r.innerType,i,t);a&&c!==null&&s.write(`${a} = ${c};`)}),e.write("}"),a}function Zc(e,n,o){for(let[i,t]of nn(n._zod.def.checks))e.write(`if (${o} > ${ut(i,t._zod.def.check)}) return INVALID;`)}function Ex(e,n,o,i,t=!0){let r=o._zod.def;e.write(`if (!Array.isArray(${i})) return INVALID;`),Zc(e,o,`${i}.length`);let a=t?z(n):null,s=z(n),c=z(n);return a&&e.write(`const ${a} = new Array(${i}.length);`),e.write(`for (let ${s} = 0; ${s} < ${i}.length; ${s}++) {`),e.indented(l=>{l.write(`const ${c} = ${i}[${s}];`);let d=de(l,n,r.element,c,t);a&&d!==null&&l.write(`${a}[${s}] = ${d};`)}),e.write("}"),a}function Ax(e,n,o,i){let r=o._zod.def.values;if(r.length!==1){let s=j(n,new Set(r));return e.write(`if (!${s}.has(${i})) return INVALID;`),i}let a=r[0];if(typeof a=="number"&&Number.isNaN(a)){let s=j(n,new Set(r));return e.write(`if (!${s}.has(${i})) return INVALID;`),i}if(typeof a=="string")e.write(`if (${i} !== ${pe(a)}) return INVALID;`);else if(typeof a=="number"||typeof a=="boolean")e.write(`if (${i} !== ${a}) return INVALID;`);else if(a===null)e.write(`if (${i} !== null) return INVALID;`);else if(a===void 0)e.write(`if (${i} !== undefined) return INVALID;`);else if(typeof a=="bigint")e.write(`if (${i} !== ${a}n) return INVALID;`);else throw new G(`literal type ${typeof a}`);return i}function Ox(e,n,o,i){let t=o._zod.values;if(!t)throw new G("enum schema without enumerated values");let r=j(n,t);return e.write(`if (!${r}.has(${i})) return INVALID;`),i}function hg(e,n,o,i){let t=o._zod.def;return ee(e,n,t.innerType,i)}function Nx(e,n,o,i){let t=o._zod.def,a=Object.getOwnPropertyDescriptor(o._zod.def,"defaultValue")?()=>o._zod.def.defaultValue:void 0;if(o._zod.def.type==="prefault"){if(!a)return ee(e,n,t.innerType,i);let c=j(n,a),l=z(n);return e.write(`let ${l} = ${i};`),e.write(`if (${i} === undefined) ${l} = ${c}();`),ee(e,n,t.innerType,l)}let s=z(n);if(a){let c=j(n,a),l=j(n,tr);e.write(`let ${s};`),e.write(`if (${i} === undefined) {`),e.indented(d=>{d.write(`${s} = ${l}(${c}());`)}),e.write("} else {"),e.indented(d=>{let p=ee(d,n,t.innerType,i);d.write(`${s} = ${p} === undefined ? ${l}(${c}()) : ${p};`)}),e.write("}")}else e.write(`let ${s};`),e.write(`if (${i} !== undefined) {`),e.indented(c=>{let l=ee(c,n,t.innerType,i);c.write(`${s} = ${l};`)}),e.write("}");return s}function zx(e,n,o,i){let t=o._zod.def,r=ee(e,n,t.innerType,i),a=z(n);return e.write(`const ${a} = ${r};`),e.write(`if (${a} === undefined) return INVALID;`),a}function Cx(e,n,o,i){let t=o._zod.def,r=t.items,a=t.rest;e.write(`if (!Array.isArray(${i})) return INVALID;`);let s=vg(r,"optin"),c=vg(r,"optout");a?e.write(`if (${i}.length < ${s}) return INVALID;`):e.write(`if (${i}.length < ${s} || ${i}.length > ${r.length}) return INVALID;`);let l=z(n);e.write(`const ${l} = [];`);for(let d=0;d=c)e.write(`if (${l}.length === ${d}) {`),e.indented(m=>{m.write(`if (${d} < ${i}.length) {`),m.indented(f=>{let g=z(n);f.write(`const ${g} = ${i}[${d}];`);let y=de(f,n,p,g);f.write(`${l}[${d}] = ${y};`)}),m.write("} else {"),m.indented(f=>{if(Rc(p)){f.write(`${l}.length = ${d};`);return}let g=z(n),y=z(n);f.write(`const ${g} = undefined;`),f.write(`const ${y} = (() => {`),f.indented(x=>{let w=de(x,n,p,g);x.write(`return ${w};`)}),f.write("})();"),f.write(`if (${y} === INVALID || ${y} === undefined) ${l}.length = ${d};`),f.write(`else ${l}[${d}] = ${y};`)}),m.write("}")}),e.write("}");else{let m=z(n);e.write(`const ${m} = ${i}[${d}];`);let f=de(e,n,p,m);e.write(`${l}[${d}] = ${f};`)}}if(a){let d=z(n),p=z(n);e.write(`for (let ${d} = ${r.length}; ${d} < ${i}.length; ${d}++) {`),e.indented(m=>{m.write(`const ${p} = ${i}[${d}];`);let f=de(m,n,a,p);m.write(`${l}[${d}] = ${f};`)}),e.write("}")}return l}function vg(e,n){for(let o=e.length-1;o>=0;o--)if(!(n==="optin"?e[o]._zod.optin!==void 0:e[o]._zod.optout==="optional"))return o+1;return 0}function Dx(e,n,o,i){let t=o._zod.def,r=t.options;if(t.discriminator)return Lx(e,n,t,i);if(t.inclusive===!1)throw new G("exclusive unions (z.xor)");if(r.length===0)return e.write("return INVALID;"),i;if(r.length===1)return ee(e,n,r[0],i);if(r.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(r.flatMap(d=>d._zod.def.values)),l=j(n,c);return e.write(`if (!${l}.has(${i})) return INVALID;`),i}let s=z(n);e.write(`let ${s};`);for(let c=0;c {`):e.write(`if (${s} === INVALID) ${s} = (() => {`),e.indented(d=>{let p=ee(d,n,l,i);d.write(`return ${p};`)}),e.write("})();")}return e.write(`if (${s} === INVALID) return INVALID;`),s}function Lx(e,n,o,i){if(o.unionFallback)throw new G("discriminated union with unionFallback");if(o.options.length===0)return e.write("return INVALID;"),i;let t=z(n),r=z(n);e.write(`const ${t} = ${i}?.[${pe(o.discriminator)}];`),e.write(`let ${r};`);let a=!0,s=new Set;for(let c of o.options){let l=c._zod.propValues?.[o.discriminator];if(!l||l.size===0)throw new G("discriminated union option without static discriminator values");for(let m of l){if(s.has(m))throw new G(`duplicate discriminator value ${String(m)}`);s.add(m)}let d=Array.from(l,m=>Ux(n,t,m)),p=a?"if":"else if";e.write(`${p} (${d.join(" || ")}) {`),e.indented(m=>{let f=ee(m,n,c,i);m.write(`${r} = ${f};`)}),e.write("}"),a=!1}return e.write("else { return INVALID; }"),r}function Ux(e,n,o){if(typeof o=="string")return`${n} === ${pe(o)}`;if(typeof o=="number")return Number.isNaN(o)?`Number.isNaN(${n})`:`${n} === ${o}`;if(typeof o=="boolean")return`${n} === ${o}`;if(o===null)return`${n} === null`;if(o===void 0)return`${n} === undefined`;if(typeof o=="bigint")return`${n} === ${o}n`;if(typeof o=="symbol"){let i=j(e,o);return`${n} === ${i}`}throw new G(`literal discriminator value ${String(o)}`)}function jx(e,n,o,i){let t=o._zod.def;n.definite=!1;let r=de(e,n,t.left,i),a=de(e,n,t.right,i),s=j(n,ln),c=z(n);return e.write(`const ${c} = ${s}(${r}, ${a});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function Rx(e,n,o,i){let t=o._zod.def,r=j(n,Pe);e.write(`if (!${r}(${i})) return INVALID;`);let a=z(n),s=z(n),c=z(n);e.write(`const ${a} = {};`);let l=t,d=l.partial?void 0:t.keyType._zod.values;if(d){let f=[];for(let y of d){if(!(typeof y=="string"||typeof y=="number"||typeof y=="symbol"))throw new G(`record key value ${String(y)}`);let x=typeof y=="number"?y.toString():y;if(x==="__proto__")throw new G('record key "__proto__"');f.push(x);let w=j(n,y),b=ee(e,n,t.keyType,w),P=z(n);e.write(`const ${P} = ${i}[${Mx(n,x)}];`);let A=de(e,n,t.valueType,P);e.write(`${a}[${b}] = ${A};`)}let g=j(n,new Set(f));return e.write(`for (const ${s} in ${i}) {`),e.indented(y=>{y.write(`if (${g}.has(${s})) continue;`),l.mode==="loose"?y.write(`if (${s} !== "__proto__") ${a}[${s}] = ${i}[${s}];`):y.write("return INVALID;")}),e.write("}"),a}let p=t.keyType._zod.def;if(!(p.type==="string"&&p.format===void 0&&!p.coerce&&(p.checks?.length??0)===0)){let f=t.mode==="loose",g=fi(t.keyType);g.definite===!1&&(n.definite=!1);let y=j(n,g),x=j(n,et),w=z(n);return yg(e,n,i,s,b=>{b.write(`let ${w} = ${y}(${s});`),b.write(`if (${w} === INVALID && typeof ${s} === "string" && ${x}.test(${s})) ${w} = ${y}(Number(${s}));`),f?b.write(`if (${w} === INVALID) { ${a}[${s}] = ${i}[${s}]; continue; }`):b.write(`if (${w} === INVALID) return INVALID;`),b.write(`if (${w} === "__proto__") continue;`);let P=z(n);b.write(`const ${P} = ${i}[${s}];`);let A=de(b,n,t.valueType,P);b.write(`${a}[${w}] = ${A};`)}),a}return yg(e,n,i,s,f=>{f.write(`const ${c} = ${i}[${s}];`);let g=de(f,n,t.valueType,c);f.write(`${a}[${s}] = ${g};`)},"return INVALID;"),a}function yg(e,n,o,i,t,r){let a=j(n,Object.prototype.propertyIsEnumerable),s=z(n),c=z(n),l=z(n);e.write(`const ${s} = Object.getOwnPropertySymbols(${o});`),e.write(`const ${c} = Object.getOwnPropertyNames(${o});`),e.write(`for (let ${l} = 0; ${l} < ${c}.length; ${l}++) {`),e.indented(d=>{d.write(`const ${i} = ${c}[${l}];`),d.write(`if (${i} === "__proto__" || !${a}.call(${o}, ${i})) continue;`),t(d)}),e.write("}"),e.write(`for (let ${l} = 0; ${l} < ${s}.length; ${l}++) {`),e.indented(d=>{d.write(`const ${i} = ${s}[${l}];`),d.write(`if (!${a}.call(${o}, ${i})) continue;`),r?d.write(r):t(d)}),e.write("}")}function Mx(e,n){return typeof n=="string"?pe(n):j(e,n)}function Fx(e,n,o,i){let t=o._zod.def;e.write(`if (!(${i} instanceof Map)) return INVALID;`),Zc(e,o,`${i}.size`);let r=z(n),a=z(n),s=z(n);return e.write(`const ${r} = new Map();`),e.write(`for (const [${a}, ${s}] of ${i}) {`),e.indented(c=>{let l=ee(c,n,t.keyType,a),d=ee(c,n,t.valueType,s);c.write(`${r}.set(${l}, ${d});`)}),e.write("}"),r}function Zx(e,n,o,i){let t=o._zod.def;e.write(`if (!(${i} instanceof Set)) return INVALID;`),Zc(e,o,`${i}.size`);let r=z(n),a=z(n);return e.write(`const ${r} = new Set();`),e.write(`for (const ${a} of ${i}) {`),e.indented(s=>{let c=ee(s,n,t.valueType,a);s.write(`${r}.add(${c});`)}),e.write("}"),r}function Gx(e,n){return e.write(`if (!(${n} instanceof File)) return INVALID;`),n}function Vx(e,n,o,i){e.write(`if (typeof ${i} !== "string") return INVALID;`);let t=o._zod.pattern;if(t){let r=j(n,t);e.write(`${r}.lastIndex = 0;`),e.write(`if (!${r}.test(${i})) return INVALID;`)}return i}function Hx(e,n,o,i){let t=o._zod.def,r=zt(n,t.getter),a=j(n,{parser:null});e.write(`if (!${a}.parser) {`),e.indented(c=>{c.write(`const inner = ${r}();`),c.write(`${a}.parser = function(input) {`),c.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),e.write("}");let s=z(n);return e.write(`const ${s} = ${a}.parser(${i});`),e.write(`if (${s} === INVALID) return INVALID;`),s}function Bx(e,n,o,i){let t=o._zod.def,r=ee(e,n,t.in,i);if(t.transform){if(Ct(t.transform))throw new Le("z.compile: async transforms in pipes are not supported");let a=t.transform,c=zt(n,d=>{let p={value:d,issues:[],addIssue:Fc},m=a(d,p);return m instanceof Promise?fe:p.issues.length===0?m:fe}),l=z(n);return e.write(`const ${l} = ${c}(${r});`),e.write(`if (${l} === INVALID) return INVALID;`),ee(e,n,t.out,l)}else return ee(e,n,t.out,r)}function Ct(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function Wx(e,n,o,i){let t=o._zod.def;if(t.fn){if(Ct(t.fn))throw new Le("z.compile: async custom predicates are not supported");let r=zt(n,t.fn),a=j(n,jc),s=z(n);e.write(`const ${s} = ${r}(${i});`),e.write(`if (${s} instanceof Promise) ${a}();`),e.write(`if (!${s}) return INVALID;`)}else throw new G("custom schema without a predicate function");return i}function Kx(e,n,o){let i=e._zod.run({value:o,issues:[]},{});if(i&&typeof i.then=="function")return fe;let t=i;return t.issues.length===0?t.value:n()}function Jx(e,n,o,i){let t=o._zod.def;if(!t.catchValue[bo])throw new G("catch with a callback (only a constant catch value compiles)",!1);let r=z(n);e.write(`let ${r} = (() => {`),e.indented(l=>{let d=de(l,n,t.innerType,i);l.write(`return ${d};`)}),e.write("})();");let a=j(n,t.innerType),s=zt(n,t.catchValue),c=j(n,Kx);return e.write(`if (${r} === INVALID) {`),e.indented(l=>{l.write(`${r} = ${c}(${a}, ${s}, ${i});`),l.write(`if (${r} === INVALID) return INVALID;`)}),e.write("}"),r}function Xx(e,n,o,i){let t=o._zod.def;if(t.transform){if(Ct(t.transform))throw new Le("z.compile: async transforms are not supported");let r=t.transform,s=zt(n,l=>{let d={value:l,issues:[],addIssue:Fc},p=r(l,d);return p instanceof Promise?fe:d.issues.length===0?p:fe}),c=z(n);return e.write(`const ${c} = ${s}(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return i}function gi(e){return e.checks&&(e.checks=[...e.checks]),e}function Gc(e,n){return new e(gi({type:"string",...S(n)}))}function Vc(e,n){return new e(gi({type:"string",coerce:!0,...S(n)}))}function hi(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...S(n)})}function vi(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...S(n)})}function yi(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...S(n)})}function bi(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(n)})}function _i(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(n)})}function $i(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(n)})}function Or(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...S(n)})}function ki(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...S(n)})}function xi(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(n)})}function Ii(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...S(n)})}function wi(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(n)})}function Si(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...S(n)})}function Pi(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...S(n)})}function Ti(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(n)})}function Ei(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(n)})}function Ai(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(n)})}function Hc(e,n){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...S(n)})}function Oi(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(n)})}function Ni(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(n)})}function zi(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...S(n)})}function Ci(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...S(n)})}function Di(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...S(n)})}function Bc(e,n){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...S(n)})}function Wc(e,n){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...S(n)})}function Li(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...S(n)})}var Kc={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Nr(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(n)})}function zr(e,n){return new e({type:"string",format:"date",check:"string_format",...S(n)})}function Cr(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...S(n)})}function Dr(e,n){return new e({type:"string",format:"duration",check:"string_format",...S(n)})}function Jc(e,n){return new e(gi({type:"number",checks:[],...S(n)}))}function Xc(e,n){return new e(gi({type:"number",coerce:!0,checks:[],...S(n)}))}function qc(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...S(n)})}function Yc(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...S(n)})}function Qc(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...S(n)})}function el(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...S(n)})}function tl(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...S(n)})}function nl(e,n){return new e({type:"boolean",...S(n)})}function rl(e,n){return new e({type:"boolean",coerce:!0,...S(n)})}function ol(e,n){return new e({type:"bigint",...S(n)})}function il(e,n){return new e({type:"bigint",coerce:!0,...S(n)})}function al(e,n){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...S(n)})}function sl(e,n){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...S(n)})}function ul(e,n){return new e({type:"symbol",...S(n)})}function cl(e,n){return new e({type:"undefined",...S(n)})}function ll(e,n){return new e({type:"null",...S(n)})}function dl(e){return new e({type:"any"})}function pl(e){return new e({type:"unknown"})}function ml(e,n){return new e({type:"never",...S(n)})}function fl(e,n){return new e({type:"void",...S(n)})}function gl(e,n){return new e({type:"date",...S(n)})}function hl(e,n){return new e({type:"date",coerce:!0,...S(n)})}function vl(e,n){return new e({type:"nan",...S(n)})}function Ve(e,n){return new Do({check:"less_than",...S(n),value:e,inclusive:!1})}function we(e,n){return new Do({check:"less_than",...S(n),value:e,inclusive:!0})}function He(e,n){return new Lo({check:"greater_than",...S(n),value:e,inclusive:!1})}function Se(e,n){return new Lo({check:"greater_than",...S(n),value:e,inclusive:!0})}function Ui(e){return He(0,e)}function ji(e){return Ve(0,e)}function Ri(e){return we(0,e)}function Mi(e){return Se(0,e)}function ct(e,n){return new Qs({check:"multiple_of",...S(n),value:e})}function lt(e,n){return new nu({check:"max_size",...S(n),maximum:e})}function Be(e,n){return new ru({check:"min_size",...S(n),minimum:e})}function Dt(e,n){return new ou({check:"size_equals",...S(n),size:e})}function Lt(e,n){return new iu({check:"max_length",...S(n),maximum:e})}function tt(e,n){return new au({check:"min_length",...S(n),minimum:e})}function Ut(e,n){return new su({check:"length_equals",...S(n),length:e})}function fn(e,n){return new uu({check:"string_format",format:"regex",...S(n),pattern:e})}function gn(e){return new cu({check:"string_format",format:"lowercase",...S(e)})}function hn(e){return new lu({check:"string_format",format:"uppercase",...S(e)})}function vn(e,n){return new du({check:"string_format",format:"includes",...S(n),includes:e})}function yn(e,n){return new pu({check:"string_format",format:"starts_with",...S(n),prefix:e})}function bn(e,n){return new mu({check:"string_format",format:"ends_with",...S(n),suffix:e})}function Fi(e,n,o){return new fu({check:"property",property:e,schema:n,...S(o)})}function _n(e,n){return new gu({check:"properties",shape:e,...S(n)})}function $n(e,n){return new hu({check:"mime_type",mime:e,...S(n)})}function Ue(e){return new vu({check:"overwrite",tx:e})}function kn(e){return Ue(n=>n.normalize(e))}function xn(){return Ue(e=>e.trim())}function In(){return Ue(e=>e.toLowerCase())}function wn(){return Ue(e=>e.toUpperCase())}function Sn(){return Ue(e=>ts(e))}function yl(e,n,o){return new e({type:"array",element:n,...S(o)})}function qx(e,n,o){return new e({type:"union",options:n,...S(o)})}function Yx(e,n,o){return new e({type:"union",options:n,inclusive:!1,...S(o)})}function Qx(e,n,o,i){return new e({type:"union",options:o,discriminator:n,...S(i)})}function eI(e,n,o){return new e({type:"intersection",left:n,right:o})}function tI(e,n,o,i){let t=o instanceof R,r=t?i:o,a=t?o:null;return new e({type:"tuple",items:n,rest:a,...S(r)})}function nI(e,n,o,i){return new e({type:"record",keyType:n,valueType:o,...S(i)})}function rI(e,n,o,i){return new e({type:"map",keyType:n,valueType:o,...S(i)})}function oI(e,n,o){return new e({type:"set",valueType:n,...S(o)})}function iI(e,n,o){let i=Array.isArray(n)?Object.fromEntries(n.map(t=>[t,t])):n;return new e({type:"enum",entries:i,...S(o)})}function aI(e,n,o){return new e({type:"enum",entries:n,...S(o)})}function sI(e,n,o){return new e({type:"literal",values:Array.isArray(n)?n:[n],...S(o)})}function bl(e,n){return new e({type:"file",...S(n)})}function uI(e,n){return new e({type:"transform",transform:n})}function cI(e,n){return new e({type:"optional",innerType:n})}function lI(e,n){return new e({type:"nullable",innerType:n})}function dI(e,n,o){return new e({type:"default",innerType:n,get defaultValue(){return typeof o=="function"?o():tr(o)}})}function pI(e,n,o){return new e({type:"nonoptional",innerType:n,...S(o)})}function mI(e,n){return new e({type:"success",innerType:n})}function fI(e,n,o){return new e({type:"catch",innerType:n,catchValue:typeof o=="function"?o:ss(o)})}function gI(e,n,o){return new e({type:"pipe",in:n,out:o})}function hI(e,n){return new e({type:"readonly",innerType:n})}function vI(e,n,o){return new e({type:"template_literal",parts:n,...S(o)})}function yI(e,n){return new e({type:"lazy",getter:n})}function bI(e,n){return new e({type:"promise",innerType:n})}function _l(e,n,o){let i=S(o);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:n,...i})}function $l(e,n,o){return new e({type:"custom",check:"custom",fn:n,...S(o)})}function kl(e,n){let o=kg(i=>(i.addIssue=t=>{if(typeof t=="string")i.issues.push(rn(t,i.value,o._zod.def));else{let r=t;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),"input"in r||(r.input=i.value),r.inst??(r.inst=o),r.continue??(r.continue=!o._zod.def.abort),i.issues.push(rn(r))}},e(i.value,i)),n);return o}function kg(e,n){let o=new Y({check:"custom",...S(n)});return o._zod.check=e,o}function xl(e){let n=new Y({check:"describe"});return n._zod.onattach=[o=>{let i=ce.get(o)??{};ce.add(o,{...i,description:e})}],n._zod.check=()=>{},n}function Il(e){let n=new Y({check:"meta"});return n._zod.onattach=[o=>{let i=ce.get(o)??{};ce.add(o,{...i,...e})}],n._zod.check=()=>{},n}function wl(e,n){let o=S(n),i=o.truthy??["true","1","yes","on","y","enabled"],t=o.falsy??["false","0","no","off","n","disabled"];o.case!=="sensitive"&&(i=i.map(f=>typeof f=="string"?f.toLowerCase():f),t=t.map(f=>typeof f=="string"?f.toLowerCase():f));let r=new Set(i),a=new Set(t),s=e.Codec??Ir,c=e.Boolean??kr,l=e.String??Ot,d=new l({type:"string",error:o.error}),p=new c({type:"boolean",error:o.error}),m=new s({type:"pipe",in:d,out:p,transform:((f,g)=>{let y=f;return o.case!=="sensitive"&&(y=y.toLowerCase()),r.has(y)?!0:a.has(y)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...r,...a],input:g.value,inst:m,continue:!1}),{})}),reverseTransform:((f,g)=>f===!0?i[0]||"true":t[0]||"false"),error:o.error});return m._zod.bag.truthy=i,m._zod.bag.falsy=t,m._zod.bag.case=o.case??"insensitive",m}function jt(e,n,o,i={}){let t=S(i),r={check:"string_format",type:"string",format:n,fn:typeof o=="function"?o:s=>o.test(s),...t};return o instanceof RegExp&&(r.pattern=o),new e(r)}function Lr(e,...n){for(let o of n)for(let i of Reflect.ownKeys(o))Object.prototype.propertyIsEnumerable.call(o,i)&&ue(e,i,o[i]);return e}function dt(e){let n=e?.target??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ce,target:n,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function ie(e,n,o,i,t){let r=typeof n.unrepresentable=="function"?n.unrepresentable({zodSchema:e,path:i.path,message:t}):n.unrepresentable;if(r==="any")return!1;if(r===void 0||r==="throw")throw new Error(t);return Object.assign(o,r),!0}function X(e,n,o={path:[],schemaPath:[]}){var i;let t=e._zod.def,r=n.seen.get(e);if(r)return r.count++,o.schemaPath.includes(e)&&(r.cycle=o.path),r.schema;let a={schema:{},count:1,cycle:void 0,path:o.path};n.seen.set(e,a),n.sharedDefsExtractedFor=void 0,n.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let d={...o,schemaPath:[...o.schemaPath,e],path:o.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,a.schema,d);else{let m=a.schema,f=n.processors[t.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${t.type}`);f(e,n,m,d)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),X(p,n,d),n.seen.get(p).isParent=!0)}let c=n.metadataRegistry.get(e);return c&&Lr(a.schema,c),n.io==="input"&&ge(e)&&(delete a.schema.examples,delete a.schema.default),n.io==="input"&&"_prefault"in a.schema&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,n.seen.get(e).schema}function xg(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function pt(e,n){let o=e.seen.get(n);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let i=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let c=i.get(s);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(s,a[0])}}let t=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,m=e.external.uri??(g=>g);if(p)return{ref:m(p)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${s}/${xg(f)}`}}let c="#",l=`${c}/${s}/`;if(a[1]===o&&!a[1].schema.id)return{ref:c};let d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:l+xg(d)}},r=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:l}=t(a);s.def={...s.schema},l&&(s.defId=l);let d=s.schema;for(let p in d)delete d[p];d.$ref=c};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(n===a[0]){r(a);continue}if(e.external){let c=e.external.registry.get(a[0])?.id;if(n!==a[0]&&c){r(a);continue}}if(e.metadataRegistry.get(a[0])?.id){r(a);continue}if(s.cycle){r(a);continue}s.count>1&&e.reused==="ref"&&r(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function cg(e){let n=e.anyOf;if(!Array.isArray(n)||n.length===0||e.type!==void 0)return;let i=[];for(let o of n){if(!o||typeof o!="object")return;cg(o);let t=Object.keys(o);if(t.length!==1||t[0]!=="type")return;let r=o.type;for(let a of Array.isArray(r)?r:[r]){if(typeof a!="string")return;i.includes(a)||i.push(a)}}delete e.anyOf,e.type=i.length===1?i[0]:i}var lg=new Set(["type","properties","required","additionalProperties"]),sg=["oneOf","anyOf"];function ug(e){let n=e.additionalProperties;return n===void 0||n===!1||typeof n!="object"||n===null?null:Object.keys(n).length?n:null}function dl(e){let n=[];for(let r of e){if(typeof r!="object"||r.type!=="object")return null;for(let a in r)if(!lg.has(a))return null;n.push(r)}let i={},o=new Set;for(let r of n){for(let a in r.properties){if(Object.prototype.hasOwnProperty.call(i,a))continue;let s=[];for(let c of n){let d=c.properties?.[a]??ug(c);d!=null&&(s.some(p=>JSON.stringify(p)===JSON.stringify(d))||s.push(d))}let u=s.length===1?s[0]:dl(s)??{allOf:s};se(i,a,u)}for(let a of r.required??[])o.add(a)}let t={type:"object",properties:i};if(o.size&&(t.required=[...o]),n.every(r=>r.additionalProperties===!1))t.additionalProperties=!1;else{let r=[];for(let a of n){let s=ug(a);s&&!r.some(u=>JSON.stringify(u)===JSON.stringify(s))&&r.push(s)}r.length===1?t.additionalProperties=r[0]:r.length>1&&(t.additionalProperties={allOf:r})}return t}function Ax(e){let n=e.allOf;if(!Array.isArray(n)||n.length<2)return;for(let t of lg)if(t in e)return;let i=n.filter(t=>sg.some(r=>Array.isArray(t[r]))),o=null;if(!i.length)o=dl(n);else{let t=i[0],r=sg.find(u=>Array.isArray(t[u]));if(Object.keys(t).length!==1)return;let a=n.filter(u=>u!==t),s=t[r].map(u=>dl([...a,u]));if(s.some(u=>!u))return;o={[r]:s}}o&&(delete e.allOf,Sr(e,o))}function dt(e,n){let i=e.seen.get(n);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let u=e.seen.get(s);if(u.ref===null)return;let c=u.def??u.schema,d={...c},p=u.ref;if(u.ref=null,p){o(p);let f=e.seen.get(p),g=f.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(g)):Sr(c,g),Sr(c,d),s._zod.parent===p)for(let x in c)x==="$ref"||x==="allOf"||x in d||delete c[x];if(g.$ref&&f.def)for(let x in c)x==="$ref"||x==="allOf"||x in f.def&&JSON.stringify(c[x])===JSON.stringify(f.def[x])&&delete c[x]}let m=s._zod.parent;if(m&&m!==p){o(m);let f=e.seen.get(m);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(let g in c)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(c[g])===JSON.stringify(f.def[g])&&delete c[g]}e.override({zodSchema:s,jsonSchema:c,path:u.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let s of[...e.seen.entries()].reverse())o(s[0]);if(e.target!=="openapi-3.0")for(let s of e.seen.entries())cg(s[1].def??s[1].schema);for(let s of e.deferred)s();if(e.intersections.length){let s=new Map;for(let u of e.seen.values())for(let c of[u.schema,u.def]){let d=c?.allOf;if(!Array.isArray(d))continue;let p=s.get(d);p?p.push(c):s.set(d,[c])}for(let u of e.intersections)for(let c of s.get(u)??[])Ax(c)}}let t={};if(e.target==="draft-2020-12"?t.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?t.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?t.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(n)?.id;if(!s)throw new Error("Schema is missing an `id` property");t.$id=e.external.uri(s)}Sr(t,i.defId?i.schema:i.def??i.schema);let r=e.metadataRegistry.get(n)?.id;r!==void 0&&t.id===r&&delete t.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let s of e.seen.entries()){let u=s[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,se(a,u.defId,u.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?t.$defs=a:t.definitions=a);try{let s=JSON.parse(JSON.stringify(t));return Object.defineProperty(s,"~standard",{value:{...n["~standard"],jsonSchema:{input:$n(n,"input",e.processors),output:$n(n,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function ge(e,n){let i=n??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return ge(o.element,i);if(o.type==="set")return ge(o.valueType,i);if(o.type==="lazy")return ge(o.getter(),i);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return ge(o.innerType,i);if(o.type==="intersection")return ge(o.left,i)||ge(o.right,i);if(o.type==="record"||o.type==="map")return ge(o.keyType,i)||ge(o.valueType,i);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ge(o.in,i)||ge(o.out,i);if(o.type==="object"){for(let t in o.shape)if(ge(o.shape[t],i))return!0;return!1}if(o.type==="union"){for(let t of o.options)if(ge(t,i))return!0;return!1}if(o.type==="tuple"){for(let t of o.items)if(ge(t,i))return!0;return!!(o.rest&&ge(o.rest,i))}return!1}var pl=(e,n={})=>i=>{let o=ct({...i,processors:n});return J(e,o),lt(o,e),dt(o,e)},$n=(e,n,i={})=>o=>{let{libraryOptions:t,target:r}=o??{},a=ct({...t??{},target:r,io:n,processors:i});return J(e,a),lt(a,e),dt(a,e)};var kn=(e,n,i)=>{(e[n]===void 0||i>e[n])&&(e[n]=i)},xn=(e,n,i)=>{(e[n]===void 0||i{kn(e,"minimum",n),xn(e,"maximum",n)},gg=(e,n)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(n)||e.multipleOf.push(n)},hg=(e,n)=>{e.patterns??(e.patterns=new Set),e.patterns.add(n)},vg=(e,n)=>{e.mime=e.mime?e.mime.filter(i=>n.includes(i)):[...n]},yg=(e,n)=>{e.format=n,n.includes("int")&&(e.isInt=!0)},pg=(e,n)=>kn(e,"minimum",n.minimum),mg=(e,n)=>xn(e,"maximum",n.maximum),fg=e=>(n,i)=>{yg(n,i.format);let[o,t]=e[i.format];kn(n,"minimum",o),xn(n,"maximum",t)},Ox={greater_than:(e,n)=>kn(e,n.inclusive?"minimum":"exclusiveMinimum",n.value),less_than:(e,n)=>xn(e,n.inclusive?"maximum":"exclusiveMaximum",n.value),multiple_of:(e,n)=>gg(e,n.value),number_format:fg(Wn),bigint_format:fg(Kn),min_length:pg,max_length:mg,length_equals:(e,n)=>dg(e,n.length),min_size:pg,max_size:mg,size_equals:(e,n)=>dg(e,n.size),string_format:(e,n)=>{yg(e,n.format),n.pattern&&hg(e,n.pattern),(n.format==="base64"||n.format==="base64url")&&(e.contentEncoding=n.format),(n.local||n.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,n)=>vg(e,n.mime)};function oe(e){let n={},i=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...i.checks??[]]:i.checks??[];for(let r of o)Ox[r._zod.def.check]?.(n,r._zod.def);let t=e._zod.bag;t.minimum!==void 0&&kn(n,"minimum",t.minimum),t.exclusiveMinimum!==void 0&&kn(n,"exclusiveMinimum",t.exclusiveMinimum),t.maximum!==void 0&&xn(n,"maximum",t.maximum),t.exclusiveMaximum!==void 0&&xn(n,"exclusiveMaximum",t.exclusiveMaximum),t.multipleOf!==void 0&&gg(n,t.multipleOf),t.format!==void 0&&(n.format??(n.format=t.format),t.format.includes("int")&&(n.isInt=!0)),t.mime&&vg(n,t.mime);for(let r of t.patterns??[])hg(n,r);return n}var Nx={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},zx=new Map([[zi,ys],[dr,bs]]),bg=e=>zx.get(e)??e,gl=(e,n,i,o)=>{let t=i;t.type="string";let{minimum:r,maximum:a,format:s,patterns:u,contentEncoding:c,laxFormat:d}=oe(e);if(typeof r=="number"&&(t.minLength=r),typeof a=="number"&&(t.maxLength=a),s&&(t.format=Nx[s]??s,t.format===""&&delete t.format,(s==="time"||d)&&delete t.format),c&&(t.contentEncoding=c),u&&u.size>0){let p=[...u].map(bg);p.length===1?t.pattern=p[0].source:p.length>1&&(t.allOf=[...p.map(m=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},hl=(e,n,i,o)=>{let t=i,{minimum:r,maximum:a,multipleOf:s,exclusiveMaximum:u,exclusiveMinimum:c,isInt:d}=oe(e);t.type=d?"integer":"number";let p=typeof c=="number"&&c>=(r??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),f=n.target==="draft-04"||n.target==="openapi-3.0";if(p?f?(t.minimum=c,t.exclusiveMinimum=!0):t.exclusiveMinimum=c:typeof r=="number"&&(t.minimum=r),m?f?(t.maximum=u,t.exclusiveMaximum=!0):t.exclusiveMaximum=u:typeof a=="number"&&(t.maximum=a),s){let g=new Set;for(let I of s)Number.isFinite(I)&&I!==0?g.add(Math.abs(I)):ie(e,n,t,o,`A multipleOf divisor of ${I} cannot be represented in JSON Schema`);let[y,...x]=g;y!==void 0&&(t.multipleOf=y),x.length&&(t.allOf=[...t.allOf??[],...x.map(I=>({multipleOf:I}))])}},vl=(e,n,i,o)=>{i.type="boolean"},yl=(e,n,i,o)=>{ie(e,n,i,o,"BigInt cannot be represented in JSON Schema")},bl=(e,n,i,o)=>{ie(e,n,i,o,"Symbols cannot be represented in JSON Schema")},_l=(e,n,i,o)=>{n.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},$l=(e,n,i,o)=>{ie(e,n,i,o,"Undefined cannot be represented in JSON Schema")},kl=(e,n,i,o)=>{ie(e,n,i,o,"Void cannot be represented in JSON Schema")},xl=(e,n,i,o)=>{i.not={}},wl=(e,n,i,o)=>{},Il=(e,n,i,o)=>{},Sl=(e,n,i,o)=>{ie(e,n,i,o,"Date cannot be represented in JSON Schema")},Pl=(e,n,i,o)=>{let t=e._zod.def,r=Ht(t.entries);if(r.length===0){i.not={};return}r.every(a=>typeof a=="number")&&(i.type="number"),r.every(a=>typeof a=="string")&&(i.type="string"),i.enum=r},Tl=(e,n,i,o)=>{let t=e._zod.def;if(t.values.length===0){i.not={};return}let r=[];for(let a of t.values)if(a===void 0){if(ie(e,n,i,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(ie(e,n,i,o,"BigInt literals cannot be represented in JSON Schema"))return;r.push(Number(a))}else r.push(a);if(r.length!==0)if(r.length===1){let a=r[0];i.type=a===null?"null":typeof a,n.target==="draft-04"||n.target==="openapi-3.0"?i.enum=[a]:i.const=a}else r.every(a=>typeof a=="number")&&(i.type="number"),r.every(a=>typeof a=="string")&&(i.type="string"),r.every(a=>typeof a=="boolean")&&(i.type="boolean"),r.every(a=>a===null)&&(i.type="null"),i.enum=r},El=(e,n,i,o)=>{ie(e,n,i,o,"NaN cannot be represented in JSON Schema")},Al=(e,n,i,o)=>{let t=i,r=e._zod.pattern;if(!r)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=r.source},Ol=(e,n,i,o)=>{let t=i;t.type="string",t.format="binary",t.contentEncoding="binary";let{minimum:r,maximum:a,mime:s}=oe(e);r!==void 0&&(t.minLength=r),a!==void 0&&(t.maxLength=a),s&&(s.length===0?t.not={}:s.length===1?t.contentMediaType=s[0]:t.anyOf=s.map(u=>({contentMediaType:u})))},Nl=(e,n,i,o)=>{i.type="boolean"},zl=(e,n,i,o)=>{ie(e,n,i,o,"Custom types cannot be represented in JSON Schema")},Dl=(e,n,i,o)=>{ie(e,n,i,o,"Function types cannot be represented in JSON Schema")},Cl=(e,n,i,o)=>{ie(e,n,i,o,"Transforms cannot be represented in JSON Schema")},Ll=(e,n,i,o)=>{ie(e,n,i,o,"Map cannot be represented in JSON Schema")},jl=(e,n,i,o)=>{ie(e,n,i,o,"Set cannot be represented in JSON Schema")},Ul=(e,n,i,o)=>{let t=i,r=e._zod.def,{minimum:a,maximum:s}=oe(e);typeof a=="number"&&(t.minItems=a),typeof s=="number"&&(t.maxItems=s),t.type="array",t.items=J(r.element,n,{...o,path:[...o.path,"items"]})};function Pr(e){let n=e._zod.def;return n.type==="pipe"&&n.in._zod.traits.has("$ZodTransform")?Pr(n.out):n.type==="catch"?Pr(n.innerType):e._zod.optin}var Rl=(e,n,i,o)=>{let t=i,r=e._zod.def,a=r.shape;if(Object.getOwnPropertySymbols(a).length&&ie(e,n,t,o,"Symbol keys cannot be represented in JSON Schema"))return;t.type="object",t.properties={};for(let c in a)se(t.properties,c,J(a[c],n,{...o,path:[...o.path,"properties",c]}));let u=[];for(let c of Object.keys(a)){let d=r.shape[c];(n.io==="input"?Pr(d)===void 0:d._zod.optout===void 0)&&u.push(c)}u.length>0&&(t.required=u),r.catchall?._zod.def.type==="never"?t.additionalProperties=!1:r.catchall?r.catchall&&(t.additionalProperties=J(r.catchall,n,{...o,path:[...o.path,"additionalProperties"]})):n.io==="output"&&(t.additionalProperties=!1)},Oo=(e,n,i,o)=>{let t=e._zod.def,r=t.inclusive===!1,a=t.options.map((s,u)=>J(s,n,{...o,path:[...o.path,r?"oneOf":"anyOf",u]}));r?i.oneOf=a:i.anyOf=a},Ml=(e,n,i,o)=>{let t=e._zod.def,r=J(t.left,n,{...o,path:[...o.path,"allOf",0]}),a=J(t.right,n,{...o,path:[...o.path,"allOf",1]}),s=c=>"allOf"in c&&Object.keys(c).length===1,u=[...s(r)?r.allOf:[r],...s(a)?a.allOf:[a]];i.allOf=u,n.intersections.push(u)},Zl=(e,n,i,o)=>{let t=i,r=e._zod.def;t.type="array";let a=n.target==="draft-2020-12"?"prefixItems":"items",s=n.target==="draft-2020-12"||n.target==="openapi-3.0"?"items":"additionalItems",u=r.items.map((y,x)=>J(y,n,{...o,path:[...o.path,a,x]})),c=r.rest?J(r.rest,n,{...o,path:[...o.path,s,...n.target==="openapi-3.0"?[r.items.length]:[]]}):null,d=r.items.length;for(;d>0;){let y=r.items[d-1];if(!(n.io==="input"?Pr(y)!==void 0:y._zod.optout==="optional"))break;d--}let p=r.items.length,m=!r.rest;n.target==="draft-2020-12"?(t.prefixItems=u,m?t.items=!1:c&&(t.items=c),d>0&&(t.minItems=d),m&&(t.maxItems=p)):n.target==="openapi-3.0"?(t.items={anyOf:u},c&&t.items.anyOf.push(c),d>0&&(t.minItems=d),m&&(t.maxItems=p)):(t.items=u,m?t.additionalItems=!1:c&&(t.additionalItems=c),d>0&&(t.minItems=d),m&&(t.maxItems=p));let{minimum:f,maximum:g}=oe(e);typeof f=="number"&&(t.minItems=f),typeof g=="number"&&(t.maxItems=g)};function ml(e,n,i){if(n.$ref){if(i.has(n))return n;i.add(n);let g=e.get(n)?.def;if(!g)return n;let y=ml(e,g,i);return y===g?n:y}for(let g of["anyOf","oneOf"]){let y=n[g];if(!Array.isArray(y))continue;let x=y.map(I=>ml(e,I,i));x.some((I,b)=>I!==y[b])&&(n={...n,[g]:x})}let o=Array.isArray(n.type)?n.type:[n.type],t=!o.includes("string")&&o.some(g=>g==="number"||g==="integer"),r=n.enum??(n.const!==void 0?[n.const]:void 0);if(!t&&!r?.some(g=>typeof g=="number"))return n;let{minimum:a,maximum:s,exclusiveMinimum:u,exclusiveMaximum:c,multipleOf:d,format:p,id:m,...f}=n;return f.enum?f.enum=f.enum.map(g=>typeof g=="number"?String(g):g):typeof f.const=="number"&&(f.const=String(f.const)),t&&(f.type="string",r||(f.pattern=(o.includes("number")?qe:ir).source)),f}var fl=new WeakMap;function Dx(e){let n=new Map;for(let o of e.seen.values())o.def&&!n.has(o.schema)&&n.set(o.schema,o);let i=new Map;for(let o of fl.get(e)??[]){let t=e.seen.get(o),r=(t?.def??t?.schema)?.propertyNames;if(!r||r===!0||i.has(r))continue;let a=ml(n,r,new Set);a!==r&&i.set(r,a)}if(i.size)for(let o of e.seen.values())for(let t of[o.schema,o.def]){let r=t&&i.get(t.propertyNames);r&&(t.propertyNames=r)}}var Fl=(e,n,i,o)=>{let t=i,r=e._zod.def;t.type="object";let a=r.keyType,s=oe(a).patterns;if(r.mode==="loose"&&s&&s.size>0){let d=J(r.valueType,n,{...o,path:[...o.path,"patternProperties","*"]});t.patternProperties={};for(let p of s)se(t.patternProperties,bg(p).source,d)}else{if(n.target==="draft-07"||n.target==="draft-2020-12"){t.propertyNames=J(r.keyType,n,{...o,path:[...o.path,"propertyNames"]});let d=fl.get(n);d||(d=[],fl.set(n,d),n.deferred.push(()=>Dx(n))),d.push(e)}t.additionalProperties=J(r.valueType,n,{...o,path:[...o.path,"additionalProperties"]})}let u=a._zod.values,c=n.io==="input"&&Pr(r.valueType)!==void 0;if(u&&!r.partial&&!c){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(t.required=d.map(String))}},Vl=(e,n,i,o)=>{let t=e._zod.def,r=J(t.innerType,n,o),a=n.seen.get(e);n.target==="openapi-3.0"?(a.ref=t.innerType,i.nullable=!0):i.anyOf=[r,{type:"null"}]},Gl=(e,n,i,o)=>{let t=e._zod.def;J(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType},Bl=Symbol();function _g(e,n,i,o,t){let r=!1,a=JSON.stringify(e,(s,u)=>typeof u!="bigint"?u:(r=!0,null));return r?(ie(n,i,o,t,"BigInt defaults cannot be represented in JSON Schema"),Bl):JSON.parse(a)}var Hl=(e,n,i,o)=>{let t=e._zod.def;J(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType;let a=_g(t.defaultValue,e,n,i,o);a!==Bl&&(i.default=a)},Wl=(e,n,i,o)=>{let t=e._zod.def;J(t.innerType,n,o);let r=n.seen.get(e);if(r.ref=t.innerType,n.io!=="input")return;let a=_g(t.defaultValue,e,n,i,o);a!==Bl&&(i._prefault=a)},Kl=(e,n,i,o)=>{let t=e._zod.def;J(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType;let a;try{a=t.catchValue(void 0)}catch{ie(e,n,i,o,"Dynamic catch values are not supported in JSON Schema");return}i.default=a},Jl=(e,n,i,o)=>{let t=e._zod.def,r=t.in._zod.traits.has("$ZodTransform"),a=n.io==="input"?r?t.out:t.in:t.out;J(a,n,o);let s=n.seen.get(e);s.ref=a},Xl=(e,n,i,o)=>{let t=e._zod.def;J(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType,i.readOnly=!0},ql=(e,n,i,o)=>{let t=e._zod.def;J(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType},No=(e,n,i,o)=>{let t=e._zod.def;J(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType},Yl=(e,n,i,o)=>{let t=e._zod.innerType;J(t,n,o);let r=n.seen.get(e);r.ref=t},Ao={string:gl,number:hl,boolean:vl,bigint:yl,symbol:bl,null:_l,undefined:$l,void:kl,never:xl,any:wl,unknown:Il,date:Sl,enum:Pl,literal:Tl,nan:El,template_literal:Al,file:Ol,success:Nl,custom:zl,function:Dl,transform:Cl,map:Ll,set:jl,array:Ul,object:Rl,union:Oo,intersection:Ml,tuple:Zl,record:Fl,nullable:Vl,nonoptional:Gl,default:Hl,prefault:Wl,catch:Kl,pipe:Jl,readonly:Xl,promise:ql,optional:No,lazy:Yl};function zo(e,n){if("_idmap"in e){let o=e,t=ct({...n,processors:Ao}),r={};for(let u of o._idmap.entries()){let[c,d]=u;J(d,t)}let a={},s={registry:o,uri:n?.uri,defs:r};t.external=s;for(let u of o._idmap.entries()){let[c,d]=u;lt(t,d),se(a,c,dt(t,d))}if(Object.keys(r).length>0){let u=t.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[u]:r}}return{schemas:a}}let i=ct({...n,processors:Ao});return J(e,i),lt(i,e),dt(i,e)}var Do=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(n){this.ctx.counter=n}get seen(){return this.ctx.seen}constructor(n){let i=n?.target??"draft-2020-12";i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),this.ctx=ct({processors:Ao,target:i,...n?.metadata&&{metadata:n.metadata},...n?.unrepresentable&&{unrepresentable:n.unrepresentable},...n?.override&&{override:n.override},...n?.io&&{io:n.io}})}process(n,i={path:[],schemaPath:[]}){return J(n,this.ctx,i)}emit(n,i){i&&(i.cycles&&(this.ctx.cycles=i.cycles),i.reused&&(this.ctx.reused=i.reused),i.external&&(this.ctx.external=i.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,lt(this.ctx,n);let o=dt(this.ctx,n),{"~standard":t,...r}=o;return r}};var $g={};var On={};Ke(On,{ZodAny:()=>_d,ZodArray:()=>wd,ZodBase64:()=>Qo,ZodBase64URL:()=>ea,ZodBigInt:()=>En,ZodBigIntFormat:()=>ra,ZodBoolean:()=>Tn,ZodCIDRv4:()=>qo,ZodCIDRv6:()=>Yo,ZodCUID:()=>Go,ZodCUID2:()=>Bo,ZodCatch:()=>Bd,ZodCodec:()=>jr,ZodCreditCard:()=>pd,ZodCustom:()=>Ur,ZodCustomStringFormat:()=>jt,ZodDate:()=>Or,ZodDefault:()=>Rd,ZodDiscriminatedUnion:()=>Sd,ZodE164:()=>ta,ZodEmail:()=>Mo,ZodEmoji:()=>Fo,ZodEnum:()=>In,ZodExactOptional:()=>sa,ZodFile:()=>Cd,ZodFunction:()=>tp,ZodGUID:()=>Zo,ZodIBAN:()=>md,ZodIPv4:()=>Jo,ZodIPv6:()=>Xo,ZodISODate:()=>mt,ZodISODateTime:()=>pt,ZodISODuration:()=>gt,ZodISOTime:()=>ft,ZodInstanceOf:()=>ip,ZodIntersection:()=>Pd,ZodJWT:()=>na,ZodKSUID:()=>Ko,ZodLazy:()=>Yd,ZodLiteral:()=>Dd,ZodMAC:()=>dd,ZodMap:()=>Nd,ZodNaN:()=>Wd,ZodNanoID:()=>Vo,ZodNever:()=>kd,ZodNonOptional:()=>ua,ZodNull:()=>yd,ZodNullable:()=>Ud,ZodNumber:()=>Pn,ZodNumberFormat:()=>Ut,ZodObject:()=>zr,ZodOptional:()=>Cr,ZodPipe:()=>Lr,ZodPrefault:()=>Zd,ZodPreprocess:()=>Kd,ZodPromise:()=>ep,ZodReadonly:()=>Jd,ZodRecord:()=>wn,ZodSet:()=>zd,ZodString:()=>Sn,ZodStringFormat:()=>X,ZodSuccess:()=>Gd,ZodSymbol:()=>hd,ZodTemplateLiteral:()=>qd,ZodTransform:()=>Ld,ZodTuple:()=>Ed,ZodType:()=>M,ZodULID:()=>Ho,ZodURL:()=>Ar,ZodUUID:()=>Ge,ZodUndefined:()=>vd,ZodUnion:()=>Dr,ZodUnknown:()=>$d,ZodVoid:()=>xd,ZodXID:()=>Wo,ZodXor:()=>Id,_ZodString:()=>Ro,_default:()=>Md,_function:()=>zh,any:()=>lh,array:()=>Nr,base64:()=>Gg,base64url:()=>Bg,bigint:()=>oh,boolean:()=>gd,catch:()=>Hd,check:()=>Dh,cidrv4:()=>Fg,cidrv6:()=>Vg,codec:()=>Eh,creditCard:()=>Wg,cuid:()=>Dg,cuid2:()=>Cg,currencyCode:()=>Qg,custom:()=>Ch,date:()=>ph,describe:()=>Lh,discriminatedUnion:()=>yh,e164:()=>Hg,email:()=>wg,emoji:()=>Ng,enum:()=>oa,exactOptional:()=>jd,file:()=>Ih,float32:()=>th,float64:()=>nh,function:()=>zh,guid:()=>Ig,hash:()=>eh,hex:()=>Yg,hostname:()=>qg,httpUrl:()=>Og,iban:()=>Kg,instanceof:()=>Uh,int:()=>jo,int32:()=>rh,int64:()=>ah,intersection:()=>Td,invertCodec:()=>Ah,ipv4:()=>Rg,ipv6:()=>Zg,json:()=>Mh,jwt:()=>Jg,keyof:()=>mh,ksuid:()=>Ug,lazy:()=>Qd,literal:()=>wh,looseObject:()=>hh,looseRecord:()=>_h,mac:()=>Mg,map:()=>$h,meta:()=>jh,nan:()=>Th,nanoid:()=>zg,nativeEnum:()=>xh,never:()=>ia,nonoptional:()=>Vd,null:()=>bd,nullable:()=>Er,nullish:()=>Sh,number:()=>fd,object:()=>fh,optional:()=>Ct,partialRecord:()=>bh,pipe:()=>Uo,prefault:()=>Fd,preprocess:()=>Zh,promise:()=>Nh,readonly:()=>Xd,record:()=>Od,refine:()=>np,set:()=>kh,strictObject:()=>gh,string:()=>Tr,stringFormat:()=>Xg,stringbool:()=>Rh,success:()=>Ph,superRefine:()=>rp,symbol:()=>uh,templateLiteral:()=>Oh,transform:()=>aa,tuple:()=>Ad,uint32:()=>ih,uint64:()=>sh,ulid:()=>Lg,undefined:()=>ch,union:()=>An,unknown:()=>Dt,url:()=>Ag,uuid:()=>Sg,uuidv4:()=>Pg,uuidv6:()=>Tg,uuidv7:()=>Eg,void:()=>dh,xid:()=>jg,xor:()=>vh});var Co={};Ke(Co,{endsWith:()=>mn,gt:()=>Fe,gte:()=>Ie,includes:()=>dn,length:()=>Nt,lowercase:()=>cn,lt:()=>Ze,lte:()=>we,maxLength:()=>Ot,maxSize:()=>ut,mime:()=>gn,minLength:()=>Ye,minSize:()=>Ve,multipleOf:()=>st,negative:()=>So,nonnegative:()=>To,nonpositive:()=>Po,normalize:()=>hn,overwrite:()=>Ce,positive:()=>Io,properties:()=>fn,property:()=>Eo,regex:()=>un,size:()=>At,slugify:()=>_n,startsWith:()=>pn,toLowerCase:()=>yn,toUpperCase:()=>bn,trim:()=>vn,uppercase:()=>ln});var kg=new WeakSet([Object.prototype,Error.prototype]);function Lo(e,n,i){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get(){let o=i(this);return Object.defineProperty(this,n,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,n,{value:o,configurable:!0,writable:!0})}})}var xg=(e,n)=>{Ya.init(e,n),e.name="ZodError";let i=Object.getPrototypeOf(e);kg.has(i)||(kg.add(i),Lo(i,"format",o=>t=>er(o,t)),Lo(i,"flatten",o=>t=>Qn(o,t)),Lo(i,"addIssue",o=>t=>{o.issues.push(t),o.message=JSON.stringify(o.issues,Wt,2)}),Lo(i,"addIssues",o=>t=>{o.issues.push(...t),o.message=JSON.stringify(o.issues,Wt,2)}),Object.defineProperty(i,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Lx=h("ZodError",xg),xe=h("ZodError",xg,void 0,{Parent:Error});var Ql=Yt(xe),ed=Qt(xe),td=en(xe),nd=tn(xe),rd=li(xe),id=di(xe),od=pi(xe),ad=mi(xe),sd=fi(xe),ud=gi(xe),cd=hi(xe),ld=vi(xe);function Ux(){ae.localeError||te(Ji())}function Lt(){ae.memoizer||te({memoizer:yr()})}var M=h("ZodType",(e,n)=>(Ux(),U.init(e,n),e.def=n,e.type=n.type,e),{check(...e){let n=this.def;return this.clone(_.mergeDefs(n,{checks:[...n.checks??[],...e.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,n){return W(this,e,n)},brand(){return this},register(e,n){return e.add(this,n),this},refine(e,n){return this.check(np(e,n))},superRefine(e,n){return this.check(rp(e,n))},overwrite(e){return this.check(Ce(e))},optional(){return Ct(this)},exactOptional(){return jd(this)},nullable(){return Er(this)},nullish(){return Ct(Er(this))},nonoptional(e){return Vd(this,e)},array(){return Nr(this)},or(e){return An([this,e])},and(e){return Td(this,e)},transform(e){return Uo(this,aa(e))},default(e){return Md(this,e)},prefault(e){return Fd(this,e)},catch(e){return Hd(this,e)},pipe(e){return Uo(this,e)},readonly(){return Xd(this)},describe(e){let n=this.clone();return ue.add(n,{description:e}),n},meta(...e){if(e.length===0)return ue.get(this);let n=this.clone();return ue.add(n,e[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...n){return n.length===0?e(this):e(this,...n)},get"~standard"(){return _.hide(this,"~standard",{...Ti(this),jsonSchema:{input:$n(this,"input"),output:$n(this,"output")}})},set"~standard"(e){_.own(this,"~standard",e)},parse:function e(n,i){return Ql(this,n,i,{callee:e})},parseAsync:async function e(n,i){return await ed(this,n,i,{callee:e})},safeParse(e,n){return td(this,e,n)},async safeParseAsync(e,n){return nd(this,e,n)},get spa(){return this?.safeParseAsync},set spa(e){_.own(this,"spa",e)},validate(e,n){return tr(this,e,n)},validateAsync(e,n){return nr(this,e,n)},encode:function e(n,i){return rd(this,n,i,{callee:e})},decode:function e(n,i){return id(this,n,i,{callee:e})},encodeAsync:async function e(n,i){return await od(this,n,i,{callee:e})},decodeAsync:async function e(n,i){return await ad(this,n,i,{callee:e})},safeEncode(e,n){return sd(this,e,n)},safeDecode(e,n){return ud(this,e,n)},async safeEncodeAsync(e,n){return cd(this,e,n)},async safeDecodeAsync(e,n){return ld(this,e,n)},toJSONSchema(e){return pl(this,{})(e)},get description(){return ue.get(this)?.description},get _def(){return this._zod.def}}),Ro=h("_ZodString",(e,n)=>{St.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>gl(e,i,o,t)},_.derived({format:e=>oe(e).format??null,minLength:e=>oe(e).minimum??null,maxLength:e=>oe(e).maximum??null},{regex(...e){return this.check(un(...e))},includes(...e){return this.check(dn(...e))},startsWith(...e){return this.check(pn(...e))},endsWith(...e){return this.check(mn(...e))},min(...e){return this.check(Ye(...e))},max(...e){return this.check(Ot(...e))},length(...e){return this.check(Nt(...e))},nonempty(...e){return this.check(Ye(1,...e))},lowercase(e){return this.check(cn(e))},uppercase(e){return this.check(ln(e))},trim(){return this.check(vn())},normalize(...e){return this.check(hn(...e))},toLowerCase(){return this.check(yn())},toUpperCase(){return this.check(bn())},slugify(){return this.check(_n())}})),Sn=h("ZodString",(e,n)=>{St.init(e,n),Ro.init(e,n)},{email(e){return this.check(ro(Mo,e))},url(e){return this.check($r(Ar,e))},jwt(e){return this.check(wo(na,e))},emoji(e){return this.check(co(Fo,e))},guid(e){return this.check(io(Zo,e))},uuid(e){return this.check(oo(Ge,e))},uuidv4(e){return this.check(ao(Ge,e))},uuidv6(e){return this.check(so(Ge,e))},uuidv7(e){return this.check(uo(Ge,e))},nanoid(e){return this.check(lo(Vo,e))},cuid(e){return this.check(po(Go,e))},cuid2(e){return this.check(mo(Bo,e))},ulid(e){return this.check(fo(Ho,e))},base64(e){return this.check($o(Qo,e))},base64url(e){return this.check(ko(ea,e))},xid(e){return this.check(go(Wo,e))},ksuid(e){return this.check(ho(Ko,e))},ipv4(e){return this.check(vo(Jo,e))},ipv6(e){return this.check(yo(Xo,e))},cidrv4(e){return this.check(bo(qo,e))},cidrv6(e){return this.check(_o(Yo,e))},e164(e){return this.check(xo(ta,e))},datetime(e){return this.check(kr(pt,e))},date(e){return this.check(xr(mt,e))},time(e){return this.check(wr(ft,e))},duration(e){return this.check(Ir(gt,e))}});function Tr(e){return Tc(Sn,e)}var X=h("ZodStringFormat",(e,n)=>{K.init(e,n),Ro.init(e,n)}),pt=h("ZodISODateTime",(e,n)=>{yu.init(e,n),X.init(e,n)}),mt=h("ZodISODate",(e,n)=>{bu.init(e,n),X.init(e,n)}),ft=h("ZodISOTime",(e,n)=>{_u.init(e,n),X.init(e,n)}),gt=h("ZodISODuration",(e,n)=>{$u.init(e,n),X.init(e,n)}),Mo=h("ZodEmail",(e,n)=>{su.init(e,n),X.init(e,n)});function wg(e){return ro(Mo,e)}var Zo=h("ZodGUID",(e,n)=>{ou.init(e,n),X.init(e,n)});function Ig(e){return io(Zo,e)}var Ge=h("ZodUUID",(e,n)=>{au.init(e,n),X.init(e,n)});function Sg(e){return oo(Ge,e)}function Pg(e){return ao(Ge,e)}function Tg(e){return so(Ge,e)}function Eg(e){return uo(Ge,e)}var Ar=h("ZodURL",(e,n)=>{lu.init(e,n),X.init(e,n)});function Ag(e){return $r(Ar,e)}function Og(e){return $r(Ar,{protocol:rr,hostname:$s,..._.normalizeParams(e)})}var Fo=h("ZodEmoji",(e,n)=>{du.init(e,n),X.init(e,n)});function Ng(e){return co(Fo,e)}var Vo=h("ZodNanoID",(e,n)=>{pu.init(e,n),X.init(e,n)});function zg(e){return lo(Vo,e)}var Go=h("ZodCUID",(e,n)=>{mu.init(e,n),X.init(e,n)});function Dg(e){return po(Go,e)}var Bo=h("ZodCUID2",(e,n)=>{fu.init(e,n),X.init(e,n)});function Cg(e){return mo(Bo,e)}var Ho=h("ZodULID",(e,n)=>{gu.init(e,n),X.init(e,n)});function Lg(e){return fo(Ho,e)}var Wo=h("ZodXID",(e,n)=>{hu.init(e,n),X.init(e,n)});function jg(e){return go(Wo,e)}var Ko=h("ZodKSUID",(e,n)=>{vu.init(e,n),X.init(e,n)});function Ug(e){return ho(Ko,e)}var Jo=h("ZodIPv4",(e,n)=>{ku.init(e,n),X.init(e,n)});function Rg(e){return vo(Jo,e)}var dd=h("ZodMAC",(e,n)=>{wu.init(e,n),X.init(e,n)});function Mg(e){return Ac(dd,e)}var Xo=h("ZodIPv6",(e,n)=>{xu.init(e,n),X.init(e,n)});function Zg(e){return yo(Xo,e)}var qo=h("ZodCIDRv4",(e,n)=>{Iu.init(e,n),X.init(e,n)});function Fg(e){return bo(qo,e)}var Yo=h("ZodCIDRv6",(e,n)=>{Su.init(e,n),X.init(e,n)});function Vg(e){return _o(Yo,e)}var Qo=h("ZodBase64",(e,n)=>{Pu.init(e,n),X.init(e,n)});function Gg(e){return $o(Qo,e)}var ea=h("ZodBase64URL",(e,n)=>{Tu.init(e,n),X.init(e,n)});function Bg(e){return ko(ea,e)}var ta=h("ZodE164",(e,n)=>{Eu.init(e,n),X.init(e,n)});function Hg(e){return xo(ta,e)}var pd=h("ZodCreditCard",(e,n)=>{Au.init(e,n),X.init(e,n)});function Wg(e){return Oc(pd,e)}var md=h("ZodIBAN",(e,n)=>{Ou.init(e,n),X.init(e,n)});function Kg(e){return Nc(md,e)}var na=h("ZodJWT",(e,n)=>{Nu.init(e,n),X.init(e,n)});function Jg(e){return wo(na,e)}var jt=h("ZodCustomStringFormat",(e,n)=>{zu.init(e,n),X.init(e,n)});function Xg(e,n,i={}){return zt(jt,e,n,i)}function qg(e){return zt(jt,"hostname",_s,e)}function Yg(e){return zt(jt,"hex",Cs,e)}function Qg(e){return zt(jt,"currency_code",xs,e)}function eh(e,n){let i=n?.enc??"hex",o=`${e}_${i}`,t=Te[o];if(!t)throw new Error(`Unrecognized hash format: ${o}`);return zt(jt,o,t,n)}var Pn=h("ZodNumber",(e,n)=>{Ui.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>hl(e,i,o,t),e.isFinite=!0},_.derived({minValue:e=>{let{minimum:n,exclusiveMinimum:i}=oe(e);return Math.max(n??Number.NEGATIVE_INFINITY,i??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:n,exclusiveMaximum:i}=oe(e);return Math.min(n??Number.POSITIVE_INFINITY,i??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:n,multipleOf:i}=oe(e);return!!n||!!i?.some(Number.isSafeInteger)},format:e=>oe(e).format??null},{gt(e,n){return this.check(Fe(e,n))},gte(e,n){return this.check(Ie(e,n))},min(e,n){return this.check(Ie(e,n))},lt(e,n){return this.check(Ze(e,n))},lte(e,n){return this.check(we(e,n))},max(e,n){return this.check(we(e,n))},int(e){return this.check(jo(e))},safe(e){return this.check(jo(e))},positive(e){return this.check(Fe(0,e))},nonnegative(e){return this.check(Ie(0,e))},negative(e){return this.check(Ze(0,e))},nonpositive(e){return this.check(we(0,e))},multipleOf(e,n){return this.check(st(e,n))},step(e,n){return this.check(st(e,n))},finite(){return this}}));function fd(e){return Dc(Pn,e)}var Ut=h("ZodNumberFormat",(e,n)=>{Du.init(e,n),Pn.init(e,n)});function jo(e){return Lc(Ut,e)}function th(e){return jc(Ut,e)}function nh(e){return Uc(Ut,e)}function rh(e){return Rc(Ut,e)}function ih(e){return Mc(Ut,e)}var Tn=h("ZodBoolean",(e,n)=>{pr.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>vl(e,i,o,t)});function gd(e){return Zc(Tn,e)}var En=h("ZodBigInt",(e,n)=>{Ri.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>yl(e,i,o,t)},_.derived({minValue:e=>oe(e).minimum??null,maxValue:e=>oe(e).maximum??null,format:e=>oe(e).format??null},{gte(e,n){return this.check(Ie(e,n))},min(e,n){return this.check(Ie(e,n))},gt(e,n){return this.check(Fe(e,n))},lt(e,n){return this.check(Ze(e,n))},lte(e,n){return this.check(we(e,n))},max(e,n){return this.check(we(e,n))},positive(e){return this.check(Fe(BigInt(0),e))},negative(e){return this.check(Ze(BigInt(0),e))},nonpositive(e){return this.check(we(BigInt(0),e))},nonnegative(e){return this.check(Ie(BigInt(0),e))},multipleOf(e,n){return this.check(st(e,n))}}));function oh(e){return Vc(En,e)}var ra=h("ZodBigIntFormat",(e,n)=>{Cu.init(e,n),En.init(e,n)});function ah(e){return Bc(ra,e)}function sh(e){return Hc(ra,e)}var hd=h("ZodSymbol",(e,n)=>{Lu.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>bl(e,i,o,t)});function uh(e){return Wc(hd,e)}var vd=h("ZodUndefined",(e,n)=>{ju.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>$l(e,i,o,t)});function ch(e){return Kc(vd,e)}var yd=h("ZodNull",(e,n)=>{Uu.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>_l(e,i,o,t)});function bd(e){return Jc(yd,e)}var _d=h("ZodAny",(e,n)=>{Ru.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>wl(e,i,o,t)});function lh(){return Xc(_d)}var $d=h("ZodUnknown",(e,n)=>{Mu.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Il(e,i,o,t)});function Dt(){return qc($d)}var kd=h("ZodNever",(e,n)=>{Zu.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>xl(e,i,o,t)});function ia(e){return Yc(kd,e)}var xd=h("ZodVoid",(e,n)=>{Fu.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>kl(e,i,o,t)});function dh(e){return Qc(xd,e)}var Or=h("ZodDate",(e,n)=>{Vu.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Sl(e,i,o,t),e.min=(i,o)=>e.check(Ie(i,o)),e.max=(i,o)=>e.check(we(i,o))},_.derived({minDate:e=>{let{minimum:n}=oe(e);return n?new Date(n):null},maxDate:e=>{let{maximum:n}=oe(e);return n?new Date(n):null}},{}));function ph(e){return el(Or,e)}var wd=h("ZodArray",(e,n)=>{Lt(),Bu.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Ul(e,i,o,t),e.element=n.element},{min(e,n){return this.check(Ye(e,n))},nonempty(e){return this.check(Ye(1,e))},max(e,n){return this.check(Ot(e,n))},length(e,n){return this.check(Nt(e,n))},unwrap(){return this.element}});function Nr(e,n){return rl(wd,e,n)}function mh(e){let n=e._zod.def.shape;return oa(Object.keys(n))}var zr=h("ZodObject",(e,n)=>{Lt(),Hu.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Rl(e,i,o,t),_.installLazyProp(e,"shape",i=>i._zod.def.shape,!1)},{keyof(){return oa(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(_.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(_.mergeDefs(this._zod.def,{catchall:Dt()}))},loose(){return this.clone(_.mergeDefs(this._zod.def,{catchall:Dt()}))},strict(){return this.clone(_.mergeDefs(this._zod.def,{catchall:ia()}))},strip(){return this.clone(_.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return _.extend(this,e)},safeExtend(e){return _.safeExtend(this,e)},merge(e){return _.merge(this,e)},pick(e){return _.pick(this,e)},omit(e){return _.omit(this,e)},partial(...e){return _.partial(Cr,this,e[0])},exactPartial(...e){return _.partial(sa,this,e[0],"exactPartial")},required(...e){return _.required(ua,this,e[0])}});function fh(e,n){let i={type:"object",shape:e??{},..._.normalizeParams(n)};return new zr(i)}function gh(e,n){return new zr({type:"object",shape:e,catchall:ia(),..._.normalizeParams(n)})}function hh(e,n){return new zr({type:"object",shape:e,catchall:Dt(),..._.normalizeParams(n)})}var Dr=h("ZodUnion",(e,n)=>{mr.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Oo(e,i,o,t),e.options=n.options});function An(e,n){return new Dr({type:"union",options:e,..._.normalizeParams(n)})}var Id=h("ZodXor",(e,n)=>{Dr.init(e,n),Wu.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Oo(e,i,o,t),e.options=n.options});function vh(e,n){return new Id({type:"union",options:e,inclusive:!1,..._.normalizeParams(n)})}var Sd=h("ZodDiscriminatedUnion",(e,n)=>{Dr.init(e,n),Ju.init(e,n)});function yh(e,n,i){return new Sd({type:"union",options:n,discriminator:e,..._.normalizeParams(i)})}var Pd=h("ZodIntersection",(e,n)=>{Xu.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Ml(e,i,o,t)});function Td(e,n){return new Pd({type:"intersection",left:e,right:n})}var Ed=h("ZodTuple",(e,n)=>{Lt(),Mi.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Zl(e,i,o,t)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(n=>new Cr({type:"optional",innerType:n}))})}});function Ad(e,n,i){let o=n instanceof U,t=o?i:n,r=o?n:null;return new Ed({type:"tuple",items:e,rest:r,..._.normalizeParams(t)})}var wn=h("ZodRecord",(e,n)=>{Lt(),qu.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Fl(e,i,o,t),e.keyType=n.keyType,e.valueType=n.valueType});function Od(e,n,i){return!n||!n._zod?new wn({type:"record",keyType:Tr(),valueType:e,..._.normalizeParams(n)}):new wn({type:"record",keyType:e,valueType:n,..._.normalizeParams(i)})}function bh(e,n,i){return new wn({type:"record",keyType:e,valueType:n,..._.normalizeParams(i),partial:!0})}function _h(e,n,i){return new wn({type:"record",keyType:e,valueType:n,mode:"loose",..._.normalizeParams(i)})}var Nd=h("ZodMap",(e,n)=>{Lt(),Yu.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Ll(e,i,o,t),e.keyType=n.keyType,e.valueType=n.valueType,e.min=(...i)=>e.check(Ve(...i)),e.nonempty=i=>e.check(Ve(1,i)),e.max=(...i)=>e.check(ut(...i)),e.size=(...i)=>e.check(At(...i))});function $h(e,n,i){return new Nd({type:"map",keyType:e,valueType:n,..._.normalizeParams(i)})}var zd=h("ZodSet",(e,n)=>{Lt(),Qu.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>jl(e,i,o,t),e.min=(...i)=>e.check(Ve(...i)),e.nonempty=i=>e.check(Ve(1,i)),e.max=(...i)=>e.check(ut(...i)),e.size=(...i)=>e.check(At(...i))});function kh(e,n){return new zd({type:"set",valueType:e,..._.normalizeParams(n)})}var In=h("ZodEnum",(e,n)=>{ec.init(e,n),M.init(e,n),e._zod.processJSONSchema=(o,t,r)=>Pl(e,o,t,r),e.enum=n.entries,e.options=[...e._zod.values];let i=new Set(Object.keys(n.entries));e.extract=(o,t)=>{let r={};for(let a of o)if(i.has(a))r[a]=n.entries[a];else throw new Error(`Key ${a} not found in enum`);return new In({...n,checks:[],..._.normalizeParams(t),entries:r})},e.exclude=(o,t)=>{let r={...n.entries};for(let a of o)if(i.has(a))delete r[a];else throw new Error(`Key ${a} not found in enum`);return new In({...n,checks:[],..._.normalizeParams(t),entries:r})}});function oa(e,n){let i=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new In({type:"enum",entries:i,..._.normalizeParams(n)})}function xh(e,n){return new In({type:"enum",entries:e,..._.normalizeParams(n)})}var Dd=h("ZodLiteral",(e,n)=>{tc.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Tl(e,i,o,t),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function wh(e,n){return new Dd({type:"literal",values:Array.isArray(e)?e:[e],..._.normalizeParams(n)})}var Cd=h("ZodFile",(e,n)=>{nc.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Ol(e,i,o,t),e.min=(i,o)=>e.check(Ve(i,o)),e.max=(i,o)=>e.check(ut(i,o)),e.mime=(i,o)=>e.check(gn(Array.isArray(i)?i:[i],o))});function Ih(e){return il(Cd,e)}var Ld=h("ZodTransform",(e,n)=>{Lt(),rc.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Cl(e,i,o,t),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new ot(e.constructor.name);i.addIssue=r=>{if(typeof r=="string")i.issues.push(_.issue(r,i.value,n));else{let a=r;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=i.value),a.inst??(a.inst=e),i.issues.push(_.issue(a))}};let t=n.transform(i.value,i);return t instanceof Promise?t.then(r=>(i.value=r,i)):(i.value=t,i)}});function aa(e){return new Ld({type:"transform",transform:e})}var Cr=h("ZodOptional",(e,n)=>{Zi.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>No(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Ct(e){return new Cr({type:"optional",innerType:e})}var sa=h("ZodExactOptional",(e,n)=>{ic.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>No(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function jd(e){return new sa({type:"optional",innerType:e})}var Ud=h("ZodNullable",(e,n)=>{oc.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Vl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Er(e){return new Ud({type:"nullable",innerType:e})}function Sh(e){return Ct(Er(e))}var Rd=h("ZodDefault",(e,n)=>{ac.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Hl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Md(e,n){return new Rd({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():_.shallowClone(n)}})}var Zd=h("ZodPrefault",(e,n)=>{sc.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Wl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Fd(e,n){return new Zd({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():_.shallowClone(n)}})}var ua=h("ZodNonOptional",(e,n)=>{uc.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Gl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Vd(e,n){return new ua({type:"nonoptional",innerType:e,..._.normalizeParams(n)})}var Gd=h("ZodSuccess",(e,n)=>{cc.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Nl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Ph(e){return new Gd({type:"success",innerType:e})}var Bd=h("ZodCatch",(e,n)=>{lc.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Kl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Hd(e,n){return new Bd({type:"catch",innerType:e,catchValue:typeof n=="function"?n:_.constantCatch(n)})}var Wd=h("ZodNaN",(e,n)=>{dc.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>El(e,i,o,t)});function Th(e){return nl(Wd,e)}var Lr=h("ZodPipe",(e,n)=>{Fi.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Jl(e,i,o,t),e.in=n.in,e.out=n.out});function Uo(e,n){return new Lr({type:"pipe",in:e,out:n})}var jr=h("ZodCodec",(e,n)=>{Lr.init(e,n),fr.init(e,n)});function Eh(e,n,i){return new jr({type:"pipe",in:e,out:n,transform:i.decode,reverseTransform:i.encode})}function Ah(e){let n=e._zod.def;return new jr({type:"pipe",in:n.out,out:n.in,transform:n.reverseTransform,reverseTransform:n.transform})}var Kd=h("ZodPreprocess",(e,n)=>{Lr.init(e,n),pc.init(e,n)}),Jd=h("ZodReadonly",(e,n)=>{mc.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Xl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Xd(e){return new Jd({type:"readonly",innerType:e})}var qd=h("ZodTemplateLiteral",(e,n)=>{fc.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Al(e,i,o,t)});function Oh(e,n){return new qd({type:"template_literal",parts:e,..._.normalizeParams(n)})}var Yd=h("ZodLazy",(e,n)=>{gr.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Yl(e,i,o,t),e.unwrap=()=>e._zod.def.getter()});function Qd(e){return new Yd({type:"lazy",getter:e})}var ep=h("ZodPromise",(e,n)=>{hc.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>ql(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Nh(e){return new ep({type:"promise",innerType:e})}var tp=h("ZodFunction",(e,n)=>{gc.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Dl(e,i,o,t)});function zh(e){return new tp({type:"function",input:Array.isArray(e?.input)?Ad(e?.input):e?.input??Nr(Dt()),output:e?.output??Dt()})}var Ur=h("ZodCustom",(e,n)=>{vc.init(e,n),M.init(e,n),e._zod.processJSONSchema=(i,o,t)=>zl(e,i,o,t)});function Dh(e){let n=new q({check:"custom"});return n._zod.check=e,n}function Ch(e,n){return ol(Ur,e??(()=>!0),n)}function np(e,n={}){return al(Ur,e,n)}function rp(e,n){return sl(e,n)}var Lh=ul,jh=cl,ip=h("ZodInstanceOf",(e,n)=>{Ur.init(e,n)},{properties(e,n){return this.check(fn(e,n))}});function Uh(e,n={}){let i=new ip({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,..._.normalizeParams(n)});return i._zod.bag.Class=e,i._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:i,path:[...i._zod.def.path??[]]})},i}var Rh=(...e)=>ll({Codec:jr,Boolean:Tn,String:Sn},...e);function Mh(e){let n=Qd(()=>An([Tr(e),fd(),gd(),bd(),Nr(n),Od(Tr(),n)]));return n}function Zh(e,n){return new Kd({type:"pipe",in:aa(e),out:n})}var Rx={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Mx(e){te({customError:e})}function Zx(){return te().customError}var op;op||(op={});var Rr={};Ke(Rr,{ZodISODate:()=>mt,ZodISODateTime:()=>pt,ZodISODuration:()=>gt,ZodISOTime:()=>ft,date:()=>Vx,datetime:()=>Fx,duration:()=>Bx,time:()=>Gx});function Fx(e){return kr(pt,e)}function Vx(e){return xr(mt,e)}function Gx(e){return wr(ft,e)}function Bx(e){return Ir(gt,e)}var P={...On,...Co,iso:Rr},Hx=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function Wx(e,n){let i=e.$schema;return i==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":i==="http://json-schema.org/draft-07/schema#"?"draft-7":i==="http://json-schema.org/draft-04/schema#"?"draft-4":n??"draft-2020-12"}function Fh(e,n){return e.map((i,o)=>oo).check(o=>{let t=o.value;if(typeof t!="object"||t===null||Array.isArray(t))return;let r=Object.getOwnPropertyNames(t);if(n.minProperties!==void 0&&r.length=${n.minProperties} properties`,input:t,inst:e,continue:!0}),n.maxProperties!==void 0&&r.length>n.maxProperties&&o.issues.push({origin:"object",code:"too_big",maximum:n.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${n.maxProperties} properties`,input:t,inst:e,continue:!0}),n.keySchema)for(let a of r){let s=n.keySchema.safeParse(a);s.success||o.issues.push({code:"invalid_key",origin:"record",issues:s.error.issues,input:a,path:[a],continue:!0})}}).pipe(e)}function ap(e,n){if(e===null)return"z";let i=typeof e;if(i!=="object"){if(i==="number"&&Number.isNaN(e))return null;let o=String(e);return`${i[0]}${o.length}:${o}`}if(n.has(e))return null;n.add(e);try{if(Array.isArray(e)){let r=[];for(let a of e){let s=ap(a,n);if(s===null)return null;r.push(s)}return`a${r.length}:[${r.join(",")}]`}let o=Object.keys(e).sort(),t=[];for(let r of o){let a=ap(e[r],n);if(a===null)return null;t.push(`${r.length}:${r}=${a}`)}return`o${t.length}:{${t.join(",")}}`}finally{n.delete(e)}}var qx=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),Yx=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Mr(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Mr):typeof e.$ref=="string"?!0:Object.entries(e).some(([n,i])=>qx.has(n)?Mr(i):!Yx.has(n)||typeof i!="object"||i===null?!1:Object.values(i).some(Mr))}function Vh(e){return e===1?"element":"elements"}function Qx(e,n){return P.transform(o=>o).check(o=>{let t=o.value;if(Array.isArray(t)){if(n.uniqueItems===!0){let r=new Map;for(let a=0;a=a)break;sn.maxContains&&o.issues.push({code:"custom",message:`Array must contain at most ${n.maxContains} matching ${Vh(n.maxContains)}`,input:t,continue:!0})}}}).pipe(e)}function Gh(e,n){if(e!==!1)return e===void 0||e===!0?P.any():he(e,n)}var ew=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function Bh(e,n){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return P.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let t=e.$ref;if(n.refs.has(t))return n.refs.get(t);if(n.processing.has(t))return P.lazy(()=>{if(!n.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return n.refs.get(t)});n.processing.add(t);let r=Jx(t,n),a=he(r,n);return n.refs.set(t,a),n.processing.delete(t),a}if(e.enum!==void 0){let t=e.enum;if(n.version==="openapi-3.0"&&e.nullable===!0&&t.length===1&&t[0]===null)return P.null();if(t.length===0)return P.never();if(t.length===1)return P.literal(t[0]);if(t.every(a=>typeof a=="string"))return P.enum(t);let r=t.map(a=>P.literal(a));return r.length<2?r[0]:P.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return P.literal(e.const);let i=e.type;if(Array.isArray(i)){let t=i.map(r=>{let a={...e,type:r};return Bh(a,n)});return t.length===0?P.never():t.length===1?t[0]:P.union(t)}if(!i)return P.any();let o;switch(i){case"string":{let t=P.string();if(e.format){let r=e.format;r==="email"?t=t.check(P.email()):r==="uri"||r==="uri-reference"?t=t.check(P.url()):r==="uuid"||r==="guid"?t=t.check(P.uuid()):r==="date-time"?t=t.check(P.iso.datetime({offset:!0})):r==="date"?t=t.check(P.iso.date()):r==="time"?t=t.check(P.regex(ew)):r==="duration"?t=t.check(P.iso.duration()):r==="hostname"?t=t.check(P.hostname()):r==="ipv4"?t=t.check(P.ipv4()):r==="ipv6"?t=t.check(P.ipv6()):r==="mac"?t=t.check(P.mac()):r==="cidr"?t=t.check(P.cidrv4()):r==="cidr-v6"?t=t.check(P.cidrv6()):r==="base64"?t=t.check(P.base64()):r==="base64url"?t=t.check(P.base64url()):r==="e164"?t=t.check(P.e164()):r==="credit_card"?t=t.check(P.creditCard()):r==="iban"?t=t.check(P.iban()):r==="jwt"?t=t.check(P.jwt()):r==="emoji"?t=t.check(P.emoji()):r==="nanoid"?t=t.check(P.nanoid()):r==="cuid"?t=t.check(P.cuid()):r==="cuid2"?t=t.check(P.cuid2()):r==="ulid"?t=t.check(P.ulid()):r==="xid"?t=t.check(P.xid()):r==="ksuid"&&(t=t.check(P.ksuid()))}typeof e.minLength=="number"&&(t=t.min(e.minLength)),typeof e.maxLength=="number"&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),o=t;break}case"number":case"integer":{let t=i==="integer"?P.number().int():P.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(t=t.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum=="number"?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(t=t.lt(e.maximum)),typeof e.multipleOf=="number"&&(t=t.multipleOf(e.multipleOf)),o=t;break}case"boolean":{o=P.boolean();break}case"null":{o=P.null();break}case"object":{let t={},r=e.properties||{},a=new Set(e.required||[]),s=typeof e.additionalProperties=="object"?he(e.additionalProperties,n):void 0;for(let[p,m]of Object.entries(r)){let f=he(m,n);se(t,p,a.has(p)?f:f.optional())}if(e.patternProperties){let p=e.patternProperties,m=Object.keys(p),f=[];for(let y of m){let x=he(p[y],n),I=P.string().regex(new RegExp(y));f.push(P.looseRecord(I,x))}let g=[];if(Object.keys(t).length>0&&g.push(P.object(t).passthrough()),g.push(...f),g.length===0)o=P.object({}).passthrough();else if(g.length===1)o=g[0];else{let y=P.intersection(g[0],g[1]);for(let x=2;xnew RegExp(b)),I=o;o=o.check(b=>{if(!Se(b.value))return;let T=[];for(let A of Object.keys(b.value))y.includes(A)||x.some(D=>D.test(A))||T.push(A);T.length&&b.issues.push({code:"unrecognized_keys",keys:T,input:b.value,inst:I})})}}else{let p=P.object(t);e.additionalProperties===!1?o=p.strict():s?o=p.catchall(s):o=p.passthrough()}let u=e.propertyNames!==void 0&&e.propertyNames!==!0,c=typeof e.minProperties=="number"?e.minProperties:void 0,d=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(u||c!==void 0||d!==void 0){let p;if(u){let m=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;p=he(m,n)}o=Xx(o,{keySchema:p,minProperties:c,maxProperties:d})}break}case"array":{let t=e.prefixItems,r=e.items;if(t&&Array.isArray(t)){let a=typeof e.minItems=="number"?e.minItems:0,s=t.map(p=>he(p,n)),u=Fh(s,a),c=Array.isArray(r)?void 0:Gh(r,n),d=P.tuple(u);o=c?d.rest(c):d,typeof e.minItems=="number"&&(o=o.check(P.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(P.maxLength(e.maxItems)))}else if(Array.isArray(r)){let a=typeof e.minItems=="number"?e.minItems:0,s=r.map(p=>he(p,n)),u=Fh(s,a),c=Gh(e.additionalItems,n),d=P.tuple(u);o=c?d.rest(c):d,typeof e.minItems=="number"&&(o=o.check(P.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(P.maxLength(e.maxItems)))}else if(r!==void 0){let a=he(r,n),s=P.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=P.array(P.any());(e.uniqueItems===!0||e.contains!==void 0)&&(o=Qx(o,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?he(e.contains,n):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${i}`)}return o}function he(e,n){if(typeof e=="boolean")return e?P.any():P.never();let i=Bh(e,n),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(c=>he(c,n)),u=P.union(s);i=o?P.intersection(i,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(c=>he(c,n)),u=P.xor(s);i=o?P.intersection(i,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)i=o?i:P.any();else{let s=o?i:he(e.allOf[0],n),u=o?0:1;for(let c=u;c0&&n.registry.add(i,t),e.description&&(i=i.describe(e.description)),i}function Hh(e,n){if(typeof e=="boolean")return e?P.any():P.never();let i;try{i=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=Wx(i,n?.defaultTarget),t=i.$defs||i.definitions||{},r={version:o,defs:t,refs:new Map,processing:new Set,rootSchema:i,registry:n?.registry??ue};return he(i,r)}var Wh=Symbol("z.visit/resolving");function Zr(e,n){let i=typeof n=="function"?n:(a,s)=>{let u=n[a._zod.def.type];return u?u(a,s):a},o=new Map;function t(a){let s=o.get(a);if(s===Wh)return new gr({type:"lazy",getter:()=>o.get(a)});if(s!==void 0)return s;o.set(a,Wh);let u=r(a),c=i(u,u!==a);return o.set(a,c),c}function r(a){let s=a._zod.def,u=s.type;switch(u){case"object":{let c=s.shape,d=Object.keys(c),p=!1,m={};for(let g of d){let y=t(c[g]);y!==c[g]&&(p=!0),m[g]=y}let f=s.catchall;return s.catchall&&(f=t(s.catchall),f!==s.catchall&&(p=!0)),p?W(a,{...s,shape:m,catchall:f}):a}case"array":{let c=t(s.element);return c===s.element?a:W(a,{...s,element:c})}case"tuple":{let c=s.items,d=!1,p=[];for(let f of c){let g=t(f);g!==f&&(d=!0),p.push(g)}let m=s.rest;return s.rest&&(m=t(s.rest),m!==s.rest&&(d=!0)),d?W(a,{...s,items:p,rest:m}):a}case"record":case"map":{let c=t(s.keyType),d=t(s.valueType);return c===s.keyType&&d===s.valueType?a:W(a,{...s,keyType:c,valueType:d})}case"set":{let c=t(s.valueType);return c===s.valueType?a:W(a,{...s,valueType:c})}case"union":{let c=s.options,d=!1,p=[];for(let m of c){let f=t(m);f!==m&&(d=!0),p.push(f)}return d?W(a,{...s,options:p}):a}case"intersection":{let c=t(s.left),d=t(s.right);return c===s.left&&d===s.right?a:W(a,{...s,left:c,right:d})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let c=t(s.innerType);return c===s.innerType?a:W(a,{...s,innerType:c})}case"pipe":{let c=t(s.in),d=t(s.out);return c===s.in&&d===s.out?a:W(a,{...s,in:c,out:d})}case"function":{let c=t(s.input),d=t(s.output);return c===s.input&&d===s.output?a:W(a,{...s,input:c,output:d})}case"lazy":{let c=s.getter,{_cachedInner:d,...p}=s;return W(a,{...p,getter:()=>t(c())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return a;default:return a}}return t(e)}function Kh(e){return Zr(e,{object:n=>n.partial(),union:n=>{let i=n._zod.def;return i.discriminator===void 0?n:An(i.options)}})}function tw(e,n){if(!n?.length)return e;let i=e._zod.def;return W(e,ze(i,{checks:[...i.checks??[],...n]}),{parent:!0})}function Jh(e){return tw(e.out,e.checks)}function nw(e){return e.in._zod.traits.has("$ZodTransform")?Jh(e):e.in}function Xh(e){return Zr(e,{pipe:n=>nw(n._zod.def),default:(n,i)=>i?Ct(n._zod.def.innerType):n,catch:(n,i)=>i?n._zod.def.innerType:n})}function qh(e){return Zr(e,{pipe:n=>Jh(n._zod.def),prefault:(n,i)=>i?n._zod.def.innerType:n})}var sp={};Ke(sp,{bigint:()=>aw,boolean:()=>ow,date:()=>sw,number:()=>iw,string:()=>rw});function rw(e){return Ec(Sn,e)}function iw(e){return Cc(Pn,e)}function ow(e){return Fc(Tn,e)}function aw(e){return Gc(En,e)}function sw(e){return tl(Or,e)}var uw=new Set(["__proto__","prototype","constructor"]),Rt=l.string().min(1).max(256).refine(e=>!uw.has(e),"reserved storage key"),ca=l.json(),la=256*1024,cw=5*1024*1024,Yh=1024,Qh=l.strictObject({key:Rt}),ev=l.object({value:ca}),tv=l.strictObject({key:Rt,value:ca}),nv=l.object({ok:l.literal(!0)}),rv=l.strictObject({key:Rt}),iv=l.object({ok:l.literal(!0)}),ov=l.strictObject({}).optional(),av=l.object({keys:l.array(l.string()).max(Yh)}),sv=l.strictObject({key:Rt}),uv=l.object({value:l.string().nullable()}),cv=l.strictObject({key:Rt,value:l.string().max(64*1024)}),lv=l.object({ok:l.literal(!0)}),dv=l.strictObject({key:Rt}),pv=l.object({ok:l.literal(!0)}),mv=l.strictObject({}).optional(),fv=l.object({status:l.enum(["os-keyring","unavailable"])}),gv=l.strictObject({}).optional(),hv=l.object({settings:l.record(l.string(),ca)}),vv=l.strictObject({key:Rt,value:ca}),yv=l.object({ok:l.literal(!0)});var Nn="x-orca-enum-since";var et="1.4.160",up="1.4.245";var Fr="1.4.246";var bv=Fr,_v=Fr;var Le="1.4.248";var dw="Relative to the plugin root; `..` segments and Windows device names such as `CON` are refused.";function da(e,n,i){return ee(`${e} ${dw}`,n,i)}function ee(e,n,i){return i?{description:e,"x-orca-since":n,examples:[...i]}:{description:e,"x-orca-since":n}}var pw=/^(?:con|prn|aux|nul|clock\$|conin\$|conout\$|com[1-9\u00B9\u00B2\u00B3]|lpt[1-9\u00B9\u00B2\u00B3])(?:\..*)?$/i,mw=/[<>:"|?*]/,pa=String.raw`[^<>:"|?*\x00-\x1f\\/]*[^<>:"|?*\x00-\x1f\\/. ]`,cp=new RegExp(`^${pa}(?:[\\\\/]${pa})*$`),eN=new RegExp(`^${pa}(?:/${pa})*$`);function fw(e){return e.length===0||e==="."||e===".."?"empty and dot path segments are not allowed":e.endsWith(".")||e.endsWith(" ")?"path segments may not end with a dot or space":mw.test(e)||[...e].some(n=>n.charCodeAt(0)<=31)?"path segment contains a Windows-forbidden character or alternate-data-stream colon":pw.test(e)?"path segment is a Windows reserved device name":null}function gw(e){if(e.length===0||e.startsWith("/")||e.startsWith("\\"))return"must be a non-empty relative path";let n=e.split(/[\\/]/);for(let i of n){let o=fw(i);if(o)return o}return null}function lp(e){return gw(e)===null}var $v=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,hw=new Set(["__proto__","prototype","constructor"]),dp=64;function kv(e){return hw.has(e)}var pp="must be a portable relative path inside the plugin directory",zn=l.string().max(dp).regex($v,"must be kebab-case (a-z, 0-9, dashes)").refine(e=>!kv(e),"must not be a reserved name"),ma=l.string().min(1).max(1024).regex(cp,pp).refine(e=>!cp.test(e)||lp(e),pp),uN=l.string().min(1).max(1024).transform(e=>e.replace(/[\\/]+$/,"")).refine(lp,pp),xv=l.string().min(1).max(256).regex(/^[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*$/,"must be a portable command id");var vw="1.4.253",Vr=vw;var wv=8,yw=2*1024*1024,bw=8*1024*1024;var _w=/^[A-Za-z0-9](?:[A-Za-z0-9 _.-]{0,46}[A-Za-z0-9])?$/,$w=/^(?:[1-9]\d{0,2}|1000)(?: (?:[1-9]\d{0,2}|1000))?$/,kw=l.object({path:ma.regex(/\.woff2?$/i,"must be a .woff or .woff2 file").meta(da(`WOFF or WOFF2 file, at most ${yw/1024/1024} MB; its first bytes must match its extension. TTF, OTF and font collections are refused.`,Vr,["fonts/Geist-Variable.woff2"])),weight:l.string().regex($w,'must be a weight from 1 to 1000, or a range such as "100 900"').refine(e=>{let[n,i=n]=e.split(" ").map(Number);return n<=i},"must list the lower weight first").optional().meta(ee("CSS weight this file draws, or a range for a variable font. Defaults to `400`.",Vr,["400","100 900"])),style:l.enum(["normal","italic"]).optional().meta(ee("Whether this file is the italic face. Defaults to `normal`.",Vr))}).strict().meta({id:"FontFaceContribution",description:"One file of a font family."}),fN=l.object({family:l.string().regex(_w,"must be 1-48 ASCII letters, digits, spaces, dots, dashes or underscores").meta(ee("Family name shown in the font pickers. Orca adds the plugin id, so a plugin font never replaces an installed or built-in font of the same name.",Vr,["Geist"])),faces:l.array(kw).min(1).max(wv).meta(ee(`The family's files, at most ${wv}. All of a plugin's font files together may be at most ${bw/1024/1024} MB.`,Vr))}).strict().meta({id:"FontContribution",description:"A font family the user can pick for the terminal, editor or interface. It applies only once picked."});function Iv(e){return/ \([a-z0-9-]+\.[a-z0-9-]+\)$/i.test(e.trim())}var xw="Orca Nerd Font Symbols",ww=["SF Mono","Menlo","Monaco","Cascadia Mono","Consolas","DejaVu Sans Mono","Liberation Mono",xw,"Symbols Nerd Font Mono","MesloLGS Nerd Font","JetBrainsMono Nerd Font","Hack Nerd Font","monospace"];function Sv(e){let n=e.trim(),i=n?[`"${n}"`]:[],o=i.map(r=>r.toLowerCase()),t=Iv(n);for(let r of ww){let a=r.toLowerCase();(t||!o.some(s=>s.includes(a)))&&i.push(r==="monospace"?r:`"${r}"`)}return i.join(", ")}function Pv(e,n){let i=typeof e=="number"?e:Number.NaN;return Number.isFinite(i)?Math.min(900,Math.max(100,Math.round(i))):n}var Iw=["fira code","fira mono","jetbrains mono","jetbrainsmono","cascadia code","cascadia mono","iosevka","victor mono","hasklig","monoid","operator mono","dank mono","mononoki","pragmatapro","recursive","monolisa","commit mono","geist mono","maple mono","departure mono"];function Sw(e){if(!e)return!1;let n=e.split(",")[0]?.replace(/"/g,"").trim().toLowerCase()??"";return n?Iw.some(i=>n.includes(i)):!1}function Tv(e,n){return e==="on"?!0:e==="off"?!1:Sw(n)}function mp(e,n){return Math.max(8,Math.min(32,e+n))}function Ev(e,n){return mp(e-.5,n)}var Pw=10,Tw=24,Ew=1,Aw=3,Ow=8,Nw=400,zw=13;function Dw(e){return fp(e?.editorFontFamily)||Av(e?.terminalFontFamily)||"monospace"}function Av(e){return typeof e=="string"?e:""}function fp(e){return Av(e).trim()}function Cw(e){let n=fp(e?.editorFontFamily)||fp(e?.terminalFontFamily);return n.includes(",")?n:Sv(n)}function fa(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Lw(e){let n=e?.editorFontSize;if(fa(n))return Math.min(Tw,Math.max(Pw,n));let i=e?.terminalFontSize;return fa(i)?i:zw}function jw(e,n){if(!fa(e))return;let i=e>=Ow?e/n:e;return Math.min(Aw,Math.max(Ew,i))}function Ov(e,n,i="editor"){let o=Lw(e),t=i==="diff"?Ev(o,n):mp(o,n),r=Dw(e),a=jw(e?.editorLineHeight,o);return{fontFamily:r,cssFontFamily:Cw(e),fontSize:t,fontWeight:fa(e?.editorFontWeight)?String(Pv(e.editorFontWeight,Nw)):"normal",lineHeight:a?Math.round(t*a):0,fontLigatures:Tv(Uw(e),r)}}function Uw(e){let n=e?.editorLigatures;return n==="on"||n==="auto"?n:"off"}function Nv(e){return e===!1?"off":"on"}function zv(e){return e?.editorMinimapEnabled??!1}var ce=["worker","panel","editor"],de=["worker"],Dn=["panel","editor"],G=e=>e;function Dv(e,n){return n==="worker"?e.since:Math.max(e.since,e.framesSince??0)}var Cv="1.4.256",ga=8*1024,gp=l.object({fontFamily:l.string().min(1).max(ga),cssFontFamily:l.string().min(1).max(ga),fontSize:l.number().finite().positive(),fontWeight:l.string().min(1).max(16),lineHeight:l.number().finite().nonnegative(),fontLigatures:l.boolean(),wordWrap:l.enum(["on","off"]),minimap:l.boolean()}).strict();function Lv(e,n){let i=typeof n=="number"&&Number.isFinite(n)?n:0,o=Ov(e,i,"editor");return{fontFamily:o.fontFamily.slice(0,ga),cssFontFamily:o.cssFontFamily.slice(0,ga),fontSize:o.fontSize,fontWeight:o.fontWeight,lineHeight:o.lineHeight,fontLigatures:o.fontLigatures,wordWrap:Nv(e?.editorWordWrap),minimap:zv(e)}}var jv={"editor.readTypography":G({summary:"The font family, size, weight, line height, ligatures, word wrap and minimap Orca's file editor uses now, editor zoom included. `editor.typography.changed` reports each change after.",since:6,scope:"desktop",capability:null,mutation:!1,surfaces:ce,params:l.strictObject({}).optional(),result:gp})};var ht=["workspace.created","workspace.removed","agent.status.changed","workspace.changed","editor.typography.changed"],CN=ht.length,Rw={"workspace.created":up,"workspace.removed":up,"agent.status.changed":et,"workspace.changed":_v,"editor.typography.changed":Cv},ha=new Map([["worktree.created","workspace.created"],["worktree.removed","workspace.removed"]]);var LN=l.object({on:l.enum(ht).meta({...ee("Event delivered to the plugin worker.",et),[Nn]:Rw})}).strict().meta({id:"EventContribution",description:"An event subscription. Requires `main`, the `trusted-worker` execution profile and the capability of the event's domain: `workspace:read` for workspace events, `agent:read` for agent events. Editor events need no capability."});var Mw=["success","failure","cancellation","superseded"],Uv=[...Mw,"interruption","unconfirmed"];var Cn=["working","blocked","waiting","done"];var rz=new Set(Cn);var vt=l.string().regex(/^[A-Za-z0-9_.:-]{1,128}$/,"is 1-128 letters, digits, or . _ : -");var va=12e4,sz=1024*1024,uz=256*1024;var Bw=l.object({id:l.string().min(1).max(64),surface:l.enum(["panel","editor"]),contributionId:l.string().min(1).max(256)}),cz=l.object({name:vt,input:l.unknown(),panel:Bw}),lz=l.object({event:vt,payload:l.unknown(),panel:l.string().min(1).max(64).optional()}),Rv=["storage","settings"],dz=l.object({area:l.enum(Rv),key:l.string().min(1).max(256)}),pz=l.discriminatedUnion("kind",[l.object({kind:l.literal("message"),event:vt,payload:l.unknown()}),l.object({kind:l.literal("event"),event:l.enum(ht),payload:l.unknown()}),l.object({kind:l.literal("changed"),area:l.enum(Rv),key:l.string()})]);var Hw=l.strictObject({name:vt,input:l.json().optional(),timeoutMs:l.number().int().min(1).max(va).optional()}),Ww=l.object({output:l.json()}),Kw=50,Jw=l.strictObject({}).optional(),Xw=l.object({agents:l.array(l.object({terminalId:l.string().min(1).max(1024).nullable(),title:l.string().max(512).nullable(),agent:l.string().max(128).nullable(),state:l.enum(Cn),stateStartedAt:l.number().finite()})).max(Kw)}),qw=l.strictObject({event:l.enum(ht)}),Yw=l.object({ok:l.literal(!0)}),Mv={"plugin.request":G({summary:"Asks the plugin's own worker to run the handler it registered with `orca.panels.handle(name)`, starting the worker if needed; resolves with what the handler returned. `unknown_method` when no handler has that name.",since:2,scope:"plugin-private",capability:null,mutation:!1,surfaces:Dn,params:Hw,result:Ww}),"agents.list":G({summary:"The agents in the focused workspace: their terminal, title, agent kind and status. `agent.status.changed` reports each change after.",since:2,scope:"active-workspace",capability:"agent:read",mutation:!1,surfaces:ce,params:Jw,result:Xw}),"events.subscribe":G({summary:"Delivers a workspace, agent or editor event to this panel as `orca.on(event)`; needs the event's read capability, when it has one. The frame APIs call it for you.",since:2,scope:"plugin-private",capability:null,mutation:!1,surfaces:Dn,params:qw,result:Yw})};var Qw=/[\p{Cc}\p{Cf}\p{Cs}\p{Zl}\p{Zp}]/u,eI=new Set(["‌","‍"]);function tI(e){return eI.has(e)||!Qw.test(e)}function Zv(e){return[...e].filter(tI).join("")}var nI=/[\t\n\v\f\r\u0085\u2028\u2029]+/g;function rI(e){return Zv(e.replace(nI," "))}function Gr(e){let n=e.overwrite(rI);return e.minLength?n.min(e.minLength,"must contain visible characters"):n}var L={maxNodes:5e3,maxDepth:64,maxTreeBytes:524288,maxTextLength:16384,maxLabelLength:1024,maxPropsPerNode:32,maxSelectOptions:500,maxEventArgs:8,maxCallbackIdLength:64,maxRadioOptions:50,maxTableColumns:32,maxTableRows:5e3,maxTreeItems:2e3,maxTreeItemDepth:16,maxKeyValueItems:200,maxDocumentLength:65536,maxEventArgItems:5e3},xz={maxBytes:640*1024,maxMessages:200,perMs:1e4,maxDepth:L.maxDepth*2+24,maxObjects:L.maxNodes*8+1024};var Be={render:"ui.render",event:"ui.event",error:"ui.error",ack:"ui.ack",ready:"ui.ready",hydrate:"ui.hydrate",visibility:"ui.visibility",persist:"ui.persist",retain:"ui.retain",snapshot:"ui.snapshot",restore:"ui.restore"};var iI={Input:{value:"value",change:"onChange"},Textarea:{value:"value",change:"onChange"},Switch:{value:"checked",change:"onChange"},Checkbox:{value:"checked",change:"onChange"},Select:{value:"value",change:"onChange"},RadioGroup:{value:"value",change:"onChange"},Slider:{value:"value",change:"onChange"},Tabs:{value:"value",change:"onChange"},Collapsible:{value:"open",change:"onChange"},Table:{value:"selected",change:"onSelectionChange"},Tree:{value:"selected",change:"onSelect"}},oI=new Map(Object.entries(iI));function hp(e){return oI.get(e)??null}var ya="$edit";var ba=/^[A-Za-z0-9_.:-]+$/,Fv=l.object({$callback:l.string().min(1).max(L.maxCallbackIdLength).regex(ba)}).strict(),Mt=["neutral","accent","success","warning","danger"],V=l.string().max(L.maxLabelLength),H=V.min(1),Y=Fv.optional(),je=l.string().regex(/^[a-z0-9-]{1,64}$/),Ee=l.enum(["none","xs","sm","md","lg"]).optional(),Br=l.enum(["start","center","end","stretch"]).optional(),tt=l.enum(Mt).optional(),_a=l.enum(["xs","sm","md"]).optional(),vp=l.enum(["solid","outline","ghost"]).optional(),N=l.boolean().optional(),Ln=l.string().max(L.maxTextLength),Hr=l.enum(["sm","md","lg","none"]).optional(),Zt=l.string().min(1).max(L.maxLabelLength),ve={[ya]:l.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).optional()};function R(e,n){return{props:e,children:n}}var yt=["activity","bar-chart-3","bell","blocks","book","bot","bug","calendar","cloud","code","database","file-text","flag","folder","gauge","globe","hammer","layers","lightbulb","package","plug","puzzle","rocket","star","terminal","wrench","zap","add","remove","delete","edit","refresh","search","settings","check","close","info","warning","error","open-external","copy","download","upload","play","pause","stop","more","expand","collapse","next","filter","branch","file","agent","link"],aI=Object.fromEntries(yt.slice(yt.indexOf("add")).map(e=>[e,Fr])),Cz=new Map(yt.map(e=>[e.replaceAll("-",""),e]));var sI=["html","components"],uI=/\.(?:m?js|tsx?|mts|jsx)$/i,Lz=l.object({id:zn.meta(ee("Panel id, unique among this plugin's panels. The reserved names `constructor` and `prototype` are refused.",et,["dashboard"])),title:Gr(l.string().min(1).max(256)).meta(ee("Title shown on the panel tab and its tooltip.",et,["Dashboard"])),icon:l.enum(yt).optional().meta({...ee("Icon shown in the right-sidebar activity bar. Defaults to `plug`.",et,["database"]),[Nn]:aI}),entry:ma.meta(da(`What the panel runs: an HTML page for \`ui: "html"\`, a \`.js\`/\`.mjs\` module for \`ui: "components"\`. Either may instead be a \`.ts\`/\`.tsx\`/\`.mts\`/\`.jsx\` file, which Orca transpiles when it loads (needs \`engines.orca\` \`>=${bv}\`; an \`html\` panel then gets a generated page around it). It is trusted code: install panels you trust.`,et,["dist/panel.html"])),ui:l.enum(sI).optional().meta(ee("How the panel draws its UI. `html` (default) shows `entry` as a web page in an isolated frame; `components` runs `entry` as a hidden module and Orca draws the component tree it returns with its own controls.",Fr,["components"]))}).strict().refine(e=>e.ui!=="components"||uI.test(e.entry),{path:["entry"],message:"a components panel entry must be a .js, .mjs, .ts, .tsx, .mts or .jsx module"}).meta({id:"PanelContribution",description:"A sidebar panel. Requires the `sandboxed-ui` execution profile or higher."});var cI="1.4.248";var lI=64,dI=256,jn=cI,Vv={text:Gr(l.string().max(lI)).optional().meta(ee("Short label shown in the status bar.",jn,["3 blocked"])),icon:l.enum(yt).optional().meta(ee("Icon shown before the text, from the panel icon set.",jn,["bell"])),tone:l.enum(Mt).optional().meta(ee("Colour of the item. Defaults to `neutral`.",jn,["warning"])),tooltip:Gr(l.string().max(dI)).optional().meta(ee("Shown on hover. Defaults to the plugin name.",jn))},Gz=l.object({id:zn.meta(ee("Item id, unique among this plugin's status bar items; `statusBar.update` names it.",jn,["blocked-count"])),...Vv,command:xv.optional().meta(ee("Id of a command this plugin contributes in `contributes.commands`, run when the item is pressed.",jn,["guard.showLog"]))}).strict().meta({id:"StatusBarItemContribution",description:"An item in the status bar. Requires the `declarative` profile; a `trusted-worker` can change it with `statusBar.update`."}),Gv=l.strictObject({...Vv,visible:l.boolean().optional()});var pI=l.strictObject({id:zn,...Gv.shape}),mI=l.object({ok:l.literal(!0)}),Bv={"statusBar.update":G({summary:"Changes one of the plugin's `contributes.statusBarItems` (named by `id`): fields given replace their current value, `visible: false` hides it. Desktop app only; lasts until Orca restarts, and is hidden while the plugin is disabled. A plugin with `main` and status bar items has its worker started when it is enabled and kept running while it stays enabled, so a worker can poll and update its items without an event or a hook.",since:2,scope:"plugin-private",capability:null,mutation:!1,surfaces:de,params:pI,result:mI})};function yp(e){return e==="linux"?"orca-ide":e==="win32"?"orca.cmd":"orca"}function fI(e){return{...e,launchCmd:e.launchCmd??e.detectCmd,expectedProcess:e.expectedProcess??e.detectCmd}}var gI={claude:{detectCmd:"claude",promptInjectionMode:"argv",pasteNeedsTypedRequest:!0,draftPromptFlag:"--prefill",preflightTrust:"claude",draftPasteReadySignal:"claude-composer-prompt",workerStartReadsComposerMarker:!0,ctrlEnterEncoding:"csi-u"},"claude-agent-teams":{detectCmd:"orca",detectCmdAliases:["orca-dev","orca-ide"],detectRequiredCommands:["claude"],detectUnsupportedRuntimes:["win32","wsl"],launchCmd:"orca claude-teams",launchCmdByPlatform:{linux:`${yp("linux")} claude-teams`,win32:`${yp("win32")} claude-teams`},expectedProcess:"claude",promptInjectionMode:"stdin-after-start",pasteNeedsTypedRequest:!0,preflightTrust:"claude",draftPasteReadySignal:"claude-composer-prompt",workerStartReadsComposerMarker:!0,ctrlEnterEncoding:"csi-u"},codebuddy:{detectCmd:"codebuddy",detectCmdAliases:["cbc"],promptInjectionMode:"argv"},openclaude:{detectCmd:"openclaude",promptInjectionMode:"argv",draftPromptFlag:"--prefill"},codex:{detectCmd:"codex",promptInjectionMode:"argv",windowsInputRecordPasteNewline:"alt-enter",preflightTrust:"codex",draftPasteReadySignal:"codex-composer-prompt",draftPasteReadyTimeoutMs:2e4,submitRetryDelayMs:1200},autohand:{detectCmd:"autohand",promptInjectionMode:"stdin-after-start"},ante:{detectCmd:"ante",promptInjectionMode:"stdin-after-start"},trae:{detectCmd:"traecli",promptInjectionMode:"argv",argvPromptSeparator:"--"},opencode:{detectCmd:"opencode",promptInjectionMode:"flag-prompt",draftPasteReadySignal:"render-cursor-after-bracketed-paste",submitPasteReadySignal:"opencode-agent-row",draftPasteReadyTimeoutMs:2e4,ctrlEnterEncoding:"csi-u",composerReadyCaptures:["opencode-1-18-32-timed-boot-slow","opencode-1-18-32-timed-boot-hidden-pane","opencode-1-18-32-timed-first-launch","opencode-cmd-2-0-21-timed-warm-server"]},opencode2:{detectCmd:"opencode2",launchCmd:"opencode2 --standalone",promptInjectionMode:"flag-prompt",draftPasteReadySignal:"render-cursor-after-bracketed-paste",submitPasteReadySignal:"opencode-agent-row",draftPasteReadyTimeoutMs:2e4,composerReadyCaptures:["opencode-2-0-18-timed-boot-hidden-pane","opencode-2-0-21-timed-cold-standalone","opencode-2-0-21-timed-cold-standalone-hidden-pane","opencode-2-0-21-timed-natural-load-enter-dropped","opencode-2-0-14-timed-cold-standalone"]},"mimo-code":{detectCmd:"mimo",promptInjectionMode:"flag-prompt",draftPasteReadySignal:"render-cursor-after-bracketed-paste"},pi:{detectCmd:"pi",promptInjectionMode:"argv",draftPromptEnvVar:"ORCA_PI_PREFILL",windowsShiftEnterEncoding:"csi-u"},omp:{detectCmd:"omp",promptInjectionMode:"argv",draftPromptEnvVar:"ORCA_OMP_PREFILL",windowsShiftEnterEncoding:"csi-u"},"prime-agent":{detectCmd:"prime-agent",promptInjectionMode:"argv",argvPromptSeparator:"--",windowsShiftEnterEncoding:"csi-u"},qoder:{detectCmd:"qodercli",detectCmdAliases:["qoder"],promptInjectionMode:"flag-prompt-interactive",preflightTrust:"qoder"},"qoder-cn":{detectCmd:"qoderclicn",detectCmdAliases:["qodercn"],promptInjectionMode:"flag-prompt-interactive",preflightTrust:"qoder-cn"},gemini:{detectCmd:"gemini",promptInjectionMode:"flag-prompt-interactive"},antigravity:{detectCmd:"agy",promptInjectionMode:"flag-prompt-interactive",preflightTrust:"antigravity",draftPasteReadySignal:"antigravity-composer-prompt",draftPasteReadyTimeoutMs:2e4,submitLineSettleMsPerLine:45},aider:{detectCmd:"aider",promptInjectionMode:"stdin-after-start"},goose:{detectCmd:"goose",promptInjectionMode:"stdin-after-start"},amp:{detectCmd:"amp",promptInjectionMode:"stdin-after-start"},kilo:{detectCmd:"kilo",promptInjectionMode:"stdin-after-start"},kiro:{detectCmd:"kiro-cli",launchCmd:"kiro-cli chat --tui",promptInjectionMode:"stdin-after-start"},crush:{detectCmd:"crush",promptInjectionMode:"stdin-after-start"},aug:{detectCmd:"auggie",promptInjectionMode:"stdin-after-start"},cline:{detectCmd:"cline",promptInjectionMode:"stdin-after-start"},freebuff:{detectCmd:"freebuff",promptInjectionMode:"stdin-after-start"},codebuff:{detectCmd:"codebuff",promptInjectionMode:"stdin-after-start"},"command-code":{detectCmd:"command-code",launchCmd:"command-code --trust",promptInjectionMode:"argv"},continue:{detectCmd:"cn",promptInjectionMode:"stdin-after-start"},cursor:{detectCmd:"cursor-agent",promptInjectionMode:"argv",preflightTrust:"cursor"},droid:{detectCmd:"droid",promptInjectionMode:"argv",windowsShiftEnterEncoding:"csi-u",ctrlEnterEncoding:"csi-u"},kimi:{preflightTrust:"kimi",detectCmd:"kimi",detectCmdAliases:["kimi-code"],promptInjectionMode:"stdin-after-start"},"mistral-vibe":{detectCmd:"vibe",detectCmdAliases:["mistral-vibe"],promptInjectionMode:"stdin-after-start"},"qwen-code":{detectCmd:"qwen",promptInjectionMode:"stdin-after-start",submitRetryDelayMs:1200},rovo:{detectCmd:"acli",launchCmd:"acli rovodev run",promptInjectionMode:"stdin-after-start"},hermes:{detectCmd:"hermes",launchCmd:"hermes --tui",promptInjectionMode:"hermes-query"},openclaw:{detectCmd:"openclaw",promptInjectionMode:"stdin-after-start"},copilot:{detectCmd:"copilot",promptInjectionMode:"flag-interactive",preflightTrust:"copilot",draftPasteReadySignal:"copilot-composer-prompt"},grok:{detectCmd:"grok",promptInjectionMode:"argv",argvPromptSeparator:"--",draftPasteReadySignal:"grok-composer-prompt",ctrlEnterEncoding:"csi-u"},muse:{detectCmd:"muse",launchCmd:"muse --trust-workspace",promptInjectionMode:"stdin-after-start"},dsh:{detectCmd:"dsh-tui",detectCmdAliases:["dst"],detectRequiredCommands:["dsh"],launchCmd:"dsh-tui .",expectedProcess:"dsh",promptInjectionMode:"stdin-after-start",draftPasteReadySignal:"dsh-composer-prompt",submitRetryDelayMs:1e3,submitRetryBudgetMs:3e4},zcode:{detectCmd:"zcode",expectedProcess:"zcode-cli",promptInjectionMode:"stdin-after-start",draftPasteReadySignal:"zcode-composer-prompt",composerReadyCaptures:["zcode-composer-ready"]},devin:{detectCmd:"devin",promptInjectionMode:"argv",argvPromptSeparator:"--"},jcode:{detectCmd:"jcode",launchCmd:"jcode",expectedProcess:"jcode",promptInjectionMode:"stdin-after-start"}},hI=Object.fromEntries(Object.entries(gI).map(([e,n])=>[e,fI(n)]));function Hv(e){return typeof e=="string"&&Object.hasOwn(hI,e)}var bp=["worktree.history.back","worktree.history.forward","sidebar.left.toggle","sidebar.sleepingWorkspaces.toggle","floatingWorkspace.maximize","tab.rename","workspace.rename","workspace.openBoard","view.tasks","sidebar.right.toggle","sidebar.explorer.toggle","sidebar.search.toggle","sidebar.sourceControl.toggle","sidebar.checks.toggle","sidebar.ports.toggle"];var aD=new Set(bp);var vI=500,_p=2e3,Wr=1024,Wv=4096,Un=l.string().min(1).max(Wr),$p=l.string().min(1).max(Wr),yI=l.strictObject({}).optional(),bI=l.object({workspaces:l.array(l.object({id:Un,kind:l.enum(["worktree","folder"]),name:l.string().max(512),project:l.string().max(512).nullable().optional(),path:l.string().max(Wr),branch:l.string().max(512).nullable(),hostId:l.string().max(Wr).nullable()})).max(vI),truncated:l.boolean()}),_I=l.strictObject({workspaceId:Un}),$I=l.object({opened:l.literal(!0)}),kI=200,xI=[[0,31],[127,159],[173,173],[847,847],[1564,1564],[4447,4448],[6068,6069],[6155,6159],[8203,8207],[8232,8238],[8288,8303],[10240,10240],[12644,12644],[65024,65039],[65279,65279],[65440,65440],[65520,65531],[119155,119162],[917504,921599]],wI=e=>{let n=e.codePointAt(0)??0;return xI.some(([i,o])=>n>=i&&n<=o)},II=l.strictObject({workspaceId:Un,name:l.string().max(kI).refine(e=>e.trim().length>0,"name must not be blank").refine(e=>![...e].some(wI),"name must be one line of plain text")}),SI=l.object({name:l.string()}),PI=l.strictObject({workspaceId:Un,title:l.string().min(1).max(512).optional(),command:l.string().min(1).max(Wv).optional()}),TI=l.object({terminalId:$p}),EI=l.strictObject({terminalId:$p,maxLines:l.number().int().min(1).max(_p).optional()}),AI=l.object({lines:l.array(l.string()).max(_p),truncated:l.boolean()}),OI=l.strictObject({workspaceId:Un,agent:l.string().min(1).max(64).refine(Hv,"unknown agent"),prompt:l.string().min(1).max(Wv).optional()}),NI=l.object({terminalId:$p});function zI(e){let n=e.split(/[\\/]/);return!/^[a-z]:/i.test(e)&&n[0]!==""&&n.every(i=>i!=="..")&&n.some(i=>i!==""&&i!==".")}var DI=l.strictObject({workspaceId:Un,path:l.string().min(1).max(Wr).refine(zI,"path must be relative and inside the workspace")}),CI=l.object({opened:l.literal(!0)}),LI=l.strictObject({action:l.enum(bp)}),jI=l.object({ran:l.literal(!0)}),Kv={"workspace.list":G({summary:"Lists every workspace, Git worktrees and folders, on every host Orca reaches.",since:3,scope:"any-workspace",capability:"workspace:read",mutation:!1,surfaces:de,params:yI,result:bI}),"workspace.open":G({summary:"Shows a workspace in Orca, as clicking it in the sidebar does; a folder workspace needs the desktop app.",since:3,scope:"any-workspace",capability:"workspace:write",mutation:!0,surfaces:de,params:_I,result:$I}),"workspace.rename":G({summary:"Renames a workspace in Orca's sidebar, as renaming it by hand does; the name stays until it is renamed again.",since:5,scope:"any-workspace",capability:"workspace:write",mutation:!0,surfaces:de,params:II,result:SI}),"terminal.create":G({summary:"Opens a terminal in a workspace, optionally running a command, in the background.",since:3,scope:"any-workspace",capability:"terminal:send",mutation:!0,surfaces:de,params:PI,result:TI}),"terminal.read":G({summary:`Reads a terminal's newest output as plain text, at most ${_p} lines.`,since:3,scope:"explicit-terminal",capability:"terminal:read",mutation:!1,surfaces:de,params:EI,result:AI}),"agent.launch":G({summary:"Starts an agent's CLI in a new terminal of a workspace, in the background, and returns as soon as it starts; a `prompt` is sent once the agent is ready.",since:3,scope:"any-workspace",capability:"agent:launch",mutation:!0,surfaces:de,params:OI,result:NI}),"editor.open":G({summary:"Opens a file of a workspace in an editor tab of Orca's window; desktop app only. `workspace.open` shows the workspace.",since:3,scope:"any-workspace",capability:"workspace:write",mutation:!0,surfaces:de,params:DI,result:CI}),"commands.run":G({summary:"Runs one of Orca's built-in actions in its window, never a plugin's replacement of it; desktop app only.",since:3,scope:"desktop",capability:"workspace:write",mutation:!0,surfaces:de,params:LI,result:jI})};var kp=l.string().regex(/^[a-f0-9]{64}$/),Jv=l.string().min(1).max(16*1024),UI=l.strictObject({expectedRevision:kp,app:Jv,terminal:Jv}),Xv={"appearance.read":G({summary:"Reads the current desktop appearance revision for a conditional update.",since:4,scope:"desktop",capability:"appearance:write",mutation:!1,surfaces:de,params:l.strictObject({}).optional(),result:l.strictObject({revision:kp})}),"appearance.apply":G({summary:"Publishes owned app/editor and terminal colors and selects them in the desktop. Returns publication, not renderer acknowledgement.",since:4,scope:"desktop",capability:"appearance:write",mutation:!0,surfaces:de,params:UI,result:l.strictObject({revision:kp,themeId:l.templateLiteral(["plugin:",l.string()]),mode:l.enum(["dark","light"]),delivery:l.literal("published")})})};var qv={...Bv,...Xv,...Kv};var RI=4096,MI=50,Kr=512,nt=1024,ZI=l.strictObject({}).optional(),xp=l.object({branch:l.string().max(Kr),displayName:l.string().max(Kr),terminals:l.array(l.object({id:l.string().min(1).max(nt),title:l.string().max(Kr).optional()}).strict()).max(MI)}).strict().nullable(),FI=l.strictObject({terminalId:l.string().min(1).max(nt),text:l.string().min(1).max(RI),enter:l.boolean().default(!1)}),VI=l.object({accepted:l.boolean()}),GI=l.strictObject({title:l.string().min(1).max(120),body:l.string().max(1e3).optional()}),BI=l.object({delivered:l.boolean()}),wp={openExternal:"shell.openExternal",saveAs:"files.saveAs"},HI=8192,WI=["http:","https:","mailto:"],Yv=64*1024*1024,KI=l.strictObject({url:l.string().min(1).max(HI).refine(QI,"url must be an http:, https: or mailto: URL")}),JI=l.object({opened:l.boolean(),reason:l.enum(["cancelled","consent-unavailable"]).optional()}),XI=l.union([l.string().max(Yv),l.custom(e=>e instanceof ArrayBuffer||e instanceof Uint8Array,"data must be a string or ArrayBuffer").refine(e=>e.byteLength<=Yv,"data exceeds 64 MiB").meta({type:"ArrayBuffer"})]),qI=l.strictObject({suggestedName:l.string().min(1).max(255).optional(),mimeType:l.string().min(1).max(255).optional(),data:XI}),YI=l.object({status:l.enum(["saved","cancelled"])});function QI(e){try{return WI.includes(new URL(e).protocol)}catch{return!1}}var Ft={"workspace.readContext":G({summary:"Branch, name and terminal ids of the focused workspace, or null when none is focused.",since:0,scope:"active-workspace",capability:"workspace:read",mutation:!1,surfaces:ce,params:ZI,result:xp}),"terminal.sendText":G({summary:"Types text into one terminal named by id, optionally pressing Enter.",since:0,scope:"explicit-terminal",capability:"terminal:send",mutation:!0,surfaces:de,params:FI,result:VI}),"notifications.show":G({summary:"Shows a desktop notification.",since:0,scope:"desktop",capability:"notifications:show",mutation:!0,surfaces:ce,params:GI,result:BI}),"storage.get":G({summary:"Reads a JSON value from the plugin's private store; null when absent.",since:0,scope:"plugin-private",capability:"storage:own",mutation:!1,framesSince:2,surfaces:ce,params:Qh,result:ev}),"storage.set":G({summary:"Writes a JSON value to the plugin's private store.",since:0,scope:"plugin-private",capability:"storage:own",mutation:!0,framesSince:2,surfaces:ce,params:tv,result:nv}),"storage.delete":G({summary:"Removes a key from the plugin's private store.",since:0,scope:"plugin-private",capability:"storage:own",mutation:!0,framesSince:2,surfaces:ce,params:rv,result:iv}),"storage.keys":G({summary:"Lists the keys in the plugin's private store.",since:0,scope:"plugin-private",capability:"storage:own",mutation:!1,framesSince:2,surfaces:ce,params:ov,result:av}),"secrets.get":G({summary:"Reads a secret from the plugin's encrypted secrets file; null when absent.",since:0,scope:"plugin-private",capability:"secrets:own",mutation:!1,framesSince:2,surfaces:ce,params:sv,result:uv}),"secrets.set":G({summary:"Stores a secret in the plugin's encrypted secrets file.",since:0,scope:"plugin-private",capability:"secrets:own",mutation:!0,framesSince:2,surfaces:ce,params:cv,result:lv}),"secrets.delete":G({summary:"Removes a secret from the plugin's encrypted secrets file.",since:0,scope:"plugin-private",capability:"secrets:own",mutation:!0,framesSince:2,surfaces:ce,params:dv,result:pv}),"secrets.protection":G({summary:"How secrets are protected at rest: `os-keyring`, or `unavailable` (no OS key store, or Linux `basic_text`), where `secrets.set` fails.",since:1,scope:"plugin-private",capability:"secrets:own",mutation:!1,framesSince:2,surfaces:ce,params:mv,result:fv}),"settings.get":G({summary:"Reads every setting the plugin owns.",since:0,scope:"plugin-private",capability:"settings:own",mutation:!1,framesSince:2,surfaces:ce,params:gv,result:hv}),"settings.set":G({summary:"Writes one setting the plugin owns.",since:0,scope:"plugin-private",capability:"settings:own",mutation:!0,framesSince:2,surfaces:ce,params:vv,result:yv}),"shell.openExternal":G({summary:"Opens an http:, https: or mailto: URL in the default browser. Needs a click or key press in the frame; desktop app only. Orca asks the person before an http(s) host the plugin was not allowed; `opened` is false if they cancel.",since:1,scope:"desktop",capability:null,userActivation:!0,mutation:!1,surfaces:Dn,params:KI,result:JI}),"files.saveAs":G({summary:"Offers data (a string or ArrayBuffer, up to 64 MiB) in Orca's save dialog; the plugin never learns the path. Needs a click or key press in the frame; desktop app only.",since:1,scope:"desktop",capability:null,userActivation:!0,mutation:!0,surfaces:Dn,params:qI,result:YI}),...Mv,...qv,...jv},Qv=Object.keys(Ft).filter(ey);function ey(e){return Object.hasOwn(Ft,e)}function Ip(e){return ey(e)?Ft[e]:null}var ty=Math.max(...Qv.map(e=>Ft[e].since));function Jr(e){return Qv.filter(n=>Ft[n].surfaces.includes(e))}function $a(e,n){return Jr(e).filter(i=>n||Ft[i].userActivation!==!0)}function ka(e,n="panel"){return Math.max(0,...e.map(i=>Dv(Ft[i],n)))}var Ue=1,TD=l.number().refine(e=>e===Ue,{error:e=>typeof e.input=="number"&&e.input>Ue?`targets host API ${e.input}, but this Orca supports only ${Ue}; update Orca`:`must be ${Ue}`}).meta({const:Ue});var eS=new Set(["rate_limited","unavailable","timeout","conflict"]);function He(e,n=e,i){return Object.assign(new Error(n),{code:e,retryable:eS.has(e),...i===void 0?{}:{retryAfterMs:i}})}var tS=new Set(["plugin.request","events.subscribe","storage.get","storage.set","storage.delete","storage.keys","settings.get","settings.set","secrets.get","secrets.set","secrets.delete","secrets.protection"]);function xa(e,n){return typeof e=="object"&&e!==null&&n in e?Object.getOwnPropertyDescriptor(e,n)?.value:void 0}function ny(e){let n={storage:new Map(Object.entries(e.storage??{})),settings:new Map(Object.entries(e.settings??{})),secrets:new Map(Object.entries(e.secrets??{}))},i=new Set,o=(a,s,u)=>{if(u===void 0?n[a].delete(s):n[a].set(s,u),a!=="secrets")for(let c of i)c(a,s);return{ok:!0}},t=null;async function r(a){let s=String(xa(a,"name")),u=xa(a,"input");if(!e.requests||!Object.hasOwn(e.requests,s)){if(t)return{output:await t(s,u)??null};throw He("unknown_method",`no panel handler named ${s}`)}let c=e.requests[s];return{output:(typeof c=="function"?await c(u):c)??null}}return{handles:a=>tS.has(a),async answer(a,s){let u=String(xa(s,"key")),c=xa(s,"value");switch(a){case"plugin.request":return r(s);case"storage.get":return{value:n.storage.get(u)??null};case"storage.keys":return{keys:[...n.storage.keys()]};case"settings.get":return{settings:Object.fromEntries(n.settings)};case"secrets.get":return{value:n.secrets.get(u)??null};case"secrets.protection":return{status:"os-keyring"};case"storage.set":return o("storage",u,c);case"settings.set":return o("settings",u,c);case"secrets.set":return o("secrets",u,c);case"storage.delete":return o("storage",u,void 0);case"secrets.delete":return o("secrets",u,void 0);default:return{ok:!0}}},routeRequests(a){return t=a,()=>{t===a&&(t=null)}},onChange(a){return i.add(a),()=>i.delete(a)},snapshot:()=>({storage:Object.fromEntries(n.storage),settings:Object.fromEntries(n.settings),secrets:Object.fromEntries(n.secrets)})}}var wa=class extends Error{constructor(i,o){super(o);this.code=i}code};function nS(e){return typeof e=="function"}var ry={ok:!0};function rS(e){return e.result.safeParse(ry).success}var Sp={"workspace.readContext":null,"notifications.show":{delivered:!0},"shell.openExternal":{opened:!0},"files.saveAs":{status:"saved"},"agents.list":{agents:[]},"editor.readTypography":Lv({terminalFontSize:14},0)};function iy(e,n){let i=new Set(e.capabilities??n),o=new Map(Object.entries(e.results??{})),t=ny(e),r={panel:$a("panel",!0),worker:Jr("worker")},a=[],s=[],u=new Set,c=0,d=(g,y)=>{throw new wa(g,y)};async function p(g,y,x){let I=Ip(g);if(!I)return d("unknown_method",`${g} does not exist in this Orca`);if(!I.surfaces.includes(x))return d("not_permitted",`${g} is not available to ${x}s`);if(I.userActivation===!0){if(c===0)return d("not_permitted",`${g} needs a click or key press in the frame`);c-=1}if(I.capability&&!i.has(I.capability))return d("capability_denied",`${g} needs the ${I.capability} capability`);let b=I.params.safeParse(y);return b.success?b.data:d("invalid_params",b.error.issues[0]?.message??"invalid params")}async function m(g,y,x){let I;try{I=await p(g,y,x)}catch(E){throw E instanceof wa?(s.push({method:g,code:E.code,message:E.message}),He(E.code,E.message)):E}let b=Ip(g);if(!b)throw He("unknown_method",g);let T=!o.has(g)&&t.handles(g),A=rS(b);if(!o.has(g)&&!T&&!Object.hasOwn(Sp,g)&&!A)throw He("unavailable",`the test configured no result for ${g}`);let D=o.has(g)?o.get(g):Object.hasOwn(Sp,g)?Sp[g]:ry,w=T?await t.answer(g,I):nS(D)?await D(I):D,O=b.result.safeParse(w);if(!O.success)throw new TypeError(`mockHost: the result configured for ${g} does not match the host API: ${O.error.issues[0]?.message??"invalid result"}`);return O.data}let f=g=>({api:{major:Ue,minor:ka(r[g])},call(y,x){a.push({method:y,params:x});let I=m(y,x,g);return u.add(I),I.catch(()=>{}).finally(()=>u.delete(I)),I},has:y=>r[g].some(x=>x===y)});return{calls:a,refusals:s,capabilities:[...i],callsOf:g=>a.filter(y=>y.method===g).map(y=>y.params),respond:(g,y)=>o.set(g,y),grantGesture:()=>{c=1},data:()=>t.snapshot(),onDataChange:g=>t.onChange(g),routeRequests:g=>t.routeRequests(g),async idle(){for(;u.size>0;)await Promise.allSettled(u)},bridge:f("panel"),worker:f("worker")}}var iS=l.object({label:H,labelHidden:N,value:Ln.optional(),defaultValue:Ln.optional(),placeholder:V.optional(),rows:l.number().int().min(2).max(20).optional(),maxLength:l.number().int().positive().max(L.maxTextLength).optional(),invalid:N,disabled:N,onChange:Y,onSubmit:Y,...ve}).strict(),oS=l.object({label:H,description:V.optional(),checked:N,defaultChecked:N,disabled:N,onChange:Y,...ve}).strict(),aS=l.object({label:H,labelHidden:N,value:V.optional(),defaultValue:V.optional(),options:l.array(l.object({value:H,label:H,description:V.optional(),disabled:N}).strict()).max(L.maxRadioOptions),orientation:l.enum(["vertical","horizontal"]).optional(),disabled:N,onChange:Y,...ve}).strict(),Ia=l.number().refine(Number.isFinite,"must be finite"),sS=l.object({label:H,labelHidden:N,value:Ia.optional(),defaultValue:Ia.optional(),min:Ia.optional(),max:Ia.optional(),step:l.number().positive().refine(Number.isFinite).optional(),showValue:N,disabled:N,onChange:Y,...ve}).strict(),uS=l.object({label:H,description:V.optional(),error:V.optional(),required:N}).strict(),oy={Textarea:R(iS,"none"),Checkbox:R(oS,"none"),RadioGroup:R(aS,"none"),Slider:R(sS,"none"),Field:R(uS,"any")};var cS=l.object({label:H,value:V.optional(),defaultValue:V.optional(),onChange:Y,...ve}).strict(),lS=l.object({value:H,label:H,icon:je.optional(),disabled:N}).strict(),dS=l.object({title:H,description:V.optional(),open:N,defaultOpen:N,disabled:N,onChange:Y,...ve}).strict(),pS=l.object({label:H,gap:Ee}).strict(),mS=l.object({columns:l.number().int().min(1).max(6).optional(),minItemWidth:l.enum(["xs","sm","md","lg"]).optional(),gap:Ee}).strict(),ay={Tabs:R(cS,"tabs"),Tab:R(lS,"any"),Collapsible:R(dS,"any"),Toolbar:R(pS,"any"),Grid:R(mS,"any")};function Re(e){return typeof e=="object"&&e!==null}var Xr=["long","short","duration"],Pp=l.number().refine(Number.isFinite,"must be a finite time in milliseconds"),sy=l.object({type:l.literal("relative"),at:Pp,format:l.enum(Xr).optional()}).strict(),fS=[["day",864e5],["hour",36e5],["minute",6e4],["second",1e3]];function gS(e){let n=Math.abs(e),[i,o]=fS.find(([,t])=>n>=t)??["second",1e3];return{value:Math.trunc(e/o),unit:i}}function uy(e,n,i,o){let{value:t,unit:r}=gS(e-n);return i==="duration"?new Intl.NumberFormat(o,{style:"unit",unit:r,unitDisplay:"narrow"}).format(Math.abs(t)):new Intl.RelativeTimeFormat(o,{numeric:i==="long"?"auto":"always",style:i==="long"?"long":"narrow"}).format(t,r)}var Tp=l.string().min(1).max(64),hS=l.union([l.string().max(L.maxLabelLength),l.number(),l.boolean(),l.null(),sy]),cy=e=>new Set(e.map(n=>n.key)).size===e.length,vS=l.object({label:H,columns:l.array(l.object({key:Tp,label:H,align:l.enum(["start","center","end"]).optional(),width:l.enum(["auto","xs","sm","md","lg"]).optional(),minWidth:l.enum(["auto","xs","sm","md"]).optional(),hideBelow:l.enum(["sm","md"]).optional(),sortable:N}).strict()).min(1).max(L.maxTableColumns).refine(cy,"column keys must be unique"),rows:l.array(l.object({key:Zt,cells:l.record(Tp,hS.refine(e=>typeof e!="number"||Number.isFinite(e))).refine(e=>Object.keys(e).length<=L.maxTableColumns),disabled:N}).strict()).max(L.maxTableRows).refine(cy,"row keys must be unique"),sort:l.object({column:Tp,direction:l.enum(["asc","desc"])}).strict().optional(),selectionMode:l.enum(["none","single","multiple"]).optional(),selected:l.array(Zt).max(L.maxTableRows).optional(),defaultSelected:l.array(Zt).max(L.maxTableRows).optional(),hasMore:N,loading:N,emptyText:V.optional(),maxHeight:Hr,onSortChange:Y,onSelectionChange:Y,onRowAction:Y,onLoadMore:Y,...ve}).strict(),yS=l.object({key:Zt,label:H,description:V.optional(),icon:je.optional(),disabled:N,hasChildren:N,children:l.array(l.unknown()).optional()}).strict();function bS(e){let n=[],i=new Set,o=[{raw:e,out:n,depth:1}],t=0;for(let r=o.pop();r;r=o.pop()){if(r.depth>L.maxTreeItemDepth)return`items nest deeper than ${L.maxTreeItemDepth}`;for(let a of r.raw){if(++t>L.maxTreeItems)return`more than ${L.maxTreeItems} items`;let s=yS.safeParse(Re(a)?a:null);if(!s.success)return"each item needs a key and a label";let{children:u,...c}=s.data;if(i.has(c.key))return`duplicate item key ${JSON.stringify(c.key.slice(0,64))}`;i.add(c.key);let d=c;r.out.push(d),u&&(d.children=[],o.push({raw:u,out:d.children,depth:r.depth+1}))}}return n}var _S=l.array(l.unknown()).transform((e,n)=>{let i=bS(e);return typeof i=="string"?(n.addIssue({code:"custom",message:i}),l.NEVER):i}),$S=l.object({label:H,items:_S,selected:V.optional(),defaultSelected:V.optional(),expanded:l.array(Zt).max(L.maxTreeItems).optional(),defaultExpanded:l.array(Zt).max(L.maxTreeItems).optional(),maxHeight:Hr,onSelect:Y,onToggle:Y,onAction:Y,...ve}).strict(),ly={Table:R(vS,"none"),Tree:R($S,"none")};var dy=l.string().max(L.maxDocumentLength),kS=/\.(?:png|jpe?g|webp)$/i;function xS(e){return kS.test(e)&&!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)&&!/[\\\0?#]/.test(e)&&e.split("/").every(n=>n!==""&&n!=="."&&n!=="..")}var wS=l.object({content:dy}).strict(),IS=l.object({code:dy,language:l.string().regex(/^[A-Za-z0-9_+#.-]{1,64}$/).optional(),label:V.optional(),lineNumbers:N,wrap:N,maxHeight:Hr}).strict(),SS=l.object({src:l.string().max(512).refine(xS,"must be an image file in the plugin"),alt:V,size:l.enum(["xs","sm","md","lg","full"]).optional(),fit:l.enum(["contain","cover"]).optional(),rounded:N}).strict(),PS=l.object({label:V.optional(),items:l.array(l.object({label:H,value:l.union([V,l.number().refine(Number.isFinite),l.boolean(),l.null()]),tone:tt,code:N}).strict()).max(L.maxKeyValueItems)}).strict(),TS=l.object({tone:tt,title:V.optional(),icon:je.optional()}).strict(),ES=l.object({at:Pp,format:l.enum(Xr).optional(),tone:tt,muted:N}).strict(),AS=l.object({shape:l.enum(["text","block","circle"]).optional(),lines:l.number().int().min(1).max(10).optional(),label:V.optional()}).strict(),py={Markdown:R(wS,"none"),CodeView:R(IS,"none"),Image:R(SS,"none"),KeyValue:R(PS,"none"),Callout:R(TS,"any"),Skeleton:R(AS,"none"),RelativeTime:R(ES,"none")};var OS=4096,Rn=l.union([l.number().min(0).max(OS),l.string().regex(/^(100|[1-9]?[0-9])%$/)]).optional(),NS=["none","muted","card",...Mt],zS=l.object({direction:l.enum(["row","column"]).optional(),gap:Ee,padding:Ee,paddingX:Ee,paddingY:Ee,margin:Ee,align:Br,justify:l.enum(["start","center","end","between"]).optional(),wrap:N,grow:N,shrink:N,width:Rn,height:Rn,minWidth:Rn,minHeight:Rn,maxWidth:Rn,maxHeight:Rn,columns:l.number().int().min(1).max(6).optional(),scroll:l.enum(["x","y","both"]).optional(),border:l.union([l.boolean(),l.enum(Mt)]).optional(),radius:l.enum(["none","sm","md","lg","full"]).optional(),background:l.enum(NS).optional()}).strict(),my={Box:R(zS,"any")};var DS=yt,fy=new Set(DS),CS=l.object({gap:Ee,align:Br}).strict(),LS=l.object({gap:Ee,align:Br,justify:l.enum(["start","center","end","between"]).optional(),wrap:N}).strict(),jS=l.object({tone:tt,muted:N,size:_a,weight:l.enum(["regular","medium","semibold"]).optional(),truncate:N}).strict(),US=l.object({level:l.union([l.literal(1),l.literal(2),l.literal(3)]).optional()}).strict(),RS=l.object({variant:vp,tone:tt,size:_a,icon:je.optional(),tooltip:V.optional(),disabled:N,onPress:Y}).strict(),MS=l.object({icon:je,label:H,tooltip:V.optional(),variant:vp,tone:tt,size:_a,disabled:N,onPress:Y}).strict(),ZS=l.object({tone:tt}).strict(),FS=l.object({title:V.optional(),description:V.optional()}).strict(),VS=l.object({label:V.optional()}).strict(),GS=l.object({title:V.optional(),description:V.optional(),icon:je.optional(),current:N,disabled:N,onPress:Y}).strict(),BS=l.object({label:H,labelHidden:N,value:Ln.optional(),defaultValue:Ln.optional(),placeholder:V.optional(),type:l.enum(["text","search","password"]).optional(),maxLength:l.number().int().positive().max(L.maxTextLength).optional(),invalid:N,disabled:N,onChange:Y,onSubmit:Y,...ve}).strict(),HS=l.object({label:H,checked:N,defaultChecked:N,disabled:N,onChange:Y,...ve}).strict(),WS=l.object({label:H,labelHidden:N,value:V.optional(),defaultValue:V.optional(),placeholder:V.optional(),options:l.array(l.object({value:H,label:H,disabled:N}).strict()).max(L.maxSelectOptions),disabled:N,onChange:Y,...ve}).strict(),KS=l.object({orientation:l.enum(["horizontal","vertical"]).optional()}).strict(),JS=l.object({label:H,labelHidden:N,value:l.number().min(0).max(100).optional()}).strict(),XS=l.object({label:H,labelHidden:N}).strict(),qS=l.object({title:H,description:V.optional(),icon:je.optional()}).strict(),YS=l.object({href:l.string().max(2048).regex(/^(https?:\/\/|mailto:)/i).optional(),onPress:Y}).strict(),QS=l.object({block:N}).strict(),qr={Stack:R(CS,"any"),Row:R(LS,"any"),Text:R(jS,"inline"),Heading:R(US,"inline"),Button:R(RS,"text"),IconButton:R(MS,"none"),Badge:R(ZS,"text"),Card:R(FS,"any"),List:R(VS,"items"),ListItem:R(GS,"any"),Input:R(BS,"none"),Switch:R(HS,"none"),Select:R(WS,"none"),Separator:R(KS,"none"),Progress:R(JS,"none"),Spinner:R(XS,"none"),EmptyState:R(qS,"any"),Link:R(YS,"text"),Code:R(QS,"text"),...oy,...ay,...ly,...py,...my};function Ep(e){return typeof e=="string"&&Object.hasOwn(qr,e)}var bC=Object.keys(qr).filter(Ep),gy=new Set(["Text","Link","Code","Badge","RelativeTime"]),hy=new Set(["Button","IconButton","Input","Switch","Select","Link","ListItem","Textarea","Checkbox","RadioGroup","Slider","Tabs","Collapsible","Table","Tree","Markdown"]),Sa={items:"ListItem",tabs:"Tab"};var eP=new Set(["type","key","props","children"]),Ap=32,tP=8,nP=/^[A-Z][A-Za-z0-9]{0,63}$/,rP=20,iP=new Map([[Sa.items,"items"],[Sa.tabs,"tabs"]]),oP={ListItem:"List",Tab:"Tabs"};function vy(e){return e==="items"||e==="tabs"?Sa[e]:void 0}var Pa=class extends Error{};function ne(e,n){throw new Pa(`${e}: ${n}`)}function aP(e,n){return e===void 0?[]:(Array.isArray(e)||ne(n,"children must be an array"),e)}function sP(e,n,i){let o=qr[e].props.shape,t={};for(let[r,a]of Object.entries(n)){if(a===void 0)continue;if(!Object.hasOwn(o,r)){i(`${e}: ignored unknown prop "${r.slice(0,64)}"`);continue}let s=o[r].safeParse(a);if(!s.success){i(`${e}: ignored invalid ${r}`);continue}t[r]=s.data}for(let[r,a]of Object.entries(o))if(!Object.hasOwn(t,r)&&!a.safeParse(void 0).success)return i(`${e}: missing required ${r}; showing a placeholder`),null;return typeof t.icon=="string"&&!fy.has(t.icon)&&i(`${e}: unknown icon "${t.icon}"; showing a fallback glyph`),t}function yy(e){if(e===null)return{ok:!0,tree:null,nodes:0,warnings:[]};let n=new Set,i=c=>{n.sizeL.maxTextLength&&ne(I,"text is too long"),r+ ++a>L.maxNodes&&ne(I,`more than ${L.maxNodes} nodes`),s+=tP+Ne.length,s>L.maxTreeBytes&&ne(I,`tree exceeds ${L.maxTreeBytes} bytes`),x.push(Ne);continue}Re(d)||ne(I,"expected a node, string or number");let b=d.type,T=Ep(b);!T&&(typeof b!="string"||!nP.test(b))&&ne(I,`invalid component name ${JSON.stringify(String(b)).slice(0,80)}`),(f==="none"||f==="text")&&ne(I,`${m} accepts only text`),f==="inline"&&T&&!gy.has(b)&&ne(I,`${m} accepts only text, Text, Link, Code, Badge and RelativeTime`);let A=vy(f),D=typeof b=="string"?iP.get(b):void 0;A!==void 0&&b!==A&&ne(I,`${m} holds only ${A}`),D!==void 0&&D!==f&&ne(I,`${b} must be a direct child of ${oP[b]??"its container"}`),g&&hy.has(b)&&ne(I,`a ListItem with onPress cannot contain a ${b}`),++r+a>L.maxNodes&&ne(I,`more than ${L.maxNodes} nodes`),p>L.maxDepth&&ne(I,`deeper than ${L.maxDepth}`);for(let Ne of Object.keys(d))eP.has(Ne)||ne(I,`unknown node field ${Ne.slice(0,64)}`);let w=d.key;w!==void 0&&((typeof w!="string"||w.length>L.maxLabelLength)&&ne(I,"key must be a short string"),y.has(w)&&ne(I,`duplicate key ${JSON.stringify(w.slice(0,64))} among siblings`),y.add(w));let O=w===void 0?{}:{key:w};if(!T){i(`unknown component ${b}; showing a placeholder`),x.push({type:"Unsupported",...O,props:{name:b},children:[]}),s+=Ap+b.length;continue}let E=d.props??{};(!Re(E)||Object.keys(E).length>L.maxPropsPerNode)&&ne(I,"props must be an object with few fields");let B=sP(b,E,i);if(!B){x.push({type:"Unsupported",...O,props:{name:b},children:[]}),s+=Ap+b.length;continue}s+=Ap+JSON.stringify(B).length,s>L.maxTreeBytes&&ne(I,`tree exceeds ${L.maxTreeBytes} bytes`);let C=[],re={type:b,...O,props:B,children:C};x.push(re);let ye=aP(d.children,I);ye.length>L.maxNodes&&ne(I,`more than ${L.maxNodes} children`);let Oe=new Set,ni=g||b==="ListItem"&&B.onPress!==void 0;for(let Ne=ye.length-1;Ne>=0;Ne--)t.push({raw:ye[Ne],depth:p+1,parentType:b,policy:qr[b].children,inPressable:ni,siblingKeys:Oe,out:C,path:`${I}.children.${Ne}`})}}catch(c){if(c instanceof Pa)return{ok:!1,error:c.message};throw c}let u=o[0];return typeof u=="object"?{ok:!0,tree:u,nodes:r,warnings:[...n]}:{ok:!1,error:"tree: expected a node"}}var Mn=l.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),Vt=l.string().min(1).max(64),Op=l.union([l.string().max(L.maxTextLength),l.number().refine(Number.isFinite),l.boolean(),l.null()]),by=l.array(Op).max(L.maxEventArgItems),uP=l.union([Op,by,l.record(l.string().max(64),l.union([Op,by])).refine(e=>Object.keys(e).length<=16,"too many fields")]),OC=l.object({document:Vt,revision:Mn,callback:l.string().min(1).max(L.maxCallbackIdLength).regex(ba),args:l.array(uP).max(L.maxEventArgs),edit:Mn.optional()}).strict(),cP=l.object({document:Vt,revision:Mn,tree:l.unknown()}).strict(),_y=l.object({document:Vt.optional(),revision:Mn,message:l.string().max(L.maxLabelLength*4),stack:l.string().max(8192).optional()}).strict();function $y(e){let n=cP.safeParse(e);if(!n.success)return{ok:!1,document:null,revision:null,error:"malformed render"};let{document:i,revision:o}=n.data,t=yy(n.data.tree);return t.ok?{...t,document:i,revision:o}:{ok:!1,document:i,revision:o,error:t.error}}var NC=l.object({document:Vt,revision:Mn,accepted:l.boolean(),retryAfterMs:l.number().int().nonnegative().max(6e4).optional()}).strict(),zC=l.object({document:Vt}).strict(),ky=/^[A-Za-z0-9_.:-]{1,128}$/,lP=["plugin","workspace"],Np=l.number().int().min(0).max(1e6),DC=l.object({version:Np,value:l.json()}).strict().refine(e=>JSON.stringify(e.value).length<=la,"persisted value is too large"),xy=l.object({document:Vt,entries:l.array(l.object({scope:l.enum(lP),key:l.string().regex(ky),version:Np,value:l.json()}).strict()).min(1).max(64),hydration:Mn.optional()}).strict(),CC=l.object({document:Vt,entries:l.array(l.object({key:l.string().regex(ky),version:Np,value:l.json().optional()}).strict().refine(e=>JSON.stringify(e.value??null).length<=la,"retained value is too large")).min(1).max(64)}).strict();import{installOrcaDeclarativeRuntime as wP}from"./orca-runtime.mjs";var dP={Stack:"group",Row:"group",Card:"region",Text:"text",Heading:"heading",Button:"button",IconButton:"button",Badge:"status",List:"list",ListItem:"listitem",Input:"textbox",Switch:"switch",Select:"combobox",Separator:"separator",Progress:"progressbar",Spinner:"status",EmptyState:"group",Link:"link",Code:"code",Textarea:"textbox",Checkbox:"checkbox",RadioGroup:"radiogroup",Slider:"slider",Field:"group",Tabs:"tablist",Tab:"tab",Collapsible:"group",Toolbar:"toolbar",Grid:"group",Table:"grid",Tree:"tree",Markdown:"document",CodeView:"code",Image:"img",KeyValue:"list",Callout:"note",Skeleton:"status",RelativeTime:"time",Box:"group",Unsupported:"unsupported"};function Iy(e,n){if(typeof e!="number")return"";let i=Xr.find(o=>o===n)??"short";return uy(e,Date.now(),i,"en")}function pP(e){return typeof e=="object"&&e!==null&&"at"in e?Iy(e.at,"format"in e?e.format:void 0):String(e??"")}var mP=["title","description","content","code","error","alt"];function fP(e){let n=[],i=[e.rows,e.items].flatMap(o=>Array.isArray(o)?o:[]);for(let o=i.shift();o!==void 0;o=i.shift()){if(typeof o!="object"||o===null)continue;let t={...o};typeof t.cells=="object"&&t.cells!==null&&n.push(...Object.values(t.cells).map(pP));for(let r of["label","value"])t[r]!==void 0&&t[r]!==null&&n.push(String(t[r]));Array.isArray(t.children)&&i.push(...t.children)}return n}function Sy(e){if(typeof e=="string")return e;let n=e.props,i=mP.map(o=>n[o]).filter(o=>typeof o=="string");return e.type==="RelativeTime"?Iy(n.at,n.format):e.type==="Tab"?typeof n.label=="string"?n.label:"":[...i,...fP(n),...e.children.map(Sy)].join(" ")}var zp=e=>e.replace(/\s+/g," ").trim();function gP(e){let n=e.props,i=n.label??n.title;return typeof i=="string"?i:void 0}function hP(e,n){let i=e.props,o=e.type==="ListItem"&&i.onPress!==void 0;return{type:e.type,key:e.key?.startsWith("#")?void 0:e.key,role:o?"button":dP[e.type]??"generic",label:gP(e),text:zp(Sy(e)),props:i,disabled:i.disabled===!0,path:n}}function Ta(e){let n=[],i=(o,t)=>{n.push(hP(o,t)),o.children.forEach((r,a)=>{typeof r!="string"&&i(r,`${t}/${r.key??`#${a}`}`)})};return e&&i(e,e.key??"#0"),n}function wy(e,n){return e===void 0?!1:typeof n=="string"?zp(e)===zp(n):n.test(e)}function Py(e,n){return(n.type===void 0||e.type===n.type)&&(n.role===void 0||e.role===n.role)&&(n.text===void 0||wy(e.text,n.text))&&(n.label===void 0||wy(e.label,n.label))&&(n.testId===void 0||e.key===n.testId)}function Ty(e){return e.filter(n=>!e.some(i=>i.path.startsWith(`${n.path}/`)))}function Ey(e){return Object.entries(e).map(([n,i])=>`${n}: ${i instanceof RegExp?String(i):JSON.stringify(i)}`).join(", ")}function Dp(e){if(typeof e=="string")return e;let n={};for(let[i,o]of Object.entries(e.props)){if(i.startsWith("$"))continue;let t=typeof o=="object"&&o!==null&&"$callback"in o;n[i]=t?"[handler]":o}return{type:e.type,...e.key&&!e.key.startsWith("#")?{key:e.key}:{},...Object.keys(n).length>0?{props:n}:{},...e.children.length>0?{children:e.children.map(Dp)}:{}}}var vP={value:"defaultValue",checked:"defaultChecked",open:"defaultOpen",selected:"defaultSelected"};function Cp(e){return typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)&&e.every(n=>typeof n=="string")}function yP(e){switch(e.type){case"Switch":case"Checkbox":case"Collapsible":return!1;case"Slider":return typeof e.props.min=="number"?e.props.min:0;case"Table":return[];default:return""}}function Ay(){let e=new Map;function n(t){let r=hp(t.type);if(!r)throw new Error(`a ${t.type} has no value; expected a form control, Tabs or Table`);return r}function i(t){let r=e.get(t.path);if(r)return r;let{value:a}=n(t),s=t.props[a],u=t.props[vP[a]??""],d={value:Cp(s)?s:Cp(u)?u:yP(t),sent:0};return e.set(t.path,d),d}function o(t,r){let{value:a,change:s}=n(t);if(t.props[a]!==void 0&&t.props[s]===void 0)throw new Error(`the ${t.type} is read-only: it has a ${a} and no ${s}`);let u=i(t);return u.sent+=1,u.value=r,{value:r,id:u.sent}}return{observe(t){let r=new Map;for(let a of t){let s=hp(a.type);if(!s)continue;let u=e.get(a.path)??i(a),c=a.props[s.value],d=a.props[ya];Cp(c)&&(typeof d=="number"?d:0)>=u.sent&&(u.value=c),r.set(a.path,u)}e=r},valueOf:t=>i(t).value,edit:o,typeInto(t,r,a){if(t.type!=="Input"&&t.type!=="Textarea")throw new Error(`type: a ${t.type} takes no text; expected an Input or Textarea`);let s=a?"":String(i(t).value),u=[];a&&u.push(o(t,s));for(let c of r)s+=c,u.push(o(t,s));return u},toggle(t){if(!["Switch","Checkbox","Collapsible"].includes(t.type))throw new Error(`toggle: expected a Switch, Checkbox or Collapsible, not a ${t.type}`);return o(t,!i(t).value)}}}function Oy(e){let n=new Map,i=(s,u)=>{let c=n.get(s)??new Set;return c.add(u),n.set(s,c),{dispose:()=>c.delete(u)}},o=(s,u)=>{for(let c of n.get(s)??[])c(u)},t=s=>u=>typeof u=="object"&&u!==null&&s in u?Object.getOwnPropertyDescriptor(u,s)?.value:void 0,r=()=>{};return{facades:{plugin:{request:(s,u,c)=>{let d=typeof c=="object"&&c!==null&&"timeoutMs"in c?c.timeoutMs:void 0;return e("plugin.request",{name:s,...u===void 0?{}:{input:u},...typeof d=="number"?{timeoutMs:d}:{}}).then(t("output"))},on:(s,u)=>i(`message:${s}`,u)},storage:{get:s=>e("storage.get",{key:s}).then(u=>t("value")(u)??null),set:(s,u)=>e("storage.set",{key:s,value:u}).then(r),delete:s=>e("storage.delete",{key:s}).then(r),keys:async()=>{let s=t("keys")(await e("storage.keys"));return Array.isArray(s)?s.map(String):[]},onDidChange:s=>i("changed:storage",u=>s({key:String(u)}))},settings:{get:async s=>{let u=t("settings")(await e("settings.get"));return s===void 0?u:t(s)(u)},set:(s,u)=>e("settings.set",{key:s,value:u}).then(r),onDidChange:s=>i("changed:settings",u=>s({key:String(u)}))},secrets:{get:async s=>{let u=t("value")(await e("secrets.get",{key:s}));return typeof u=="string"?u:null},set:(s,u)=>e("secrets.set",{key:s,value:u}).then(r),delete:s=>e("secrets.delete",{key:s}).then(r)}},post:(s,u)=>o(`message:${s}`,u),changed:(s,u)=>o(`changed:${s}`,u)}}var Ny=Symbol.for("orca.testing.stored");function zy(e,n){return Object.freeze({[Ny]:!0,version:n,value:e})}function bP(e){return typeof e=="object"&&e!==null&&Ny in e}function Dy(e,n){for(let i of["plugin","workspace"])for(let[o,t]of Object.entries(n?.[i]??{}))e[i].set(o,bP(t)?{version:t.version,value:t.value}:{version:1,value:t})}var _P={sm:360,md:480};function Cy(e,n){let i=e.filter(o=>!o.hideBelow||n>=_P[o.hideBelow]);return i.length>0?i:e.slice(0,1)}var Lp=(e,n)=>e.path.startsWith(`${n.path}/`);function Ea(e,n){return n.filter(i=>i.type==="Tab"&&Lp(i,e)&&!i.path.slice(e.path.length+1).includes("/"))}function jp(e,n,i){let o=Ea(e,n);return o.find(t=>t.props.value===i)??o.find(t=>!t.disabled)}function Ly(e,n){let i=[];for(let o of e)if(!i.some(t=>Lp(o,t))&&(o.type==="Collapsible"&&n(o)!==!0&&i.push(o),o.type==="Tabs")){let t=jp(o,e,n(o));i.push(...Ea(o,e).filter(r=>r!==t))}return e.filter(o=>!i.some(t=>Lp(o,t)))}function jy(e){return typeof e=="object"&&e!==null&&"key"in e&&typeof e.key=="string"}function Up(e){return Array.isArray(e.props.rows)?e.props.rows.filter(jy):[]}function Rp(e){let n=[],i=Array.isArray(e.props.items)?[...e.props.items]:[];for(let o=i.shift();o!==void 0;o=i.shift())if(jy(o)){n.push(o);let t="children"in o?o.children:void 0;Array.isArray(t)&&i.push(...t)}return n}function Ae(e,n,i){if(e.type!==n)throw new Error(`${i}: expected a ${n}, not a ${e.type}`)}function Mp(e,n,i){let o=Up(e).find(t=>t.key===n);if(!o||o.disabled===!0)throw new Error(`${i}: the Table has no enabled row "${n}"`);return o}function Aa(e,n,i){let o=Rp(e).find(t=>t.key===n);if(!o)throw new Error(`${i}: the Tree has no item "${n}"`);return o}function Uy(e){return e.hasChildren===!0||Array.isArray(e.children)&&e.children.length>0}function Ry(e,n){let o=(Array.isArray(e.props.columns)?e.props.columns:[]).find(a=>typeof a=="object"&&a!==null&&"key"in a&&a.key===n);if(!o||typeof o!="object"||!("sortable"in o)||o.sortable!==!0)throw new Error(`sort: the Table has no sortable column "${n}"`);let t=e.props.sort,r=typeof t=="object"&&t!==null&&"column"in t&&t.column===n&&"direction"in t&&t.direction==="asc";return{column:n,direction:r?"desc":"asc"}}function $P(e,n){return e.type==="Tabs"?Ea(e,n).map(o=>({value:o.props.value,disabled:o.disabled})):(Array.isArray(e.props.options)?e.props.options:[]).map(o=>typeof o=="object"&&o!==null&&"value"in o?{value:o.value,disabled:"disabled"in o&&o.disabled===!0}:{value:void 0,disabled:!0})}function My({host:e,controls:n,resolve:i,elements:o,dispatch:t,settled:r}){let a=new Map,s=d=>{let p=a.get(d.path);if(!p){let m=d.props.expanded??d.props.defaultExpanded;p=new Set(Array.isArray(m)?m.filter(f=>typeof f=="string"):[]),a.set(d.path,p)}return p},u=async(d,p,m,f)=>{let g=n.edit(d,m);t(p,[f],g.id),await r()},c=async(d,p,m,f)=>{let g=i(d,f);if(Ae(g,"Tree",f),!Uy(Aa(g,p,f)))throw new Error(`${f}: the Tree item "${p}" has no children`);let y=s(g);y.has(p)!==m&&(m?y.add(p):y.delete(p),t(g.props.onToggle,[{key:p,expanded:m}]),await r())};return{async press(d){let p=i(d,"press"),{href:m,onPress:f}=p.props;if(p.type==="Link"&&typeof m=="string")e.grantGesture(),e.bridge.call("shell.openExternal",{url:m}).catch(()=>{});else{if(f===void 0)throw new Error(`press: the ${p.type} has no onPress`);e.grantGesture()}t(f,[]),await r()},async type(d,p,m={}){let f=i(d,"type");for(let g of n.typeInto(f,p,m.replace===!0))t(f.props.onChange,[g.value],g.id),await r();m.submit&&(t(f.props.onSubmit,[n.valueOf(f)]),await r())},async submit(d){let p=i(d,"submit");t(p.props.onSubmit,[n.valueOf(p)]),await r()},async toggle(d){let p=i(d,"toggle"),m=n.toggle(p);t(p.props.onChange,[m.value],m.id),await r()},async select(d,p){let m=i(d,"select");if(!["Select","RadioGroup","Tabs"].includes(m.type))throw new Error(`select: expected a Select, RadioGroup or Tabs, not a ${m.type}`);let f=$P(m,o()).find(g=>g.value===p);if(!f||f.disabled)throw new Error(`select: the ${m.type} has no enabled option "${p}"`);await u(m,m.props.onChange,p,p)},async slide(d,p){let m=i(d,"slide");Ae(m,"Slider","slide");let f=typeof m.props.min=="number"?m.props.min:0,g=typeof m.props.max=="number"?m.props.max:100;if(!Number.isFinite(p)||pg)throw new Error(`slide: ${p} is outside the Slider's ${f} to ${g}`);await u(m,m.props.onChange,p,p)},async sort(d,p){let m=i(d,"sort");if(Ae(m,"Table","sort"),m.props.onSortChange===void 0)throw new Error("sort: the Table has no onSortChange");t(m.props.onSortChange,[Ry(m,p)]),await r()},async selectRows(d,p){let m=i(d,"selectRows");Ae(m,"Table","selectRows");let f=m.props.selectionMode??"none";if(f==="none"||f==="single"&&p.length>1)throw new Error(`selectRows: the Table's selectionMode is ${String(f)}`);p.forEach(g=>Mp(m,g,"selectRows")),await u(m,m.props.onSelectionChange,[...p],{keys:[...p]})},async activateRow(d,p){let m=i(d,"activateRow");if(Ae(m,"Table","activateRow"),Mp(m,p,"activateRow"),m.props.onRowAction===void 0)throw new Error("activateRow: the Table has no onRowAction");t(m.props.onRowAction,[{key:p}]),await r()},async loadMore(d){let p=i(d,"loadMore");if(Ae(p,"Table","loadMore"),p.props.hasMore!==!0||p.props.onLoadMore===void 0)throw new Error("loadMore: the Table has no more rows (hasMore and onLoadMore)");t(p.props.onLoadMore,[]),await r()},expand:(d,p)=>c(d,p,!0,"expand"),collapse:(d,p)=>c(d,p,!1,"collapse"),async selectItem(d,p){let m=i(d,"selectItem");if(Ae(m,"Tree","selectItem"),Aa(m,p,"selectItem").disabled===!0)throw new Error(`selectItem: the Tree item "${p}" is disabled`);await u(m,m.props.onSelect,p,{key:p})},async activateItem(d,p){let m=i(d,"activateItem");if(Ae(m,"Tree","activateItem"),Aa(m,p,"activateItem").disabled===!0||!m.props.onAction)throw new Error(`activateItem: the Tree item "${p}" cannot be activated`);t(m.props.onAction,[{key:p}]),await r()},expandedOf:d=>{let p=i(d,"expandedOf");return Ae(p,"Tree","expandedOf"),Rp(p).map(m=>m.key).filter(m=>s(p).has(m))},columnsOf:(d,p={})=>{let m=i(d,"columnsOf");Ae(m,"Table","columnsOf");let g=(Array.isArray(m.props.columns)?m.props.columns:[]).flatMap(y=>{if(typeof y!="object"||y===null||!("key"in y))return[];let x="hideBelow"in y?y.hideBelow:void 0;return typeof y.key=="string"?[{key:y.key,hideBelow:x==="sm"||x==="md"?x:void 0}]:[]});return Cy(g,p.width??Number.POSITIVE_INFINITY).map(y=>y.key)},rowsOf:d=>{let p=i(d,"rowsOf");return Ae(p,"Table","rowsOf"),Up(p).map(m=>m.key)}}}var Me=e=>{let n=(e??"").replace(/\s+/g," ").trim();return JSON.stringify(n.length>60?`${n.slice(0,59)}…`:n)},kP=e=>e==="danger"||e==="warning",Zy=e=>Array.isArray(e)?e.length:0;function xP(e,n){let{props:i}=e;switch(e.type){case"Heading":return`Heading ${Me(e.text)}`;case"Callout":return`Callout ${String(i.tone??"neutral")} ${Me(e.label??e.text)}`;case"EmptyState":return`EmptyState ${Me(e.label)}`;case"Table":return`Table ${Me(e.label)}: ${Zy(i.rows)} row(s)${i.hasMore===!0?", more":""}`;case"Tree":return`Tree ${Me(e.label)}: ${Zy(i.items)} top-level item(s)`;case"Tabs":return`Tabs ${Me(e.label)}: ${Me(n.get(e.path))} selected`;case"Skeleton":case"Spinner":return`${e.type} ${Me(e.label??"Loading")}`;case"Text":return i.tone==="danger"||i.tone==="warning"?`Text ${String(i.tone)} ${Me(e.text)}`:null;case"Box":{let o=[i.background,i.border].find(kP);return o?`Box ${o} ${Me(e.text)}`:null}default:return null}}function Fy(e,n){let i=[];for(let o of e){if(o.type==="List"){let r=e.filter(a=>a.type==="ListItem"&&a.path.startsWith(`${o.path}/`)).length;i.push(`List ${Me(o.label)}: ${r} item(s)`);continue}let t=xP(o,n);t&&i.push(t)}return i.length>12?[...i.slice(0,12),`… ${i.length-12} more`]:i}function Vy(e){return"path"in e}var IP=100,SP=()=>new Promise(e=>typeof setImmediate=="function"?setImmediate(e):setTimeout(e,0));async function Gy(e,n){let i=n.host,o=new Map,t=(w,O)=>{for(let E of o.get(w)??[])E(O)},r=[],a=[],s=[],u={plugin:new Map,workspace:new Map};Dy(u,n.persisted);let c=n.visible??!0,d={document:"",revision:0,tree:null},p=Ay(),m=Oy(i.bridge.call),f=i.onDataChange(m.changed);function g(w,O){if(w===Be.ready)t(Be.hydrate,{panel:{id:n.panelId??"panel"},visible:c,plugin:Object.fromEntries(u.plugin),workspace:Object.fromEntries(u.workspace)});else if(w===Be.render){let E=$y(O);if(!E.ok){a.push({kind:"refused",message:E.error}),E.document!==null&&E.revision!==null&&t(Be.ack,{document:E.document,revision:E.revision,accepted:!1});return}s.push(...E.warnings.filter(B=>!s.includes(B))),d={document:E.document,revision:E.revision,tree:E.tree},p.observe(Ta(E.tree)),t(Be.ack,{document:E.document,revision:E.revision,accepted:!0})}else if(w===Be.error){let E=_y.safeParse(O);a.push(E.success?{kind:"plugin",message:E.data.message,...E.data.stack?{stack:E.data.stack}:{}}:{kind:"plugin",message:String(O)})}else if(w===Be.persist){let E=xy.safeParse(O);if(!E.success){a.push({kind:"refused",message:"persisted state Orca would not store"});return}for(let B of E.data.entries)u[B.scope].set(B.key,{version:B.version,value:B.value})}}let y=wP({post:g,awaitHydration:!0,colorScheme:n.theme??"dark",schedule:w=>r.push(w),bridge:{api:i.bridge.api,locale:n.locale??"en",host:{call:i.bridge.call,has:i.bridge.has},...m.facades,on(w,O){let E=o.get(w)??new Set;return E.add(O),o.set(w,E),{dispose:()=>E.delete(O)}}}});async function x(){for(let w=0;wLy(Ta(d.tree),w=>p.valueOf(w)),b=w=>Ty(I().filter(O=>Py(O,w)));function T(w,O){let E=Vy(w)?I().find(B=>B.path===w.path):b(w)[0];if(!E)throw new Error(Vy(w)?`${O}: the element is no longer in the panel`:`${O}: nothing in the panel matches { ${Ey(w)} }`);if(E.disabled)throw new Error(`${O}: the ${E.type} is disabled`);return E}function A(w,O,E){let B=typeof w=="object"&&w!==null&&"$callback"in w?w.$callback:null;typeof B=="string"&&t(Be.event,{document:d.document,revision:d.revision,callback:B,args:O,...E===void 0?{}:{edit:E}})}await Promise.resolve(typeof e=="function"?{default:e}:e).then(w=>y.boot(w)).catch(w=>a.push({kind:"plugin",message:w instanceof Error?w.message:String(w),...w instanceof Error&&w.stack?{stack:w.stack}:{}})),await x();let D=My({host:i,controls:p,resolve:T,elements:I,dispatch:A,settled:x});return{host:i,errors:a,warnings:s,get refusals(){return i.refusals},find:w=>b(w)[0]??null,findAll:b,tree:()=>d.tree?Dp(d.tree):null,drawnTree:()=>d.tree,summary:()=>{let w=Ta(d.tree),O=I(),E=new Map(O.filter(B=>B.type==="Tabs").map(B=>[B.path,jp(B,w,p.valueOf(B))?.label??""]));return Fy(O,E)},get persisted(){let w=O=>Object.fromEntries([...u[O]].map(([E,B])=>[E,B.value]));return{plugin:w("plugin"),workspace:w("workspace"),storage:i.data().storage}},settled:x,...D,valueOf:w=>p.valueOf(T(w,"valueOf")),async emit(w,O){t(w,O),await x()},async post(w,O){m.post(w,O),await x()},async setVisible(w){c=w,t(Be.visibility,{visible:w}),await x()},async rerender(){y.rerender(),await x()},async unmount(){y.dispose(),o.clear(),f()}}}var By={workspaceId:l.string().min(1).max(2048),kind:l.enum(["worktree","folder"])},PP=l.object({...By,path:l.string().min(1).max(32*1024),branch:l.string().max(1024)}),TP=l.object({...By,path:l.string().min(1).max(32*1024)}),EP=l.object({workspaceId:l.string().min(1).max(2048).nullable(),paneKey:l.string().min(1).max(2048),terminalId:l.string().min(1).max(nt).optional(),title:l.string().max(Kr).optional(),state:l.enum(Cn),receivedAt:l.number().finite().positive(),mainAgent:l.object({state:l.enum(Cn),outcome:l.enum(Uv).optional(),stateStartedAt:l.number().finite()}).optional()}),AP=l.object({context:xp}),Zp={"workspace.created":PP,"workspace.removed":TP,"agent.status.changed":EP,"workspace.changed":AP,"editor.typography.changed":gp};var Yr=["terminal.send","workspace.create.before","workspace.create.after","agent.launch.before","agent.prompt.before","agent.tool.before","agent.tool.after","editor.save.before"],y0=Yr.length,OP={"terminal.send":Le,"workspace.create.before":Le,"workspace.create.after":Le,"agent.launch.before":Le,"agent.prompt.before":Le,"agent.tool.before":Le,"agent.tool.after":Le,"editor.save.before":Le};function Oa(e){return Yr.some(n=>n===e)}var b0=l.object({event:l.enum(Yr).meta({...ee("Hook the worker handles with `orca.hooks.on`.",Le),[Nn]:OP}),onError:l.enum(["pass","deny"]).optional().meta(ee("What Orca does when this plugin's hook throws, times out, crashes or does not start: `pass` (the default) carries on as if it passed; `deny` refuses the action, naming the plugin, so a guard fails closed. Ignored for hooks that only observe.",Le))}).strict().meta({id:"HookContribution",description:"A hook Orca runs through the worker before (or after) it acts. Requires `main` and the `trusted-worker` execution profile."});var k0=1024*1024,x0=new TextEncoder,w0=new Uint8Array(0);var O0=16*1024*1024,N0=16*1024*1024;var zP=256*1024;var U0=16*1024,Qr=16*1024*1024;var bt=2e3,Zn=l.strictObject({deny:l.string().min(1).max(500)}),DP=l.object({terminalId:l.string().min(1).max(nt),text:l.string().max(Qr),enter:l.boolean(),inputKind:l.enum(["driving","orchestration","launch"])}),CP=l.object({kind:l.enum(["worktree","folder"]),projectId:l.string().min(1).max(2048),name:l.string().min(1).max(1024),branch:l.string().min(1).max(1024).optional(),base:l.string().min(1).max(1024).optional()}),LP=l.object({workspaceId:l.string().min(1).max(2048),kind:l.enum(["worktree","folder"]),path:l.string().min(1).max(32*1024),branch:l.string().max(1024)}),jP=l.record(l.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(256).refine(e=>!e.toUpperCase().startsWith("ORCA_"),"ORCA_* variables are reserved"),l.string().max(32*1024)).refine(e=>Object.keys(e).length<=64,"at most 64 variables"),UP=l.enum(["worktree","folder"]),RP=l.object({agent:l.string().min(1).max(64),workspaceId:l.string().min(1).max(2048).nullable(),workspaceKind:UP.nullable(),terminalId:l.string().min(1).max(nt).optional(),command:l.string().min(1).max(Qr),env:jP}),MP=l.object({agent:l.string().min(1).max(64).nullable(),terminalId:l.string().min(1).max(nt),prompt:l.string().max(Qr),inputKind:l.enum(["driving","orchestration","launch"])}),Hy={agent:l.string().min(1).max(64),workspaceId:l.string().min(1).max(2048).nullable(),terminalId:l.string().min(1).max(nt).optional(),tool:l.string().min(1).max(256),input:l.unknown(),callId:l.string().min(1).max(256).optional()},ZP=l.object(Hy),FP=l.object({...Hy,output:l.unknown().optional()}),VP=l.object({workspaceId:l.string().min(1).max(2048).nullable(),path:l.string().min(1).max(32*1024),languageId:l.string().min(1).max(128).optional(),text:l.string().max(Qr)}),ei={"terminal.send":{payload:DP,result:Zn,mutable:["text","enter"],deadlineMs:bt,summary:"Text Orca, the CLI or a plugin is about to send to a terminal. A person typing (on the desktop, a phone or a paired client) is never hooked, and prompts Orca submits to an agent take `agent.prompt.before` instead. Writes to one terminal stay in order while a hook decides. Rewrite `text` or `enter` with `next`, or return `{ deny }` to refuse the send."},"workspace.create.before":{payload:CP,result:Zn,mutable:["name","branch","base"],deadlineMs:bt,summary:"A worktree or folder workspace is about to be created. Change `name`, `branch` or `base` with `next`, or return `{ deny }` to refuse it."},"workspace.create.after":{payload:LP,result:null,mutable:[],deadlineMs:bt,summary:"A worktree or folder workspace was created. Observe only: Orca does not wait for it, and results are ignored."},"agent.launch.before":{payload:RP,result:Zn,mutable:["command","env"],deadlineMs:bt,summary:"Orca is about to start an agent CLI in a terminal, from any launcher (new tab, workspace create, CLI, automation, orchestration). Change `command` or add `env` with `next`, or return `{ deny }` to refuse the launch. Restores of saved sessions are not hooked."},"agent.prompt.before":{payload:MP,result:Zn,mutable:["prompt"],deadlineMs:bt,summary:"Orca is about to submit a prompt to an agent in a terminal: a launch prompt, an orchestration dispatch, an issue or task prompt, or `orca terminal send` to an agent. A prompt a person submits is never hooked, and writes to one terminal stay in order while it decides. Rewrite `prompt` with `next`, or return `{ deny }` to refuse it."},"agent.tool.before":{payload:ZP,result:Zn,mutable:["input"],deadlineMs:bt,summary:"An agent in an Orca terminal is about to run a tool. Claude Code waits for the answer: return `{ deny }` to refuse the call (the agent sees the reason) or change `input` with `next`; the person is still asked as usual. Other agents only report the call, so their results are ignored. Agents on SSH or WSL hosts are not hooked yet."},"agent.tool.after":{payload:FP,result:null,mutable:[],deadlineMs:bt,summary:"An agent in an Orca terminal finished a tool call (successfully or not). Observe only: Orca does not wait for it."},"editor.save.before":{payload:VP,result:Zn,mutable:["text"],deadlineMs:bt,summary:"The person is about to save a text file from an Orca editor tab (an explicit save, not autosave). Change `text` with `next` (format on save) or return `{ deny }` to refuse the save, which shows your reason. Edits made while the hook ran stay unsaved."}};var Na=class{constructor(n){this.event=n}event},H0=l.object({event:l.enum(Yr),payload:l.unknown()}),Wy=l.discriminatedUnion("decision",[l.object({decision:l.literal("continue"),payload:l.unknown()}),l.object({decision:l.literal("result"),result:l.unknown()})]);async function Ky(e,n){let i=n;for(let o of e){let r=await o(i,a=>new Na(a??i));if(r instanceof Na)i=r.event;else if(r!=null)return{decision:"result",result:r}}return{decision:"continue",payload:i}}function GP(e){return e instanceof Error?e.message:String(e)}function Jy(e,n,i="timed out"){let o,t=new Promise((r,a)=>{o=setTimeout(()=>a(new Error(`${i} after ${n}ms`)),n)});return Promise.race([e,t]).finally(()=>clearTimeout(o))}function BP(e,n,i){let o=ei[e];if(!Re(n)||!Re(i))return{ok:!1,reason:"next() was given something other than the event object"};let t={...n};for(let a of o.mutable)Object.hasOwn(i,a)&&(t[a]=i[a]);let r=o.payload.safeParse(t);return r.success?{ok:!0,payload:r.data}:{ok:!1,reason:r.error.issues[0]?.message??"invalid change"}}var Fp=class extends Error{};async function Xy(e){let{event:n}=e,i=ei[n],o=e.deadlineMs??i.deadlineMs,t=e.payload;for(let r of e.participants){let a=e.now(),s=()=>Math.round(e.now()-a),u=i.result!==null&&e.failsClosed?.(r)===!0,c=(f,g=!1)=>u&&!g?(e.log(r,`hook ${n} denied after ${s()}ms (onError: deny): ${f}`),{kind:"deny",pluginKey:r,reason:`${r} failed and denies on error: ${f}`}):(e.log(r,`hook ${n} skipped after ${s()}ms: ${f}`),null),d;try{if(e.start){let f=e.startTimeoutMs??o;await Jy(e.start(r),f,"worker did not start")}d=await Jy(e.invoke(r,t,o),o)}catch(f){let g=c(GP(f),f instanceof Fp);if(g)return g;continue}let p=Wy.safeParse(d);if(!p.success){let f=c("the worker answered with something other than a hook decision");if(f)return f;continue}if(p.data.decision==="continue"){let f=BP(n,t,p.data.payload);f.ok?t=f.payload:e.log(r,`hook ${n}: change ignored: ${f.reason}`);continue}if(i.result===null)continue;let m=i.result.safeParse(p.data.result);if(!m.success){if(u){let f=c(`malformed result: ${m.error.issues[0]?.message??"invalid"}`);if(f)return f}e.log(r,`hook ${n}: result ignored: return next(event) or { deny: reason }`);continue}return{kind:"deny",pluginKey:r,reason:m.data.deny}}return{kind:"continue",payload:t}}function HP(e){return typeof e!="object"||e===null||!("workspaceId"in e)||"worktreeId"in e?e:{...e,worktreeId:e.workspaceId}}function ti(e,n){return typeof e=="object"&&e!==null&&n in e?Object.getOwnPropertyDescriptor(e,n)?.value:void 0}function za(e,n){return e.add(n),{dispose:()=>{e.delete(n)}}}var WP=new Set(Jr("worker"));function qy(){return{commands:new Map,events:new Map,hooks:new Map,panelRequests:new Map,dataListeners:{storage:new Set,settings:new Set}}}function Yy(e){let{tables:n,hostCall:i}=e,o=async(t,r)=>{await i(t,r)};return Object.freeze({api:Object.freeze({major:Ue,minor:ty}),commands:Object.freeze({register(t,r){return n.commands.set(t,r),{dispose:()=>{n.commands.delete(t)}}}}),events:Object.freeze({on(t,r){let a=ha.get(t)??t,s=n.events.get(a)??new Set;n.events.set(a,s);let u=a!==t||t==="agent.status.changed",c=za(s,p=>r(u?HP(p):p));if(t!=="workspace.changed")return c;let d=!0;return i("workspace.readContext").then(p=>d&&r({context:p})).catch(()=>{}),{dispose:()=>{d=!1,c.dispose()}}}}),hooks:Object.freeze({on(t,r){if(!Oa(t))throw new TypeError(`orca.hooks.on: unknown hook ${String(t)}`);if(typeof r!="function")throw new TypeError("orca.hooks.on needs a handler function");let a=n.hooks.get(t)??new Set;return n.hooks.set(t,a),za(a,r)}}),host:Object.freeze({call:(t,r,a)=>i(t,r,a),has:t=>WP.has(t)}),panels:Object.freeze({handle(t,r){if(vt.parse(t),typeof r!="function")throw new TypeError("orca.panels.handle needs a handler function");return n.panelRequests.set(t,r),{dispose:()=>{n.panelRequests.get(t)===r&&n.panelRequests.delete(t)}}},post(t,r,a){vt.parse(t),e.postToPanels({event:t,payload:r,...a?.panel?{panel:a.panel}:{}})}}),storage:Object.freeze({get:async t=>ti(await i("storage.get",{key:t}),"value")??null,set:(t,r)=>o("storage.set",{key:t,value:r}),delete:t=>o("storage.delete",{key:t}),keys:async()=>{let t=ti(await i("storage.keys"),"keys");return Array.isArray(t)?t.filter(r=>typeof r=="string"):[]},onDidChange:t=>za(n.dataListeners.storage,t)}),settings:Object.freeze({get:async t=>{let r=ti(await i("settings.get"),"settings"),a=typeof r=="object"&&r!==null?{...r}:{};return t===void 0?a:ti(a,t)},set:(t,r)=>o("settings.set",{key:t,value:r}),onDidChange:t=>za(n.dataListeners.settings,t)}),secrets:Object.freeze({get:async t=>{let r=ti(await i("secrets.get",{key:t}),"value");return typeof r=="string"?r:null},set:(t,r)=>o("secrets.set",{key:t,value:r}),delete:t=>o("secrets.delete",{key:t})}),grantedCapabilities:Object.freeze([...e.grantedCapabilities]),log:t=>e.log(String(t))})}var Qy={id:"test-panel",surface:"panel",contributionId:"panel"};function KP(e){return Object.hasOwn(Zp,e)}function JP(e){return e instanceof Error?e.message:String(e)}async function eb(e,n){let{host:i}=n,o=new Set(n.events),t=n.hooks.map(b=>typeof b=="string"?{event:b}:b),r=new Set(t.map(b=>b.event)),a=new Set(t.filter(b=>b.onError==="deny").map(b=>b.event)),s=qy(),u=[],c=[],d=!0,p=e.default;if(typeof p!="function")throw new TypeError(typeof e.activate=="function"?"mountWorker: the module exports activate by name, but Orca calls the default export: write `export default function activate(orca)`":"mountWorker: the module has no default-exported activate(orca) function");let m=e.deactivate;if(m!==void 0&&typeof m!="function")throw new TypeError("mountWorker: the module exports a deactivate that is not a function");let f=Yy({tables:s,hostCall:(b,T)=>i.worker.call(b,T),postToPanels:b=>{c.push(b)},log:b=>{u.push(b)},grantedCapabilities:i.capabilities}),g=i.onDataChange((b,T)=>{for(let A of s.dataListeners[b])A({key:T})});await p(f);let y=n.commands?[...s.commands.keys()].find(b=>!n.commands?.includes(b)):void 0;if(y!==void 0)throw new Error(`registered undeclared command ${y}: list it in contributes.commands`);async function x(b,T,A){let D=s.panelRequests.get(b);if(!D)throw He("unknown_method",`no panel handler named ${b}`);let w={...Qy,contributionId:A??Qy.contributionId};return D(T,{panel:w,signal:new AbortController().signal})}let I=i.routeRequests((b,T)=>x(b,T));return{host:i,logs:u,posts:c,get refusals(){return i.refusals},async emit(b,T){if(!KP(b))throw new Error(`emit: "${b}" is not an event Orca sends to workers`);if(!o.has(b))throw new Error(`emit: "${b}" never arrives: it is not in contributes.events`);let A=Zp[b].safeParse(T);if(!A.success)throw new TypeError(`emit: that ${b} payload is not one Orca sends: ${A.error.issues[0]?.message??""}`);let D=s.events.get(ha.get(b)??b)??[];await Promise.all([...D].map(async w=>w(A.data))),await i.idle()},hooks:{async fire(b,T){if(!Oa(b))throw new Error(`hooks.fire: "${b}" is not a hook Orca runs`);if(!r.has(b))throw new Error(`hooks.fire: "${b}" never runs: it is not in contributes.hooks`);let A=ei[b].payload.safeParse(T);if(!A.success)throw new TypeError(`hooks.fire: that ${b} event is not one Orca sends: ${A.error.issues[0]?.message??""}`);let D=await Xy({event:b,payload:A.data,participants:["worker"],invoke:(w,O)=>Ky(s.hooks.get(b)??[],O),log:(w,O)=>{u.push(O)},now:()=>performance.now(),failsClosed:()=>a.has(b)});return await i.idle(),D.kind==="deny"?{kind:"deny",reason:D.reason}:{kind:"continue",event:D.payload}}},async command(b,T){let A=s.commands.get(b);if(!A)throw new Error(`command: the worker registered no "${b}"`);let D=await A(T,{signal:new AbortController().signal});return await i.idle(),D},async request(b,T,A={}){let D=await x(b,T,A.panel);return await i.idle(),D},async deactivate(){if(d){d=!1,g(),I(),s.events.clear(),s.hooks.clear(),s.commands.clear(),s.panelRequests.clear();try{await(typeof m=="function"?m():void 0)}catch(b){throw new Error(`deactivate threw: ${JP(b)}`,{cause:b})}await i.idle()}}}}import{test as dj,describe as pj,beforeEach as mj,afterEach as fj}from"node:test";import{default as hj}from"node:assert/strict";import{runInThisContext as rT}from"node:vm";function tb(e){if(typeof e!="object"||e===null||!("on"in e)||!("document"in e))return!1;let n=e.document;return typeof e.on=="function"&&typeof n=="object"&&n!==null&&"session"in n&&typeof n.session=="function"&&"applyEdit"in n&&typeof n.applyEdit=="function"}var We=1;var Gp=["invalid_request","invalid_params","unknown_method","capability_denied","consent_required","not_permitted","rate_limited","unavailable","action_failed","cancelled","timeout","conflict","too_large"],XP=new Set(["rate_limited","unavailable","timeout","conflict"]);function qP(e){return Gp.find(n=>n===e)??"action_failed"}function _t(e,n,i){let o=qP(e);return{code:o,message:n.slice(0,8192),retryable:XP.has(o),...i===void 0?{}:{retryAfterMs:i}}}var Vp=l.number().int().nonnegative(),nb=l.string().min(1).max(128),YP=l.object({code:l.string().max(64),message:l.string().max(8192),retryable:l.boolean(),retryAfterMs:l.number().int().nonnegative().optional()}),hL=l.discriminatedUnion("kind",[l.object({orca:l.literal(We),kind:l.literal("req"),id:Vp,method:nb,params:l.unknown().optional()}),l.object({orca:l.literal(We),kind:l.literal("res"),id:Vp,result:l.unknown().optional(),error:YP.optional()}),l.object({orca:l.literal(We),kind:l.literal("evt"),event:nb,payload:l.unknown().optional()}),l.object({orca:l.literal(We),kind:l.literal("cancel"),id:Vp})]);var Gt={ready:"ready",hello:"hello",theme:"theme",ping:"ping",pong:"pong",editorKeydown:"editor.keydown",editorDocument:"editor.document",editorSubscribed:"editor.subscribed",editorMerges:"editor.merges",push:"plugin.push"},Fn={applyEdit:"editor.applyEdit",flush:"editor.flush"},rb=64*1024;var QP=l.string().min(32).max(128),$L=l.object({sessionToken:QP,action:l.string().min(1),params:l.unknown().optional()}).strict();var Bp=64*1024*1024,PL=16*1024*1024;var Hp=1e3,eT=l.strictObject({baseVersion:l.number().int().nonnegative(),content:l.discriminatedUnion("kind",[l.strictObject({kind:l.literal("text"),text:l.string()}),l.strictObject({kind:l.literal("bytes"),bytes:l.instanceof(ArrayBuffer)})])});function ib(e){let n=eT.safeParse(e);return n.success?n.data:null}var Wp=_t("conflict","The file changed outside this editor; edit the latest document."),ob=_t("too_large","The edit is larger than Orca accepts; the file keeps its last accepted edit.");var ab="__orcaPluginFrameTransport",sb="__orcaDeclarativePost";var ub=` - var domainEvents = ${JSON.stringify(ht)} +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(n===a[0]){r(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(n!==a[0]&&l){r(a);continue}}if(e.metadataRegistry.get(a[0])?.id){r(a);continue}if(s.cycle){r(a);continue}s.count>1&&e.reused==="ref"&&r(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Sg(e){let n=e.anyOf;if(!Array.isArray(n)||n.length===0||e.type!==void 0)return;let o=[];for(let i of n){if(!i||typeof i!="object")return;Sg(i);let t=Object.keys(i);if(t.length!==1||t[0]!=="type")return;let r=i.type;for(let a of Array.isArray(r)?r:[r]){if(typeof a!="string")return;o.includes(a)||o.push(a)}}delete e.anyOf,e.type=o.length===1?o[0]:o}var Pg=new Set(["type","properties","required","additionalProperties"]),Ig=["oneOf","anyOf"];function wg(e){let n=e.additionalProperties;return n===void 0||n===!1||typeof n!="object"||n===null?null:Object.keys(n).length?n:null}function Sl(e){let n=[];for(let r of e){if(typeof r!="object"||r.type!=="object")return null;for(let a in r)if(!Pg.has(a))return null;n.push(r)}let o={},i=new Set;for(let r of n){for(let a in r.properties){if(Object.prototype.hasOwnProperty.call(o,a))continue;let s=[];for(let l of n){let d=l.properties?.[a]??wg(l);d!=null&&(s.some(p=>JSON.stringify(p)===JSON.stringify(d))||s.push(d))}let c=s.length===1?s[0]:Sl(s)??{allOf:s};ue(o,a,c)}for(let a of r.required??[])i.add(a)}let t={type:"object",properties:o};if(i.size&&(t.required=[...i]),n.every(r=>r.additionalProperties===!1))t.additionalProperties=!1;else{let r=[];for(let a of n){let s=wg(a);s&&!r.some(c=>JSON.stringify(c)===JSON.stringify(s))&&r.push(s)}r.length===1?t.additionalProperties=r[0]:r.length>1&&(t.additionalProperties={allOf:r})}return t}function _I(e){let n=e.allOf;if(!Array.isArray(n)||n.length<2)return;for(let t of Pg)if(t in e)return;let o=n.filter(t=>Ig.some(r=>Array.isArray(t[r]))),i=null;if(!o.length)i=Sl(n);else{let t=o[0],r=Ig.find(c=>Array.isArray(t[c]));if(Object.keys(t).length!==1)return;let a=n.filter(c=>c!==t),s=t[r].map(c=>Sl([...a,c]));if(s.some(c=>!c))return;i={[r]:s}}i&&(delete e.allOf,Lr(e,i))}function mt(e,n){let o=e.seen.get(n);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=s=>{let c=e.seen.get(s);if(c.ref===null)return;let l=c.def??c.schema,d={...l},p=c.ref;if(c.ref=null,p){i(p);let f=e.seen.get(p),g=f.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(g)):Lr(l,g),Lr(l,d),s._zod.parent===p)for(let x in l)x==="$ref"||x==="allOf"||x in d||delete l[x];if(g.$ref&&f.def)for(let x in l)x==="$ref"||x==="allOf"||x in f.def&&JSON.stringify(l[x])===JSON.stringify(f.def[x])&&delete l[x]}let m=s._zod.parent;if(m&&m!==p){i(m);let f=e.seen.get(m);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let g in l)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(l[g])===JSON.stringify(f.def[g])&&delete l[g]}e.override({zodSchema:s,jsonSchema:l,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let s of[...e.seen.entries()].reverse())i(s[0]);if(e.target!=="openapi-3.0")for(let s of e.seen.entries())Sg(s[1].def??s[1].schema);for(let s of e.deferred)s();if(e.intersections.length){let s=new Map;for(let c of e.seen.values())for(let l of[c.schema,c.def]){let d=l?.allOf;if(!Array.isArray(d))continue;let p=s.get(d);p?p.push(l):s.set(d,[l])}for(let c of e.intersections)for(let l of s.get(c)??[])_I(l)}}let t={};if(e.target==="draft-2020-12"?t.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?t.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?t.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(n)?.id;if(!s)throw new Error("Schema is missing an `id` property");t.$id=e.external.uri(s)}Lr(t,o.defId?o.schema:o.def??o.schema);let r=e.metadataRegistry.get(n)?.id;r!==void 0&&t.id===r&&delete t.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let s of e.seen.entries()){let c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,ue(a,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?t.$defs=a:t.definitions=a);try{let s=JSON.parse(JSON.stringify(t));return Object.defineProperty(s,"~standard",{value:{...n["~standard"],jsonSchema:{input:Pn(n,"input",e.processors),output:Pn(n,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function ge(e,n){let o=n??{seen:new Set};if(o.seen.has(e))return!1;o.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return ge(i.element,o);if(i.type==="set")return ge(i.valueType,o);if(i.type==="lazy")return ge(i.getter(),o);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault"||i.type==="catch")return ge(i.innerType,o);if(i.type==="intersection")return ge(i.left,o)||ge(i.right,o);if(i.type==="record"||i.type==="map")return ge(i.keyType,o)||ge(i.valueType,o);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ge(i.in,o)||ge(i.out,o);if(i.type==="object"){for(let t in i.shape)if(ge(i.shape[t],o))return!0;return!1}if(i.type==="union"){for(let t of i.options)if(ge(t,o))return!0;return!1}if(i.type==="tuple"){for(let t of i.items)if(ge(t,o))return!0;return!!(i.rest&&ge(i.rest,o))}return!1}var Pl=(e,n={})=>o=>{let i=dt({...o,processors:n});return X(e,i),pt(i,e),mt(i,e)},Pn=(e,n,o={})=>i=>{let{libraryOptions:t,target:r}=i??{},a=dt({...t??{},target:r,io:n,processors:o});return X(e,a),pt(a,e),mt(a,e)};var Tn=(e,n,o)=>{(e[n]===void 0||o>e[n])&&(e[n]=o)},En=(e,n,o)=>{(e[n]===void 0||o{Tn(e,"minimum",n),En(e,"maximum",n)},Ng=(e,n)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(n)||e.multipleOf.push(n)},zg=(e,n)=>{e.patterns??(e.patterns=new Set),e.patterns.add(n)},Cg=(e,n)=>{e.mime=e.mime?e.mime.filter(o=>n.includes(o)):[...n]},Dg=(e,n)=>{e.format=n,n.includes("int")&&(e.isInt=!0)},Eg=(e,n)=>Tn(e,"minimum",n.minimum),Ag=(e,n)=>En(e,"maximum",n.maximum),Og=e=>(n,o)=>{Dg(n,o.format);let[i,t]=e[o.format];Tn(n,"minimum",i),En(n,"maximum",t)},$I={greater_than:(e,n)=>Tn(e,n.inclusive?"minimum":"exclusiveMinimum",n.value),less_than:(e,n)=>En(e,n.inclusive?"maximum":"exclusiveMaximum",n.value),multiple_of:(e,n)=>Ng(e,n.value),number_format:Og(rr),bigint_format:Og(or),min_length:Eg,max_length:Ag,length_equals:(e,n)=>Tg(e,n.length),min_size:Eg,max_size:Ag,size_equals:(e,n)=>Tg(e,n.size),string_format:(e,n)=>{Dg(e,n.format),n.pattern&&zg(e,n.pattern),(n.format==="base64"||n.format==="base64url")&&(e.contentEncoding=n.format),(n.local||n.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,n)=>Cg(e,n.mime)};function ae(e){let n={},o=e._zod.def,i=e._zod.traits.has("$ZodCheck")?[e,...o.checks??[]]:o.checks??[];for(let r of i)$I[r._zod.def.check]?.(n,r._zod.def);let t=e._zod.bag;t.minimum!==void 0&&Tn(n,"minimum",t.minimum),t.exclusiveMinimum!==void 0&&Tn(n,"exclusiveMinimum",t.exclusiveMinimum),t.maximum!==void 0&&En(n,"maximum",t.maximum),t.exclusiveMaximum!==void 0&&En(n,"exclusiveMaximum",t.exclusiveMaximum),t.multipleOf!==void 0&&Ng(n,t.multipleOf),t.format!==void 0&&(n.format??(n.format=t.format),t.format.includes("int")&&(n.isInt=!0)),t.mime&&Cg(n,t.mime);for(let r of t.patterns??[])zg(n,r);return n}var kI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},xI=new Map([[Bo,zs],[$r,Cs]]),Lg=e=>xI.get(e)??e,Al=(e,n,o,i)=>{let t=o;t.type="string";let{minimum:r,maximum:a,format:s,patterns:c,contentEncoding:l,laxFormat:d}=ae(e);if(typeof r=="number"&&(t.minLength=r),typeof a=="number"&&(t.maxLength=a),s&&(t.format=kI[s]??s,t.format===""&&delete t.format,(s==="time"||d)&&delete t.format),l&&(t.contentEncoding=l),c&&c.size>0){let p=[...c].map(Lg);p.length===1?t.pattern=p[0].source:p.length>1&&(t.allOf=[...p.map(m=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},Ol=(e,n,o,i)=>{let t=o,{minimum:r,maximum:a,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:d}=ae(e);t.type=d?"integer":"number";let p=typeof l=="number"&&l>=(r??Number.NEGATIVE_INFINITY),m=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),f=n.target==="draft-04"||n.target==="openapi-3.0";if(p?f?(t.minimum=l,t.exclusiveMinimum=!0):t.exclusiveMinimum=l:typeof r=="number"&&(t.minimum=r),m?f?(t.maximum=c,t.exclusiveMaximum=!0):t.exclusiveMaximum=c:typeof a=="number"&&(t.maximum=a),s){let g=new Set;for(let w of s)Number.isFinite(w)&&w!==0?g.add(Math.abs(w)):ie(e,n,t,i,`A multipleOf divisor of ${w} cannot be represented in JSON Schema`);let[y,...x]=g;y!==void 0&&(t.multipleOf=y),x.length&&(t.allOf=[...t.allOf??[],...x.map(w=>({multipleOf:w}))])}},Nl=(e,n,o,i)=>{o.type="boolean"},zl=(e,n,o,i)=>{ie(e,n,o,i,"BigInt cannot be represented in JSON Schema")},Cl=(e,n,o,i)=>{ie(e,n,o,i,"Symbols cannot be represented in JSON Schema")},Dl=(e,n,o,i)=>{n.target==="openapi-3.0"?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},Ll=(e,n,o,i)=>{ie(e,n,o,i,"Undefined cannot be represented in JSON Schema")},Ul=(e,n,o,i)=>{ie(e,n,o,i,"Void cannot be represented in JSON Schema")},jl=(e,n,o,i)=>{o.not={}},Rl=(e,n,o,i)=>{},Ml=(e,n,o,i)=>{},Fl=(e,n,o,i)=>{ie(e,n,o,i,"Date cannot be represented in JSON Schema")},Zl=(e,n,o,i)=>{let t=e._zod.def,r=Yt(t.entries);if(r.length===0){o.not={};return}r.every(a=>typeof a=="number")&&(o.type="number"),r.every(a=>typeof a=="string")&&(o.type="string"),o.enum=r},Gl=(e,n,o,i)=>{let t=e._zod.def;if(t.values.length===0){o.not={};return}let r=[];for(let a of t.values)if(a===void 0){if(ie(e,n,o,i,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(ie(e,n,o,i,"BigInt literals cannot be represented in JSON Schema"))return;r.push(Number(a))}else r.push(a);if(r.length!==0)if(r.length===1){let a=r[0];o.type=a===null?"null":typeof a,n.target==="draft-04"||n.target==="openapi-3.0"?o.enum=[a]:o.const=a}else r.every(a=>typeof a=="number")&&(o.type="number"),r.every(a=>typeof a=="string")&&(o.type="string"),r.every(a=>typeof a=="boolean")&&(o.type="boolean"),r.every(a=>a===null)&&(o.type="null"),o.enum=r},Vl=(e,n,o,i)=>{ie(e,n,o,i,"NaN cannot be represented in JSON Schema")},Hl=(e,n,o,i)=>{let t=o,r=e._zod.pattern;if(!r)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=r.source},Bl=(e,n,o,i)=>{let t=o;t.type="string",t.format="binary",t.contentEncoding="binary";let{minimum:r,maximum:a,mime:s}=ae(e);r!==void 0&&(t.minLength=r),a!==void 0&&(t.maxLength=a),s&&(s.length===0?t.not={}:s.length===1?t.contentMediaType=s[0]:t.anyOf=s.map(c=>({contentMediaType:c})))},Wl=(e,n,o,i)=>{o.type="boolean"},Kl=(e,n,o,i)=>{ie(e,n,o,i,"Custom types cannot be represented in JSON Schema")},Jl=(e,n,o,i)=>{ie(e,n,o,i,"Function types cannot be represented in JSON Schema")},Xl=(e,n,o,i)=>{ie(e,n,o,i,"Transforms cannot be represented in JSON Schema")},ql=(e,n,o,i)=>{ie(e,n,o,i,"Map cannot be represented in JSON Schema")},Yl=(e,n,o,i)=>{ie(e,n,o,i,"Set cannot be represented in JSON Schema")},Ql=(e,n,o,i)=>{let t=o,r=e._zod.def,{minimum:a,maximum:s}=ae(e);typeof a=="number"&&(t.minItems=a),typeof s=="number"&&(t.maxItems=s),t.type="array",t.items=X(r.element,n,{...i,path:[...i.path,"items"]})};function Ur(e){let n=e._zod.def;return n.type==="pipe"&&n.in._zod.traits.has("$ZodTransform")?Ur(n.out):n.type==="catch"?Ur(n.innerType):e._zod.optin}var ed=(e,n,o,i)=>{let t=o,r=e._zod.def,a=r.shape;if(Object.getOwnPropertySymbols(a).length&&ie(e,n,t,i,"Symbol keys cannot be represented in JSON Schema"))return;t.type="object",t.properties={};for(let l in a)ue(t.properties,l,X(a[l],n,{...i,path:[...i.path,"properties",l]}));let c=[];for(let l of Object.keys(a)){let d=r.shape[l];(n.io==="input"?Ur(d)===void 0:d._zod.optout===void 0)&&c.push(l)}c.length>0&&(t.required=c),r.catchall?._zod.def.type==="never"?t.additionalProperties=!1:r.catchall?r.catchall&&(t.additionalProperties=X(r.catchall,n,{...i,path:[...i.path,"additionalProperties"]})):n.io==="output"&&(t.additionalProperties=!1)},Gi=(e,n,o,i)=>{let t=e._zod.def,r=t.inclusive===!1,a=t.options.map((s,c)=>X(s,n,{...i,path:[...i.path,r?"oneOf":"anyOf",c]}));r?o.oneOf=a:o.anyOf=a},td=(e,n,o,i)=>{let t=e._zod.def,r=X(t.left,n,{...i,path:[...i.path,"allOf",0]}),a=X(t.right,n,{...i,path:[...i.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,c=[...s(r)?r.allOf:[r],...s(a)?a.allOf:[a]];o.allOf=c,n.intersections.push(c)},nd=(e,n,o,i)=>{let t=o,r=e._zod.def;t.type="array";let a=n.target==="draft-2020-12"?"prefixItems":"items",s=n.target==="draft-2020-12"||n.target==="openapi-3.0"?"items":"additionalItems",c=r.items.map((y,x)=>X(y,n,{...i,path:[...i.path,a,x]})),l=r.rest?X(r.rest,n,{...i,path:[...i.path,s,...n.target==="openapi-3.0"?[r.items.length]:[]]}):null,d=r.items.length;for(;d>0;){let y=r.items[d-1];if(!(n.io==="input"?Ur(y)!==void 0:y._zod.optout==="optional"))break;d--}let p=r.items.length,m=!r.rest;n.target==="draft-2020-12"?(t.prefixItems=c,m?t.items=!1:l&&(t.items=l),d>0&&(t.minItems=d),m&&(t.maxItems=p)):n.target==="openapi-3.0"?(t.items={anyOf:c},l&&t.items.anyOf.push(l),d>0&&(t.minItems=d),m&&(t.maxItems=p)):(t.items=c,m?t.additionalItems=!1:l&&(t.additionalItems=l),d>0&&(t.minItems=d),m&&(t.maxItems=p));let{minimum:f,maximum:g}=ae(e);typeof f=="number"&&(t.minItems=f),typeof g=="number"&&(t.maxItems=g)};function Tl(e,n,o){if(n.$ref){if(o.has(n))return n;o.add(n);let g=e.get(n)?.def;if(!g)return n;let y=Tl(e,g,o);return y===g?n:y}for(let g of["anyOf","oneOf"]){let y=n[g];if(!Array.isArray(y))continue;let x=y.map(w=>Tl(e,w,o));x.some((w,b)=>w!==y[b])&&(n={...n,[g]:x})}let i=Array.isArray(n.type)?n.type:[n.type],t=!i.includes("string")&&i.some(g=>g==="number"||g==="integer"),r=n.enum??(n.const!==void 0?[n.const]:void 0);if(!t&&!r?.some(g=>typeof g=="number"))return n;let{minimum:a,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:d,format:p,id:m,...f}=n;return f.enum?f.enum=f.enum.map(g=>typeof g=="number"?String(g):g):typeof f.const=="number"&&(f.const=String(f.const)),t&&(f.type="string",r||(f.pattern=(i.includes("number")?et:fr).source)),f}var El=new WeakMap;function II(e){let n=new Map;for(let i of e.seen.values())i.def&&!n.has(i.schema)&&n.set(i.schema,i);let o=new Map;for(let i of El.get(e)??[]){let t=e.seen.get(i),r=(t?.def??t?.schema)?.propertyNames;if(!r||r===!0||o.has(r))continue;let a=Tl(n,r,new Set);a!==r&&o.set(r,a)}if(o.size)for(let i of e.seen.values())for(let t of[i.schema,i.def]){let r=t&&o.get(t.propertyNames);r&&(t.propertyNames=r)}}var rd=(e,n,o,i)=>{let t=o,r=e._zod.def;t.type="object";let a=r.keyType,s=ae(a).patterns;if(r.mode==="loose"&&s&&s.size>0){let d=X(r.valueType,n,{...i,path:[...i.path,"patternProperties","*"]});t.patternProperties={};for(let p of s)ue(t.patternProperties,Lg(p).source,d)}else{if(n.target==="draft-07"||n.target==="draft-2020-12"){t.propertyNames=X(r.keyType,n,{...i,path:[...i.path,"propertyNames"]});let d=El.get(n);d||(d=[],El.set(n,d),n.deferred.push(()=>II(n))),d.push(e)}t.additionalProperties=X(r.valueType,n,{...i,path:[...i.path,"additionalProperties"]})}let c=a._zod.values,l=n.io==="input"&&Ur(r.valueType)!==void 0;if(c&&!r.partial&&!l){let d=[...c].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(t.required=d.map(String))}},od=(e,n,o,i)=>{let t=e._zod.def,r=X(t.innerType,n,i),a=n.seen.get(e);n.target==="openapi-3.0"?(a.ref=t.innerType,o.nullable=!0):o.anyOf=[r,{type:"null"}]},id=(e,n,o,i)=>{let t=e._zod.def;X(t.innerType,n,i);let r=n.seen.get(e);r.ref=t.innerType},ad=Symbol();function Ug(e,n,o,i,t){let r=!1,a=JSON.stringify(e,(s,c)=>typeof c!="bigint"?c:(r=!0,null));return r?(ie(n,o,i,t,"BigInt defaults cannot be represented in JSON Schema"),ad):JSON.parse(a)}var sd=(e,n,o,i)=>{let t=e._zod.def;X(t.innerType,n,i);let r=n.seen.get(e);r.ref=t.innerType;let a=Ug(t.defaultValue,e,n,o,i);a!==ad&&(o.default=a)},ud=(e,n,o,i)=>{let t=e._zod.def;X(t.innerType,n,i);let r=n.seen.get(e);if(r.ref=t.innerType,n.io!=="input")return;let a=Ug(t.defaultValue,e,n,o,i);a!==ad&&(o._prefault=a)},cd=(e,n,o,i)=>{let t=e._zod.def;X(t.innerType,n,i);let r=n.seen.get(e);r.ref=t.innerType;let a;try{a=t.catchValue(void 0)}catch{ie(e,n,o,i,"Dynamic catch values are not supported in JSON Schema");return}o.default=a},ld=(e,n,o,i)=>{let t=e._zod.def,r=t.in._zod.traits.has("$ZodTransform"),a=n.io==="input"?r?t.out:t.in:t.out;X(a,n,i);let s=n.seen.get(e);s.ref=a},dd=(e,n,o,i)=>{let t=e._zod.def;X(t.innerType,n,i);let r=n.seen.get(e);r.ref=t.innerType,o.readOnly=!0},pd=(e,n,o,i)=>{let t=e._zod.def;X(t.innerType,n,i);let r=n.seen.get(e);r.ref=t.innerType},Vi=(e,n,o,i)=>{let t=e._zod.def;X(t.innerType,n,i);let r=n.seen.get(e);r.ref=t.innerType},md=(e,n,o,i)=>{let t=e._zod.innerType;X(t,n,i);let r=n.seen.get(e);r.ref=t},Zi={string:Al,number:Ol,boolean:Nl,bigint:zl,symbol:Cl,null:Dl,undefined:Ll,void:Ul,never:jl,any:Rl,unknown:Ml,date:Fl,enum:Zl,literal:Gl,nan:Vl,template_literal:Hl,file:Bl,success:Wl,custom:Kl,function:Jl,transform:Xl,map:ql,set:Yl,array:Ql,object:ed,union:Gi,intersection:td,tuple:nd,record:rd,nullable:od,nonoptional:id,default:sd,prefault:ud,catch:cd,pipe:ld,readonly:dd,promise:pd,optional:Vi,lazy:md};function Hi(e,n){if("_idmap"in e){let i=e,t=dt({...n,processors:Zi}),r={};for(let c of i._idmap.entries()){let[l,d]=c;X(d,t)}let a={},s={registry:i,uri:n?.uri,defs:r};t.external=s;for(let c of i._idmap.entries()){let[l,d]=c;pt(t,d),ue(a,l,mt(t,d))}if(Object.keys(r).length>0){let c=t.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:r}}return{schemas:a}}let o=dt({...n,processors:Zi});return X(e,o),pt(o,e),mt(o,e)}var Bi=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(n){this.ctx.counter=n}get seen(){return this.ctx.seen}constructor(n){let o=n?.target??"draft-2020-12";o==="draft-4"&&(o="draft-04"),o==="draft-7"&&(o="draft-07"),this.ctx=dt({processors:Zi,target:o,...n?.metadata&&{metadata:n.metadata},...n?.unrepresentable&&{unrepresentable:n.unrepresentable},...n?.override&&{override:n.override},...n?.io&&{io:n.io}})}process(n,o={path:[],schemaPath:[]}){return X(n,this.ctx,o)}emit(n,o){o&&(o.cycles&&(this.ctx.cycles=o.cycles),o.reused&&(this.ctx.reused=o.reused),o.external&&(this.ctx.external=o.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,pt(this.ctx,n);let i=mt(this.ctx,n),{"~standard":t,...r}=i;return r}};var jg={};var Un={};qe(Un,{ZodAny:()=>Dd,ZodArray:()=>Rd,ZodBase64:()=>da,ZodBase64URL:()=>pa,ZodBigInt:()=>Dn,ZodBigIntFormat:()=>ga,ZodBoolean:()=>Cn,ZodCIDRv4:()=>ca,ZodCIDRv6:()=>la,ZodCUID:()=>na,ZodCUID2:()=>ra,ZodCatch:()=>ap,ZodCodec:()=>Wr,ZodCreditCard:()=>Pd,ZodCustom:()=>Kr,ZodCustomStringFormat:()=>Zt,ZodDate:()=>Fr,ZodDefault:()=>ep,ZodDiscriminatedUnion:()=>Fd,ZodE164:()=>ma,ZodEmail:()=>Yi,ZodEmoji:()=>ea,ZodEnum:()=>On,ZodExactOptional:()=>ba,ZodFile:()=>Xd,ZodFunction:()=>hp,ZodGUID:()=>Qi,ZodIBAN:()=>Td,ZodIPv4:()=>sa,ZodIPv6:()=>ua,ZodISODate:()=>gt,ZodISODateTime:()=>ft,ZodISODuration:()=>vt,ZodISOTime:()=>ht,ZodInstanceOf:()=>bp,ZodIntersection:()=>Zd,ZodJWT:()=>fa,ZodKSUID:()=>aa,ZodLazy:()=>mp,ZodLiteral:()=>Jd,ZodMAC:()=>Sd,ZodMap:()=>Wd,ZodNaN:()=>up,ZodNanoID:()=>ta,ZodNever:()=>Ud,ZodNonOptional:()=>_a,ZodNull:()=>zd,ZodNullable:()=>Qd,ZodNumber:()=>zn,ZodNumberFormat:()=>Gt,ZodObject:()=>Gr,ZodOptional:()=>Hr,ZodPipe:()=>Br,ZodPrefault:()=>np,ZodPreprocess:()=>cp,ZodPromise:()=>gp,ZodReadonly:()=>lp,ZodRecord:()=>An,ZodSet:()=>Kd,ZodString:()=>Nn,ZodStringFormat:()=>q,ZodSuccess:()=>ip,ZodSymbol:()=>Od,ZodTemplateLiteral:()=>pp,ZodTransform:()=>qd,ZodTuple:()=>Vd,ZodType:()=>F,ZodULID:()=>oa,ZodURL:()=>Mr,ZodUUID:()=>We,ZodUndefined:()=>Nd,ZodUnion:()=>Vr,ZodUnknown:()=>Ld,ZodVoid:()=>jd,ZodXID:()=>ia,ZodXor:()=>Md,_ZodString:()=>qi,_default:()=>tp,_function:()=>Xh,any:()=>Ph,array:()=>Zr,base64:()=>sh,base64url:()=>uh,bigint:()=>kh,boolean:()=>Ad,catch:()=>sp,check:()=>qh,cidrv4:()=>ih,cidrv6:()=>ah,codec:()=>Bh,creditCard:()=>lh,cuid:()=>qg,cuid2:()=>Yg,currencyCode:()=>hh,custom:()=>Yh,date:()=>Eh,describe:()=>Qh,discriminatedUnion:()=>Dh,e164:()=>ch,email:()=>Fg,emoji:()=>Jg,enum:()=>va,exactOptional:()=>Yd,file:()=>Zh,float32:()=>yh,float64:()=>bh,function:()=>Xh,guid:()=>Zg,hash:()=>vh,hex:()=>gh,hostname:()=>fh,httpUrl:()=>Kg,iban:()=>dh,instanceof:()=>tv,int:()=>Ji,int32:()=>_h,int64:()=>xh,intersection:()=>Gd,invertCodec:()=>Wh,ipv4:()=>nh,ipv6:()=>oh,json:()=>rv,jwt:()=>ph,keyof:()=>Ah,ksuid:()=>th,lazy:()=>fp,literal:()=>Fh,looseObject:()=>zh,looseRecord:()=>Uh,mac:()=>rh,map:()=>jh,meta:()=>ev,nan:()=>Hh,nanoid:()=>Xg,nativeEnum:()=>Mh,never:()=>ha,nonoptional:()=>op,null:()=>Cd,nullable:()=>Rr,nullish:()=>Gh,number:()=>Ed,object:()=>Oh,optional:()=>Mt,partialRecord:()=>Lh,pipe:()=>Xi,prefault:()=>rp,preprocess:()=>ov,promise:()=>Jh,readonly:()=>dp,record:()=>Bd,refine:()=>vp,set:()=>Rh,strictObject:()=>Nh,string:()=>jr,stringFormat:()=>mh,stringbool:()=>nv,success:()=>Vh,superRefine:()=>yp,symbol:()=>wh,templateLiteral:()=>Kh,transform:()=>ya,tuple:()=>Hd,uint32:()=>$h,uint64:()=>Ih,ulid:()=>Qg,undefined:()=>Sh,union:()=>Ln,unknown:()=>Rt,url:()=>Wg,uuid:()=>Gg,uuidv4:()=>Vg,uuidv6:()=>Hg,uuidv7:()=>Bg,void:()=>Th,xid:()=>eh,xor:()=>Ch});var Wi={};qe(Wi,{endsWith:()=>bn,gt:()=>He,gte:()=>Se,includes:()=>vn,length:()=>Ut,lowercase:()=>gn,lt:()=>Ve,lte:()=>we,maxLength:()=>Lt,maxSize:()=>lt,mime:()=>$n,minLength:()=>tt,minSize:()=>Be,multipleOf:()=>ct,negative:()=>ji,nonnegative:()=>Mi,nonpositive:()=>Ri,normalize:()=>kn,overwrite:()=>Ue,positive:()=>Ui,properties:()=>_n,property:()=>Fi,regex:()=>fn,size:()=>Dt,slugify:()=>Sn,startsWith:()=>yn,toLowerCase:()=>In,toUpperCase:()=>wn,trim:()=>xn,uppercase:()=>hn});var Rg=new WeakSet([Object.prototype,Error.prototype]);function Ki(e,n,o){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get(){let i=o(this);return Object.defineProperty(this,n,{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,n,{value:i,configurable:!0,writable:!0})}})}var Mg=(e,n)=>{ms.init(e,n),e.name="ZodError";let o=Object.getPrototypeOf(e);Rg.has(o)||(Rg.add(o),Ki(o,"format",i=>t=>lr(i,t)),Ki(o,"flatten",i=>t=>cr(i,t)),Ki(o,"addIssue",i=>t=>{i.issues.push(t),i.message=JSON.stringify(i.issues,Qt,2)}),Ki(o,"addIssues",i=>t=>{i.issues.push(...t),i.message=JSON.stringify(i.issues,Qt,2)}),Object.defineProperty(o,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},SI=h("ZodError",Mg),Ie=h("ZodError",Mg,void 0,{Parent:Error});var fd=on(Ie),gd=an(Ie),hd=sn(Ie),vd=un(Ie),yd=xo(Ie),bd=Io(Ie),_d=wo(Ie),$d=So(Ie),kd=Po(Ie),xd=To(Ie),Id=Eo(Ie),wd=Ao(Ie);function TI(){se.localeError||ne(ui())}function Ft(){se.memoizer||ne({memoizer:Tr()})}var F=h("ZodType",(e,n)=>(TI(),R.init(e,n),e.def=n,e.type=n.type,e),{check(...e){let n=this.def;return this.clone(_.mergeDefs(n,{checks:[...n.checks??[],...e.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,n){return K(this,e,n)},brand(){return this},register(e,n){return e.add(this,n),this},refine(e,n){return this.check(vp(e,n))},superRefine(e,n){return this.check(yp(e,n))},overwrite(e){return this.check(Ue(e))},optional(){return Mt(this)},exactOptional(){return Yd(this)},nullable(){return Rr(this)},nullish(){return Mt(Rr(this))},nonoptional(e){return op(this,e)},array(){return Zr(this)},or(e){return Ln([this,e])},and(e){return Gd(this,e)},transform(e){return Xi(this,ya(e))},default(e){return tp(this,e)},prefault(e){return rp(this,e)},catch(e){return sp(this,e)},pipe(e){return Xi(this,e)},readonly(){return dp(this)},describe(e){let n=this.clone();return ce.add(n,{description:e}),n},meta(...e){if(e.length===0)return ce.get(this);let n=this.clone();return ce.add(n,e[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...n){return n.length===0?e(this):e(this,...n)},get"~standard"(){return _.hide(this,"~standard",{...Fo(this),jsonSchema:{input:Pn(this,"input"),output:Pn(this,"output")}})},set"~standard"(e){_.own(this,"~standard",e)},parse:function e(n,o){return fd(this,n,o,{callee:e})},parseAsync:async function e(n,o){return await gd(this,n,o,{callee:e})},safeParse(e,n){return hd(this,e,n)},async safeParseAsync(e,n){return vd(this,e,n)},get spa(){return this?.safeParseAsync},set spa(e){_.own(this,"spa",e)},validate(e,n){return dr(this,e,n)},validateAsync(e,n){return pr(this,e,n)},encode:function e(n,o){return yd(this,n,o,{callee:e})},decode:function e(n,o){return bd(this,n,o,{callee:e})},encodeAsync:async function e(n,o){return await _d(this,n,o,{callee:e})},decodeAsync:async function e(n,o){return await $d(this,n,o,{callee:e})},safeEncode(e,n){return kd(this,e,n)},safeDecode(e,n){return xd(this,e,n)},async safeEncodeAsync(e,n){return Id(this,e,n)},async safeDecodeAsync(e,n){return wd(this,e,n)},toJSONSchema(e){return Pl(this,{})(e)},get description(){return ce.get(this)?.description},get _def(){return this._zod.def}}),qi=h("_ZodString",(e,n)=>{Ot.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Al(e,o,i,t)},_.derived({format:e=>ae(e).format??null,minLength:e=>ae(e).minimum??null,maxLength:e=>ae(e).maximum??null},{regex(...e){return this.check(fn(...e))},includes(...e){return this.check(vn(...e))},startsWith(...e){return this.check(yn(...e))},endsWith(...e){return this.check(bn(...e))},min(...e){return this.check(tt(...e))},max(...e){return this.check(Lt(...e))},length(...e){return this.check(Ut(...e))},nonempty(...e){return this.check(tt(1,...e))},lowercase(e){return this.check(gn(e))},uppercase(e){return this.check(hn(e))},trim(){return this.check(xn())},normalize(...e){return this.check(kn(...e))},toLowerCase(){return this.check(In())},toUpperCase(){return this.check(wn())},slugify(){return this.check(Sn())}})),Nn=h("ZodString",(e,n)=>{Ot.init(e,n),qi.init(e,n)},{email(e){return this.check(hi(Yi,e))},url(e){return this.check(Or(Mr,e))},jwt(e){return this.check(Li(fa,e))},emoji(e){return this.check(ki(ea,e))},guid(e){return this.check(vi(Qi,e))},uuid(e){return this.check(yi(We,e))},uuidv4(e){return this.check(bi(We,e))},uuidv6(e){return this.check(_i(We,e))},uuidv7(e){return this.check($i(We,e))},nanoid(e){return this.check(xi(ta,e))},cuid(e){return this.check(Ii(na,e))},cuid2(e){return this.check(wi(ra,e))},ulid(e){return this.check(Si(oa,e))},base64(e){return this.check(zi(da,e))},base64url(e){return this.check(Ci(pa,e))},xid(e){return this.check(Pi(ia,e))},ksuid(e){return this.check(Ti(aa,e))},ipv4(e){return this.check(Ei(sa,e))},ipv6(e){return this.check(Ai(ua,e))},cidrv4(e){return this.check(Oi(ca,e))},cidrv6(e){return this.check(Ni(la,e))},e164(e){return this.check(Di(ma,e))},datetime(e){return this.check(Nr(ft,e))},date(e){return this.check(zr(gt,e))},time(e){return this.check(Cr(ht,e))},duration(e){return this.check(Dr(vt,e))}});function jr(e){return Gc(Nn,e)}var q=h("ZodStringFormat",(e,n)=>{J.init(e,n),qi.init(e,n)}),ft=h("ZodISODateTime",(e,n)=>{zu.init(e,n),q.init(e,n)}),gt=h("ZodISODate",(e,n)=>{Cu.init(e,n),q.init(e,n)}),ht=h("ZodISOTime",(e,n)=>{Du.init(e,n),q.init(e,n)}),vt=h("ZodISODuration",(e,n)=>{Lu.init(e,n),q.init(e,n)}),Yi=h("ZodEmail",(e,n)=>{ku.init(e,n),q.init(e,n)});function Fg(e){return hi(Yi,e)}var Qi=h("ZodGUID",(e,n)=>{_u.init(e,n),q.init(e,n)});function Zg(e){return vi(Qi,e)}var We=h("ZodUUID",(e,n)=>{$u.init(e,n),q.init(e,n)});function Gg(e){return yi(We,e)}function Vg(e){return bi(We,e)}function Hg(e){return _i(We,e)}function Bg(e){return $i(We,e)}var Mr=h("ZodURL",(e,n)=>{wu.init(e,n),q.init(e,n)});function Wg(e){return Or(Mr,e)}function Kg(e){return Or(Mr,{protocol:mr,hostname:Ls,..._.normalizeParams(e)})}var ea=h("ZodEmoji",(e,n)=>{Su.init(e,n),q.init(e,n)});function Jg(e){return ki(ea,e)}var ta=h("ZodNanoID",(e,n)=>{Pu.init(e,n),q.init(e,n)});function Xg(e){return xi(ta,e)}var na=h("ZodCUID",(e,n)=>{Tu.init(e,n),q.init(e,n)});function qg(e){return Ii(na,e)}var ra=h("ZodCUID2",(e,n)=>{Eu.init(e,n),q.init(e,n)});function Yg(e){return wi(ra,e)}var oa=h("ZodULID",(e,n)=>{Au.init(e,n),q.init(e,n)});function Qg(e){return Si(oa,e)}var ia=h("ZodXID",(e,n)=>{Ou.init(e,n),q.init(e,n)});function eh(e){return Pi(ia,e)}var aa=h("ZodKSUID",(e,n)=>{Nu.init(e,n),q.init(e,n)});function th(e){return Ti(aa,e)}var sa=h("ZodIPv4",(e,n)=>{Uu.init(e,n),q.init(e,n)});function nh(e){return Ei(sa,e)}var Sd=h("ZodMAC",(e,n)=>{Ru.init(e,n),q.init(e,n)});function rh(e){return Hc(Sd,e)}var ua=h("ZodIPv6",(e,n)=>{ju.init(e,n),q.init(e,n)});function oh(e){return Ai(ua,e)}var ca=h("ZodCIDRv4",(e,n)=>{Mu.init(e,n),q.init(e,n)});function ih(e){return Oi(ca,e)}var la=h("ZodCIDRv6",(e,n)=>{Fu.init(e,n),q.init(e,n)});function ah(e){return Ni(la,e)}var da=h("ZodBase64",(e,n)=>{Zu.init(e,n),q.init(e,n)});function sh(e){return zi(da,e)}var pa=h("ZodBase64URL",(e,n)=>{Gu.init(e,n),q.init(e,n)});function uh(e){return Ci(pa,e)}var ma=h("ZodE164",(e,n)=>{Vu.init(e,n),q.init(e,n)});function ch(e){return Di(ma,e)}var Pd=h("ZodCreditCard",(e,n)=>{Hu.init(e,n),q.init(e,n)});function lh(e){return Bc(Pd,e)}var Td=h("ZodIBAN",(e,n)=>{Bu.init(e,n),q.init(e,n)});function dh(e){return Wc(Td,e)}var fa=h("ZodJWT",(e,n)=>{Wu.init(e,n),q.init(e,n)});function ph(e){return Li(fa,e)}var Zt=h("ZodCustomStringFormat",(e,n)=>{Ku.init(e,n),q.init(e,n)});function mh(e,n,o={}){return jt(Zt,e,n,o)}function fh(e){return jt(Zt,"hostname",Ds,e)}function gh(e){return jt(Zt,"hex",Xs,e)}function hh(e){return jt(Zt,"currency_code",js,e)}function vh(e,n){let o=n?.enc??"hex",i=`${e}_${o}`,t=Ee[i];if(!t)throw new Error(`Unrecognized hash format: ${i}`);return jt(Zt,i,t,n)}var zn=h("ZodNumber",(e,n)=>{qo.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Ol(e,o,i,t),e.isFinite=!0},_.derived({minValue:e=>{let{minimum:n,exclusiveMinimum:o}=ae(e);return Math.max(n??Number.NEGATIVE_INFINITY,o??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:n,exclusiveMaximum:o}=ae(e);return Math.min(n??Number.POSITIVE_INFINITY,o??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:n,multipleOf:o}=ae(e);return!!n||!!o?.some(Number.isSafeInteger)},format:e=>ae(e).format??null},{gt(e,n){return this.check(He(e,n))},gte(e,n){return this.check(Se(e,n))},min(e,n){return this.check(Se(e,n))},lt(e,n){return this.check(Ve(e,n))},lte(e,n){return this.check(we(e,n))},max(e,n){return this.check(we(e,n))},int(e){return this.check(Ji(e))},safe(e){return this.check(Ji(e))},positive(e){return this.check(He(0,e))},nonnegative(e){return this.check(Se(0,e))},negative(e){return this.check(Ve(0,e))},nonpositive(e){return this.check(we(0,e))},multipleOf(e,n){return this.check(ct(e,n))},step(e,n){return this.check(ct(e,n))},finite(){return this}}));function Ed(e){return Jc(zn,e)}var Gt=h("ZodNumberFormat",(e,n)=>{Ju.init(e,n),zn.init(e,n)});function Ji(e){return qc(Gt,e)}function yh(e){return Yc(Gt,e)}function bh(e){return Qc(Gt,e)}function _h(e){return el(Gt,e)}function $h(e){return tl(Gt,e)}var Cn=h("ZodBoolean",(e,n)=>{kr.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Nl(e,o,i,t)});function Ad(e){return nl(Cn,e)}var Dn=h("ZodBigInt",(e,n)=>{Yo.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>zl(e,o,i,t)},_.derived({minValue:e=>ae(e).minimum??null,maxValue:e=>ae(e).maximum??null,format:e=>ae(e).format??null},{gte(e,n){return this.check(Se(e,n))},min(e,n){return this.check(Se(e,n))},gt(e,n){return this.check(He(e,n))},lt(e,n){return this.check(Ve(e,n))},lte(e,n){return this.check(we(e,n))},max(e,n){return this.check(we(e,n))},positive(e){return this.check(He(BigInt(0),e))},negative(e){return this.check(Ve(BigInt(0),e))},nonpositive(e){return this.check(we(BigInt(0),e))},nonnegative(e){return this.check(Se(BigInt(0),e))},multipleOf(e,n){return this.check(ct(e,n))}}));function kh(e){return ol(Dn,e)}var ga=h("ZodBigIntFormat",(e,n)=>{Xu.init(e,n),Dn.init(e,n)});function xh(e){return al(ga,e)}function Ih(e){return sl(ga,e)}var Od=h("ZodSymbol",(e,n)=>{qu.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Cl(e,o,i,t)});function wh(e){return ul(Od,e)}var Nd=h("ZodUndefined",(e,n)=>{Yu.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Ll(e,o,i,t)});function Sh(e){return cl(Nd,e)}var zd=h("ZodNull",(e,n)=>{Qu.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Dl(e,o,i,t)});function Cd(e){return ll(zd,e)}var Dd=h("ZodAny",(e,n)=>{ec.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Rl(e,o,i,t)});function Ph(){return dl(Dd)}var Ld=h("ZodUnknown",(e,n)=>{tc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Ml(e,o,i,t)});function Rt(){return pl(Ld)}var Ud=h("ZodNever",(e,n)=>{nc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>jl(e,o,i,t)});function ha(e){return ml(Ud,e)}var jd=h("ZodVoid",(e,n)=>{rc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Ul(e,o,i,t)});function Th(e){return fl(jd,e)}var Fr=h("ZodDate",(e,n)=>{oc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Fl(e,o,i,t),e.min=(o,i)=>e.check(Se(o,i)),e.max=(o,i)=>e.check(we(o,i))},_.derived({minDate:e=>{let{minimum:n}=ae(e);return n?new Date(n):null},maxDate:e=>{let{maximum:n}=ae(e);return n?new Date(n):null}},{}));function Eh(e){return gl(Fr,e)}var Rd=h("ZodArray",(e,n)=>{Ft(),ac.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Ql(e,o,i,t),e.element=n.element},{min(e,n){return this.check(tt(e,n))},nonempty(e){return this.check(tt(1,e))},max(e,n){return this.check(Lt(e,n))},length(e,n){return this.check(Ut(e,n))},unwrap(){return this.element}});function Zr(e,n){return yl(Rd,e,n)}function Ah(e){let n=e._zod.def.shape;return va(Object.keys(n))}var Gr=h("ZodObject",(e,n)=>{Ft(),sc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>ed(e,o,i,t),_.installLazyProp(e,"shape",o=>o._zod.def.shape,!1)},{keyof(){return va(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(_.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(_.mergeDefs(this._zod.def,{catchall:Rt()}))},loose(){return this.clone(_.mergeDefs(this._zod.def,{catchall:Rt()}))},strict(){return this.clone(_.mergeDefs(this._zod.def,{catchall:ha()}))},strip(){return this.clone(_.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return _.extend(this,e)},safeExtend(e){return _.safeExtend(this,e)},merge(e){return _.merge(this,e)},pick(e){return _.pick(this,e)},omit(e){return _.omit(this,e)},partial(...e){return _.partial(Hr,this,e[0])},exactPartial(...e){return _.partial(ba,this,e[0],"exactPartial")},required(...e){return _.required(_a,this,e[0])}});function Oh(e,n){let o={type:"object",shape:e??{},..._.normalizeParams(n)};return new Gr(o)}function Nh(e,n){return new Gr({type:"object",shape:e,catchall:ha(),..._.normalizeParams(n)})}function zh(e,n){return new Gr({type:"object",shape:e,catchall:Rt(),..._.normalizeParams(n)})}var Vr=h("ZodUnion",(e,n)=>{xr.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Gi(e,o,i,t),e.options=n.options});function Ln(e,n){return new Vr({type:"union",options:e,..._.normalizeParams(n)})}var Md=h("ZodXor",(e,n)=>{Vr.init(e,n),uc.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Gi(e,o,i,t),e.options=n.options});function Ch(e,n){return new Md({type:"union",options:e,inclusive:!1,..._.normalizeParams(n)})}var Fd=h("ZodDiscriminatedUnion",(e,n)=>{Vr.init(e,n),lc.init(e,n)});function Dh(e,n,o){return new Fd({type:"union",options:n,discriminator:e,..._.normalizeParams(o)})}var Zd=h("ZodIntersection",(e,n)=>{dc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>td(e,o,i,t)});function Gd(e,n){return new Zd({type:"intersection",left:e,right:n})}var Vd=h("ZodTuple",(e,n)=>{Ft(),Qo.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>nd(e,o,i,t)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(n=>new Hr({type:"optional",innerType:n}))})}});function Hd(e,n,o){let i=n instanceof R,t=i?o:n,r=i?n:null;return new Vd({type:"tuple",items:e,rest:r,..._.normalizeParams(t)})}var An=h("ZodRecord",(e,n)=>{Ft(),pc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>rd(e,o,i,t),e.keyType=n.keyType,e.valueType=n.valueType});function Bd(e,n,o){return!n||!n._zod?new An({type:"record",keyType:jr(),valueType:e,..._.normalizeParams(n)}):new An({type:"record",keyType:e,valueType:n,..._.normalizeParams(o)})}function Lh(e,n,o){return new An({type:"record",keyType:e,valueType:n,..._.normalizeParams(o),partial:!0})}function Uh(e,n,o){return new An({type:"record",keyType:e,valueType:n,mode:"loose",..._.normalizeParams(o)})}var Wd=h("ZodMap",(e,n)=>{Ft(),mc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>ql(e,o,i,t),e.keyType=n.keyType,e.valueType=n.valueType,e.min=(...o)=>e.check(Be(...o)),e.nonempty=o=>e.check(Be(1,o)),e.max=(...o)=>e.check(lt(...o)),e.size=(...o)=>e.check(Dt(...o))});function jh(e,n,o){return new Wd({type:"map",keyType:e,valueType:n,..._.normalizeParams(o)})}var Kd=h("ZodSet",(e,n)=>{Ft(),fc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Yl(e,o,i,t),e.min=(...o)=>e.check(Be(...o)),e.nonempty=o=>e.check(Be(1,o)),e.max=(...o)=>e.check(lt(...o)),e.size=(...o)=>e.check(Dt(...o))});function Rh(e,n){return new Kd({type:"set",valueType:e,..._.normalizeParams(n)})}var On=h("ZodEnum",(e,n)=>{gc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(i,t,r)=>Zl(e,i,t,r),e.enum=n.entries,e.options=[...e._zod.values];let o=new Set(Object.keys(n.entries));e.extract=(i,t)=>{let r={};for(let a of i)if(o.has(a))r[a]=n.entries[a];else throw new Error(`Key ${a} not found in enum`);return new On({...n,checks:[],..._.normalizeParams(t),entries:r})},e.exclude=(i,t)=>{let r={...n.entries};for(let a of i)if(o.has(a))delete r[a];else throw new Error(`Key ${a} not found in enum`);return new On({...n,checks:[],..._.normalizeParams(t),entries:r})}});function va(e,n){let o=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new On({type:"enum",entries:o,..._.normalizeParams(n)})}function Mh(e,n){return new On({type:"enum",entries:e,..._.normalizeParams(n)})}var Jd=h("ZodLiteral",(e,n)=>{hc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Gl(e,o,i,t),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function Fh(e,n){return new Jd({type:"literal",values:Array.isArray(e)?e:[e],..._.normalizeParams(n)})}var Xd=h("ZodFile",(e,n)=>{vc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Bl(e,o,i,t),e.min=(o,i)=>e.check(Be(o,i)),e.max=(o,i)=>e.check(lt(o,i)),e.mime=(o,i)=>e.check($n(Array.isArray(o)?o:[o],i))});function Zh(e){return bl(Xd,e)}var qd=h("ZodTransform",(e,n)=>{Ft(),yc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Xl(e,o,i,t),e._zod.parse=(o,i)=>{if(i.direction==="backward")throw new st(e.constructor.name);o.addIssue=r=>{if(typeof r=="string")o.issues.push(_.issue(r,o.value,n));else{let a=r;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=o.value),a.inst??(a.inst=e),o.issues.push(_.issue(a))}};let t=n.transform(o.value,o);return t instanceof Promise?t.then(r=>(o.value=r,o)):(o.value=t,o)}});function ya(e){return new qd({type:"transform",transform:e})}var Hr=h("ZodOptional",(e,n)=>{ei.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Vi(e,o,i,t),e.unwrap=()=>e._zod.def.innerType});function Mt(e){return new Hr({type:"optional",innerType:e})}var ba=h("ZodExactOptional",(e,n)=>{bc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Vi(e,o,i,t),e.unwrap=()=>e._zod.def.innerType});function Yd(e){return new ba({type:"optional",innerType:e})}var Qd=h("ZodNullable",(e,n)=>{_c.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>od(e,o,i,t),e.unwrap=()=>e._zod.def.innerType});function Rr(e){return new Qd({type:"nullable",innerType:e})}function Gh(e){return Mt(Rr(e))}var ep=h("ZodDefault",(e,n)=>{$c.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>sd(e,o,i,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tp(e,n){return new ep({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():_.shallowClone(n)}})}var np=h("ZodPrefault",(e,n)=>{kc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>ud(e,o,i,t),e.unwrap=()=>e._zod.def.innerType});function rp(e,n){return new np({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():_.shallowClone(n)}})}var _a=h("ZodNonOptional",(e,n)=>{xc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>id(e,o,i,t),e.unwrap=()=>e._zod.def.innerType});function op(e,n){return new _a({type:"nonoptional",innerType:e,..._.normalizeParams(n)})}var ip=h("ZodSuccess",(e,n)=>{Ic.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Wl(e,o,i,t),e.unwrap=()=>e._zod.def.innerType});function Vh(e){return new ip({type:"success",innerType:e})}var ap=h("ZodCatch",(e,n)=>{wc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>cd(e,o,i,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function sp(e,n){return new ap({type:"catch",innerType:e,catchValue:typeof n=="function"?n:_.constantCatch(n)})}var up=h("ZodNaN",(e,n)=>{Sc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Vl(e,o,i,t)});function Hh(e){return vl(up,e)}var Br=h("ZodPipe",(e,n)=>{ti.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>ld(e,o,i,t),e.in=n.in,e.out=n.out});function Xi(e,n){return new Br({type:"pipe",in:e,out:n})}var Wr=h("ZodCodec",(e,n)=>{Br.init(e,n),Ir.init(e,n)});function Bh(e,n,o){return new Wr({type:"pipe",in:e,out:n,transform:o.decode,reverseTransform:o.encode})}function Wh(e){let n=e._zod.def;return new Wr({type:"pipe",in:n.out,out:n.in,transform:n.reverseTransform,reverseTransform:n.transform})}var cp=h("ZodPreprocess",(e,n)=>{Br.init(e,n),Pc.init(e,n)}),lp=h("ZodReadonly",(e,n)=>{Tc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>dd(e,o,i,t),e.unwrap=()=>e._zod.def.innerType});function dp(e){return new lp({type:"readonly",innerType:e})}var pp=h("ZodTemplateLiteral",(e,n)=>{Ec.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Hl(e,o,i,t)});function Kh(e,n){return new pp({type:"template_literal",parts:e,..._.normalizeParams(n)})}var mp=h("ZodLazy",(e,n)=>{wr.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>md(e,o,i,t),e.unwrap=()=>e._zod.def.getter()});function fp(e){return new mp({type:"lazy",getter:e})}var gp=h("ZodPromise",(e,n)=>{Oc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>pd(e,o,i,t),e.unwrap=()=>e._zod.def.innerType});function Jh(e){return new gp({type:"promise",innerType:e})}var hp=h("ZodFunction",(e,n)=>{Ac.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Jl(e,o,i,t)});function Xh(e){return new hp({type:"function",input:Array.isArray(e?.input)?Hd(e?.input):e?.input??Zr(Rt()),output:e?.output??Rt()})}var Kr=h("ZodCustom",(e,n)=>{Nc.init(e,n),F.init(e,n),e._zod.processJSONSchema=(o,i,t)=>Kl(e,o,i,t)});function qh(e){let n=new Y({check:"custom"});return n._zod.check=e,n}function Yh(e,n){return _l(Kr,e??(()=>!0),n)}function vp(e,n={}){return $l(Kr,e,n)}function yp(e,n){return kl(e,n)}var Qh=xl,ev=Il,bp=h("ZodInstanceOf",(e,n)=>{Kr.init(e,n)},{properties(e,n){return this.check(_n(e,n))}});function tv(e,n={}){let o=new bp({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,..._.normalizeParams(n)});return o._zod.bag.Class=e,o._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:o,path:[...o._zod.def.path??[]]})},o}var nv=(...e)=>wl({Codec:Wr,Boolean:Cn,String:Nn},...e);function rv(e){let n=fp(()=>Ln([jr(e),Ed(),Ad(),Cd(),Zr(n),Bd(jr(),n)]));return n}function ov(e,n){return new cp({type:"pipe",in:ya(e),out:n})}var EI={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function AI(e){ne({customError:e})}function OI(){return ne().customError}var _p;_p||(_p={});var Jr={};qe(Jr,{ZodISODate:()=>gt,ZodISODateTime:()=>ft,ZodISODuration:()=>vt,ZodISOTime:()=>ht,date:()=>zI,datetime:()=>NI,duration:()=>DI,time:()=>CI});function NI(e){return Nr(ft,e)}function zI(e){return zr(gt,e)}function CI(e){return Cr(ht,e)}function DI(e){return Dr(vt,e)}var T={...Un,...Wi,iso:Jr},LI=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function UI(e,n){let o=e.$schema;return o==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":o==="http://json-schema.org/draft-07/schema#"?"draft-7":o==="http://json-schema.org/draft-04/schema#"?"draft-4":n??"draft-2020-12"}function iv(e,n){return e.map((o,i)=>ii).check(i=>{let t=i.value;if(typeof t!="object"||t===null||Array.isArray(t))return;let r=Object.getOwnPropertyNames(t);if(n.minProperties!==void 0&&r.length=${n.minProperties} properties`,input:t,inst:e,continue:!0}),n.maxProperties!==void 0&&r.length>n.maxProperties&&i.issues.push({origin:"object",code:"too_big",maximum:n.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${n.maxProperties} properties`,input:t,inst:e,continue:!0}),n.keySchema)for(let a of r){let s=n.keySchema.safeParse(a);s.success||i.issues.push({code:"invalid_key",origin:"record",issues:s.error.issues,input:a,path:[a],continue:!0})}}).pipe(e)}function $p(e,n){if(e===null)return"z";let o=typeof e;if(o!=="object"){if(o==="number"&&Number.isNaN(e))return null;let i=String(e);return`${o[0]}${i.length}:${i}`}if(n.has(e))return null;n.add(e);try{if(Array.isArray(e)){let r=[];for(let a of e){let s=$p(a,n);if(s===null)return null;r.push(s)}return`a${r.length}:[${r.join(",")}]`}let i=Object.keys(e).sort(),t=[];for(let r of i){let a=$p(e[r],n);if(a===null)return null;t.push(`${r.length}:${r}=${a}`)}return`o${t.length}:{${t.join(",")}}`}finally{n.delete(e)}}var FI=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),ZI=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Xr(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Xr):typeof e.$ref=="string"?!0:Object.entries(e).some(([n,o])=>FI.has(n)?Xr(o):!ZI.has(n)||typeof o!="object"||o===null?!1:Object.values(o).some(Xr))}function av(e){return e===1?"element":"elements"}function GI(e,n){return T.transform(i=>i).check(i=>{let t=i.value;if(Array.isArray(t)){if(n.uniqueItems===!0){let r=new Map;for(let a=0;a=a)break;sn.maxContains&&i.issues.push({code:"custom",message:`Array must contain at most ${n.maxContains} matching ${av(n.maxContains)}`,input:t,continue:!0})}}}).pipe(e)}function sv(e,n){if(e!==!1)return e===void 0||e===!0?T.any():he(e,n)}var VI=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function uv(e,n){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return T.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let t=e.$ref;if(n.refs.has(t))return n.refs.get(t);if(n.processing.has(t))return T.lazy(()=>{if(!n.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return n.refs.get(t)});n.processing.add(t);let r=RI(t,n),a=he(r,n);return n.refs.set(t,a),n.processing.delete(t),a}if(e.enum!==void 0){let t=e.enum;if(n.version==="openapi-3.0"&&e.nullable===!0&&t.length===1&&t[0]===null)return T.null();if(t.length===0)return T.never();if(t.length===1)return T.literal(t[0]);if(t.every(a=>typeof a=="string"))return T.enum(t);let r=t.map(a=>T.literal(a));return r.length<2?r[0]:T.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return T.literal(e.const);let o=e.type;if(Array.isArray(o)){let t=o.map(r=>{let a={...e,type:r};return uv(a,n)});return t.length===0?T.never():t.length===1?t[0]:T.union(t)}if(!o)return T.any();let i;switch(o){case"string":{let t=T.string();if(e.format){let r=e.format;r==="email"?t=t.check(T.email()):r==="uri"||r==="uri-reference"?t=t.check(T.url()):r==="uuid"||r==="guid"?t=t.check(T.uuid()):r==="date-time"?t=t.check(T.iso.datetime({offset:!0})):r==="date"?t=t.check(T.iso.date()):r==="time"?t=t.check(T.regex(VI)):r==="duration"?t=t.check(T.iso.duration()):r==="hostname"?t=t.check(T.hostname()):r==="ipv4"?t=t.check(T.ipv4()):r==="ipv6"?t=t.check(T.ipv6()):r==="mac"?t=t.check(T.mac()):r==="cidr"?t=t.check(T.cidrv4()):r==="cidr-v6"?t=t.check(T.cidrv6()):r==="base64"?t=t.check(T.base64()):r==="base64url"?t=t.check(T.base64url()):r==="e164"?t=t.check(T.e164()):r==="credit_card"?t=t.check(T.creditCard()):r==="iban"?t=t.check(T.iban()):r==="jwt"?t=t.check(T.jwt()):r==="emoji"?t=t.check(T.emoji()):r==="nanoid"?t=t.check(T.nanoid()):r==="cuid"?t=t.check(T.cuid()):r==="cuid2"?t=t.check(T.cuid2()):r==="ulid"?t=t.check(T.ulid()):r==="xid"?t=t.check(T.xid()):r==="ksuid"&&(t=t.check(T.ksuid()))}typeof e.minLength=="number"&&(t=t.min(e.minLength)),typeof e.maxLength=="number"&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),i=t;break}case"number":case"integer":{let t=o==="integer"?T.number().int():T.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(t=t.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum=="number"?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(t=t.lt(e.maximum)),typeof e.multipleOf=="number"&&(t=t.multipleOf(e.multipleOf)),i=t;break}case"boolean":{i=T.boolean();break}case"null":{i=T.null();break}case"object":{let t={},r=e.properties||{},a=new Set(e.required||[]),s=typeof e.additionalProperties=="object"?he(e.additionalProperties,n):void 0;for(let[p,m]of Object.entries(r)){let f=he(m,n);ue(t,p,a.has(p)?f:f.optional())}if(e.patternProperties){let p=e.patternProperties,m=Object.keys(p),f=[];for(let y of m){let x=he(p[y],n),w=T.string().regex(new RegExp(y));f.push(T.looseRecord(w,x))}let g=[];if(Object.keys(t).length>0&&g.push(T.object(t).passthrough()),g.push(...f),g.length===0)i=T.object({}).passthrough();else if(g.length===1)i=g[0];else{let y=T.intersection(g[0],g[1]);for(let x=2;xnew RegExp(b)),w=i;i=i.check(b=>{if(!Pe(b.value))return;let P=[];for(let A of Object.keys(b.value))y.includes(A)||x.some(D=>D.test(A))||P.push(A);P.length&&b.issues.push({code:"unrecognized_keys",keys:P,input:b.value,inst:w})})}}else{let p=T.object(t);e.additionalProperties===!1?i=p.strict():s?i=p.catchall(s):i=p.passthrough()}let c=e.propertyNames!==void 0&&e.propertyNames!==!0,l=typeof e.minProperties=="number"?e.minProperties:void 0,d=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||l!==void 0||d!==void 0){let p;if(c){let m=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;p=he(m,n)}i=MI(i,{keySchema:p,minProperties:l,maxProperties:d})}break}case"array":{let t=e.prefixItems,r=e.items;if(t&&Array.isArray(t)){let a=typeof e.minItems=="number"?e.minItems:0,s=t.map(p=>he(p,n)),c=iv(s,a),l=Array.isArray(r)?void 0:sv(r,n),d=T.tuple(c);i=l?d.rest(l):d,typeof e.minItems=="number"&&(i=i.check(T.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(T.maxLength(e.maxItems)))}else if(Array.isArray(r)){let a=typeof e.minItems=="number"?e.minItems:0,s=r.map(p=>he(p,n)),c=iv(s,a),l=sv(e.additionalItems,n),d=T.tuple(c);i=l?d.rest(l):d,typeof e.minItems=="number"&&(i=i.check(T.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(T.maxLength(e.maxItems)))}else if(r!==void 0){let a=he(r,n),s=T.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),i=s}else i=T.array(T.any());(e.uniqueItems===!0||e.contains!==void 0)&&(i=GI(i,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?he(e.contains,n):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${o}`)}return i}function he(e,n){if(typeof e=="boolean")return e?T.any():T.never();let o=uv(e,n),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(l=>he(l,n)),c=T.union(s);o=i?T.intersection(o,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(l=>he(l,n)),c=T.xor(s);o=i?T.intersection(o,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)o=i?o:T.any();else{let s=i?o:he(e.allOf[0],n),c=i?0:1;for(let l=c;l0&&n.registry.add(o,t),e.description&&(o=o.describe(e.description)),o}function cv(e,n){if(typeof e=="boolean")return e?T.any():T.never();let o;try{o=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=UI(o,n?.defaultTarget),t=o.$defs||o.definitions||{},r={version:i,defs:t,refs:new Map,processing:new Set,rootSchema:o,registry:n?.registry??ce};return he(o,r)}var lv=Symbol("z.visit/resolving");function qr(e,n){let o=typeof n=="function"?n:(a,s)=>{let c=n[a._zod.def.type];return c?c(a,s):a},i=new Map;function t(a){let s=i.get(a);if(s===lv)return new wr({type:"lazy",getter:()=>i.get(a)});if(s!==void 0)return s;i.set(a,lv);let c=r(a),l=o(c,c!==a);return i.set(a,l),l}function r(a){let s=a._zod.def,c=s.type;switch(c){case"object":{let l=s.shape,d=Object.keys(l),p=!1,m={};for(let g of d){let y=t(l[g]);y!==l[g]&&(p=!0),m[g]=y}let f=s.catchall;return s.catchall&&(f=t(s.catchall),f!==s.catchall&&(p=!0)),p?K(a,{...s,shape:m,catchall:f}):a}case"array":{let l=t(s.element);return l===s.element?a:K(a,{...s,element:l})}case"tuple":{let l=s.items,d=!1,p=[];for(let f of l){let g=t(f);g!==f&&(d=!0),p.push(g)}let m=s.rest;return s.rest&&(m=t(s.rest),m!==s.rest&&(d=!0)),d?K(a,{...s,items:p,rest:m}):a}case"record":case"map":{let l=t(s.keyType),d=t(s.valueType);return l===s.keyType&&d===s.valueType?a:K(a,{...s,keyType:l,valueType:d})}case"set":{let l=t(s.valueType);return l===s.valueType?a:K(a,{...s,valueType:l})}case"union":{let l=s.options,d=!1,p=[];for(let m of l){let f=t(m);f!==m&&(d=!0),p.push(f)}return d?K(a,{...s,options:p}):a}case"intersection":{let l=t(s.left),d=t(s.right);return l===s.left&&d===s.right?a:K(a,{...s,left:l,right:d})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=t(s.innerType);return l===s.innerType?a:K(a,{...s,innerType:l})}case"pipe":{let l=t(s.in),d=t(s.out);return l===s.in&&d===s.out?a:K(a,{...s,in:l,out:d})}case"function":{let l=t(s.input),d=t(s.output);return l===s.input&&d===s.output?a:K(a,{...s,input:l,output:d})}case"lazy":{let l=s.getter,{_cachedInner:d,...p}=s;return K(a,{...p,getter:()=>t(l())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return a;default:return a}}return t(e)}function dv(e){return qr(e,{object:n=>n.partial(),union:n=>{let o=n._zod.def;return o.discriminator===void 0?n:Ln(o.options)}})}function HI(e,n){if(!n?.length)return e;let o=e._zod.def;return K(e,De(o,{checks:[...o.checks??[],...n]}),{parent:!0})}function pv(e){return HI(e.out,e.checks)}function BI(e){return e.in._zod.traits.has("$ZodTransform")?pv(e):e.in}function mv(e){return qr(e,{pipe:n=>BI(n._zod.def),default:(n,o)=>o?Mt(n._zod.def.innerType):n,catch:(n,o)=>o?n._zod.def.innerType:n})}function fv(e){return qr(e,{pipe:n=>pv(n._zod.def),prefault:(n,o)=>o?n._zod.def.innerType:n})}var kp={};qe(kp,{bigint:()=>XI,boolean:()=>JI,date:()=>qI,number:()=>KI,string:()=>WI});function WI(e){return Vc(Nn,e)}function KI(e){return Xc(zn,e)}function JI(e){return rl(Cn,e)}function XI(e){return il(Dn,e)}function qI(e){return hl(Fr,e)}var YI=new Set(["__proto__","prototype","constructor"]),Vt=u.string().min(1).max(256).refine(e=>!YI.has(e),"reserved storage key"),$a=u.json(),ka=256*1024,QI=5*1024*1024,gv=1024,hv=u.strictObject({key:Vt}),vv=u.object({value:$a}),yv=u.strictObject({key:Vt,value:$a}),bv=u.object({ok:u.literal(!0)}),_v=u.strictObject({key:Vt}),$v=u.object({ok:u.literal(!0)}),kv=u.strictObject({}).optional(),xv=u.object({keys:u.array(u.string()).max(gv)}),Iv=u.strictObject({key:Vt}),wv=u.object({value:u.string().nullable()}),Sv=u.strictObject({key:Vt,value:u.string().max(64*1024)}),Pv=u.object({ok:u.literal(!0)}),Tv=u.strictObject({key:Vt}),Ev=u.object({ok:u.literal(!0)}),Av=u.strictObject({}).optional(),Ov=u.object({status:u.enum(["os-keyring","unavailable"])}),Nv=u.strictObject({}).optional(),zv=u.object({settings:u.record(u.string(),$a)}),Cv=u.strictObject({key:Vt,value:$a}),Dv=u.object({ok:u.literal(!0)});var jn="x-orca-enum-since";var rt="1.4.160",xp="1.4.245";var Yr="1.4.246";var Lv=Yr,Uv=Yr;var je="1.4.248";var tw="Relative to the plugin root; `..` segments and Windows device names such as `CON` are refused.";function xa(e,n,o){return te(`${e} ${tw}`,n,o)}function te(e,n,o){return o?{description:e,"x-orca-since":n,examples:[...o]}:{description:e,"x-orca-since":n}}var nw=/^(?:con|prn|aux|nul|clock\$|conin\$|conout\$|com[1-9\u00B9\u00B2\u00B3]|lpt[1-9\u00B9\u00B2\u00B3])(?:\..*)?$/i,rw=/[<>:"|?*]/,Ia=String.raw`[^<>:"|?*\x00-\x1f\\/]*[^<>:"|?*\x00-\x1f\\/. ]`,Ip=new RegExp(`^${Ia}(?:[\\\\/]${Ia})*$`),Cz=new RegExp(`^${Ia}(?:/${Ia})*$`);function ow(e){return e.length===0||e==="."||e===".."?"empty and dot path segments are not allowed":e.endsWith(".")||e.endsWith(" ")?"path segments may not end with a dot or space":rw.test(e)||[...e].some(n=>n.charCodeAt(0)<=31)?"path segment contains a Windows-forbidden character or alternate-data-stream colon":nw.test(e)?"path segment is a Windows reserved device name":null}function iw(e){if(e.length===0||e.startsWith("/")||e.startsWith("\\"))return"must be a non-empty relative path";let n=e.split(/[\\/]/);for(let o of n){let i=ow(o);if(i)return i}return null}function wp(e){return iw(e)===null}var jv=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,aw=new Set(["__proto__","prototype","constructor"]),Sp=64;function Rv(e){return aw.has(e)}var Pp="must be a portable relative path inside the plugin directory",Rn=u.string().max(Sp).regex(jv,"must be kebab-case (a-z, 0-9, dashes)").refine(e=>!Rv(e),"must not be a reserved name"),wa=u.string().min(1).max(1024).regex(Ip,Pp).refine(e=>!Ip.test(e)||wp(e),Pp),Zz=u.string().min(1).max(1024).transform(e=>e.replace(/[\\/]+$/,"")).refine(wp,Pp),Mv=u.string().min(1).max(256).regex(/^[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*$/,"must be a portable command id");var sw="1.4.253",Qr=sw;var Fv=8,uw=2*1024*1024,cw=8*1024*1024;var lw=/^[A-Za-z0-9](?:[A-Za-z0-9 _.-]{0,46}[A-Za-z0-9])?$/,dw=/^(?:[1-9]\d{0,2}|1000)(?: (?:[1-9]\d{0,2}|1000))?$/,pw=u.object({path:wa.regex(/\.woff2?$/i,"must be a .woff or .woff2 file").meta(xa(`WOFF or WOFF2 file, at most ${uw/1024/1024} MB; its first bytes must match its extension. TTF, OTF and font collections are refused.`,Qr,["fonts/Geist-Variable.woff2"])),weight:u.string().regex(dw,'must be a weight from 1 to 1000, or a range such as "100 900"').refine(e=>{let[n,o=n]=e.split(" ").map(Number);return n<=o},"must list the lower weight first").optional().meta(te("CSS weight this file draws, or a range for a variable font. Defaults to `400`.",Qr,["400","100 900"])),style:u.enum(["normal","italic"]).optional().meta(te("Whether this file is the italic face. Defaults to `normal`.",Qr))}).strict().meta({id:"FontFaceContribution",description:"One file of a font family."}),Kz=u.object({family:u.string().regex(lw,"must be 1-48 ASCII letters, digits, spaces, dots, dashes or underscores").meta(te("Family name shown in the font pickers. Orca adds the plugin id, so a plugin font never replaces an installed or built-in font of the same name.",Qr,["Geist"])),faces:u.array(pw).min(1).max(Fv).meta(te(`The family's files, at most ${Fv}. All of a plugin's font files together may be at most ${cw/1024/1024} MB.`,Qr))}).strict().meta({id:"FontContribution",description:"A font family the user can pick for the terminal, editor or interface. It applies only once picked."});function Zv(e){return/ \([a-z0-9-]+\.[a-z0-9-]+\)$/i.test(e.trim())}var mw="Orca Nerd Font Symbols",fw=["SF Mono","Menlo","Monaco","Cascadia Mono","Consolas","DejaVu Sans Mono","Liberation Mono",mw,"Symbols Nerd Font Mono","MesloLGS Nerd Font","JetBrainsMono Nerd Font","Hack Nerd Font","monospace"];function Gv(e){let n=e.trim(),o=n?[`"${n}"`]:[],i=o.map(r=>r.toLowerCase()),t=Zv(n);for(let r of fw){let a=r.toLowerCase();(t||!i.some(s=>s.includes(a)))&&o.push(r==="monospace"?r:`"${r}"`)}return o.join(", ")}function Vv(e,n){let o=typeof e=="number"?e:Number.NaN;return Number.isFinite(o)?Math.min(900,Math.max(100,Math.round(o))):n}var gw=["fira code","fira mono","jetbrains mono","jetbrainsmono","cascadia code","cascadia mono","iosevka","victor mono","hasklig","monoid","operator mono","dank mono","mononoki","pragmatapro","recursive","monolisa","commit mono","geist mono","maple mono","departure mono"];function hw(e){if(!e)return!1;let n=e.split(",")[0]?.replace(/"/g,"").trim().toLowerCase()??"";return n?gw.some(o=>n.includes(o)):!1}function Hv(e,n){return e==="on"?!0:e==="off"?!1:hw(n)}function Tp(e,n){return Math.max(8,Math.min(32,e+n))}function Bv(e,n){return Tp(e-.5,n)}var vw=10,yw=24,bw=1,_w=3,$w=8,kw=400,xw=13;function Iw(e){return Ep(e?.editorFontFamily)||Wv(e?.terminalFontFamily)||"monospace"}function Wv(e){return typeof e=="string"?e:""}function Ep(e){return Wv(e).trim()}function ww(e){let n=Ep(e?.editorFontFamily)||Ep(e?.terminalFontFamily);return n.includes(",")?n:Gv(n)}function Sa(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Sw(e){let n=e?.editorFontSize;if(Sa(n))return Math.min(yw,Math.max(vw,n));let o=e?.terminalFontSize;return Sa(o)?o:xw}function Pw(e,n){if(!Sa(e))return;let o=e>=$w?e/n:e;return Math.min(_w,Math.max(bw,o))}function Kv(e,n,o="editor"){let i=Sw(e),t=o==="diff"?Bv(i,n):Tp(i,n),r=Iw(e),a=Pw(e?.editorLineHeight,i);return{fontFamily:r,cssFontFamily:ww(e),fontSize:t,fontWeight:Sa(e?.editorFontWeight)?String(Vv(e.editorFontWeight,kw)):"normal",lineHeight:a?Math.round(t*a):0,fontLigatures:Hv(Tw(e),r)}}function Tw(e){let n=e?.editorLigatures;return n==="on"||n==="auto"?n:"off"}function Jv(e){return e===!1?"off":"on"}function Xv(e){return e?.editorMinimapEnabled??!1}var le=["worker","panel","editor"],B=["worker"],Mn=["panel","editor"],C=e=>e;function Pa(e,n){return e.proposed!==!0||n}function qv(e,n){return n==="worker"?e.since:Math.max(e.since,e.framesSince??0)}var Yv="1.4.256",Ta=8*1024,Ap=u.object({fontFamily:u.string().min(1).max(Ta),cssFontFamily:u.string().min(1).max(Ta),fontSize:u.number().finite().positive(),fontWeight:u.string().min(1).max(16),lineHeight:u.number().finite().nonnegative(),fontLigatures:u.boolean(),wordWrap:u.enum(["on","off"]),minimap:u.boolean()}).strict();function Qv(e,n){let o=typeof n=="number"&&Number.isFinite(n)?n:0,i=Kv(e,o,"editor");return{fontFamily:i.fontFamily.slice(0,Ta),cssFontFamily:i.cssFontFamily.slice(0,Ta),fontSize:i.fontSize,fontWeight:i.fontWeight,lineHeight:i.lineHeight,fontLigatures:i.fontLigatures,wordWrap:Jv(e?.editorWordWrap),minimap:Xv(e)}}var ey={"editor.readTypography":C({summary:"The font family, size, weight, line height, ligatures, word wrap and minimap Orca's file editor uses now, editor zoom included. `editor.typography.changed` reports each change after.",since:6,scope:"desktop",capability:null,mutation:!1,surfaces:le,params:u.strictObject({}).optional(),result:Ap})};var yt=["workspace.created","workspace.removed","agent.status.changed","workspace.changed","editor.typography.changed"],gC=yt.length,Ew={"workspace.created":xp,"workspace.removed":xp,"agent.status.changed":rt,"workspace.changed":Uv,"editor.typography.changed":Yv},Ea=new Map([["worktree.created","workspace.created"],["worktree.removed","workspace.removed"]]);var hC=u.object({on:u.enum(yt).meta({...te("Event delivered to the plugin worker.",rt),[jn]:Ew})}).strict().meta({id:"EventContribution",description:"An event subscription. Requires `main`, the `trusted-worker` execution profile and the capability of the event's domain: `workspace:read` for workspace events, `agent:read` for agent events. Editor events need no capability."});var Aw=["success","failure","cancellation","superseded"],ty=[...Aw,"interruption","unconfirmed"];var Fn=["working","blocked","waiting","done"];var UC=new Set(Fn);var Op=["claude","codebuddy","codex","qoder","qoder-cn","qwen-code","gemini","antigravity","opencode","opencode2","pi","mimo-code","droid","grok","devin","omp","prime-agent","copilot","cursor","kimi","muse","zcode","dsh","jcode","kiro","hermes"];var HC=new Set(Op);function ny(e){for(let n=0;ne===e.trim()&&!e.startsWith("-")&&!ny(e),"invalid session id"),Lw=u.strictObject({name:bt,input:u.json().optional(),timeoutMs:u.number().int().min(1).max(Aa).optional()}),Uw=u.object({output:u.json()}),jw=50,Rw=512,Mw=u.strictObject({}).optional(),Fw=u.object({agents:u.array(u.object({terminalId:u.string().min(1).max(1024).nullable(),title:u.string().max(512).nullable(),agent:u.string().max(128).nullable(),state:u.enum(Fn),stateStartedAt:u.number().finite(),sessionId:Ht.nullable().optional(),task:u.object({title:u.string().max(Rw)}).nullable().optional()})).max(jw)}),Zw=u.strictObject({event:u.enum(yt)}),Gw=u.object({ok:u.literal(!0)}),oy={"plugin.request":C({summary:"Asks the plugin's own worker to run the handler it registered with `orca.panels.handle(name)`, starting the worker if needed; resolves with what the handler returned. `unknown_method` when no handler has that name.",since:2,scope:"plugin-private",capability:null,mutation:!1,surfaces:Mn,params:Lw,result:Uw}),"agents.list":C({summary:"The agents in the focused workspace: their terminal, title, agent kind, status, session and dispatched task. `agent.status.changed` reports each change after.",since:2,scope:"active-workspace",capability:"agent:read",mutation:!1,surfaces:le,params:Mw,result:Fw}),"events.subscribe":C({summary:"Delivers a workspace, agent or editor event to this panel as `orca.on(event)`; needs the event's read capability, when it has one. The frame APIs call it for you.",since:2,scope:"plugin-private",capability:null,mutation:!1,surfaces:Mn,params:Zw,result:Gw})};var Vw=/[\p{Cc}\p{Cf}\p{Cs}\p{Zl}\p{Zp}]/u,Hw=new Set(["‌","‍"]);function Bw(e){return Hw.has(e)||!Vw.test(e)}function iy(e){return[...e].filter(Bw).join("")}var Ww=/[\t\n\v\f\r\u0085\u2028\u2029]+/g;function Kw(e){return iy(e.replace(Ww," "))}function eo(e){let n=e.overwrite(Kw);return e.minLength?n.min(e.minLength,"must contain visible characters"):n}var U={maxNodes:5e3,maxDepth:64,maxTreeBytes:524288,maxTextLength:16384,maxLabelLength:1024,maxPropsPerNode:32,maxSelectOptions:500,maxEventArgs:8,maxCallbackIdLength:64,maxRadioOptions:50,maxTableColumns:32,maxTableRows:5e3,maxTreeItems:2e3,maxTreeItemDepth:16,maxKeyValueItems:200,maxDocumentLength:65536,maxEventArgItems:5e3},pD={maxBytes:640*1024,maxMessages:200,perMs:1e4,maxDepth:U.maxDepth*2+24,maxObjects:U.maxNodes*8+1024};var Ke={render:"ui.render",event:"ui.event",error:"ui.error",ack:"ui.ack",ready:"ui.ready",hydrate:"ui.hydrate",visibility:"ui.visibility",persist:"ui.persist",retain:"ui.retain",snapshot:"ui.snapshot",restore:"ui.restore"};var Jw={Input:{value:"value",change:"onChange"},Textarea:{value:"value",change:"onChange"},Switch:{value:"checked",change:"onChange"},Checkbox:{value:"checked",change:"onChange"},Select:{value:"value",change:"onChange"},RadioGroup:{value:"value",change:"onChange"},Slider:{value:"value",change:"onChange"},Tabs:{value:"value",change:"onChange"},Collapsible:{value:"open",change:"onChange"},Table:{value:"selected",change:"onSelectionChange"},Tree:{value:"selected",change:"onSelect"}},Xw=new Map(Object.entries(Jw));function Np(e){return Xw.get(e)??null}var Oa="$edit";var Na=/^[A-Za-z0-9_.:-]+$/,ay=u.object({$callback:u.string().min(1).max(U.maxCallbackIdLength).regex(Na)}).strict(),Bt=["neutral","accent","success","warning","danger"],V=u.string().max(U.maxLabelLength),W=V.min(1),Q=ay.optional(),Re=u.string().regex(/^[a-z0-9-]{1,64}$/),Ae=u.enum(["none","xs","sm","md","lg"]).optional(),to=u.enum(["start","center","end","stretch"]).optional(),ot=u.enum(Bt).optional(),za=u.enum(["xs","sm","md"]).optional(),zp=u.enum(["solid","outline","ghost"]).optional(),N=u.boolean().optional(),Zn=u.string().max(U.maxTextLength),no=u.enum(["sm","md","lg","none"]).optional(),Wt=u.string().min(1).max(U.maxLabelLength),ve={[Oa]:u.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).optional()};function M(e,n){return{props:e,children:n}}var _t=["activity","bar-chart-3","bell","blocks","book","bot","bug","calendar","cloud","code","database","file-text","flag","folder","gauge","globe","hammer","layers","lightbulb","package","plug","puzzle","rocket","star","terminal","wrench","zap","add","remove","delete","edit","refresh","search","settings","check","close","info","warning","error","open-external","copy","download","upload","play","pause","stop","more","expand","collapse","next","filter","branch","file","agent","link"],qw=Object.fromEntries(_t.slice(_t.indexOf("add")).map(e=>[e,Yr])),ID=new Map(_t.map(e=>[e.replaceAll("-",""),e]));var Yw=["html","components"],Qw=/\.(?:m?js|tsx?|mts|jsx)$/i,wD=u.object({id:Rn.meta(te("Panel id, unique among this plugin's panels. The reserved names `constructor` and `prototype` are refused.",rt,["dashboard"])),title:eo(u.string().min(1).max(256)).meta(te("Title shown on the panel tab and its tooltip.",rt,["Dashboard"])),icon:u.enum(_t).optional().meta({...te("Icon shown in the right-sidebar activity bar. Defaults to `plug`.",rt,["database"]),[jn]:qw}),entry:wa.meta(xa(`What the panel runs: an HTML page for \`ui: "html"\`, a \`.js\`/\`.mjs\` module for \`ui: "components"\`. Either may instead be a \`.ts\`/\`.tsx\`/\`.mts\`/\`.jsx\` file, which Orca transpiles when it loads (needs \`engines.orca\` \`>=${Lv}\`; an \`html\` panel then gets a generated page around it). It is trusted code: install panels you trust.`,rt,["dist/panel.html"])),ui:u.enum(Yw).optional().meta(te("How the panel draws its UI. `html` (default) shows `entry` as a web page in an isolated frame; `components` runs `entry` as a hidden module and Orca draws the component tree it returns with its own controls.",Yr,["components"]))}).strict().refine(e=>e.ui!=="components"||Qw.test(e.entry),{path:["entry"],message:"a components panel entry must be a .js, .mjs, .ts, .tsx, .mts or .jsx module"}).meta({id:"PanelContribution",description:"A sidebar panel. Requires the `sandboxed-ui` execution profile or higher."});var eS="1.4.248";var tS=64,nS=256,Gn=eS,sy={text:eo(u.string().max(tS)).optional().meta(te("Short label shown in the status bar.",Gn,["3 blocked"])),icon:u.enum(_t).optional().meta(te("Icon shown before the text, from the panel icon set.",Gn,["bell"])),tone:u.enum(Bt).optional().meta(te("Colour of the item. Defaults to `neutral`.",Gn,["warning"])),tooltip:eo(u.string().max(nS)).optional().meta(te("Shown on hover. Defaults to the plugin name.",Gn))},zD=u.object({id:Rn.meta(te("Item id, unique among this plugin's status bar items; `statusBar.update` names it.",Gn,["blocked-count"])),...sy,command:Mv.optional().meta(te("Id of a command this plugin contributes in `contributes.commands`, run when the item is pressed.",Gn,["guard.showLog"]))}).strict().meta({id:"StatusBarItemContribution",description:"An item in the status bar. Requires the `declarative` profile; a `trusted-worker` can change it with `statusBar.update`."}),uy=u.strictObject({...sy,visible:u.boolean().optional()});var rS=u.strictObject({id:Rn,...uy.shape}),oS=u.object({ok:u.literal(!0)}),cy={"statusBar.update":C({summary:"Changes one of the plugin's `contributes.statusBarItems` (named by `id`): fields given replace their current value, `visible: false` hides it. Desktop app only; lasts until Orca restarts, and is hidden while the plugin is disabled. A plugin with `main` and status bar items has its worker started when it is enabled and kept running while it stays enabled, so a worker can poll and update its items without an event or a hook.",since:2,scope:"plugin-private",capability:null,mutation:!1,surfaces:B,params:rS,result:oS})};function Cp(e){return e==="linux"?"orca-ide":e==="win32"?"orca.cmd":"orca"}function iS(e){return{...e,launchCmd:e.launchCmd??e.detectCmd,expectedProcess:e.expectedProcess??e.detectCmd}}var aS={claude:{detectCmd:"claude",promptInjectionMode:"argv",pasteNeedsTypedRequest:!0,draftPromptFlag:"--prefill",preflightTrust:"claude",draftPasteReadySignal:"claude-composer-prompt",workerStartReadsComposerMarker:!0,ctrlEnterEncoding:"csi-u"},"claude-agent-teams":{detectCmd:"orca",detectCmdAliases:["orca-dev","orca-ide"],detectRequiredCommands:["claude"],detectUnsupportedRuntimes:["win32","wsl"],launchCmd:"orca claude-teams",launchCmdByPlatform:{linux:`${Cp("linux")} claude-teams`,win32:`${Cp("win32")} claude-teams`},expectedProcess:"claude",promptInjectionMode:"stdin-after-start",pasteNeedsTypedRequest:!0,preflightTrust:"claude",draftPasteReadySignal:"claude-composer-prompt",workerStartReadsComposerMarker:!0,ctrlEnterEncoding:"csi-u"},codebuddy:{detectCmd:"codebuddy",detectCmdAliases:["cbc"],promptInjectionMode:"argv"},openclaude:{detectCmd:"openclaude",promptInjectionMode:"argv",draftPromptFlag:"--prefill"},codex:{detectCmd:"codex",promptInjectionMode:"argv",windowsInputRecordPasteNewline:"alt-enter",preflightTrust:"codex",draftPasteReadySignal:"codex-composer-prompt",draftPasteReadyTimeoutMs:2e4,submitRetryDelayMs:1200},autohand:{detectCmd:"autohand",promptInjectionMode:"stdin-after-start"},ante:{detectCmd:"ante",promptInjectionMode:"stdin-after-start"},trae:{detectCmd:"traecli",promptInjectionMode:"argv",argvPromptSeparator:"--"},opencode:{detectCmd:"opencode",promptInjectionMode:"flag-prompt",draftPasteReadySignal:"render-cursor-after-bracketed-paste",submitPasteReadySignal:"opencode-agent-row",draftPasteReadyTimeoutMs:2e4,ctrlEnterEncoding:"csi-u",composerReadyCaptures:["opencode-1-18-32-timed-boot-slow","opencode-1-18-32-timed-boot-hidden-pane","opencode-1-18-32-timed-first-launch","opencode-cmd-2-0-21-timed-warm-server"]},opencode2:{detectCmd:"opencode2",launchCmd:"opencode2 --standalone",promptInjectionMode:"flag-prompt",draftPasteReadySignal:"render-cursor-after-bracketed-paste",submitPasteReadySignal:"opencode-agent-row",draftPasteReadyTimeoutMs:2e4,composerReadyCaptures:["opencode-2-0-18-timed-boot-hidden-pane","opencode-2-0-21-timed-cold-standalone","opencode-2-0-21-timed-cold-standalone-hidden-pane","opencode-2-0-21-timed-natural-load-enter-dropped","opencode-2-0-14-timed-cold-standalone"]},"mimo-code":{detectCmd:"mimo",promptInjectionMode:"flag-prompt",draftPasteReadySignal:"render-cursor-after-bracketed-paste"},pi:{detectCmd:"pi",promptInjectionMode:"argv",draftPromptEnvVar:"ORCA_PI_PREFILL",windowsShiftEnterEncoding:"csi-u"},omp:{detectCmd:"omp",promptInjectionMode:"argv",draftPromptEnvVar:"ORCA_OMP_PREFILL",windowsShiftEnterEncoding:"csi-u"},"prime-agent":{detectCmd:"prime-agent",promptInjectionMode:"argv",argvPromptSeparator:"--",windowsShiftEnterEncoding:"csi-u"},qoder:{detectCmd:"qodercli",detectCmdAliases:["qoder"],promptInjectionMode:"flag-prompt-interactive",preflightTrust:"qoder"},"qoder-cn":{detectCmd:"qoderclicn",detectCmdAliases:["qodercn"],promptInjectionMode:"flag-prompt-interactive",preflightTrust:"qoder-cn"},gemini:{detectCmd:"gemini",promptInjectionMode:"flag-prompt-interactive"},antigravity:{detectCmd:"agy",promptInjectionMode:"flag-prompt-interactive",preflightTrust:"antigravity",draftPasteReadySignal:"antigravity-composer-prompt",draftPasteReadyTimeoutMs:2e4,submitLineSettleMsPerLine:45},aider:{detectCmd:"aider",promptInjectionMode:"stdin-after-start"},goose:{detectCmd:"goose",promptInjectionMode:"stdin-after-start"},amp:{detectCmd:"amp",promptInjectionMode:"stdin-after-start"},kilo:{detectCmd:"kilo",promptInjectionMode:"stdin-after-start"},kiro:{detectCmd:"kiro-cli",launchCmd:"kiro-cli chat --tui",promptInjectionMode:"stdin-after-start"},crush:{detectCmd:"crush",promptInjectionMode:"stdin-after-start"},aug:{detectCmd:"auggie",promptInjectionMode:"stdin-after-start"},cline:{detectCmd:"cline",promptInjectionMode:"stdin-after-start"},freebuff:{detectCmd:"freebuff",promptInjectionMode:"stdin-after-start"},codebuff:{detectCmd:"codebuff",promptInjectionMode:"stdin-after-start"},"command-code":{detectCmd:"command-code",launchCmd:"command-code --trust",promptInjectionMode:"argv"},continue:{detectCmd:"cn",promptInjectionMode:"stdin-after-start"},cursor:{detectCmd:"cursor-agent",promptInjectionMode:"argv",preflightTrust:"cursor"},droid:{detectCmd:"droid",promptInjectionMode:"argv",windowsShiftEnterEncoding:"csi-u",ctrlEnterEncoding:"csi-u"},kimi:{preflightTrust:"kimi",detectCmd:"kimi",detectCmdAliases:["kimi-code"],promptInjectionMode:"stdin-after-start"},"mistral-vibe":{detectCmd:"vibe",detectCmdAliases:["mistral-vibe"],promptInjectionMode:"stdin-after-start"},"qwen-code":{detectCmd:"qwen",promptInjectionMode:"stdin-after-start",submitRetryDelayMs:1200},rovo:{detectCmd:"acli",launchCmd:"acli rovodev run",promptInjectionMode:"stdin-after-start"},hermes:{detectCmd:"hermes",launchCmd:"hermes --tui",promptInjectionMode:"hermes-query"},openclaw:{detectCmd:"openclaw",promptInjectionMode:"stdin-after-start"},copilot:{detectCmd:"copilot",promptInjectionMode:"flag-interactive",preflightTrust:"copilot",draftPasteReadySignal:"copilot-composer-prompt"},grok:{detectCmd:"grok",promptInjectionMode:"argv",argvPromptSeparator:"--",draftPasteReadySignal:"grok-composer-prompt",ctrlEnterEncoding:"csi-u"},muse:{detectCmd:"muse",launchCmd:"muse --trust-workspace",promptInjectionMode:"stdin-after-start"},dsh:{detectCmd:"dsh-tui",detectCmdAliases:["dst"],detectRequiredCommands:["dsh"],launchCmd:"dsh-tui .",expectedProcess:"dsh",promptInjectionMode:"stdin-after-start",draftPasteReadySignal:"dsh-composer-prompt",submitRetryDelayMs:1e3,submitRetryBudgetMs:3e4},zcode:{detectCmd:"zcode",expectedProcess:"zcode-cli",promptInjectionMode:"stdin-after-start",draftPasteReadySignal:"zcode-composer-prompt",composerReadyCaptures:["zcode-composer-ready"]},devin:{detectCmd:"devin",promptInjectionMode:"argv",argvPromptSeparator:"--"},jcode:{detectCmd:"jcode",launchCmd:"jcode",expectedProcess:"jcode",promptInjectionMode:"stdin-after-start"}},sS=Object.fromEntries(Object.entries(aS).map(([e,n])=>[e,iS(n)]));function ly(e){return typeof e=="string"&&Object.hasOwn(sS,e)}var Dp=["worktree.history.back","worktree.history.forward","sidebar.left.toggle","sidebar.sleepingWorkspaces.toggle","floatingWorkspace.maximize","tab.rename","workspace.rename","workspace.openBoard","view.tasks","sidebar.right.toggle","sidebar.explorer.toggle","sidebar.search.toggle","sidebar.sourceControl.toggle","sidebar.checks.toggle","sidebar.ports.toggle"];var JD=new Set(Dp);var uS=500,cS=500,Lp=2e3,Oe=1024,$t=Oe,ro=4096,dy=ro,ye=u.string().min(1).max($t),Kt=u.string().min(1).max($t),Vn=ye,Up=Kt;var py=u.string().max($t).nullable(),lS=u.strictObject({includeStatus:u.boolean().optional()}).optional(),dS=u.object({state:u.enum(["working","permission","done","active","inactive"]),unread:u.boolean(),terminalCount:u.number().int().nonnegative(),lastActivityAt:u.number().finite().nullable()}),pS=u.object({workspaces:u.array(u.object({id:Vn,kind:u.enum(["worktree","folder"]),name:u.string().max(512),project:u.string().max(512).nullable().optional(),projectId:u.string().max($t).nullable().optional(),path:u.string().max($t),branch:u.string().max(512).nullable(),hostId:py,status:dS.optional()})).max(uS),truncated:u.boolean(),statusTruncated:u.boolean().optional()}),mS=u.strictObject({}).optional(),fS=u.object({projects:u.array(u.object({id:u.string().min(1).max($t),name:u.string().max(512),kind:u.enum(["git","folder"]),hostId:py,path:u.string().max($t),hidden:u.boolean().optional()})).max(cS),truncated:u.boolean()}),gS=u.strictObject({workspaceId:Vn}),hS=u.object({opened:u.literal(!0)}),vS=200,yS=[[0,31],[127,159],[173,173],[847,847],[1564,1564],[4447,4448],[6068,6069],[6155,6159],[8203,8207],[8232,8238],[8288,8303],[10240,10240],[12644,12644],[65024,65039],[65279,65279],[65440,65440],[65520,65531],[119155,119162],[917504,921599]],bS=e=>{let n=e.codePointAt(0)??0;return yS.some(([o,i])=>n>=o&&n<=i)};function oo(e){return![...e].some(bS)}var Hn=u.string().max(vS).refine(e=>e.trim().length>0,"name must not be blank").refine(oo,"name must be one line of plain text"),_S=u.strictObject({workspaceId:Vn,name:Hn}),$S=u.object({name:u.string()}),kS=u.strictObject({workspaceId:Vn,title:u.string().min(1).max(512).optional(),command:u.string().min(1).max(dy).optional()}),xS=u.object({terminalId:Up}),IS=u.strictObject({terminalId:Up,maxLines:u.number().int().min(1).max(Lp).optional()}),wS=u.object({lines:u.array(u.string()).max(Lp),truncated:u.boolean()}),io=u.string().min(1).max(64).refine(ly,"unknown agent"),SS=u.strictObject({workspaceId:Vn,agent:io,prompt:u.string().min(1).max(dy).optional()}),PS=u.object({terminalId:Up});function TS(e){let n=e.split(/[\\/]/);return!/^[a-z]:/i.test(e)&&n[0]!==""&&n.every(o=>o!=="..")&&n.some(o=>o!==""&&o!==".")}var ES=u.strictObject({workspaceId:Vn,path:u.string().min(1).max($t).refine(TS,"path must be relative and inside the workspace")}),AS=u.object({opened:u.literal(!0)}),OS=u.strictObject({action:u.enum(Dp)}),NS=u.object({ran:u.literal(!0)}),my={"workspace.list":C({summary:"Lists every workspace, Git worktrees and folders, on every host Orca reaches; `includeStatus` (host API 1.7) adds each one's agent status. `hostId` is the host a row records (`local`, `ssh:…`, `runtime:…`), or null when it records none, as for a project-group folder on this machine.",since:3,scope:"any-workspace",capability:"workspace:read",mutation:!1,surfaces:B,params:lS,result:pS}),"project.list":C({summary:"Lists your projects (repositories and folders) on every host; `id` is what `workspace.list` rows name as `projectId`. `hostId` is always named: `local`, `ssh:…` or `runtime:…`.",since:7,scope:"any-workspace",capability:"workspace:read",mutation:!1,surfaces:B,params:mS,result:fS}),"workspace.open":C({summary:"Shows a workspace in Orca, as clicking it in the sidebar does; a folder workspace needs the desktop app.",since:3,scope:"any-workspace",capability:"workspace:write",mutation:!0,surfaces:B,params:gS,result:hS}),"workspace.rename":C({summary:"Renames a workspace in Orca's sidebar, as renaming it by hand does; the name stays until it is renamed again.",since:5,scope:"any-workspace",capability:"workspace:write",mutation:!0,surfaces:B,params:_S,result:$S}),"terminal.create":C({summary:"Opens a terminal in a workspace, optionally running a command, in the background.",since:3,scope:"any-workspace",capability:"terminal:send",mutation:!0,surfaces:B,params:kS,result:xS}),"terminal.read":C({summary:`Reads a terminal's newest output as plain text, at most ${Lp} lines.`,since:3,scope:"explicit-terminal",capability:"terminal:read",mutation:!1,surfaces:B,params:IS,result:wS}),"agent.launch":C({summary:"Starts an agent's CLI in a new terminal of a workspace, in the background, and returns as soon as it starts; a `prompt` is sent once the agent is ready.",since:3,scope:"any-workspace",capability:"agent:launch",mutation:!0,surfaces:B,params:SS,result:PS}),"editor.open":C({summary:"Opens a file of a workspace in an editor tab of Orca's window; desktop app only. `workspace.open` shows the workspace.",since:3,scope:"any-workspace",capability:"workspace:write",mutation:!0,surfaces:B,params:ES,result:AS}),"commands.run":C({summary:"Runs one of Orca's built-in actions in its window, never a plugin's replacement of it; desktop app only.",since:3,scope:"desktop",capability:"workspace:write",mutation:!0,surfaces:B,params:OS,result:NS})};var jp=u.string().regex(/^[a-f0-9]{64}$/),fy=u.string().min(1).max(16*1024),zS=u.strictObject({expectedRevision:jp,app:fy,terminal:fy}),gy={"appearance.read":C({summary:"Reads the current desktop appearance revision for a conditional update.",since:4,scope:"desktop",capability:"appearance:write",mutation:!1,surfaces:B,params:u.strictObject({}).optional(),result:u.strictObject({revision:jp})}),"appearance.apply":C({summary:"Publishes owned app/editor and terminal colors and selects them in the desktop. Returns publication, not renderer acknowledgement.",since:4,scope:"desktop",capability:"appearance:write",mutation:!0,surfaces:B,params:zS,result:u.strictObject({revision:jp,themeId:u.templateLiteral(["plugin:",u.string()]),mode:u.enum(["dark","light"]),delivery:u.literal("published")})})};var ao=50,kt=512,Me=1024,so=u.object({workspaceId:ye.optional(),branch:u.string().max(kt),displayName:u.string().max(kt),terminals:u.array(u.object({id:u.string().min(1).max(Me),title:u.string().max(kt).optional()}).strict()).max(ao)}).strict().nullable();var CS=u.strictObject({workspaceId:ye}),DS=u.object({terminals:u.array(u.object({id:Kt,title:u.string().max(kt).optional()})).max(ao),truncated:u.boolean()}),hy=u.strictObject({terminalId:Kt}),LS=u.object({focused:u.boolean()}),US=u.object({closed:u.literal(!0)}),vy={"terminal.list":C({summary:`Lists a workspace's terminals, at most ${ao}; \`workspace.readContext\` lists the focused one's.`,since:7,scope:"any-workspace",capability:"workspace:read",mutation:!1,surfaces:B,params:CS,result:DS}),"terminal.focus":C({summary:"Shows any terminal's workspace and focuses its pane, as clicking it does; desktop app only. `focused` is false when a newer focus request won or the window did not move to it.",since:7,scope:"explicit-terminal",capability:"workspace:write",mutation:!0,surfaces:B,params:hy,result:LS}),"terminal.close":C({summary:"Closes a terminal of the focused workspace, or one this plugin opened (`terminal.create`, `agent.launch`), stopping what runs in it (local or SSH); closing its last pane closes the tab. Any other terminal is refused with `action_failed`. A plugin keeps its terminals until it is disabled or removed.",since:7,scope:"explicit-terminal",capability:"terminal:send",mutation:!0,surfaces:B,params:hy,result:US})};function jS(e){let n=e?.trim();if(!(!n||n==="default"))return/^[a-z0-9][a-z0-9._-]{0,63}$/.test(n)&&!n.endsWith(".")&&!/^(?:CON|PRN|AUX|NUL|COM[0-9]|LPT[0-9])(?:\..*)?$/i.test(n)?n:null}var RS=/[\\/]profiles[\\/]([^\\/]+)[\\/]agent[\\/]sessions[\\/]|[\\/]omp[\\/]profiles[\\/]([^\\/]+)[\\/]sessions[\\/]/;function yy(e){let n=e?.match(RS),o=jS(n?.[1]??n?.[2]);return o?["--profile",o]:[]}function by(e,n,o){let i=n.id;switch(e){case"codebuddy":return n.key==="session_id"?["codebuddy","--resume",i]:null;case"claude":return n.key==="session_id"?["claude",...n.effort?["--effort",n.effort]:[],"--resume",i]:null;case"cursor":return n.key==="conversation_id"?["cursor-agent","--resume",i]:null;case"codex":return n.key==="session_id"?["codex","resume",i]:null;case"qoder-cn":return n.key==="session_id"?["qoderclicn","--resume",i]:null;case"qwen-code":return n.key==="session_id"?["qwen","--resume",i]:null;case"qoder":return n.key==="session_id"?["qodercli","--resume",i]:null;case"gemini":return n.key==="session_id"?["gemini","--resume",i]:null;case"antigravity":return n.key==="conversation_id"?["agy","--conversation",i]:null;case"opencode":return n.key==="session_id"?["opencode","--session",i]:null;case"opencode2":return n.key==="session_id"?["opencode2","--session",i]:null;case"pi":return n.key==="session_id"&&n.transcriptPath?["pi","--session",n.transcriptPath]:null;case"prime-agent":return n.key==="session_id"&&n.transcriptPath?["prime-agent","--resume",n.transcriptPath]:null;case"mimo-code":return n.key==="session_id"?["mimo","--session",i]:null;case"droid":return n.key==="session_id"?["droid","--resume",i]:null;case"grok":return n.key==="session_id"?["grok","--resume",i]:null;case"devin":return n.key==="session_id"?["devin","--resume",i]:null;case"omp":{if(n.key!=="session_id")return null;let t=o?.trim()||n.transcriptPath?.trim()||i;return["omp",...yy(t),"--resume",t]}case"copilot":return n.key==="session_id"?["copilot",`--resume=${i}`]:null;case"kimi":return n.key==="session_id"?["kimi","--session",i]:null;case"muse":return n.key==="session_id"?["muse","resume",i]:null;case"zcode":return n.key==="session_id"?["zcode","--resume",i]:null;case"dsh":return n.key==="session_id"?["dsh-tui","--backend=dsh","--resume",i]:null;case"jcode":return n.key==="session_id"?["jcode","--resume",i]:null;case"kiro":return n.key==="session_id"?["kiro-cli","--resume-id",i]:null;case"hermes":return n.key==="session_id"?["hermes","--resume",i]:null}}var MS=["session_id","conversation_id"];function _y(e){return MS.find(n=>by(e,{key:n,id:"id"})!==null)??null}var FS=u.strictObject({projectId:u.string().min(1).max(Oe),hostId:u.string().min(1).max(Oe).optional(),name:Hn.optional(),baseBranch:u.string().min(1).max(255).refine(e=>!e.startsWith("-")&&!/\s/.test(e)&&oo(e),"baseBranch must be a branch or ref name").optional(),agent:io.optional(),prompt:u.string().min(1).max(ro).optional(),setup:u.literal("skip").optional(),open:u.boolean().optional()}).refine(e=>e.prompt===void 0||e.agent!==void 0,{message:"prompt requires agent",path:["prompt"]}),ZS=u.object({workspaceId:ye,terminalId:Kt.optional()}),GS=u.strictObject({workspaceId:ye,agent:u.enum(Op).refine(e=>_y(e)!==null,"this agent cannot resume by session id"),sessionId:Ht}),VS=u.object({terminalId:Kt,started:u.boolean()}),$y={"workspace.create":C({summary:"Creates a workspace (a new branch and worktree) in a Git project, local or SSH, and returns its id; with `agent`, starts that agent there once setup has run, in the background unless `open`; if the agent fails after the workspace exists, the error names its id. Orca's workspace-create and agent hooks run as for any create.",since:8,scope:"any-workspace",capability:"workspace:create",paramCapabilities:{agent:"agent:launch"},mutation:!0,surfaces:B,params:FS,result:ZS}),"agent.resume":C({summary:"Resumes an agent's earlier session by its `sessionId` in a new terminal of a workspace, in the background; `started` is false when an Orca terminal already runs it. From host API 1.9, a session no Orca pane runs that Agent Session History lists on this computer (among the workspace's own sessions and the 200 newest) is prepared and started as Orca's own Resume does, in the agent account Orca would pick; only `agent:launch` is needed, since the plugin must already know the id. Other sessions, and workspaces on another host, resume by id. In WSL it uses the distro's default agent account, as `agent.launch` does.",since:8,scope:"any-workspace",capability:"agent:launch",mutation:!0,surfaces:B,params:GS,result:VS})};function HS(e){let n=new Date(e);return n.setHours(0,0,0,0),n.getTime()}function BS(e,n){let o=new Date(e);return o.setDate(o.getDate()+n),o.setHours(0,0,0,0),o.getTime()}function WS(e,n){let o=new Date(n);if(!e.months.has(o.getMonth()+1))return!1;let i=e.daysOfMonth.has(o.getDate()),t=e.daysOfWeek.has(o.getDay());return e.dayOfMonthRestricted&&e.dayOfWeekRestricted?i||t:i&&t}function ky(e,n){let o=HS(n);for(let i=0;i<3294;i+=1){if(WS(e,o))return!0;o=BS(o,1)}return!1}function xy(e,n){let o=e.charCodeAt(n);if(o<55296||o>56319||n+1>=e.length)return o;let i=e.charCodeAt(n+1);return i<56320||i>57343?o:(o-55296)*1024+(i-56320)+65536}function Rp(e,n={}){let o=n.stopAfterBytes,i=0;for(let t=0;t(o??0))return{byteLength:i,exceededLimit:!0};r>65535&&(t+=1)}return{byteLength:i,exceededLimit:!1}}var RL=1024*1024,ML=new TextEncoder,FL=new Uint8Array(0);function Iy(e){return e<=127?1:e<=2047?2:e<=65535?3:4}var BL=16*1024*1024,WL=16*1024*1024;var KS=256*1024;function wy(e,n){return e.length>n||Rp(e,{stopAfterBytes:n}).exceededLimit}var Sy={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12},Py={SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6,SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};function Mp(e,n,o){let i=e.toUpperCase(),r=n?.[i]??Number(i);if(!Number.isInteger(r))throw new Error(`Invalid cron ${o}.`);return r}function Bn(e){let n=new Set;for(let o of e.value.split(",")){let i=o.trim();if(!i)throw new Error(`Invalid cron ${e.field}.`);let t=i.split("/");if(t.length>2)throw new Error(`Invalid cron ${e.field}.`);let[r,a]=t;if(!r)throw new Error(`Invalid cron ${e.field}.`);let s=a===void 0?1:Number(a);if(!Number.isInteger(s)||s<1)throw new Error(`Invalid cron ${e.field}.`);let c=e.distinctValueCount??e.max-e.min+1;if(e.rejectOversizedStep&&s>c)throw new Error(`Cron ${e.field} step must be between 1 and ${c}.`);let l,d;if(r==="*")l=e.min,d=e.max;else if(r.includes("-")){let f=r.split("-");if(f.length!==2||!f[0]||!f[1])throw new Error(`Invalid cron ${e.field}.`);let[g,y]=f;l=Mp(g,e.names??null,e.field),d=Mp(y,e.names??null,e.field)}else l=Mp(r,e.names??null,e.field),d=a===void 0?l:e.max;let p=e.normalize?.(l)??l,m=e.normalize?.(d)??d;if(le.max||de.max||pe.max||me.max||l>d)throw new Error(`Invalid cron ${e.field}.`);for(let f=l;f<=d;f+=s)n.add(e.normalize?.(f)??f)}if(n.size===0)throw new Error(`Invalid cron ${e.field}.`);return n}function Fp(e){return!e.split(",").some(n=>n.split("/")[0].trim()==="*")}var JS=2*1024,XS=["SU","MO","TU","WE","TH","FR","SA"];function qS(e){let n=new Map;for(let a of e.split(";")){let[s,c]=a.split("=");s&&c&&n.set(s.toUpperCase(),c)}let o=n.get("FREQ");if(o!=="HOURLY"&&o!=="DAILY"&&o!=="WEEKLY")throw new Error("Unsupported automation recurrence.");let i=Number(n.get("BYHOUR")??"9"),t=Number(n.get("BYMINUTE")??"0");if(!Number.isInteger(i)||i<0||i>23)throw new Error("Invalid recurrence hour.");if(!Number.isInteger(t)||t<0||t>59)throw new Error("Invalid recurrence minute.");let r=(n.get("BYDAY")??"").split(",").filter(Boolean);if(o==="WEEKLY"&&(r.length===0||r.some(a=>!XS.includes(a))))throw new Error("Invalid recurrence day.");return{kind:"rrule",freq:o,byDay:r,byHour:i,byMinute:t}}function YS(e,n={}){let o=QS(e,6);if(o.length!==5)throw new Error("Cron schedule must have five fields.");let[i,t,r,a,s]=o,c=n.rejectOversizedStep??!1;return{kind:"cron",minutes:Bn({value:i,min:0,max:59,field:"minute",rejectOversizedStep:c}),hours:Bn({value:t,min:0,max:23,field:"hour",rejectOversizedStep:c}),daysOfMonth:Bn({value:r,min:1,max:31,field:"day of month",rejectOversizedStep:c}),months:Bn({value:a,min:1,max:12,field:"month",names:Sy,rejectOversizedStep:c}),daysOfWeek:Bn({value:s,min:0,max:7,field:"day of week",names:Py,normalize:l=>l===7?0:l,distinctValueCount:7,rejectOversizedStep:c}),dayOfMonthRestricted:Fp(r),dayOfWeekRestricted:Fp(s)}}function QS(e,n=5){if(wy(e,JS))return[];let o=[],i=-1;for(let t=0;t<=e.length;t+=1){if(!(t===e.length)&&!eP(e.charCodeAt(t))){i===-1&&(i=t);continue}if(i!==-1&&(o.push(e.slice(i,t)),i=-1,o.length>=n))break}return o}function eP(e){return e===32||e>=9&&e<=13||e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function tP(e,n={}){let o=e.trim();return o.includes("=")?qS(o):YS(o,n)}function nP(e,n){try{let o=tP(e,n);return o.kind!=="cron"||ky(o,Date.now())}catch{return!1}}function Ty(e){return nP(e,{rejectOversizedStep:!0})}var rP=200,oP=16384,Ay=2048,Wn=Oe,Ca=u.string().min(1).max(Wn),Oy=u.string().max(oP).refine(e=>e.trim().length>0,"prompt must not be blank"),Ny=u.string().min(1).max(Ay).refine(Ty,"schedule must be an RRULE or a cron expression"),zy=u.string().min(1).max(64).refine(iP,"unknown time zone");function iP(e){try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).resolvedOptions().timeZone!==""}catch{return!1}}var aP=u.strictObject({}).optional(),sP=u.object({id:Ca,name:u.string().max(512),agent:u.string().max(64),prompt:u.string().max(ro),promptTruncated:u.boolean(),projectId:u.string().max(Wn).nullable(),hostId:u.string().max(Wn).nullable(),workspaceId:u.string().max(Wn).nullable(),workspaceMode:u.enum(["existing","new-per-run"]),schedule:u.string().max(Ay).nullable(),timezone:u.string().max(64),enabled:u.boolean(),nextRunAt:u.number().finite().nullable(),lastRunAt:u.number().finite().nullable(),createdByThisPlugin:u.boolean()}),uP=u.object({automations:u.array(sP).max(rP),truncated:u.boolean()}),cP=u.strictObject({name:Hn,prompt:Oy,agent:io,projectId:u.string().min(1).max(Wn).optional(),hostId:u.string().min(1).max(Wn).optional(),workspaceId:ye.optional(),schedule:Ny,timezone:zy.optional(),enabled:u.boolean().optional(),creationKey:u.string().min(1).max(128).refine(oo,"creationKey must be plain text").optional()}).refine(e=>e.projectId===void 0!=(e.workspaceId===void 0),"give exactly one of projectId and workspaceId").refine(e=>e.hostId===void 0||e.projectId!==void 0,{message:"hostId goes with projectId",path:["hostId"]}),lP=u.object({automationId:Ca}),Cy=u.enum(["cancelled","consent-unavailable","changed"]).optional(),dP=u.strictObject({automationId:Ca,name:Hn.optional(),prompt:Oy.optional(),schedule:Ny.optional(),timezone:zy.optional(),enabled:u.boolean().optional()}).refine(e=>Object.entries(e).some(([n,o])=>n!=="automationId"&&o!==void 0),"nothing to change"),pP=u.object({updated:u.boolean(),reason:Cy}),mP=u.strictObject({automationId:Ca}),fP=u.object({deleted:u.boolean(),reason:Cy}),Ey="Orca first asks the person about an automation this plugin did not create (or created before it was removed or disabled); if they decline or cannot be asked, or it changes while they are asked, nothing changes and `reason` says why.",Dy={"automation.list":C({summary:"Lists the automations this Orca schedules, at most 200, with each one's prompt cut to 4096 characters.",since:8,scope:"any-workspace",capability:"automation:read",mutation:!1,surfaces:B,params:aP,result:uP}),"automation.create":C({summary:"Creates an automation that starts `agent` with `prompt` on `schedule`, even when the plugin is not running, with the person's settings for that agent; Orca's Automations page shows it as created by the plugin.",since:8,scope:"any-workspace",capability:"automation:write",mutation:!0,surfaces:B,params:cP,result:lP}),"automation.update":C({summary:`Changes an automation's name, prompt, schedule, time zone or whether it is enabled. ${Ey} Orca also asks before a new prompt or schedule, or resuming, for any automation whose runs use extra agent settings the person chose.`,since:8,scope:"any-workspace",capability:"automation:write",mutation:!0,surfaces:B,params:dP,result:pP}),"automation.delete":C({summary:`Deletes an automation. ${Ey}`,since:8,scope:"any-workspace",capability:"automation:write",mutation:!0,surfaces:B,params:mP,result:fP})};var Ly=200;var gP=512,hP=u.strictObject({workspaceId:ye.optional(),limit:u.number().int().min(1).max(Ly).optional()}).optional(),vP=u.object({sessions:u.array(u.object({sessionId:Ht,agent:u.string().max(128),title:u.string().max(gP),workspaceId:ye.nullable(),hostId:u.string().max(Oe),branch:u.string().max(512).nullable(),createdAt:u.number().finite().nullable(),updatedAt:u.number().finite(),messageCount:u.number().int().nonnegative(),totalTokens:u.number().int().nonnegative(),running:u.boolean()})).max(Ly),truncated:u.boolean()}),Uy={"agent.listSessions":C({summary:"Past agent sessions in Orca's Agent Session History on this computer (WSL distributions included on Windows), newest first: title, agent, workspace, branch, times, message and token counts, and whether an Orca terminal here runs it. Leaves out Antigravity IDE conversations and subagent transcripts, and never gives the conversation or file paths, though a title can be the start of its first message. `agent.resume` resumes one by its `sessionId`, for agents that resume by id.",since:9,scope:"any-workspace",capability:"history:read",mutation:!1,surfaces:B,params:hP,result:vP})};var yP=u.strictObject({projectId:u.string().min(1).max(Oe),hostId:u.string().min(1).max(Oe).optional(),hidden:u.boolean()}),bP=u.object({hostId:u.string().min(1).max(Oe),hidden:u.boolean()}),jy={"project.setHidden":C({summary:"Hides a project from Orca's sidebar, or shows it again, as Hide Project in its menu does. View-only: its workspaces, terminals, agents and automations keep running, `workspace.list` still lists its workspaces, `project.list` marks it `hidden`, and Orca's Hidden projects list can show it again. It changes one host's copy of the project; on a paired Orca server it hides the project for everyone connected.",since:9,scope:"any-workspace",capability:"workspace:write",mutation:!0,surfaces:B,params:yP,result:bP})};var Ry={...cy,...gy,...my,...jy,...vy,...$y,...Dy,...Uy};var _P=4096,$P=u.strictObject({}).optional(),kP=u.strictObject({terminalId:u.string().min(1).max(Me),text:u.string().min(1).max(_P),enter:u.boolean().default(!1)}),xP=u.object({accepted:u.boolean()}),IP=u.strictObject({title:u.string().min(1).max(120),body:u.string().max(1e3).optional()}),wP=u.object({delivered:u.boolean()}),Zp={openExternal:"shell.openExternal",saveAs:"files.saveAs"},SP=8192,PP=["http:","https:","mailto:"],My=64*1024*1024,TP=u.strictObject({url:u.string().min(1).max(SP).refine(zP,"url must be an http:, https: or mailto: URL")}),EP=u.object({opened:u.boolean(),reason:u.enum(["cancelled","consent-unavailable"]).optional()}),AP=u.union([u.string().max(My),u.custom(e=>e instanceof ArrayBuffer||e instanceof Uint8Array,"data must be a string or ArrayBuffer").refine(e=>e.byteLength<=My,"data exceeds 64 MiB").meta({type:"ArrayBuffer"})]),OP=u.strictObject({suggestedName:u.string().min(1).max(255).optional(),mimeType:u.string().min(1).max(255).optional(),data:AP}),NP=u.object({status:u.enum(["saved","cancelled"])});function zP(e){try{return PP.includes(new URL(e).protocol)}catch{return!1}}var xt={"workspace.readContext":C({summary:"Id, branch, name and terminal ids of the focused workspace, or null when none is focused.",since:0,scope:"active-workspace",capability:"workspace:read",mutation:!1,surfaces:le,params:$P,result:so}),"terminal.sendText":C({summary:"Types text into one terminal named by id, optionally pressing Enter.",since:0,scope:"explicit-terminal",capability:"terminal:send",mutation:!0,surfaces:B,params:kP,result:xP}),"notifications.show":C({summary:"Shows a desktop notification.",since:0,scope:"desktop",capability:"notifications:show",mutation:!0,surfaces:le,params:IP,result:wP}),"storage.get":C({summary:"Reads a JSON value from the plugin's private store; null when absent.",since:0,scope:"plugin-private",capability:"storage:own",mutation:!1,framesSince:2,surfaces:le,params:hv,result:vv}),"storage.set":C({summary:"Writes a JSON value to the plugin's private store.",since:0,scope:"plugin-private",capability:"storage:own",mutation:!0,framesSince:2,surfaces:le,params:yv,result:bv}),"storage.delete":C({summary:"Removes a key from the plugin's private store.",since:0,scope:"plugin-private",capability:"storage:own",mutation:!0,framesSince:2,surfaces:le,params:_v,result:$v}),"storage.keys":C({summary:"Lists the keys in the plugin's private store.",since:0,scope:"plugin-private",capability:"storage:own",mutation:!1,framesSince:2,surfaces:le,params:kv,result:xv}),"secrets.get":C({summary:"Reads a secret from the plugin's encrypted secrets file; null when absent.",since:0,scope:"plugin-private",capability:"secrets:own",mutation:!1,framesSince:2,surfaces:le,params:Iv,result:wv}),"secrets.set":C({summary:"Stores a secret in the plugin's encrypted secrets file.",since:0,scope:"plugin-private",capability:"secrets:own",mutation:!0,framesSince:2,surfaces:le,params:Sv,result:Pv}),"secrets.delete":C({summary:"Removes a secret from the plugin's encrypted secrets file.",since:0,scope:"plugin-private",capability:"secrets:own",mutation:!0,framesSince:2,surfaces:le,params:Tv,result:Ev}),"secrets.protection":C({summary:"How secrets are protected at rest: `os-keyring`, or `unavailable` (no OS key store, or Linux `basic_text`), where `secrets.set` fails.",since:1,scope:"plugin-private",capability:"secrets:own",mutation:!1,framesSince:2,surfaces:le,params:Av,result:Ov}),"settings.get":C({summary:"Reads every setting the plugin owns.",since:0,scope:"plugin-private",capability:"settings:own",mutation:!1,framesSince:2,surfaces:le,params:Nv,result:zv}),"settings.set":C({summary:"Writes one setting the plugin owns.",since:0,scope:"plugin-private",capability:"settings:own",mutation:!0,framesSince:2,surfaces:le,params:Cv,result:Dv}),"shell.openExternal":C({summary:"Opens an http:, https: or mailto: URL in the default browser. Needs a click or key press in the frame; desktop app only. Orca asks the person before an http(s) host the plugin was not allowed; `opened` is false if they cancel.",since:1,scope:"desktop",capability:null,userActivation:!0,mutation:!1,surfaces:Mn,params:TP,result:EP}),"files.saveAs":C({summary:"Offers data (a string or ArrayBuffer, up to 64 MiB) in Orca's save dialog; the plugin never learns the path. Needs a click or key press in the frame; desktop app only.",since:1,scope:"desktop",capability:null,userActivation:!0,mutation:!0,surfaces:Mn,params:OP,result:NP}),...oy,...Ry,...ey},Fy=Object.keys(xt).filter(Zy),CP=Fy.filter(e=>Pa(xt[e],!1));function Zy(e){return Object.hasOwn(xt,e)}function Da(e){return Zy(e)?xt[e]:null}var Gy=Math.max(...CP.map(e=>xt[e].since));function Kn(e,n=!1){return Fy.filter(o=>{let i=xt[o];return i.surfaces.includes(e)&&Pa(i,n)})}function La(e,n){return Kn(e).filter(o=>n||xt[o].userActivation!==!0)}function Ua(e,n="panel"){return Math.max(0,...e.map(o=>qv(xt[o],n)))}var Fe=1,z0=u.number().refine(e=>e===Fe,{error:e=>typeof e.input=="number"&&e.input>Fe?`targets host API ${e.input}, but this Orca supports only ${Fe}; update Orca`:`must be ${Fe}`}).meta({const:Fe});function Vy(e,n,o){if(!e.paramCapabilities||typeof n!="object"||n===null)return null;for(let[i,t]of Object.entries(e.paramCapabilities))if(Object.getOwnPropertyDescriptor(n,i)?.value!==void 0&&!o.includes(t))return{param:i,capability:t};return null}var DP=new Set(["rate_limited","unavailable","timeout","conflict"]);function Je(e,n=e,o){return Object.assign(new Error(n),{code:e,retryable:DP.has(e),...o===void 0?{}:{retryAfterMs:o}})}var LP=new Set(["plugin.request","events.subscribe","storage.get","storage.set","storage.delete","storage.keys","settings.get","settings.set","secrets.get","secrets.set","secrets.delete","secrets.protection"]);function ja(e,n){return typeof e=="object"&&e!==null&&n in e?Object.getOwnPropertyDescriptor(e,n)?.value:void 0}function Hy(e){let n={storage:new Map(Object.entries(e.storage??{})),settings:new Map(Object.entries(e.settings??{})),secrets:new Map(Object.entries(e.secrets??{}))},o=new Set,i=(a,s,c)=>{if(c===void 0?n[a].delete(s):n[a].set(s,c),a!=="secrets")for(let l of o)l(a,s);return{ok:!0}},t=null;async function r(a){let s=String(ja(a,"name")),c=ja(a,"input");if(!e.requests||!Object.hasOwn(e.requests,s)){if(t)return{output:await t(s,c)??null};throw Je("unknown_method",`no panel handler named ${s}`)}let l=e.requests[s];return{output:(typeof l=="function"?await l(c):l)??null}}return{handles:a=>LP.has(a),async answer(a,s){let c=String(ja(s,"key")),l=ja(s,"value");switch(a){case"plugin.request":return r(s);case"storage.get":return{value:n.storage.get(c)??null};case"storage.keys":return{keys:[...n.storage.keys()]};case"settings.get":return{settings:Object.fromEntries(n.settings)};case"secrets.get":return{value:n.secrets.get(c)??null};case"secrets.protection":return{status:"os-keyring"};case"storage.set":return i("storage",c,l);case"settings.set":return i("settings",c,l);case"secrets.set":return i("secrets",c,l);case"storage.delete":return i("storage",c,void 0);case"secrets.delete":return i("secrets",c,void 0);default:return{ok:!0}}},routeRequests(a){return t=a,()=>{t===a&&(t=null)}},onChange(a){return o.add(a),()=>o.delete(a)},snapshot:()=>({storage:Object.fromEntries(n.storage),settings:Object.fromEntries(n.settings),secrets:Object.fromEntries(n.secrets)})}}var Ra=class extends Error{constructor(o,i){super(i);this.code=o}code};function UP(e){return typeof e=="function"}var By={ok:!0};function jP(e){return e.result.safeParse(By).success}var Gp={"workspace.readContext":null,"notifications.show":{delivered:!0},"shell.openExternal":{opened:!0},"files.saveAs":{status:"saved"},"agents.list":{agents:[]},"project.list":{projects:[],truncated:!1},"project.setHidden":e=>({hostId:e.hostId??"local",hidden:e.hidden}),"terminal.list":{terminals:[],truncated:!1},"terminal.focus":{focused:!0},"terminal.close":{closed:!0},"automation.list":{automations:[],truncated:!1},"agent.listSessions":{sessions:[],truncated:!1},"editor.readTypography":Qv({terminalFontSize:14},0)};function Wy(e,n){let o=new Set(e.capabilities??n),i=new Map(Object.entries(e.results??{})),t=Hy(e),r={panel:La("panel",!0),worker:Kn("worker",!0)},a=[],s=[],c=new Set,l=0,d=(g,y)=>{throw new Ra(g,y)};async function p(g,y,x){let w=Da(g);if(!w)return d("unknown_method",`${g} does not exist in this Orca`);if(!w.surfaces.includes(x))return d("not_permitted",`${g} is not available to ${x}s`);if(w.userActivation===!0){if(l===0)return d("not_permitted",`${g} needs a click or key press in the frame`);l-=1}if(w.capability&&!o.has(w.capability))return d("capability_denied",`${g} needs the ${w.capability} capability`);let b=w.params.safeParse(y);if(!b.success)return d("invalid_params",b.error.issues[0]?.message??"invalid params");let P=Vy(w,b.data,[...o]);return P?d("capability_denied",`${g} with ${P.param} needs the ${P.capability} capability`):b.data}async function m(g,y,x){let w;try{w=await p(g,y,x)}catch(E){throw E instanceof Ra?(s.push({method:g,code:E.code,message:E.message}),Je(E.code,E.message)):E}let b=Da(g);if(!b)throw Je("unknown_method",g);let P=!i.has(g)&&t.handles(g),A=jP(b);if(!i.has(g)&&!P&&!Object.hasOwn(Gp,g)&&!A)throw Je("unavailable",`the test configured no result for ${g}`);let D=i.has(g)?i.get(g):Object.hasOwn(Gp,g)?Gp[g]:By,I=P?await t.answer(g,w):UP(D)?await D(w):D,O=b.result.safeParse(I);if(!O.success)throw new TypeError(`mockHost: the result configured for ${g} does not match the host API: ${O.error.issues[0]?.message??"invalid result"}`);return O.data}let f=g=>({api:{major:Fe,minor:Ua(r[g])},call(y,x){a.push({method:y,params:x});let w=m(y,x,g);return c.add(w),w.catch(()=>{}).finally(()=>c.delete(w)),w},has:y=>r[g].some(x=>x===y)});return{calls:a,refusals:s,capabilities:[...o],callsOf:g=>a.filter(y=>y.method===g).map(y=>y.params),respond:(g,y)=>i.set(g,y),grantGesture:()=>{l=1},data:()=>t.snapshot(),onDataChange:g=>t.onChange(g),routeRequests:g=>t.routeRequests(g),async idle(){for(;c.size>0;)await Promise.allSettled(c)},bridge:f("panel"),worker:f("worker")}}var RP=u.object({label:W,labelHidden:N,value:Zn.optional(),defaultValue:Zn.optional(),placeholder:V.optional(),rows:u.number().int().min(2).max(20).optional(),maxLength:u.number().int().positive().max(U.maxTextLength).optional(),invalid:N,disabled:N,onChange:Q,onSubmit:Q,...ve}).strict(),MP=u.object({label:W,description:V.optional(),checked:N,defaultChecked:N,disabled:N,onChange:Q,...ve}).strict(),FP=u.object({label:W,labelHidden:N,value:V.optional(),defaultValue:V.optional(),options:u.array(u.object({value:W,label:W,description:V.optional(),disabled:N}).strict()).max(U.maxRadioOptions),orientation:u.enum(["vertical","horizontal"]).optional(),disabled:N,onChange:Q,...ve}).strict(),Ma=u.number().refine(Number.isFinite,"must be finite"),ZP=u.object({label:W,labelHidden:N,value:Ma.optional(),defaultValue:Ma.optional(),min:Ma.optional(),max:Ma.optional(),step:u.number().positive().refine(Number.isFinite).optional(),showValue:N,disabled:N,onChange:Q,...ve}).strict(),GP=u.object({label:W,description:V.optional(),error:V.optional(),required:N}).strict(),Ky={Textarea:M(RP,"none"),Checkbox:M(MP,"none"),RadioGroup:M(FP,"none"),Slider:M(ZP,"none"),Field:M(GP,"any")};var VP=u.object({label:W,value:V.optional(),defaultValue:V.optional(),onChange:Q,...ve}).strict(),HP=u.object({value:W,label:W,icon:Re.optional(),disabled:N}).strict(),BP=u.object({title:W,description:V.optional(),open:N,defaultOpen:N,disabled:N,onChange:Q,...ve}).strict(),WP=u.object({label:W,gap:Ae}).strict(),KP=u.object({columns:u.number().int().min(1).max(6).optional(),minItemWidth:u.enum(["xs","sm","md","lg"]).optional(),gap:Ae}).strict(),Jy={Tabs:M(VP,"tabs"),Tab:M(HP,"any"),Collapsible:M(BP,"any"),Toolbar:M(WP,"any"),Grid:M(KP,"any")};function Ze(e){return typeof e=="object"&&e!==null}var uo=["long","short","duration"],Vp=u.number().refine(Number.isFinite,"must be a finite time in milliseconds"),Xy=u.object({type:u.literal("relative"),at:Vp,format:u.enum(uo).optional()}).strict(),JP=[["day",864e5],["hour",36e5],["minute",6e4],["second",1e3]];function XP(e){let n=Math.abs(e),[o,i]=JP.find(([,t])=>n>=t)??["second",1e3];return{value:Math.trunc(e/i),unit:o}}function qy(e,n,o,i){let{value:t,unit:r}=XP(e-n);return o==="duration"?new Intl.NumberFormat(i,{style:"unit",unit:r,unitDisplay:"narrow"}).format(Math.abs(t)):new Intl.RelativeTimeFormat(i,{numeric:o==="long"?"auto":"always",style:o==="long"?"long":"narrow"}).format(t,r)}var Hp=u.string().min(1).max(64),qP=u.union([u.string().max(U.maxLabelLength),u.number(),u.boolean(),u.null(),Xy]),Yy=e=>new Set(e.map(n=>n.key)).size===e.length,YP=u.object({label:W,columns:u.array(u.object({key:Hp,label:W,align:u.enum(["start","center","end"]).optional(),width:u.enum(["auto","xs","sm","md","lg"]).optional(),minWidth:u.enum(["auto","xs","sm","md"]).optional(),hideBelow:u.enum(["sm","md"]).optional(),sortable:N}).strict()).min(1).max(U.maxTableColumns).refine(Yy,"column keys must be unique"),rows:u.array(u.object({key:Wt,cells:u.record(Hp,qP.refine(e=>typeof e!="number"||Number.isFinite(e))).refine(e=>Object.keys(e).length<=U.maxTableColumns),disabled:N}).strict()).max(U.maxTableRows).refine(Yy,"row keys must be unique"),sort:u.object({column:Hp,direction:u.enum(["asc","desc"])}).strict().optional(),selectionMode:u.enum(["none","single","multiple"]).optional(),selected:u.array(Wt).max(U.maxTableRows).optional(),defaultSelected:u.array(Wt).max(U.maxTableRows).optional(),hasMore:N,loading:N,emptyText:V.optional(),maxHeight:no,onSortChange:Q,onSelectionChange:Q,onRowAction:Q,onLoadMore:Q,...ve}).strict(),QP=u.object({key:Wt,label:W,description:V.optional(),icon:Re.optional(),disabled:N,hasChildren:N,children:u.array(u.unknown()).optional()}).strict();function eT(e){let n=[],o=new Set,i=[{raw:e,out:n,depth:1}],t=0;for(let r=i.pop();r;r=i.pop()){if(r.depth>U.maxTreeItemDepth)return`items nest deeper than ${U.maxTreeItemDepth}`;for(let a of r.raw){if(++t>U.maxTreeItems)return`more than ${U.maxTreeItems} items`;let s=QP.safeParse(Ze(a)?a:null);if(!s.success)return"each item needs a key and a label";let{children:c,...l}=s.data;if(o.has(l.key))return`duplicate item key ${JSON.stringify(l.key.slice(0,64))}`;o.add(l.key);let d=l;r.out.push(d),c&&(d.children=[],i.push({raw:c,out:d.children,depth:r.depth+1}))}}return n}var tT=u.array(u.unknown()).transform((e,n)=>{let o=eT(e);return typeof o=="string"?(n.addIssue({code:"custom",message:o}),u.NEVER):o}),nT=u.object({label:W,items:tT,selected:V.optional(),defaultSelected:V.optional(),expanded:u.array(Wt).max(U.maxTreeItems).optional(),defaultExpanded:u.array(Wt).max(U.maxTreeItems).optional(),maxHeight:no,onSelect:Q,onToggle:Q,onAction:Q,...ve}).strict(),Qy={Table:M(YP,"none"),Tree:M(nT,"none")};var eb=u.string().max(U.maxDocumentLength),rT=/\.(?:png|jpe?g|webp)$/i;function oT(e){return rT.test(e)&&!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)&&!/[\\\0?#]/.test(e)&&e.split("/").every(n=>n!==""&&n!=="."&&n!=="..")}var iT=u.object({content:eb}).strict(),aT=u.object({code:eb,language:u.string().regex(/^[A-Za-z0-9_+#.-]{1,64}$/).optional(),label:V.optional(),lineNumbers:N,wrap:N,maxHeight:no}).strict(),sT=u.object({src:u.string().max(512).refine(oT,"must be an image file in the plugin"),alt:V,size:u.enum(["xs","sm","md","lg","full"]).optional(),fit:u.enum(["contain","cover"]).optional(),rounded:N}).strict(),uT=u.object({label:V.optional(),items:u.array(u.object({label:W,value:u.union([V,u.number().refine(Number.isFinite),u.boolean(),u.null()]),tone:ot,code:N}).strict()).max(U.maxKeyValueItems)}).strict(),cT=u.object({tone:ot,title:V.optional(),icon:Re.optional()}).strict(),lT=u.object({at:Vp,format:u.enum(uo).optional(),tone:ot,muted:N}).strict(),dT=u.object({shape:u.enum(["text","block","circle"]).optional(),lines:u.number().int().min(1).max(10).optional(),label:V.optional()}).strict(),tb={Markdown:M(iT,"none"),CodeView:M(aT,"none"),Image:M(sT,"none"),KeyValue:M(uT,"none"),Callout:M(cT,"any"),Skeleton:M(dT,"none"),RelativeTime:M(lT,"none")};var pT=4096,Jn=u.union([u.number().min(0).max(pT),u.string().regex(/^(100|[1-9]?[0-9])%$/)]).optional(),mT=["none","muted","card",...Bt],fT=u.object({direction:u.enum(["row","column"]).optional(),gap:Ae,padding:Ae,paddingX:Ae,paddingY:Ae,margin:Ae,align:to,justify:u.enum(["start","center","end","between"]).optional(),wrap:N,grow:N,shrink:N,width:Jn,height:Jn,minWidth:Jn,minHeight:Jn,maxWidth:Jn,maxHeight:Jn,columns:u.number().int().min(1).max(6).optional(),scroll:u.enum(["x","y","both"]).optional(),border:u.union([u.boolean(),u.enum(Bt)]).optional(),radius:u.enum(["none","sm","md","lg","full"]).optional(),background:u.enum(mT).optional()}).strict(),nb={Box:M(fT,"any")};var gT=_t,rb=new Set(gT),hT=u.object({gap:Ae,align:to}).strict(),vT=u.object({gap:Ae,align:to,justify:u.enum(["start","center","end","between"]).optional(),wrap:N}).strict(),yT=u.object({tone:ot,muted:N,size:za,weight:u.enum(["regular","medium","semibold"]).optional(),truncate:N}).strict(),bT=u.object({level:u.union([u.literal(1),u.literal(2),u.literal(3)]).optional()}).strict(),_T=u.object({variant:zp,tone:ot,size:za,icon:Re.optional(),tooltip:V.optional(),disabled:N,onPress:Q}).strict(),$T=u.object({icon:Re,label:W,tooltip:V.optional(),variant:zp,tone:ot,size:za,disabled:N,onPress:Q}).strict(),kT=u.object({tone:ot}).strict(),xT=u.object({title:V.optional(),description:V.optional()}).strict(),IT=u.object({label:V.optional()}).strict(),wT=u.object({title:V.optional(),description:V.optional(),icon:Re.optional(),current:N,disabled:N,onPress:Q}).strict(),ST=u.object({label:W,labelHidden:N,value:Zn.optional(),defaultValue:Zn.optional(),placeholder:V.optional(),type:u.enum(["text","search","password"]).optional(),maxLength:u.number().int().positive().max(U.maxTextLength).optional(),invalid:N,disabled:N,onChange:Q,onSubmit:Q,...ve}).strict(),PT=u.object({label:W,checked:N,defaultChecked:N,disabled:N,onChange:Q,...ve}).strict(),TT=u.object({label:W,labelHidden:N,value:V.optional(),defaultValue:V.optional(),placeholder:V.optional(),options:u.array(u.object({value:W,label:W,disabled:N}).strict()).max(U.maxSelectOptions),disabled:N,onChange:Q,...ve}).strict(),ET=u.object({orientation:u.enum(["horizontal","vertical"]).optional()}).strict(),AT=u.object({label:W,labelHidden:N,value:u.number().min(0).max(100).optional()}).strict(),OT=u.object({label:W,labelHidden:N}).strict(),NT=u.object({title:W,description:V.optional(),icon:Re.optional()}).strict(),zT=u.object({href:u.string().max(2048).regex(/^(https?:\/\/|mailto:)/i).optional(),onPress:Q}).strict(),CT=u.object({block:N}).strict(),co={Stack:M(hT,"any"),Row:M(vT,"any"),Text:M(yT,"inline"),Heading:M(bT,"inline"),Button:M(_T,"text"),IconButton:M($T,"none"),Badge:M(kT,"text"),Card:M(xT,"any"),List:M(IT,"items"),ListItem:M(wT,"any"),Input:M(ST,"none"),Switch:M(PT,"none"),Select:M(TT,"none"),Separator:M(ET,"none"),Progress:M(AT,"none"),Spinner:M(OT,"none"),EmptyState:M(NT,"any"),Link:M(zT,"text"),Code:M(CT,"text"),...Ky,...Jy,...Qy,...tb,...nb};function Bp(e){return typeof e=="string"&&Object.hasOwn(co,e)}var TU=Object.keys(co).filter(Bp),ob=new Set(["Text","Link","Code","Badge","RelativeTime"]),ib=new Set(["Button","IconButton","Input","Switch","Select","Link","ListItem","Textarea","Checkbox","RadioGroup","Slider","Tabs","Collapsible","Table","Tree","Markdown"]),Fa={items:"ListItem",tabs:"Tab"};var DT=new Set(["type","key","props","children"]),Wp=32,LT=8,UT=/^[A-Z][A-Za-z0-9]{0,63}$/,jT=20,RT=new Map([[Fa.items,"items"],[Fa.tabs,"tabs"]]),MT={ListItem:"List",Tab:"Tabs"};function ab(e){return e==="items"||e==="tabs"?Fa[e]:void 0}var Za=class extends Error{};function re(e,n){throw new Za(`${e}: ${n}`)}function FT(e,n){return e===void 0?[]:(Array.isArray(e)||re(n,"children must be an array"),e)}function ZT(e,n,o){let i=co[e].props.shape,t={};for(let[r,a]of Object.entries(n)){if(a===void 0)continue;if(!Object.hasOwn(i,r)){o(`${e}: ignored unknown prop "${r.slice(0,64)}"`);continue}let s=i[r].safeParse(a);if(!s.success){o(`${e}: ignored invalid ${r}`);continue}t[r]=s.data}for(let[r,a]of Object.entries(i))if(!Object.hasOwn(t,r)&&!a.safeParse(void 0).success)return o(`${e}: missing required ${r}; showing a placeholder`),null;return typeof t.icon=="string"&&!rb.has(t.icon)&&o(`${e}: unknown icon "${t.icon}"; showing a fallback glyph`),t}function sb(e){if(e===null)return{ok:!0,tree:null,nodes:0,warnings:[]};let n=new Set,o=l=>{n.sizeU.maxTextLength&&re(w,"text is too long"),r+ ++a>U.maxNodes&&re(w,`more than ${U.maxNodes} nodes`),s+=LT+Ce.length,s>U.maxTreeBytes&&re(w,`tree exceeds ${U.maxTreeBytes} bytes`),x.push(Ce);continue}Ze(d)||re(w,"expected a node, string or number");let b=d.type,P=Bp(b);!P&&(typeof b!="string"||!UT.test(b))&&re(w,`invalid component name ${JSON.stringify(String(b)).slice(0,80)}`),(f==="none"||f==="text")&&re(w,`${m} accepts only text`),f==="inline"&&P&&!ob.has(b)&&re(w,`${m} accepts only text, Text, Link, Code, Badge and RelativeTime`);let A=ab(f),D=typeof b=="string"?RT.get(b):void 0;A!==void 0&&b!==A&&re(w,`${m} holds only ${A}`),D!==void 0&&D!==f&&re(w,`${b} must be a direct child of ${MT[b]??"its container"}`),g&&ib.has(b)&&re(w,`a ListItem with onPress cannot contain a ${b}`),++r+a>U.maxNodes&&re(w,`more than ${U.maxNodes} nodes`),p>U.maxDepth&&re(w,`deeper than ${U.maxDepth}`);for(let Ce of Object.keys(d))DT.has(Ce)||re(w,`unknown node field ${Ce.slice(0,64)}`);let I=d.key;I!==void 0&&((typeof I!="string"||I.length>U.maxLabelLength)&&re(w,"key must be a short string"),y.has(I)&&re(w,`duplicate key ${JSON.stringify(I.slice(0,64))} among siblings`),y.add(I));let O=I===void 0?{}:{key:I};if(!P){o(`unknown component ${b}; showing a placeholder`),x.push({type:"Unsupported",...O,props:{name:b},children:[]}),s+=Wp+b.length;continue}let E=d.props??{};(!Ze(E)||Object.keys(E).length>U.maxPropsPerNode)&&re(w,"props must be an object with few fields");let H=ZT(b,E,o);if(!H){x.push({type:"Unsupported",...O,props:{name:b},children:[]}),s+=Wp+b.length;continue}s+=Wp+JSON.stringify(H).length,s>U.maxTreeBytes&&re(w,`tree exceeds ${U.maxTreeBytes} bytes`);let L=[],oe={type:b,...O,props:H,children:L};x.push(oe);let be=FT(d.children,w);be.length>U.maxNodes&&re(w,`more than ${U.maxNodes} children`);let ze=new Set,go=g||b==="ListItem"&&H.onPress!==void 0;for(let Ce=be.length-1;Ce>=0;Ce--)t.push({raw:be[Ce],depth:p+1,parentType:b,policy:co[b].children,inPressable:go,siblingKeys:ze,out:L,path:`${w}.children.${Ce}`})}}catch(l){if(l instanceof Za)return{ok:!1,error:l.message};throw l}let c=i[0];return typeof c=="object"?{ok:!0,tree:c,nodes:r,warnings:[...n]}:{ok:!1,error:"tree: expected a node"}}var Xn=u.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),Jt=u.string().min(1).max(64),Kp=u.union([u.string().max(U.maxTextLength),u.number().refine(Number.isFinite),u.boolean(),u.null()]),ub=u.array(Kp).max(U.maxEventArgItems),GT=u.union([Kp,ub,u.record(u.string().max(64),u.union([Kp,ub])).refine(e=>Object.keys(e).length<=16,"too many fields")]),MU=u.object({document:Jt,revision:Xn,callback:u.string().min(1).max(U.maxCallbackIdLength).regex(Na),args:u.array(GT).max(U.maxEventArgs),edit:Xn.optional()}).strict(),VT=u.object({document:Jt,revision:Xn,tree:u.unknown()}).strict(),cb=u.object({document:Jt.optional(),revision:Xn,message:u.string().max(U.maxLabelLength*4),stack:u.string().max(8192).optional()}).strict();function lb(e){let n=VT.safeParse(e);if(!n.success)return{ok:!1,document:null,revision:null,error:"malformed render"};let{document:o,revision:i}=n.data,t=sb(n.data.tree);return t.ok?{...t,document:o,revision:i}:{ok:!1,document:o,revision:i,error:t.error}}var FU=u.object({document:Jt,revision:Xn,accepted:u.boolean(),retryAfterMs:u.number().int().nonnegative().max(6e4).optional()}).strict(),ZU=u.object({document:Jt}).strict(),db=/^[A-Za-z0-9_.:-]{1,128}$/,HT=["plugin","workspace"],Jp=u.number().int().min(0).max(1e6),GU=u.object({version:Jp,value:u.json()}).strict().refine(e=>JSON.stringify(e.value).length<=ka,"persisted value is too large"),pb=u.object({document:Jt,entries:u.array(u.object({scope:u.enum(HT),key:u.string().regex(db),version:Jp,value:u.json()}).strict()).min(1).max(64),hydration:Xn.optional()}).strict(),VU=u.object({document:Jt,entries:u.array(u.object({key:u.string().regex(db),version:Jp,value:u.json().optional()}).strict().refine(e=>JSON.stringify(e.value??null).length<=ka,"retained value is too large")).min(1).max(64)}).strict();import{installOrcaDeclarativeRuntime as iE}from"./orca-runtime.mjs";var BT={Stack:"group",Row:"group",Card:"region",Text:"text",Heading:"heading",Button:"button",IconButton:"button",Badge:"status",List:"list",ListItem:"listitem",Input:"textbox",Switch:"switch",Select:"combobox",Separator:"separator",Progress:"progressbar",Spinner:"status",EmptyState:"group",Link:"link",Code:"code",Textarea:"textbox",Checkbox:"checkbox",RadioGroup:"radiogroup",Slider:"slider",Field:"group",Tabs:"tablist",Tab:"tab",Collapsible:"group",Toolbar:"toolbar",Grid:"group",Table:"grid",Tree:"tree",Markdown:"document",CodeView:"code",Image:"img",KeyValue:"list",Callout:"note",Skeleton:"status",RelativeTime:"time",Box:"group",Unsupported:"unsupported"};function fb(e,n){if(typeof e!="number")return"";let o=uo.find(i=>i===n)??"short";return qy(e,Date.now(),o,"en")}function WT(e){return typeof e=="object"&&e!==null&&"at"in e?fb(e.at,"format"in e?e.format:void 0):String(e??"")}var KT=["title","description","content","code","error","alt"];function JT(e){let n=[],o=[e.rows,e.items].flatMap(i=>Array.isArray(i)?i:[]);for(let i=o.shift();i!==void 0;i=o.shift()){if(typeof i!="object"||i===null)continue;let t={...i};typeof t.cells=="object"&&t.cells!==null&&n.push(...Object.values(t.cells).map(WT));for(let r of["label","value"])t[r]!==void 0&&t[r]!==null&&n.push(String(t[r]));Array.isArray(t.children)&&o.push(...t.children)}return n}function gb(e){if(typeof e=="string")return e;let n=e.props,o=KT.map(i=>n[i]).filter(i=>typeof i=="string");return e.type==="RelativeTime"?fb(n.at,n.format):e.type==="Tab"?typeof n.label=="string"?n.label:"":[...o,...JT(n),...e.children.map(gb)].join(" ")}var Xp=e=>e.replace(/\s+/g," ").trim();function XT(e){let n=e.props,o=n.label??n.title;return typeof o=="string"?o:void 0}function qT(e,n){let o=e.props,i=e.type==="ListItem"&&o.onPress!==void 0;return{type:e.type,key:e.key?.startsWith("#")?void 0:e.key,role:i?"button":BT[e.type]??"generic",label:XT(e),text:Xp(gb(e)),props:o,disabled:o.disabled===!0,path:n}}function Ga(e){let n=[],o=(i,t)=>{n.push(qT(i,t)),i.children.forEach((r,a)=>{typeof r!="string"&&o(r,`${t}/${r.key??`#${a}`}`)})};return e&&o(e,e.key??"#0"),n}function mb(e,n){return e===void 0?!1:typeof n=="string"?Xp(e)===Xp(n):n.test(e)}function hb(e,n){return(n.type===void 0||e.type===n.type)&&(n.role===void 0||e.role===n.role)&&(n.text===void 0||mb(e.text,n.text))&&(n.label===void 0||mb(e.label,n.label))&&(n.testId===void 0||e.key===n.testId)}function vb(e){return e.filter(n=>!e.some(o=>o.path.startsWith(`${n.path}/`)))}function yb(e){return Object.entries(e).map(([n,o])=>`${n}: ${o instanceof RegExp?String(o):JSON.stringify(o)}`).join(", ")}function qp(e){if(typeof e=="string")return e;let n={};for(let[o,i]of Object.entries(e.props)){if(o.startsWith("$"))continue;let t=typeof i=="object"&&i!==null&&"$callback"in i;n[o]=t?"[handler]":i}return{type:e.type,...e.key&&!e.key.startsWith("#")?{key:e.key}:{},...Object.keys(n).length>0?{props:n}:{},...e.children.length>0?{children:e.children.map(qp)}:{}}}var YT={value:"defaultValue",checked:"defaultChecked",open:"defaultOpen",selected:"defaultSelected"};function Yp(e){return typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)&&e.every(n=>typeof n=="string")}function QT(e){switch(e.type){case"Switch":case"Checkbox":case"Collapsible":return!1;case"Slider":return typeof e.props.min=="number"?e.props.min:0;case"Table":return[];default:return""}}function bb(){let e=new Map;function n(t){let r=Np(t.type);if(!r)throw new Error(`a ${t.type} has no value; expected a form control, Tabs or Table`);return r}function o(t){let r=e.get(t.path);if(r)return r;let{value:a}=n(t),s=t.props[a],c=t.props[YT[a]??""],d={value:Yp(s)?s:Yp(c)?c:QT(t),sent:0};return e.set(t.path,d),d}function i(t,r){let{value:a,change:s}=n(t);if(t.props[a]!==void 0&&t.props[s]===void 0)throw new Error(`the ${t.type} is read-only: it has a ${a} and no ${s}`);let c=o(t);return c.sent+=1,c.value=r,{value:r,id:c.sent}}return{observe(t){let r=new Map;for(let a of t){let s=Np(a.type);if(!s)continue;let c=e.get(a.path)??o(a),l=a.props[s.value],d=a.props[Oa];Yp(l)&&(typeof d=="number"?d:0)>=c.sent&&(c.value=l),r.set(a.path,c)}e=r},valueOf:t=>o(t).value,edit:i,typeInto(t,r,a){if(t.type!=="Input"&&t.type!=="Textarea")throw new Error(`type: a ${t.type} takes no text; expected an Input or Textarea`);let s=a?"":String(o(t).value),c=[];a&&c.push(i(t,s));for(let l of r)s+=l,c.push(i(t,s));return c},toggle(t){if(!["Switch","Checkbox","Collapsible"].includes(t.type))throw new Error(`toggle: expected a Switch, Checkbox or Collapsible, not a ${t.type}`);return i(t,!o(t).value)}}}function _b(e){let n=new Map,o=(s,c)=>{let l=n.get(s)??new Set;return l.add(c),n.set(s,l),{dispose:()=>l.delete(c)}},i=(s,c)=>{for(let l of n.get(s)??[])l(c)},t=s=>c=>typeof c=="object"&&c!==null&&s in c?Object.getOwnPropertyDescriptor(c,s)?.value:void 0,r=()=>{};return{facades:{plugin:{request:(s,c,l)=>{let d=typeof l=="object"&&l!==null&&"timeoutMs"in l?l.timeoutMs:void 0;return e("plugin.request",{name:s,...c===void 0?{}:{input:c},...typeof d=="number"?{timeoutMs:d}:{}}).then(t("output"))},on:(s,c)=>o(`message:${s}`,c)},storage:{get:s=>e("storage.get",{key:s}).then(c=>t("value")(c)??null),set:(s,c)=>e("storage.set",{key:s,value:c}).then(r),delete:s=>e("storage.delete",{key:s}).then(r),keys:async()=>{let s=t("keys")(await e("storage.keys"));return Array.isArray(s)?s.map(String):[]},onDidChange:s=>o("changed:storage",c=>s({key:String(c)}))},settings:{get:async s=>{let c=t("settings")(await e("settings.get"));return s===void 0?c:t(s)(c)},set:(s,c)=>e("settings.set",{key:s,value:c}).then(r),onDidChange:s=>o("changed:settings",c=>s({key:String(c)}))},secrets:{get:async s=>{let c=t("value")(await e("secrets.get",{key:s}));return typeof c=="string"?c:null},set:(s,c)=>e("secrets.set",{key:s,value:c}).then(r),delete:s=>e("secrets.delete",{key:s}).then(r)}},post:(s,c)=>i(`message:${s}`,c),changed:(s,c)=>i(`changed:${s}`,c)}}var $b=Symbol.for("orca.testing.stored");function kb(e,n){return Object.freeze({[$b]:!0,version:n,value:e})}function eE(e){return typeof e=="object"&&e!==null&&$b in e}function xb(e,n){for(let o of["plugin","workspace"])for(let[i,t]of Object.entries(n?.[o]??{}))e[o].set(i,eE(t)?{version:t.version,value:t.value}:{version:1,value:t})}var tE={sm:360,md:480};function Ib(e,n){let o=e.filter(i=>!i.hideBelow||n>=tE[i.hideBelow]);return o.length>0?o:e.slice(0,1)}var Qp=(e,n)=>e.path.startsWith(`${n.path}/`);function Va(e,n){return n.filter(o=>o.type==="Tab"&&Qp(o,e)&&!o.path.slice(e.path.length+1).includes("/"))}function em(e,n,o){let i=Va(e,n);return i.find(t=>t.props.value===o)??i.find(t=>!t.disabled)}function wb(e,n){let o=[];for(let i of e)if(!o.some(t=>Qp(i,t))&&(i.type==="Collapsible"&&n(i)!==!0&&o.push(i),i.type==="Tabs")){let t=em(i,e,n(i));o.push(...Va(i,e).filter(r=>r!==t))}return e.filter(i=>!o.some(t=>Qp(i,t)))}function Sb(e){return typeof e=="object"&&e!==null&&"key"in e&&typeof e.key=="string"}function tm(e){return Array.isArray(e.props.rows)?e.props.rows.filter(Sb):[]}function nm(e){let n=[],o=Array.isArray(e.props.items)?[...e.props.items]:[];for(let i=o.shift();i!==void 0;i=o.shift())if(Sb(i)){n.push(i);let t="children"in i?i.children:void 0;Array.isArray(t)&&o.push(...t)}return n}function Ne(e,n,o){if(e.type!==n)throw new Error(`${o}: expected a ${n}, not a ${e.type}`)}function rm(e,n,o){let i=tm(e).find(t=>t.key===n);if(!i||i.disabled===!0)throw new Error(`${o}: the Table has no enabled row "${n}"`);return i}function Ha(e,n,o){let i=nm(e).find(t=>t.key===n);if(!i)throw new Error(`${o}: the Tree has no item "${n}"`);return i}function Pb(e){return e.hasChildren===!0||Array.isArray(e.children)&&e.children.length>0}function Tb(e,n){let i=(Array.isArray(e.props.columns)?e.props.columns:[]).find(a=>typeof a=="object"&&a!==null&&"key"in a&&a.key===n);if(!i||typeof i!="object"||!("sortable"in i)||i.sortable!==!0)throw new Error(`sort: the Table has no sortable column "${n}"`);let t=e.props.sort,r=typeof t=="object"&&t!==null&&"column"in t&&t.column===n&&"direction"in t&&t.direction==="asc";return{column:n,direction:r?"desc":"asc"}}function nE(e,n){return e.type==="Tabs"?Va(e,n).map(i=>({value:i.props.value,disabled:i.disabled})):(Array.isArray(e.props.options)?e.props.options:[]).map(i=>typeof i=="object"&&i!==null&&"value"in i?{value:i.value,disabled:"disabled"in i&&i.disabled===!0}:{value:void 0,disabled:!0})}function Eb({host:e,controls:n,resolve:o,elements:i,dispatch:t,settled:r}){let a=new Map,s=d=>{let p=a.get(d.path);if(!p){let m=d.props.expanded??d.props.defaultExpanded;p=new Set(Array.isArray(m)?m.filter(f=>typeof f=="string"):[]),a.set(d.path,p)}return p},c=async(d,p,m,f)=>{let g=n.edit(d,m);t(p,[f],g.id),await r()},l=async(d,p,m,f)=>{let g=o(d,f);if(Ne(g,"Tree",f),!Pb(Ha(g,p,f)))throw new Error(`${f}: the Tree item "${p}" has no children`);let y=s(g);y.has(p)!==m&&(m?y.add(p):y.delete(p),t(g.props.onToggle,[{key:p,expanded:m}]),await r())};return{async press(d){let p=o(d,"press"),{href:m,onPress:f}=p.props;if(p.type==="Link"&&typeof m=="string")e.grantGesture(),e.bridge.call("shell.openExternal",{url:m}).catch(()=>{});else{if(f===void 0)throw new Error(`press: the ${p.type} has no onPress`);e.grantGesture()}t(f,[]),await r()},async type(d,p,m={}){let f=o(d,"type");for(let g of n.typeInto(f,p,m.replace===!0))t(f.props.onChange,[g.value],g.id),await r();m.submit&&(t(f.props.onSubmit,[n.valueOf(f)]),await r())},async submit(d){let p=o(d,"submit");t(p.props.onSubmit,[n.valueOf(p)]),await r()},async toggle(d){let p=o(d,"toggle"),m=n.toggle(p);t(p.props.onChange,[m.value],m.id),await r()},async select(d,p){let m=o(d,"select");if(!["Select","RadioGroup","Tabs"].includes(m.type))throw new Error(`select: expected a Select, RadioGroup or Tabs, not a ${m.type}`);let f=nE(m,i()).find(g=>g.value===p);if(!f||f.disabled)throw new Error(`select: the ${m.type} has no enabled option "${p}"`);await c(m,m.props.onChange,p,p)},async slide(d,p){let m=o(d,"slide");Ne(m,"Slider","slide");let f=typeof m.props.min=="number"?m.props.min:0,g=typeof m.props.max=="number"?m.props.max:100;if(!Number.isFinite(p)||pg)throw new Error(`slide: ${p} is outside the Slider's ${f} to ${g}`);await c(m,m.props.onChange,p,p)},async sort(d,p){let m=o(d,"sort");if(Ne(m,"Table","sort"),m.props.onSortChange===void 0)throw new Error("sort: the Table has no onSortChange");t(m.props.onSortChange,[Tb(m,p)]),await r()},async selectRows(d,p){let m=o(d,"selectRows");Ne(m,"Table","selectRows");let f=m.props.selectionMode??"none";if(f==="none"||f==="single"&&p.length>1)throw new Error(`selectRows: the Table's selectionMode is ${String(f)}`);p.forEach(g=>rm(m,g,"selectRows")),await c(m,m.props.onSelectionChange,[...p],{keys:[...p]})},async activateRow(d,p){let m=o(d,"activateRow");if(Ne(m,"Table","activateRow"),rm(m,p,"activateRow"),m.props.onRowAction===void 0)throw new Error("activateRow: the Table has no onRowAction");t(m.props.onRowAction,[{key:p}]),await r()},async loadMore(d){let p=o(d,"loadMore");if(Ne(p,"Table","loadMore"),p.props.hasMore!==!0||p.props.onLoadMore===void 0)throw new Error("loadMore: the Table has no more rows (hasMore and onLoadMore)");t(p.props.onLoadMore,[]),await r()},expand:(d,p)=>l(d,p,!0,"expand"),collapse:(d,p)=>l(d,p,!1,"collapse"),async selectItem(d,p){let m=o(d,"selectItem");if(Ne(m,"Tree","selectItem"),Ha(m,p,"selectItem").disabled===!0)throw new Error(`selectItem: the Tree item "${p}" is disabled`);await c(m,m.props.onSelect,p,{key:p})},async activateItem(d,p){let m=o(d,"activateItem");if(Ne(m,"Tree","activateItem"),Ha(m,p,"activateItem").disabled===!0||!m.props.onAction)throw new Error(`activateItem: the Tree item "${p}" cannot be activated`);t(m.props.onAction,[{key:p}]),await r()},expandedOf:d=>{let p=o(d,"expandedOf");return Ne(p,"Tree","expandedOf"),nm(p).map(m=>m.key).filter(m=>s(p).has(m))},columnsOf:(d,p={})=>{let m=o(d,"columnsOf");Ne(m,"Table","columnsOf");let g=(Array.isArray(m.props.columns)?m.props.columns:[]).flatMap(y=>{if(typeof y!="object"||y===null||!("key"in y))return[];let x="hideBelow"in y?y.hideBelow:void 0;return typeof y.key=="string"?[{key:y.key,hideBelow:x==="sm"||x==="md"?x:void 0}]:[]});return Ib(g,p.width??Number.POSITIVE_INFINITY).map(y=>y.key)},rowsOf:d=>{let p=o(d,"rowsOf");return Ne(p,"Table","rowsOf"),tm(p).map(m=>m.key)}}}var Ge=e=>{let n=(e??"").replace(/\s+/g," ").trim();return JSON.stringify(n.length>60?`${n.slice(0,59)}…`:n)},rE=e=>e==="danger"||e==="warning",Ab=e=>Array.isArray(e)?e.length:0;function oE(e,n){let{props:o}=e;switch(e.type){case"Heading":return`Heading ${Ge(e.text)}`;case"Callout":return`Callout ${String(o.tone??"neutral")} ${Ge(e.label??e.text)}`;case"EmptyState":return`EmptyState ${Ge(e.label)}`;case"Table":return`Table ${Ge(e.label)}: ${Ab(o.rows)} row(s)${o.hasMore===!0?", more":""}`;case"Tree":return`Tree ${Ge(e.label)}: ${Ab(o.items)} top-level item(s)`;case"Tabs":return`Tabs ${Ge(e.label)}: ${Ge(n.get(e.path))} selected`;case"Skeleton":case"Spinner":return`${e.type} ${Ge(e.label??"Loading")}`;case"Text":return o.tone==="danger"||o.tone==="warning"?`Text ${String(o.tone)} ${Ge(e.text)}`:null;case"Box":{let i=[o.background,o.border].find(rE);return i?`Box ${i} ${Ge(e.text)}`:null}default:return null}}function Ob(e,n){let o=[];for(let i of e){if(i.type==="List"){let r=e.filter(a=>a.type==="ListItem"&&a.path.startsWith(`${i.path}/`)).length;o.push(`List ${Ge(i.label)}: ${r} item(s)`);continue}let t=oE(i,n);t&&o.push(t)}return o.length>12?[...o.slice(0,12),`… ${o.length-12} more`]:o}function Nb(e){return"path"in e}var aE=100,sE=()=>new Promise(e=>typeof setImmediate=="function"?setImmediate(e):setTimeout(e,0));async function zb(e,n){let o=n.host,i=new Map,t=(I,O)=>{for(let E of i.get(I)??[])E(O)},r=[],a=[],s=[],c={plugin:new Map,workspace:new Map};xb(c,n.persisted);let l=n.visible??!0,d={document:"",revision:0,tree:null},p=bb(),m=_b(o.bridge.call),f=o.onDataChange(m.changed);function g(I,O){if(I===Ke.ready)t(Ke.hydrate,{panel:{id:n.panelId??"panel"},visible:l,plugin:Object.fromEntries(c.plugin),workspace:Object.fromEntries(c.workspace)});else if(I===Ke.render){let E=lb(O);if(!E.ok){a.push({kind:"refused",message:E.error}),E.document!==null&&E.revision!==null&&t(Ke.ack,{document:E.document,revision:E.revision,accepted:!1});return}s.push(...E.warnings.filter(H=>!s.includes(H))),d={document:E.document,revision:E.revision,tree:E.tree},p.observe(Ga(E.tree)),t(Ke.ack,{document:E.document,revision:E.revision,accepted:!0})}else if(I===Ke.error){let E=cb.safeParse(O);a.push(E.success?{kind:"plugin",message:E.data.message,...E.data.stack?{stack:E.data.stack}:{}}:{kind:"plugin",message:String(O)})}else if(I===Ke.persist){let E=pb.safeParse(O);if(!E.success){a.push({kind:"refused",message:"persisted state Orca would not store"});return}for(let H of E.data.entries)c[H.scope].set(H.key,{version:H.version,value:H.value})}}let y=iE({post:g,awaitHydration:!0,colorScheme:n.theme??"dark",schedule:I=>r.push(I),bridge:{api:o.bridge.api,locale:n.locale??"en",host:{call:o.bridge.call,has:o.bridge.has},...m.facades,on(I,O){let E=i.get(I)??new Set;return E.add(O),i.set(I,E),{dispose:()=>E.delete(O)}}}});async function x(){for(let I=0;Iwb(Ga(d.tree),I=>p.valueOf(I)),b=I=>vb(w().filter(O=>hb(O,I)));function P(I,O){let E=Nb(I)?w().find(H=>H.path===I.path):b(I)[0];if(!E)throw new Error(Nb(I)?`${O}: the element is no longer in the panel`:`${O}: nothing in the panel matches { ${yb(I)} }`);if(E.disabled)throw new Error(`${O}: the ${E.type} is disabled`);return E}function A(I,O,E){let H=typeof I=="object"&&I!==null&&"$callback"in I?I.$callback:null;typeof H=="string"&&t(Ke.event,{document:d.document,revision:d.revision,callback:H,args:O,...E===void 0?{}:{edit:E}})}await Promise.resolve(typeof e=="function"?{default:e}:e).then(I=>y.boot(I)).catch(I=>a.push({kind:"plugin",message:I instanceof Error?I.message:String(I),...I instanceof Error&&I.stack?{stack:I.stack}:{}})),await x();let D=Eb({host:o,controls:p,resolve:P,elements:w,dispatch:A,settled:x});return{host:o,errors:a,warnings:s,get refusals(){return o.refusals},find:I=>b(I)[0]??null,findAll:b,tree:()=>d.tree?qp(d.tree):null,drawnTree:()=>d.tree,summary:()=>{let I=Ga(d.tree),O=w(),E=new Map(O.filter(H=>H.type==="Tabs").map(H=>[H.path,em(H,I,p.valueOf(H))?.label??""]));return Ob(O,E)},get persisted(){let I=O=>Object.fromEntries([...c[O]].map(([E,H])=>[E,H.value]));return{plugin:I("plugin"),workspace:I("workspace"),storage:o.data().storage}},settled:x,...D,valueOf:I=>p.valueOf(P(I,"valueOf")),async emit(I,O){t(I,O),await x()},async post(I,O){m.post(I,O),await x()},async setVisible(I){l=I,t(Ke.visibility,{visible:I}),await x()},async rerender(){y.rerender(),await x()},async unmount(){y.dispose(),i.clear(),f()}}}var Cb=ye.optional(),Db={workspaceId:u.string().min(1).max(2048),workspaceListId:Cb,kind:u.enum(["worktree","folder"])},uE=u.object({...Db,path:u.string().min(1).max(32*1024),branch:u.string().max(1024)}),cE=u.object({...Db,path:u.string().min(1).max(32*1024)}),lE=u.object({workspaceId:u.string().min(1).max(2048).nullable(),workspaceListId:Cb,paneKey:u.string().min(1).max(2048),terminalId:u.string().min(1).max(Me).optional(),title:u.string().max(kt).optional(),state:u.enum(Fn),receivedAt:u.number().finite().positive(),mainAgent:u.object({state:u.enum(Fn),outcome:u.enum(ty).optional(),stateStartedAt:u.number().finite()}).optional(),sessionId:Ht.optional()}),dE=u.object({context:so}),om={"workspace.created":uE,"workspace.removed":cE,"agent.status.changed":lE,"workspace.changed":dE,"editor.typography.changed":Ap};var lo=["terminal.send","workspace.create.before","workspace.create.after","agent.launch.before","agent.prompt.before","agent.tool.before","agent.tool.after","editor.save.before"],Ej=lo.length,pE={"terminal.send":je,"workspace.create.before":je,"workspace.create.after":je,"agent.launch.before":je,"agent.prompt.before":je,"agent.tool.before":je,"agent.tool.after":je,"editor.save.before":je};function Ba(e){return lo.some(n=>n===e)}var Aj=u.object({event:u.enum(lo).meta({...te("Hook the worker handles with `orca.hooks.on`.",je),[jn]:pE}),onError:u.enum(["pass","deny"]).optional().meta(te("What Orca does when this plugin's hook throws, times out, crashes or does not start: `pass` (the default) carries on as if it passed; `deny` refuses the action, naming the plugin, so a guard fails closed. Ignored for hooks that only observe.",je))}).strict().meta({id:"HookContribution",description:"A hook Orca runs through the worker before (or after) it acts. Requires `main` and the `trusted-worker` execution profile."});var Lj=16*1024,po=16*1024*1024;var It=2e3,qn=u.strictObject({deny:u.string().min(1).max(500)}),mE=u.object({terminalId:u.string().min(1).max(Me),text:u.string().max(po),enter:u.boolean(),inputKind:u.enum(["driving","orchestration","launch"])}),fE=u.object({kind:u.enum(["worktree","folder"]),projectId:u.string().min(1).max(2048),name:u.string().min(1).max(1024),branch:u.string().min(1).max(1024).optional(),base:u.string().min(1).max(1024).optional()}),gE=u.object({workspaceId:u.string().min(1).max(2048),kind:u.enum(["worktree","folder"]),path:u.string().min(1).max(32*1024),branch:u.string().max(1024)}),hE=u.record(u.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(256).refine(e=>!e.toUpperCase().startsWith("ORCA_"),"ORCA_* variables are reserved"),u.string().max(32*1024)).refine(e=>Object.keys(e).length<=64,"at most 64 variables"),vE=u.enum(["worktree","folder"]),yE=u.object({agent:u.string().min(1).max(64),workspaceId:u.string().min(1).max(2048).nullable(),workspaceKind:vE.nullable(),terminalId:u.string().min(1).max(Me).optional(),command:u.string().min(1).max(po),env:hE}),bE=u.object({agent:u.string().min(1).max(64).nullable(),terminalId:u.string().min(1).max(Me),prompt:u.string().max(po),inputKind:u.enum(["driving","orchestration","launch"])}),Lb={agent:u.string().min(1).max(64),workspaceId:u.string().min(1).max(2048).nullable(),terminalId:u.string().min(1).max(Me).optional(),tool:u.string().min(1).max(256),input:u.unknown(),callId:u.string().min(1).max(256).optional()},_E=u.object(Lb),$E=u.object({...Lb,output:u.unknown().optional()}),kE=u.object({workspaceId:u.string().min(1).max(2048).nullable(),path:u.string().min(1).max(32*1024),languageId:u.string().min(1).max(128).optional(),text:u.string().max(po)}),mo={"terminal.send":{payload:mE,result:qn,mutable:["text","enter"],deadlineMs:It,summary:"Text Orca, the CLI or a plugin is about to send to a terminal. A person typing (on the desktop, a phone or a paired client) is never hooked, and prompts Orca submits to an agent take `agent.prompt.before` instead. Writes to one terminal stay in order while a hook decides. Rewrite `text` or `enter` with `next`, or return `{ deny }` to refuse the send."},"workspace.create.before":{payload:fE,result:qn,mutable:["name","branch","base"],deadlineMs:It,summary:"A worktree or folder workspace is about to be created. Change `name`, `branch` or `base` with `next`, or return `{ deny }` to refuse it."},"workspace.create.after":{payload:gE,result:null,mutable:[],deadlineMs:It,summary:"A worktree or folder workspace was created. Observe only: Orca does not wait for it, and results are ignored."},"agent.launch.before":{payload:yE,result:qn,mutable:["command","env"],deadlineMs:It,summary:"Orca is about to start an agent CLI in a terminal, from any launcher (new tab, workspace create, CLI, automation, orchestration). Change `command` or add `env` with `next`, or return `{ deny }` to refuse the launch. Restores of saved sessions are not hooked."},"agent.prompt.before":{payload:bE,result:qn,mutable:["prompt"],deadlineMs:It,summary:"Orca is about to submit a prompt to an agent in a terminal: a launch prompt, an orchestration dispatch, an issue or task prompt, or `orca terminal send` to an agent. A prompt a person submits is never hooked, and writes to one terminal stay in order while it decides. Rewrite `prompt` with `next`, or return `{ deny }` to refuse it."},"agent.tool.before":{payload:_E,result:qn,mutable:["input"],deadlineMs:It,summary:"An agent in an Orca terminal is about to run a tool. Claude Code waits for the answer: return `{ deny }` to refuse the call (the agent sees the reason) or change `input` with `next`; the person is still asked as usual. Other agents only report the call, so their results are ignored. Agents on SSH or WSL hosts are not hooked yet."},"agent.tool.after":{payload:$E,result:null,mutable:[],deadlineMs:It,summary:"An agent in an Orca terminal finished a tool call (successfully or not). Observe only: Orca does not wait for it."},"editor.save.before":{payload:kE,result:qn,mutable:["text"],deadlineMs:It,summary:"The person is about to save a text file from an Orca editor tab (an explicit save, not autosave). Change `text` with `next` (format on save) or return `{ deny }` to refuse the save, which shows your reason. Edits made while the hook ran stay unsaved."}};var Wa=class{constructor(n){this.event=n}event},Vj=u.object({event:u.enum(lo),payload:u.unknown()}),Ub=u.discriminatedUnion("decision",[u.object({decision:u.literal("continue"),payload:u.unknown()}),u.object({decision:u.literal("result"),result:u.unknown()})]);async function jb(e,n){let o=n;for(let i of e){let r=await i(o,a=>new Wa(a??o));if(r instanceof Wa)o=r.event;else if(r!=null)return{decision:"result",result:r}}return{decision:"continue",payload:o}}function xE(e){return e instanceof Error?e.message:String(e)}function Rb(e,n,o="timed out"){let i,t=new Promise((r,a)=>{i=setTimeout(()=>a(new Error(`${o} after ${n}ms`)),n)});return Promise.race([e,t]).finally(()=>clearTimeout(i))}function IE(e,n,o){let i=mo[e];if(!Ze(n)||!Ze(o))return{ok:!1,reason:"next() was given something other than the event object"};let t={...n};for(let a of i.mutable)Object.hasOwn(o,a)&&(t[a]=o[a]);let r=i.payload.safeParse(t);return r.success?{ok:!0,payload:r.data}:{ok:!1,reason:r.error.issues[0]?.message??"invalid change"}}var im=class extends Error{};async function Mb(e){let{event:n}=e,o=mo[n],i=e.deadlineMs??o.deadlineMs,t=e.payload;for(let r of e.participants){let a=e.now(),s=()=>Math.round(e.now()-a),c=o.result!==null&&e.failsClosed?.(r)===!0,l=(f,g=!1)=>c&&!g?(e.log(r,`hook ${n} denied after ${s()}ms (onError: deny): ${f}`),{kind:"deny",pluginKey:r,reason:`${r} failed and denies on error: ${f}`}):(e.log(r,`hook ${n} skipped after ${s()}ms: ${f}`),null),d;try{if(e.start){let f=e.startTimeoutMs??i;await Rb(e.start(r),f,"worker did not start")}d=await Rb(e.invoke(r,t,i),i)}catch(f){let g=l(xE(f),f instanceof im);if(g)return g;continue}let p=Ub.safeParse(d);if(!p.success){let f=l("the worker answered with something other than a hook decision");if(f)return f;continue}if(p.data.decision==="continue"){let f=IE(n,t,p.data.payload);f.ok?t=f.payload:e.log(r,`hook ${n}: change ignored: ${f.reason}`);continue}if(o.result===null)continue;let m=o.result.safeParse(p.data.result);if(!m.success){if(c){let f=l(`malformed result: ${m.error.issues[0]?.message??"invalid"}`);if(f)return f}e.log(r,`hook ${n}: result ignored: return next(event) or { deny: reason }`);continue}return{kind:"deny",pluginKey:r,reason:m.data.deny}}return{kind:"continue",payload:t}}function wE(e){return typeof e!="object"||e===null||!("workspaceId"in e)||"worktreeId"in e?e:{...e,worktreeId:e.workspaceId}}function fo(e,n){return typeof e=="object"&&e!==null&&n in e?Object.getOwnPropertyDescriptor(e,n)?.value:void 0}function Ka(e,n){return e.add(n),{dispose:()=>{e.delete(n)}}}var SE=new Set(Kn("worker")),PE=new Set(Kn("worker",!0));function Fb(){return{commands:new Map,events:new Map,hooks:new Map,panelRequests:new Map,dataListeners:{storage:new Set,settings:new Set}}}function Zb(e){let{tables:n,hostCall:o}=e,i=e.allowProposed?PE:SE,t=async(r,a)=>{await o(r,a)};return Object.freeze({api:Object.freeze({major:Fe,minor:Gy}),commands:Object.freeze({register(r,a){return n.commands.set(r,a),{dispose:()=>{n.commands.delete(r)}}}}),events:Object.freeze({on(r,a){let s=Ea.get(r)??r,c=n.events.get(s)??new Set;n.events.set(s,c);let l=s!==r||r==="agent.status.changed",d=Ka(c,m=>a(l?wE(m):m));if(r!=="workspace.changed")return d;let p=!0;return o("workspace.readContext").then(m=>p&&a({context:m})).catch(()=>{}),{dispose:()=>{p=!1,d.dispose()}}}}),hooks:Object.freeze({on(r,a){if(!Ba(r))throw new TypeError(`orca.hooks.on: unknown hook ${String(r)}`);if(typeof a!="function")throw new TypeError("orca.hooks.on needs a handler function");let s=n.hooks.get(r)??new Set;return n.hooks.set(r,s),Ka(s,a)}}),host:Object.freeze({call:(r,a,s)=>o(r,a,s),has:r=>i.has(r)}),panels:Object.freeze({handle(r,a){if(bt.parse(r),typeof a!="function")throw new TypeError("orca.panels.handle needs a handler function");return n.panelRequests.set(r,a),{dispose:()=>{n.panelRequests.get(r)===a&&n.panelRequests.delete(r)}}},post(r,a,s){bt.parse(r),e.postToPanels({event:r,payload:a,...s?.panel?{panel:s.panel}:{}})}}),storage:Object.freeze({get:async r=>fo(await o("storage.get",{key:r}),"value")??null,set:(r,a)=>t("storage.set",{key:r,value:a}),delete:r=>t("storage.delete",{key:r}),keys:async()=>{let r=fo(await o("storage.keys"),"keys");return Array.isArray(r)?r.filter(a=>typeof a=="string"):[]},onDidChange:r=>Ka(n.dataListeners.storage,r)}),settings:Object.freeze({get:async r=>{let a=fo(await o("settings.get"),"settings"),s=typeof a=="object"&&a!==null?{...a}:{};return r===void 0?s:fo(s,r)},set:(r,a)=>t("settings.set",{key:r,value:a}),onDidChange:r=>Ka(n.dataListeners.settings,r)}),secrets:Object.freeze({get:async r=>{let a=fo(await o("secrets.get",{key:r}),"value");return typeof a=="string"?a:null},set:(r,a)=>t("secrets.set",{key:r,value:a}),delete:r=>t("secrets.delete",{key:r})}),grantedCapabilities:Object.freeze([...e.grantedCapabilities]),log:r=>e.log(String(r))})}var Gb={id:"test-panel",surface:"panel",contributionId:"panel"};function TE(e){return Object.hasOwn(om,e)}function EE(e){return e instanceof Error?e.message:String(e)}async function Vb(e,n){let{host:o}=n,i=new Set(n.events),t=n.hooks.map(b=>typeof b=="string"?{event:b}:b),r=new Set(t.map(b=>b.event)),a=new Set(t.filter(b=>b.onError==="deny").map(b=>b.event)),s=Fb(),c=[],l=[],d=!0,p=e.default;if(typeof p!="function")throw new TypeError(typeof e.activate=="function"?"mountWorker: the module exports activate by name, but Orca calls the default export: write `export default function activate(orca)`":"mountWorker: the module has no default-exported activate(orca) function");let m=e.deactivate;if(m!==void 0&&typeof m!="function")throw new TypeError("mountWorker: the module exports a deactivate that is not a function");let f=Zb({tables:s,hostCall:(b,P)=>o.worker.call(b,P),postToPanels:b=>{l.push(b)},log:b=>{c.push(b)},grantedCapabilities:o.capabilities}),g=o.onDataChange((b,P)=>{for(let A of s.dataListeners[b])A({key:P})});await p(f);let y=n.commands?[...s.commands.keys()].find(b=>!n.commands?.includes(b)):void 0;if(y!==void 0)throw new Error(`registered undeclared command ${y}: list it in contributes.commands`);async function x(b,P,A){let D=s.panelRequests.get(b);if(!D)throw Je("unknown_method",`no panel handler named ${b}`);let I={...Gb,contributionId:A??Gb.contributionId};return D(P,{panel:I,signal:new AbortController().signal})}let w=o.routeRequests((b,P)=>x(b,P));return{host:o,logs:c,posts:l,get refusals(){return o.refusals},async emit(b,P){if(!TE(b))throw new Error(`emit: "${b}" is not an event Orca sends to workers`);if(!i.has(b))throw new Error(`emit: "${b}" never arrives: it is not in contributes.events`);let A=om[b].safeParse(P);if(!A.success)throw new TypeError(`emit: that ${b} payload is not one Orca sends: ${A.error.issues[0]?.message??""}`);let D=s.events.get(Ea.get(b)??b)??[];await Promise.all([...D].map(async I=>I(A.data))),await o.idle()},hooks:{async fire(b,P){if(!Ba(b))throw new Error(`hooks.fire: "${b}" is not a hook Orca runs`);if(!r.has(b))throw new Error(`hooks.fire: "${b}" never runs: it is not in contributes.hooks`);let A=mo[b].payload.safeParse(P);if(!A.success)throw new TypeError(`hooks.fire: that ${b} event is not one Orca sends: ${A.error.issues[0]?.message??""}`);let D=await Mb({event:b,payload:A.data,participants:["worker"],invoke:(I,O)=>jb(s.hooks.get(b)??[],O),log:(I,O)=>{c.push(O)},now:()=>performance.now(),failsClosed:()=>a.has(b)});return await o.idle(),D.kind==="deny"?{kind:"deny",reason:D.reason}:{kind:"continue",event:D.payload}}},async command(b,P){let A=s.commands.get(b);if(!A)throw new Error(`command: the worker registered no "${b}"`);let D=await A(P,{signal:new AbortController().signal});return await o.idle(),D},async request(b,P,A={}){let D=await x(b,P,A.panel);return await o.idle(),D},async deactivate(){if(d){d=!1,g(),w(),s.events.clear(),s.hooks.clear(),s.commands.clear(),s.panelRequests.clear();try{await(typeof m=="function"?m():void 0)}catch(b){throw new Error(`deactivate threw: ${EE(b)}`,{cause:b})}await o.idle()}}}}import{test as c4,describe as l4,beforeEach as d4,afterEach as p4}from"node:test";import{default as f4}from"node:assert/strict";import{runInThisContext as UE}from"node:vm";function Hb(e){if(typeof e!="object"||e===null||!("on"in e)||!("document"in e))return!1;let n=e.document;return typeof e.on=="function"&&typeof n=="object"&&n!==null&&"session"in n&&typeof n.session=="function"&&"applyEdit"in n&&typeof n.applyEdit=="function"}var Xe=1;var sm=["invalid_request","invalid_params","unknown_method","capability_denied","consent_required","not_permitted","rate_limited","unavailable","action_failed","cancelled","timeout","conflict","too_large"],AE=new Set(["rate_limited","unavailable","timeout","conflict"]);function OE(e){return sm.find(n=>n===e)??"action_failed"}function wt(e,n,o){let i=OE(e);return{code:i,message:n.slice(0,8192),retryable:AE.has(i),...o===void 0?{}:{retryAfterMs:o}}}var am=u.number().int().nonnegative(),Bb=u.string().min(1).max(128),NE=u.object({code:u.string().max(64),message:u.string().max(8192),retryable:u.boolean(),retryAfterMs:u.number().int().nonnegative().optional()}),fR=u.discriminatedUnion("kind",[u.object({orca:u.literal(Xe),kind:u.literal("req"),id:am,method:Bb,params:u.unknown().optional()}),u.object({orca:u.literal(Xe),kind:u.literal("res"),id:am,result:u.unknown().optional(),error:NE.optional()}),u.object({orca:u.literal(Xe),kind:u.literal("evt"),event:Bb,payload:u.unknown().optional()}),u.object({orca:u.literal(Xe),kind:u.literal("cancel"),id:am})]);var Xt={ready:"ready",hello:"hello",theme:"theme",ping:"ping",pong:"pong",editorKeydown:"editor.keydown",editorDocument:"editor.document",editorSubscribed:"editor.subscribed",editorMerges:"editor.merges",push:"plugin.push"},Yn={applyEdit:"editor.applyEdit",flush:"editor.flush"},Wb=64*1024;var zE=u.string().min(32).max(128),bR=u.object({sessionToken:zE,action:u.string().min(1),params:u.unknown().optional()}).strict();var um=64*1024*1024,wR=16*1024*1024;var cm=1e3,CE=u.strictObject({baseVersion:u.number().int().nonnegative(),content:u.discriminatedUnion("kind",[u.strictObject({kind:u.literal("text"),text:u.string()}),u.strictObject({kind:u.literal("bytes"),bytes:u.instanceof(ArrayBuffer)})])});function Kb(e){let n=CE.safeParse(e);return n.success?n.data:null}var lm=wt("conflict","The file changed outside this editor; edit the latest document."),Jb=wt("too_large","The edit is larger than Orca accepts; the file keeps its last accepted edit.");var Xb="__orcaPluginFrameTransport",qb="__orcaDeclarativePost";var Yb=` + var domainEvents = ${JSON.stringify(yt)} var subscribed = new Set() var pluginListeners = new Map() var dataListeners = new Map() @@ -106,7 +106,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. var params = { name: String(name) } if (input !== undefined) params.input = input if (typeof o.timeoutMs === 'number' && o.timeoutMs > 0) { - params.timeoutMs = Math.min(Math.ceil(o.timeoutMs), ${va}) + params.timeoutMs = Math.min(Math.ceil(o.timeoutMs), ${Aa}) } return call('plugin.request', params, { signal: o.signal }).then(pick('output')) }, @@ -136,7 +136,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. set: function (key, value) { return call('secrets.set', { key: String(key), value: String(value) }).then(done) }, delete: function (key) { return call('secrets.delete', { key: String(key) }).then(done) } }) -`;var cb=` +`;var Qb=` function start() { if (helloSeen && latest) starting.splice(0).forEach(function (resolve) { resolve(latest) }) } @@ -359,7 +359,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. }) }) } -`;var lb="orca-design-tokens";function tT(e,n){let i=$a(e,n!=="parent"),o=JSON.stringify({protocol:We,surface:e,api:{major:Ue,minor:ka(i)},methods:i,codes:Gp,events:Gt,editor:Fn,user:n==="guest"?wp:null,tokensStyleId:lb,maxPending:256,deadlineMs:12e4,userDeadlineMs:30*6e4,userMethodList:Object.values(wp),transportGlobal:n==="parent"?null:ab,declarativePost:n==="declarative-guest"?sb:null}).replaceAll("<","\\u003c");return`;(function (C) { +`;var e_="orca-design-tokens";function DE(e,n){let o=La(e,n!=="parent"),i=JSON.stringify({protocol:Xe,surface:e,api:{major:Fe,minor:Ua(o)},methods:o,codes:sm,events:Xt,editor:Yn,user:n==="guest"?Zp:null,tokensStyleId:e_,maxPending:256,deadlineMs:12e4,userDeadlineMs:30*6e4,userMethodList:Object.values(Zp),transportGlobal:n==="parent"?null:Xb,declarativePost:n==="declarative-guest"?qb:null}).replaceAll("<","\\u003c");return`;(function (C) { var E = C.events var nextId = 0 var pending = new Map() @@ -494,7 +494,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. }), on: on } -${ub} if (C.user) { +${Yb} if (C.user) { orca.shell = Object.freeze({ openExternal: function (url) { return userCall(C.user.openExternal, { url: String(url) }) } }) @@ -517,7 +517,7 @@ ${ub} if (C.user) { Object.defineProperty(orca, 'locale', { get: function () { return locale || navigator.language }, enumerable: true }) -${cb} if (C.surface === 'editor') { +${Qb} if (C.surface === 'editor') { window.addEventListener('keydown', function (event) { if (event.repeat || !(event.metaKey || event.ctrlKey)) return post({ kind: 'evt', event: E.editorKeydown, payload: { @@ -534,17 +534,17 @@ ${cb} if (C.surface === 'editor') { } }) } post({ kind: 'evt', event: E.ready, payload: { protocol: C.protocol } }) -})(${o}) -`}function db(e,n="panel",i={}){let o=i.declarative?"declarative-guest":"guest",t=i.theme,r=t?.colorScheme==="light"||t?.colorScheme==="dark"?t.colorScheme:"",a=typeof t?.tokens=="string"?t.tokens.replace(/[{}<>]/g,""):"";return` +})(${i}) +`}function t_(e,n="panel",o={}){let i=o.declarative?"declarative-guest":"guest",t=o.theme,r=t?.colorScheme==="light"||t?.colorScheme==="dark"?t.colorScheme:"",a=typeof t?.tokens=="string"?t.tokens.replace(/[{}<>]/g,""):"";return` - + +${DE(n,i)} -${e}`}var nT=new TextEncoder;function Kp(e,n){return e.length>n?n+1:nT.encode(e).byteLength}function pb(e,n=rb,i={}){let o=i.maxObjects??1e4,t=i.maxDepth??100,r=new WeakSet,a=0,s=0,u=d=>{a=Math.min(n+1,a+d)},c=(d,p)=>{if(a>n)return;if(d===null){u(1);return}switch(typeof d){case"undefined":case"boolean":u(1);return;case"number":u(8);return;case"bigint":u(Kp(d.toString(),n-a));return;case"string":u(Kp(d,n-a));return;case"symbol":case"function":a=n+1;return;case"object":break}let m=d;if(r.has(m)){u(8);return}if(r.add(m),s+=1,s>o||p>t){a=n+1;return}if(m instanceof ArrayBuffer){u(m.byteLength);return}if(typeof SharedArrayBuffer<"u"&&m instanceof SharedArrayBuffer){u(m.byteLength);return}if(ArrayBuffer.isView(m)){u(16),c(m.buffer,p+1);return}if(typeof Blob<"u"&&m instanceof Blob){u(m.size);return}if(m instanceof Date){u(8);return}if(m instanceof RegExp){c(m.source,p+1),c(m.flags,p+1);return}if(m instanceof Map){u(8);for(let[f,g]of m)if(u(4),c(f,p+1),c(g,p+1),a>n)return;return}if(m instanceof Set){u(8);for(let f of m)if(u(4),c(f,p+1),a>n)return;return}if(Array.isArray(m)){u(8);for(let f of m)if(u(4),c(f,p+1),a>n)return;return}try{let f=Object.getPrototypeOf(m);if(f!==Object.prototype&&f!==null){a=n+1;return}for(let g of Object.keys(m))if(u(4),u(Kp(g,n-a)),c(m[g],p+1),a>n)return}catch{a=n+1}};return c(e,0),a}var iT=e=>typeof e=="object"&&e!==null,mb=/') - writeFileSync(join(staticRoot, 'assets', 'app.js'), 'console.log("prefixed")') - const transport = createStaticTransport(staticRoot) - - await transport.start() - - const indexResponse = await fetch( - `http://127.0.0.1:${transport.resolvedPort}/orca/web-index.html` - ) - expect(indexResponse.status).toBe(200) - await expect(indexResponse.text()).resolves.toBe('') - - const assetResponse = await fetch( - `http://127.0.0.1:${transport.resolvedPort}/orca/assets/app.js` - ) - expect(assetResponse.status).toBe(200) - await expect(assetResponse.text()).resolves.toBe('console.log("prefixed")') - }) - - // #30100: with no request listener Node never answered plain HTTP, so curl hung forever. - it('answers plain HTTP with 404 when it has no web client to serve', async () => { - const transport = new WebSocketTransport({ host: '127.0.0.1', port: 0 }) - transports.push(transport) - - await transport.start() - - for (const path of ['/', '/web-index.html', '/does-not-exist']) { - const response = await fetch(`http://127.0.0.1:${transport.resolvedPort}${path}`, { - signal: AbortSignal.timeout(5_000) - }) - expect(response.status).toBe(404) - } - }) - - it('does not expose arbitrary files from the static root', async () => { - const staticRoot = mkdtempSync(join(tmpdir(), 'ws-transport-static-')) - writeFileSync(join(staticRoot, 'package.json'), '{}') - const transport = createStaticTransport(staticRoot) - - await transport.start() - - const response = await fetch(`http://127.0.0.1:${transport.resolvedPort}/package.json`) - expect(response.status).toBe(404) - }) - - it('rejects encoded Windows separators in static paths', async () => { - const staticRoot = mkdtempSync(join(tmpdir(), 'ws-transport-static-')) - mkdirSync(join(staticRoot, 'assets')) - writeFileSync(join(staticRoot, 'package.json'), '{}') - const transport = createStaticTransport(staticRoot) - - await transport.start() - - const response = await fetch( - `http://127.0.0.1:${transport.resolvedPort}/assets/..%5Cpackage.json` - ) - expect(response.status).toBe(400) - }) -}) diff --git a/src/main/runtime/rpc/ws-transport.test.ts b/src/main/runtime/rpc/ws-transport.test.ts deleted file mode 100644 index cab47b68b60..00000000000 --- a/src/main/runtime/rpc/ws-transport.test.ts +++ /dev/null @@ -1,304 +0,0 @@ -import 'node:events' -import { connect } from 'node:net' -import { describe, expect, it, afterEach, vi } from 'vitest' -import WebSocket from 'ws' -import { WebSocketTransport } from './ws-transport' -import './node-websocket-lifecycle' - -describe('WebSocketTransport', () => { - const transports: WebSocketTransport[] = [] - - afterEach(async () => { - await Promise.all(transports.map((t) => t.stop().catch(() => {}))) - transports.length = 0 - }) - - async function createTransport( - handler?: (msg: string, reply: (response: string) => void) => void, - options: { preAuthTimeoutMs?: number } = {} - ) { - const transport = new WebSocketTransport({ - host: '127.0.0.1', - // Port 0 reserves atomically; probed free ports can race. - port: 0, - preAuthTimeoutMs: options.preAuthTimeoutMs - }) - if (handler) { - transport.onMessage(handler) - } - transports.push(transport) - return { transport } - } - - function connectWs(target: number | WebSocketTransport): Promise { - const port = typeof target === 'number' ? target : target.resolvedPort - return new Promise((resolve, reject) => { - const ws = new WebSocket(`ws://127.0.0.1:${port}`) - ws.once('open', () => resolve(ws)) - ws.once('error', reject) - }) - } - - it('rejects oversized messages by closing the connection', async () => { - const { transport } = await createTransport() - - await transport.start() - - const ws = await connectWs(transport) - - const oversized = 'x'.repeat(1024 * 1024 + 100) - - await new Promise((resolve) => { - ws.once('close', () => resolve()) - ws.send(oversized) - }) - }) - - it('terminates every active connection for a revoked client id', async () => { - const { transport } = await createTransport() - const closedClientIds: (string | null)[] = [] - transport.onConnectionClose((clientId) => { - closedClientIds.push(clientId) - }) - - await transport.start() - - const clients = await Promise.all([connectWs(transport), connectWs(transport)]) - const wss = (transport as unknown as { wss: { clients: Set } }).wss - for (const client of wss.clients) { - transport.setClientId(client, 'device-token') - } - - expect(transport.terminateClientConnections('device-token')).toBe(2) - - await Promise.all( - clients.map( - (client) => - new Promise((resolve) => { - if (client.readyState === client.CLOSED) { - resolve() - return - } - client.once('close', () => resolve()) - }) - ) - ) - - await expect - .poll(() => closedClientIds, { timeout: 2_000, interval: 20 }) - .toEqual(['device-token', 'device-token']) - }) - - it('reaps silent pre-auth sockets so they cannot hold the connection cap', async () => { - const { transport } = await createTransport(undefined, { preAuthTimeoutMs: 50 }) - await transport.start() - - const clients = await Promise.all(Array.from({ length: 32 }, () => connectWs(transport))) - await Promise.all( - clients.map( - (client) => - new Promise((resolve) => { - if (client.readyState === client.CLOSED) { - resolve() - return - } - client.once('close', () => resolve()) - }) - ) - ) - - const liveClient = await connectWs(transport) - expect(liveClient.readyState).toBe(liveClient.OPEN) - liveClient.close() - }) - - it('drops a source the guard refuses before any HTTP or upgrade handling', async () => { - const admit = vi.fn(() => false) - const transport = new WebSocketTransport({ host: '127.0.0.1', port: 0, sourceGuard: { admit } }) - transports.push(transport) - await transport.start() - - await expect(connectWs(transport)).rejects.toThrow() - expect(admit).toHaveBeenCalledWith('127.0.0.1') - }) - - it('stops while an HTTP client holds an unanswered request open', async () => { - const transport = new WebSocketTransport({ host: '127.0.0.1', port: 0 }) - transports.push(transport) - await transport.start() - const socket = connect(transport.resolvedPort, '127.0.0.1') - await new Promise((resolve) => socket.once('connect', () => resolve())) - socket.on('error', () => {}) - // Why: the server's automatic 100 Continue proves the request is parsed and in flight. - const continued = new Promise((resolve) => socket.once('data', () => resolve())) - socket.write( - 'POST /unanswered HTTP/1.1\r\nHost: 127.0.0.1\r\nContent-Length: 1\r\nExpect: 100-continue\r\n\r\n' - ) - await continued - - await transport.stop() - socket.destroy() - }) - - it('does not wait for an unresponsive client close handshake during stop', async () => { - const { transport } = await createTransport() - await transport.start() - const ws = await connectWs(transport) - const underlying = (ws as unknown as { _socket: { pause: () => void } })._socket - underlying.pause() - - const stopPromise = transport.stop() - const outcome = await Promise.race([ - stopPromise.then(() => 'stopped' as const), - new Promise<'pending'>((resolve) => setTimeout(() => resolve('pending'), 100)) - ]) - - if (outcome === 'pending') { - ws.terminate() - await stopPromise - } - - expect(outcome).toBe('stopped') - }) - - it('falls back to OS-assigned port when preferred port is in use', async () => { - const { transport: first } = await createTransport() - await first.start() - const occupiedPort = first.resolvedPort - - // A conflicting port must fall back rather than fail startup. - const second = new WebSocketTransport({ - host: '127.0.0.1', - port: occupiedPort - }) - transports.push(second) - - await second.start() - - expect(second.resolvedPort).not.toBe(occupiedPort) - expect(second.resolvedPort).toBeGreaterThan(0) - - const ws = await connectWs(second.resolvedPort) - ws.close() - }) - - it('reaps a half-open client that stops responding to pings', async () => { - // Half-open peers otherwise occupy mobile slots for ~2h; verify heartbeat teardown through the production capacity-releasing close handler. - const transport = new WebSocketTransport({ - host: '127.0.0.1', - port: 0, - heartbeatIntervalMs: 50 - }) - transport.onMessage(() => {}) - transports.push(transport) - - let serverClosed = false - transport.onConnectionClose(() => { - serverClosed = true - }) - - // Stamp accepted sockets before startup so onConnectionClose sees their client ids. - await transport.start() - - const ws = await connectWs(transport) - // Pause TCP to block auto-pong flushing and model iOS background half-opens. - const underlying = (ws as unknown as { _socket: { pause: () => void } })._socket - underlying.pause() - - // Why: we need a clientId on the ws so onConnectionClose actually - // fires. The transport sets it lazily via setClientId in production - // (after auth); in this test we don't run auth, so reach in. - const wss = (transport as unknown as { wss: { clients: Set<{ readyState: number }> } }).wss - for (const c of wss.clients) { - transport.setClientId(c as never, 'test-client') - } - - await expect.poll(() => serverClosed, { timeout: 2_000, interval: 25 }).toBe(true) - expect(wss.clients.size).toBe(0) - }, 5_000) - - // Persist fallback endpoints so paired phones remain reachable across restarts (STA-1511). - describe('fallback port stability', () => { - async function reserveFreePort(): Promise { - const scratch = new WebSocketTransport({ host: '127.0.0.1', port: 0 }) - await scratch.start() - const port = scratch.resolvedPort - await scratch.stop() - return port - } - - it('binds the persisted fallback port even when the preferred port is free', async () => { - // Fallback pairings must survive even when the preferred port becomes free (STA-1511). - const preferredPort = await reserveFreePort() - const fallbackPort = await reserveFreePort() - - const transport = new WebSocketTransport({ - host: '127.0.0.1', - port: preferredPort, - fallbackPort - }) - transports.push(transport) - await transport.start() - expect(transport.resolvedPort).toBe(fallbackPort) - }) - - it('binds the preferred port first when preferPinnedPort is set and both are free', async () => { - // An explicit serve --port pin must precede stale persisted fallback (#8535). - const preferredPort = await reserveFreePort() - const fallbackPort = await reserveFreePort() - - const transport = new WebSocketTransport({ - host: '127.0.0.1', - port: preferredPort, - fallbackPort, - preferPinnedPort: true - }) - transports.push(transport) - await transport.start() - expect(transport.resolvedPort).toBe(preferredPort) - }) - - it('falls through to the preferred port when the fallback bind fails with a non-EADDRINUSE error', async () => { - // Persisted ports may enter Windows Hyper-V reserved ranges; EACCES must fall back to preferred, not disable transport. - const preferredPort = await reserveFreePort() - const fallbackPort = await reserveFreePort() - const transport = new WebSocketTransport({ - host: '127.0.0.1', - port: preferredPort, - fallbackPort - }) - transports.push(transport) - const withListen = transport as unknown as { tryListen(port: number): Promise } - const realTryListen = withListen.tryListen.bind(transport) - withListen.tryListen = (port: number) => - port === fallbackPort - ? Promise.reject(Object.assign(new Error('listen EACCES'), { code: 'EACCES' })) - : realTryListen(port) - - await transport.start() - expect(transport.resolvedPort).toBe(preferredPort) - }) - - it('tries the deterministic ladder before an OS-assigned port (#15490)', async () => { - const transport = new WebSocketTransport({ - host: '127.0.0.1', - port: 6768, - fallbackPort: 62944, - fallbackLadder: [6769, 6770, 6771] - }) - transports.push(transport) - const attempted: number[] = [] - const withListen = transport as unknown as { tryListen(port: number): Promise } - withListen.tryListen = async (port: number) => { - attempted.push(port) - if (port !== 6770) { - throw Object.assign(new Error('listen EADDRINUSE'), { code: 'EADDRINUSE' }) - } - } - - await transport.start() - expect(attempted).toEqual([62944, 6768, 6769, 6770]) - expect(transport.persistedFallbackFailed).toBe(true) - }) - }) -}) diff --git a/src/main/runtime/rpc/ws-unauthenticated-source-cap.test.ts b/src/main/runtime/rpc/ws-unauthenticated-source-cap.test.ts deleted file mode 100644 index 1f93c78c661..00000000000 --- a/src/main/runtime/rpc/ws-unauthenticated-source-cap.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { EventEmitter } from 'node:events' -import type { Socket } from 'node:net' -import { describe, expect, it, vi } from 'vitest' -import { UnauthenticatedSourceCap } from './ws-unauthenticated-source-cap' - -function peer(remoteAddress: string): Socket & EventEmitter { - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the cap reads only remoteAddress and close. - return Object.assign(new EventEmitter(), { remoteAddress }) as unknown as Socket & EventEmitter -} - -describe('UnauthenticatedSourceCap', () => { - it('refuses a source past the cap until one of its sockets closes', () => { - const log = vi.fn() - const cap = new UnauthenticatedSourceCap(2, () => 0, log) - const first = peer('203.0.113.9') - expect(cap.admit(first)).toBe(true) - expect(cap.admit(peer('::ffff:203.0.113.9'))).toBe(true) - expect(cap.admit(peer('203.0.113.9'))).toBe(false) - expect(cap.admit(peer('203.0.113.9'))).toBe(false) - expect(cap.admit(peer('203.0.113.10'))).toBe(true) - expect(log).toHaveBeenCalledOnce() - - first.emit('close') - expect(cap.admit(peer('203.0.113.9'))).toBe(true) - }) - - it('counts an IPv6 /64 as one source', () => { - const cap = new UnauthenticatedSourceCap(1, () => 0, vi.fn()) - expect(cap.admit(peer('2001:db8:1:2::1'))).toBe(true) - expect(cap.admit(peer('2001:db8:1:2::2'))).toBe(false) - expect(cap.admit(peer('2001:db8:1:3::1'))).toBe(true) - }) - - it('frees the slot on authentication and admits a source holding an authenticated socket', () => { - const cap = new UnauthenticatedSourceCap(1, () => 0, vi.fn()) - const client = peer('192.168.1.20') - expect(cap.admit(client)).toBe(true) - cap.noteAuthenticated(client) - expect(cap.admit(peer('192.168.1.20'))).toBe(true) - // Past the cap, but this source has already proven a credential. - expect(cap.admit(peer('192.168.1.20'))).toBe(true) - - client.emit('close') - expect(cap.admit(peer('192.168.1.20'))).toBe(false) - }) -}) diff --git a/src/main/runtime/session-graph/session-graph-authority.ts b/src/main/runtime/session-graph/session-graph-authority.ts index ea078c04082..3aaf7892048 100644 --- a/src/main/runtime/session-graph/session-graph-authority.ts +++ b/src/main/runtime/session-graph/session-graph-authority.ts @@ -252,6 +252,29 @@ export abstract class OrcaRuntimeWithTransitionGraphReloadToTerminalState extend /** Reconcile client-hosted pages per paired device; one attached client cannot account for another's pages. */ markClientHostedPagesReconciled(pairedDeviceId: string): void { - this.clientHostedPageReconciliation.markReconciled(pairedDeviceId) + const held = this.clientHostedPageReconciliation.markReconciled(pairedDeviceId) + if (!held?.size) { + return + } + const candidates = this.selectMobileSessionTabsListeners(undefined, pairedDeviceId) + if (candidates.length === 0) { + return + } + const deliver = this.createMobileSessionTabsDelivery() + for (const worktree of held) { + const selected = this.selectMobileSessionTabsListeners(worktree, pairedDeviceId, candidates) + if (selected.length === 0) { + continue + } + deliver( + this.getMobileSessionTabsForWorktree(worktree, pairedDeviceId, { + includeAgentSenders: false + }), + ++this.mobileSessionTabsChangeSequence, + pairedDeviceId, + selected, + 'reconciliation' + ) + } } } diff --git a/src/main/runtime/session-lifecycle/close/close-mobile-session-tab.ts b/src/main/runtime/session-lifecycle/close/close-mobile-session-tab.ts index 9b5123c115e..961fb4eda4d 100644 --- a/src/main/runtime/session-lifecycle/close/close-mobile-session-tab.ts +++ b/src/main/runtime/session-lifecycle/close/close-mobile-session-tab.ts @@ -14,7 +14,7 @@ import { } from './mobile-session-tab-close-outcome' import { getRuntimeBrowserPageRegistry } from '../../browser/client-pages/runtime-browser-page-registry' import type { RuntimeEdgeCommandSurface } from '../../construction/runtime-edge-command-controller' -import { rendererPublicationThrottle } from '../../../window/renderer-publication-throttle' +import { rendererPublicationThrottle } from '../../../window/visibility/renderer-publication-throttle' import { retireHeadlessMobileSessionEditorTab } from '../../session-tabs/headless-editor-tabs' import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/layout-owner-switch' diff --git a/src/main/runtime/session-tabs/mobile-session-membership.ts b/src/main/runtime/session-tabs/mobile-session-membership.ts index d9fe6ec16ac..881d9d14ff4 100644 --- a/src/main/runtime/session-tabs/mobile-session-membership.ts +++ b/src/main/runtime/session-tabs/mobile-session-membership.ts @@ -1,3 +1,4 @@ +import type { MobileSessionTabSubscription } from '../construction/runtime-identity-state' import type { OrcaRuntimeWithScheduleMobileSessionTabsChanged as SessionTabsPublication } from './session-tabs-change-publication' import type { OrcaRuntimeWithPruneMobileSessionTabGroupLayout as SessionTabsProjection } from '../session-lifecycle/projection/prune-mobile-session-tab-group-layout' import type { OrcaRuntimeWithGetTerminalInteractiveWait as GetTerminalInteractiveWaitMethods } from '../terminal/wait/terminal-interactive-wait' @@ -22,7 +23,11 @@ export abstract class OrcaRuntimeWithTouchMobileSessionTabsForWorktree extends O ...args: Parameters ): ReturnType - protected abstract hasAgentSenderListeners(): boolean + protected abstract selectMobileSessionTabsListeners( + worktree?: string, + clientNavigationId?: string, + candidates?: Iterable + ): MobileSessionTabSubscription[] abstract getTerminalWorktreeIdForPaneKey( ...args: Parameters @@ -35,14 +40,19 @@ export abstract class OrcaRuntimeWithTouchMobileSessionTabsForWorktree extends O /** Republish only worktrees whose sender scope differs from the one their last frame carried. */ refreshAgentSenderAssociations(): void { - if (!this.hasAgentSenderListeners()) { + const listeners = this.selectMobileSessionTabsListeners().filter( + (subscription) => subscription.clientKind !== 'mobile' + ) + if (listeners.length === 0) { return } const changed = this.agentProjections.senders.changedScopes( this.mobileSessionTabsByWorktree.keys() ) for (const worktreeId of changed) { - this.touchMobileSessionTabsForWorktree(worktreeId) + if (this.selectMobileSessionTabsListeners(worktreeId, undefined, listeners).length > 0) { + this.touchMobileSessionTabsForWorktree(worktreeId) + } } } diff --git a/src/main/runtime/session-tabs/mobile-session-publication-preservation.ts b/src/main/runtime/session-tabs/mobile-session-publication-preservation.ts index c4aa4873899..ec48166dddd 100644 --- a/src/main/runtime/session-tabs/mobile-session-publication-preservation.ts +++ b/src/main/runtime/session-tabs/mobile-session-publication-preservation.ts @@ -18,6 +18,7 @@ export abstract class OrcaRuntimeWithStoredMobileSnapshotHasStalePreservedTab ex protected abstract getListedBrowserTabsByPageId( ...args: Parameters ): ReturnType + protected abstract notifyMobileSessionTabsChangedNow( ...args: Parameters< ScheduleMobileSessionTabsChangedMethods['notifyMobileSessionTabsChangedNow'] @@ -208,12 +209,16 @@ export abstract class OrcaRuntimeWithStoredMobileSnapshotHasStalePreservedTab ex tabs: [] } const changeSequence = ++this.mobileSessionTabsChangeSequence - for (const subscription of this.mobileSessionTabListeners) { + for (const subscription of this.selectMobileSessionTabsListeners(worktreeId)) { + if (!this.mobileSessionTabListeners.has(subscription)) { + continue + } subscription.listener( this.clientSessionTabSelections.project(removed, subscription.clientNavigationId), changeSequence ) } + this.clientHostedPageReconciliation.forgetWorktree(worktreeId) this.clientSessionTabSelections.forgetWorktree(worktreeId) } diff --git a/src/main/runtime/session-tabs/mobile-session-tab-subscriptions.ts b/src/main/runtime/session-tabs/mobile-session-tab-subscriptions.ts index 8b01ffdba50..44455726f30 100644 --- a/src/main/runtime/session-tabs/mobile-session-tab-subscriptions.ts +++ b/src/main/runtime/session-tabs/mobile-session-tab-subscriptions.ts @@ -1,19 +1,31 @@ +import type { + ClientHostedPageObservation, + MobileSessionTabSubscription +} from '../construction/runtime-identity-state' import type { RuntimeMobileSessionTabsResult } from '../../../shared/runtime-session-contracts' import { RuntimeWorkspaceFileTargets } from '../workspaces/workspace-file-session-targets' export abstract class RuntimeMobileSessionTabSubscriptions extends RuntimeWorkspaceFileTargets { onMobileSessionTabsChanged( - listener: (snapshot: RuntimeMobileSessionTabsResult, changeSequence: number) => void, + listener: MobileSessionTabSubscription['listener'], clientNavigationId?: string, - clientKind?: 'mobile' | 'runtime' + clientKind?: 'mobile' | 'runtime', + options?: Pick ): () => void { // Drain coalesced notifications before subscribing: the initial snapshot already includes them. this.mobileSessionTabsNotifyCoalescer.flushAll() - const subscription = { listener, clientNavigationId, clientKind } + const subscription = { + listener, + clientNavigationId, + clientKind, + observation: options?.observation, + acceptsWorktree: options?.acceptsWorktree + } this.mobileSessionTabListeners.add(subscription) return () => { // Flush before removal so this listener receives the latest settled state. this.mobileSessionTabsNotifyCoalescer.flushAll() const removed = this.mobileSessionTabListeners.delete(subscription) + this.clientHostedPageReconciliation.forgetObservation(clientNavigationId, subscription) if (removed && clientKind !== 'mobile') { this.releaseAgentSenderHistoryIfUnobserved() } @@ -23,6 +35,60 @@ export abstract class RuntimeMobileSessionTabSubscriptions extends RuntimeWorksp } } + protected deliverMobileSessionTabsFrame( + subscription: MobileSessionTabSubscription, + frame: RuntimeMobileSessionTabsResult, + sequence: number, + delivery?: 'reconciliation' + ): void { + subscription.listener(frame, sequence, delivery) + if ( + subscription.observation === 'caller' || + !this.mobileSessionTabListeners.has(subscription) + ) { + return + } + this.clientHostedPageReconciliation.observe( + [frame], + subscription.clientNavigationId, + subscription + ) + } + + observeClientHostedPageSnapshots( + frames: readonly RuntimeMobileSessionTabsResult[], + clientNavigationId?: string, + observer?: ClientHostedPageObservation + ): void { + this.clientHostedPageReconciliation.observe(frames, clientNavigationId, observer) + } + + forgetClientHostedPageObservation( + clientNavigationId: string | undefined, + observer: ClientHostedPageObservation + ): void { + this.clientHostedPageReconciliation.forgetObservation(clientNavigationId, observer) + } + + protected selectMobileSessionTabsListeners( + worktree?: string, + clientNavigationId?: string, + candidates: Iterable = this.mobileSessionTabListeners + ): MobileSessionTabSubscription[] { + const selected: MobileSessionTabSubscription[] = [] + for (const subscription of candidates) { + if ( + this.mobileSessionTabListeners.has(subscription) && + (clientNavigationId === undefined || + subscription.clientNavigationId === clientNavigationId) && + (worktree === undefined || subscription.acceptsWorktree?.(worktree) !== false) + ) { + selected.push(subscription) + } + } + return selected + } + protected hasAgentSenderListeners(): boolean { for (const { clientKind } of this.mobileSessionTabListeners) { if (clientKind !== 'mobile') { @@ -40,5 +106,6 @@ export abstract class RuntimeMobileSessionTabSubscriptions extends RuntimeWorksp forgetClientNavigationState(clientNavigationId: string): void { this.clientSessionTabSelections.forgetClient(clientNavigationId) + this.clientHostedPageReconciliation.forgetClient(clientNavigationId) } } diff --git a/src/main/runtime/session-tabs/orca-runtime-session-tabs-path-alias.test.ts b/src/main/runtime/session-tabs/orca-runtime-session-tabs-path-alias.test.ts index 3dde336c70a..363ca55c4ab 100644 --- a/src/main/runtime/session-tabs/orca-runtime-session-tabs-path-alias.test.ts +++ b/src/main/runtime/session-tabs/orca-runtime-session-tabs-path-alias.test.ts @@ -158,3 +158,35 @@ describe('session tab workspace path aliases', () => { runtime.cleanupSubscriptionsForConnection('alias-connection') }) }) + +it('rejects ambiguous later aliases while retaining an exact host spelling', async () => { + const runtime = new OrcaRuntimeService() + runtime.attachWindow(1) + const rpc = new RpcDispatcher({ runtime, methods: SESSION_TAB_METHODS }) + const frames: { type?: string; worktree?: string }[] = [] + try { + await rpc.dispatchStreaming( + { + id: 'ambiguous-alias', + authToken: 'test', + method: 'session.tabs.subscribe', + params: { worktree: `id:${ALIAS}` } + }, + (reply) => frames.push(JSON.parse(reply).result), + { connectionId: 'ambiguous-alias' } + ) + publishGraph(runtime, WORKTREE, [snapshot('repo::g:/git/example', 'pty-other')]) + runtime.onMobileSessionTabsChanged(() => {}, undefined, 'mobile')() + expect(frames.filter((frame) => frame.type === 'updated')).toEqual([]) + publishGraph(runtime, ALIAS, [ + snapshot(WORKTREE), + snapshot('repo::g:/git/example', 'pty-other') + ]) + runtime.onMobileSessionTabsChanged(() => {}, undefined, 'mobile')() + expect( + frames.filter((frame) => frame.type === 'updated').map((frame) => frame.worktree) + ).toEqual([ALIAS]) + } finally { + runtime.cleanupSubscriptionsForConnection('ambiguous-alias') + } +}) diff --git a/src/main/runtime/session-tabs/session-tabs-change-publication.ts b/src/main/runtime/session-tabs/session-tabs-change-publication.ts index 95832e5f5e6..dd780267785 100644 --- a/src/main/runtime/session-tabs/session-tabs-change-publication.ts +++ b/src/main/runtime/session-tabs/session-tabs-change-publication.ts @@ -1,3 +1,4 @@ +import type { MobileSessionTabSubscription } from '../construction/runtime-identity-state' import { OrcaRuntimeWithStoredMobileSnapshotHasStalePreservedTab } from './mobile-session-publication-preservation' import type { BrowserTabInfo } from '../../../shared/browser/runtime/runtime-browser-contracts' import type { @@ -67,7 +68,9 @@ export abstract class OrcaRuntimeWithScheduleMobileSessionTabsChanged extends Or return ( result: RuntimeMobileSessionTabsResult, changeSequence: number, - clientNavigationId?: string + clientNavigationId?: string, + candidates?: readonly MobileSessionTabSubscription[], + delivery?: 'reconciliation' ): void => { const { agentSenderAssociations: _senders, ...tabsOnly } = result // A frame for one client is already its projection; projecting again stacks the epoch suffix and revision, so the client fences it. @@ -75,32 +78,31 @@ export abstract class OrcaRuntimeWithScheduleMobileSessionTabsChanged extends Or clientNavigationId === undefined ? this.projectMobileSessionTabsForClient(frame, id) : frame let desktopFrame: RuntimeMobileSessionTabsResult | undefined try { - for (const subscription of this.mobileSessionTabListeners) { - if ( - clientNavigationId !== undefined && - subscription.clientNavigationId !== clientNavigationId - ) { + for (const subscription of this.selectMobileSessionTabsListeners( + result.worktree, + clientNavigationId, + candidates + )) { + if (!this.mobileSessionTabListeners.has(subscription)) { continue } let frame: RuntimeMobileSessionTabsResult = tabsOnly if (subscription.clientKind !== 'mobile') { if (!desktopFrame) { - if (result.agentSenderAssociations) { - desktopFrame = result - } else { + desktopFrame = result + if (!result.agentSenderAssociations) { senderScope ??= this.agentProjections.senders.buildForFramePass() desktopFrame = { ...result, agentSenderAssociations: senderScope(result.worktree) } } } frame = desktopFrame } - subscription.listener(project(frame, subscription.clientNavigationId), changeSequence) + const supplied = project(frame, subscription.clientNavigationId) + this.deliverMobileSessionTabsFrame(subscription, supplied, changeSequence, delivery) } - if (clientNavigationId === undefined && desktopFrame?.agentSenderAssociations) { - this.agentProjections.senders.acknowledgeFrame( - result.worktree, - desktopFrame.agentSenderAssociations - ) + const senders = desktopFrame?.agentSenderAssociations + if (clientNavigationId === undefined && senders) { + this.agentProjections.senders.acknowledgeFrame(result.worktree, senders) } } finally { if (senderScope) { diff --git a/src/main/runtime/sidebar-inputs/orca-runtime-workspace-unread.test.ts b/src/main/runtime/sidebar-inputs/orca-runtime-workspace-unread.test.ts index c85f052a214..483a8f12c04 100644 --- a/src/main/runtime/sidebar-inputs/orca-runtime-workspace-unread.test.ts +++ b/src/main/runtime/sidebar-inputs/orca-runtime-workspace-unread.test.ts @@ -6,18 +6,9 @@ import { folderWorkspaceKey } from '../../../shared/workspace-scope' import { AgentHookServer } from '../../agent-hooks/server/agent-hook-server' import { OrcaRuntimeService } from '../orca-runtime' import { RpcDispatcher } from '../rpc/dispatcher' -import type { RpcDispatchStreamingOptions } from '../rpc/dispatcher-stream-options' +import type { RpcDispatchStreamingOptions } from '../rpc/dispatch/dispatcher-stream-options' import { SESSION_TAB_METHODS } from '../rpc/methods/session-tabs/session-tabs' import { SIDEBAR_INPUT_METHODS } from '../rpc/methods/sidebar-inputs/sidebar-inputs' -import { requireSwitchedOn } from './require-switched-on' -import { ELECTRON_REMOTE_RUNTIME_CLIENT_CAPABILITIES } from '../../../shared/electron-remote-runtime-client-capabilities' -import { remoteRuntimeClientCapabilities } from '../../../shared/remote-runtime/remote-runtime-client-capabilities' -import { WORKSPACE_UNREAD_HOST_RAISES_CAPABILITY } from '../../../shared/workspace-unread-raise-capability' -import { - BROWSER_CLIENT_HOST_RUNTIME_CAPABILITY, - BROWSER_CLIENT_PAGE_METADATA_RUNTIME_CAPABILITY, - BROWSER_NETWORK_TUNNEL_RUNTIME_CAPABILITY -} from '../../../shared/browser/runtime/browser-runtime-capabilities' import type { HostWorktreeTarget } from '../../../shared/worktree/host-qualified-identity' import { partialRuntimeStore, @@ -41,22 +32,6 @@ const LEAF = '22222222-2222-4222-8222-222222222222' const PANE = `tab-1:${LEAF}` const PHONE: RpcDispatchStreamingOptions = { clientKind: 'mobile', connectionId: 'phone-1' } -/** Desktop request, subscription, browser-host lease, network-tunnel and CLI capability sets. */ -function currentDesktopSockets() { - return { - request: remoteRuntimeClientCapabilities(ELECTRON_REMOTE_RUNTIME_CLIENT_CAPABILITIES), - lease: remoteRuntimeClientCapabilities([ - BROWSER_CLIENT_HOST_RUNTIME_CAPABILITY, - BROWSER_CLIENT_PAGE_METADATA_RUNTIME_CAPABILITY - ]), - tunnel: remoteRuntimeClientCapabilities([ - BROWSER_CLIENT_HOST_RUNTIME_CAPABILITY, - BROWSER_NETWORK_TUNNEL_RUNTIME_CAPABILITY - ]), - cli: remoteRuntimeClientCapabilities() - } -} - function createHeadlessHost() { const meta: Record = { [WT]: storeWorktreeMeta() } const sshMeta: Record = { [SSH_WT]: storeWorktreeMeta() } @@ -245,29 +220,4 @@ describe('workspace unread flag on a headless host', () => { vi.useRealTimers() } }) - - it('leaves raising to an older desktop while it is connected, and still clears on the phone', async () => { - const host = createHeadlessHost() - // Either its request socket or its browser host lease hosts client pages without the capability. - const older = (capabilities: readonly string[]) => - capabilities.filter((capability) => capability !== WORKSPACE_UNREAD_HOST_RAISES_CAPABILITY) - const facts = requireSwitchedOn(host.runtime.sidebarFacts) - facts.noteRuntimeClient('desktop-old', older(currentDesktopSockets().request)) - facts.noteRuntimeClient('desktop-old-lease', older(currentDesktopSockets().lease)) - host.finishTurn() - expect(host.meta[WT].isUnread).toBe(false) - - // The older desktop raised it by its own rule; the phone opening it still clears it here. - host.meta[WT].isUnread = true - await host.openOnPhone(WT) - expect(host.meta[WT].isUnread).toBe(false) - host.runtime.cleanupSubscriptionsForConnection('phone-1') - - host.runtime.cleanupSubscriptionsForConnection('desktop-old') - host.finishTurn() - expect(host.meta[WT].isUnread).toBe(false) - host.runtime.cleanupSubscriptionsForConnection('desktop-old-lease') - host.finishTurn() - expect(host.meta[WT].isUnread).toBe(true) - }) }) diff --git a/src/main/runtime/sidebar-inputs/repo-icon-data-urls.test.ts b/src/main/runtime/sidebar-inputs/repo-icon-data-urls.test.ts index 2e9773721c7..69c65af6928 100644 --- a/src/main/runtime/sidebar-inputs/repo-icon-data-urls.test.ts +++ b/src/main/runtime/sidebar-inputs/repo-icon-data-urls.test.ts @@ -1,7 +1,6 @@ import { describe, expect, it, vi } from 'vitest' import type { RepoIcon } from '../../../shared/repo-icon' import type { Repo } from '../../../shared/repo-types' -import { MAX_REPO_ICON_DATA_URL_BYTES } from '../../../shared/sidebar-list/repo-icon-data-urls-contract' import { RepoIconDataUrls, repoIconId, type RepoIconPngEncoder } from './repo-icon-data-urls' import type { RepoIconFetch } from './repo-icon-remote-fetch' import { pngHeader } from './repo-icon-image-fixture' @@ -12,14 +11,6 @@ const AVATAR: RepoIcon = { source: 'github' } -function upload(bytes: Uint8Array): RepoIcon { - return { - type: 'image', - src: `data:image/png;base64,${Buffer.from(bytes).toString('base64')}`, - source: 'upload' - } -} - function repo(id: string, repoIcon: RepoIcon | null): Repo { return { id, path: `/r/${id}`, displayName: id, badgeColor: '#000', addedAt: 0, repoIcon } } @@ -43,53 +34,7 @@ function setup( return { icons, fetch, advance: (ms: number) => (now += ms) } } -const ENCODED = new Uint8Array([1, 2, 3]) -const ENCODED_URL = 'data:image/png;base64,AQID' - -describe('RepoIconDataUrls with an encoder (desktop)', () => { - it('steps down to 32 px when the 64 px PNG is over the cap', async () => { - const huge = new Uint8Array(MAX_REPO_ICON_DATA_URL_BYTES) - const encoder = vi.fn((_bytes, edge) => (edge === 64 ? huge : ENCODED)) - const { icons } = setup([repo('a', AVATAR)], { encoder }) - - expect((await icons.read([repoIconId(AVATAR)!])).icons[0].dataUrl).toBe(ENCODED_URL) - expect(encoder.mock.calls.map(([, edge]) => edge)).toEqual([64, 32]) - }) - - it('falls back when neither encoding nor passthrough fits the cap', async () => { - const icon = upload(pngHeader(64, 64, MAX_REPO_ICON_DATA_URL_BYTES)) - const huge = new Uint8Array(MAX_REPO_ICON_DATA_URL_BYTES) - const encoder = vi.fn(() => huge) - const { icons } = setup([repo('a', icon)], { encoder }) - - expect((await icons.read([repoIconId(icon)!])).icons[0].dataUrl).toBeNull() - expect(encoder).toHaveBeenCalledTimes(2) - }) -}) - describe('RepoIconDataUrls caps', () => { - it('refuses bytes that are not a readable raster image, before decoding', async () => { - const encoder = vi.fn(() => ENCODED) - const { icons } = setup([repo('a', AVATAR)], { - encoder, - fetch: async () => pngResponse(new Uint8Array([1, 2, 3, 4])) - }) - - expect((await icons.read([repoIconId(AVATAR)!])).icons[0].dataUrl).toBeNull() - expect(encoder).not.toHaveBeenCalled() - }) - - it('refuses a fetched image over 512 px before decoding', async () => { - const encoder = vi.fn(() => ENCODED) - const { icons } = setup([repo('a', AVATAR)], { - encoder, - fetch: async () => pngResponse(pngHeader(513, 64)) - }) - - expect((await icons.read([repoIconId(AVATAR)!])).icons[0].dataUrl).toBeNull() - expect(encoder).not.toHaveBeenCalled() - }) - it('runs at most four fetches at once', async () => { const releases: (() => void)[] = [] let active = 0 @@ -126,16 +71,6 @@ describe('RepoIconDataUrls caps', () => { }) describe('RepoIconDataUrls cache', () => { - it('fetches an avatar shared by two repos once, across concurrent and later reads', async () => { - const { icons, fetch } = setup([repo('a', AVATAR), repo('b', { ...AVATAR, label: 'b' })]) - const id = repoIconId(AVATAR)! - - await Promise.all([icons.read([id, id]), icons.read([id])]) - await icons.read([id]) - - expect(fetch).toHaveBeenCalledTimes(1) - }) - it('retries a failed fetch after five minutes, a success only after an hour', async () => { let fail = true const { icons, fetch, advance } = setup([repo('a', AVATAR)], { @@ -156,27 +91,4 @@ describe('RepoIconDataUrls cache', () => { await icons.read([id]) expect(fetch).toHaveBeenCalledTimes(3) }) - - it('evicts the least recently read icons past 1 MiB', async () => { - const avatars = Array.from({ length: 80 }, (_, index): RepoIcon => ({ - ...AVATAR, - src: `https://github.com/owner${index}.png` - })) - // Each encoded icon is just under the 16 KiB cap, so 80 of them overflow 1 MiB. - const nearCap = new Uint8Array(12 * 1024 - 64) - const { icons, fetch } = setup( - avatars.map((icon, index) => repo(`r${index}`, icon)), - { encoder: () => nearCap } - ) - const ids = avatars.map((icon) => repoIconId(icon)!) - - for (let start = 0; start < ids.length; start += 16) { - await icons.read(ids.slice(start, start + 16)) - } - expect(fetch).toHaveBeenCalledTimes(80) - await icons.read([ids[79]]) - expect(fetch).toHaveBeenCalledTimes(80) - await icons.read([ids[0]]) - expect(fetch).toHaveBeenCalledTimes(81) - }) }) diff --git a/src/main/runtime/sidebar-inputs/repo-icon-remote-fetch.test.ts b/src/main/runtime/sidebar-inputs/repo-icon-remote-fetch.test.ts deleted file mode 100644 index 451dc09fcd1..00000000000 --- a/src/main/runtime/sidebar-inputs/repo-icon-remote-fetch.test.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import { - fetchRemoteRepoIcon, - REPO_ICON_FETCH_MAX_BYTES, - type RepoIconFetch -} from './repo-icon-remote-fetch' -import { pngHeader } from './repo-icon-image-fixture' - -const AVATAR = 'https://github.com/stablyai.png?size=64' - -function image(bytes: Uint8Array, headers: Record = {}): Response { - return new Response(Buffer.from(bytes), { - status: 200, - headers: { 'content-type': 'image/png', ...headers } - }) -} - -function redirect(location: string): Response { - return new Response(null, { status: 302, headers: { location } }) -} - -describe('fetchRemoteRepoIcon', () => { - it('follows up to three https redirects without cookies', async () => { - const fetch = vi - .fn() - .mockResolvedValueOnce(redirect('https://avatars.example/a')) - .mockResolvedValueOnce(redirect('/b')) - .mockResolvedValueOnce(redirect('https://avatars.example/c')) - .mockResolvedValueOnce(image(pngHeader(64, 64))) - - const fetched = await fetchRemoteRepoIcon(AVATAR, fetch) - - expect(fetched?.mimeType).toBe('image/png') - expect(fetch.mock.calls.map(([url]) => url)).toEqual([ - AVATAR, - 'https://avatars.example/a', - 'https://avatars.example/b', - 'https://avatars.example/c' - ]) - expect(fetch.mock.calls[0][1]).toMatchObject({ redirect: 'manual', credentials: 'omit' }) - }) - - it('gives up on a redirect loop after three hops', async () => { - const fetch = vi.fn(async () => redirect(AVATAR)) - - expect(await fetchRemoteRepoIcon(AVATAR, fetch)).toBeNull() - expect(fetch).toHaveBeenCalledTimes(4) - }) - - it('refuses a redirect off https', async () => { - const fetch = vi.fn(async () => redirect('http://avatars.example/a')) - - expect(await fetchRemoteRepoIcon(AVATAR, fetch)).toBeNull() - expect(fetch).toHaveBeenCalledTimes(1) - }) - - it('refuses a body declared over the cap without reading it', async () => { - const response = image(pngHeader(64, 64), { - 'content-length': String(REPO_ICON_FETCH_MAX_BYTES + 1) - }) - const cancel = vi.spyOn(response.body!, 'cancel') - - expect(await fetchRemoteRepoIcon(AVATAR, async () => response)).toBeNull() - expect(cancel).toHaveBeenCalled() - }) - - it('stops reading an undeclared body once it passes the cap', async () => { - const chunk = new Uint8Array(16 * 1024) - let pulls = 0 - const body = new ReadableStream({ - pull: (controller) => { - pulls += 1 - controller.enqueue(chunk) - } - }) - const response = new Response(body, { headers: { 'content-type': 'image/png' } }) - - expect(await fetchRemoteRepoIcon(AVATAR, async () => response)).toBeNull() - expect(pulls).toBeLessThan(10) - }) - - it('refuses non-https and credentialed sources', async () => { - const fetch = vi.fn() - expect(await fetchRemoteRepoIcon('http://github.com/a.png', fetch)).toBeNull() - expect(await fetchRemoteRepoIcon('https://user:pw@github.com/a.png', fetch)).toBeNull() - expect(fetch).not.toHaveBeenCalled() - }) - - it('times out a server that never answers', async () => { - const fetch: RepoIconFetch = (_url, init) => - new Promise((_resolve, reject) => - init.signal?.addEventListener('abort', () => reject(init.signal?.reason)) - ) - - expect(await fetchRemoteRepoIcon(AVATAR, fetch, 20)).toBeNull() - }) - - it('times out a body that stalls after the headers', async () => { - const fetch: RepoIconFetch = async (_url, init) => { - const body = new ReadableStream({ - start: (controller) => { - init.signal?.addEventListener('abort', () => controller.error(init.signal?.reason)) - } - }) - return new Response(body, { headers: { 'content-type': 'image/png' } }) - } - - expect(await fetchRemoteRepoIcon(AVATAR, fetch, 20)).toBeNull() - }) -}) diff --git a/src/main/runtime/sidebar-inputs/sidebar-inputs-feed-announcements.test.ts b/src/main/runtime/sidebar-inputs/sidebar-inputs-feed-announcements.test.ts deleted file mode 100644 index 05287e24028..00000000000 --- a/src/main/runtime/sidebar-inputs/sidebar-inputs-feed-announcements.test.ts +++ /dev/null @@ -1,213 +0,0 @@ -// Exercise every domain's real store writers and announcements (design §9.4); phone reads must not re-read domains. -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { RuntimeClientEvent } from '../../../shared/runtime-client-events' -import type { Repo } from '../../../shared/repo-types' -import type { PRInfo } from '../../../shared/github/pull-request-types' -import type { WslHostService } from '../../wsl/host-lifecycle/wsl-host-service' -import { setWslHostService } from '../../wsl/host-lifecycle/wsl-host-service-instance' -import { getGitHubPRCacheKeyCandidates } from '../../../shared/github/github-cache-key' -import { toRuntimeExecutionHostId } from '../../../shared/execution-host' -import { - getWorktreeHostIdentity, - hostWorktreeTarget -} from '../../../shared/worktree/host-qualified-identity' -import { - prGroupOfReviewFact, - WorkspaceReviewFactsSnapshotSchema, - type WorkspaceReviewFact -} from '../../../shared/sidebar-list/workspace-review-facts' -import { fixture } from '../../persistence/loading-store/profile-writing/profile-state-delayed-authority-fixture' -import { ProducerRevision } from './producer-revision' -import { SidebarInputsFeed } from './sidebar-inputs-feed' -import { - sidebarInputsFeedDomains, - type SidebarInputsFeedSources -} from './sidebar-inputs-feed-domains' -import { TestPhone } from './sidebar-inputs-feed.test-fixture' - -const repo: Repo = { id: 'repo-1', path: '/r', displayName: 'r', badgeColor: 'blue', addedAt: 1 } -const worktree = { - id: 'repo-1::/r/a', - repoId: repo.id, - hostId: 'local', - branch: 'refs/heads/feature', - linkedPR: null -} as const - -async function host() { - const { store } = await fixture() - store.addRepo(repo) - const clientEvents = new Set<(event: RuntimeClientEvent) => void>() - const temporal = new Set<() => void>() - const wslListeners = new Set<() => void>() - const revisions = { - activity: new ProducerRevision(), - paired: new ProducerRevision(), - creations: new ProducerRevision(), - rows: new ProducerRevision(), - detected: new ProducerRevision(), - liveContent: new ProducerRevision() - } - // A WSL registry that only announces; this host has no WSL hosts. - const wsl = { - getStatuses: () => [], - onStatusesChanged: (listener: () => void) => { - wslListeners.add(listener) - return () => wslListeners.delete(listener) - } - } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the desktop domain reads only these two members. - setWslHostService(wsl as unknown as WslHostService) - const sources: SidebarInputsFeedSources = { - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the domains read only the members stubbed here. - facts: { - workspaceActivityFacts: { revision: revisions.activity }, - getWorkspaceActivityFacts: () => ({ revision: 0, facts: {} }), - getSidebarTemporalSnapshot: () => ({ sessionId: null, retention: null }), - onSidebarTemporalChange: (listener: () => void) => { - temporal.add(listener) - return () => temporal.delete(listener) - }, - detectedCheckouts: { - revision: revisions.detected, - snapshot: () => ({}), - watch: (listener: () => void) => revisions.detected.onChange(listener) - }, - workspaceLiveContent: { revision: revisions.liveContent, snapshot: () => ({}) } - } as unknown as SidebarInputsFeedSources['facts'], - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: as above. - pairedServerRows: { - revision: revisions.paired, - snapshot: () => ({ servers: [] }), - catalogs: () => [] - } as unknown as SidebarInputsFeedSources['pairedServerRows'], - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: as above. - workspaceLifecycle: { - revision: revisions.creations, - creationsSnapshot: () => ({ creations: {} }), - hints: () => ({}) - } as unknown as SidebarInputsFeedSources['workspaceLifecycle'], - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: as above; one cached worktree, already scanned. - workspaceRows: { - revision: revisions.rows, - snapshot: () => ({ revision: 0, rows: {} }), - resolvedWorktrees: () => [worktree], - ready: async () => {} - } as unknown as SidebarInputsFeedSources['workspaceRows'], - repoIcons: { idsByRepo: () => ({}) }, - store: () => store, - onClientEvent: (listener) => { - clientEvents.add(listener) - return () => clientEvents.delete(listener) - } - } - const emit = (event: RuntimeClientEvent): void => - clientEvents.forEach((listener) => listener(event)) - const catalogEvent = (): void => emit({ type: 'reposChanged' }) - // Every public writer of what each domain reads. - const writers: Record void>> = { - activity: { - 'activity producer': () => revisions.activity.bump(), - 'paired server rows': () => revisions.paired.bump(), - // Only a paired server's partition holds activity (its browser and chat tabs). - 'saved session': () => - store.patchWorkspaceSession({ activeTabId: 'tab-1' }, toRuntimeExecutionHostId('env-1')) - }, - temporal: { 'retention owner': () => temporal.forEach((listener) => listener()) }, - creations: { 'lifecycle queue': () => revisions.creations.bump() }, - inProgress: { 'lifecycle queue': () => revisions.creations.bump() }, - workspaces: { 'workspace rows producer': () => revisions.rows.bump() }, - detected: { 'detected checkouts producer': () => revisions.detected.bump() }, - liveContent: { 'live content producer': () => revisions.liveContent.bump() }, - view: { 'ui write': () => store.updateUI({ groupBy: 'pr-status' }) }, - pairedServerHosts: { 'paired server rows': () => revisions.paired.bump() }, - pairedServerRows: { 'paired server rows': () => revisions.paired.bump() }, - desktop: { - 'catalog event': catalogEvent, - 'ui write': () => store.updateUI({ workspaceHostOrder: ['local'] }), - 'settings write': () => - store.updateSettings({ - showPinnedWorktreesInGroups: !store.getSettings().showPinnedWorktreesInGroups - }), - 'saved session': () => store.patchWorkspaceSession({ activeWorktreeId: worktree.id }), - 'pin write': () => - store.setWorktreeMeta(hostWorktreeTarget({ id: worktree.id, hostId: 'local' }), { - isPinned: true - }), - 'WSL status': () => wslListeners.forEach((listener) => listener()) - }, - projectCatalog: { - 'catalog event': catalogEvent, - 'paired server rows': () => revisions.paired.bump(), - 'ui write': () => store.updateUI({ projectOrderBy: 'recent' }), - 'full save': () => - store.setWorktreeLineage(hostWorktreeTarget({ id: worktree.id, hostId: 'local' }), { - worktreeId: worktree.id, - worktreeInstanceId: 'a-1', - parentWorktreeId: 'repo-1::/r/p', - parentWorktreeInstanceId: 'p-1', - origin: 'manual', - capture: { source: 'manual-action', confidence: 'explicit' }, - createdAt: 1 - }) - }, - repoIcons: { 'catalog event': catalogEvent }, - review: { - 'PR cache save': () => store.setGitHubCache({ ...store.getGitHubCache(), pr: {} }), - 'workspace rows producer': () => revisions.rows.bump(), - 'paired server rows': () => revisions.paired.bump(), - 'catalog event': catalogEvent - } - } - return { store, sources, writers } -} - -function feedReviewFact(value: unknown): WorkspaceReviewFact | null { - const parsed = WorkspaceReviewFactsSnapshotSchema.shape.facts.valueType.safeParse(value) - return parsed.success ? parsed.data : null -} - -beforeEach(() => { - vi.spyOn(console, 'warn').mockImplementation(() => {}) -}) - -afterEach(() => { - setWslHostService(null) - vi.restoreAllMocks() -}) - -describe('sidebar inputs feed announcements', () => { - it('follows a PR cache save on a quiet desktop into the phone’s PR grouping', async () => { - const { store, sources } = await host() - const events: { generation: string; revision: number }[] = [] - const feed = new SidebarInputsFeed( - () => sidebarInputsFeedDomains(sources), - (event) => events.push(event) - ) - store.updateUI({ groupBy: 'pr-status' }) - const phone = new TestPhone(feed, 'conn-1') - phone.refresh() - await phone.settle() - expect(phone.view().review).toBeUndefined() - - // Nothing else happens on this desktop: no catalog event, no phone read, no metadata write. - const before = events.length - const [key] = getGitHubPRCacheKeyCandidates(repo, 'feature') - store.setGitHubCache({ - ...store.getGitHubCache(), - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: grouping reads only number and state. - pr: { [key]: { data: { number: 7, state: 'merged' } as PRInfo, fetchedAt: 1 } } - }) - await vi.waitFor(() => expect(events.length).toBeGreaterThan(before)) - const notice = events.at(-1) - if (!notice) { - throw new Error('the PR cache save announced nothing') - } - phone.notice(notice) - await phone.settle() - const fact = phone.view().review?.[getWorktreeHostIdentity(worktree)] - expect(fact).toEqual({ provider: 'github', reviewState: 'merged' }) - expect(prGroupOfReviewFact(feedReviewFact(fact))).toBe('done') - phone.disconnect() - }) -}) diff --git a/src/main/runtime/terminal/identity/quarter-circle-title-send-authorization.test.ts b/src/main/runtime/terminal/identity/quarter-circle-title-send-authorization.test.ts deleted file mode 100644 index ccacd82f373..00000000000 --- a/src/main/runtime/terminal/identity/quarter-circle-title-send-authorization.test.ts +++ /dev/null @@ -1,253 +0,0 @@ -// Quarter-circle progress glyphs alone cannot authorize auto-Enter into an unknown pane owner (STA-4028, #13925). -import { afterEach, describe, expect, it, vi } from 'vitest' - -import { OrcaRuntimeService } from '../../orca-runtime' - -import { assertTerminalAgentSendable } from '../../rpc/terminal-agent-send-guard' - -vi.mock('electron', () => ({ - BrowserWindow: { fromId: vi.fn(() => null) }, - webContents: { fromId: vi.fn(() => null) }, - ipcMain: { on: vi.fn(), removeListener: vi.fn() }, - app: { getPath: vi.fn(() => '/tmp') } -})) - -const LEAF_ID = '11111111-1111-4111-8111-111111111111' -const TAB_ID = 'tab-1' -const WORKTREE_ID = 'wt-1' -const PTY_ID = 'pty-1' - -afterEach(() => { - vi.useRealTimers() - vi.restoreAllMocks() -}) - -// Captured from Claude Code 2.1.228 while it read this repository's package.json. -const SPINNER_ONLY_TITLE = '◑ Check package version in package.json' - -async function createRuntimeWithTitle( - paneTitle: string, - foregroundProcess: string | null, - launchAgent?: 'claude', - verifiedLaunch = true -): Promise<{ - runtime: OrcaRuntimeService - handle: string - getForegroundProcess: ReturnType -}> { - const runtime = new OrcaRuntimeService(null) - const internals = runtime as unknown as { - resolveTerminalWorkspaceLaunchScope: (selector: string) => Promise - } - vi.spyOn(internals, 'resolveTerminalWorkspaceLaunchScope').mockResolvedValue({ - id: WORKTREE_ID, - path: '/repo/app', - connectionId: null, - repo: null, - folderWorkspace: null - }) - const getForegroundProcess = vi.fn(async () => foregroundProcess) - runtime.setPtyController({ - spawn: vi.fn().mockResolvedValue({ id: PTY_ID, incarnationId: 'initial-incarnation' }), - write: () => true, - kill: () => true, - getForegroundProcess - }) - const terminal = await runtime.createTerminal(`id:${WORKTREE_ID}`, { - tabId: TAB_ID, - leafId: LEAF_ID, - title: 'Terminal', - ...(launchAgent - ? { - launchAgent, - ...(verifiedLaunch - ? { launchConfig: { agentCommand: 'claude', agentArgs: '', agentEnv: {} } } - : {}) - } - : {}) - }) - runtime.attachWindow(1) - runtime.syncWindowGraph(1, { - tabs: [ - { - tabId: TAB_ID, - worktreeId: WORKTREE_ID, - title: 'Terminal', - activeLeafId: LEAF_ID, - layout: null - } - ], - leaves: [ - { - tabId: TAB_ID, - worktreeId: WORKTREE_ID, - leafId: LEAF_ID, - paneRuntimeId: 1, - ptyId: PTY_ID, - paneTitle - } - ] - }) - return { runtime, handle: terminal.handle, getForegroundProcess } -} - -const AUTHORIZED = 'authorized' - -// The 150ms foreground tick first crosses its unchanged 6,500ms budget at 6,600ms. -const WRAPPER_REJECTION_TICK_MS = 6_600 -const NO_AGENT_GUARD_DEADLINE_MS = 1_050 - -async function readAgentEvidenceAtDeadline( - read: () => Promise, - deadlineMs: number -): Promise { - vi.useFakeTimers({ toFake: ['Date', 'setTimeout', 'clearTimeout'] }) - try { - let settled = false - const result = read() - void result.then( - () => { - settled = true - }, - () => { - settled = true - } - ) - await vi.advanceTimersByTimeAsync(deadlineMs - 1) - expect(settled, 'agent evidence settled before its deadline').toBe(false) - await vi.advanceTimersByTimeAsync(1) - expect(settled, 'agent evidence did not settle at its deadline').toBe(true) - expect(vi.getTimerCount()).toBe(0) - return await result - } finally { - try { - await vi.runOnlyPendingTimersAsync() - } finally { - vi.clearAllTimers() - vi.useRealTimers() - } - } -} - -async function guardedSendResult(runtime: OrcaRuntimeService, handle: string): Promise { - try { - await assertTerminalAgentSendable({ runtime, handle, assertWritable: () => {} }) - return AUTHORIZED - } catch (error) { - return error instanceof Error ? error.message : String(error) - } -} - -describe('quarter-circle title send authorization (STA-4028)', () => { - it('refuses a guarded send when a quarter-circle spinner is the only agent evidence', async () => { - const { runtime, handle } = await createRuntimeWithTitle(SPINNER_ONLY_TITLE, 'node') - - expect( - await readAgentEvidenceAtDeadline( - () => runtime.getTerminalAgentStatus(handle), - WRAPPER_REJECTION_TICK_MS - ) - ).toMatchObject({ isRunningAgent: false }) - expect( - await readAgentEvidenceAtDeadline( - () => guardedSendResult(runtime, handle), - WRAPPER_REJECTION_TICK_MS - ) - ).toBe('terminal_guard_no_agent') - }) - - it('refuses a guarded send when the foreground process cannot be read at all', async () => { - // SSH/folder foreground lookup can fail; missing evidence must refuse rather than trust a glyph. - const { runtime, handle } = await createRuntimeWithTitle(SPINNER_ONLY_TITLE, null) - - expect( - await readAgentEvidenceAtDeadline( - () => guardedSendResult(runtime, handle), - NO_AGENT_GUARD_DEADLINE_MS - ) - ).toBe('terminal_guard_no_agent') - }) - - it('authorizes a managed Claude launch when the foreground process is unavailable', async () => { - const { runtime, handle, getForegroundProcess } = await createRuntimeWithTitle( - SPINNER_ONLY_TITLE, - null, - 'claude' - ) - expect( - ( - runtime as unknown as { - ptysById: Map - } - ).ptysById.get(PTY_ID) - ).toMatchObject({ launchAgent: 'claude', launchToken: expect.any(String) }) - - await expect(runtime.getTerminalAgentStatus(handle)).resolves.toMatchObject({ - isRunningAgent: true, - status: 'working' - }) - await expect(guardedSendResult(runtime, handle)).resolves.toBe(AUTHORIZED) - expect(getForegroundProcess).not.toHaveBeenCalled() - }) - - it('does not trust an unverified Claude launch hint', async () => { - const { runtime, handle } = await createRuntimeWithTitle( - SPINNER_ONLY_TITLE, - null, - 'claude', - false - ) - - expect( - await readAgentEvidenceAtDeadline( - () => guardedSendResult(runtime, handle), - NO_AGENT_GUARD_DEADLINE_MS - ) - ).toBe('terminal_guard_no_agent') - }) - - it('does not carry managed Claude identity into a replacement PTY incarnation', async () => { - const { runtime, handle } = await createRuntimeWithTitle(SPINNER_ONLY_TITLE, null, 'claude') - const pty = ( - runtime as unknown as { - ptysById: Map< - string, - { incarnationId: string | null; launchIncarnationId: string | null; launchToken: string } - > - } - ).ptysById.get(PTY_ID) - expect(pty).toMatchObject({ - incarnationId: 'initial-incarnation', - launchIncarnationId: 'initial-incarnation' - }) - - runtime.onPtySpawned(PTY_ID, 'replacement-incarnation', { awaitsRegistration: false }) - - expect(pty).toMatchObject({ - incarnationId: 'replacement-incarnation', - launchIncarnationId: 'initial-incarnation', - launchToken: expect.any(String) - }) - await expect(runtime.getTerminalAgentStatus(handle)).rejects.toThrow('terminal_handle_stale') - - runtime.registerPty(PTY_ID, WORKTREE_ID, null, { - tabId: TAB_ID, - leafId: LEAF_ID, - incarnationId: 'replacement-incarnation' - }) - const replacementHandle = runtime.getTerminalHandleForPaneKey(`${TAB_ID}:${LEAF_ID}`) - if (replacementHandle === null) { - throw new Error('replacement terminal handle was not registered') - } - expect(replacementHandle).not.toBe(handle) - await expect(runtime.getTerminalAgentStatus(replacementHandle)).resolves.toMatchObject({ - isRunningAgent: false - }) - expect( - await readAgentEvidenceAtDeadline( - () => guardedSendResult(runtime, replacementHandle), - NO_AGENT_GUARD_DEADLINE_MS - ) - ).toBe('terminal_guard_no_agent') - }) -}) diff --git a/src/main/runtime/terminal/input/terminal-plugin-hooked-input.ts b/src/main/runtime/terminal/input/terminal-plugin-hooked-input.ts index 57590e3da0e..f24506fa874 100644 --- a/src/main/runtime/terminal/input/terminal-plugin-hooked-input.ts +++ b/src/main/runtime/terminal/input/terminal-plugin-hooked-input.ts @@ -1,5 +1,5 @@ import type { RuntimeTerminalSend } from '../../../../shared/runtime-terminal-send-contract' -import { assertLegacyAiVaultResumeCommandAllowed } from '../../../ai-vault/structured-session-ownership' +import { assertLegacyAiVaultResumeCommandAllowed } from '../../../ai-vault/structured-sessions/structured-session-ownership' import type { RuntimeTerminalWriteOptions } from './runtime-terminal-writer' import { OrcaRuntimeWithControllerKnowsPtyIsLive } from './terminal-input-dispatch' import type { RuntimeAgentPromptWriteOptions } from './agent-prompt-write-options' diff --git a/src/main/runtime/terminal/launch/mobile-terminal-chat-fork-create.ts b/src/main/runtime/terminal/launch/mobile-terminal-chat-fork-create.ts index 7c744b51f4b..63a4efaff68 100644 --- a/src/main/runtime/terminal/launch/mobile-terminal-chat-fork-create.ts +++ b/src/main/runtime/terminal/launch/mobile-terminal-chat-fork-create.ts @@ -8,13 +8,13 @@ import type { RuntimeMobileSessionCreateTerminalResult } from '../../../../share import { prepareStructuredChatCliFork, isStructuredChatCliForkSourceCurrent -} from '../../../ai-vault/structured-chat-cli-fork' +} from '../../../ai-vault/structured-sessions/structured-chat-cli-fork' import { buildMobileTerminalChatFork } from './mobile-terminal-chat-fork' import { isWslUncPath } from '../../../../shared/wsl-paths' import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { applyRemoteViewerLaunchEnv } from './remote-viewer-launch-env' import { deterministicAgentSessionUuid } from './runtime-agent-launch-resolution' -import { rendererPublicationThrottle } from '../../../window/renderer-publication-throttle' +import { rendererPublicationThrottle } from '../../../window/visibility/renderer-publication-throttle' import { PROJECT_RUNTIME_REPAIR_REQUIRED_CODE } from '../../../../shared/project-runtime-repair-message' import { OrchestrationError } from '../../orchestration/orchestration-error' import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' diff --git a/src/main/runtime/terminal/launch/mobile-terminal-chat-fork.test.ts b/src/main/runtime/terminal/launch/mobile-terminal-chat-fork.test.ts deleted file mode 100644 index db104413939..00000000000 --- a/src/main/runtime/terminal/launch/mobile-terminal-chat-fork.test.ts +++ /dev/null @@ -1,166 +0,0 @@ -import { expect, it, vi } from 'vitest' -import type { RuntimeNotifier } from '../../client/events/runtime-notifier-contract' -import './mobile-terminal-chat-fork' -import { prepareStructuredChatCliFork } from '../../../ai-vault/structured-chat-cli-fork' -import '../../orchestration/orchestration-error' -import '../../../../shared/project-runtime-repair-message' -import '../../orca-runtime-tests/orca-runtime-test-lifecycle.spec' -import { committingSpawn } from '../../orca-runtime-tests/bind-first-pane.test-fixture' -import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/layout-owner-switch' -import { structuredAgentSessionTabId } from '../../../../shared/agent-session/view/structured-agent-session-projection' -vi.mock('../../../ai-vault/structured-chat-cli-fork', () => ({ - prepareStructuredChatCliFork: vi.fn(), - isStructuredChatCliForkSourceCurrent: vi.fn(() => true) -})) -const cwd = process.platform === 'win32' ? 'C:\\repo' : '/tmp/repo' -const filePath = process.platform === 'win32' ? 'C:\\sessions\\chat.jsonl' : '/tmp/chat.jsonl' - -it.each([true, false])( - 'forks a source-selected chat with saved placement available: %s', - async (saved) => { - await import('../../orca-runtime-tests/runtime-test-module-registration.spec') - const { OrcaRuntimeService } = await import('../../orca-runtime') - const { electronMocks } = await import('../../orca-runtime-test-mocks/setup.spec') - const { - TEST_WORKTREE_ID: wt, - makeRuntimeStoreWithWorkspaceSession, - makeWorkspaceSessionWithHeadlessTerminal - } = await import('../../orca-runtime-tests/orca-runtime-test-fixtures.spec') - const { withChatTabChanges } = await import('../../agent-session/agent-session-tab-layout') - const source = 'source-chat', - row = `agent-session:${source}`, - canonical = 'custom-chat-tab' - const initial = makeWorkspaceSessionWithHeadlessTerminal() - const session = - withChatTabChanges('local', initial, wt, [ - { open: { sessionId: source, agent: 'claude', tabId: canonical } } - ]) ?? initial - const group = session.tabGroups?.[wt]?.[0] - if (!group) { - throw new Error('Missing saved group') - } - group.tabOrder = [canonical, 'host-tab'] - const fixture = makeRuntimeStoreWithWorkspaceSession(saved ? session : initial) - const admit = vi.spyOn(fixture.runtimeStore, 'admitTerminalPane') - const service = new OrcaRuntimeService(fixture.runtimeStore) - const spawn = vi.fn( - async (_options: { worktreeId?: string; tabId?: string; leafId?: string }) => ({ - id: 'pty-fork', - incarnationId: '45454545-4545-4545-8545-454545454545' - }) - ) - service.setPtyController({ - spawn: committingSpawn(service, spawn), - write: () => true, - kill: () => true, - getForegroundProcess: async () => null, - listProcesses: async () => [] - }) - electronMocks.BrowserWindow.fromId.mockReturnValue({ - isDestroyed: () => false, - webContents: { - isDestroyed: () => false, - setBackgroundThrottling: vi.fn(), - capturePage: async () => undefined - } - }) - service.attachWindow(1) - service.syncWindowGraph(1, { tabs: [], leaves: [] }) - const { createMobileCreateTestNotifier } = - await import('../../orca-runtime-tests/orca-runtime-test-scenario-builders.spec') - const reveal = vi.fn>( - (_worktree, opts) => { - if (!opts.tabId || !opts.leafId) { - throw new Error('Missing revealed pane') - } - return { - tabId: opts.tabId, - identity: { - worktreeId: wt, - tabId: opts.tabId, - leafId: opts.leafId, - ptyId: opts.ptyId - } - } - } - ) - service.setNotifier({ - ...createMobileCreateTestNotifier(vi.fn()), - revealTerminalSession: reveal - }) - vi.spyOn(service, 'ensureStructuredAgentSessionHost').mockResolvedValue(undefined) - await service.publishStructuredAgentSessionTab({ - workspaceId: wt, - sessionId: source, - agent: 'claude', - activate: true - }) - vi.mocked(prepareStructuredChatCliFork).mockResolvedValue({ - useRealCodexHome: false, - cliForkSource: { - agent: 'claude', - sourceAgent: 'claude', - sessionId: source, - filePath, - cwd, - codexHome: null, - executionHostPlatform: process.platform - } - }) - const created = await service.createMobileSessionTerminal(`id:${wt}`, { - sourceChatFork: { sessionId: source }, - afterTabId: row, - clientMutationId: 'fork', - navigation: 'caller', - clientNavigationId: 'phone', - supportsSplitGroupPlacement: true - }) - expect(spawn).toHaveBeenCalledOnce() - expect(spawn.mock.calls[0]?.[0]).toEqual( - expect.objectContaining({ - command: expect.stringContaining(source) - }) - ) - expect(admit).toHaveBeenCalledOnce() - expect(admit.mock.calls[0]?.[0]).toMatchObject({ - type: 'createTerminalTab', - tabId: created.tab.parentTabId, - ...(saved ? { afterTabId: canonical, groupId: group.id } : {}) - }) - expect(admit.mock.calls[0]?.[0]).not.toMatchObject({ afterTabId: row }) - expect(reveal).toHaveBeenCalledWith( - wt, - expect.objectContaining({ - tabId: created.tab.parentTabId, - leafId: created.tab.leafId, - ptyId: created.tab.ptyId, - activate: false, - focus: false, - presentation: 'background', - surfaceOwner: false, - ...(saved ? { afterTabId: canonical, targetGroupId: group.id } : {}) - }) - ) - if (saved) { - expect( - fixture.getSession().tabGroups?.[wt]?.find((entry) => entry.id === group.id)?.tabOrder - ).toEqual([canonical, created.tab.parentTabId, 'host-tab']) - expect(fixture.getSession().unifiedTabs?.[wt]).toEqual( - expect.arrayContaining([expect.objectContaining({ id: canonical, entityId: source })]) - ) - } else if (ORCA_LAYOUT_OWNER_IS_MAIN) { - expect(admit.mock.calls[0]?.[0]).toMatchObject({ - afterTabId: structuredAgentSessionTabId(source) - }) - } else { - expect(admit.mock.calls[0]?.[0]).not.toHaveProperty('afterTabId') - expect(reveal.mock.calls[0]?.[1]).not.toHaveProperty('afterTabId') - expect(reveal.mock.calls[0]?.[1]).not.toHaveProperty('targetGroupId') - } - expect((await service.listMobileSessionTabs(`id:${wt}`)).tabs).toEqual( - expect.arrayContaining([ - expect.objectContaining({ type: 'agent-session', id: row, sessionId: source }) - ]) - ) - } -) diff --git a/src/main/runtime/terminal/launch/mobile-terminal-renderer-create.ts b/src/main/runtime/terminal/launch/mobile-terminal-renderer-create.ts index f79c0bc11ee..81c59d9b381 100644 --- a/src/main/runtime/terminal/launch/mobile-terminal-renderer-create.ts +++ b/src/main/runtime/terminal/launch/mobile-terminal-renderer-create.ts @@ -12,7 +12,7 @@ import { MOBILE_TERMINAL_SURFACE_TIMEOUT_MS } from '../view/terminal-surface-deadlines' import { isClientDisconnectedError } from '../../client/runtime-client-disconnect' -import { rendererPublicationThrottle } from '../../../window/renderer-publication-throttle' +import { rendererPublicationThrottle } from '../../../window/visibility/renderer-publication-throttle' import { deterministicAgentSessionUuid } from './runtime-agent-launch-resolution' import { assertMobileTerminalShellSupported } from './mobile-terminal-shell-refusal' import { anchorTabOfCreate, mainPlacedAfter } from './mobile-terminal-create-anchor' diff --git a/src/main/runtime/terminal/launch/terminal-pty-exit-waiter.spec.ts b/src/main/runtime/terminal/launch/terminal-pty-exit-waiter.spec.ts index 2fee34fc5a6..3d397a1750f 100644 --- a/src/main/runtime/terminal/launch/terminal-pty-exit-waiter.spec.ts +++ b/src/main/runtime/terminal/launch/terminal-pty-exit-waiter.spec.ts @@ -11,7 +11,7 @@ import { waitForWorkerAgentReady } from '../wait/launched-agent-composer-readine export function registerTerminalPtyExitWaiterTests(): void { describe('idle and fresh readiness waits on an exited terminal', () => { it.each( - (['pi', 'claude', 'codex', 'opencode'] as const).flatMap((agent) => + (['pi', 'claude', 'opencode'] as const).flatMap((agent) => [true, false].map((exitBeforeWait) => ({ agent, exitBeforeWait })) ) )( diff --git a/src/main/runtime/terminal/layout/mobile-presence-lock.test.ts b/src/main/runtime/terminal/layout/mobile-presence-lock.test.ts deleted file mode 100644 index 9fa17d5d1b0..00000000000 --- a/src/main/runtime/terminal/layout/mobile-presence-lock.test.ts +++ /dev/null @@ -1,199 +0,0 @@ -import { mobilePresenceStore as store } from '../../orca-runtime-test-mocks/mobile-presence-store' -import type * as WorktreeScanCacheModule from '../../../git/worktrees/catalog/worktree-scan-cache' -import type * as WorktreeListingModule from '../../../git/worktrees/catalog/worktree-listing' -import '../input/terminal-input-admission' -import './mobile-subscribe-integration.spec' -import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest' -import { listWorktrees } from '../../../git/worktrees/catalog/worktree-scan-cache' -import type * as GitUsernameModule from '../../../git/repositories/git-username' -import { OrcaRuntimeService } from '../../orca-runtime' -import type { RuntimePtyController } from '../lifecycle/runtime-pty-controller-contract' - -vi.mock('../../../git/worktrees/catalog/worktree-scan-cache', async (importOriginal) => { - const facade = getWorktreeListingMocks() - return { - ...(await importOriginal()), - listWorktrees: facade.listWorktrees - } -}) - -vi.mock('../../../git/worktrees/catalog/worktree-listing', async (importOriginal) => { - const facade = getWorktreeListingMocks() - return { - ...(await importOriginal()), - listWorktreesStrict: facade.listWorktreesStrict - } -}) - -const { getWorktreeListingMocks } = vi.hoisted(() => { - const createWorktreeListingMocks = () => ({ - listWorktrees: vi.fn().mockResolvedValue([]), - listWorktreesStrict: vi.fn().mockResolvedValue([]) - }) - let listings: ReturnType | undefined - return { getWorktreeListingMocks: () => (listings ??= createWorktreeListingMocks()) } -}) -vi.mock('../../../workspace-hooks/hooks', () => ({ - getEffectiveHooks: vi.fn().mockReturnValue(null), - runHook: vi.fn().mockResolvedValue({ success: true, output: '' }) -})) -vi.mock('../../../workspace-hooks/worktree-runner-script', () => ({ - createSetupRunnerScript: vi.fn() -})) -vi.mock('../../../ipc/worktree-logic', async (importOriginal) => { - const actual = (await importOriginal()) as Record - return { ...actual, computeWorktreePath: vi.fn(), ensurePathWithinWorkspace: vi.fn() } -}) -vi.mock('../../../ipc/worktrees/removal/registered-worktree-roots-cache', () => ({ - invalidateAuthorizedRootsCache: vi.fn(), - invalidateAuthorizedRootsCacheForRepo: vi.fn() -})) -const repoBranchConflictMock = vi.hoisted(() => vi.fn().mockResolvedValue(null)) - -vi.mock('../../../git/repositories/git-username', async () => { - const actual = await vi.importActual( - '../../../git/repositories/git-username' - ) - return { ...actual, resolveLocalGitUsername: vi.fn(async () => '') } -}) - -// #7588 held-modal cases need per-test indefinite hold without mutating the shared default. -function createRuntime(mobileAutoRestoreFitMs: number | null = 5_000) { - vi.mocked(listWorktrees).mockResolvedValue([]) - const effectiveStore = { - ...store, - getSettings: () => ({ ...store.getSettings(), mobileAutoRestoreFitMs }) - } - const runtime = new OrcaRuntimeService(effectiveStore) - const ptySizes = new Map([ - ['pty-1', { cols: 150, rows: 40 }] - ]) - const resizes: { ptyId: string; cols: number; rows: number }[] = [] - const writes: string[] = [] - const driverEvents: { ptyId: string; driver: { kind: string; clientId?: string } }[] = [] - const fitOverrideEvents: { ptyId: string; mode: string; cols: number; rows: number }[] = [] - let resizeSucceeds = true - - const controller: RuntimePtyController = { - write: (_ptyId, data) => { - writes.push(data) - return true - }, - kill: () => true, - getForegroundProcess: async () => null, - resize: (ptyId, cols, rows) => { - if (!resizeSucceeds) { - return false - } - ptySizes.set(ptyId, { cols, rows }) - resizes.push({ ptyId, cols, rows }) - return true - }, - getSize: (ptyId) => ptySizes.get(ptyId) ?? null - } - runtime.setPtyController(controller) - runtime.setNotifier({ - worktreesChanged: vi.fn(), - reposChanged: vi.fn(), - activateWorktree: vi.fn(), - createTerminal: vi.fn(), - splitTerminal: vi.fn(), - renameTerminal: vi.fn(), - focusTerminal: vi.fn(), - closeTerminal: vi.fn(), - terminalFitOverrideChanged: (ptyId, mode, cols, rows) => { - fitOverrideEvents.push({ ptyId, mode, cols, rows }) - }, - terminalDriverChanged: (ptyId, driver) => { - driverEvents.push({ ptyId, driver: { ...driver } }) - } - }) - - return { - runtime, - controller, - ptySizes, - resizes, - writes, - driverEvents, - fitOverrideEvents, - setResizeSucceeds: (next: boolean) => { - resizeSucceeds = next - } - } -} - -describe('mobile presence lock — multi-mobile semantics', () => { - beforeEach(() => vi.useFakeTimers()) - afterEach(() => vi.useRealTimers()) - - it('updateDesktopViewport resizes the source PTY and records desktop geometry', async () => { - const { runtime, ptySizes, resizes } = createRuntime() - - expect(await runtime.updateDesktopViewport('pty-1', { cols: 132, rows: 44 })).toBe(true) - - expect(ptySizes.get('pty-1')).toEqual({ cols: 132, rows: 44 }) - expect(resizes.at(-1)).toEqual({ ptyId: 'pty-1', cols: 132, rows: 44 }) - // Controller drift must not overwrite remembered renderer geometry. - ptySizes.set('pty-1', { cols: 160, rows: 50 }) - await runtime.handleMobileSubscribe('pty-1', 'phone-A', { cols: 49, rows: 20 }) - expect(await runtime.reclaimTerminalForDesktop('pty-1')).toBe(true) - expect(ptySizes.get('pty-1')).toEqual({ cols: 132, rows: 44 }) - }) - - it('updateDesktopViewport records restore geometry while phone-fit override is held', async () => { - const { runtime, ptySizes, resizes } = createRuntime() - await runtime.handleMobileSubscribe('pty-1', 'phone-A', { cols: 49, rows: 20 }) - expect(ptySizes.get('pty-1')).toEqual({ cols: 49, rows: 20 }) - resizes.length = 0 - - expect(await runtime.updateDesktopViewport('pty-1', { cols: 132, rows: 44 })).toBe(true) - - expect(ptySizes.get('pty-1')).toEqual({ cols: 49, rows: 20 }) - expect(resizes).toEqual([]) - - expect(await runtime.reclaimTerminalForDesktop('pty-1')).toBe(true) - expect(ptySizes.get('pty-1')).toEqual({ cols: 132, rows: 44 }) - }) -}) - -// #7588: null-viewport re-subscribe leaves an active subscriber under the held fit override. -async function reachHeldModalWithNullViewportResubscribe( - runtime: OrcaRuntimeService -): Promise { - await runtime.handleMobileSubscribe('pty-1', 'phone-A', { cols: 45, rows: 20 }) - runtime.handleMobileUnsubscribe('pty-1', 'phone-A') - await vi.advanceTimersByTimeAsync(300) - await runtime.handleMobileSubscribe('pty-1', 'phone-A', undefined) -} - -describe('mobile presence lock — issue #7588 held-modal restore convergence', () => { - beforeEach(() => vi.useFakeTimers()) - afterEach(() => vi.useRealTimers()) - - it('reclaim after a null-viewport resubscribe restores dims, clears override, notifies both channels', async () => { - const { runtime, ptySizes, fitOverrideEvents } = createRuntime(null) - const listenerEvents: { mode: string; cols: number; rows: number }[] = [] - runtime.subscribeToFitOverrideChanges('pty-1', (e) => listenerEvents.push(e)) - - await reachHeldModalWithNullViewportResubscribe(runtime) - expect(runtime.getDriver('pty-1')).toEqual({ kind: 'idle' }) - expect(runtime.getTerminalFitOverride('pty-1')).not.toBeNull() - expect(ptySizes.get('pty-1')).toEqual({ cols: 45, rows: 20 }) - - const notifierBefore = fitOverrideEvents.length - const listenerBefore = listenerEvents.length - const restored = await runtime.reclaimTerminalForDesktop('pty-1') - - expect(restored).toBe(true) - expect(ptySizes.get('pty-1')).toEqual({ cols: 150, rows: 40 }) - expect(runtime.getTerminalFitOverride('pty-1')).toBeNull() - expect(fitOverrideEvents.slice(notifierBefore).some((e) => e.mode === 'desktop-fit')).toBe(true) - expect(listenerEvents.slice(listenerBefore).some((e) => e.mode === 'desktop-fit')).toBe(true) - }) -}) - -vi.mock('../../../git/refs/resolution/repo-branch-conflict', async (importOriginal) => ({ - ...(await importOriginal>()), - getBranchConflictKind: repoBranchConflictMock -})) diff --git a/src/main/runtime/terminal/layout/mobile-subscribe-integration.spec.ts b/src/main/runtime/terminal/layout/mobile-subscribe-integration.spec.ts deleted file mode 100644 index 03367f9ca29..00000000000 --- a/src/main/runtime/terminal/layout/mobile-subscribe-integration.spec.ts +++ /dev/null @@ -1,279 +0,0 @@ -import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest' -import { listWorktrees } from '../../../git/worktrees/catalog/worktree-scan-cache' -import { OrcaRuntimeService } from '../../orca-runtime' - -// Legacy restore cases need finite 5s (the clamp floor); production defaults to indefinite hold. -const LEGACY_RESTORE_MS = 5_000 -const settingsState = { - mobileAutoRestoreFitMs: LEGACY_RESTORE_MS as number | null -} - -const store = { - getRepo: () => ({ - id: 'repo-1', - path: '/tmp/repo', - displayName: 'repo', - badgeColor: 'blue', - addedAt: 1 - }), - getRepos: () => [store.getRepo()], - addRepo: () => {}, - updateRepo: () => undefined as never, - getAllWorktreeMeta: () => ({}), - getWorktreeMeta: () => undefined, - getGitHubCache: () => ({ pr: {}, issue: {} }), - setWorktreeMeta: () => undefined as never, - removeWorktreeMeta: () => {}, - getRetiredWorktreeNameRegistry: () => ({ exhaustedTiers: 0, names: [] }), - addRetiredWorktreeName: () => {}, - mergeRetiredWorktreeNames: () => false, - getSettings: () => ({ - workspaceDir: '/tmp/workspaces', - nestWorkspaces: false, - refreshLocalBaseRefOnWorktreeCreate: false, - branchPrefix: 'none', - branchPrefixCustom: '', - mobileAutoRestoreFitMs: settingsState.mobileAutoRestoreFitMs - }), - updateSettings: (updates: { mobileAutoRestoreFitMs?: number | null }) => { - if ('mobileAutoRestoreFitMs' in updates) { - settingsState.mobileAutoRestoreFitMs = updates.mobileAutoRestoreFitMs ?? null - } - } -} - -class ObservableRuntime extends OrcaRuntimeService { - get restoreTimers(): typeof this.pendingRestoreTimers { - return this.pendingRestoreTimers - } - get softLeavers(): typeof this.pendingSoftLeavers { - return this.pendingSoftLeavers - } - get fitOverrides(): typeof this.terminalFitOverrides { - return this.terminalFitOverrides - } - get drivers(): typeof this.terminalDrivers { - return this.terminalDrivers - } -} - -function createRuntime() { - vi.mocked(listWorktrees).mockResolvedValue([ - { - path: '/tmp/worktree-a', - head: 'abc', - branch: 'feature/foo', - isBare: false, - isMainWorktree: false - } - ]) - const runtime = new ObservableRuntime(store) - const ptySizes = new Map() - ptySizes.set('pty-1', { cols: 150, rows: 40 }) - ptySizes.set('pty-2', { cols: 120, rows: 35 }) - ptySizes.set('pty-3', { cols: 100, rows: 30 }) - - const resizes: { ptyId: string; cols: number; rows: number }[] = [] - const notifications: { ptyId: string; mode: string; cols: number; rows: number }[] = [] - - runtime.setPtyController({ - write: () => true, - kill: () => true, - getForegroundProcess: async () => null, - resize: (ptyId, cols, rows) => { - ptySizes.set(ptyId, { cols, rows }) - resizes.push({ ptyId, cols, rows }) - return true - }, - getSize: (ptyId) => ptySizes.get(ptyId) ?? null - }) - runtime.setNotifier({ - worktreesChanged: vi.fn(), - reposChanged: vi.fn(), - activateWorktree: vi.fn(), - createTerminal: vi.fn(), - splitTerminal: vi.fn(), - renameTerminal: vi.fn(), - focusTerminal: vi.fn(), - closeTerminal: vi.fn(), - terminalFitOverrideChanged: (ptyId, mode, cols, rows) => { - notifications.push({ ptyId, mode, cols, rows }) - }, - terminalDriverChanged: vi.fn() - }) - - return { runtime, ptySizes, resizes, notifications } -} - -describe('mobile subscribe integration', () => { - beforeEach(() => { - vi.useFakeTimers() - settingsState.mobileAutoRestoreFitMs = LEGACY_RESTORE_MS - }) - - afterEach(() => { - vi.useRealTimers() - }) - - it('serializeMainTerminalBuffer reports the seq included in the headless snapshot', async () => { - vi.useRealTimers() - const { runtime } = createRuntime() - const first = 'one\r\n' - const second = 'two\r\n' - const third = 'three\r\n' - - runtime.onPtyData('pty-1', first, Date.now()) - const initialSnapshot = await runtime.serializeMainTerminalBuffer('pty-1') - expect(initialSnapshot?.seq).toBe(first.length) - expect(initialSnapshot?.source).toBe('headless') - - type HeadlessStateForTest = { - emulator: { write: (data: string) => Promise | void } - } - const headless = ( - runtime as unknown as { headlessTerminals: Map } - ).headlessTerminals.get('pty-1') - expect(headless).toBeDefined() - const originalWrite = headless!.emulator.write.bind(headless!.emulator) - const secondWriteGate: { release: (() => void) | null } = { release: null } - const secondWriteStarted = new Promise((resolve) => { - headless!.emulator.write = async (data: string): Promise => { - if (data === second) { - resolve() - await new Promise((release) => { - secondWriteGate.release = release - }) - } - await originalWrite(data) - } - }) - - try { - runtime.onPtyData('pty-1', second, Date.now()) - await secondWriteStarted - const racedSnapshot = runtime.serializeMainTerminalBuffer('pty-1') - runtime.onPtyData('pty-1', third, Date.now()) - if (!secondWriteGate.release) { - throw new Error('second write did not block') - } - secondWriteGate.release() - - const snapshot = await racedSnapshot - expect(snapshot?.seq).toBe(first.length + second.length) - expect(snapshot?.source).toBe('headless') - expect(runtime.getPtyOutputSequence('pty-1')).toBe( - first.length + second.length + third.length - ) - - const finalSnapshot = await runtime.serializeMainTerminalBuffer('pty-1') - expect(finalSnapshot?.seq).toBe(first.length + second.length + third.length) - expect(finalSnapshot?.source).toBe('headless') - } finally { - headless!.emulator.write = originalWrite - secondWriteGate.release?.() - } - }) - - it('preserves held-override baseline across resubscribe-after-indefinite-hold', async () => { - // Indefinite-hold re-subscribe must inherit the retained desktop baseline for later Restore. - settingsState.mobileAutoRestoreFitMs = null - const { runtime, ptySizes } = createRuntime() - - await runtime.handleMobileSubscribe('pty-1', 'client-a', { cols: 45, rows: 20 }) - expect(ptySizes.get('pty-1')).toEqual({ cols: 45, rows: 20 }) - - runtime.handleMobileUnsubscribe('pty-1', 'client-a') - await vi.advanceTimersByTimeAsync(60_000) - expect(ptySizes.get('pty-1')).toEqual({ cols: 45, rows: 20 }) - - await runtime.handleMobileSubscribe('pty-1', 'client-a', { cols: 45, rows: 20 }) - - await runtime.reclaimTerminalForDesktop('pty-1') - - expect(ptySizes.get('pty-1')).toEqual({ cols: 150, rows: 40 }) - }) - - describe('onExternalPtyResize', () => { - it('ignores reports while a mobile-fit override is in place', async () => { - // Phone-fit echoes must not poison the desktop restore baseline; see docs/mobile-fit-hold.md. - const { runtime, ptySizes } = createRuntime() - await runtime.handleMobileSubscribe('pty-1', 'client-a', { cols: 45, rows: 20 }) - - runtime.onExternalPtyResize('pty-1', 45, 20) - - runtime.setMobileDisplayMode('pty-1', 'desktop') - await runtime.applyMobileDisplayMode('pty-1') - expect(ptySizes.get('pty-1')).toEqual({ cols: 150, rows: 40 }) - }) - - it('updates baseline mid-fit when desktop reports dims that differ from the override', async () => { - // A newly visible desktop tab can report real geometry during phone fit; retain it for restore. - const { runtime, ptySizes } = createRuntime() - ptySizes.set('pty-1', { cols: 80, rows: 24 }) - runtime.onExternalPtyResize('pty-1', 80, 24) - await runtime.handleMobileSubscribe('pty-1', 'client-a', { cols: 45, rows: 20 }) - - runtime.onExternalPtyResize('pty-1', 200, 60) - - runtime.setMobileDisplayMode('pty-1', 'desktop') - await runtime.applyMobileDisplayMode('pty-1') - expect(ptySizes.get('pty-1')).toEqual({ cols: 200, rows: 60 }) - }) - }) - - describe('recordRendererGeometry (pty:reportGeometry IPC)', () => { - it('bypasses the cascade-suppress window (it is measurement-only)', async () => { - const { runtime, ptySizes, resizes } = createRuntime() - await runtime.handleMobileSubscribe('pty-1', 'client-a', { cols: 45, rows: 20 }) - runtime.setMobileDisplayMode('pty-1', 'desktop') - await runtime.applyMobileDisplayMode('pty-1') - expect(runtime.isResizeSuppressed()).toBe(true) - expect(ptySizes.get('pty-1')).toEqual({ cols: 150, rows: 40 }) - resizes.length = 0 - - runtime.recordRendererGeometry('pty-1', 130, 40) - expect(ptySizes.get('pty-1')).toEqual({ cols: 150, rows: 40 }) - expect(resizes).toEqual([]) - - runtime.setMobileDisplayMode('pty-1', 'auto') - await runtime.applyMobileDisplayMode('pty-1') - expect(ptySizes.get('pty-1')).toEqual({ cols: 45, rows: 20 }) - runtime.setMobileDisplayMode('pty-1', 'desktop') - await runtime.applyMobileDisplayMode('pty-1') - expect(ptySizes.get('pty-1')).toEqual({ cols: 130, rows: 40 }) - }) - }) - - // See docs/mobile-fit-hold.md. - describe('mobileAutoRestoreFitMs (fit hold)', () => { - it('reclaim with WS disconnect between cycles — held branch restores correctly each time', async () => { - // Repeated held-override reclaim must restore desktop geometry, never the current phone fit. - settingsState.mobileAutoRestoreFitMs = null - const { runtime, ptySizes } = createRuntime() - - for (let i = 0; i < 3; i++) { - await runtime.handleMobileSubscribe('pty-1', 'client-a', { cols: 45, rows: 20 }) - await runtime.mobileTookFloor('pty-1', 'client-a') - expect(ptySizes.get('pty-1'), `iter ${i}: phone-fit`).toEqual({ cols: 45, rows: 20 }) - - runtime.onClientDisconnected('client-a') - await vi.advanceTimersByTimeAsync(0) - await vi.advanceTimersByTimeAsync(60_000) - expect(ptySizes.get('pty-1'), `iter ${i}: held after disconnect`).toEqual({ - cols: 45, - rows: 20 - }) - expect(runtime.isMobileSubscriberActive('pty-1'), `iter ${i}: no subscribers`).toBe(false) - expect(runtime.getTerminalFitOverride('pty-1'), `iter ${i}: override held`).not.toBeNull() - - const ok = await runtime.reclaimTerminalForDesktop('pty-1') - expect(ok, `iter ${i}: reclaim ok`).toBe(true) - expect(ptySizes.get('pty-1'), `iter ${i}: PTY restored to desktop`).toEqual({ - cols: 150, - rows: 40 - }) - expect(runtime.getTerminalFitOverride('pty-1'), `iter ${i}: override cleared`).toBeNull() - } - }) - }) -}) diff --git a/src/main/runtime/terminal/output/stale-title-display-surfaces.test.ts b/src/main/runtime/terminal/output/stale-title-display-surfaces.test.ts index f0f27f9cde0..94edd862714 100644 --- a/src/main/runtime/terminal/output/stale-title-display-surfaces.test.ts +++ b/src/main/runtime/terminal/output/stale-title-display-surfaces.test.ts @@ -2,7 +2,6 @@ import { describe, expect, it, vi } from 'vitest' import '../../orca-runtime-tests/runtime-test-module-registration.spec' import { OrcaRuntimeService } from '../../orca-runtime' import '../../orca-runtime-tests/orca-runtime-test-lifecycle.spec' -import { assertTerminalAgentSendable } from '../../rpc/terminal-agent-send-guard' import { HEADLESS_LEAF_ID, TEST_WORKTREE_ID, @@ -170,146 +169,6 @@ describe('display surfaces after the stale-working title clear', () => { }) // Synthetic: a trust dialog painted after the clear, behind the name title `⠋ Claude Code`. - it.each(['mounted', 'mountedEcho', 'rendererless'] as const)( - 'a trust dialog painted after the clear still reads as a wait on the user (%s)', - async (mode) => { - vi.useFakeTimers() - try { - const ptyId = mode === 'rendererless' ? 'bg-pty' : 'pty-1' - const runtime = new OrcaRuntimeService(store) - runtime.setPtyController({ - spawn: vi.fn().mockResolvedValue({ id: ptyId }), - write: () => true, - kill: () => true, - getForegroundProcess: async () => 'claude' - }) - let handle: string - if (mode === 'rendererless') { - runtime.attachWindow(1) - runtime.syncWindowGraph(1, { tabs: [], leaves: [] }) - handle = ( - await runtime.createTerminal(`id:${TEST_WORKTREE_ID}`, { - tabId: 'bg-tab', - leafId: HEADLESS_LEAF_ID - }) - ).handle - } else { - syncSinglePty(runtime, ptyId, { tabTitle: 'Terminal 1', paneTitle: null }) - runtime.onPtyData(ptyId, 'boot\r\n', Date.now()) - handle = (await runtime.listTerminals()).terminals[0]?.handle ?? '' - } - runtime.onPtyData(ptyId, '\x1b]0;⠋ Claude Code\x07', Date.now()) - if (mode !== 'rendererless') { - syncSinglePty(runtime, ptyId, { tabTitle: '⠋ Claude Code', paneTitle: '⠋ Claude Code' }) - } - runtime.onPtyData(ptyId, 'still running\r\n', Date.now()) - await vi.advanceTimersByTimeAsync(3_000) - if (mode === 'mountedEcho') { - // The renderer republishes its own cleared title, as a mounted pane does. - syncSinglePty(runtime, ptyId, { tabTitle: 'Claude Code', paneTitle: 'Claude Code' }) - } - await vi.advanceTimersByTimeAsync(1_000) - runtime.onPtyData( - ptyId, - '\r\nDo you trust the files in this folder?\r\n /repo/app\r\n 1. Yes, proceed\r\n 2. No, exit\r\n', - Date.now() - ) - await vi.advanceTimersByTimeAsync(1_000) - await expect(runtime.getTerminalAgentStatus(handle)).resolves.toMatchObject({ - isRunningAgent: true, - status: 'permission' - }) - await expect( - assertTerminalAgentSendable({ runtime, handle, assertWritable: () => {} }) - ).rejects.toThrow('terminal_guard_permission') - await expect(runtime.getTerminalInteractiveWait(handle)).resolves.toMatchObject({ - source: 'prompt-text', - reason: 'agent-trust-workspace' - }) - } finally { - vi.useRealTimers() - } - } - ) // Synthetic: prompt verification behind a standing clear judges against the baseline main had. - it.each([ - ['mounted', 'output only', false], - ['mountedEcho', 'output only', false], - ['rendererless', 'output only', false], - ['mounted', 'a new spinner frame', true], - ['mountedEcho', 'a new spinner frame', true], - ['rendererless', 'a new spinner frame', true] - ] as const)( - 'a prompt sent behind a cleared spinner (%s) answered by %s settles as on main', - async (mode, _after, spinnerFrame) => { - vi.useFakeTimers() - try { - const ptyId = mode === 'rendererless' ? 'bg-pty' : 'pty-1' - const runtime = new OrcaRuntimeService(store) - runtime.setPtyController({ - spawn: vi.fn().mockResolvedValue({ id: ptyId }), - write: (_ptyId, data) => { - if (data === '\r') { - runtime.onPtyData( - ptyId, - spinnerFrame ? '\x1b]0;⠙ Claude Code\x07' : '\r\n', - Date.now() - ) - } - return true - }, - kill: () => true, - getForegroundProcess: async () => 'claude' - }) - let handle: string - if (mode === 'rendererless') { - runtime.attachWindow(1) - runtime.syncWindowGraph(1, { tabs: [], leaves: [] }) - handle = ( - await runtime.createTerminal(`id:${TEST_WORKTREE_ID}`, { - tabId: 'bg-tab', - leafId: HEADLESS_LEAF_ID - }) - ).handle - } else { - syncSinglePty(runtime, ptyId, { tabTitle: 'Terminal 1', paneTitle: null }) - runtime.onPtyData(ptyId, 'boot\r\n', Date.now()) - handle = (await runtime.listTerminals()).terminals[0]?.handle ?? '' - } - runtime.onPtyData(ptyId, '\x1b]0;⠋ Claude Code\x07', Date.now()) - if (mode !== 'rendererless') { - syncSinglePty(runtime, ptyId, { tabTitle: '⠋ Claude Code', paneTitle: '⠋ Claude Code' }) - } - runtime.onPtyData(ptyId, 'still running\r\n', Date.now()) - await vi.advanceTimersByTimeAsync(3_000) - if (mode === 'mountedEcho') { - syncSinglePty(runtime, ptyId, { tabTitle: 'Claude Code', paneTitle: 'Claude Code' }) - } - if (spinnerFrame) { - // The receipt path takes no output as evidence, so only a new turn settles it. - const submission = runtime.sendTerminalAgentPrompt(handle, 'review this', { - inputKind: 'driving', - acceptQueued: true, - requestId: `after-clear-${mode}` - }) - await vi.advanceTimersByTimeAsync(20_000) - await expect(submission).resolves.toMatchObject({ - prompt: { stages: ['input_accepted', 'turn_started'] } - }) - } else { - // Output after Enter is not a turn start, so a swallowed Enter still reads as stalled. - const submission = runtime.sendTerminalAgentPrompt(handle, 'review this', { - inputKind: 'driving' - }) - const rejected = expect(submission).rejects.toThrow('agent_prompt_stalled') - // Past the 30 s effect window. - await vi.advanceTimersByTimeAsync(40_000) - await rejected - } - } finally { - vi.useRealTimers() - } - } - ) }) diff --git a/src/main/runtime/terminal/wait/active-worktree-context-fallback.ts b/src/main/runtime/terminal/wait/active-worktree-context-fallback.ts index 97d3f9de86f..ca22e7addce 100644 --- a/src/main/runtime/terminal/wait/active-worktree-context-fallback.ts +++ b/src/main/runtime/terminal/wait/active-worktree-context-fallback.ts @@ -6,10 +6,13 @@ import { } from '../../../../shared/execution-host' import { getActiveSidebarWorkspaceId, parseWorkspaceKey } from '../../../../shared/workspace-scope' import { splitWorktreeIdForFilesystem } from '../../../../shared/worktree/id' +import { worktreeMetaIdentityKey } from '../../../../shared/worktree/identity' -type WorktreeMetaLabel = { displayName?: string } +type WorktreeMetaLabel = { displayName?: string; instanceId?: string; hostId?: ExecutionHostId } export type ActiveWorkspaceContext = { worktreeId: string + /** Host-qualified identity key; absent for folders and rows known only from storage. */ + identityKey?: string path: string branch: string displayName: string @@ -143,8 +146,11 @@ export function resolveStoredWorkspaceContext( if ((!meta && !repo) || !rowHostId || rowHostId === LOCAL_EXECUTION_HOST_ID) { return null } + // Host-qualified: a same-id row of another host never lends this workspace its identity. + const identityKey = worktreeMetaIdentityKey(id, store?.getWorktreeMetaForHost?.(id, rowHostId)) return { worktreeId: id, + ...(identityKey ? { identityKey } : {}), path: parsed.worktreePath, branch: '', displayName: nonEmpty(meta?.displayName, repo?.displayName, parsed.worktreePath) diff --git a/src/main/runtime/terminal/wait/terminal-interactive-wait-visibility.test.ts b/src/main/runtime/terminal/wait/terminal-interactive-wait-visibility.test.ts index bfabf727b5e..f69937580d1 100644 --- a/src/main/runtime/terminal/wait/terminal-interactive-wait-visibility.test.ts +++ b/src/main/runtime/terminal/wait/terminal-interactive-wait-visibility.test.ts @@ -12,7 +12,7 @@ import { TRANSCRIPT_PANE_PTY_ID as PTY_ID, waitForTranscriptIdle } from '../../orca-runtime-tests/agent-transcript-pane-test-harness' -import { assertTerminalAgentSendable } from '../../rpc/terminal-agent-send-guard' +import { assertTerminalAgentSendable } from '../../rpc/terminal/terminal-agent-send-guard' import { readRuntimeFixture } from './agent-transcript-replay-test-harness' vi.mock('electron', () => ({ @@ -194,36 +194,6 @@ describe('Interactive wait visibility and terminal admission', () => { await expect(runtime.getTerminalInteractiveWait(handle)).resolves.toBeUndefined() }) - it('does not accrue a probe per poll while the foreground probe wedges', async () => { - // Timeout abandons the wait, not the request; single-flight prevents one stranded remote probe per poll. - let probes = 0 - const { runtime, handle } = await createPane({ - paneTitle: '✻ Claude Code', - foregroundProcess: 'claude', - data: agentStatusOsc('waiting'), - onForegroundProbe: () => { - probes += 1 - }, - foregroundProbeHangs: true - }) - - vi.useFakeTimers({ toFake: ['Date', 'setTimeout', 'clearTimeout'] }) - try { - const probing = Promise.all([ - runtime.getTerminalInteractiveWait(handle), - runtime.getTerminalInteractiveWait(handle), - runtime.getTerminalInteractiveWait(handle) - ]) - void probing.catch(() => undefined) - await vi.advanceTimersByTimeAsync(TERMINAL_INTERACTIVE_WAIT_PROBE_TIMEOUT_MS) - await probing - - expect(probes).toBe(1) - } finally { - vi.useRealTimers() - } - }, 20_000) - it('leaves the wait unevaluated when the foreground probe wedges', async () => { // Bound remote PTY probes; a wedged host must leave wait unknown without stalling showTerminal. const { runtime, handle } = await createPane({ diff --git a/src/main/runtime/terminal/wait/terminal-interactive-wait.ts b/src/main/runtime/terminal/wait/terminal-interactive-wait.ts index 27773d46dfa..d123518d53e 100644 --- a/src/main/runtime/terminal/wait/terminal-interactive-wait.ts +++ b/src/main/runtime/terminal/wait/terminal-interactive-wait.ts @@ -171,6 +171,7 @@ export abstract class OrcaRuntimeWithGetTerminalInteractiveWait extends OrcaRunt const resolved = await this.resolveWorkspaceSelector(`id:${worktreeId}`, scope) return { worktreeId: resolved.id, + ...(resolved.identity ? { identityKey: resolved.identity.key } : {}), path: resolved.git.path, branch: resolved.git.branch, displayName: resolved.displayName diff --git a/src/main/runtime/terminal/wait/tui-idle-agent-fixture.mjs b/src/main/runtime/terminal/wait/tui-idle-agent-fixture.mjs deleted file mode 100644 index 9b923de8b64..00000000000 --- a/src/main/runtime/terminal/wait/tui-idle-agent-fixture.mjs +++ /dev/null @@ -1,20 +0,0 @@ -// Real-PTY stand-in streams under a name-only OSC title, then settles according to mode. -const mode = process.argv[2] -const workMs = Number(process.argv[3] ?? 6000) -const osc = (title) => `]0;${title}` - -process.stdout.write(osc('Codex')) -const end = Date.now() + workMs -const streaming = setInterval(() => { - if (Date.now() >= end) { - clearInterval(streaming) - if (mode === 'explicit-idle') { - process.stdout.write(osc('Codex ready')) - } - return - } - process.stdout.write(`analysing chunk ${Date.now()}\n`) -}, 250) - -// Stay alive so the PTY foreground process remains this agent, never the shell. -setInterval(() => {}, 1 << 30) diff --git a/src/main/runtime/terminal/wait/tui-idle-name-only-real-pty.integration.test.ts b/src/main/runtime/terminal/wait/tui-idle-name-only-real-pty.integration.test.ts deleted file mode 100644 index 504b2627eff..00000000000 --- a/src/main/runtime/terminal/wait/tui-idle-name-only-real-pty.integration.test.ts +++ /dev/null @@ -1,131 +0,0 @@ -import { fileURLToPath } from 'node:url' -import * as pty from 'node-pty' -import { describe, it, type TestContext } from 'vitest' -import type { OrcaRuntimeService } from '../../orca-runtime' -import { makeTuiIdleRuntime } from './tui-idle-wait-test-harness' -import type { RuntimeSyncWindowGraph } from '../../../../shared/runtime-session-contracts' -import { TERMINAL_LIFECYCLE_METHODS } from '../../rpc/methods/terminal/terminal-lifecycle-methods' - -// #6011: real bytes, foreground reads and elapsed time prove name-only OSC titles cannot settle a streaming agent immediately. - -const FIXTURE = fileURLToPath(new URL('./tui-idle-agent-fixture.mjs', import.meta.url)) -const WORKTREE_ID = 'repo-1::/tmp/tui-idle-real-pty' -const TAB_ID = '55555555-5555-4555-8555-555555555555' -const LEAF_ID = '66666666-6666-4666-8666-666666666666' -const PTY_ID = 'pty-tui-idle-real' - -const waitMethod = TERMINAL_LIFECYCLE_METHODS.find((method) => method.name === 'terminal.wait')! - -async function startRealAgentPane( - context: TestContext, - mode: 'explicit-idle' | 'quiet', - workMs: number -) { - const child = pty.spawn(process.execPath, [FIXTURE, mode, String(workMs)], { - name: 'xterm-256color', - cols: 120, - rows: 30, - cwd: '/tmp' - }) - context.onTestFinished(() => { - try { - child.kill() - } catch { - // The fixture may already be gone. - } - }) - - // Real foreground read against the real pty, so corroboration is host-produced here too. - const runtime = makeTuiIdleRuntime({ - repoPath: '/tmp/tui-idle-real-pty', - getForegroundProcess: async () => child.process || null - }) - runtime.attachWindow(1) - const graph: RuntimeSyncWindowGraph = { - tabs: [ - { - tabId: TAB_ID, - worktreeId: WORKTREE_ID, - title: 'Agent', - activeLeafId: LEAF_ID, - layout: null - } - ], - leaves: [ - { - tabId: TAB_ID, - worktreeId: WORKTREE_ID, - leafId: LEAF_ID, - paneRuntimeId: 1, - ptyId: PTY_ID, - paneTitle: null, - title: '' - } - ] - } - runtime.syncWindowGraph(1, graph) - - const transcript: string[] = [] - child.onData((data) => { - transcript.push(data) - runtime.onPtyData(PTY_ID, data, Date.now()) - }) - - const { terminals } = await runtime.listTerminals(`id:${WORKTREE_ID}`) - return { runtime, transcript, handle: terminals[0].handle } -} - -/** Exactly what `orca terminal wait --terminal --for tui-idle` reaches over RPC. */ -async function terminalWait( - runtime: OrcaRuntimeService, - terminal: string, - timeoutMs: number -): Promise<{ satisfied: boolean; elapsedMs: number }> { - const startedAt = Date.now() - try { - const result = await waitMethod.handler({ terminal, for: 'tui-idle', timeoutMs }, { runtime }) - return { satisfied: result.wait.satisfied === true, elapsedMs: Date.now() - startedAt } - } catch (error) { - // Why only `timeout`: an unsatisfied wait is the outcome under test, but any other - // failure means the harness broke and must not read as a passing refusal. - if ((error instanceof Error ? error.message : String(error)) !== 'timeout') { - throw error - } - return { satisfied: false, elapsedMs: Date.now() - startedAt } - } -} - -// Each case owns its PTY and runtime; overlap the real idle observation windows. -describe.skipIf(process.platform === 'win32')('tui-idle against a real agent pty', () => { - it.concurrent('does not satisfy while the real process streams under a name-only title', async (context) => { - const { expect } = context - const { runtime, transcript, handle } = await startRealAgentPane(context, 'quiet', 60_000) - // Wait for real control bytes before measuring idle behavior. - await expect.poll(() => transcript.join(''), { timeout: 5_000 }).toContain(']0;Codex') - - const outcome = await terminalWait(runtime, handle, 8_000) - expect(outcome.satisfied).toBe(false) - expect(outcome.elapsedMs).toBeGreaterThanOrEqual(7_500) - }, 25_000) - - it.concurrent('satisfies once the real process emits an explicit idle title', async (context) => { - const { expect } = context - const { runtime, handle } = await startRealAgentPane(context, 'explicit-idle', 3_000) - await new Promise((resolve) => setTimeout(resolve, 500)) - - const outcome = await terminalWait(runtime, handle, 20_000) - expect(outcome.satisfied).toBe(true) - expect(outcome.elapsedMs).toBeGreaterThanOrEqual(1_500) - }, 28_000) - - it.concurrent('satisfies once the real process goes quiet with the agent still in foreground', async (context) => { - const { expect } = context - const { runtime, handle } = await startRealAgentPane(context, 'quiet', 3_000) - await new Promise((resolve) => setTimeout(resolve, 500)) - - const outcome = await terminalWait(runtime, handle, 20_000) - expect(outcome.satisfied).toBe(true) - // Corroboration is never instant: quiescence must elapse after the last byte. - expect(outcome.elapsedMs).toBeGreaterThanOrEqual(3_000) - }, 28_000) -}) diff --git a/src/main/runtime/workspaces/catalog/repo-worktree-resolution-scan.ts b/src/main/runtime/workspaces/catalog/repo-worktree-resolution-scan.ts index 05a118f2ebf..d95c14c18fb 100644 --- a/src/main/runtime/workspaces/catalog/repo-worktree-resolution-scan.ts +++ b/src/main/runtime/workspaces/catalog/repo-worktree-resolution-scan.ts @@ -1,20 +1,24 @@ import type { GitWorktreeInfo } from '../../../../shared/worktree/types' -import { listWorktreesStrict } from '../../../git/worktrees/catalog/worktree-listing' +import { listWorktreesSharedStrictAllowingTrueEmpty } from '../../../git/worktrees/catalog/worktree-scan-cache' import type { LocalProjectWorktreeGitOptions } from '../../../workspaces/execution-host/project-runtime-git-options' export type RuntimeWorktreeScanResult = | { ok: true; worktrees: GitWorktreeInfo[] } - | { ok: false; worktrees: GitWorktreeInfo[] } + | { ok: false; worktrees: GitWorktreeInfo[]; trueEmpty?: boolean } +/** Runtime readers never treat an empty catalog as success; `trueEmpty` tells the shared owner it was confirmed. */ export async function scanLocalRepoWorktreesForResolution( repoPath: string, options: LocalProjectWorktreeGitOptions ): Promise { try { + // Equivalent requests from other registrations of this path join one Git process. const worktrees = options.wslDistro - ? await listWorktreesStrict(repoPath, options) - : await listWorktreesStrict(repoPath) - return { ok: true, worktrees } + ? await listWorktreesSharedStrictAllowingTrueEmpty(repoPath, options) + : await listWorktreesSharedStrictAllowingTrueEmpty(repoPath) + return worktrees.length > 0 + ? { ok: true, worktrees } + : { ok: false, worktrees: [], trueEmpty: true } } catch { return { ok: false, worktrees: [] } } diff --git a/src/main/runtime/workspaces/catalog/repo-worktree-row-resolution.ts b/src/main/runtime/workspaces/catalog/repo-worktree-row-resolution.ts index 31e8e38c0b5..d959f401f3b 100644 --- a/src/main/runtime/workspaces/catalog/repo-worktree-row-resolution.ts +++ b/src/main/runtime/workspaces/catalog/repo-worktree-row-resolution.ts @@ -74,6 +74,8 @@ export type RepoWorktreeRowDeps = { projectRuntimeByRepoId: ReadonlyMap ) => Promise getCachedSuccessfulScan?: (repo: Repo) => RuntimeWorktreeScanResult | undefined + /** Once per new observation, with its scan-start generation; absent keeps per-read pruning. */ + claimLineagePrune?: (scan: RuntimeWorktreeScanResult) => { scanGeneration: number } | null /** Folder workspaces are stamped from runtime-owned identity helpers, so the caller supplies them. */ listFolderWorkspaces: (repo: Repo, repoOwnerCount: number) => Worktree[] } @@ -121,7 +123,7 @@ export type RepoWorktreeRowsScan = { /** The scan half of `resolveRepoWorktreeRows`: slow, and the only part that awaits. */ export async function scanRepoWorktreeRows( - deps: Pick, + deps: Omit, repo: Repo, projectRuntimeByRepoId: ReadonlyMap, repoOwnerCount = deps.store.getRepos().filter((candidate) => candidate.id === repo.id).length @@ -146,8 +148,11 @@ export async function scanRepoWorktreeRows( listStoredWorktreeRowsForRepo(store, repo, repoOwnerCount) } const gitWorktrees = preserveFolderUpgradeWorktreePath(repo, scan.worktrees) - if (scan.ok) { - pruneLineageForMissingRepoWorktrees(store, repo, gitWorktrees, { scanGeneration }) + // Cached reads must not re-prune against a generation captured after their rows were observed. + const lineage = + scan.ok && (deps.claimLineagePrune ? deps.claimLineagePrune(scan) : { scanGeneration }) + if (lineage) { + pruneLineageForMissingRepoWorktrees(store, repo, gitWorktrees, lineage) } return { ok: scan.ok, worktrees: gitWorktrees, removals, projectedRemovals: removals } } @@ -200,9 +205,7 @@ export function projectRepoWorktreeRows( branch: gitWorktree.branch, isBare: gitWorktree.isBare, isMainWorktree: gitWorktree.isMainWorktree - }, - displayName: merged.displayName, - comment: merged.comment + } } }) if (expectedHostId !== LOCAL_EXECUTION_HOST_ID || !scan) { diff --git a/src/main/runtime/workspaces/catalog/resolved-worktree-scan-join.ts b/src/main/runtime/workspaces/catalog/resolved-worktree-scan-join.ts index a9b2f8aed0c..d2a63b435dd 100644 --- a/src/main/runtime/workspaces/catalog/resolved-worktree-scan-join.ts +++ b/src/main/runtime/workspaces/catalog/resolved-worktree-scan-join.ts @@ -60,7 +60,7 @@ export function platformsByRepoId( export async function scanResolvedWorktreeRepos( store: RuntimeStore | null, rowDeps: () => RepoWorktreeRowDeps, - scanCacheEntry: (scanScopeKey: string) => object | undefined + scanCacheEntry: (repo: Repo) => object | undefined ): Promise { const scans: ResolvedWorktreeRepoScans = new Map() if (!store) { @@ -79,8 +79,8 @@ export async function scanResolvedWorktreeRepos( projectRuntimeByRepoId, repoOwners.rowsFor(repo.id).length ) - // The key listRepoWorktreesForResolution caches under. - const gitRun = scanCacheEntry(`${repo.id}\0${getRepoExecutionHostId(repo)}`) ?? null + // The owner observation the scan answered from; verification never mints a new one. + const gitRun = scanCacheEntry(repo) ?? null scans.set(resolvedWorktreeRepoScanKey(repo), { ...scan, gitRun }) }) ) diff --git a/src/main/runtime/workspaces/catalog/runtime-managed-worktree-queries.test.ts b/src/main/runtime/workspaces/catalog/runtime-managed-worktree-queries.test.ts index 464deed5b46..9fb41be5d5c 100644 --- a/src/main/runtime/workspaces/catalog/runtime-managed-worktree-queries.test.ts +++ b/src/main/runtime/workspaces/catalog/runtime-managed-worktree-queries.test.ts @@ -35,6 +35,12 @@ vi.mock( ) import { RuntimeManagedWorktreeQueries } from './runtime-managed-worktree-queries' +import { runtimeResultForObservation } from './runtime-worktree-catalog-read' +import { + _resetWorktreeCatalogOwnerForTests, + readWorktreeCatalog +} from '../../../workspaces/catalog/repo-worktree-catalog-owner' +import { setWorktreeCatalogRouteResolver } from '../../../workspaces/catalog/repo-worktree-catalog-route' import type { RuntimeStore } from '../../construction/runtime-store-contract' import { bumpLocalWorktreeScanGeneration, @@ -324,4 +330,56 @@ describe('RuntimeManagedWorktreeQueries.listDetected overtaken scan', () => { expect(pruneLineageMock).not.toHaveBeenCalled() expect(pruneMetadataMock).not.toHaveBeenCalled() }) + + it('never publishes owner rows as authoritative once the owner retired their route', async () => { + let live = true + setWorktreeCatalogRouteResolver(() => + live ? { repoPath: repo.path, runtimeKey: 'local:default' } : null + ) + try { + const { observation } = await readWorktreeCatalog( + repo, + 'local:default', + { kind: 'runtime', maxAgeMs: 30_000 }, + { + scan: async () => ({ kind: 'rows', worktrees: rows([repo.path]) }), + // The observation carries the pre-scan hygiene claim a pruning listing consumes. + captureWitness: () => + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the mocked prune reads only the expectation's presence. + ({ + authorizedRootsRevision: 0, + rootsRevision: 0, + hygieneDue: true, + expectation: { repo, metadata: [] }, + release: () => {} + }) as never + } + ) + const ownerRows = runtimeResultForObservation(observation!) + const scanRepo = vi.fn(async () => ownerRows) + // The route changes while the listing awaits its own metadata prune, after admission. + let helperSawCurrent: boolean | undefined + pruneMetadataMock.mockImplementationOnce(async (args: { isCallerCurrent: () => boolean }) => { + live = false + helperSawCurrent = args.isCallerCurrent() + return { scanGenerationCurrent: true, preservedMetadataCandidateIds: new Set() } + }) + const store = gitStore({ + pruneSessionlessMissingLocalWorktreeMetadataForRepo: vi.fn(() => []), + getProfileStorageDirectory: () => '/profile', + captureNativeLocalWorktreeMetadataScanExpectation: vi.fn(() => ({ repo, metadata: [] })) + }) + + const result = await queries(store, { scanRepo }).listDetected(repo) + + expect(pruneMetadataMock).toHaveBeenCalledTimes(1) + expect(helperSawCurrent).toBe(false) + expect(result).toMatchObject({ authoritative: false, source: 'git' }) + expect(result.worktrees.map((worktree) => worktree.path)).toEqual([repo.path]) + expect(pruneLineageMock).not.toHaveBeenCalled() + } finally { + setWorktreeCatalogRouteResolver(null) + _resetWorktreeCatalogOwnerForTests() + } + }) }) diff --git a/src/main/runtime/workspaces/catalog/runtime-managed-worktree-queries.ts b/src/main/runtime/workspaces/catalog/runtime-managed-worktree-queries.ts index ed08471a010..03babd2d039 100644 --- a/src/main/runtime/workspaces/catalog/runtime-managed-worktree-queries.ts +++ b/src/main/runtime/workspaces/catalog/runtime-managed-worktree-queries.ts @@ -158,11 +158,9 @@ export class RuntimeManagedWorktreeQueries { worktrees: projectWorktreeLineageWithHostPeers(store, repo, detected) } } - const scan = await scanRuntimeWorktreesUntilNotOvertaken(store, repo, (target) => - this.deps.scanRepo(target) - ) + const scan = await scanRuntimeWorktreesUntilNotOvertaken(store, repo, this.deps.scanRepo) // Publish overtaken scans as non-authoritative: throwing would drop client rows. Prune nothing; the overtaking mutation's event requests a fresh listing. - if (scan.ok && !scan.superseded) { + if (scan.ok && !scan.superseded && scan.authorityCurrent()) { // Headless hosts lack ipcMain listings; runtime must sweep its own metadata too (#17776). if (scan.metadataPruneExpectation && canPruneAuthoritativeLocalMetadata(store)) { await pruneMetadataMissingFromAuthoritativeLocalScan({ @@ -170,12 +168,13 @@ export class RuntimeManagedWorktreeQueries { repo, gitWorktrees: scan.worktrees, scan: scan.metadataPruneExpectation, - scanGeneration: scan.scanGeneration + scanGeneration: scan.scanGeneration, + isCallerCurrent: scan.authorityCurrent }) } - pruneLineageForMissingRepoWorktrees(store, repo, scan.worktrees, { - scanGeneration: scan.scanGeneration - }) + if (scan.lineagePrune && scan.authorityCurrent()) { + pruneLineageForMissingRepoWorktrees(store, repo, scan.worktrees, scan.lineagePrune) + } } const matcher = createWorktreeVisibilitySourceMatcher( [repo.path, ...scan.worktrees.map((worktree) => worktree.path)], @@ -204,7 +203,7 @@ export class RuntimeManagedWorktreeQueries { }) return { repoId: repo.id, - authoritative: scan.ok && !scan.superseded, + authoritative: scan.ok && !scan.superseded && scan.authorityCurrent(), source: scan.ok ? 'git' : 'metadata-fallback', workspaceMetadata: listed.workspaceMetadata, // Stamp the scan's starting generation: that is the catalog its rows describe. diff --git a/src/main/runtime/workspaces/catalog/runtime-witnessed-worktree-scan.ts b/src/main/runtime/workspaces/catalog/runtime-witnessed-worktree-scan.ts index 13937823bba..f1a50b87f83 100644 --- a/src/main/runtime/workspaces/catalog/runtime-witnessed-worktree-scan.ts +++ b/src/main/runtime/workspaces/catalog/runtime-witnessed-worktree-scan.ts @@ -9,12 +9,22 @@ import { getLocalProjectWorktreeGitOptions } from '../../../workspaces/execution import type { Store } from '../../../persistence/loading-store/store' import type { RuntimeStore } from '../../construction/runtime-store-contract' import type { RuntimeWorktreeScanResult } from './repo-worktree-resolution-scan' +import { + claimRuntimeLineagePrune, + observationForRuntimeResult +} from './runtime-worktree-catalog-read' +import { isCurrentWorktreeCatalogObservation } from '../../../workspaces/catalog/repo-worktree-catalog-owner' +import { claimWorktreeCatalogHygiene } from '../../../ipc/worktrees/listing/worktree-catalog-observation-hygiene' export type WitnessedRuntimeWorktreeScan = RuntimeWorktreeScanResult & { /** A concurrent worktree change made these scan rows stale. */ superseded: boolean scanGeneration: number metadataPruneExpectation: NativeLocalWorktreeMetadataScanExpectation | undefined + /** Lineage prunes once per observation; null when another read of these rows already did. */ + lineagePrune: { scanGeneration: number } | null + /** Owner authority for these rows, rechecked after awaits before destructive work. */ + authorityCurrent: () => boolean } /** Refuse destructive pruning on unresolved routes or WSL, whose Linux paths v1 cannot equate with stored UNC aliases. */ @@ -42,20 +52,42 @@ async function scanRuntimeWorktreesWithMutationWitness( scanRepo: (repo: Repo) => Promise ): Promise { // Capture before listing can mutate metadata synchronously; pruning revalidates the original rows. - const scanGeneration = getLocalWorktreeScanGeneration(repo.id) - const metadataPruneExpectation = captureLocalMetadataPruneExpectation(store, repo) + let scanGeneration = getLocalWorktreeScanGeneration(repo.id) + let metadataPruneExpectation: NativeLocalWorktreeMetadataScanExpectation | undefined + let lineagePrune: { scanGeneration: number } | null = null + let authorityCurrent = (): boolean => true let scan: RuntimeWorktreeScanResult try { scan = await scanRepo(repo) } catch { scan = { ok: false, worktrees: [] } } + const observation = observationForRuntimeResult(scan) + if (observation) { + // Shared observations carry their own pre-scan witness; older rows never get today's expectations. + scanGeneration = observation.generation + authorityCurrent = () => isCurrentWorktreeCatalogObservation(observation) + const claim = + isLocalWorktreeScanGenerationCurrent(repo.id, scanGeneration) && authorityCurrent() + ? claimWorktreeCatalogHygiene(observation) + : null + metadataPruneExpectation = claim?.expectation + lineagePrune = claimRuntimeLineagePrune(scan) + } else { + // Only injected scanners land here: production `ok` rows always carry an owner observation. + metadataPruneExpectation = captureLocalMetadataPruneExpectation(store, repo) + lineagePrune = { scanGeneration } + } return { ...scan, // Failed scans are already non-authoritative. - superseded: scan.ok && !isLocalWorktreeScanGenerationCurrent(repo.id, scanGeneration), + superseded: + scan.ok && + (!isLocalWorktreeScanGenerationCurrent(repo.id, scanGeneration) || !authorityCurrent()), scanGeneration, - metadataPruneExpectation + metadataPruneExpectation, + lineagePrune, + authorityCurrent } } diff --git a/src/main/runtime/workspaces/catalog/runtime-workspace-catalog-events.ts b/src/main/runtime/workspaces/catalog/runtime-workspace-catalog-events.ts index c32fb362212..0a5849ce694 100644 --- a/src/main/runtime/workspaces/catalog/runtime-workspace-catalog-events.ts +++ b/src/main/runtime/workspaces/catalog/runtime-workspace-catalog-events.ts @@ -1,11 +1,8 @@ -import { - getRepoExecutionHostId, - getRepoRoutingConnectionId -} from '../../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' import type { Repo } from '../../../../shared/repo-types' import { normalizeRuntimePathForComparison } from '../../../../shared/cross-platform-path' import { composeWorktreeId } from '../../../../shared/worktree/id' -import type { PullRequestChange } from '../../../github/pull-request-changed-events' +import type { PullRequestChange } from '../../../github/pull-requests/refresh/pull-request-changed-events' import { OrcaRuntimeWithGetStatus } from '../../hosts/runtime-status' export abstract class RuntimeWorkspaceCatalogEvents extends OrcaRuntimeWithGetStatus { @@ -13,6 +10,10 @@ export abstract class RuntimeWorkspaceCatalogEvents extends OrcaRuntimeWithGetSt abstract invalidateWorktreeScanCacheForRepo(repoId: string): void + protected abstract peekRepoWorktreeListing( + repo: Repo + ): { worktrees: { path: string }[] } | undefined + // Renderer meta writes skip its notifier after optimistic updates; remote clients still need invalidation. notifyWorktreesChangedForRemoteClients(repoId: string): void { this.invalidateResolvedWorktreeCache() @@ -56,9 +57,8 @@ export abstract class RuntimeWorkspaceCatalogEvents extends OrcaRuntimeWithGetSt // Ids spelled as clients listed them; an unlisted path may be another spelling of any checkout, so name none. private listedWorktreeIds(repo: Repo, paths: readonly string[]): string[] | null { - const scan = this.worktreeScanCache.get(`${repo.id}\0${getRepoExecutionHostId(repo)}`) const listed = new Map( - (scan?.listing ?? scan?.result)?.worktrees.map((worktree) => [ + this.peekRepoWorktreeListing(repo)?.worktrees.map((worktree) => [ normalizeRuntimePathForComparison(worktree.path), worktree.path ]) diff --git a/src/main/runtime/workspaces/catalog/runtime-worktree-catalog-read.ts b/src/main/runtime/workspaces/catalog/runtime-worktree-catalog-read.ts new file mode 100644 index 00000000000..3942889786b --- /dev/null +++ b/src/main/runtime/workspaces/catalog/runtime-worktree-catalog-read.ts @@ -0,0 +1,66 @@ +import type { WorktreeCatalogObservation } from '../../../workspaces/catalog/repo-worktree-catalog-observation' +import type { RuntimeWorktreeScanResult } from './repo-worktree-resolution-scan' +import { dropRepeatedWorktreeRows } from './repeated-worktree-rows' +import { isCurrentWorktreeCatalogObservation } from '../../../workspaces/catalog/repo-worktree-catalog-owner' + +const resultByObservation = new WeakMap() +const observationByResult = new WeakMap() +const listingByResult = new WeakMap() +const lineagePrunedObservations = new WeakSet() + +/** One stable runtime result per owner observation, so listing projections and git-run identity follow it. */ +export function runtimeResultForObservation( + observation: WorktreeCatalogObservation +): RuntimeWorktreeScanResult { + const known = resultByObservation.get(observation) + if (known) { + return known + } + // Runtime never reports a confirmed-empty scan as success; strict failures and true-empty both read `ok:false`. + const result = + observation.outcome.kind === 'rows' + ? dropRepeatedWorktreeRows({ ok: true, worktrees: observation.outcome.worktrees }) + : { ok: false, worktrees: [] } + resultByObservation.set(observation, result) + observationByResult.set(result, observation) + return result +} + +export function rememberRuntimeWorktreeListing( + result: RuntimeWorktreeScanResult, + listing: RuntimeWorktreeScanResult +): void { + const observation = observationByResult.get(result) + if (observation) { + listingByResult.set(result, listing) + observationByResult.set(listing, observation) + } +} + +export function runtimeWorktreeListingFor( + result: RuntimeWorktreeScanResult +): RuntimeWorktreeScanResult | undefined { + return listingByResult.get(result) +} + +export function observationForRuntimeResult( + result: RuntimeWorktreeScanResult +): WorktreeCatalogObservation | undefined { + return observationByResult.get(result) +} + +/** Lineage pruning runs once per new observation, with the generation its scan started under. */ +export function claimRuntimeLineagePrune( + result: RuntimeWorktreeScanResult +): { scanGeneration: number } | null { + const observation = observationByResult.get(result) + if ( + !observation || + lineagePrunedObservations.has(observation) || + !isCurrentWorktreeCatalogObservation(observation) + ) { + return null + } + lineagePrunedObservations.add(observation) + return { scanGeneration: observation.generation } +} diff --git a/src/main/runtime/workspaces/catalog/runtime-worktree-scan-state.ts b/src/main/runtime/workspaces/catalog/runtime-worktree-scan-state.ts deleted file mode 100644 index 10b74e296de..00000000000 --- a/src/main/runtime/workspaces/catalog/runtime-worktree-scan-state.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { RuntimeWorktreeScanResult } from './repo-worktree-resolution-scan' - -export type RuntimeWorktreeScanCache = { - generation: number - runtimeKey: string - result: RuntimeWorktreeScanResult - listing?: RuntimeWorktreeScanResult - expiresAt: number - adminFingerprint: string | null - scannedAt: number -} - -export type RuntimeWorktreeScanInFlight = { - generation: number - runtimeKey: string - promise: Promise -} - -export type RuntimeWorktreeScanRefresh = { - result: RuntimeWorktreeScanResult - adminFingerprint: string | null - adminFingerprintProbe: Promise | null - scannedAt: number -} diff --git a/src/main/runtime/workspaces/catalog/workspace-catalog.ts b/src/main/runtime/workspaces/catalog/workspace-catalog.ts index b48f767182e..3e81bcfb1a6 100644 --- a/src/main/runtime/workspaces/catalog/workspace-catalog.ts +++ b/src/main/runtime/workspaces/catalog/workspace-catalog.ts @@ -33,14 +33,26 @@ import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../sha import { withUnregisteredRemovalCheckouts } from '../../../workspaces/removal/worktree-removal-listing' import { withoutInFlightWorktreeCreates } from '../../../workspaces/creation/worktree-create-in-flight' import { preserveFolderUpgradeWorktreePath } from '../../../workspaces/catalog/folder-upgrade-worktree-path' -import type { RuntimeWorktreeScanCache } from './runtime-worktree-scan-state' +import type { GitWorktreeInfo } from '../../../../shared/worktree/types' +import { + peekWorktreeCatalog, + retireObsoleteWorktreeCatalogs +} from '../../../workspaces/catalog/repo-worktree-catalog-owner' +import { + claimRuntimeLineagePrune, + rememberRuntimeWorktreeListing, + runtimeResultForObservation, + runtimeWorktreeListingFor +} from './runtime-worktree-catalog-read' import * as ScanCache from './runtime-worktree-scan-cache' const RESOLVED_WORKTREE_CACHE_TTL_MS = 1000 export abstract class RuntimeWorkspaceCatalog extends OrcaRuntimeWithReadKittyFile { - protected abstract refreshRepoWorktreeScan( - ...args: Parameters - ): ReturnType + protected abstract readRepoWorktreeCatalog( + ...args: Parameters + ): ReturnType + + protected abstract listStoredWorktreesForResolution(repo: Repo): GitWorktreeInfo[] protected listKnownResolvedWorktreesForExplicitTarget( targetWorktreeId: string, @@ -130,26 +142,31 @@ export abstract class RuntimeWorkspaceCatalog extends OrcaRuntimeWithReadKittyFi } protected scanResolvedWorktreeRepos(): Promise { - return scanResolvedWorktreeRepos(this.store, this.repoWorktreeRowDeps.bind(this), (key) => - this.worktreeScanCache.get(key) + return scanResolvedWorktreeRepos( + this.store, + this.repoWorktreeRowDeps.bind(this), + (repo) => this.peekRepoWorktreeObservation(repo)?.observation ) } protected pruneUnregisteredWorktreeScans(): void { - const registered = new Set( - (this.store?.getRepos() ?? []).map((repo) => `${repo.id}\0${getRepoExecutionHostId(repo)}`) - ) - for (const cache of [ - this.worktreeScanCache, - this.worktreeScanGenerations, - this.worktreeScanInFlight - ]) { - for (const key of cache.keys()) { - if (!registered.has(key)) { - cache.delete(key) - } - } + retireObsoleteWorktreeCatalogs() + } + + private peekRepoWorktreeObservation(repo: Repo) { + return this.store + ? peekWorktreeCatalog(repo, ScanCache.resolveWorktreeScanRuntime(this.store, repo).runtimeKey) + : null + } + + /** The listing a client last saw for this repo, current or not, for path spelling. */ + protected peekRepoWorktreeListing(repo: Repo): RuntimeWorktreeScanResult | undefined { + const known = this.peekRepoWorktreeObservation(repo) + if (!known) { + return undefined } + const result = runtimeResultForObservation(known.observation) + return runtimeWorktreeListingFor(result) ?? result } /** The fleet listing from cached scans and the store as it is now, synchronously. */ @@ -172,17 +189,13 @@ export abstract class RuntimeWorkspaceCatalog extends OrcaRuntimeWithReadKittyFi scanRepo: (repo, projectRuntimeByRepoId) => this.listRepoWorktreesForListing(repo, projectRuntimeByRepoId), getCachedSuccessfulScan: (repo) => { - const key = `${repo.id}\0${getRepoExecutionHostId(repo)}` - const cached = this.worktreeScanCache.get(key) - if ( - cached?.generation === (this.worktreeScanGenerations.get(key) ?? 0) && - cached.runtimeKey === ScanCache.resolveWorktreeScanRuntime(store, repo).runtimeKey && - cached.listing?.ok - ) { - return cached.listing - } - return undefined + const known = this.peekRepoWorktreeObservation(repo) + const listing = known?.current + ? runtimeWorktreeListingFor(runtimeResultForObservation(known.observation)) + : undefined + return listing?.ok ? listing : undefined }, + claimLineagePrune: claimRuntimeLineagePrune, listFolderWorkspaces: (repo, repoOwnerCount) => listRuntimeFolderWorkspaces(store, repo, repoOwnerCount) } @@ -201,9 +214,10 @@ export abstract class RuntimeWorkspaceCatalog extends OrcaRuntimeWithReadKittyFi /** The resolution scan plus the checkouts this host's removals own that Git no longer lists. */ protected async listRepoWorktreesForListing( repo: Repo, - projectRuntimeByRepoId?: ReadonlyMap + projectRuntimeByRepoId?: ReadonlyMap, + options: { claimsHygiene?: boolean } = {} ): Promise { - const cached = await this.listRepoWorktreesForResolution(repo, projectRuntimeByRepoId) + const cached = await this.listRepoWorktreesForResolution(repo, projectRuntimeByRepoId, options) // Paired detectedList must retain folder-upgrade locators or folder ids lose metadata and terminals (#30150). const scan = { ...cached, worktrees: preserveFolderUpgradeWorktreePath(repo, cached.worktrees) } const listing = @@ -216,81 +230,30 @@ export abstract class RuntimeWorkspaceCatalog extends OrcaRuntimeWithReadKittyFi ) } : scan - const cachedEntry = this.worktreeScanCache.get(`${repo.id}\0${getRepoExecutionHostId(repo)}`) - if (cachedEntry?.result === cached) { - cachedEntry.listing = listing - } + rememberRuntimeWorktreeListing(cached, listing) return listing } protected async listRepoWorktreesForResolution( repo: Repo, - projectRuntimeByRepoId?: ReadonlyMap + projectRuntimeByRepoId?: ReadonlyMap, + options: { claimsHygiene?: boolean } = {} ): Promise { const { projectRuntime, runtimeKey, sshConnectionId } = ScanCache.resolveWorktreeScanRuntime( this.requireStore(), repo, projectRuntimeByRepoId ) - const now = Date.now() - const scanScopeKey = `${repo.id}\0${getRepoExecutionHostId(repo)}` - const retryCurrent = (): Promise => { - const current = this.store - ?.getRepos() - .find( - (candidate) => - candidate.id === repo.id && - getRepoExecutionHostId(candidate) === getRepoExecutionHostId(repo) - ) - return current - ? this.listRepoWorktreesForResolution(current) - : Promise.resolve({ ok: false, worktrees: [] }) + // Why: this process serves no SSH git, so an SSH repo answers from its stored rows. + if (sshConnectionId) { + return { ok: false, worktrees: this.listStoredWorktreesForResolution(repo) } } - const generation = this.worktreeScanGenerations.get(scanScopeKey) ?? 0 - const cached = this.worktreeScanCache.get(scanScopeKey) - if ( - cached?.generation === generation && - cached.runtimeKey === runtimeKey && - cached.expiresAt > now - ) { - return cached.result - } - const inFlight = this.worktreeScanInFlight.get(scanScopeKey) - if (inFlight?.generation === generation && inFlight.runtimeKey === runtimeKey) { - return (await inFlight.promise).result - } - const reusableCached = - cached?.generation === generation && cached.runtimeKey === runtimeKey ? cached : null - const promise = this.refreshRepoWorktreeScan(repo, projectRuntime, reusableCached) - .then(async (refresh) => { - if (this.worktreeScanInFlight.get(scanScopeKey)?.promise !== promise) { - return { ...refresh, result: await retryCurrent() } - } - if (refresh.result.ok || !sshConnectionId) { - const entry: RuntimeWorktreeScanCache = { - generation, - runtimeKey, - result: refresh.result, - expiresAt: Date.now() + ScanCache.resolveWorktreeScanCacheTtlMs(repo), - adminFingerprint: refresh.adminFingerprint, - scannedAt: refresh.scannedAt - } - this.worktreeScanCache.set(scanScopeKey, entry) - void refresh.adminFingerprintProbe?.then((fingerprint) => { - if (this.worktreeScanCache.get(scanScopeKey) === entry) { - entry.adminFingerprint = fingerprint - } - }) - } - return refresh - }) - .finally(() => { - if (this.worktreeScanInFlight.get(scanScopeKey)?.promise === promise) { - this.worktreeScanInFlight.delete(scanScopeKey) - } - }) - this.worktreeScanInFlight.set(scanScopeKey, { generation, runtimeKey, promise }) - return (await promise).result + return await this.readRepoWorktreeCatalog( + repo, + projectRuntime, + runtimeKey, + options.claimsHygiene === true + ) } listRepos(): Repo[] { diff --git a/src/main/runtime/workspaces/catalog/workspace-repo-scan-refresh.ts b/src/main/runtime/workspaces/catalog/workspace-repo-scan-refresh.ts index aed21d93a36..1890b56971e 100644 --- a/src/main/runtime/workspaces/catalog/workspace-repo-scan-refresh.ts +++ b/src/main/runtime/workspaces/catalog/workspace-repo-scan-refresh.ts @@ -1,29 +1,38 @@ import { RuntimeWorkspaceCatalog } from './workspace-catalog' import type { Repo } from '../../../../shared/repo-types' import type { ProjectExecutionRuntimeResolution } from '../../../../shared/execution-host/project-execution-runtime' -import type { - RuntimeWorktreeScanCache, - RuntimeWorktreeScanRefresh -} from './runtime-worktree-scan-state' -import { resolveWorktreeScanCacheTtlMs } from './runtime-worktree-scan-cache' +import { + resolveWorktreeScanCacheTtlMs, + resolveWorktreeScanRuntime +} from './runtime-worktree-scan-cache' import { WORKTREE_SCAN_ADMIN_FINGERPRINT_TIMEOUT_MS, WORKTREE_SCAN_ADMIN_RECONCILE_INTERVAL_MS } from './worktree-scan-admin-budget' import { getLocalProjectWorktreeGitOptionsForRuntime } from '../../../workspaces/execution-host/project-runtime-git-options' -import { withTimeoutResult } from '../../../../shared/promise-timeout-fallback' import { readRepoWorktreeAdminFingerprint } from './repo-worktree-admin-fingerprint' import type { RuntimeWorktreeScanResult } from './repo-worktree-resolution-scan' import { scanLocalRepoWorktreesForResolution } from './repo-worktree-resolution-scan' -import { dropRepeatedWorktreeRows } from './repeated-worktree-rows' import type { GitWorktreeInfo } from '../../../../shared/worktree/types' import { listStoredWorktreeRowsForRepo } from './repo-worktree-row-resolution' import type { ResolvedWorktree } from './runtime-worktree-path-identity' -import { getRepoExecutionHostId, getRepoSshConnectionId } from '../../../../shared/execution-host' +import { getRepoSshConnectionId } from '../../../../shared/execution-host' import { blockedWslDistroForPath, wslDistroForPath } from '../../../wsl/filesystem/wsl-unc-access-gate' +import { + invalidateWorktreeCatalogForRepo, + peekWorktreeCatalog, + readWorktreeCatalog +} from '../../../workspaces/catalog/repo-worktree-catalog-owner' +import { runtimeResultForObservation } from './runtime-worktree-catalog-read' +import { + needsWorktreeCatalogHygieneClaim, + worktreeCatalogHygienePlan +} from '../../../ipc/worktrees/listing/worktree-catalog-observation-hygiene' +import type { Store } from '../../../persistence/loading-store/store' +import { SUPERSEDED_SCAN_RESCANS } from '../../../ipc/worktrees/listing/overtaken-scan-rerun' const lastFingerprintUnknownWarnAt = new Map() @@ -45,103 +54,81 @@ function warnFingerprintUnknownOnce(repoId: string, reason: string): void { } export abstract class RuntimeWorkspaceRepoScanRefresh extends RuntimeWorkspaceCatalog { - /** Reuse cached scans when a Git-admin fingerprint proves no change. */ - protected async refreshRepoWorktreeScan( + /** Runtime readers accept the owner's observation for the scan TTL, then its admin-fingerprint verifier. */ + protected async readRepoWorktreeCatalog( repo: Repo, projectRuntime: ProjectExecutionRuntimeResolution | undefined, - cached: RuntimeWorktreeScanCache | null - ): Promise { - const scannedAt = Date.now() + runtimeKey: string, + claimsHygiene: boolean + ): Promise { + const gitOptions = getLocalProjectWorktreeGitOptionsForRuntime(repo, projectRuntime) // E9: the admin reads below and the Git scan both boot a stopped distro; keep known rows until it runs. - const wslDistro = getRepoSshConnectionId(repo) - ? undefined - : getLocalProjectWorktreeGitOptionsForRuntime(repo, projectRuntime).wslDistro if ( - !getRepoSshConnectionId(repo) && - wslDistroForPath(repo.path, wslDistro) && - (await blockedWslDistroForPath(repo.path, wslDistro)) + wslDistroForPath(repo.path, gitOptions.wslDistro) && + (await blockedWslDistroForPath(repo.path, gitOptions.wslDistro)) ) { - return cached - ? { - result: cached.result, - adminFingerprint: cached.adminFingerprint, - adminFingerprintProbe: null, - scannedAt: cached.scannedAt - } - : { - result: { ok: false, worktrees: this.listStoredWorktreesForResolution(repo) }, - adminFingerprint: null, - adminFingerprintProbe: null, - scannedAt - } + // Known rows only while nothing has invalidated them; otherwise last stored rows, as non-authoritative. + const known = peekWorktreeCatalog(repo, runtimeKey) + return known?.current + ? runtimeResultForObservation(known.observation) + : { ok: false, worktrees: this.listStoredWorktreesForResolution(repo) } } - // Fingerprint only on-host Git: executionHostId-only SSH and WSL paths cannot be described by local admin reads. - const fingerprintCapable = - !getRepoSshConnectionId(repo) && - // Skip fingerprints when scan TTL already reaches reconciliation; they could never be reused. - resolveWorktreeScanCacheTtlMs(repo) < WORKTREE_SCAN_ADMIN_RECONCILE_INTERVAL_MS && - !getLocalProjectWorktreeGitOptionsForRuntime(repo, projectRuntime).wslDistro - // Probe before scanning so concurrent changes cannot be stamped as already observed. - const probe = fingerprintCapable ? this.startRepoWorktreeAdminFingerprintProbe(repo) : null - const reusable = - cached?.result.ok === true && - scannedAt - cached.scannedAt < WORKTREE_SCAN_ADMIN_RECONCILE_INTERVAL_MS - ? cached - : null - // Unknown probes reuse the cache without resetting scannedAt; rescanning on slow-mount timeouts amplifies load (#19312). - const reuseCached = (): RuntimeWorktreeScanRefresh | null => - reusable - ? { - result: reusable.result, - adminFingerprint: reusable.adminFingerprint, - adminFingerprintProbe: null, - scannedAt: reusable.scannedAt - } - : null - if (probe === 'in-flight') { - const reused = reuseCached() - if (reused) { - warnFingerprintUnknownOnce(repo.id, 'previous probe still pending') - return reused - } - } else if (probe && reusable) { - // Await only for a reusable cache; scan-bound callers cannot use the probe. - const probed = await withTimeoutResult(probe, WORKTREE_SCAN_ADMIN_FINGERPRINT_TIMEOUT_MS) - if (!probed.ok) { - warnFingerprintUnknownOnce(repo.id, 'probe expired') - return ( - reuseCached() ?? - (await this.scanRepoWorktreesForRefresh(repo, projectRuntime, null, scannedAt)) - ) - } - // Only a known matching fingerprint proves no change. - if (probed.value !== null && probed.value === reusable.adminFingerprint) { - return { - result: reusable.result, - adminFingerprint: probed.value, - adminFingerprintProbe: null, - scannedAt: reusable.scannedAt - } - } + // Admission and the owner route must agree: a route replaced while the distro check ran is not read. + const live = this.store + ? resolveWorktreeScanRuntime(this.requireStore(), repo) + : { runtimeKey, projectRuntime } + if ( + live.runtimeKey !== runtimeKey || + getLocalProjectWorktreeGitOptionsForRuntime(repo, live.projectRuntime).wslDistro !== + gitOptions.wslDistro + ) { + return { ok: false, worktrees: this.listStoredWorktreesForResolution(repo) } } - return await this.scanRepoWorktreesForRefresh( + const ttlMs = resolveWorktreeScanCacheTtlMs(repo) + // WSL execution cannot be described by local admin reads; a TTL at the ceiling could never reuse a probe. + const verifier = + ttlMs < WORKTREE_SCAN_ADMIN_RECONCILE_INTERVAL_MS && !gitOptions.wslDistro + ? { + ceilingMs: WORKTREE_SCAN_ADMIN_RECONCILE_INTERVAL_MS, + timeoutMs: WORKTREE_SCAN_ADMIN_FINGERPRINT_TIMEOUT_MS, + probe: () => this.startRepoWorktreeAdminFingerprintProbe(repo), + onUnknown: (reason: string) => warnFingerprintUnknownOnce(repo.id, reason) + } + : undefined + const store = this.store + const { observation, superseded } = await readWorktreeCatalog( repo, - projectRuntime, - probe === 'in-flight' ? null : probe, - scannedAt + runtimeKey, + { + kind: 'runtime', + maxAgeMs: ttlMs, + reusesFailure: true, + // Readers that joined an overtaken scan follow current truth, within the detected listing's bound. + overtakenFlights: SUPERSEDED_SCAN_RESCANS + 1, + ...(verifier ? { verifier } : {}), + ...(claimsHygiene ? { needsHygieneClaim: needsWorktreeCatalogHygieneClaim(repo) } : {}) + }, + { + scan: async () => { + const scan = await scanLocalRepoWorktreesForResolution(repo.path, gitOptions) + if (scan.ok) { + return { kind: 'rows', worktrees: scan.worktrees } + } + return scan.trueEmpty + ? { kind: 'true-empty' } + : { kind: 'failed', error: new Error(`worktree list failed for ${repo.path}`) } + }, + ...(store + ? worktreeCatalogHygienePlan(store as unknown as Store, repo, gitOptions, claimsHygiene) + : {}) + } ) - } - - private async scanRepoWorktreesForRefresh( - repo: Repo, - projectRuntime: ProjectExecutionRuntimeResolution | undefined, - probe: Promise | null, - scannedAt: number - ): Promise { - const result = dropRepeatedWorktreeRows( - await this.listRepoWorktreesForResolutionUncached(repo, projectRuntime) - ) - return { result, adminFingerprint: null, adminFingerprintProbe: probe, scannedAt } + if (!observation) { + return { ok: false, worktrees: this.listStoredWorktreesForResolution(repo) } + } + const result = runtimeResultForObservation(observation) + // Mutations kept overtaking scans: publish the rows as non-authoritative, never as current truth. + return superseded && result.ok ? { ok: false, worktrees: result.worktrees } : result } /** Allow one outstanding filesystem probe per repo: timeouts do not cancel readdir/stat, so repeated probes could exhaust libuv on wedged mounts. */ @@ -159,25 +146,6 @@ export abstract class RuntimeWorkspaceRepoScanRefresh extends RuntimeWorkspaceCa }) } - protected async listRepoWorktreesForResolutionUncached( - repo: Repo, - projectRuntime: ProjectExecutionRuntimeResolution | undefined - ): Promise { - // Resolve executionHostId-only SSH rows too; client scans of remote paths would lose all worktrees. - const sshConnectionId = getRepoSshConnectionId(repo) - if (!sshConnectionId) { - return await scanLocalRepoWorktreesForResolution( - repo.path, - getLocalProjectWorktreeGitOptionsForRuntime(repo, projectRuntime) - ) - } - // Why: this process serves no SSH git, so an SSH repo answers from its stored rows. - return { - ok: false, - worktrees: this.listStoredWorktreesForResolution(repo) - } - } - protected listStoredWorktreesForResolution(repo: Repo): GitWorktreeInfo[] { return this.store ? listStoredWorktreeRowsForRepo(this.requireStore(), repo) : [] } @@ -191,36 +159,8 @@ export abstract class RuntimeWorkspaceRepoScanRefresh extends RuntimeWorkspaceCa } invalidateWorktreeScanCacheForRepo(repoId: string): void { - const prefix = `${repoId}\0` - const scopeKeys = new Set( - this.store - ?.getRepos() - .filter((repo) => repo.id === repoId) - .map((repo) => `${repoId}\0${getRepoExecutionHostId(repo)}`) ?? [] - ) - for (const keys of [ - this.worktreeScanGenerations.keys(), - this.worktreeScanCache.keys(), - this.worktreeScanInFlight.keys() - ]) { - for (const key of keys) { - if (key.startsWith(prefix)) { - scopeKeys.add(key) - } - } - } - const registered = new Set( - (this.store?.getRepos() ?? []).map((repo) => `${repo.id}\0${getRepoExecutionHostId(repo)}`) - ) - for (const key of scopeKeys) { - if (registered.has(key)) { - this.worktreeScanGenerations.set(key, (this.worktreeScanGenerations.get(key) ?? 0) + 1) - } else { - this.worktreeScanGenerations.delete(key) - this.worktreeScanCache.delete(key) - } - this.worktreeScanInFlight.delete(key) - } + invalidateWorktreeCatalogForRepo(repoId) + this.pruneUnregisteredWorktreeScans() } invalidateWorktreeCatalog(repoId: string): void { @@ -229,16 +169,9 @@ export abstract class RuntimeWorkspaceRepoScanRefresh extends RuntimeWorkspaceCa } protected invalidateSshWorktreeScanCacheInternal(targetId: string): void { + // SSH repos answer from stored rows and own no Git observation here; only projections go stale. const repos = this.store?.getRepos() ?? [] - const affectedRepos = repos.filter((repo) => getRepoSshConnectionId(repo) === targetId) - const affectedScopeKeys = new Set( - affectedRepos.map((repo) => `${repo.id}\0${getRepoExecutionHostId(repo)}`) - ) - for (const key of affectedScopeKeys) { - this.worktreeScanGenerations.set(key, (this.worktreeScanGenerations.get(key) ?? 0) + 1) - this.worktreeScanInFlight.delete(key) - } - if (affectedScopeKeys.size > 0) { + if (repos.some((repo) => getRepoSshConnectionId(repo) === targetId)) { this.resolvedWorktrees.invalidateResolved() } } diff --git a/src/main/runtime/workspaces/catalog/worktree-catalog-live-route.test.ts b/src/main/runtime/workspaces/catalog/worktree-catalog-live-route.test.ts new file mode 100644 index 00000000000..59cdb6a54ff --- /dev/null +++ b/src/main/runtime/workspaces/catalog/worktree-catalog-live-route.test.ts @@ -0,0 +1,74 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { + isLiveWorktreeCatalogRoute, + setWorktreeCatalogRouteResolver +} from '../../../workspaces/catalog/repo-worktree-catalog-route' +import { markWorktreeRouteInputsChanged } from '../../../workspaces/catalog/local-worktree-scan-generation' +import { registerWorktreeCatalogRoutes } from './worktree-catalog-live-route' + +function storeWith(repoCount: number) { + const repos: { id: string; path: string; kind: 'git' | 'folder' }[] = Array.from( + { length: repoCount }, + (_unused, index) => ({ id: `repo-${index}`, path: `/repos/app-${index}`, kind: 'git' }) + ) + const projects = repos.map((repo, index) => ({ + id: `project-${index}`, + sourceRepoIds: [repo.id] + })) + return { + repos, + getRepos: vi.fn(() => repos.map((repo) => ({ ...repo }))), + getProjects: vi.fn(() => [...projects]), + getSettings: () => ({}) + } +} + +// Pinned to a non-Windows host, where each project resolves to its own host runtime. +const routeOf = (index: number) => ({ + repoPath: `/repos/app-${index}`, + runtimeKey: `project-${index}:local-host:darwin` +}) +const realPlatform = process.platform + +describe('worktree catalog live route', () => { + beforeEach(() => { + Object.defineProperty(process, 'platform', { value: 'darwin' }) + }) + afterEach(() => { + Object.defineProperty(process, 'platform', { value: realPlatform }) + setWorktreeCatalogRouteResolver(null) + }) + + it('reads the registry and projects once per route change however many owners check', async () => { + for (const repoCount of [12, 120]) { + const store = storeWith(repoCount) + registerWorktreeCatalogRoutes(store as never) + for (let pass = 0; pass < 3; pass += 1) { + for (let index = 0; index < repoCount; index += 1) { + expect(isLiveWorktreeCatalogRoute(`repo-${index}`, 'local', routeOf(index))).toBe(true) + } + await Promise.resolve() + } + expect(store.getRepos).toHaveBeenCalledTimes(1) + expect(store.getProjects.mock.calls.length).toBeLessThanOrEqual(2) + + markWorktreeRouteInputsChanged() + expect(isLiveWorktreeCatalogRoute('repo-0', 'local', routeOf(0))).toBe(true) + expect(store.getRepos).toHaveBeenCalledTimes(2) + } + }) + + it('rejects a captured route as soon as the registration changes, before any later read', () => { + const store = storeWith(2) + registerWorktreeCatalogRoutes(store as never) + expect(isLiveWorktreeCatalogRoute('repo-0', 'local', routeOf(0))).toBe(true) + + store.repos[0].kind = 'folder' + store.repos[1].path = '/repos/renamed' + markWorktreeRouteInputsChanged() + + expect(isLiveWorktreeCatalogRoute('repo-0', 'local', routeOf(0))).toBe(false) + expect(isLiveWorktreeCatalogRoute('repo-1', 'local', routeOf(1))).toBe(false) + expect(isLiveWorktreeCatalogRoute('repo-9', 'local', routeOf(9))).toBe(false) + }) +}) diff --git a/src/main/runtime/workspaces/catalog/worktree-catalog-live-route.ts b/src/main/runtime/workspaces/catalog/worktree-catalog-live-route.ts new file mode 100644 index 00000000000..fbe635cd935 --- /dev/null +++ b/src/main/runtime/workspaces/catalog/worktree-catalog-live-route.ts @@ -0,0 +1,62 @@ +import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { isFolderRepo } from '../../../../shared/repo-kind' +import { + setWorktreeCatalogRouteResolver, + type WorktreeCatalogRoute +} from '../../../workspaces/catalog/repo-worktree-catalog-route' +import { getWorktreeRouteInputsRevision } from '../../../workspaces/catalog/local-worktree-scan-generation' +import { getWslDiscoveryRevision } from '../../../wsl/discovery/wsl-discovery-change' +import { resolveLocalProjectRuntimesForRepos } from '../../../workspaces/execution-host/local-project-runtime-resolution' +import type { RuntimeStore } from '../../construction/runtime-store-contract' +import { resolveWorktreeScanRuntime } from './runtime-worktree-scan-cache' + +type RouteSnapshot = { + inputsRevision: number + wslRevision: number + routes: Map +} + +/** Every eligible repo's live route from one registry read and one project pass. */ +function buildRoutes(store: RuntimeStore): Map { + const repos = store.getRepos() + const projectRuntimeByRepoId = resolveLocalProjectRuntimesForRepos(store as never, repos) + const routes = new Map() + for (const repo of repos) { + // Only this host's repos run local Git; remote-owned registrations answer from their own host. + if (isFolderRepo(repo) || getRepoExecutionHostId(repo) !== LOCAL_EXECUTION_HOST_ID) { + continue + } + const { projectRuntime, runtimeKey, sshConnectionId } = resolveWorktreeScanRuntime( + store as never, + repo, + projectRuntimeByRepoId + ) + // SSH rows answer from stored metadata and repair states cannot run local Git. + if (sshConnectionId || projectRuntime?.status === 'repair-required') { + continue + } + routes.set(`${repo.id}\0${getRepoExecutionHostId(repo)}`, { repoPath: repo.path, runtimeKey }) + } + return routes +} + +/** The catalog owner asks the live registration, not the caller, which route runs a repo's Git. */ +export function registerWorktreeCatalogRoutes(store: RuntimeStore | null | undefined): void { + if (!store) { + return + } + // Rebuilt only after a route input changes; writers advance these revisions synchronously. + let snapshot: RouteSnapshot | null = null + setWorktreeCatalogRouteResolver((repoId, hostId) => { + const inputsRevision = getWorktreeRouteInputsRevision() + const wslRevision = getWslDiscoveryRevision() + if ( + !snapshot || + snapshot.inputsRevision !== inputsRevision || + snapshot.wslRevision !== wslRevision + ) { + snapshot = { inputsRevision, wslRevision, routes: buildRoutes(store) } + } + return snapshot.routes.get(`${repoId}\0${hostId}`) ?? null + }) +} diff --git a/src/main/runtime/workspaces/catalog/worktree-scan-admin-fingerprint-gate.test.ts b/src/main/runtime/workspaces/catalog/worktree-scan-admin-fingerprint-gate.test.ts index 953588f35bf..218dfaf6d1e 100644 --- a/src/main/runtime/workspaces/catalog/worktree-scan-admin-fingerprint-gate.test.ts +++ b/src/main/runtime/workspaces/catalog/worktree-scan-admin-fingerprint-gate.test.ts @@ -31,6 +31,7 @@ vi.mock('./repo-worktree-admin-fingerprint', () => ({ })) import { OrcaRuntimeService } from '../../orca-runtime' +import { _resetWorktreeCatalogOwnerForTests } from '../../../workspaces/catalog/repo-worktree-catalog-owner' import { WORKTREE_SCAN_ADMIN_FINGERPRINT_TIMEOUT_MS } from './worktree-scan-admin-budget' import type { HostWorktreeTarget } from '../../../../shared/worktree/host-qualified-identity' @@ -166,6 +167,8 @@ function stallProbeOnce(): (fingerprint: string | null) => void { describe('worktree scan admin-fingerprint gate', () => { beforeEach(() => { + // The catalog owner is process-wide, like production's single runtime; each case starts unobserved. + _resetWorktreeCatalogOwnerForTests() listWorktreesStrictMock.mockReset() listWorktreesStrictMock.mockResolvedValue([ { path: REPO_PATH, head: 'abc', branch: 'main', isBare: false, isMainWorktree: true }, @@ -247,6 +250,8 @@ describe('worktree scan admin-fingerprint gate', () => { describe('scoped explicit worktree-id resolution', () => { beforeEach(() => { + // The catalog owner is process-wide, like production's single runtime; each case starts unobserved. + _resetWorktreeCatalogOwnerForTests() listWorktreesStrictMock.mockReset() listWorktreesStrictMock.mockImplementation(async (repoPath: string) => [ { path: repoPath, head: 'abc', branch: 'main', isBare: false, isMainWorktree: true }, diff --git a/src/main/runtime/workspaces/creation/runtime-folder-worktree-create.ts b/src/main/runtime/workspaces/creation/runtime-folder-worktree-create.ts index 1aecde1f210..7d3be5e68f0 100644 --- a/src/main/runtime/workspaces/creation/runtime-folder-worktree-create.ts +++ b/src/main/runtime/workspaces/creation/runtime-folder-worktree-create.ts @@ -31,6 +31,7 @@ import { type RuntimeFolderWorktreeSetupDeps } from './runtime-folder-worktree-setup' import { buildRuntimeSetupReceipt } from './runtime-local-worktree-setup' +import { createdWorktreeLifecycleIdentity } from '../lifecycle/worktree-lifecycle-event' type RuntimeFolderWorktreeCreateDeps = { store: RuntimeStore @@ -146,7 +147,8 @@ export async function createRuntimeFolderWorktree(args: { kind: 'created', worktreeId: worktree.id, path: worktree.path, - branch: worktree.branch + branch: worktree.branch, + ...createdWorktreeLifecycleIdentity(worktree) }) const setupResult = deps.setup ? await prepareFolderWorktreeSetup({ diff --git a/src/main/runtime/workspaces/creation/runtime-worktree-create-git.test.ts b/src/main/runtime/workspaces/creation/runtime-worktree-create-git.test.ts index 42e33c8b45a..d345dd5b012 100644 --- a/src/main/runtime/workspaces/creation/runtime-worktree-create-git.test.ts +++ b/src/main/runtime/workspaces/creation/runtime-worktree-create-git.test.ts @@ -70,3 +70,35 @@ describe('explicit local branch reuse on the execution host', () => { expect(worktrees).not.toHaveBeenCalled() }) }) + +describe('filesystem aliases of checked-out branches', () => { + const nfcBranch = 'feature/수신'.normalize('NFC') + const nfdBranch = nfcBranch.normalize('NFD') + + function mockGit(checkedOutBranch: string, listRef: (ref: string) => string): void { + git.mockImplementation(async (args: string[]) => + args[0] === 'for-each-ref' ? { stdout: listRef(args[2]) } : { stdout: 'abc123\n' } + ) + worktrees.mockResolvedValue([{ path: '/busy', branch: `refs/heads/${checkedOutBranch}` }]) + } + + it('rejects an NFD name that macOS Git resolves to a checked-out NFC branch (#18447)', async () => { + mockGit(nfcBranch, () => `refs/heads/${nfcBranch}\n`) + + await expect(canCheckoutExistingLocalBranch('/repo', nfdBranch, nfdBranch)).resolves.toBe(false) + }) + + it('rejects a case alias of a checked-out branch on a case-insensitive filesystem', async () => { + mockGit('feature/test', () => '') + + await expect( + canCheckoutExistingLocalBranch('/repo', 'feature/TEST', 'feature/TEST') + ).resolves.toBe(false) + }) + + it('allows a distinct alias on filesystems that store both spellings', async () => { + mockGit(nfcBranch, (ref) => `${ref}\n`) + + await expect(canCheckoutExistingLocalBranch('/repo', nfdBranch, nfdBranch)).resolves.toBe(true) + }) +}) diff --git a/src/main/runtime/workspaces/creation/runtime-worktree-create-git.ts b/src/main/runtime/workspaces/creation/runtime-worktree-create-git.ts index 9a672e2c0ae..65cf11d9a52 100644 --- a/src/main/runtime/workspaces/creation/runtime-worktree-create-git.ts +++ b/src/main/runtime/workspaces/creation/runtime-worktree-create-git.ts @@ -96,12 +96,15 @@ export async function canCheckoutExistingLocalBranch( } const worktrees = await listWorktrees(repoPath, gitOptions) let busy = worktrees.find((worktree) => normalizeLocalBranchName(worktree.branch) === branchName) - if (explicitReuse && !busy) { + if (!busy) { + // Why: macOS Git resolves case and NFC/NFD aliases to one stored ref; Linux keeps them distinct. + // Explicit reuse already verified that the requested spelling is stored exactly. for (const worktree of worktrees) { const checkedOutBranch = normalizeLocalBranchName(worktree.branch) if ( foldGitRefNameCase(checkedOutBranch) === foldGitRefNameCase(branchName) && - !(await hasExactBranchRef(checkedOutBranch)) + ((!explicitReuse && !(await hasExactBranchRef(branchName))) || + !(await hasExactBranchRef(checkedOutBranch))) ) { busy = worktree break diff --git a/src/main/runtime/workspaces/creation/workspace-creation.ts b/src/main/runtime/workspaces/creation/workspace-creation.ts index d64f593a6ab..51a626f9184 100644 --- a/src/main/runtime/workspaces/creation/workspace-creation.ts +++ b/src/main/runtime/workspaces/creation/workspace-creation.ts @@ -40,6 +40,7 @@ import { workspaceLifecycleKey } from '../lifecycle/workspace-lifecycle-commands import { getRepoExecutionHostId } from '../../../../shared/execution-host' import { applyWorkspaceCreatePluginHook } from '../../../plugins/hooks/workspace-create-plugin-hook' import { withProjectWorktreeCreate } from '../../../workspaces/creation/worktree-create-in-flight' +import { createdWorktreeLifecycleIdentity } from '../lifecycle/worktree-lifecycle-event' export abstract class OrcaRuntimeWithCreateManagedWorktree extends OrcaRuntimeWithGetWorktreeTerminalProvisioningHost { abstract resolveLineageForWorktreeCreate( @@ -240,7 +241,8 @@ export abstract class OrcaRuntimeWithCreateManagedWorktree extends OrcaRuntimeWi kind: 'created', worktreeId: worktree.id, path: worktree.path, - branch: worktree.branch + branch: worktree.branch, + ...createdWorktreeLifecycleIdentity(worktree) }) return { worktree: { diff --git a/src/main/runtime/workspaces/lifecycle/worktree-lifecycle-event.ts b/src/main/runtime/workspaces/lifecycle/worktree-lifecycle-event.ts index b27f9758d83..4ee82b08c4c 100644 --- a/src/main/runtime/workspaces/lifecycle/worktree-lifecycle-event.ts +++ b/src/main/runtime/workspaces/lifecycle/worktree-lifecycle-event.ts @@ -1,3 +1,25 @@ +import type { ExecutionHostId } from '../../../../shared/execution-host' + +/** Host-qualified identity of the worktree, when it has one. Captured before a removal purges + * the metadata row, since listeners hear `removed` only after. */ +type WorktreeLifecycleIdentity = { identityKey?: string; hostId?: ExecutionHostId } + export type RuntimeWorktreeLifecycleEvent = - | { kind: 'created'; worktreeId: string; path: string; branch: string } - | { kind: 'removed'; worktreeId: string; path: string } + | ({ + kind: 'created' + worktreeId: string + path: string + branch: string + } & WorktreeLifecycleIdentity) + | ({ kind: 'removed'; worktreeId: string; path: string } & WorktreeLifecycleIdentity) + +/** A created worktree's identity, from the row Orca just built for it. */ +export function createdWorktreeLifecycleIdentity(worktree: { + identity?: { key: string } + hostId?: ExecutionHostId +}): WorktreeLifecycleIdentity { + return { + ...(worktree.identity ? { identityKey: worktree.identity.key } : {}), + ...(worktree.hostId ? { hostId: worktree.hostId } : {}) + } +} diff --git a/src/main/runtime/workspaces/lineage/runtime-worktree-lineage-controller.test.ts b/src/main/runtime/workspaces/lineage/runtime-worktree-lineage-controller.test.ts deleted file mode 100644 index 5950106adaf..00000000000 --- a/src/main/runtime/workspaces/lineage/runtime-worktree-lineage-controller.test.ts +++ /dev/null @@ -1,195 +0,0 @@ -import { afterEach, describe, expect, it, vi } from 'vitest' -import '../../../../shared/agent-launch/catalog/tui-agent-display-names' -import type { CliWorktreeBuilder } from '../../rpc/methods/agent-launch/agent-launch-cwd-cli.test-fixture' -import '../../../../shared/execution-host' -import { WorktreeCreate } from '../../../../shared/rpc-contract/worktree-create-params' -import { WorktreeCreate as PreObservationCreate } from '../../../../shared/rpc-contract/worktree-create-params.pre-observation.test-fixture' -import { AgentLaunch, AgentLaunchReplay } from '../../../../shared/rpc-contract/agent-launch-params' -import { - AgentLaunch as PreObservationLaunch, - AgentLaunchReplay as PreObservationReplay -} from '../../../../shared/rpc-contract/agent-launch-params.pre-observation.test-fixture' -import { RuntimeWorktreeLineageController } from './runtime-worktree-lineage-controller' - -import type { ResolvedWorktree } from '../catalog/runtime-worktree-path-identity' -import { - formatAmbiguousCwdParentMessage, - type WorktreeLineageInput -} from './runtime-worktree-lineage-resolution' -import { - makeRuntimeOrchestrationDb, - taskLineageRow -} from '../../orca-runtime-tests/runtime-orchestration-db.test-fixture' -import { buildManagedWorktreeCreateArgs } from '../../rpc/methods/workspaces/worktree-create-args' -import { mapRuntimeError } from '../../rpc/errors' - -const fixturesPath = '../../../../cli/test-fixtures' -const { buildWorktree }: { buildWorktree: CliWorktreeBuilder } = await import(fixturesPath) -const root: Omit, 'identity'> = buildWorktree( - '/tmp/owner-choice', - 'main', - 'abc', - 'repo-a' -) -const siblingId = `${root.id}::workspace:11111111-1111-4111-8111-111111111111` -const choices = [`id:${siblingId}`, `id:${root.id}`] -const unresolved = { - cwdParentWorktree: choices[0], - cwdParentAmbiguous: true as const, - callerTerminalHandle: 'term_R' -} - -function worktree(id: string): ResolvedWorktree { - return { - ...root, - ...root.git, - id, - hostId: 'local', - instanceId: id, - linkedPR: null, - linkedLinearIssue: null, - isArchived: false, - isUnread: false, - isPinned: false, - sortOrder: 0, - lastActivityAt: 0 - } -} - -function fixture() { - const db = makeRuntimeOrchestrationDb() - const showTerminal = vi.fn(async (_handle: string) => ({ worktreeId: root.id })) - const resolveWorktree = vi.fn(async (selector: string) => { - if (selector === 'id:stale') { - throw new Error('selector_not_found') - } - return worktree(selector.replace(/^id:/, '')) - }) - const controller = new RuntimeWorktreeLineageController({ - getStore: () => null, - getDb: () => db, - showTerminal, - resolveWorkspace: async (selector: string) => ({ - kind: 'worktree' as const, - worktree: await resolveWorktree(selector) - }) - }) - return { controller, db, showTerminal, resolveWorktree } -} - -function parseVersionedCreate( - newHost: boolean, - route: 'create' | 'launch' | 'replay', - create: Record -) { - if (route === 'create') { - return (newHost ? WorktreeCreate : PreObservationCreate).parse(create) - } - const schema = - route === 'launch' - ? newHost - ? AgentLaunch - : PreObservationLaunch - : newHost - ? AgentLaunchReplay - : PreObservationReplay - const parsed = schema.parse({ - agent: 'codex', - operationId: `${Date.now()}-${'a'.repeat(32)}`, - target: { kind: 'create-worktree', create } - }) - if (parsed.target.kind !== 'create-worktree') { - throw new Error('fixture target changed') - } - return parsed.target.create -} - -afterEach(() => vi.restoreAllMocks()) - -describe('consumed cwd parent at the production authority boundary', () => { - it.each(['absent', 'stale-terminal', 'stale-env', 'stale-task', 'terminal-disappears'])( - 'refuses a retained positive cwd tie (%s), preserving exact RPC recovery', - async (kind) => { - const { controller, showTerminal, db } = fixture() - const input: WorktreeLineageInput = { ...unresolved } - if (kind === 'terminal-disappears') { - expect(await showTerminal('term_R')).toEqual({ worktreeId: root.id }) - expect(await controller.resolveParent(choices[1]!)).toMatchObject({ - worktree: { id: root.id } - }) - } - showTerminal.mockRejectedValue(new Error('terminal_not_found')) - if (kind === 'absent') { - delete input.callerTerminalHandle - } - if (kind === 'stale-env') { - input.envParentWorkspace = 'id:stale' - } - if (kind === 'stale-task') { - input.comment = 'created for task_stale' - vi.spyOn(db, 'getTask').mockReturnValue( - taskLineageRow({ id: 'task_stale', created_by_terminal_handle: 'term_gone' }) - ) - } - for (const order of [choices, choices.toReversed()]) { - let caught: unknown - try { - await controller.resolveCreate( - { ...input, cwdParentWorktree: order[0], cwdParentAmbiguous: true }, - 'local' - ) - } catch (error) { - caught = error - } - expect(caught).toMatchObject({ code: 'LINEAGE_PARENT_AMBIGUOUS' }) - const wire = mapRuntimeError('refusal', { runtimeId: 'runtime-1' }, caught) - expect(wire).toMatchObject({ - ok: false, - error: { - code: 'LINEAGE_PARENT_AMBIGUOUS', - message: formatAmbiguousCwdParentMessage() - } - }) - } - } - ) - - it.each([false, true])( - 'executes old/new client and host schema compatibility (newClient=%s)', - async (newClient) => { - const { controller, showTerminal } = fixture() - const request = { - repo: 'id:repo-a', - name: 'child', - cwdParentWorktree: choices[0], - callerTerminalHandle: 'term_R', - ...(newClient ? { cwdParentAmbiguous: true } : {}) - } - for (const newHost of [false, true]) { - for (const route of ['create', 'launch', 'replay'] as const) { - const parsed = parseVersionedCreate(newHost, route, request) - const { lineage } = buildManagedWorktreeCreateArgs(parsed, {}) - showTerminal.mockResolvedValue({ worktreeId: root.id }) - expect(await controller.resolveCreate(lineage, 'local')).toMatchObject({ - kind: 'lineage', - capture: { source: 'terminal-context' }, - parent: { worktree: { id: root.id } } - }) - showTerminal.mockRejectedValue(new Error('terminal_not_found')) - if (newHost && newClient) { - await expect(controller.resolveCreate(lineage, 'local')).rejects.toMatchObject({ - code: 'LINEAGE_PARENT_AMBIGUOUS' - }) - } else { - expect(lineage).not.toHaveProperty('cwdParentAmbiguous') - expect(await controller.resolveCreate(lineage, 'local')).toMatchObject({ - kind: 'lineage', - capture: { source: 'cwd-context', confidence: 'inferred' }, - parent: { worktree: { id: siblingId } } - }) - } - } - } - } - ) -}) diff --git a/src/main/runtime/workspaces/persisted-surfaces/automation-api-operations.ts b/src/main/runtime/workspaces/persisted-surfaces/automation-api-operations.ts index bdac0f5120f..e56f402c01e 100644 --- a/src/main/runtime/workspaces/persisted-surfaces/automation-api-operations.ts +++ b/src/main/runtime/workspaces/persisted-surfaces/automation-api-operations.ts @@ -93,10 +93,11 @@ export abstract class OrcaRuntimeWithAutomationApiOperations extends OrcaRuntime createAutomation( input: RuntimeAutomationCreateInput, - destination?: AutomationDestination + destination?: AutomationDestination, + beforeWrite?: () => void ): Promise { return this.automation.withExternalProbePriority(() => - this.automation.create(input, destination).then((automation) => { + this.automation.create(input, destination, beforeWrite).then((automation) => { const selector = this.automationChangeSelector(automation.id) this.publishAutomationDefinitionChange(selector, selector) return automation diff --git a/src/main/runtime/workspaces/process-listing/workspace-process-listing.ts b/src/main/runtime/workspaces/process-listing/workspace-process-listing.ts index 18f33acf5d3..bef13877ace 100644 --- a/src/main/runtime/workspaces/process-listing/workspace-process-listing.ts +++ b/src/main/runtime/workspaces/process-listing/workspace-process-listing.ts @@ -67,6 +67,11 @@ export abstract class OrcaRuntimeWithGetWorktreePs extends RuntimeChatWorkerEven () => this._orchestrationDb ) + /** The task each pane was dispatched, by pane key, as `worktree.ps` rows title it. */ + listAgentTasksByPaneKey() { + return this.agentOrchestrationProjection.buildByPaneKey() ?? {} + } + async getWorktreePs( limit = DEFAULT_WORKTREE_PS_LIMIT, sourceDefaultsSupported = true, diff --git a/src/main/runtime/workspaces/process-listing/worktree-ps-degraded-repo-scan.test.ts b/src/main/runtime/workspaces/process-listing/worktree-ps-degraded-repo-scan.test.ts index ada74807a73..c62c1479819 100644 --- a/src/main/runtime/workspaces/process-listing/worktree-ps-degraded-repo-scan.test.ts +++ b/src/main/runtime/workspaces/process-listing/worktree-ps-degraded-repo-scan.test.ts @@ -32,6 +32,7 @@ import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' import type { WorktreeLineage } from '../../../../shared/worktree/lineage-types' import { worktreeWorkspaceKey } from '../../../../shared/workspace-scope' import { OrcaRuntimeService } from '../../orca-runtime' +import { _resetWorktreeCatalogOwnerForTests } from '../../../workspaces/catalog/repo-worktree-catalog-owner' import type { HostWorktreeTarget } from '../../../../shared/worktree/host-qualified-identity' import { @@ -144,6 +145,8 @@ async function advancePastRepoScanBudget(pending: Promise): Promise { describe('worktree.ps on a degraded repo scan', () => { beforeEach(() => { + // The catalog owner is process-wide; a previous case's failed scan must not answer this one. + _resetWorktreeCatalogOwnerForTests() listWorktreesStrictMock.mockReset() listWorktreesStrictMock.mockResolvedValue([]) }) diff --git a/src/main/runtime/workspaces/removal/runtime-interrupted-local-worktree-removal.test.ts b/src/main/runtime/workspaces/removal/runtime-interrupted-local-worktree-removal.test.ts index 6d2639924e0..d684f5ddb61 100644 --- a/src/main/runtime/workspaces/removal/runtime-interrupted-local-worktree-removal.test.ts +++ b/src/main/runtime/workspaces/removal/runtime-interrupted-local-worktree-removal.test.ts @@ -1,37 +1,25 @@ +import type { Repo } from '../../../../shared/repo-types' +import type { GitPushTarget } from '../../../../shared/worktree/types' +import type { WorktreeRemovalRecord } from '../../../workspaces/removal/worktree-removal-records' import { installRealWorkerThreadChildProcesses } from '../../../worker-thread-child-process/worker-thread-child-process-real.test-fixtures' -// Use real Git/disk evidence to finish interrupted removal regardless of how far the earlier run progressed. import { execFile } from 'node:child_process' import { existsSync } from 'node:fs' -import { mkdir, mkdtemp, readFile, realpath, rename, unlink, writeFile } from 'node:fs/promises' +import { mkdir, mkdtemp, realpath, unlink, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { promisify } from 'node:util' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { GitPushTarget } from '../../../../shared/worktree/types' -import type { Repo } from '../../../../shared/repo-types' + import { getDefaultSettings } from '../../../../shared/constants' import { getProjectHostSetupWorktreeMeta } from '../../../../shared/project-host-setup-lookup' -import { buildDetectedGitWorktrees } from '../../../ipc/worktrees/listing/ssh-worktree-fallback' + import { removeTree } from '../../../../shared/windows-transient-lock-removal' import type { RemoveWorktreeResult } from '../../../../shared/worktree/create-types' import type { Store } from '../../../persistence/loading-store/store' import type * as HostTreeRemoval from '../../../filesystem/host-tree-removal' import { removeHostTree } from '../../../filesystem/host-tree-removal' -import * as nativeFs from '../../../filesystem/asar-transparent-fs' -import * as diskFs from 'node:fs/promises' -import * as nativeRemoval from '../../../git/worktrees/removal/windows-worktree-removal' -import * as graphReader from '../../../git/worktrees/catalog/worktree-list-reader' -import { cleanupLocalOrphanedWorktreeDirectory } from '../../../workspaces/removal/local-orphaned-worktree-cleanup' -import * as removalOwnership from '../../../ipc/worktrees/removal/worktree-removal-ownership' -import { executeWorktreeRemoval } from '../../../ipc/worktrees/removal/execute-worktree-removal' -import { RuntimeWorktreeRemovalInFlight } from './runtime-worktree-removal-in-flight' -import { OrcaRuntimeWithResolveWorktreeRemovalTarget } from '../workspace-removal-target' -import type { WorktreeIpcContext } from '../../../ipc/worktrees/worktree-ipc-context' -import * as backgroundRemoval from '../../../workspaces/removal/worktree-background-removal' -import * as worktreeGit from '../../../git/worktrees/catalog/worktree-listing' -import * as worktreeRemote from '../../../ipc/worktree-remote' + import { getLocalProjectWorktreeGitOptions } from '../../../workspaces/execution-host/project-runtime-git-options' -import * as removalTable from '../../../workspaces/removal/worktree-removal-table' import { listWorktreesStrict } from '../../../git/worktrees/catalog/worktree-listing' import { areWorktreePathsEqual } from '../../../git/worktrees/catalog/worktree-path-comparison' import { @@ -46,19 +34,13 @@ import { resumeInterruptedWorktreeRemovals, waitForPendingWorktreeRemoval } from '../../../workspaces/removal/worktree-background-removal' -import { withUnregisteredRemovalCheckouts } from '../../../workspaces/removal/worktree-removal-listing' + import { readWorktreeRemovalRecords, - writeWorktreeRemovalRecords, - type WorktreeRemovalRecord + writeWorktreeRemovalRecords } from '../../../workspaces/removal/worktree-removal-records' -import { queueWorkspaceDelete } from '../lifecycle/workspace-lifecycle-commands' -import { WorkspaceLifecycleQueue } from '../lifecycle/workspace-lifecycle-queue' -import { interruptedLocalWorktreeRemovalJob } from './runtime-interrupted-local-worktree-removal' -vi.mock('node:fs/promises', async (importOriginal) => { - return { ...(await importOriginal()) } -}) +import { interruptedLocalWorktreeRemovalJob } from './runtime-interrupted-local-worktree-removal' vi.mock('../../../workspaces/execution-host/project-runtime-git-options', () => ({ getLocalProjectWorktreeGitOptions: vi.fn(() => ({})) @@ -68,11 +50,6 @@ vi.mock('../../../filesystem/host-tree-removal', async (importOriginal) => { return { ...actual, removeHostTree: vi.fn(actual.removeHostTree) } }) -vi.mock('../../../ipc/worktrees/removal/worktree-removal-ownership', () => ({ - stopPtysForDestructiveWorktreeRemoval: vi.fn(async () => {}), - removeWorktreeMetadataAndTransientState: vi.fn() -})) - const execFileAsync = promisify(execFile) let scratchDir = '' @@ -81,7 +58,6 @@ let repoPath = '' let worktreePath = '' let repo: Repo let pushTarget: GitPushTarget | undefined -let lifecycle: WorkspaceLifecycleQueue async function git(args: string[], cwd = repoPath): Promise { const { stdout } = await execFileAsync('git', args, { cwd }) @@ -97,7 +73,6 @@ async function isRegistered(path: string): Promise { beforeEach(async () => { pushTarget = undefined - lifecycle = new WorkspaceLifecycleQueue() vi.mocked(getLocalProjectWorktreeGitOptions).mockReturnValue({}) // realpath: macOS hands out /var/... temp paths while Git reports /private/var/.... scratchDir = await realpath(await mkdtemp(join(tmpdir(), 'orca-interrupted-removal-'))) @@ -120,7 +95,6 @@ afterEach(async () => { _resetPendingWorktreeRemovalsForTests() vi.restoreAllMocks() vi.mocked(removeHostTree).mockClear() - vi.mocked(removalOwnership.stopPtysForDestructiveWorktreeRemoval).mockReset() await removeTree(scratchDir) }) @@ -185,14 +159,6 @@ async function finishAfterRestart( return { outcome, purged, remember, records } } -/** The non-main rows a listing shows, with any failed delete's error. */ -async function listedRows(): Promise<{ path: string; removalError?: string }[]> { - const rows = await withUnregisteredRemovalCheckouts(repo.id, await listWorktreesStrict(repoPath)) - return buildDetectedGitWorktrees(removalHost().store, repo, rows) - .filter((row) => row.visible && !row.isMainWorktree) - .map(({ path, removalError }) => ({ path, ...(removalError ? { removalError } : {}) })) -} - function removalHost( repoGone = false, stopPtys = async () => {}, @@ -230,343 +196,7 @@ function removalHost( } } -const deletionOperations = () => - (['rm', 'unlink', 'rmdir'] as const).map((operation) => vi.spyOn(nativeFs, operation)) - -function expectNoTeardownOrDeletion( - ...callbacks: (ReturnType | ReturnType[number])[] -): void { - callbacks.forEach((callback) => expect(callback).not.toHaveBeenCalled()) -} - -type RemovalEntry = 'desktop' | 'runtime' - -async function deleteViaEntry( - entry: RemovalEntry, - force: boolean, - stop = async () => {}, - teardown = vi.fn(), - deleteBranch?: boolean -): Promise { - const worktreeId = `repo-1::${worktreePath}` - const host = removalHost(false, stop, teardown) - const { store } = host - const runtime: OrcaRuntimeWithResolveWorktreeRemovalTarget = Object.assign( - Object.create(OrcaRuntimeWithResolveWorktreeRemovalTarget.prototype), - { - store, - workspaceLifecycle: lifecycle, - listRepos: store.getRepos, - listTerminals: async () => ({ totalCount: 0 }), - requireStore: () => store, - resolveWorktreeRemovalTarget: async () => ({ - id: worktreeId, - repoId: repo.id, - path: worktreePath - }), - removeManagedWorktreeInFlight: new RuntimeWorktreeRemovalInFlight(), - localRemovalJobHost: () => host, - acquireFileWatcherRemoval: host.acquireWatcherRemoval, - stopPtysForDestructiveWorktreeRemoval: stop, - closeFileWatchersForRemoval: host.closeWatchers, - preservedBranchCleanup: { ...host.preservedBranchCleanup, delete: vi.fn() }, - purgeRemovedWorktree: host.purge, - clearOptimisticReconcileToken: () => {}, - publishWorktreeRemovalChange: () => {}, - notifyWorktreesChanged: () => {}, - emitWorktreeLifecycle: () => {} - } - ) - vi.mocked(removalOwnership.stopPtysForDestructiveWorktreeRemoval).mockImplementation(stop) - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: native dispatch reads only the fixture-owned context fields below. - const context = { - store, - runtime, - mainWindow: { isDestroyed: () => true } - } as unknown as WorktreeIpcContext - try { - const accepted = - entry === 'desktop' - ? await executeWorktreeRemoval( - context, - { worktreeId, force }, - repo, - repo.id, - worktreePath, - 'local' - ) - : await queueWorkspaceDelete( - runtime, - `id:${worktreeId}`, - 'local', - { force, deleteBranch }, - (removal) => - runtime.removeManagedWorktree(`id:${worktreeId}`, { - ...removal, - waitForBackgroundRemoval: true - }) - ) - return await backgroundRemoval.finishAcceptedWorktreeRemoval(accepted, worktreeId) - } finally { - await _settlePendingWorktreeRemovalsForTests() - } -} - -async function orphanAdmin(): Promise { - const admin = (await readFile(join(worktreePath, '.git'), 'utf8')).trim().replace(/^gitdir: /, '') - await removeTree(admin) - await unlink(join(worktreePath, '.git')) - await writeFile(join(worktreePath, '.git'), ` gitdir: ${admin}\nignored second line\n`) -} - -async function recordFailedRemoval(force: boolean, deleteBranch = true): Promise { - await writeWorktreeRemovalRecords(recordsDir, () => [ - { - worktreeId: `repo-1::${worktreePath}`, - repoId: repo.id, - repoPath, - worktreePath, - branch: 'feature', - head: '', - deleteBranch, - force, - requestedAt: 1, - failure: { message: 'held file', failedAt: 2 } - } - ]) - await loadWorktreeRemovalRecords(recordsDir) -} - describe('finishing an interrupted worktree removal after a restart', () => { - it('refuses an unknown owner through both entries, admission, cleanup and failed listing', async () => { - await orphanAdmin() - const movedOwner = join(scratchDir, 'ENOENT') - await rename(repoPath, movedOwner) - repoPath = movedOwner - repo.path = repoPath - await writeFile(join(repoPath, 'HEAD'), 'ref: refs/heads/main\n') - await writeFile( - join(worktreePath, '.git'), - `gitdir: ${join(repoPath, 'worktrees', 'feature')}\n` - ) - // Successful graph seams isolate proof propagation, not a live permission exploit. - vi.spyOn(worktreeGit, 'listWorktreesStrict').mockResolvedValue([]) - vi.spyOn(graphReader, 'readTranslatedWorktreeGraph').mockResolvedValue([]) - const stat = diskFs.stat - vi.spyOn(diskFs, 'stat').mockImplementation(async (path, options) => { - if (String(path) === join(repoPath, '.git')) { - throw Object.assign(new Error(`EACCES: permission denied, stat '${String(path)}'`), { - code: 'EACCES' - }) - } - return stat(path, options) - }) - const stop = vi.fn(async () => {}) - const teardown = vi.fn() - const operations = deletionOperations() - await expect( - nativeRemoval.removeWindowsCheckout(repoPath, worktreePath, true, {}) - ).rejects.toThrow('Refusing to delete unregistered worktree path') - // Reach both nonnative unregistered consumers after independently checking native admission. - vi.spyOn(nativeRemoval, 'usesNativeWindowsRemoval').mockReturnValue(false) - const metadata = vi.mocked(removalOwnership.removeWorktreeMetadataAndTransientState) - metadata.mockClear() - const pushCleanup = vi.spyOn(worktreeRemote, 'cleanupUnusedWorktreePushTargetRemote') - for (const entry of ['desktop', 'runtime'] as const) { - await expect(deleteViaEntry(entry, true, stop, teardown)).rejects.toThrow( - 'Refusing to delete unregistered worktree path' - ) - } - await expect( - cleanupLocalOrphanedWorktreeDirectory(repoPath, worktreePath, {}, stop) - ).rejects.toThrow('Worktree is no longer registered with Git but its directory remains.') - expectNoTeardownOrDeletion(stop, teardown, ...operations) - expect(removeHostTree).not.toHaveBeenCalled() - expect(metadata).not.toHaveBeenCalled() - expect(pushCleanup).not.toHaveBeenCalled() - expect(await readFile(join(worktreePath, 'seed.txt'), 'utf8')).toBe('seed\n') - await recordFailedRemoval(true) - expect(await readWorktreeRemovalRecords(recordsDir)).toMatchObject([ - { worktreePath, failure: { message: 'held file' } } - ]) - expect(await listedRows()).toEqual([]) - await vi.waitFor(async () => expect(await readWorktreeRemovalRecords(recordsDir)).toEqual([])) - expect(await readFile(join(worktreePath, 'seed.txt'), 'utf8')).toBe('seed\n') - }) - - it.skipIf(process.platform !== 'win32').each([ - { entry: 'desktop', phase: 'child' }, - { entry: 'runtime', phase: 'child' }, - { entry: 'desktop', phase: 'root' }, - { entry: 'runtime', phase: 'root' } - ] as const)( - '$entry completes explicit retry after releasing held $phase across restart', - async ({ entry, phase }) => { - const remoteUrl = 'https://example.invalid/repo.git' - pushTarget = { - remoteName: 'pr-contributor', - branchName: 'feature', - remoteCreated: true, - remoteUrl - } - await git(['remote', 'add', pushTarget.remoteName, remoteUrl]) - await git(['config', `remote.${pushTarget.remoteName}.orca-created`, 'true']) - const sibling = join(scratchDir, 'temporarily-missing') - await git(['worktree', 'add', '-q', sibling, '-b', 'sibling']) - await rename(sibling, join(scratchDir, 'offline')) - const path = phase === 'child' ? join(worktreePath, 'seed.txt') : worktreePath - const locked = Object.assign(new Error('held path'), { code: 'EBUSY', path }) - const held = vi.spyOn(nativeFs, phase === 'child' ? 'rm' : 'rmdir').mockRejectedValue(locked) - const { outcome, records } = await finishAfterRestart({ force: true }) - const message = `${path} is open in another program. Close that program and delete again.` - expect(outcome.status).toBe('failed') - expect(records).toMatchObject([{ failure: { message } }]) - if (phase === 'root') { - expect((await listWorktreesStrict(repoPath)).filter((row) => row.prunable)).toHaveLength(2) - } - expect(await listedRows()).toEqual([{ path: worktreePath, removalError: message }]) - expect(await git(['remote'])).toContain(pushTarget.remoteName) - expect(await isRegistered(worktreePath)).toBe(true) - expect(await git(['branch', '--list', 'feature'])).not.toBe('') - _resetPendingWorktreeRemovalsForTests() - await loadWorktreeRemovalRecords(recordsDir) - expect(await listedRows()).toEqual([{ path: worktreePath, removalError: message }]) - const resume = vi.fn() - resumeInterruptedWorktreeRemovals(resume) - expect(resume).not.toHaveBeenCalled() - await expect(deleteViaEntry(entry, true)).rejects.toThrow() - expect(await isRegistered(worktreePath)).toBe(true) - held.mockRestore() - await deleteViaEntry(entry, true) - expect(existsSync(worktreePath)).toBe(false) - expect(await isRegistered(worktreePath)).toBe(false) - expect(await git(['branch', '--list', 'feature'])).toBe('') - expect(await git(['remote'])).not.toContain(pushTarget.remoteName) - expect(await isRegistered(sibling)).toBe(true) - expect(await readWorktreeRemovalRecords(recordsDir)).toEqual([]) - }, - 60_000 - ) - - it - .skipIf(process.platform !== 'win32') - .each( - (['desktop', 'runtime'] as const).flatMap((entry) => - ['native', 'wsl'].map((route) => ({ entry, route })) - ) - )( - '$entry refuses $route before publication/teardown and honors current native force', - async ({ entry, route }) => { - const seed = await readFile(join(worktreePath, 'seed.txt')) - await orphanAdmin() - if (route === 'wsl') { - await unlink(join(worktreePath, '.git')) - vi.mocked(getLocalProjectWorktreeGitOptions).mockReturnValue({ wslDistro: 'Ubuntu' }) - // A route-list seam, not a distro run: the request must refuse before invoking a job. - vi.spyOn(worktreeGit, 'listWorktreesStrict').mockResolvedValue([]) - } - const retryJob = vi.spyOn(backgroundRemoval, 'retryFailedWorktreeRemoval') - const pushCleanup = vi.spyOn(worktreeRemote, 'cleanupUnusedWorktreePushTargetRemote') - await recordFailedRemoval(true) - const stop = vi.fn(async () => {}) - const teardown = vi.fn() - const operations = deletionOperations() - for (let attempt = 0; attempt < 2; attempt += 1) { - await expect(deleteViaEntry(entry, false, stop, teardown)).rejects.toThrow( - /no longer (?:registered|a Git worktree)/ - ) - expect(retryJob).not.toHaveBeenCalled() - expect(pushCleanup).not.toHaveBeenCalled() - expectNoTeardownOrDeletion(stop, teardown, ...operations) - expect(await readFile(join(worktreePath, 'seed.txt'))).toEqual(seed) - expect(await readWorktreeRemovalRecords(recordsDir)).toMatchObject([ - { force: true, failure: { message: 'held file' } } - ]) - _resetPendingWorktreeRemovalsForTests() - await loadWorktreeRemovalRecords(recordsDir) - } - if (route === 'wsl') { - return - } - const sibling = join(scratchDir, 'temporarily-missing') - await git(['worktree', 'add', '-q', sibling, '-b', 'sibling']) - await rename(sibling, join(scratchDir, 'offline')) - await recordFailedRemoval(false) - const started = Promise.withResolvers() - const paused = Promise.withResolvers() - const retry = deleteViaEntry(entry, true, async () => { - started.resolve() - await paused.promise - }).catch((error: unknown) => error) - try { - await started.promise - expect([...removalTable.pendingWorktreeRemovals.values()]).toMatchObject([ - { force: true, branch: 'feature', deleteBranch: true } - ]) - expect(await readWorktreeRemovalRecords(recordsDir)).toMatchObject([{ force: true }]) - } finally { - paused.resolve() - } - expect(await retry).not.toBeInstanceOf(Error) - expect(await isRegistered(worktreePath)).toBe(false) - expect(await isRegistered(sibling)).toBe(true) - expect(await git(['branch', '--list', 'feature'])).toBe('') - await git(['worktree', 'add', '-q', worktreePath, '-b', 'feature']) - await removeTree(worktreePath) - expect(await isRegistered(worktreePath)).toBe(true) - await deleteViaEntry(entry, true) - expect(await isRegistered(worktreePath)).toBe(false) - expect(await isRegistered(sibling)).toBe(true) - expect(await git(['branch', '--list', 'feature'])).toBe('') - } - ) - - it.skipIf(process.platform !== 'win32').each( - (['desktop', 'runtime'] as const).flatMap((entry) => - ['attached', 'detached', 'folder', 'nested'].map((schedule) => ({ - entry, - schedule - })) - ) - )( - '$entry preserves $schedule replacements before/after teardown', - async ({ entry, schedule }) => { - await orphanAdmin() - await loadWorktreeRemovalRecords(recordsDir) - const change = async () => { - if (schedule === 'nested') { - await git(['worktree', 'add', '-q', join(worktreePath, 'nested'), '-b', 'nested']) - } else { - await rename(worktreePath, join(scratchDir, 'original')) - await (schedule === 'folder' - ? mkdir(worktreePath) - : git([ - 'worktree', - 'add', - '-q', - ...(schedule === 'detached' ? ['--detach'] : ['-b', 'other']), - worktreePath - ])) - } - await writeFile(join(worktreePath, 'notes.txt'), 'mine\n') - } - const stop = vi.fn(change) - const teardown = vi.fn() - await expect(deleteViaEntry(entry, true, stop, teardown)).rejects.toThrow() - expect(await readFile(join(worktreePath, 'notes.txt'), 'utf8')).toBe('mine\n') - expect(stop).toHaveBeenCalledOnce() - // A second ordinary Delete refuses proofless/nested contents before teardown. - if (['folder', 'nested'].includes(schedule)) { - stop.mockClear() - teardown.mockClear() - const operations = deletionOperations() - await expect(deleteViaEntry(entry, true, stop, teardown)).rejects.toThrow() - expectNoTeardownOrDeletion(stop, teardown, ...operations) - expect(await readFile(join(worktreePath, 'notes.txt'), 'utf8')).toBe('mine\n') - } - } - ) - it.each(['partial', 'detached', 'keep-registered', 'keep-unregistered'])( 'finishes the accepted %s pending checkout after restart', async (kind) => { @@ -601,156 +231,6 @@ describe('finishing an interrupted worktree removal after a restart', () => { } ) - it.each([false, undefined])( - 'settles persisted failed keep through lifecycle retry, intent=%s', - async (intent) => { - const head = (await git(['rev-parse', 'feature'])).trim() - await git(['worktree', 'remove', worktreePath]) - await mkdir(worktreePath) - await writeFile(join(worktreePath, 'leftover'), 'held') - await recordFailedRemoval(false, false) - const id = `repo-1::${worktreePath}` - const record = removalTable.failedWorktreeRemovals.get(id) - expect(record).toMatchObject({ deleteBranch: false, failure: { message: 'held file' } }) - await expect(deleteViaEntry('runtime', false, undefined, undefined, intent)).rejects.toThrow( - 'folder was left on disk' - ) - expect(removalTable.failedWorktreeRemovals.get(id)).toBe(record) - expect(lifecycle.hints()).toEqual({}) - // Removing only this fixture's leftover is the legitimate external wake for retry. - await removeTree(worktreePath) - await expect(deleteViaEntry('runtime', false, undefined, undefined, true)).rejects.toThrow( - 'different branch choice' - ) - expect(removalTable.failedWorktreeRemovals.get(id)).toBe(record) - expect(lifecycle.hints()).toEqual({}) - const entered = Promise.withResolvers() - const release = Promise.withResolvers() - const stopPtys = async () => { - entered.resolve() - await release.promise - } - const retry = deleteViaEntry('runtime', false, stopPtys, undefined, intent) - try { - await entered.promise - expect(removalTable.pendingWorktreeRemovals.get(id)).toMatchObject({ deleteBranch: false }) - expect(removalTable.failedWorktreeRemovals.has(id)).toBe(false) - } finally { - release.resolve() - } - const result = await retry - expect(result).not.toHaveProperty('preservedBranch') - expect((await git(['rev-parse', 'feature'])).trim()).toBe(head) - expect(await isRegistered(worktreePath)).toBe(false) - expect(existsSync(worktreePath)).toBe(false) - expect(waitForPendingWorktreeRemoval(id)).toBeUndefined() - expect(removalTable.failedWorktreeRemovals.has(id)).toBe(false) - expect(await readWorktreeRemovalRecords(recordsDir)).toEqual([]) - expect(lifecycle.hints()).toEqual({}) - } - ) - - it('keeps the user’s non-forced choice: Git refuses local changes and the row returns as before', async () => { - vi.spyOn(console, 'warn').mockImplementation(() => {}) - await writeFile(join(worktreePath, 'notes.txt'), 'mine\n') - - const { outcome, purged, records } = await finishAfterRestart({ force: false }) - - expect(outcome).toMatchObject({ status: 'failed' }) - expect(await readFile(join(worktreePath, 'notes.txt'), 'utf8')).toBe('mine\n') - expect(existsSync(join(worktreePath, 'seed.txt'))).toBe(true) - expect(await isRegistered(worktreePath)).toBe(true) - expect(await git(['branch', '--list', 'feature'])).not.toBe('') - expect(purged).toEqual([]) - expect(records).toMatchObject([{ failure: { message: expect.any(String) } }]) - expect(await listedRows()).toEqual([{ path: worktreePath, removalError: expect.any(String) }]) - }) - - it.each([true, false])( - 'preserves a nonempty markerless checkout and platform cleanup policy (force %s)', - async (force) => { - vi.spyOn(console, 'warn').mockImplementation(() => {}) - const admin = (await readFile(join(worktreePath, '.git'), 'utf8')).trim().slice(8) - const backlink = await readFile(join(admin, 'gitdir'), 'utf8') - const branchHead = await git(['rev-parse', 'feature']) - // Git deletes in directory order; without `.git` no `worktree remove` can validate it. - await unlink(join(worktreePath, '.git')) - - const { outcome, purged, records } = await finishAfterRestart({ force }) - - const refusal = expect.stringContaining('folder was left on disk') - expect(outcome).toEqual({ status: 'failed', error: refusal }) - const native = process.platform === 'win32' - if (native && force) { - await expect(deleteViaEntry('runtime', force)).rejects.toThrow(/folder was left on disk/) - await removalTable.persistWorktreeRemovalRecords() - expect(await readWorktreeRemovalRecords(recordsDir)).toEqual(records) - expect(await readFile(join(admin, 'gitdir'), 'utf8')).toBe(backlink) - expect(await git(['rev-parse', 'feature'])).toBe(branchHead) - } - expect(existsSync(join(worktreePath, '.git'))).toBe(false) - expect(await readFile(join(worktreePath, 'seed.txt'), 'utf8')).toBe('seed\n') - expect(removeHostTree).not.toHaveBeenCalled() - expect(await isRegistered(worktreePath)).toBe(native) - expect((await git(['branch', '--list', 'feature'])).trim() !== '').toBe(native) - expect(purged).toEqual([]) - expect(records).toMatchObject([{ failure: { message: refusal } }]) - expect(await listedRows()).toEqual([{ path: worktreePath, removalError: refusal }]) - } - ) - - it('deletes nothing in a folder put at the path after Git unregistered the checkout', async () => { - vi.spyOn(console, 'warn').mockImplementation(() => {}) - await git(['worktree', 'remove', worktreePath]) - await mkdir(worktreePath, { recursive: true }) - await writeFile(join(worktreePath, 'notes.txt'), 'mine\n') - - const { outcome, purged, records } = await finishAfterRestart({ force: true }) - - const refusal = expect.stringContaining('folder was left on disk') - expect(outcome).toEqual({ status: 'failed', error: refusal }) - expect(await readFile(join(worktreePath, 'notes.txt'), 'utf8')).toBe('mine\n') - expect(removeHostTree).not.toHaveBeenCalled() - // Git let go of the checkout, so the recorded branch delete runs (merged only); no files. - expect(await git(['branch', '--list', 'feature'])).toBe('') - expect(purged).toEqual([]) - expect(records).toMatchObject([{ failure: { message: refusal } }]) - expect(await listedRows()).toEqual([{ path: worktreePath, removalError: refusal }]) - }) - - it('leaves a different checkout created at the same path since the quit', async () => { - vi.spyOn(console, 'warn').mockImplementation(() => {}) - const head = (await git(['rev-parse', 'feature'])).trim() - await git(['worktree', 'remove', worktreePath]) - await git(['worktree', 'add', '-q', worktreePath, '-b', 'other']) - await writeFile(join(worktreePath, 'unsaved.txt'), 'work\n') - - const { outcome, purged, records } = await finishAfterRestart({ head, force: true }) - - expect(outcome).toMatchObject({ status: 'failed' }) - expect(records).toEqual([]) - expect(existsSync(join(worktreePath, 'unsaved.txt'))).toBe(true) - expect(await isRegistered(worktreePath)).toBe(true) - expect(purged).toEqual([]) - }) - - it('leaves a repository created at the path after Git unregistered the checkout', async () => { - vi.spyOn(console, 'warn').mockImplementation(() => {}) - await git(['worktree', 'remove', worktreePath]) - await mkdir(worktreePath, { recursive: true }) - await git(['init', '-q'], worktreePath) - await writeFile(join(worktreePath, 'unsaved.txt'), 'work\n') - - const { outcome, purged, records } = await finishAfterRestart({ force: true }) - - expect(outcome).toMatchObject({ status: 'failed' }) - // Not the removed checkout's leftover, so no row either, as a listing would decide. - expect(records).toEqual([]) - expect(existsSync(join(worktreePath, 'unsaved.txt'))).toBe(true) - expect(removeHostTree).not.toHaveBeenCalled() - expect(purged).toEqual([]) - }) - it('leaves the same branch checked out again at a new head', async () => { vi.spyOn(console, 'warn').mockImplementation(() => {}) const head = (await git(['rev-parse', 'feature'])).trim() @@ -767,56 +247,6 @@ describe('finishing an interrupted worktree removal after a restart', () => { expect(existsSync(join(worktreePath, 'work.txt'))).toBe(true) expect(purged).toEqual([]) }) - - it('leaves a locked checkout alone even when its .git file is gone', async () => { - vi.spyOn(console, 'warn').mockImplementation(() => {}) - await git(['worktree', 'lock', worktreePath]) - await unlink(join(worktreePath, '.git')) - - const { outcome, purged, records } = await finishAfterRestart({ force: true }) - - expect(outcome).toMatchObject({ status: 'failed', error: expect.stringMatching(/locked/) }) - expect(existsSync(join(worktreePath, 'seed.txt'))).toBe(true) - // Not pruned either: the lock keeps Git's registration. - expect(await isRegistered(worktreePath)).toBe(true) - expect(purged).toEqual([]) - expect(records).toMatchObject([{ failure: { message: expect.any(String) } }]) - }) - - it('keeps an unmerged branch, as a normal removal does', async () => { - await writeFile(join(worktreePath, 'work.txt'), 'work\n') - await git(['add', '-A'], worktreePath) - await git(['commit', '-qm', 'work'], worktreePath) - const head = (await git(['rev-parse', 'feature'])).trim() - await git(['worktree', 'remove', worktreePath]) - - const { outcome, remember, records } = await finishAfterRestart() - - expect(records).toEqual([]) - expect(outcome).toMatchObject({ - status: 'removed', - preservedBranch: { branchName: 'feature', head } - }) - expect((await git(['rev-parse', 'feature'])).trim()).toBe(head) - expect(remember).toHaveBeenCalledWith( - `repo-1::${worktreePath}`, - undefined, - { preservedBranch: { branchName: 'feature', head } }, - head, - undefined - ) - }) - - it('drops a record whose repo Orca no longer has', async () => { - vi.spyOn(console, 'warn').mockImplementation(() => {}) - - const { outcome, purged, records } = await finishAfterRestart({ repoGone: true }) - - expect(records).toEqual([]) - expect(outcome).toMatchObject({ status: 'removed' }) - expect(purged).toEqual([]) - expect(existsSync(worktreePath)).toBe(true) - }) }) installRealWorkerThreadChildProcesses() diff --git a/src/main/runtime/workspaces/removal/workspace-removal.ts b/src/main/runtime/workspaces/removal/workspace-removal.ts index 6eb7e60a00b..e71734c87a2 100644 --- a/src/main/runtime/workspaces/removal/workspace-removal.ts +++ b/src/main/runtime/workspaces/removal/workspace-removal.ts @@ -40,6 +40,7 @@ import { assertWslMoveWorkspaceWritable, isWslMoveSourceHost } from '../../../persistence/moving-wsl-projects/quiescence/wsl-move-scope-guard' +import { worktreeHostIdentity } from '../../../persistence/worktree-meta-host-identity' export abstract class OrcaRuntimeWithRemoveManagedWorktree extends RuntimeWorkspaceMetadata { abstract removeWorktreeMetadataAndHistory( @@ -96,21 +97,19 @@ export abstract class OrcaRuntimeWithRemoveManagedWorktree extends RuntimeWorksp await waitForWorktreeRemovalAcceptance(removalTarget.id, cleanupHostId) return options.waitForBackgroundRemoval ? await pending : { removing: true } } - const emitRemoved = (): void => - this.emitWorktreeLifecycle({ - kind: 'removed', - worktreeId: removalTarget.id, - path: removalTarget.path - }) - const { id: worktreeId } = removalTarget - const cleanupScopeKey = preservedBranchCleanupScopeKey({ worktreeId, hostId: cleanupHostId }) - const optionsKey = getRuntimeWorktreeRemovalOptionsKey({ - force, - runHooks, - allowUnverifiedPtyStop, - allowFailedArchiveHook, - deleteBranch: options.deleteBranch + // Identity read now: the purge drops the row before listeners hear `removed`. + const removed = { + kind: 'removed' as const, + worktreeId: removalTarget.id, + path: removalTarget.path, + ...worktreeHostIdentity(store, removalTarget.id, fenceHostId) + } + const emitRemoved = (): void => this.emitWorktreeLifecycle(removed) + const cleanupScopeKey = preservedBranchCleanupScopeKey({ + worktreeId: removalTarget.id, + hostId: cleanupHostId }) + const optionsKey = getRuntimeWorktreeRemovalOptionsKey(options) const inFlightRemoval = this.removeManagedWorktreeInFlight.get( cleanupScopeKey, removalTarget.id, diff --git a/src/main/runtime/workspaces/workspace-removal-target.ts b/src/main/runtime/workspaces/workspace-removal-target.ts index 3c01b337197..7d5a5369b46 100644 --- a/src/main/runtime/workspaces/workspace-removal-target.ts +++ b/src/main/runtime/workspaces/workspace-removal-target.ts @@ -37,6 +37,7 @@ import { retryFailedRemovalUnlessRegistered } from '../../workspaces/removal/wor import type { GitWorktreeInfo } from '../../../shared/worktree/types' import { removeWorktreeMetaRow } from '../../persistence/host-qualified-worktree-meta' import { RuntimeAgentLaunchPreparation } from '../terminal/launch/runtime-agent-launch-preparation' +import { worktreeHostIdentity } from '../../persistence/worktree-meta-host-identity' export abstract class OrcaRuntimeWithResolveWorktreeRemovalTarget extends RuntimeAgentLaunchPreparation { protected abstract resolveExplicitWorktreeIdScoped( @@ -117,15 +118,25 @@ export abstract class OrcaRuntimeWithResolveWorktreeRemovalTarget extends Runtim } protected localRemovalJobHost(store: RuntimeStore) { + // `removed` is heard after the purge drops the row, so its identity is read first. + const purgedIdentities = new Map>() return { store, acquireWatcherRemoval: this.acquireFileWatcherRemoval, closeWatchers: (path) => this.closeFileWatchersForRemoval(path), preservedBranchCleanup: this.preservedBranchCleanup, - purge: ({ worktreeId, repoId }) => - this.purgeRemovedWorktree(store, worktreeId, repoId, LOCAL_EXECUTION_HOST_ID), - onRemoved: ({ worktreeId, worktreePath }) => - this.emitWorktreeLifecycle({ kind: 'removed', worktreeId, path: worktreePath }), + purge: ({ worktreeId, repoId }) => { + purgedIdentities.set( + worktreeId, + worktreeHostIdentity(store, worktreeId, LOCAL_EXECUTION_HOST_ID) + ) + return this.purgeRemovedWorktree(store, worktreeId, repoId, LOCAL_EXECUTION_HOST_ID) + }, + onRemoved: ({ worktreeId, worktreePath }) => { + const identity = purgedIdentities.get(worktreeId) + purgedIdentities.delete(worktreeId) + this.emitWorktreeLifecycle({ kind: 'removed', worktreeId, path: worktreePath, ...identity }) + }, publish: (repoId) => this.publishWorktreeRemovalChange(repoId) } } diff --git a/src/main/skills/install/skill-installation.test.ts b/src/main/skills/install/skill-installation.test.ts index 4390dd339b9..43886af7c4e 100644 --- a/src/main/skills/install/skill-installation.test.ts +++ b/src/main/skills/install/skill-installation.test.ts @@ -27,24 +27,6 @@ describe('skill install service', () => { expect(await readFile(join(claude, 'SKILL.md'), 'utf8')).toBe('unowned') }) - it('removes an owned placement when its provider is deselected', async () => { - const { root, input } = await createSkillInstallHome() - await installSharedSkill(input) - const claude = join(root, 'home', '.claude', 'skills', 'test-skill') - - const updated = await installSharedSkill({ - ...input, - operationId: 'operation_without_claude', - detectedProviders: ['codex'] - }) - - expect(updated.status).toBe('unchanged') - await expect(lstat(claude)).rejects.toMatchObject({ code: 'ENOENT' }) - expect(updated.placements).toEqual([ - expect.objectContaining({ provider: 'agent-skills', topology: 'canonical-copy' }) - ]) - }) - it('preserves the committed canonical install when cancellation reaches provider placement', async () => { const { root, input } = await createSkillInstallHome() const controller = new AbortController() diff --git a/src/main/source-control/forge-provider.ts b/src/main/source-control/forge-provider.ts index cf4f4b9ba1a..46ed21b53f7 100644 --- a/src/main/source-control/forge-provider.ts +++ b/src/main/source-control/forge-provider.ts @@ -23,12 +23,10 @@ import { getGiteaRepoSlug } from '../gitea/client' import { createGiteaPullRequest } from '../gitea/pull-request-creation' -import { - createGitHubPullRequest, - getGitHubPRLookupRateLimitBlock, - getPRForBranchOutcome, - getRepoSlug -} from '../github/client' +import { createGitHubPullRequest } from '../github/client/create/create-github-pull-request' +import { getGitHubPRLookupRateLimitBlock } from '../github/client/lookup/pr-lookup-rate-limit' +import { getPRForBranchOutcome } from '../github/client/lookup/pr-for-branch-outcome' +import { getRepoSlug } from '../github/client/fetch/repo-slug-upstream' import { getMergeRequest, getMergeRequestForBranchOrThrow, diff --git a/src/main/source-control/forge-review-mappers.ts b/src/main/source-control/forge-review-mappers.ts index 7a3cede98a7..be4598a8070 100644 --- a/src/main/source-control/forge-review-mappers.ts +++ b/src/main/source-control/forge-review-mappers.ts @@ -1,6 +1,6 @@ import type { HostedReviewInfo } from '../../shared/source-control/hosted-review/hosted-review-contracts' import { hostedReviewInfoFromGitHubPRInfo } from '../../shared/source-control/hosted-review/hosted-review-github' -import type { PRInfo } from '../../shared/github/pull-request-types' +import type { PRInfo } from '../../shared/github/pull-requests/pull-request-types' import type { MRInfo } from '../../shared/gitlab-types' import type { AzureDevOpsPullRequestInfo } from '../azure-devops/pull-request-mappers' import type { BitbucketPullRequestInfo } from '../bitbucket/pull-request-mappers' diff --git a/src/main/source-control/hosted-review-base-ref-suffix.test.ts b/src/main/source-control/hosted-review-base-ref-suffix.test.ts index 7de6024d0da..d07f256ac84 100644 --- a/src/main/source-control/hosted-review-base-ref-suffix.test.ts +++ b/src/main/source-control/hosted-review-base-ref-suffix.test.ts @@ -4,7 +4,8 @@ const { gitExecFileAsyncMock } = vi.hoisted(() => ({ gitExecFileAsyncMock: vi.fn() })) -vi.mock('../github/gh-utils', () => ({ +vi.mock('../git/command-runner/git-exec-file', async (importOriginal) => ({ + ...(await importOriginal>()), gitExecFileAsync: gitExecFileAsyncMock })) diff --git a/src/main/source-control/hosted-review-branch-cache.test.ts b/src/main/source-control/hosted-review-branch-cache.test.ts index e833fa2dfca..7058e91a3e0 100644 --- a/src/main/source-control/hosted-review-branch-cache.test.ts +++ b/src/main/source-control/hosted-review-branch-cache.test.ts @@ -2,16 +2,11 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { HostedReviewInfo } from '../../shared/source-control/hosted-review/hosted-review-contracts' import { __resetHostedReviewBranchCacheForTests, - invalidateHostedReviewBranchCache, withHostedReviewBranchCache } from './hosted-review-branch-cache' import { HOSTED_REVIEW_LOOKUP_DEADLINE_MS, LOOKUP_BACKOFF_MAX_MS, - MAX_BRANCH_MAP_ENTRIES, - MAX_DETACHED_LOOKUPS, - MAX_INFLIGHT_LOOKUPS, - MAX_UNSETTLED_LOOKUP_KEYS, MAX_UNSETTLED_LOOKUPS_PER_KEY } from './hosted-review-refresh-pacing' @@ -31,29 +26,6 @@ function stuckLookup() { return { lookup, resolve: (review) => resolve(review), reject: (error) => reject(error) } } -/** Evict by size alone, leaving an untimed-out straggler behind a replacement owner. */ -function evictInflightRecord(evictedLookup: () => Promise) { - const swallow = (promise: Promise): void => { - void promise.catch(() => {}) - } - swallow(withHostedReviewBranchCache(identity, { headOid: null }, evictedLookup)) - - const filler = stuckLookup() - for (let index = 0; index < MAX_INFLIGHT_LOOKUPS; index += 1) { - swallow( - withHostedReviewBranchCache( - { ...identity, branch: `feature/${index}` }, - { headOid: null }, - filler.lookup - ) - ) - } - - const successor = stuckLookup() - const request = withHostedReviewBranchCache(identity, { headOid: null }, successor.lookup) - return { request, resolve: successor.resolve, reject: successor.reject } -} - const openReview: HostedReviewInfo = { provider: 'github', number: 7, @@ -78,341 +50,7 @@ describe('hosted review branch cache (#11532)', () => { vi.useRealTimers() }) - it('bypasses a merged result for an explicit refresh', async () => { - const lookup = vi.fn(async () => mergedReview) - await withHostedReviewBranchCache(identity, { headOid: 'aaa' }, lookup) - lookup.mockResolvedValue(openReview) - await expect( - withHostedReviewBranchCache(identity, { headOid: 'aaa', force: true }, lookup) - ).resolves.toEqual(openReview) - expect(lookup).toHaveBeenCalledTimes(2) - }) - - it('collapses concurrent callers onto one lookup', async () => { - let resolveLookup: (value: HostedReviewInfo | null) => void = () => {} - const lookup = vi.fn( - () => - new Promise((resolve) => { - resolveLookup = resolve - }) - ) - - const first = withHostedReviewBranchCache(identity, { headOid: null }, lookup) - const second = withHostedReviewBranchCache(identity, { headOid: null }, lookup) - resolveLookup(openReview) - - await expect(first).resolves.toEqual(openReview) - await expect(second).resolves.toEqual(openReview) - expect(lookup).toHaveBeenCalledTimes(1) - }) - - it('separates lookups that differ only by linked review number', async () => { - const lookup = vi.fn(async () => null) - - await withHostedReviewBranchCache({ ...identity, linkedGitHubPR: 1 }, { headOid: null }, lookup) - await withHostedReviewBranchCache({ ...identity, linkedGitHubPR: 2 }, { headOid: null }, lookup) - - expect(lookup).toHaveBeenCalledTimes(2) - }) - - it('backs a failing branch off instead of re-asking every poll', async () => { - const lookup = vi.fn(async () => { - throw new Error('rate limited') - }) - - await expect(withHostedReviewBranchCache(identity, { headOid: null }, lookup)).rejects.toThrow( - 'rate limited' - ) - vi.setSystemTime(1_000_000 + 30_000) - await expect(withHostedReviewBranchCache(identity, { headOid: null }, lookup)).rejects.toThrow( - /backing off/ - ) - expect(lookup).toHaveBeenCalledTimes(1) - - vi.setSystemTime(1_000_000 + 60_001) - await expect(withHostedReviewBranchCache(identity, { headOid: null }, lookup)).rejects.toThrow( - 'rate limited' - ) - expect(lookup).toHaveBeenCalledTimes(2) - - vi.setSystemTime(1_000_000 + 60_001 + 60_000) - await expect(withHostedReviewBranchCache(identity, { headOid: null }, lookup)).rejects.toThrow( - /backing off/ - ) - expect(lookup).toHaveBeenCalledTimes(2) - }) - - it('serves the last known review from the failure itself, not only the backoff', async () => { - const lookup = vi - .fn<() => Promise>() - .mockResolvedValueOnce(openReview) - .mockRejectedValueOnce(new Error('transient')) - - await withHostedReviewBranchCache(identity, { headOid: null }, lookup) - vi.setSystemTime(1_000_000 + 60_001) - await expect(withHostedReviewBranchCache(identity, { headOid: null }, lookup)).resolves.toEqual( - openReview - ) - - vi.setSystemTime(1_000_000 + 60_001 + 1_000) - await expect(withHostedReviewBranchCache(identity, { headOid: null }, lookup)).resolves.toEqual( - openReview - ) - expect(lookup).toHaveBeenCalledTimes(2) - }) - - it('resets the escalation once a lookup succeeds', async () => { - const lookup = vi - .fn<() => Promise>() - .mockRejectedValueOnce(new Error('first')) - .mockResolvedValueOnce(openReview) - .mockRejectedValueOnce(new Error('second')) - .mockResolvedValue(mergedReview) - - await expect(withHostedReviewBranchCache(identity, { headOid: null }, lookup)).rejects.toThrow( - 'first' - ) - vi.setSystemTime(1_000_000 + 60_001) - await expect(withHostedReviewBranchCache(identity, { headOid: null }, lookup)).resolves.toEqual( - openReview - ) - - // Success resets escalation; the next failed refresh starts at base even when serving stale data. - vi.setSystemTime(1_000_000 + 2 * 60_001) - await expect(withHostedReviewBranchCache(identity, { headOid: null }, lookup)).resolves.toEqual( - openReview - ) - vi.setSystemTime(1_000_000 + 3 * 60_001) - await expect(withHostedReviewBranchCache(identity, { headOid: null }, lookup)).resolves.toEqual( - mergedReview - ) - expect(lookup).toHaveBeenCalledTimes(4) - }) - - it('retires a cached no-review answer when Orca opens a review', async () => { - const lookup = vi - .fn<() => Promise>() - .mockResolvedValueOnce(null) - .mockResolvedValueOnce(openReview) - - await withHostedReviewBranchCache(identity, { headOid: null }, lookup) - invalidateHostedReviewBranchCache('/repo', 'local') - - await expect(withHostedReviewBranchCache(identity, { headOid: null }, lookup)).resolves.toEqual( - openReview - ) - expect(lookup).toHaveBeenCalledTimes(2) - }) - - it('discards a lookup that was already in flight when Orca opened a review', async () => { - let resolveLookup: (value: HostedReviewInfo | null) => void = () => {} - const lookup = vi - .fn<() => Promise>() - .mockImplementationOnce( - () => - new Promise((resolve) => { - resolveLookup = resolve - }) - ) - .mockResolvedValue(openReview) - - const inflight = withHostedReviewBranchCache(identity, { headOid: null }, lookup) - invalidateHostedReviewBranchCache('/repo', 'local') - // Creation invalidation outranks this pre-review lookup's stale null. - resolveLookup(null) - await expect(inflight).resolves.toBeNull() - - await expect(withHostedReviewBranchCache(identity, { headOid: null }, lookup)).resolves.toEqual( - openReview - ) - expect(lookup).toHaveBeenCalledTimes(2) - }) - - it('leaves another repo in-flight lookup cacheable across an invalidation', async () => { - let resolveLookup: (value: HostedReviewInfo | null) => void = () => {} - const other = { ...identity, repoPath: '/other' } - const lookup = vi.fn<() => Promise>().mockImplementationOnce( - () => - new Promise((resolve) => { - resolveLookup = resolve - }) - ) - - const inflight = withHostedReviewBranchCache(other, { headOid: null }, lookup) - invalidateHostedReviewBranchCache('/repo', 'local') - resolveLookup(null) - await inflight - - await withHostedReviewBranchCache(other, { headOid: null }, lookup) - expect(lookup).toHaveBeenCalledTimes(1) - }) - - it('scopes invalidation to one repo', async () => { - const lookup = vi.fn(async () => null) - - await withHostedReviewBranchCache(identity, { headOid: null }, lookup) - await withHostedReviewBranchCache( - { ...identity, repoPath: '/other' }, - { headOid: null }, - lookup - ) - expect(lookup).toHaveBeenCalledTimes(2) - - invalidateHostedReviewBranchCache('/other', 'local') - - await withHostedReviewBranchCache(identity, { headOid: null }, lookup) - expect(lookup).toHaveBeenCalledTimes(2) - await withHostedReviewBranchCache( - { ...identity, repoPath: '/other' }, - { headOid: null }, - lookup - ) - expect(lookup).toHaveBeenCalledTimes(3) - }) - - it('keeps SSH and local repos with the same path apart', async () => { - const lookup = vi.fn(async () => null) - - await withHostedReviewBranchCache(identity, { headOid: null }, lookup) - await withHostedReviewBranchCache( - { ...identity, executionHostId: 'ssh:ssh-1' as const }, - { headOid: null }, - lookup - ) - - expect(lookup).toHaveBeenCalledTimes(2) - }) - - describe('selected-worktree tier', () => { - it('caps the fast tier so a caller cannot promote a whole list', async () => { - const lookup = vi.fn(async () => null) - const branchAt = (index: number) => ({ ...identity, branch: `feature/${index}` }) - - for (let index = 0; index <= 8; index += 1) { - await withHostedReviewBranchCache(branchAt(index), { headOid: null, active: true }, lookup) - } - expect(lookup).toHaveBeenCalledTimes(9) - - vi.setSystemTime(1_000_000 + 60_001) - await withHostedReviewBranchCache(branchAt(0), { headOid: null }, lookup) - expect(lookup).toHaveBeenCalledTimes(9) - await withHostedReviewBranchCache(branchAt(8), { headOid: null }, lookup) - expect(lookup).toHaveBeenCalledTimes(10) - }) - }) - describe('in-flight deadline (P1-D)', () => { - it('releases a stuck lookup at the deadline instead of pinning the branch', async () => { - const { lookup } = stuckLookup() - - const request = withHostedReviewBranchCache(identity, { headOid: null }, lookup) - const rejects = expect(request).rejects.toThrow(/timed out/) - await vi.advanceTimersByTimeAsync(HOSTED_REVIEW_LOOKUP_DEADLINE_MS) - await rejects - - await expect( - withHostedReviewBranchCache(identity, { headOid: null }, lookup) - ).rejects.toThrow(/backing off/) - expect(lookup).toHaveBeenCalledTimes(1) - }) - - it('lets a later poll succeed after a lookup times out', async () => { - const { lookup } = stuckLookup() - - const rejects = expect( - withHostedReviewBranchCache(identity, { headOid: null }, lookup) - ).rejects.toThrow(/timed out/) - await vi.advanceTimersByTimeAsync(HOSTED_REVIEW_LOOKUP_DEADLINE_MS) - await rejects - - await vi.advanceTimersByTimeAsync(60_001) - const recovered = vi.fn(async () => openReview) - await expect( - withHostedReviewBranchCache(identity, { headOid: null }, recovered) - ).resolves.toEqual(openReview) - expect(recovered).toHaveBeenCalledTimes(1) - }) - - it('keeps the last known review when a refresh times out', async () => { - await withHostedReviewBranchCache(identity, { headOid: null }, async () => openReview) - vi.setSystemTime(START + 60_001) - - const { lookup } = stuckLookup() - const request = withHostedReviewBranchCache(identity, { headOid: null }, lookup) - await vi.advanceTimersByTimeAsync(HOSTED_REVIEW_LOOKUP_DEADLINE_MS) - - await expect(request).resolves.toEqual(openReview) - }) - - it('adopts a lookup that lands after its deadline', async () => { - const { lookup, resolve } = stuckLookup() - - const rejects = expect( - withHostedReviewBranchCache(identity, { headOid: null }, lookup) - ).rejects.toThrow(/timed out/) - await vi.advanceTimersByTimeAsync(HOSTED_REVIEW_LOOKUP_DEADLINE_MS) - await rejects - - resolve(openReview) - await vi.advanceTimersByTimeAsync(0) - - // Late answers still spent quota; adopt them when safe so slow hosts can converge. - const next = vi.fn(async () => null) - await expect(withHostedReviewBranchCache(identity, { headOid: null }, next)).resolves.toEqual( - openReview - ) - expect(next).not.toHaveBeenCalled() - }) - - it('keeps escalating when a lookup only ever answers past its deadline', async () => { - const first = stuckLookup() - const firstRejects = expect( - withHostedReviewBranchCache(identity, { headOid: null }, first.lookup) - ).rejects.toThrow(/timed out/) - await vi.advanceTimersByTimeAsync(HOSTED_REVIEW_LOOKUP_DEADLINE_MS) - await firstRejects - - // A second timeout backs off longer than found-review TTL, exposing escalation. - await vi.advanceTimersByTimeAsync(60_001) - const second = stuckLookup() - const secondRejects = expect( - withHostedReviewBranchCache(identity, { headOid: null }, second.lookup) - ).rejects.toThrow(/timed out/) - await vi.advanceTimersByTimeAsync(HOSTED_REVIEW_LOOKUP_DEADLINE_MS) - await secondRejects - - second.resolve(openReview) - await vi.advanceTimersByTimeAsync(0) - - // Adopt safe late data without treating missed deadlines as provider recovery. - await vi.advanceTimersByTimeAsync(60_001) - const recovered = vi.fn(async () => mergedReview) - await expect( - withHostedReviewBranchCache(identity, { headOid: null }, recovered) - ).resolves.toEqual(openReview) - expect(recovered).not.toHaveBeenCalled() - }) - - it('does not let a timed-out null wipe the open review it was refreshing', async () => { - await withHostedReviewBranchCache(identity, { headOid: null }, async () => openReview) - await vi.advanceTimersByTimeAsync(60_001) - - const stale = stuckLookup() - const request = withHostedReviewBranchCache(identity, { headOid: null }, stale.lookup) - await vi.advanceTimersByTimeAsync(HOSTED_REVIEW_LOOKUP_DEADLINE_MS) - await expect(request).resolves.toEqual(openReview) - - stale.resolve(null) - await vi.advanceTimersByTimeAsync(0) - - // A timed-out refresh must not replace its served answer with a long-lived null. - const next = vi.fn(async () => openReview) - await expect(withHostedReviewBranchCache(identity, { headOid: null }, next)).resolves.toEqual( - openReview - ) - expect(next).not.toHaveBeenCalled() - }) - it('does not let a timed-out null short-circuit the lookup replacing it', async () => { const stale = stuckLookup() const rejects = expect( @@ -437,109 +75,6 @@ describe('hosted review branch cache (#11532)', () => { expect(joiner).not.toHaveBeenCalled() }) - it('lets a newer straggler supersede an older one that landed first', async () => { - const first = stuckLookup() - const firstRejects = expect( - withHostedReviewBranchCache(identity, { headOid: null }, first.lookup) - ).rejects.toThrow(/timed out/) - await vi.advanceTimersByTimeAsync(HOSTED_REVIEW_LOOKUP_DEADLINE_MS) - await firstRejects - - await vi.advanceTimersByTimeAsync(60_001) - const second = stuckLookup() - const secondRejects = expect( - withHostedReviewBranchCache(identity, { headOid: null }, second.lookup) - ).rejects.toThrow(/timed out/) - await vi.advanceTimersByTimeAsync(HOSTED_REVIEW_LOOKUP_DEADLINE_MS) - await secondRejects - - // Completion order cannot establish freshness; lookup start order does. - first.resolve(null) - await vi.advanceTimersByTimeAsync(0) - second.resolve(openReview) - await vi.advanceTimersByTimeAsync(0) - - const next = vi.fn(async () => null) - await expect(withHostedReviewBranchCache(identity, { headOid: null }, next)).resolves.toEqual( - openReview - ) - expect(next).not.toHaveBeenCalled() - }) - - it('does not let an older straggler overwrite a newer one that landed first', async () => { - const first = stuckLookup() - const firstRejects = expect( - withHostedReviewBranchCache(identity, { headOid: null }, first.lookup) - ).rejects.toThrow(/timed out/) - await vi.advanceTimersByTimeAsync(HOSTED_REVIEW_LOOKUP_DEADLINE_MS) - await firstRejects - - await vi.advanceTimersByTimeAsync(60_001) - const second = stuckLookup() - const secondRejects = expect( - withHostedReviewBranchCache(identity, { headOid: null }, second.lookup) - ).rejects.toThrow(/timed out/) - await vi.advanceTimersByTimeAsync(HOSTED_REVIEW_LOOKUP_DEADLINE_MS) - await secondRejects - - // Even when both detach, retain the answer asked most recently. - second.resolve(openReview) - await vi.advanceTimersByTimeAsync(0) - first.resolve(null) - await vi.advanceTimersByTimeAsync(0) - - const next = vi.fn(async () => null) - await expect(withHostedReviewBranchCache(identity, { headOid: null }, next)).resolves.toEqual( - openReview - ) - expect(next).not.toHaveBeenCalled() - }) - - it('does not let a straggler overwrite an answer newer than itself', async () => { - const stale = stuckLookup() - const rejects = expect( - withHostedReviewBranchCache(identity, { headOid: null }, stale.lookup) - ).rejects.toThrow(/timed out/) - await vi.advanceTimersByTimeAsync(HOSTED_REVIEW_LOOKUP_DEADLINE_MS) - await rejects - - await vi.advanceTimersByTimeAsync(60_001) - await withHostedReviewBranchCache(identity, { headOid: null }, async () => mergedReview) - - stale.resolve(openReview) - await vi.advanceTimersByTimeAsync(0) - - const next = vi.fn(async () => null) - await expect(withHostedReviewBranchCache(identity, { headOid: null }, next)).resolves.toEqual( - mergedReview - ) - expect(next).not.toHaveBeenCalled() - }) - - it('does not let a straggler evict the lookup that replaced it', async () => { - const stale = stuckLookup() - const rejects = expect( - withHostedReviewBranchCache(identity, { headOid: null }, stale.lookup) - ).rejects.toThrow(/timed out/) - await vi.advanceTimersByTimeAsync(HOSTED_REVIEW_LOOKUP_DEADLINE_MS) - await rejects - - await vi.advanceTimersByTimeAsync(60_001) - const replacement = stuckLookup() - const first = withHostedReviewBranchCache(identity, { headOid: null }, replacement.lookup) - - // A straggler must clear only its own record or the next reader starts a duplicate call. - stale.reject(new Error('late failure')) - await vi.advanceTimersByTimeAsync(0) - - const second = withHostedReviewBranchCache(identity, { headOid: null }, replacement.lookup) - replacement.resolve(openReview) - - await expect(first).resolves.toEqual(openReview) - await expect(second).resolves.toEqual(openReview) - expect(replacement.lookup).toHaveBeenCalledTimes(1) - }) - it('releases a caller by wall clock when the deadline timer never fires', async () => { const { lookup } = stuckLookup() @@ -555,63 +90,6 @@ describe('hosted review branch cache (#11532)', () => { expect(lookup).toHaveBeenCalledTimes(1) }) - it('bounds the in-flight map independently of the completed cache', async () => { - const { lookup } = stuckLookup() - const branchAt = (index: number) => ({ ...identity, branch: `feature/${index}` }) - const swallow = (promise: Promise): void => { - void promise.catch(() => {}) - } - - for (let index = 0; index <= MAX_INFLIGHT_LOOKUPS; index += 1) { - swallow(withHostedReviewBranchCache(branchAt(index), { headOid: null }, lookup)) - } - expect(lookup).toHaveBeenCalledTimes(MAX_INFLIGHT_LOOKUPS + 1) - - swallow(withHostedReviewBranchCache(branchAt(0), { headOid: null }, lookup)) - expect(lookup).toHaveBeenCalledTimes(MAX_INFLIGHT_LOOKUPS + 2) - - swallow( - withHostedReviewBranchCache(branchAt(MAX_INFLIGHT_LOOKUPS), { headOid: null }, lookup) - ) - expect(lookup).toHaveBeenCalledTimes(MAX_INFLIGHT_LOOKUPS + 2) - }) - - it('does not let a cap-evicted straggler clobber the answer that replaced it', async () => { - const evicted = stuckLookup() - const successor = evictInflightRecord(evicted.lookup) - - // Size eviction alone creates a straggler; it must not displace its successor. - evicted.resolve(mergedReview) - await vi.advanceTimersByTimeAsync(0) - - const joiner = vi.fn(async () => null) - const joined = withHostedReviewBranchCache(identity, { headOid: null }, joiner) - - successor.resolve(openReview) - await expect(successor.request).resolves.toEqual(openReview) - await expect(joined).resolves.toEqual(openReview) - expect(joiner).not.toHaveBeenCalled() - }) - - it('does not let a cap-evicted straggler double-count its successor failure', async () => { - const evicted = stuckLookup() - const successor = evictInflightRecord(evicted.lookup) - - evicted.reject(new Error('late failure')) - await vi.advanceTimersByTimeAsync(0) - - successor.reject(new Error('successor failure')) - await expect(successor.request).rejects.toThrow('successor failure') - - // Late rejection must not count a second backoff failure. - await vi.advanceTimersByTimeAsync(60_001) - const recovered = vi.fn(async () => openReview) - await expect( - withHostedReviewBranchCache(identity, { headOid: null }, recovered) - ).resolves.toEqual(openReview) - expect(recovered).toHaveBeenCalledTimes(1) - }) - it('stops asking once a branch has stranded its cap of unsettled lookups', async () => { const wedged = stuckLookup() for (let attempt = 0; attempt < MAX_UNSETTLED_LOOKUPS_PER_KEY; attempt += 1) { @@ -638,117 +116,5 @@ describe('hosted review branch cache (#11532)', () => { ).resolves.toEqual(mergedReview) expect(recovered).toHaveBeenCalledTimes(1) }) - - it('counts a lookup that is still running against the branch cap', async () => { - const swallow = (promise: Promise): void => { - void promise.catch(() => {}) - } - const filler = stuckLookup() - const wedged = stuckLookup() - /** Evict without timeout; reuse filler keys so the in-flight cap fires before unsettled-key admission. */ - const evictInflightRecords = (): void => { - for (let index = 0; index < MAX_INFLIGHT_LOOKUPS; index += 1) { - swallow( - withHostedReviewBranchCache( - { ...identity, branch: `filler/${index}` }, - { headOid: null }, - filler.lookup - ) - ) - } - } - - for (let attempt = 0; attempt < MAX_UNSETTLED_LOOKUPS_PER_KEY; attempt += 1) { - swallow(withHostedReviewBranchCache(identity, { headOid: null }, wedged.lookup)) - evictInflightRecords() - } - expect(wedged.lookup).toHaveBeenCalledTimes(MAX_UNSETTLED_LOOKUPS_PER_KEY) - - // Size-evicted calls are still live before their deadlines; admission must count them. - await expect( - withHostedReviewBranchCache(identity, { headOid: null }, wedged.lookup) - ).rejects.toThrow(/never answered/) - expect(wedged.lookup).toHaveBeenCalledTimes(MAX_UNSETTLED_LOOKUPS_PER_KEY) - }) - - it('stops admitting new branches once the unsettled map is full', async () => { - const swallow = (promise: Promise): void => { - void promise.catch(() => {}) - } - const filler = stuckLookup() - for (let index = 0; index < MAX_UNSETTLED_LOOKUP_KEYS; index += 1) { - swallow( - withHostedReviewBranchCache( - { ...identity, branch: `filler/${index}` }, - { headOid: null }, - filler.lookup - ) - ) - } - expect(filler.lookup).toHaveBeenCalledTimes(MAX_UNSETTLED_LOOKUP_KEYS) - - // Bound new keys before deadline detachment; fresh branches must not be blamed for a lookup they never started. - const fresh = vi.fn(async () => openReview) - const refusal = await withHostedReviewBranchCache( - { ...identity, branch: 'fresh' }, - { headOid: null }, - fresh - ).catch((error: unknown) => (error as Error).message) - expect(refusal).toMatch(/Too many hosted review lookups are already in progress/) - expect(refusal).not.toMatch(/never answered/) - expect(fresh).not.toHaveBeenCalled() - - // The map cap blocks new keys, not recovery retries for existing ones. - const retry = stuckLookup() - swallow( - withHostedReviewBranchCache( - { ...identity, branch: 'filler/0' }, - { headOid: null }, - retry.lookup - ) - ) - expect(retry.lookup).toHaveBeenCalledTimes(1) - }) - - it('names the process-wide cap when abandoned lookups have filled it', async () => { - const wedged = stuckLookup() - for (let index = 0; index < MAX_DETACHED_LOOKUPS; index += 1) { - void withHostedReviewBranchCache( - { ...identity, branch: `wedged/${index}` }, - { headOid: null }, - wedged.lookup - ).catch(() => {}) - } - await vi.advanceTimersByTimeAsync(HOSTED_REVIEW_LOOKUP_DEADLINE_MS) - - const fresh = vi.fn(async () => openReview) - const refusal = await withHostedReviewBranchCache( - { ...identity, branch: 'fresh' }, - { headOid: null }, - fresh - ).catch((error: unknown) => (error as Error).message) - expect(refusal).toMatch(/abandoned without answering/) - expect(fresh).not.toHaveBeenCalled() - }) - - it('does not adopt a straggler whose invalidated scope was evicted', async () => { - const stale = stuckLookup() - const inflight = withHostedReviewBranchCache(identity, { headOid: null }, stale.lookup) - - invalidateHostedReviewBranchCache('/repo', 'local') - // After generation-map eviction, zero would alias an invalidated lookup's captured generation. - for (let index = 0; index < MAX_BRANCH_MAP_ENTRIES; index += 1) { - invalidateHostedReviewBranchCache(`/filler/${index}`, 'local') - } - - stale.resolve(null) - await expect(inflight).resolves.toBeNull() - - const next = vi.fn(async () => openReview) - await expect(withHostedReviewBranchCache(identity, { headOid: null }, next)).resolves.toEqual( - openReview - ) - expect(next).toHaveBeenCalledTimes(1) - }) }) }) diff --git a/src/main/source-control/hosted-review-creation-eligibility.test.ts b/src/main/source-control/hosted-review-creation-eligibility.test.ts index e672df3c077..ce8bdcb15fe 100644 --- a/src/main/source-control/hosted-review-creation-eligibility.test.ts +++ b/src/main/source-control/hosted-review-creation-eligibility.test.ts @@ -38,13 +38,19 @@ const { getEnterpriseGitHubRepoSlugMock: vi.fn() })) -vi.mock('../github/client', () => ({ - createGitHubPullRequest: createGitHubPullRequestMock, - getRepoSlug: getRepoSlugMock, +vi.mock('../github/client/create/create-github-pull-request', () => ({ + createGitHubPullRequest: createGitHubPullRequestMock +})) + +vi.mock('../github/client/fetch/repo-slug-upstream', () => ({ + getRepoSlug: getRepoSlugMock +})) + +vi.mock('../github/client/lookup/get-pr-for-branch', () => ({ getPRForBranch: vi.fn() })) -vi.mock('../github/github-enterprise-repository', () => ({ +vi.mock('../github/repositories/github-enterprise-repository', () => ({ getEnterpriseGitHubRepoSlug: getEnterpriseGitHubRepoSlugMock })) @@ -86,10 +92,17 @@ vi.mock('../gitea/pull-request-creation', () => ({ isGiteaReviewCreationAuthenticated: isGiteaReviewCreationAuthenticatedMock })) -vi.mock('../github/gh-utils', () => ({ +vi.mock('../github/execution/github-operation-slots', () => ({ acquire: vi.fn(), - release: vi.fn(), - ghExecFileAsync: ghExecFileAsyncMock, + release: vi.fn() +})) + +vi.mock('../git/command-runner/hosted-cli/gh-exec-file', () => ({ + ghExecFileAsync: ghExecFileAsyncMock +})) + +vi.mock('../git/command-runner/git-exec-file', async (importOriginal) => ({ + ...(await importOriginal>()), gitExecFileAsync: gitExecFileAsyncMock })) @@ -116,7 +129,7 @@ vi.mock('./hosted-review', () => ({ import { createHostedReview, getHostedReviewCreationEligibility } from './hosted-review-creation' import { baseRefExistsOnRemote } from './hosted-review-creation-git-state' -import { _resetOriginGitHubApiRepositoryCache } from '../github/github-api-repository' +import { _resetOriginGitHubApiRepositoryCache } from '../github/repositories/github-api-repository-remote-probe' const LOCAL_REPO_ARGS = { executionHostId: 'local' as const, repoPath: '/repo' } diff --git a/src/main/source-control/hosted-review-creation-git-state.ts b/src/main/source-control/hosted-review-creation-git-state.ts index 57d32686ca1..c00cddeba72 100644 --- a/src/main/source-control/hosted-review-creation-git-state.ts +++ b/src/main/source-control/hosted-review-creation-git-state.ts @@ -5,7 +5,7 @@ import { } from '../../shared/source-control/hosted-review/hosted-review-refs' import { isSafeGitRefName } from '../../shared/git/status/git-status-upstream-ref' import type { GitUpstreamStatus } from '../../shared/git/status/git-status-types' -import { gitExecFileAsync } from '../github/gh-utils' +import { gitExecFileAsync } from '../git/command-runner/git-exec-file' import { isShowRefNoMatchError } from '../../shared/git/refs/git-show-ref-no-match' import { probeExactRefsViaForEachRef } from '../git/refs/resolution/exact-ref-probe' import { gitOptionalLocksDisabledEnv } from '../git/command-runner/git-environment/git-process-env' diff --git a/src/main/source-control/hosted-review-creation-gitlab-self-hosted.test.ts b/src/main/source-control/hosted-review-creation-gitlab-self-hosted.test.ts index 00ae0c91879..d6da312b510 100644 --- a/src/main/source-control/hosted-review-creation-gitlab-self-hosted.test.ts +++ b/src/main/source-control/hosted-review-creation-gitlab-self-hosted.test.ts @@ -35,9 +35,15 @@ vi.mock('../git/command-runner/hosted-cli/gh-exec-file', async (importOriginal) ghExecFileAsync: ghExecFileAsyncMock })) -vi.mock('../github/client', () => ({ - createGitHubPullRequest: vi.fn(), - getRepoSlug: getRepoSlugMock, +vi.mock('../github/client/create/create-github-pull-request', () => ({ + createGitHubPullRequest: vi.fn() +})) + +vi.mock('../github/client/fetch/repo-slug-upstream', () => ({ + getRepoSlug: getRepoSlugMock +})) + +vi.mock('../github/client/lookup/get-pr-for-branch', () => ({ getPRForBranch: vi.fn() })) diff --git a/src/main/source-control/hosted-review-creation-provider.ts b/src/main/source-control/hosted-review-creation-provider.ts index f54d913b457..caa45a48742 100644 --- a/src/main/source-control/hosted-review-creation-provider.ts +++ b/src/main/source-control/hosted-review-creation-provider.ts @@ -4,8 +4,9 @@ import type { HostedReviewCreationProvider } from '../../shared/source-control/h import { isAzureDevOpsReviewCreationAuthenticated } from '../azure-devops/pull-request-creation' import { isBitbucketReviewCreationAuthenticated } from '../bitbucket/pull-request-creation' import { isGiteaReviewCreationAuthenticated } from '../gitea/pull-request-creation' -import { getEnterpriseGitHubRepoSlug } from '../github/github-enterprise-repository' -import { acquire, ghExecFileAsync, release } from '../github/gh-utils' +import { getEnterpriseGitHubRepoSlug } from '../github/repositories/github-enterprise-repository' +import { acquire, release } from '../github/execution/github-operation-slots' +import { ghExecFileAsync } from '../git/command-runner/hosted-cli/gh-exec-file' import { getProjectSlug } from '../gitlab/merge-requests/merge-request-lookup' import { acquire as acquireGlab, diff --git a/src/main/source-control/hosted-review-creation.test.ts b/src/main/source-control/hosted-review-creation.test.ts index ec8ca06b16e..441add3fa9d 100644 --- a/src/main/source-control/hosted-review-creation.test.ts +++ b/src/main/source-control/hosted-review-creation.test.ts @@ -38,13 +38,19 @@ const { getEnterpriseGitHubRepoSlugMock: vi.fn() })) -vi.mock('../github/client', () => ({ - createGitHubPullRequest: createGitHubPullRequestMock, - getRepoSlug: getRepoSlugMock, +vi.mock('../github/client/create/create-github-pull-request', () => ({ + createGitHubPullRequest: createGitHubPullRequestMock +})) + +vi.mock('../github/client/fetch/repo-slug-upstream', () => ({ + getRepoSlug: getRepoSlugMock +})) + +vi.mock('../github/client/lookup/get-pr-for-branch', () => ({ getPRForBranch: vi.fn() })) -vi.mock('../github/github-enterprise-repository', () => ({ +vi.mock('../github/repositories/github-enterprise-repository', () => ({ getEnterpriseGitHubRepoSlug: getEnterpriseGitHubRepoSlugMock })) @@ -86,10 +92,17 @@ vi.mock('../gitea/pull-request-creation', () => ({ isGiteaReviewCreationAuthenticated: isGiteaReviewCreationAuthenticatedMock })) -vi.mock('../github/gh-utils', () => ({ +vi.mock('../github/execution/github-operation-slots', () => ({ acquire: vi.fn(), - release: vi.fn(), - ghExecFileAsync: ghExecFileAsyncMock, + release: vi.fn() +})) + +vi.mock('../git/command-runner/hosted-cli/gh-exec-file', () => ({ + ghExecFileAsync: ghExecFileAsyncMock +})) + +vi.mock('../git/command-runner/git-exec-file', async (importOriginal) => ({ + ...(await importOriginal>()), gitExecFileAsync: gitExecFileAsyncMock })) @@ -117,7 +130,7 @@ vi.mock('./hosted-review', () => ({ import { createHostedReview } from './hosted-review-creation' -import { _resetOriginGitHubApiRepositoryCache } from '../github/github-api-repository' +import { _resetOriginGitHubApiRepositoryCache } from '../github/repositories/github-api-repository-remote-probe' // Isolate module-level repository identities between tests. beforeEach(() => { diff --git a/src/main/source-control/hosted-review-creation.ts b/src/main/source-control/hosted-review-creation.ts index 07caa8f26b8..ba2bc22a976 100644 --- a/src/main/source-control/hosted-review-creation.ts +++ b/src/main/source-control/hosted-review-creation.ts @@ -8,8 +8,8 @@ import type { } from '../../shared/source-control/hosted-review/hosted-review-contracts' import { supportsHostedReviewCreation } from '../../shared/source-control/hosted-review/hosted-review-creation-providers' import { normalizeHostedReviewBaseRef } from '../../shared/source-control/hosted-review/hosted-review-refs' -import { getRepoSlug } from '../github/client' -import { isDefaultGitHubHost } from '../../shared/github/repository-identity-key' +import { getRepoSlug } from '../github/client/fetch/repo-slug-upstream' +import { isDefaultGitHubHost } from '../../shared/github/repositories/repository-identity-key' import { detectHostedReviewProvider, getForgeProviderForRepository diff --git a/src/main/source-control/hosted-review-execution-host-routing.test.ts b/src/main/source-control/hosted-review-execution-host-routing.test.ts index 2dd8c014ebe..0d6b3596358 100644 --- a/src/main/source-control/hosted-review-execution-host-routing.test.ts +++ b/src/main/source-control/hosted-review-execution-host-routing.test.ts @@ -53,9 +53,16 @@ const { assertRemoteUrlReadableMock: vi.fn() })) -vi.mock('../github/gh-utils', () => ({ - gitExecFileAsync: gitExecFileAsyncMock, - ghExecFileAsync: ghExecFileAsyncMock, +vi.mock('../git/command-runner/git-exec-file', async (importOriginal) => ({ + ...(await importOriginal>()), + gitExecFileAsync: gitExecFileAsyncMock +})) + +vi.mock('../git/command-runner/hosted-cli/gh-exec-file', () => ({ + ghExecFileAsync: ghExecFileAsyncMock +})) + +vi.mock('../github/execution/github-operation-slots', () => ({ acquire: vi.fn(async () => {}), release: vi.fn() })) @@ -117,15 +124,15 @@ vi.mock('../github/client/lookup/pr-for-branch-outcome', () => ({ getPRForBranchOutcome: getPRForBranchOutcomeMock })) -vi.mock('../github/client', () => ({ - getRepoSlug: getRepoSlugMock, - getRepoUpstream: getRepoUpstreamMock, - getPRForBranchOutcome: getPRForBranchOutcomeMock, - getGitHubPRLookupRateLimitBlock: vi.fn(async () => null), +vi.mock('../github/client/lookup/pr-lookup-rate-limit', () => ({ + getGitHubPRLookupRateLimitBlock: vi.fn(async () => null) +})) + +vi.mock('../github/client/create/create-github-pull-request', () => ({ createGitHubPullRequest: createGitHubPullRequestMock })) -vi.mock('../github/github-enterprise-repository', () => ({ +vi.mock('../github/repositories/github-enterprise-repository', () => ({ getEnterpriseGitHubRepoSlug: getEnterpriseGitHubRepoSlugMock })) diff --git a/src/main/source-control/hosted-review-git-options.ts b/src/main/source-control/hosted-review-git-options.ts index 289691c6f99..54e6aa7bf00 100644 --- a/src/main/source-control/hosted-review-git-options.ts +++ b/src/main/source-control/hosted-review-git-options.ts @@ -1,5 +1,5 @@ import type { GitAdmissionTier } from '../../shared/rpc-contract/git-admission-tier-params' -import type { GhAccountBinding } from '../../shared/github/account-binding' +import type { GhAccountBinding } from '../../shared/github/accounts/account-binding' export type HostedReviewLocalGitOptions = { wslDistro?: string diff --git a/src/main/source-control/hosted-review.test.ts b/src/main/source-control/hosted-review.test.ts index f61125e3a6f..6d7036953ae 100644 --- a/src/main/source-control/hosted-review.test.ts +++ b/src/main/source-control/hosted-review.test.ts @@ -33,10 +33,19 @@ vi.mock('../gitlab/merge-requests/merge-request-lookup', () => ({ getMergeRequest: vi.fn() })) -vi.mock('../github/client', () => ({ - getRepoSlug: getRepoSlugMock, - getPRForBranchOutcome: getPRForBranchOutcomeMock, - getGitHubPRLookupRateLimitBlock: vi.fn(async () => null), +vi.mock('../github/client/fetch/repo-slug-upstream', () => ({ + getRepoSlug: getRepoSlugMock +})) + +vi.mock('../github/client/lookup/pr-for-branch-outcome', () => ({ + getPRForBranchOutcome: getPRForBranchOutcomeMock +})) + +vi.mock('../github/client/lookup/pr-lookup-rate-limit', () => ({ + getGitHubPRLookupRateLimitBlock: vi.fn(async () => null) +})) + +vi.mock('../github/client/create/create-github-pull-request', () => ({ createGitHubPullRequest: vi.fn() })) @@ -80,54 +89,6 @@ describe('getHostedReviewForBranch', () => { __resetHostedReviewBranchCacheForTests() }) - it('refreshes a self-managed GitLab MR through the provider while old metadata is pending', async () => { - getProjectSlugMock.mockResolvedValue({ host: 'gitlab.example.test', path: 'g/p' }) - const old = { - number: 7, - title: 'MR', - state: 'opened', - url: 'https://gitlab.example.test/g/p/-/merge_requests/7', - pipelineStatus: 'success', - updatedAt: '2026-05-10T00:00:00.000Z', - mergeable: 'MERGEABLE' - } - let finishOld: (value: typeof old) => void = () => {} - const pending = new Promise((resolve) => { - finishOld = resolve - }) - let started!: () => void - const requestStarted = new Promise((resolve) => { - started = resolve - }) - getMergeRequestForBranchMock.mockImplementation( - ( - _repo: string, - _branch: string, - _linked: unknown, - connectionId?: string | null, - options?: { userRefresh?: boolean } - ) => { - started() - if (connectionId !== 'ssh-1') { - return Promise.resolve(null) - } - return options?.userRefresh ? Promise.resolve({ ...old, state: 'merged' }) : pending - } - ) - const input = { - repoPath: '/repo', - executionHostId: 'ssh:ssh-1', - branch: 'feature', - force: true - } as const - const before = getHostedReviewForBranch(input) - await requestStarted - const click = getHostedReviewForBranch({ ...input, userRefresh: true }) - finishOld(old) - await before - await expect(click).resolves.toMatchObject({ provider: 'gitlab', state: 'merged', number: 7 }) - }) - it('maps GitLab merge requests into the hosted review surface', async () => { getProjectSlugMock.mockResolvedValue({ host: 'gitlab.com', path: 'g/p' }) const mr = { @@ -165,114 +126,4 @@ describe('getHostedReviewForBranch', () => { expect(getProjectSlugMock).toHaveBeenCalledWith('/repo', 'ssh-1') expect(getPRForBranchOutcomeMock).not.toHaveBeenCalled() }) - - it('falls through to GitHub when origin is not GitLab', async () => { - getProjectSlugMock.mockResolvedValue(null) - getRepoSlugMock.mockResolvedValue({ owner: 'o', repo: 'r' }) - getPRForBranchOutcomeMock.mockResolvedValue({ - kind: 'found', - fetchedAt: 1, - pr: { - number: 3, - title: 'GitHub branch', - state: 'open', - url: 'https://github.com/o/r/pull/3', - checksStatus: 'pending', - updatedAt: '2026-05-10T00:00:00.000Z', - mergeable: 'UNKNOWN' - } - }) - - await expect( - getHostedReviewForBranch({ - executionHostId: 'local', - repoPath: '/repo', - branch: 'feature', - linkedGitHubPR: 3 - }) - ).resolves.toMatchObject({ - provider: 'github', - number: 3, - status: 'pending' - }) - expect(getPRForBranchOutcomeMock).toHaveBeenCalledWith('/repo', 'feature', 3, null, null, { - currentHeadOid: null - }) - }) - - it('routes local WSL project branch lookup through provider detection and the selected provider', async () => { - getProjectSlugMock.mockResolvedValue(null) - getRepoSlugMock.mockResolvedValue(null) - getBitbucketRepoSlugMock.mockResolvedValue({ workspace: 'team', repoSlug: 'orca' }) - getBitbucketPullRequestForBranchMock.mockResolvedValue({ - number: 22, - title: 'Bitbucket WSL branch', - state: 'open', - url: 'https://bitbucket.org/team/orca/pull-requests/22', - status: 'pending', - updatedAt: '2026-06-16T00:00:00.000Z', - mergeable: 'UNKNOWN' - }) - - await expect( - getHostedReviewForBranch({ - executionHostId: 'local', - repoPath: '/repo', - branch: 'feature/wsl', - linkedBitbucketPR: 22, - localGitExecOptions: { wslDistro: 'Ubuntu' } - }) - ).resolves.toMatchObject({ - provider: 'bitbucket', - number: 22, - status: 'pending' - }) - - const executionOptions = { localGitExecOptions: { wslDistro: 'Ubuntu' } } - expect(getProjectSlugMock).toHaveBeenCalledWith('/repo', null, executionOptions) - expect(getRepoSlugMock).toHaveBeenCalledWith('/repo', null, executionOptions) - expect(getBitbucketRepoSlugMock).toHaveBeenCalledWith('/repo', null, executionOptions) - expect(getBitbucketPullRequestForBranchMock).toHaveBeenCalledWith( - '/repo', - 'feature/wsl', - 22, - null, - executionOptions - ) - }) - - it('uses fallback GitHub PR when branch is empty', async () => { - getProjectSlugMock.mockResolvedValue(null) - getRepoSlugMock.mockResolvedValue({ owner: 'o', repo: 'r' }) - getPRForBranchOutcomeMock.mockResolvedValue({ - kind: 'found', - fetchedAt: 1, - pr: { - number: 42, - title: 'Detached GitHub branch', - state: 'open', - url: 'https://github.com/o/r/pull/42', - checksStatus: 'success', - updatedAt: '2026-05-10T00:00:00.000Z', - mergeable: 'MERGEABLE' - } - }) - - await expect( - getHostedReviewForBranch({ - executionHostId: 'local', - repoPath: '/repo', - branch: '', - fallbackGitHubPR: 42 - }) - ).resolves.toMatchObject({ - provider: 'github', - number: 42, - status: 'success' - }) - expect(getPRForBranchOutcomeMock).toHaveBeenCalledWith('/repo', '', null, null, 42, { - acceptMergedFallbackPR: true, - currentHeadOid: null - }) - }) }) diff --git a/src/main/source-control/hosted-review.ts b/src/main/source-control/hosted-review.ts index 8dd813873b7..8bd616faa04 100644 --- a/src/main/source-control/hosted-review.ts +++ b/src/main/source-control/hosted-review.ts @@ -1,4 +1,7 @@ -import { githubRepoContext, withGitHubRepoExecution } from '../github/github-repository-identity' +import { + githubRepoContext, + withGitHubRepoExecution +} from '../github/repositories/github-repository-identity' import type { ExecutionHostId } from '../../shared/execution-host' import { cachedHostedReviewOutcome, diff --git a/src/main/source-control/pull-request-linked-issue.ts b/src/main/source-control/pull-request-linked-issue.ts index 0b7c102f69b..5efbbbc4ecd 100644 --- a/src/main/source-control/pull-request-linked-issue.ts +++ b/src/main/source-control/pull-request-linked-issue.ts @@ -3,7 +3,7 @@ import type { PullRequestLinkedIssue } from '../../shared/source-control/ai/gene import { isLinkedIssueNumber } from '../../shared/source-control/ai/recipes/source-control-ai-action-variables' import type { WorkspaceLinkedItem } from '../../shared/worktree/types' import type { GitRuntimeOptions } from '../git/command-runner/git-runtime-options' -import { getIssue as getGitHubIssue } from '../github/issues' +import { getIssue as getGitHubIssue } from '../github/issues/issues' import { getIssue as getGitLabIssue } from '../gitlab/issues/gitlab-issue-queries' export type PullRequestLinkedIssueMeta = { diff --git a/src/main/source-control/stacked-hosted-review-creation.ts b/src/main/source-control/stacked-hosted-review-creation.ts index 3c6aa158c99..47b9713a1b4 100644 --- a/src/main/source-control/stacked-hosted-review-creation.ts +++ b/src/main/source-control/stacked-hosted-review-creation.ts @@ -1,6 +1,9 @@ -import { withGitHubRepoExecution } from '../github/github-repository-identity' +import { withGitHubRepoExecution } from '../github/repositories/github-repository-identity' import { hostedReviewSshConnectionId } from './hosted-review-execution-host' -import { getHostedReviewLocalGitOptions } from './hosted-review-git-options' +import { + getHostedReviewLocalGitOptions, + type HostedReviewExecutionOptions +} from './hosted-review-git-options' import type { ExecutionHostId } from '../../shared/execution-host' import type { CreateStackedHostedReviewInput, @@ -10,9 +13,9 @@ import type { import { prepareGitHubStackedPullRequest, registerGitHubStackedPullRequest -} from '../github/stacked-pr-creation' +} from '../github/pull-requests/stacks/stacked-pr-creation' import { createHostedReview } from './hosted-review-creation' -import type { HostedReviewExecutionOptions } from './hosted-review-git-options' + import { stackedReviewFailure } from '../../shared/source-control/hosted-review/stacked-hosted-review-failure-copy' export async function createStackedHostedReview( diff --git a/src/main/ssh/legacy-relay/bridge/legacy-relay-target-bridge.test.ts b/src/main/ssh/legacy-relay/bridge/legacy-relay-target-bridge.test.ts index af50a39637a..b3ff4176a7f 100644 --- a/src/main/ssh/legacy-relay/bridge/legacy-relay-target-bridge.test.ts +++ b/src/main/ssh/legacy-relay/bridge/legacy-relay-target-bridge.test.ts @@ -1,5 +1,4 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { toAppSshPtyId } from '../../../../shared/ssh-pty-id' import type { SshRemotePtyLease } from '../../../../shared/ssh-types' import type { LegacyRelayEndpoint, @@ -98,466 +97,6 @@ afterEach(() => { }) describe('one target’s legacy relay bridge', () => { - it('serves a leased pane its relay lists, forwarding output only once attached', async () => { - const subject = bridge() - await subject.refresh() - expect(subject.snapshot()).toEqual([ - { ptyId: PTY, targetId: TARGET, tabId: 'tab-1', leafId: 'leaf-1', state: 'live' } - ]) - relay.clients[0].emitData('pty-1', 'early') - await expect(subject.attach(PTY)).resolves.toMatchObject({ - status: 'attached', - replay: 'SCREEN' - }) - relay.clients[0].emitData('pty-1', 'late') - subject.write(PTY, 'ls\r') - expect(events.data).toEqual(['late']) - expect(relay.clients[0].writes).toEqual(['ls\r']) - }) - - it('names a live leased pane by its pane key, with what its relay claims about it', async () => { - const leafId = '33333333-3333-4333-8333-333333333333' - leases = [lease({ leafId })] - const subject = bridge({ - openClient: async () => { - const client = fakeClient(relay) - client.list = async () => [ - { relayPtyId: 'pty-1', incarnationId: 'inc-1', terminalHandle: 'term_a' } - ] - relay.clients.push(client) - return client - } - }) - await subject.refresh() - expect(subject.livePaneForKey(`tab-1:${leafId}`)).toEqual({ - ptyId: PTY, - incarnationId: 'inc-1', - terminalHandle: 'term_a' - }) - // A pane moved to another tab keeps the key its shell was started with. - expect(subject.livePaneForKey(`tab-2:${leafId}`)).toMatchObject({ ptyId: PTY }) - expect(subject.livePaneForKey('tab-1:44444444-4444-4444-8444-444444444444')).toBeNull() - expect(subject.livePaneForKey('tab-1:not-a-leaf')).toBeNull() - relay.clients[0].drop() - // Unverifiable is not live: a pane the relay cannot vouch for names nobody. - expect(subject.livePaneForKey(`tab-1:${leafId}`)).toBeNull() - }) - - it('retires the pane and hangs up when its relay reports the exit', async () => { - const subject = bridge() - await subject.refresh() - await subject.attach(PTY) - relay.clients[0].emitExit('pty-1', 0) - expect(events.exits).toEqual([PTY]) - expect(events.exitedTelemetry).toBe(1) - expect(leases[0].state).toBe('terminated') - expect(subject.snapshot()).toEqual([]) - expect(relay.clients[0].closed).toBe(true) - }) - - it('reads a dropped connection as unverifiable and reattaches once the relay answers', async () => { - const subject = bridge() - await subject.refresh() - relay.openError = new Error('ssh down') - relay.clients[0].drop() - expect(subject.snapshot()[0].state).toBe('unverifiable') - await vi.advanceTimersByTimeAsync(2_000) - expect(subject.snapshot()[0].state).toBe('unverifiable') - expect(leases[0].state).toBe('detached') - relay.openError = null - await vi.advanceTimersByTimeAsync(4_000) - expect(subject.snapshot()[0].state).toBe('live') - expect(events.exits).toEqual([]) - }) - - it('answers an attach for a leased pane it cannot reach as unverifiable, never exited', async () => { - listing = { kind: 'unverifiable' } - const subject = bridge() - await subject.refresh() - // Publish before relay replies so mounting tabs wait rather than spawn duplicate shells. - expect(subject.snapshot()).toEqual([ - { ptyId: PTY, targetId: TARGET, tabId: 'tab-1', leafId: 'leaf-1', state: 'unverifiable' } - ]) - const attached = subject.attach(PTY) - await vi.advanceTimersByTimeAsync(20_000) - await expect(attached).resolves.toEqual({ status: 'unverifiable' }) - expect(leases[0].state).toBe('detached') - }) - - it('serves a pane whose relay could not be asked at first once it answers', async () => { - relay.openError = new Error('owner claim timed out') - const subject = bridge() - await subject.refresh() - expect(subject.snapshot()[0].state).toBe('unverifiable') - relay.openError = null - await vi.advanceTimersByTimeAsync(2_000) - expect(subject.snapshot()[0].state).toBe('live') - await expect(subject.attach(PTY)).resolves.toMatchObject({ status: 'attached' }) - }) - - it('retires a lease only when every relay for the target answered without it', async () => { - relay.ptys.clear() - await bridge().refresh() - expect(leases[0].state).toBe('terminated') - expect(events.exitedTelemetry).toBe(0) - }) - - it('keeps a lease when a relay could not be asked', async () => { - relay.ptys.clear() - relay.openError = new Error('refused') - await bridge().refresh() - expect(leases[0].state).toBe('detached') - }) - - it('keeps a lease when a relay may run that no endpoint accounts for', async () => { - relay.ptys.clear() - listing = { kind: 'listed', endpoints: [ENDPOINT], exhaustive: false } - await bridge().refresh() - expect(leases[0].state).toBe('detached') - }) - - it('counts a relay whose socket is provably dead as holding nothing', async () => { - relay.openError = new Error('ECONNREFUSED') - endpointExited = true - await bridge().refresh() - expect(leases[0].state).toBe('terminated') - }) - - it('retires on a proven-exited attach refusal, and only re-lists an ambiguous one', async () => { - const subject = bridge() - await subject.refresh() - relay.attachError = new Error('PTY "pty-1" not found') - await expect(subject.attach(PTY)).resolves.toEqual({ status: 'unverifiable' }) - expect(leases[0].state).toBe('detached') - expect(subject.snapshot()[0].state).toBe('unverifiable') - // Re-listed on backoff, never in a tight loop. - await vi.advanceTimersByTimeAsync(2_000) - expect(subject.snapshot()[0].state).toBe('live') - relay.attachError = new Error('PTY "pty-1" not found (process exited)') - await expect(subject.attach(PTY)).resolves.toEqual({ status: 'exited' }) - expect(leases[0].state).toBe('terminated') - }) - - it('never serves a lease a stop is pending for, or one a newer pane won', async () => { - leases = [ - lease({ pendingKill: { requestedAt: 1, attempts: 1 } }), - lease({ ptyId: 'pty-2', supersededBy: 'pty-3' }), - lease({ ptyId: 'pty-4', tabId: undefined }) - ] - relay.ptys = new Set(['pty-1', 'pty-2', 'pty-4']) - const subject = bridge() - await subject.refresh() - expect(subject.snapshot()).toEqual([]) - expect(stops.owes(PTY)).toBe(false) - // An unfenced legacy id cannot prove this pending stop's process. - expect(relay.shutdowns).toEqual([]) - expect(leases[0].pendingKill).toBeUndefined() - }) - - it('stops a closed tab’s shell through the relay and retires it on the relay’s exit report', async () => { - const subject = bridge() - await subject.refresh() - await expect(stops.stop(PTY, subject)).resolves.toEqual({ status: 'requested' }) - expect(relay.shutdowns).toEqual(['pty-1']) - expect(events.exits).toEqual([PTY]) - expect(leases[0].state).toBe('terminated') - await vi.advanceTimersByTimeAsync(30_000) - expect(relay.shutdowns).toEqual(['pty-1']) - }) - - it('retires a stopped shell once a listing proves it gone, without an exit report', async () => { - relay.exitOnShutdown = false - relay.incarnations.set('pty-1', 'inc-1') - const subject = bridge() - await subject.refresh() - await stops.stop(PTY, subject) - expect(leases[0].state).toBe('detached') - await vi.advanceTimersByTimeAsync(2_000) - expect(leases[0].state).toBe('terminated') - expect(stops.size).toBe(0) - }) - - it('holds a close for an unreachable relay as unverifiable and sends it once the relay answers', async () => { - relay.incarnations.set('pty-1', 'inc-1') - const subject = bridge() - await subject.refresh() - relay.openError = new Error('ssh down') - relay.clients[0].drop() - await expect(stops.stop(PTY, subject)).resolves.toEqual({ status: 'unverifiable' }) - expect(relay.shutdowns).toEqual([]) - // Loss of contact is never exit. - expect(leases[0].state).toBe('detached') - expect(events.exits).toEqual([]) - relay.openError = null - await vi.advanceTimersByTimeAsync(2_000) - expect(relay.shutdowns).toEqual(['pty-1#inc-1']) - expect(leases[0].state).toBe('terminated') - }) - - it('keeps the identity a first close saw when the tab’s close repeats while unreachable', async () => { - relay.incarnations.set('pty-1', 'inc-1') - const subject = bridge() - await subject.refresh() - relay.openError = new Error('ssh down') - relay.clients[0].drop() - await stops.stop(PTY, subject) - await vi.advanceTimersByTimeAsync(2_000) - await stops.stop(PTY, subject) - relay.openError = null - await vi.advanceTimersByTimeAsync(10_000) - expect(relay.shutdowns).toEqual(['pty-1#inc-1']) - }) - - it('never stops a different process that took a closed tab’s recycled relay id', async () => { - relay.incarnations.set('pty-1', 'inc-1') - const subject = bridge() - await subject.refresh() - relay.openError = new Error('ssh down') - relay.clients[0].drop() - await stops.stop(PTY, subject) - relay.incarnations.set('pty-1', 'inc-2') - relay.openError = null - await vi.advanceTimersByTimeAsync(10_000) - expect(relay.shutdowns).toEqual([]) - expect(stops.size).toBe(0) - // Retire the closed lease so the stranger cannot be served under its tab. - expect(leases[0].state).toBe('terminated') - expect(subject.snapshot()).toEqual([]) - }) - - it('never re-aims a repeated close at a process that took the closed tab’s relay id', async () => { - relay.incarnations.set('pty-1', 'inc-1') - const subject = bridge() - await subject.refresh() - relay.openError = new Error('ssh down') - relay.clients[0].drop() - await stops.stop(PTY, subject) - // A restarted relay reuses the id for another shell, and the close repeats before any flush. - const client = fakeClient(relay) - const recycled = { - paneState: () => 'live' as const, - paneReplaced: () => false, - liveRoute: () => ({ client, relayPtyId: 'pty-1' }), - listedIncarnation: () => 'inc-2', - refresh: async () => {} - } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: stop() reads only these members. - await stops.stop(PTY, recycled as unknown as LegacyRelayTargetBridge) - expect(relay.shutdowns).toEqual([]) - expect(leases[0].state).toBe('terminated') - }) - - it('proves a stop only by the relay’s exit report, never by the stop’s reply', async () => { - const epochPty = toAppSshPtyId(TARGET, 'pty2:epoch:1') - leases = [lease({ ptyId: 'pty2:epoch:1' })] - relay.ptys = new Set(['pty2:epoch:1']) - const subject = bridge() - await subject.refresh() - await expect(stops.stopAndWait(epochPty, subject, Date.now() + 5_000)).resolves.toBe('reported') - }) - - it('settles on the relay’s exit report even when the stop’s own reply is lost', async () => { - const epochPty = toAppSshPtyId(TARGET, 'pty2:epoch:1') - leases = [lease({ ptyId: 'pty2:epoch:1' })] - const client = fakeClient(relay) - client.shutdown = async () => { - stops.exited(epochPty) - throw new Error('request timed out') - } - const lostReply = { - paneState: () => 'live' as const, - paneReplaced: () => false, - liveRoute: () => ({ client, relayPtyId: 'pty2:epoch:1' }), - listedIncarnation: () => undefined, - refresh: async () => {} - } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: stop() reads only these members. - const target = lostReply as unknown as LegacyRelayTargetBridge - await expect(stops.stopAndWait(epochPty, target, Date.now() + 5_000)).resolves.toBe('reported') - }) - - it('still settles on an exit report that trails a failed stop reply', async () => { - const epochPty = toAppSshPtyId(TARGET, 'pty2:epoch:1') - leases = [lease({ ptyId: 'pty2:epoch:1' })] - relay.ptys = new Set(['pty2:epoch:1']) - relay.shutdownError = new Error('request timed out') - const subject = bridge() - await subject.refresh() - const settled = stops.stopAndWait(epochPty, subject, Date.now() + 5_000) - await vi.advanceTimersByTimeAsync(100) - relay.clients[0].emitExit('pty2:epoch:1', 0) - await expect(settled).resolves.toBe('reported') - }) - - it('still sees an unfenced stop’s exit report that trails its reply, never re-serving the pane', async () => { - relay.exitOnShutdown = false - const subject = bridge() - await subject.refresh() - const settled = stops.stopAndWait(PTY, subject, Date.now() + 5_000) - await vi.advanceTimersByTimeAsync(0) - expect(relay.shutdowns).toEqual(['pty-1']) - expect(subject.snapshot()).toEqual([]) - relay.clients[0].emitExit('pty-1', 0) - await expect(settled).resolves.toBe('reported') - }) - - it('still sees an unfenced stop’s exit report after its reply timed out', async () => { - relay.shutdownError = new Error('request timed out') - const subject = bridge() - await subject.refresh() - const settled = stops.stopAndWait(PTY, subject, Date.now() + 5_000) - await vi.advanceTimersByTimeAsync(100) - expect(subject.snapshot()).toEqual([]) - relay.clients[0].emitExit('pty-1', 0) - await expect(settled).resolves.toBe('reported') - }) - - it('leaves a taken stop unproven while no exit report or complete listing confirms it', async () => { - const epochPty = toAppSshPtyId(TARGET, 'pty2:epoch:1') - leases = [lease({ ptyId: 'pty2:epoch:1' })] - relay.ptys = new Set(['pty2:epoch:1']) - relay.exitOnShutdown = false - // A relay may run that no endpoint accounts for, so absence from the listing is not exit. - listing = { kind: 'listed', endpoints: [ENDPOINT], exhaustive: false } - const subject = bridge() - await subject.refresh() - const settled = stops.stopAndWait(epochPty, subject, Date.now() + 1_000) - await vi.advanceTimersByTimeAsync(1_000) - await expect(settled).resolves.toBeNull() - expect(relay.shutdowns).toEqual(['pty2:epoch:1']) - }) - - it('never attaches a pane whose tab closed while the attach waited for its relay', async () => { - const epochPty = toAppSshPtyId(TARGET, 'pty2:epoch:1') - leases = [lease({ ptyId: 'pty2:epoch:1' })] - relay.ptys = new Set(['pty2:epoch:1']) - relay.openError = new Error('ssh down') - const subject = bridge() - await subject.refresh() - const attach = subject.attach(epochPty) - // The tab closes while the attach waits for the unreachable relay. - await stops.stop(epochPty, null) - relay.openError = null - relay.shutdownError = new Error('timed out') - await subject.refresh() - await expect(attach).resolves.toEqual({ status: 'not-bridged' }) - expect(relay.clients.every((client) => client.writes.length === 0)).toBe(true) - }) - - it('sends a close recorded while disconnected once the next bridge lists the pane', async () => { - const epochPty = toAppSshPtyId(TARGET, 'pty2:epoch:1') - leases = [lease({ ptyId: 'pty2:epoch:1' })] - relay.ptys = new Set(['pty2:epoch:1']) - await expect(stops.stop(epochPty, null)).resolves.toEqual({ status: 'unverifiable' }) - expect(leases[0].state).toBe('detached') - await bridge().refresh() - expect(relay.shutdowns).toEqual(['pty2:epoch:1']) - }) - - it('sends a close recorded while disconnected after a restart before the reconnect', async () => { - const epochPty = toAppSshPtyId(TARGET, 'pty2:epoch:1') - leases = [lease({ ptyId: 'pty2:epoch:1' })] - relay.ptys = new Set(['pty2:epoch:1']) - await stops.stop(epochPty, null) - // Restart: only the persisted leases survive. - stops = paneStops() - const subject = bridge() - await subject.refresh() - expect(relay.shutdowns).toEqual(['pty2:epoch:1']) - // A pending stop must never offer the shell for reattach. - expect(subject.snapshot()).toEqual([]) - expect(leases[0]).toMatchObject({ state: 'terminated' }) - expect(leases[0].pendingKill).toBeUndefined() - }) - - it('restores a fenced stop across a restart and sends it only to the same process', async () => { - relay.incarnations.set('pty-1', 'inc-1') - const subject = bridge() - await subject.refresh() - relay.openError = new Error('ssh down') - relay.clients[0].drop() - await stops.stop(PTY, subject) - subject.dispose() - stops = paneStops() - relay.openError = null - await bridge().refresh() - expect(relay.shutdowns).toEqual(['pty-1#inc-1']) - }) - - it('drops a restored stop whose relay id now names another process, never serving it', async () => { - relay.incarnations.set('pty-1', 'inc-1') - const subject = bridge() - await subject.refresh() - relay.openError = new Error('ssh down') - relay.clients[0].drop() - await stops.stop(PTY, subject) - subject.dispose() - stops = paneStops() - relay.incarnations.set('pty-1', 'inc-2') - relay.openError = null - const next = bridge() - await next.refresh() - await vi.advanceTimersByTimeAsync(10_000) - expect(relay.shutdowns).toEqual([]) - expect(leases[0]).toMatchObject({ state: 'terminated' }) - expect(leases[0].pendingKill).toBeUndefined() - expect(next.snapshot()).toEqual([]) - }) - - it('stops serving an unfenced legacy pane once its one stop failed', async () => { - const subject = bridge() - await subject.refresh() - relay.shutdownError = new Error('timed out') - await stops.stop(PTY, subject) - await vi.advanceTimersByTimeAsync(0) - expect(subject.snapshot()).toEqual([]) - expect(subject.livePaneCount()).toBe(0) - }) - - it('never serves an unfenced legacy pane again after its tab closed and Orca restarted', async () => { - await expect(stops.stop(PTY, null)).resolves.toEqual({ status: 'unverifiable' }) - stops = paneStops() - const subject = bridge() - await subject.refresh() - expect(subject.snapshot()).toEqual([]) - expect(relay.shutdowns).toEqual([]) - }) - - it('never replays a blind close for a legacy id that could name another shell', async () => { - await stops.stop(PTY, null) - await bridge().refresh() - expect(relay.shutdowns).toEqual([]) - expect(leases[0].state).toBe('terminated') - }) - - it('never replays a fenced legacy stop to a relay that no longer reports the incarnation', async () => { - relay.incarnations.set('pty-1', 'inc-1') - const subject = bridge() - await subject.refresh() - relay.openError = new Error('ssh down') - relay.clients[0].drop() - await stops.stop(PTY, subject) - // A restarted or downgraded relay lists the same id with no identity, and may ignore the fence. - relay.incarnations.clear() - relay.openError = null - await vi.advanceTimersByTimeAsync(10_000) - expect(relay.shutdowns).toEqual([]) - }) - - it('never replays an unfenced legacy stop on a later connection, which may be a new relay', async () => { - const subject = bridge() - await subject.refresh() - relay.shutdownError = new Error('timed out') - await expect(stops.stop(PTY, subject)).resolves.toEqual({ status: 'unverifiable' }) - relay.shutdownError = null - relay.clients[0].drop() - await vi.advanceTimersByTimeAsync(10_000) - expect(relay.shutdowns).toEqual([]) - // Unfenced stops get one attempt; retired leases must never target a later relay. - expect(leases[0].state).toBe('terminated') - expect(subject.snapshot()).toEqual([]) - }) - it('never republishes a pane that exited while a refresh was asking its relay', async () => { const subject = bridge() await subject.refresh() @@ -600,8 +139,6 @@ describe('one target’s legacy relay bridge', () => { describe('two relays that list the same relay id', () => { const OTHER: LegacyRelayEndpoint = { ...ENDPOINT, endpoint: '/home/me/.orca-remote/b.sock' } let other: FakeRelay - const clientOf = (endpoint: LegacyRelayEndpoint) => - (endpoint.endpoint === OTHER.endpoint ? other : relay).clients.at(-1)! const twoRelays = (): LegacyRelayTargetBridge => bridge({ openClient: async (endpoint) => { @@ -619,35 +156,6 @@ describe('one target’s legacy relay bridge', () => { other = { ...relay, ptys: new Set(), clients: [], shutdowns: [], incarnations: new Map() } }) - it('keeps the attached relay when a second one later lists the same id', async () => { - const subject = twoRelays() - await subject.refresh() - await expect(subject.attach(PTY)).resolves.toMatchObject({ status: 'attached' }) - other.ptys.add('pty-1') - listing = { kind: 'listed', endpoints: [ENDPOINT, OTHER], exhaustive: true } - await subject.refresh() - subject.write(PTY, 'ls\r') - expect(clientOf(ENDPOINT).writes).toEqual(['ls\r']) - expect(clientOf(OTHER).writes).toEqual([]) - // Only the owning relay speaks for the pane. - clientOf(OTHER).emitData('pty-1', 'foreign') - clientOf(OTHER).emitExit('pty-1', 0) - expect(events.data).toEqual([]) - expect(events.exits).toEqual([]) - expect(leases[0].state).toBe('detached') - }) - - it('retires the pane when its own relay answers without it, never moving it to the other', async () => { - const subject = twoRelays() - await subject.refresh() - relay.ptys.delete('pty-1') - other.ptys.add('pty-1') - listing = { kind: 'listed', endpoints: [ENDPOINT, OTHER], exhaustive: true } - await subject.refresh() - expect(leases[0].state).toBe('terminated') - expect(subject.snapshot()).toEqual([]) - }) - it('serves neither relay when both list the id and neither held it', async () => { other.ptys.add('pty-1') listing = { kind: 'listed', endpoints: [ENDPOINT, OTHER], exhaustive: true } @@ -665,89 +173,5 @@ describe('one target’s legacy relay bridge', () => { await vi.advanceTimersByTimeAsync(60_000) expect(leases[0].state).toBe('terminated') }) - - it('never adopts the one relay listing an id while another could not be asked', async () => { - other.ptys.add('pty-1') - relay.openError = new Error('ssh down') - listing = { kind: 'listed', endpoints: [ENDPOINT, OTHER], exhaustive: true } - const subject = twoRelays() - await subject.refresh() - expect(subject.snapshot()).toEqual([expect.objectContaining({ state: 'unverifiable' })]) - // The unreachable relay answers and both list the id: still nobody's. - relay.openError = null - await vi.advanceTimersByTimeAsync(10_000) - expect(subject.snapshot()).toEqual([expect.objectContaining({ state: 'unverifiable' })]) - expect(other.clients.flatMap((client) => client.writes)).toEqual([]) - }) - - it('never adopts the one relay listing an id while the census may have missed another', async () => { - listing = { kind: 'listed', endpoints: [ENDPOINT], exhaustive: false } - const subject = twoRelays() - await subject.refresh() - expect(subject.snapshot()).toEqual([expect.objectContaining({ state: 'unverifiable' })]) - // The census later accounts for every relay, and the missed one runs the same id. - other.ptys.add('pty-1') - listing = { kind: 'listed', endpoints: [ENDPOINT, OTHER], exhaustive: true } - await vi.advanceTimersByTimeAsync(10_000) - expect(subject.snapshot()).toEqual([expect.objectContaining({ state: 'unverifiable' })]) - subject.write(PTY, 'ls\r') - expect(relay.clients.flatMap((client) => client.writes)).toEqual([]) - }) - - it('serves an epoch-scoped id from its one relay even while the census may have missed one', async () => { - const epochPty = toAppSshPtyId(TARGET, 'pty2:epoch:1') - leases = [lease({ ptyId: 'pty2:epoch:1' })] - relay.ptys = new Set(['pty2:epoch:1']) - listing = { kind: 'listed', endpoints: [ENDPOINT], exhaustive: false } - const subject = twoRelays() - await subject.refresh() - expect(subject.snapshot()).toEqual([ - expect.objectContaining({ ptyId: epochPty, state: 'live' }) - ]) - }) - - it('keeps the owning relay across a reconnect, when both relays list the id', async () => { - const first = twoRelays() - await first.refresh() - first.dispose() - other.ptys.add('pty-1') - listing = { kind: 'listed', endpoints: [ENDPOINT, OTHER], exhaustive: true } - const successor = twoRelays() - await successor.refresh() - await expect(successor.attach(PTY)).resolves.toMatchObject({ status: 'attached' }) - successor.write(PTY, 'ls\r') - expect(clientOf(ENDPOINT).writes).toEqual(['ls\r']) - expect(clientOf(OTHER).writes).toEqual([]) - }) - - it('keeps an exit the relay reported while its listing was in flight', async () => { - const subject = bridge({ - openClient: async () => { - const client = fakeClient(relay) - const list = client.list.bind(client) - client.list = async () => { - const rows = await list() - // The shell exits after the relay answered but before the pane has an owner. - client.emitExit('pty-1', 3) - return rows - } - relay.clients.push(client) - return client - } - }) - await subject.refresh() - expect(events.exits).toEqual([PTY]) - expect(leases[0].state).toBe('terminated') - expect(subject.snapshot()).toEqual([]) - }) - }) - - it('hangs up every connection on dispose and leaves the relays to their own grace', async () => { - const subject = bridge() - await subject.refresh() - subject.dispose() - expect(relay.clients.every((client) => client.closed)).toBe(true) - expect(leases[0].state).toBe('detached') - expect(subject.snapshot()).toEqual([]) }) }) diff --git a/src/main/ssh/legacy-relay/cli/legacy-relay-cli-call-limits.ts b/src/main/ssh/legacy-relay/cli/legacy-relay-cli-call-limits.ts index 36579cbd252..2e05b2dc430 100644 --- a/src/main/ssh/legacy-relay/cli/legacy-relay-cli-call-limits.ts +++ b/src/main/ssh/legacy-relay/cli/legacy-relay-cli-call-limits.ts @@ -11,7 +11,7 @@ import { hashCanonical, readPromptBasePayloadHash, replayStableCallerParams -} from '../../../runtime/rpc/orchestration-mutation-receipt' +} from '../../../runtime/rpc/orchestration/mutations/orchestration-mutation-receipt' import { getCompiledSchema } from '../../../schema-validation/zod-schema-compilation' import type { LegacyRelayCliCall } from './legacy-relay-cli-caller' diff --git a/src/main/star-nag/agent-value-moment.ts b/src/main/star-nag/agent-value-moment.ts index 52c4909a45a..5171860b9dc 100644 --- a/src/main/star-nag/agent-value-moment.ts +++ b/src/main/star-nag/agent-value-moment.ts @@ -1,5 +1,5 @@ import { app } from 'electron' -import { checkOrcaStarred } from '../github/client' +import { checkOrcaStarred } from '../github/client/fetch/orca-star' import type { Store } from '../persistence/loading-store/store' import type { StarNagPromptMode } from '../../shared/star-nag-telemetry' diff --git a/src/main/star-nag/direct-star-attempt.ts b/src/main/star-nag/direct-star-attempt.ts index 18a22aad6f5..802b43c6b6a 100644 --- a/src/main/star-nag/direct-star-attempt.ts +++ b/src/main/star-nag/direct-star-attempt.ts @@ -1,4 +1,4 @@ -import { starOrca } from '../github/client' +import { starOrca } from '../github/client/fetch/orca-star' import { track } from '../telemetry/client' import { getCohortAtEmit } from '../telemetry/cohort-classifier' import { type StarNagPromptSession, trackStarNagSessionOutcome } from './prompt-session-telemetry' diff --git a/src/main/star-nag/service-direct-star.test.ts b/src/main/star-nag/service-direct-star.test.ts index e694b26557d..fcec053d665 100644 --- a/src/main/star-nag/service-direct-star.test.ts +++ b/src/main/star-nag/service-direct-star.test.ts @@ -30,7 +30,7 @@ vi.mock('electron', () => ({ } })) -vi.mock('../github/client', () => ({ +vi.mock('../github/client/fetch/orca-star', () => ({ checkOrcaStarred: mocks.checkOrcaStarredMock, starOrca: mocks.starOrcaMock })) @@ -84,30 +84,6 @@ describe('StarNagService', () => { expect(ui.starNagCompleted).toBe(true) }) - it('records failed direct star after dismissal without clearing the cooldown or re-showing', async () => { - const window = createWindow() - browserWindowMock.getAllWindows.mockReturnValue([window]) - const deferredStar = createDeferred() - starOrcaMock.mockReturnValue(deferredStar.promise) - const { service, ui } = createHarness() - - service.registerIpcHandlers() - getIpcHandler('star-nag:forceShow')() - const starPromise = getIpcHandler('star-nag:starOrca')() - getIpcHandler('star-nag:dismiss')() - - deferredStar.resolve(false) - await expect(starPromise).resolves.toBe(false) - - expect(trackMock).toHaveBeenCalledWith( - 'star_nag_outcome', - expect.objectContaining({ outcome: 'direct_star_failed', mode: 'gh' }) - ) - expect(ui.starNagCompleted).toBeUndefined() - expect(ui.starNagDeferredUntil).toBeGreaterThan(Date.now()) - expect(window.webContents.send).toHaveBeenCalledTimes(1) - }) - it('clears the in-flight direct-star guard after thrown attempts so the user can retry', async () => { const window = createWindow() browserWindowMock.getAllWindows.mockReturnValue([window]) @@ -124,41 +100,4 @@ describe('StarNagService', () => { expect(starOrcaMock).toHaveBeenCalledTimes(2) expect(ui.starNagCompleted).toBe(true) }) - - it('records failed direct star before web fallback and guards duplicate in-flight attempts', async () => { - const window = createWindow() - browserWindowMock.getAllWindows.mockReturnValue([window]) - const deferredStar = createDeferred() - starOrcaMock.mockReturnValue(deferredStar.promise) - const { service, ui } = createHarness() - - service.registerIpcHandlers() - getIpcHandler('star-nag:forceShow')() - const starFromNag = getIpcHandler('star-nag:starOrca') - const first = starFromNag() - const second = starFromNag() - - deferredStar.resolve(false) - await expect(first).resolves.toBe(false) - await expect(second).resolves.toBe(false) - - const starAttempts = trackMock.mock.calls.filter( - ([name, payload]) => - name === 'star_nag_outcome' && (payload as { outcome?: string }).outcome === 'star_clicked' - ) - expect(starAttempts).toHaveLength(1) - expect(trackMock).toHaveBeenCalledWith( - 'star_nag_outcome', - expect.objectContaining({ outcome: 'direct_star_failed', mode: 'gh' }) - ) - - getIpcHandler('star-nag:openWeb')() - - expect(trackMock).toHaveBeenCalledWith( - 'star_nag_outcome', - expect.objectContaining({ outcome: 'opened_repo', mode: 'web' }) - ) - expect(ui.starNagCompleted).toBeUndefined() - expect(ui.starNagDeferredUntil).toBeGreaterThan(Date.now()) - }) }) diff --git a/src/main/star-nag/service-force-show-races.test.ts b/src/main/star-nag/service-force-show-races.test.ts index cae9f744075..06891c5170d 100644 --- a/src/main/star-nag/service-force-show-races.test.ts +++ b/src/main/star-nag/service-force-show-races.test.ts @@ -32,7 +32,7 @@ vi.mock('electron', () => ({ } })) -vi.mock('../github/client', () => ({ +vi.mock('../github/client/fetch/orca-star', () => ({ checkOrcaStarred: mocks.checkOrcaStarredMock, starOrca: mocks.starOrcaMock })) diff --git a/src/main/star-nag/service-threshold-prompt.test.ts b/src/main/star-nag/service-threshold-prompt.test.ts deleted file mode 100644 index e9e2bec9b8c..00000000000 --- a/src/main/star-nag/service-threshold-prompt.test.ts +++ /dev/null @@ -1,262 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/constants' -import { - createHarness, - createIpcHandlerLookup, - createWindow, - flushAsyncWork, - resetStarNagMocks, - type TestWindow -} from './service-test-harness' - -const mocks = vi.hoisted(() => ({ - appMock: { - getVersion: vi.fn(() => '1.2.3') - }, - browserWindowMock: { - getAllWindows: vi.fn<() => TestWindow[]>(() => []) - }, - checkOrcaStarredMock: vi.fn(), - starOrcaMock: vi.fn(), - trackMock: vi.fn(), - getCohortAtEmitMock: vi.fn(() => ({ nth_repo_added: 3 })), - ipcMainHandleMock: vi.fn() -})) - -vi.mock('electron', () => ({ - app: mocks.appMock, - BrowserWindow: mocks.browserWindowMock, - ipcMain: { - handle: mocks.ipcMainHandleMock - } -})) - -vi.mock('../github/client', () => ({ - checkOrcaStarred: mocks.checkOrcaStarredMock, - starOrca: mocks.starOrcaMock -})) - -vi.mock('../telemetry/client', () => ({ - track: mocks.trackMock -})) - -vi.mock('../telemetry/cohort-classifier', () => ({ - getCohortAtEmit: mocks.getCohortAtEmitMock -})) - -const { browserWindowMock, checkOrcaStarredMock, trackMock } = mocks -const getIpcHandler = createIpcHandlerLookup(mocks.ipcMainHandleMock) - -describe('StarNagService', () => { - let consoleInfoMock: ReturnType - - beforeEach(() => { - resetStarNagMocks(mocks) - consoleInfoMock = vi.spyOn(console, 'info').mockImplementation(() => undefined) - }) - - afterEach(() => { - consoleInfoMock.mockRestore() - }) - - it('preserves the counter and dismissal backoff after an app update', async () => { - const window = createWindow() - browserWindowMock.getAllWindows.mockReturnValue([window]) - const { service, emitAgentStarted, store, ui } = createHarness({ - starNagAppVersion: '1.2.2', - starNagBaselineAgents: 10, - starNagNextThreshold: 70, - starNagDeferredUntil: 1 - }) - - service.start() - expect(store.updateUI).not.toHaveBeenCalled() - expect(ui.starNagDeferredUntil).toBe(1) - emitAgentStarted(79) - await flushAsyncWork() - expect(window.webContents.send).not.toHaveBeenCalled() - - emitAgentStarted(80) - await flushAsyncWork() - expect(window.webContents.send).toHaveBeenCalledTimes(1) - expect(trackMock).toHaveBeenCalledWith( - 'star_nag_outcome', - expect.objectContaining({ outcome: 'shown', threshold: 70, agents_since_baseline: 70 }) - ) - }) - - it.each([undefined, null])('initializes a missing baseline (%s) only once', async (baseline) => { - const window = createWindow() - browserWindowMock.getAllWindows.mockReturnValue([window]) - const { service, emitAgentStarted, ui } = createHarness({ - starNagAppVersion: undefined, - starNagBaselineAgents: baseline, - starNagNextThreshold: undefined - }) - - service.start() - expect(ui.starNagBaselineAgents).toBe(45) - expect(ui.starNagNextThreshold).toBe(STAR_NAG_INITIAL_THRESHOLD) - service.stop() - mocks.appMock.getVersion.mockReturnValue('1.2.4') - service.start() - emitAgentStarted(79) - await flushAsyncWork() - expect(window.webContents.send).not.toHaveBeenCalled() - emitAgentStarted(80) - await flushAsyncWork() - expect(window.webContents.send).toHaveBeenCalledTimes(1) - }) - - it('logs a threshold exposure exactly once while the card remains visible', async () => { - const window = createWindow() - browserWindowMock.getAllWindows.mockReturnValue([window]) - const { service, emitAgentStarted } = createHarness() - - service.start() - emitAgentStarted(45) - await flushAsyncWork() - emitAgentStarted(46) - - expect(window.webContents.send).toHaveBeenCalledTimes(1) - expect(window.webContents.send).toHaveBeenCalledWith('star-nag:show', { - mode: 'gh', - surface: 'card' - }) - expect(consoleInfoMock).toHaveBeenCalledTimes(1) - expect(consoleInfoMock).toHaveBeenCalledWith({ - event: 'star_nag_shown', - app_version: '1.2.3', - threshold: STAR_NAG_INITIAL_THRESHOLD, - agents_since_baseline: 35, - source: 'threshold' - }) - }) - - it('shows the browser fallback when checkOrcaStarred cannot determine star state', async () => { - const window = createWindow() - browserWindowMock.getAllWindows.mockReturnValue([window]) - checkOrcaStarredMock.mockResolvedValue(null) - const { service, emitAgentStarted } = createHarness() - - service.start() - emitAgentStarted(45) - await flushAsyncWork() - - expect(window.webContents.send).toHaveBeenCalledWith('star-nag:show', { - mode: 'web', - surface: 'card' - }) - expect(trackMock).toHaveBeenCalledWith('star_nag_outcome', { - outcome: 'shown', - source: 'threshold', - mode: 'web', - threshold: STAR_NAG_INITIAL_THRESHOLD, - agents_since_baseline: 35, - agents_since_baseline_bucket: '35-69', - nth_repo_added: 3 - }) - expect(consoleInfoMock).toHaveBeenCalledWith({ - event: 'star_nag_shown', - app_version: '1.2.3', - threshold: STAR_NAG_INITIAL_THRESHOLD, - agents_since_baseline: 35, - source: 'threshold' - }) - }) - - it('does not log a threshold exposure when checkOrcaStarred returns true', async () => { - const window = createWindow() - browserWindowMock.getAllWindows.mockReturnValue([window]) - checkOrcaStarredMock.mockResolvedValue(true) - const { service, emitAgentStarted } = createHarness() - - service.start() - emitAgentStarted(45) - await flushAsyncWork() - - expect(window.webContents.send).not.toHaveBeenCalled() - expect(consoleInfoMock).not.toHaveBeenCalled() - }) - - it('does not block a later real prompt after crossing the threshold with no window', async () => { - const { service, emitAgentStarted } = createHarness() - - service.start() - emitAgentStarted(45) - await flushAsyncWork() - - expect(consoleInfoMock).not.toHaveBeenCalled() - expect(trackMock).not.toHaveBeenCalled() - - const window = createWindow() - browserWindowMock.getAllWindows.mockReturnValue([window]) - emitAgentStarted(46) - await flushAsyncWork() - - expect(window.webContents.send).toHaveBeenCalledWith('star-nag:show', { - mode: 'gh', - surface: 'card' - }) - expect(consoleInfoMock).toHaveBeenCalledWith({ - event: 'star_nag_shown', - app_version: '1.2.3', - threshold: STAR_NAG_INITIAL_THRESHOLD, - agents_since_baseline: 36, - source: 'threshold' - }) - }) - - it('logs dismissal with doubled next_threshold and advances backoff for the active session', async () => { - const window = createWindow() - browserWindowMock.getAllWindows.mockReturnValue([window]) - const { service, emitAgentStarted, ui } = createHarness() - - service.start() - service.registerIpcHandlers() - emitAgentStarted(45) - await flushAsyncWork() - getIpcHandler('star-nag:dismiss')() - - expect(consoleInfoMock).toHaveBeenLastCalledWith({ - event: 'star_nag_dismissed', - app_version: '1.2.3', - threshold: STAR_NAG_INITIAL_THRESHOLD, - agents_since_baseline: 35, - source: 'threshold', - next_threshold: STAR_NAG_INITIAL_THRESHOLD * 2 - }) - expect(ui.starNagNextThreshold).toBe(STAR_NAG_INITIAL_THRESHOLD * 2) - expect(ui.starNagBaselineAgents).toBe(45) - expect(ui.starNagDeferredUntil).toBeGreaterThan(Date.now()) - }) - - it('preserves an active cooldown and backoff after an app update', async () => { - const window = createWindow() - browserWindowMock.getAllWindows.mockReturnValue([window]) - const { service, emitAgentStarted, store, ui } = createHarness({ - starNagAppVersion: '1.2.2', - starNagNextThreshold: 70, - starNagDeferredUntil: Date.now() + 3 * 24 * 60 * 60 * 1000 - }) - - service.start() - emitAgentStarted(80) - await flushAsyncWork() - - expect(checkOrcaStarredMock).not.toHaveBeenCalled() - expect(window.webContents.send).not.toHaveBeenCalled() - expect(trackMock).not.toHaveBeenCalled() - expect(store.updateUI).not.toHaveBeenCalled() - - ui.starNagDeferredUntil = Date.now() - 1 - emitAgentStarted(81) - await flushAsyncWork() - - expect(window.webContents.send).toHaveBeenCalledTimes(1) - expect(window.webContents.send).toHaveBeenCalledWith('star-nag:show', { - mode: 'gh', - surface: 'card' - }) - }) -}) diff --git a/src/main/star-nag/service.ts b/src/main/star-nag/service.ts index 253e18e828c..ab076140f36 100644 --- a/src/main/star-nag/service.ts +++ b/src/main/star-nag/service.ts @@ -1,6 +1,6 @@ import { BrowserWindow, ipcMain } from 'electron' import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/constants' -import { checkOrcaStarred } from '../github/client' +import { checkOrcaStarred } from '../github/client/fetch/orca-star' import type { Store } from '../persistence/loading-store/store' import type { StatsCollector } from '../stats/collector' import { track } from '../telemetry/client' diff --git a/src/main/startup/agent-launch-record-warmup.ts b/src/main/startup/agent-accounts/agent-launch-record-warmup.ts similarity index 92% rename from src/main/startup/agent-launch-record-warmup.ts rename to src/main/startup/agent-accounts/agent-launch-record-warmup.ts index 1936ea9e070..bd9814d6b4c 100644 --- a/src/main/startup/agent-launch-record-warmup.ts +++ b/src/main/startup/agent-accounts/agent-launch-record-warmup.ts @@ -1,5 +1,5 @@ import type { BrowserWindow } from 'electron' -import { mainProcessState as state } from './main-process-state' +import { mainProcessState as state } from '../main-process-state' // Defer synchronous disk work (95-280ms measured under load) past first-load renderer startup. export const AGENT_LAUNCH_RECORD_WARMUP_DELAY_MS = 1_500 diff --git a/src/main/startup/codex-account-restart-resume.test.ts b/src/main/startup/agent-accounts/codex-account-restart-resume.test.ts similarity index 92% rename from src/main/startup/codex-account-restart-resume.test.ts rename to src/main/startup/agent-accounts/codex-account-restart-resume.test.ts index 0f682389007..c665233f8d7 100644 --- a/src/main/startup/codex-account-restart-resume.test.ts +++ b/src/main/startup/agent-accounts/codex-account-restart-resume.test.ts @@ -5,7 +5,7 @@ import { afterEach, beforeEach, expect, it, vi } from 'vitest' const homes = vi.hoisted(() => ({ original: '', selected: '', system: '' })) vi.mock('electron', () => ({ app: { getPath: () => homes.system } })) -vi.mock('./main-process-state', () => ({ +vi.mock('../main-process-state', () => ({ mainProcessState: { codexRuntimeHome: { isHostSystemDefaultRealHomeSelected: () => false, @@ -15,21 +15,21 @@ vi.mock('./main-process-state', () => ({ store: { getSettings: () => ({}) } } })) -vi.mock('../codex/hooks/installation/hook-service', () => ({ +vi.mock('../../codex/hooks/installation/hook-service', () => ({ codexHookService: { installForLaunchPrep: vi.fn(), refreshRuntimeUserHooksForLaunchPrep: vi.fn() } })) -vi.mock('../codex/hooks/reconciliation/codex-hook-reconcile', () => ({ +vi.mock('../../codex/hooks/reconciliation/codex-hook-reconcile', () => ({ reconcileCodexHooksForLaunch: vi.fn() })) -vi.mock('../codex/configuration/homes/codex-home-paths', () => ({ +vi.mock('../../codex/configuration/homes/codex-home-paths', () => ({ getCodexSessionBackfillStateDirPath: () => join(homes.system, 'backfill'), getSystemCodexHomePath: () => homes.system, getOrcaManagedCodexHomePath: () => join(homes.system, 'legacy') })) -vi.mock('../codex/configuration/settings/codex-config-mirror', () => ({ +vi.mock('../../codex/configuration/settings/codex-config-mirror', () => ({ ensureCodexDaemonSocketGuard: vi.fn() })) diff --git a/src/main/startup/codex-launch-preparation.ts b/src/main/startup/agent-accounts/codex-launch-preparation.ts similarity index 82% rename from src/main/startup/codex-launch-preparation.ts rename to src/main/startup/agent-accounts/codex-launch-preparation.ts index b3c34371d83..61481b0896e 100644 --- a/src/main/startup/codex-launch-preparation.ts +++ b/src/main/startup/agent-accounts/codex-launch-preparation.ts @@ -1,5 +1,5 @@ -import { createCodexRuntimeHomeLaunchPreparation } from '../codex/configuration/homes/codex-runtime-home-launch-preparation' -import { mainProcessState as state } from './main-process-state' +import { createCodexRuntimeHomeLaunchPreparation } from '../../codex/configuration/homes/codex-runtime-home-launch-preparation' +import { mainProcessState as state } from '../main-process-state' export const prepareCodexRuntimeHomeForLaunch = createCodexRuntimeHomeLaunchPreparation({ getRuntimeHome: () => state.codexRuntimeHome, diff --git a/src/main/startup/codex-session-resume-daemon-guard.test.ts b/src/main/startup/agent-accounts/codex-session-resume-daemon-guard.test.ts similarity index 86% rename from src/main/startup/codex-session-resume-daemon-guard.test.ts rename to src/main/startup/agent-accounts/codex-session-resume-daemon-guard.test.ts index cddbb67aa12..71c56522328 100644 --- a/src/main/startup/codex-session-resume-daemon-guard.test.ts +++ b/src/main/startup/agent-accounts/codex-session-resume-daemon-guard.test.ts @@ -2,11 +2,11 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { VerifiedCodexResumeSource } from '../codex/history/resume/codex-session-resume-preparation' +import type { VerifiedCodexResumeSource } from '../../codex/history/resume/codex-session-resume-preparation' import { CODEX_DAEMON_OVERRIDE_MARKER, codexDaemonSocketPathExceedsLimit -} from '../codex/configuration/shared-server/codex-daemon-socket-path-guard' +} from '../../codex/configuration/shared-server/codex-daemon-socket-path-guard' const mocks = vi.hoisted(() => ({ hooksEnabled: false, @@ -20,30 +20,30 @@ const mocks = vi.hoisted(() => ({ })) vi.mock('electron', () => ({ app: { getPath: vi.fn(() => '/tmp/orca-user-data') } })) -vi.mock('../codex/hooks/installation/hook-service', () => ({ +vi.mock('../../codex/hooks/installation/hook-service', () => ({ codexHookService: { installForLaunchPrep: mocks.installForLaunchPrep, refreshRuntimeUserHooksForLaunchPrep: mocks.refreshRuntimeUserHooksForLaunchPrep } })) -vi.mock('../codex/hooks/reconciliation/codex-hook-reconcile', () => ({ +vi.mock('../../codex/hooks/reconciliation/codex-hook-reconcile', () => ({ reconcileCodexHooksForLaunch: mocks.reconcileCodexHooksForLaunch })) -vi.mock('../../shared/agent-hook-listener/configuration/agent-status-hooks-setting', () => ({ +vi.mock('../../../shared/agent-hook-listener/configuration/agent-status-hooks-setting', () => ({ isAgentStatusHooksEnabledForAgent: () => mocks.hooksEnabled })) -vi.mock('../codex/configuration/homes/codex-home-paths', async (importOriginal) => ({ +vi.mock('../../codex/configuration/homes/codex-home-paths', async (importOriginal) => ({ ...(await importOriginal()), getSystemCodexHomePath: () => mocks.systemHomePath, getOrcaManagedCodexHomePath: () => mocks.sharedHomePath })) -vi.mock('../codex/history/resume/codex-session-resume-preparation', () => ({ +vi.mock('../../codex/history/resume/codex-session-resume-preparation', () => ({ prepareCodexSessionResume: mocks.prepareCodexSessionResume })) -vi.mock('../codex/history/resume/codex-legacy-session-resume', () => ({ +vi.mock('../../codex/history/resume/codex-legacy-session-resume', () => ({ prepareLegacySharedCodexSessionResume: mocks.prepareLegacySharedCodexSessionResume })) -vi.mock('./main-process-state', () => ({ +vi.mock('../main-process-state', () => ({ mainProcessState: { codexRuntimeHome: { isHostSystemDefaultRealHomeSelected: () => false, diff --git a/src/main/startup/codex-session-resume-launch.ts b/src/main/startup/agent-accounts/codex-session-resume-launch.ts similarity index 59% rename from src/main/startup/codex-session-resume-launch.ts rename to src/main/startup/agent-accounts/codex-session-resume-launch.ts index f7634e5f440..879a8ab4e89 100644 --- a/src/main/startup/codex-session-resume-launch.ts +++ b/src/main/startup/agent-accounts/codex-session-resume-launch.ts @@ -1,5 +1,5 @@ -import { createCodexSessionResumeLaunchPreparation } from '../codex/history/resume/codex-session-resume-launch-preparation' -import { mainProcessState as state } from './main-process-state' +import { createCodexSessionResumeLaunchPreparation } from '../../codex/history/resume/codex-session-resume-launch-preparation' +import { mainProcessState as state } from '../main-process-state' const desktopResumeLaunch = createCodexSessionResumeLaunchPreparation({ getRuntimeHome: () => state.codexRuntimeHome, diff --git a/src/main/startup/main-process-account-services.ts b/src/main/startup/agent-accounts/main-process-account-services.ts similarity index 72% rename from src/main/startup/main-process-account-services.ts rename to src/main/startup/agent-accounts/main-process-account-services.ts index 399359df921..7cd4b959165 100644 --- a/src/main/startup/main-process-account-services.ts +++ b/src/main/startup/agent-accounts/main-process-account-services.ts @@ -1,21 +1,21 @@ import { app } from 'electron' -import { KeybindingService } from '../keybindings/keybinding-service' -import { createProviderAccountServices } from '../providers/accounts/provider-account-services' -import { createCodexSessionMigrationScheduler } from '../codex/history/backfill/codex-session-migration-scheduler' -import { startCodexSessionBackfillInBackground } from '../codex/history/backfill/codex-session-backfill' -import { startCodexSessionIndexHealInBackground } from '../codex/history/index/codex-session-index-heal' -import { startCodexStateDbBackfillRecoveryInBackground } from '../codex/history/index/codex-state-db-backfill-recovery' -import { getOrcaManagedCodexHomePath } from '../codex/configuration/homes/codex-home-paths' +import { KeybindingService } from '../../keybindings/keybinding-service' +import { createProviderAccountServices } from '../../providers/accounts/provider-account-services' +import { createCodexSessionMigrationScheduler } from '../../codex/history/backfill/codex-session-migration-scheduler' +import { startCodexSessionBackfillInBackground } from '../../codex/history/backfill/codex-session-backfill' +import { startCodexSessionIndexHealInBackground } from '../../codex/history/index/codex-session-index-heal' +import { startCodexStateDbBackfillRecoveryInBackground } from '../../codex/history/index/codex-state-db-backfill-recovery' +import { getOrcaManagedCodexHomePath } from '../../codex/configuration/homes/codex-home-paths' import { hasOpenCodeGoApiKey, readOpenCodeGoApiKey, saveOpenCodeGoApiKey -} from '../opencode/accounts/opencode-go-api-key-store' -import { agentHookServer } from '../agent-hooks/server/agent-hook-server' -import { resolveHostCodexSessionSourceHome } from '../codex/history/rollouts/codex-session-source-home' -import { browserManager } from '../browser/guest-lifecycle/manager/browser-manager' -import { prewarmStructuredAgentModelCatalogs } from '../runtime/agent-session/model-catalog/structured-agent-model-catalog-wiring' -import { mainProcessState as state } from './main-process-state' +} from '../../opencode/accounts/opencode-go-api-key-store' +import { agentHookServer } from '../../agent-hooks/server/agent-hook-server' +import { resolveHostCodexSessionSourceHome } from '../../codex/history/rollouts/codex-session-source-home' +import { browserManager } from '../../browser/guest-lifecycle/manager/browser-manager' +import { prewarmStructuredAgentModelCatalogs } from '../../runtime/agent-session/model-catalog/structured-agent-model-catalog-wiring' +import { mainProcessState as state } from '../main-process-state' // Settings that change which account or binary a new chat's agent runs under. const MODEL_CATALOG_ACCOUNT_SETTINGS = [ diff --git a/src/main/startup/disabled-chromium-features.ts b/src/main/startup/chromium-policy/disabled-chromium-features.ts similarity index 100% rename from src/main/startup/disabled-chromium-features.ts rename to src/main/startup/chromium-policy/disabled-chromium-features.ts diff --git a/src/main/startup/linear-regexp-fallback.ts b/src/main/startup/chromium-policy/linear-regexp-fallback.ts similarity index 100% rename from src/main/startup/linear-regexp-fallback.ts rename to src/main/startup/chromium-policy/linear-regexp-fallback.ts diff --git a/src/main/startup/chromium-policy/privileged-custom-schemes.ts b/src/main/startup/chromium-policy/privileged-custom-schemes.ts new file mode 100644 index 00000000000..dd155bc3341 --- /dev/null +++ b/src/main/startup/chromium-policy/privileged-custom-schemes.ts @@ -0,0 +1,14 @@ +import { BROWSER_EXTENSION_API_CUSTOM_SCHEME } from '../../browser/extensions/api-runtime/browser-extension-api-scheme' +import { JIRA_IMAGE_CUSTOM_SCHEME } from '../../jira/attachments/image-protocol' +import { MEDIA_PREVIEW_CUSTOM_SCHEME } from '../../media/media-preview-protocol' +import { PLUGIN_IMAGE_CUSTOM_SCHEME } from '../../plugins/plugin-image-scheme' +import { PLUGIN_FRAME_CUSTOM_SCHEME } from '../../plugins/panels/guest-isolation/plugin-frame-scheme' + +/** Registered with doc preview's in one call: each registerSchemesAsPrivileged call replaces the last. */ +export const PRIVILEGED_CUSTOM_SCHEMES: Electron.CustomScheme[] = [ + MEDIA_PREVIEW_CUSTOM_SCHEME, + JIRA_IMAGE_CUSTOM_SCHEME, + BROWSER_EXTENSION_API_CUSTOM_SCHEME, + PLUGIN_IMAGE_CUSTOM_SCHEME, + PLUGIN_FRAME_CUSTOM_SCHEME +] diff --git a/src/main/startup/renderer-heap-headroom.ts b/src/main/startup/chromium-policy/renderer-heap-headroom.ts similarity index 100% rename from src/main/startup/renderer-heap-headroom.ts rename to src/main/startup/chromium-policy/renderer-heap-headroom.ts diff --git a/src/main/startup/cli-command-names.ts b/src/main/startup/cli-launch/cli-command-names.ts similarity index 100% rename from src/main/startup/cli-command-names.ts rename to src/main/startup/cli-launch/cli-command-names.ts diff --git a/src/main/startup/cli-launch-redirect.ts b/src/main/startup/cli-launch/cli-launch-redirect.ts similarity index 96% rename from src/main/startup/cli-launch-redirect.ts rename to src/main/startup/cli-launch/cli-launch-redirect.ts index e156f0e3f29..d65041c4adf 100644 --- a/src/main/startup/cli-launch-redirect.ts +++ b/src/main/startup/cli-launch/cli-launch-redirect.ts @@ -1,11 +1,11 @@ import { existsSync } from 'node:fs' import { posix, resolve, win32 } from 'node:path' import { runProcessSync } from '@orca/process-host' -import { CLI_BOOLEAN_FLAGS, findCliCommandIndex } from '../../shared/cli-argument-boundary' -import { ELECTRON_NO_SANDBOX_REQUEST_ENV } from '../../shared/electron-no-sandbox-request' +import { CLI_BOOLEAN_FLAGS, findCliCommandIndex } from '../../../shared/cli-argument-boundary' +import { ELECTRON_NO_SANDBOX_REQUEST_ENV } from '../../../shared/electron-no-sandbox-request' import { CLI_COMMAND_NAMES } from './cli-command-names' -import { reexecHeadlessServeOnX11IfNeeded } from './headless-serve-x11-reexec' -import { argvRequestsServeMode, VALUE_TAKING_FLAGS } from './serve-mode-argv' +import { reexecHeadlessServeOnX11IfNeeded } from '../serve-launch/headless-serve-x11-reexec' +import { argvRequestsServeMode, VALUE_TAKING_FLAGS } from '../serve-launch/serve-mode-argv' export type CliLaunchRedirectResult = { redirected: false } | { redirected: true; status: number } diff --git a/src/main/startup/cloud-session-shutdown-flush.ts b/src/main/startup/cloud-startup/cloud-session-shutdown-flush.ts similarity index 71% rename from src/main/startup/cloud-session-shutdown-flush.ts rename to src/main/startup/cloud-startup/cloud-session-shutdown-flush.ts index 1809141e96a..e9114caadea 100644 --- a/src/main/startup/cloud-session-shutdown-flush.ts +++ b/src/main/startup/cloud-startup/cloud-session-shutdown-flush.ts @@ -1,5 +1,5 @@ import { powerMonitor } from 'electron' -import { flushUnsavedCloudSessions } from '../orca-profiles/cloud-session/profile-cloud-session-owner' +import { flushUnsavedCloudSessions } from '../../orca-profiles/cloud-session/profile-cloud-session-owner' // OS shutdown may skip before-quit and lose rotated tokens; Windows reports session-end per window. export function installCloudSessionShutdownFlush(): void { diff --git a/src/main/startup/main-process-connector-startup.ts b/src/main/startup/cloud-startup/main-process-connector-startup.ts similarity index 74% rename from src/main/startup/main-process-connector-startup.ts rename to src/main/startup/cloud-startup/main-process-connector-startup.ts index a2a94473576..58b46b681ad 100644 --- a/src/main/startup/main-process-connector-startup.ts +++ b/src/main/startup/cloud-startup/main-process-connector-startup.ts @@ -1,7 +1,7 @@ -import type { ConnectorCloud } from '../connector-cloud/connector-cloud' -import { createDesktopConnectorCloud } from '../connector-cloud/connector-cloud-install' -import { getProfileUserDataPath } from '../orca-profiles/profile-storage-paths' -import { mainProcessState as state } from './main-process-state' +import type { ConnectorCloud } from '../../connector-cloud/connector-cloud' +import { createDesktopConnectorCloud } from '../../connector-cloud/connector-cloud-install' +import { getProfileUserDataPath } from '../../orca-profiles/profile-storage-paths' +import { mainProcessState as state } from '../main-process-state' // Desktop only: the connector acts as the signed-in Orca account, which `orca serve` does not have yet. // Created before the window exists, so its sign-in and sign-out hooks always find it. diff --git a/src/main/startup/main-process-push-startup.ts b/src/main/startup/cloud-startup/main-process-push-startup.ts similarity index 66% rename from src/main/startup/main-process-push-startup.ts rename to src/main/startup/cloud-startup/main-process-push-startup.ts index 7ad0653356d..58e988d653d 100644 --- a/src/main/startup/main-process-push-startup.ts +++ b/src/main/startup/cloud-startup/main-process-push-startup.ts @@ -1,8 +1,8 @@ -import { getOrcaPushGatewayUrl } from '../orca-profiles/cloud-auth/profile-cloud-auth-config' -import { DesktopPushService } from '../runtime/push/desktop-push-service' -import type { OrcaRuntimeService } from '../runtime/orca-runtime' -import type { OrcaRuntimeRpcServer } from '../runtime/rpc/server/runtime-rpc' -import { mainProcessState as state } from './main-process-state' +import { getOrcaPushGatewayUrl } from '../../orca-profiles/cloud-auth/profile-cloud-auth-config' +import { DesktopPushService } from '../../runtime/push/desktop-push-service' +import type { OrcaRuntimeService } from '../../runtime/orca-runtime' +import type { OrcaRuntimeRpcServer } from '../../runtime/rpc/server/runtime-rpc' +import { mainProcessState as state } from '../main-process-state' // Push authenticates by host keypair, so accountless hosts must register phones too; shared startup state supplies the runtime in both modes. export function startDesktopPushService(runtimeRpc: OrcaRuntimeRpcServer): void { diff --git a/src/main/startup/main-process-relay-startup.ts b/src/main/startup/cloud-startup/main-process-relay-startup.ts similarity index 69% rename from src/main/startup/main-process-relay-startup.ts rename to src/main/startup/cloud-startup/main-process-relay-startup.ts index 539284e7580..89e8534643c 100644 --- a/src/main/startup/main-process-relay-startup.ts +++ b/src/main/startup/cloud-startup/main-process-relay-startup.ts @@ -1,11 +1,11 @@ import { app, powerMonitor } from 'electron' -import { getOrcaCloudAuthConfig } from '../orca-profiles/cloud-auth/profile-cloud-auth-config' -import { getProfileUserDataPath } from '../orca-profiles/profile-storage-paths' -import type { OrcaRuntimeRpcServer } from '../runtime/rpc/server/runtime-rpc' -import { DesktopRelayService } from '../runtime/mobile-cloud-relay/desktop-relay-service' -import { createDesktopRelayServiceInstaller } from '../runtime/mobile-cloud-relay/desktop-relay-service-installer' +import { getOrcaCloudAuthConfig } from '../../orca-profiles/cloud-auth/profile-cloud-auth-config' +import { getProfileUserDataPath } from '../../orca-profiles/profile-storage-paths' +import type { OrcaRuntimeRpcServer } from '../../runtime/rpc/server/runtime-rpc' +import { DesktopRelayService } from '../../runtime/mobile-cloud-relay/desktop-relay-service' +import { createDesktopRelayServiceInstaller } from '../../runtime/mobile-cloud-relay/desktop-relay-service-installer' import { publishDesktopRelayStatus } from './main-process-relay-status' -import { mainProcessState as state } from './main-process-state' +import { mainProcessState as state } from '../main-process-state' // Register before proxy readiness; the installer waits before its first request. export function startDesktopRelayService(runtimeRpc: OrcaRuntimeRpcServer): void { diff --git a/src/main/startup/main-process-relay-status.ts b/src/main/startup/cloud-startup/main-process-relay-status.ts similarity index 74% rename from src/main/startup/main-process-relay-status.ts rename to src/main/startup/cloud-startup/main-process-relay-status.ts index f53848fdf63..501026dfa46 100644 --- a/src/main/startup/main-process-relay-status.ts +++ b/src/main/startup/cloud-startup/main-process-relay-status.ts @@ -1,5 +1,5 @@ -import type { MobileRelayStatusDetail } from '../../shared/remote-runtime/relay/mobile-relay-status' -import { mainProcessState as state } from './main-process-state' +import type { MobileRelayStatusDetail } from '../../../shared/remote-runtime/relay/mobile-relay-status' +import { mainProcessState as state } from '../main-process-state' export function getDesktopRelayStatus(): MobileRelayStatusDetail { return { ...state.desktopRelayStatus } diff --git a/src/main/startup/configure-process-profile-state.test.ts b/src/main/startup/configure-process-profile-state.test.ts index 08db1989c61..693d2dff09f 100644 --- a/src/main/startup/configure-process-profile-state.test.ts +++ b/src/main/startup/configure-process-profile-state.test.ts @@ -25,7 +25,8 @@ afterEach(() => { describe('pre-ready profile-state recovery boundary', () => { it('ignores a matching marker when SQLite is missing but an export remains', async () => { const { shouldDisableHttp2ForElectronNetworking } = await import('./configure-process') - const { writeHttp1CompatibilityMarker } = await import('./http1-compatibility-marker') + const { writeHttp1CompatibilityMarker } = + await import('./network-compatibility/http1-compatibility-marker') const { profileStateJsonExportPath } = await import('../persistence/profile-state/legacy-json/profile-state-export-path') const userDataPath = mkdtempSync(join(tmpdir(), 'orca-http1-profile-')) diff --git a/src/main/startup/configure-process.test.ts b/src/main/startup/configure-process.test.ts index f9b8bf88ca2..80cbf4deefa 100644 --- a/src/main/startup/configure-process.test.ts +++ b/src/main/startup/configure-process.test.ts @@ -133,51 +133,6 @@ describe('patchPackagedProcessPath', () => { }) describe('configureDevUserDataPath', () => { - it('forces Electron home into the disposable E2E profile', async () => { - const { app } = await import('electron') - const { configureDevUserDataPath } = await import('./configure-process') - const originalE2EUserDataDir = process.env.ORCA_E2E_USER_DATA_DIR - const originalE2EHomeDir = process.env.ORCA_E2E_HOME_DIR - const originalHome = process.env.HOME - const originalUserProfile = process.env.USERPROFILE - const tempRoot = mkdtempSync(join(tmpdir(), 'orca-configure-e2e-home-')) - const e2eRoot = join(tempRoot, 'user-data') - const e2eHome = join(tempRoot, 'home') - process.env.ORCA_E2E_USER_DATA_DIR = e2eRoot - process.env.ORCA_E2E_HOME_DIR = e2eHome - process.env.HOME = e2eHome - process.env.USERPROFILE = e2eHome - - try { - configureDevUserDataPath(true) - } finally { - rmSync(tempRoot, { recursive: true, force: true }) - if (originalE2EUserDataDir === undefined) { - delete process.env.ORCA_E2E_USER_DATA_DIR - } else { - process.env.ORCA_E2E_USER_DATA_DIR = originalE2EUserDataDir - } - if (originalE2EHomeDir === undefined) { - delete process.env.ORCA_E2E_HOME_DIR - } else { - process.env.ORCA_E2E_HOME_DIR = originalE2EHomeDir - } - if (originalHome === undefined) { - delete process.env.HOME - } else { - process.env.HOME = originalHome - } - if (originalUserProfile === undefined) { - delete process.env.USERPROFILE - } else { - process.env.USERPROFILE = originalUserProfile - } - } - - expect(app.setPath).toHaveBeenCalledWith('home', e2eHome) - expect(app.setPath).toHaveBeenCalledWith('userData', e2eRoot) - }) - it('rejects an E2E launch whose Node home escaped the disposable profile', async () => { const { configureDevUserDataPath } = await import('./configure-process') const originalE2EUserDataDir = process.env.ORCA_E2E_USER_DATA_DIR @@ -293,7 +248,8 @@ describe('configureElectronNetworkCompatibility', () => { it('answers from the marker without reading the settings file', async () => { const { shouldDisableHttp2ForElectronNetworking } = await import('./configure-process') - const { writeHttp1CompatibilityMarker } = await import('./http1-compatibility-marker') + const { writeHttp1CompatibilityMarker } = + await import('./network-compatibility/http1-compatibility-marker') const userDataPath = createUserDataDir({ electronHttp1CompatibilityMode: false }) writeHttp1CompatibilityMarker(userDataPath, true) rmSync(join(userDataPath, 'orca-data.json'), { force: true }) @@ -311,7 +267,8 @@ describe('configureElectronNetworkCompatibility', () => { it('lets the environment override the marker', async () => { const { shouldDisableHttp2ForElectronNetworking } = await import('./configure-process') - const { writeHttp1CompatibilityMarker } = await import('./http1-compatibility-marker') + const { writeHttp1CompatibilityMarker } = + await import('./network-compatibility/http1-compatibility-marker') const userDataPath = createUserDataDir({}) writeHttp1CompatibilityMarker(userDataPath, true) @@ -322,7 +279,8 @@ describe('configureElectronNetworkCompatibility', () => { it('scopes a profile marker to the active profile before trusting it', async () => { const { shouldDisableHttp2ForElectronNetworking } = await import('./configure-process') - const { writeHttp1CompatibilityMarker } = await import('./http1-compatibility-marker') + const { writeHttp1CompatibilityMarker } = + await import('./network-compatibility/http1-compatibility-marker') const userDataPath = mkdtempSync(join(tmpdir(), 'orca-http1-profile-')) tempDirs.push(userDataPath) createProfileState(userDataPath, 'profile-b', { electronHttp1CompatibilityMode: false }) @@ -333,7 +291,8 @@ describe('configureElectronNetworkCompatibility', () => { it('uses a matching profile marker even when the legacy JSON is stale', async () => { const { shouldDisableHttp2ForElectronNetworking } = await import('./configure-process') - const { writeHttp1CompatibilityMarker } = await import('./http1-compatibility-marker') + const { writeHttp1CompatibilityMarker } = + await import('./network-compatibility/http1-compatibility-marker') const userDataPath = mkdtempSync(join(tmpdir(), 'orca-http1-profile-')) tempDirs.push(userDataPath) createProfileState(userDataPath, 'profile-b', { electronHttp1CompatibilityMode: false }) @@ -354,182 +313,3 @@ describe('configureElectronNetworkCompatibility', () => { expect(shouldDisableHttp2ForElectronNetworking({ env: {}, userDataPath })).toBe(false) }) }) - -describe('enableMainProcessGpuFeatures', () => { - const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform') - const originalE2EUserDataDir = process.env.ORCA_E2E_USER_DATA_DIR - - function setPlatform(platform: NodeJS.Platform): void { - Object.defineProperty(process, 'platform', { - configurable: true, - value: platform - }) - } - - afterEach(() => { - if (originalPlatform) { - Object.defineProperty(process, 'platform', originalPlatform) - } - if (originalE2EUserDataDir === undefined) { - delete process.env.ORCA_E2E_USER_DATA_DIR - } else { - process.env.ORCA_E2E_USER_DATA_DIR = originalE2EUserDataDir - } - }) - - it('disables the GPU sandbox on Linux Wayland without disabling acceleration', async () => { - const { app } = await import('electron') - const { enableMainProcessGpuFeatures } = await import('./configure-process') - const originalWaylandDisplay = process.env.WAYLAND_DISPLAY - - try { - setPlatform('linux') - delete process.env.ORCA_E2E_USER_DATA_DIR - process.env.WAYLAND_DISPLAY = 'wayland-1' - vi.mocked(app.disableHardwareAcceleration).mockClear() - vi.mocked(app.commandLine.appendSwitch).mockClear() - - enableMainProcessGpuFeatures() - } finally { - if (originalWaylandDisplay === undefined) { - delete process.env.WAYLAND_DISPLAY - } else { - process.env.WAYLAND_DISPLAY = originalWaylandDisplay - } - } - - expect(app.commandLine.appendSwitch).toHaveBeenCalledWith('disable-gpu-sandbox') - expect(app.disableHardwareAcceleration).not.toHaveBeenCalled() - expect(app.commandLine.appendSwitch).not.toHaveBeenCalledWith( - 'enable-features', - expect.stringContaining('EarlyEstablishGpuChannel') - ) - expect(app.commandLine.appendSwitch).not.toHaveBeenCalledWith( - 'enable-features', - expect.stringContaining('EstablishGpuChannelAsync') - ) - }) - - it('uses Electron Ozone hints to recognize forced Linux Wayland launches', async () => { - const { app } = await import('electron') - const { enableMainProcessGpuFeatures } = await import('./configure-process') - - setPlatform('linux') - delete process.env.ORCA_E2E_USER_DATA_DIR - vi.mocked(app.commandLine.appendSwitch).mockClear() - vi.mocked(app.commandLine.getSwitchValue).mockImplementation((switchName: string) => - switchName === 'ozone-platform' ? 'wayland' : '' - ) - - enableMainProcessGpuFeatures() - - expect(app.commandLine.appendSwitch).toHaveBeenCalledWith('disable-gpu-sandbox') - expect(app.commandLine.appendSwitch).not.toHaveBeenCalledWith( - 'enable-features', - expect.stringContaining('EarlyEstablishGpuChannel') - ) - }) - - it('honors explicit Linux X11 Ozone overrides even when Wayland env vars are present', async () => { - const { app } = await import('electron') - const { enableMainProcessGpuFeatures } = await import('./configure-process') - const originalWaylandDisplay = process.env.WAYLAND_DISPLAY - const originalSessionType = process.env.XDG_SESSION_TYPE - - try { - setPlatform('linux') - delete process.env.ORCA_E2E_USER_DATA_DIR - process.env.WAYLAND_DISPLAY = 'wayland-1' - process.env.XDG_SESSION_TYPE = 'wayland' - vi.mocked(app.commandLine.appendSwitch).mockClear() - vi.mocked(app.commandLine.getSwitchValue).mockImplementation((switchName: string) => - switchName === 'ozone-platform' ? 'x11' : '' - ) - - enableMainProcessGpuFeatures() - } finally { - if (originalWaylandDisplay === undefined) { - delete process.env.WAYLAND_DISPLAY - } else { - process.env.WAYLAND_DISPLAY = originalWaylandDisplay - } - if (originalSessionType === undefined) { - delete process.env.XDG_SESSION_TYPE - } else { - process.env.XDG_SESSION_TYPE = originalSessionType - } - } - - expect(app.commandLine.appendSwitch).not.toHaveBeenCalledWith('disable-gpu-sandbox') - expect(app.commandLine.appendSwitch).toHaveBeenCalledWith( - 'enable-features', - 'EarlyEstablishGpuChannel,EstablishGpuChannelAsync' - ) - }) - - it('does not disable the GPU sandbox outside Linux Wayland', async () => { - const { app } = await import('electron') - const { enableMainProcessGpuFeatures } = await import('./configure-process') - const originalWaylandDisplay = process.env.WAYLAND_DISPLAY - const originalSessionType = process.env.XDG_SESSION_TYPE - const originalOzoneHint = process.env.ELECTRON_OZONE_PLATFORM_HINT - - try { - delete process.env.ORCA_E2E_USER_DATA_DIR - delete process.env.WAYLAND_DISPLAY - delete process.env.XDG_SESSION_TYPE - delete process.env.ELECTRON_OZONE_PLATFORM_HINT - - for (const platform of ['linux', 'darwin', 'win32'] as const) { - setPlatform(platform) - vi.mocked(app.commandLine.appendSwitch).mockClear() - vi.mocked(app.commandLine.getSwitchValue).mockImplementation((switchName: string) => - switchName === 'enable-features' ? '' : '' - ) - - enableMainProcessGpuFeatures() - - expect(app.commandLine.appendSwitch).not.toHaveBeenCalledWith('disable-gpu-sandbox') - } - } finally { - if (originalWaylandDisplay === undefined) { - delete process.env.WAYLAND_DISPLAY - } else { - process.env.WAYLAND_DISPLAY = originalWaylandDisplay - } - if (originalSessionType === undefined) { - delete process.env.XDG_SESSION_TYPE - } else { - process.env.XDG_SESSION_TYPE = originalSessionType - } - if (originalOzoneHint === undefined) { - delete process.env.ELECTRON_OZONE_PLATFORM_HINT - } else { - process.env.ELECTRON_OZONE_PLATFORM_HINT = originalOzoneHint - } - } - }) - - it('disables the GPU process for Linux E2E runs', async () => { - const { app } = await import('electron') - const { enableMainProcessGpuFeatures } = await import('./configure-process') - - setPlatform('linux') - process.env.ORCA_E2E_USER_DATA_DIR = '/tmp/orca-e2e' - vi.mocked(app.disableHardwareAcceleration).mockClear() - vi.mocked(app.commandLine.appendSwitch).mockClear() - - enableMainProcessGpuFeatures() - - expect(app.disableHardwareAcceleration).toHaveBeenCalledTimes(1) - expect(app.commandLine.appendSwitch).toHaveBeenCalledWith('disable-gpu') - expect(app.commandLine.appendSwitch).not.toHaveBeenCalledWith( - 'enable-features', - expect.any(String) - ) - expect(app.commandLine.appendSwitch).not.toHaveBeenCalledWith( - 'max-active-webgl-contexts', - expect.any(String) - ) - }) -}) diff --git a/src/main/startup/configure-process.ts b/src/main/startup/configure-process.ts index 060967d63f2..ef4c976adc2 100644 --- a/src/main/startup/configure-process.ts +++ b/src/main/startup/configure-process.ts @@ -1,22 +1,22 @@ import { app } from 'electron' -import { guardExternalOpensInE2E } from './e2e-external-open-guard' -import { quitProcess } from './process-quit-request' +import { guardExternalOpensInE2E } from './testing/e2e-external-open-guard' +import { quitProcess } from './quit/process-quit-request' import { existsSync, mkdirSync } from 'node:fs' import { homedir } from 'node:os' import { join, resolve } from 'node:path' import { getVersionManagerBinPaths } from '../codex-cli/command' import { isWindowsFnmDefaultAliasDir } from '../../shared/fnm-default-alias-dirs' import { getMainE2EConfig } from './testing/e2e-config' -import { DISABLED_CHROMIUM_FEATURES } from './disabled-chromium-features' -import { readHttp1CompatibilityMarker } from './http1-compatibility-marker' -import { checkServeUserDataPath } from './serve-user-data-path-guard' +import { DISABLED_CHROMIUM_FEATURES } from './chromium-policy/disabled-chromium-features' +import { readHttp1CompatibilityMarker } from './network-compatibility/http1-compatibility-marker' +import { checkServeUserDataPath } from './serve-launch/serve-user-data-path-guard' import { stampRuntimeSourceEnv } from '../../shared/runtime-source-env' import { isLinuxWaylandSession } from '../../shared/linux-wayland-session' import { hasMissingProfileStateDatabaseWithRetainedAuthority, readActiveProfileId, readPersistedHttp1CompatibilityMode -} from './http1-compatibility-profile-state' +} from './network-compatibility/http1-compatibility-profile-state' const DEV_PARENT_SHUTDOWN_GRACE_MS = 3000 const HTTP1_COMPATIBILITY_ENV_VAR = 'ORCA_DISABLE_HTTP2' diff --git a/src/main/startup/event-loop-stall-probe.ts b/src/main/startup/diagnostics/event-loop-stall-probe.ts similarity index 100% rename from src/main/startup/event-loop-stall-probe.ts rename to src/main/startup/diagnostics/event-loop-stall-probe.ts diff --git a/src/main/startup/startup-diagnostics.ts b/src/main/startup/diagnostics/startup-diagnostics.ts similarity index 100% rename from src/main/startup/startup-diagnostics.ts rename to src/main/startup/diagnostics/startup-diagnostics.ts diff --git a/src/main/startup/e2e-external-open-guard.test.ts b/src/main/startup/e2e-external-open-guard.test.ts deleted file mode 100644 index 8a1d224bd74..00000000000 --- a/src/main/startup/e2e-external-open-guard.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { expect, it, vi } from 'vitest' - -const openExternal = vi.hoisted(() => vi.fn()) -vi.mock('electron', () => ({ shell: { openExternal } })) - -const { shell } = await import('electron') -const { guardExternalOpensInE2E } = await import('./e2e-external-open-guard') - -it("never opens the tester's browser or mail client in an e2e launch", async () => { - vi.spyOn(console, 'info').mockImplementation(() => undefined) - guardExternalOpensInE2E() - await shell.openExternal('mailto:a@example.com') - await shell.openExternal('https://example.com') - expect(openExternal).not.toHaveBeenCalled() -}) diff --git a/src/main/startup/ensure-virtual-display.test.ts b/src/main/startup/ensure-virtual-display.test.ts deleted file mode 100644 index b4ed9d23726..00000000000 --- a/src/main/startup/ensure-virtual-display.test.ts +++ /dev/null @@ -1,690 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' - -const { spawnMock, existsSyncMock, readFileSyncMock, rmSyncMock, statSyncMock, appMock } = - vi.hoisted(() => ({ - spawnMock: vi.fn(), - existsSyncMock: vi.fn(), - readFileSyncMock: vi.fn(), - rmSyncMock: vi.fn(), - statSyncMock: vi.fn(), - appMock: { - disableHardwareAcceleration: vi.fn(), - commandLine: { appendSwitch: vi.fn(), getSwitchValue: vi.fn() }, - once: vi.fn() - } - })) - -vi.mock('child_process', () => ({ spawn: spawnMock })) -vi.mock('fs', () => ({ - existsSync: existsSyncMock, - readFileSync: readFileSyncMock, - rmSync: rmSyncMock, - statSync: statSyncMock -})) -vi.mock('electron', () => ({ app: appMock })) - -const OWN_UID = 1000 -const OTHER_UID = 1001 -const ORIGINAL_PLATFORM = process.platform -const ORIGINAL_GETUID = Object.getOwnPropertyDescriptor(process, 'getuid') -const ORIGINAL_DISPLAY = process.env.DISPLAY - -function setPlatform(platform: NodeJS.Platform): void { - Object.defineProperty(process, 'platform', { value: platform, configurable: true }) - // Simulated Linux still needs a UID when the Windows test host lacks getuid. - Object.defineProperty(process, 'getuid', { - value: () => OWN_UID, - configurable: true, - writable: true - }) -} - -function mockLiveXDisplay(pid = 4321): void { - statSyncMock.mockReturnValue({ isSocket: () => true, uid: OWN_UID }) - existsSyncMock.mockReturnValue(true) - readFileSyncMock.mockReturnValue(`${pid}\n`) - vi.spyOn(process, 'kill').mockImplementation(() => true) -} - -function mockXvfbTakesDisplay(pid = 1234): void { - let bound = false - statSyncMock.mockImplementation(() => ({ isSocket: () => true, uid: OWN_UID })) - readFileSyncMock.mockImplementation(() => { - if (!bound) { - throw Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - } - return `${pid}\n` - }) - vi.spyOn(process, 'kill').mockImplementation(() => true) - spawnMock.mockImplementation(() => { - bound = true - return { pid, once: vi.fn(), kill: vi.fn(), killed: false } - }) -} - -describe('ensureVirtualDisplayForHeadlessServe', () => { - beforeEach(() => { - spawnMock.mockReset() - existsSyncMock.mockReset() - readFileSyncMock.mockReset() - rmSyncMock.mockReset() - statSyncMock.mockReset() - appMock.disableHardwareAcceleration.mockReset() - appMock.commandLine.appendSwitch.mockReset() - appMock.commandLine.getSwitchValue.mockReset().mockReturnValue('') - appMock.once.mockReset() - delete process.env.DISPLAY - }) - - afterEach(async () => { - const { stopVirtualDisplay } = await import('./ensure-virtual-display') - process.removeListener('exit', stopVirtualDisplay) - stopVirtualDisplay() - vi.restoreAllMocks() - setPlatform(ORIGINAL_PLATFORM) - if (ORIGINAL_GETUID) { - Object.defineProperty(process, 'getuid', ORIGINAL_GETUID) - } else { - Reflect.deleteProperty(process, 'getuid') - } - if (ORIGINAL_DISPLAY === undefined) { - delete process.env.DISPLAY - } else { - process.env.DISPLAY = ORIGINAL_DISPLAY - } - }) - - it('is a no-op (supported) on non-Linux platforms', async () => { - setPlatform('darwin') - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(true) - expect(spawnMock).not.toHaveBeenCalled() - }) - - it('does not start a display outside serve mode on Linux', async () => { - setPlatform('linux') - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: false })).toBe(false) - expect(spawnMock).not.toHaveBeenCalled() - }) - - it('reuses an externally provided DISPLAY without starting Xvfb', async () => { - setPlatform('linux') - process.env.DISPLAY = ':0' - mockLiveXDisplay() - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(true) - expect(spawnMock).not.toHaveBeenCalled() - expect(process.env.DISPLAY).toBe(':0') - expect(appMock.disableHardwareAcceleration).toHaveBeenCalled() - expect(appMock.commandLine.appendSwitch).toHaveBeenCalledWith('disable-dev-shm-usage') - expect(appMock.commandLine.appendSwitch).toHaveBeenCalledWith('disable-gpu') - }) - - it('keeps hardware acceleration when ORCA_SERVE_GPU=1 opts in', async () => { - setPlatform('linux') - process.env.DISPLAY = ':0' - vi.stubEnv('ORCA_SERVE_GPU', '1') - mockLiveXDisplay() - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - try { - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(true) - } finally { - vi.unstubAllEnvs() - } - expect(appMock.disableHardwareAcceleration).not.toHaveBeenCalled() - expect(appMock.commandLine.appendSwitch).toHaveBeenCalledWith('disable-dev-shm-usage') - expect(appMock.commandLine.appendSwitch).not.toHaveBeenCalledWith('disable-gpu') - }) - - it('reports unsupported when Xvfb cannot be launched', async () => { - setPlatform('linux') - statSyncMock.mockImplementation(() => { - throw Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - }) - spawnMock.mockReturnValue({ pid: undefined, once: vi.fn(), kill: vi.fn(), killed: false }) - const { - ensureVirtualDisplayForHeadlessServe, - MISSING_LINUX_DISPLAY_MESSAGE, - MISSING_SERVE_DISPLAY_MESSAGE, - missingLinuxDisplayMessage - } = await import('./ensure-virtual-display') - - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(false) - expect(spawnMock).toHaveBeenCalledWith('Xvfb', expect.any(Array), expect.any(Object)) - expect(MISSING_LINUX_DISPLAY_MESSAGE).toContain('endpoint is unavailable') - expect(MISSING_LINUX_DISPLAY_MESSAGE).toContain('XDG_RUNTIME_DIR') - for (const message of [MISSING_LINUX_DISPLAY_MESSAGE, MISSING_SERVE_DISPLAY_MESSAGE]) { - expect(message).toContain('`xvfb` on Debian/Ubuntu') - expect(message).toContain('`xorg-x11-server-Xvfb`') - expect(message).toContain('`xorg-server-xvfb` on Arch') - } - expect(MISSING_SERVE_DISPLAY_MESSAGE).not.toContain('orca-ide serve') - expect(MISSING_SERVE_DISPLAY_MESSAGE).toContain('Wayland alone is not enough') - expect(missingLinuxDisplayMessage(true)).toBe(MISSING_SERVE_DISPLAY_MESSAGE) - expect(missingLinuxDisplayMessage(false)).toBe(MISSING_LINUX_DISPLAY_MESSAGE) - }) - - it('leaves an externally configured stale display untouched', async () => { - setPlatform('linux') - process.env.DISPLAY = ':77' - statSyncMock.mockReturnValue({ isSocket: () => true, uid: OWN_UID }) - existsSyncMock.mockReturnValue(true) - readFileSyncMock.mockImplementation(() => { - throw new Error('display lock is outside this namespace') - }) - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(false) - expect(spawnMock).not.toHaveBeenCalled() - expect(rmSyncMock).not.toHaveBeenCalled() - expect(process.env.DISPLAY).toBe(':77') - }) - - // #15084: containers may expose an external X socket without its host lock/PID. - it('serves on an externally configured display that has no lock file', async () => { - setPlatform('linux') - process.env.DISPLAY = ':0' - statSyncMock.mockReturnValue({ isSocket: () => true, uid: OWN_UID }) - readFileSyncMock.mockImplementation(() => { - throw Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - }) - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(true) - expect(spawnMock).not.toHaveBeenCalled() - expect(rmSyncMock).not.toHaveBeenCalled() - expect(process.env.DISPLAY).toBe(':0') - }) - - // Cleanup unlinks lock first; trusting Orca's own lockless :99 would revive an orphan socket. - it('does not adopt its own :99 socket when the lock is missing', async () => { - setPlatform('linux') - existsSyncMock.mockReturnValue(true) - mockXvfbTakesDisplay() - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(true) - expect(rmSyncMock).toHaveBeenCalled() - expect(spawnMock).toHaveBeenCalledWith( - 'Xvfb', - expect.arrayContaining([':99']), - expect.any(Object) - ) - }) - - it('reuses an existing virtual display only when its X server is alive', async () => { - setPlatform('linux') - statSyncMock.mockReturnValue({ isSocket: () => true, uid: OWN_UID }) - existsSyncMock.mockReturnValue(true) - readFileSyncMock.mockReturnValue('4321\n') - const killSpy = vi.spyOn(process, 'kill').mockReturnValue(true as never) // PID alive - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(true) - expect(killSpy).toHaveBeenCalledWith(4321, 0) - expect(spawnMock).not.toHaveBeenCalled() - expect(rmSyncMock).not.toHaveBeenCalled() - expect(process.env.DISPLAY).toBe(':99') - killSpy.mockRestore() - }) - - it('treats a stale socket (dead server) as no display and starts a fresh Xvfb', async () => { - setPlatform('linux') - existsSyncMock.mockReturnValue(true) - let bound = false - statSyncMock.mockImplementation(() => ({ isSocket: () => true, uid: OWN_UID })) - readFileSyncMock.mockImplementation(() => (bound ? '1234\n' : '9999\n')) - // Only the newly spawned Xvfb is alive; the orphan lock PID is dead. - const killSpy = vi.spyOn(process, 'kill').mockImplementation((pid) => { - if (pid === 9999) { - throw new Error('ESRCH') - } - return true as never - }) - spawnMock.mockImplementation(() => { - bound = true - return { pid: 1234, once: vi.fn(), kill: vi.fn(), killed: false } - }) - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(true) - expect(rmSyncMock).toHaveBeenCalled() - expect(spawnMock).toHaveBeenCalledWith( - 'Xvfb', - expect.arrayContaining([':99', '-terminate']), - expect.objectContaining({ detached: true }) - ) - expect(process.env.DISPLAY).toBe(':99') - killSpy.mockRestore() - }) - - // A foreign stale socket can prevent bind; trusting it advertised a dead display and crashed Ozone initialization. - it('reports failure when a stale socket blocks the Xvfb rebind', async () => { - setPlatform('linux') - statSyncMock.mockReturnValue({ isSocket: () => true, uid: OWN_UID }) - // Foreign ownership prevents unlink and Xvfb never acquires the display. - rmSyncMock.mockImplementation(() => { - throw Object.assign(new Error('permission denied'), { code: 'EACCES' }) - }) - readFileSyncMock.mockImplementation(() => { - throw Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - }) - spawnMock.mockReturnValue({ pid: 4242, once: vi.fn(), kill: vi.fn(), killed: false }) - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - vi.useFakeTimers({ toFake: ['Date'] }) - const sleep = vi - .spyOn(Atomics, 'wait') - .mockImplementation((_array, _index, _value, timeout) => { - vi.setSystemTime(Date.now() + (timeout ?? 0)) - return 'timed-out' - }) - try { - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(false) - expect(process.env.DISPLAY).toBeUndefined() - } finally { - sleep.mockRestore() - vi.useRealTimers() - } - }) - - it('accepts the display once the spawned Xvfb owns its lock', async () => { - setPlatform('linux') - let lockWritten = false - statSyncMock.mockImplementation(() => ({ isSocket: () => lockWritten, uid: OWN_UID })) - rmSyncMock.mockImplementation(() => {}) - readFileSyncMock.mockImplementation(() => { - if (!lockWritten) { - throw Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - } - return '4242\n' - }) - vi.spyOn(process, 'kill').mockImplementation(() => true) - spawnMock.mockImplementation(() => { - lockWritten = true - return { pid: 4242, once: vi.fn(), kill: vi.fn(), killed: false } - }) - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(true) - expect(process.env.DISPLAY).toBe(':99') - }) - - describe('with several accounts on one machine (#26602)', () => { - type FakeDisplay = { uid: number; lockPid: number | null; socket: boolean } - - // Model independent artifacts/ownership for each candidate display. - function mockDisplays(displays: Record, alivePids: number[]): void { - const displayOf = (path: string): FakeDisplay | undefined => { - const match = /(?:\.X(\d+)-lock|X11-unix\/X(\d+))$/.exec(path) - return match ? displays[Number(match[1] ?? match[2])] : undefined - } - const enoent = () => Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - statSyncMock.mockImplementation((path: string) => { - const display = displayOf(path) - const isLock = path.endsWith('-lock') - if (!display || (isLock ? display.lockPid === null : !display.socket)) { - throw enoent() - } - return { uid: display.uid, isSocket: () => !isLock } - }) - readFileSyncMock.mockImplementation((path: string) => { - if (path === '/proc/net/unix') { - return '' - } - const display = displayOf(path) - if (!display || display.lockPid === null) { - throw enoent() - } - return `${display.lockPid}\n` - }) - vi.spyOn(process, 'kill').mockImplementation((pid) => { - if (!alivePids.includes(Number(pid))) { - throw Object.assign(new Error('ESRCH'), { code: 'ESRCH' }) - } - return true - }) - let nextPid = 5000 - spawnMock.mockImplementation((_command: string, args: string[]) => { - const pid = nextPid++ - alivePids.push(pid) - const displayNumber = Number(args[0].slice(1)) - if (!displays[displayNumber]) { - displays[displayNumber] = { uid: OWN_UID, lockPid: pid, socket: true } - } - return { pid, once: vi.fn(), kill: vi.fn(), killed: false } - }) - } - - it("starts its own display instead of attaching to another account's live :99", async () => { - setPlatform('linux') - mockDisplays({ 99: { uid: OTHER_UID, lockPid: 777, socket: true } }, [777]) - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(true) - expect(process.env.DISPLAY).toBe(':100') - expect(spawnMock).toHaveBeenCalledWith( - 'Xvfb', - expect.arrayContaining([':100']), - expect.any(Object) - ) - expect(rmSyncMock).not.toHaveBeenCalled() - }) - - it("skips another account's stale :99 that sticky /tmp keeps it from removing", async () => { - setPlatform('linux') - mockDisplays({ 99: { uid: OTHER_UID, lockPid: 777, socket: true } }, []) - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(true) - expect(process.env.DISPLAY).toBe(':100') - expect(rmSyncMock).not.toHaveBeenCalled() - }) - - it('reuses its own live display past the ones other accounts hold', async () => { - setPlatform('linux') - mockDisplays( - { - 99: { uid: OTHER_UID, lockPid: 777, socket: true }, - 100: { uid: OWN_UID, lockPid: 888, socket: true } - }, - [777, 888] - ) - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(true) - expect(process.env.DISPLAY).toBe(':100') - expect(spawnMock).not.toHaveBeenCalled() - }) - - it("leaves its own account's display alone while that server is still starting", async () => { - setPlatform('linux') - // :99 has its live lock but no socket yet. - mockDisplays({ 99: { uid: OWN_UID, lockPid: 888, socket: false } }, [888]) - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(true) - expect(process.env.DISPLAY).toBe(':100') - expect(rmSyncMock).not.toHaveBeenCalled() - }) - - it('does not accept a spawned Xvfb that died after writing its lock and socket', async () => { - setPlatform('linux') - const alive: number[] = [] - mockDisplays({}, alive) - const startXvfb = spawnMock.getMockImplementation()! - spawnMock.mockImplementation((command: string, args: string[]) => { - const child = startXvfb(command, args) - alive.splice(alive.indexOf(child.pid), 1) - return child - }) - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - vi.useFakeTimers({ toFake: ['Date'] }) - const sleep = vi - .spyOn(Atomics, 'wait') - .mockImplementation((_array, _index, _value, timeout) => { - vi.setSystemTime(Date.now() + (timeout ?? 0)) - return 'timed-out' - }) - try { - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(false) - expect(process.env.DISPLAY).toBeUndefined() - } finally { - sleep.mockRestore() - vi.useRealTimers() - } - }) - - it('moves on when another server wins the free display first', async () => { - setPlatform('linux') - const displays: Record = {} - mockDisplays(displays, [777]) - const startXvfb = spawnMock.getMockImplementation()! - spawnMock.mockImplementationOnce((command: string, args: string[]) => { - // Model another account winning the bind race. - displays[99] = { uid: OTHER_UID, lockPid: 777, socket: true } - return startXvfb(command, args) - }) - const { ensureVirtualDisplayForHeadlessServe } = await import('./ensure-virtual-display') - - expect(ensureVirtualDisplayForHeadlessServe({ isServeMode: true })).toBe(true) - expect(process.env.DISPLAY).toBe(':100') - expect(spawnMock).toHaveBeenCalledTimes(2) - }) - }) - - describe('hasUsableLinuxDisplay', () => { - it('accepts live local X11 and Wayland sockets', async () => { - setPlatform('linux') - mockLiveXDisplay() - const { hasUsableLinuxDisplay } = await import('./ensure-virtual-display') - - expect(hasUsableLinuxDisplay({ DISPLAY: ':0' })).toBe(true) - expect( - hasUsableLinuxDisplay({ - WAYLAND_DISPLAY: 'wayland-0', - XDG_RUNTIME_DIR: '/run/user/1000' - }) - ).toBe(true) - expect(statSyncMock).toHaveBeenCalledWith('/tmp/.X11-unix/X0') - expect(statSyncMock).toHaveBeenCalledWith('/run/user/1000/wayland-0') - }) - - // Abstract sockets are kernel-owned and vanish on exit, so their presence proves a live server. - it('accepts an abstract-namespace X socket with no filesystem socket', async () => { - setPlatform('linux') - statSyncMock.mockImplementation(() => { - throw Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - }) - readFileSyncMock.mockImplementation((path: string) => { - if (path === '/proc/net/unix') { - return [ - 'Num RefCount Protocol Flags Type St Inode Path', - '0000000000000000: 00000003 00000000 00000000 0001 03 12014 @/tmp/.X11-unix/X0', - '' - ].join('\n') - } - throw Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - }) - const { hasUsableLinuxDisplay } = await import('./ensure-virtual-display') - - expect(hasUsableLinuxDisplay({ DISPLAY: ':0' })).toBe(true) - }) - - it('does not confuse a different display number in the abstract table', async () => { - setPlatform('linux') - statSyncMock.mockImplementation(() => { - throw Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - }) - readFileSyncMock.mockImplementation((path: string) => { - if (path === '/proc/net/unix') { - return '0000000000000000: 00000003 00000000 00000000 0001 03 12014 @/tmp/.X11-unix/X10\n' - } - throw Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - }) - const { hasUsableLinuxDisplay } = await import('./ensure-virtual-display') - - expect(hasUsableLinuxDisplay({ DISPLAY: ':1' })).toBe(false) - }) - - it('accepts an inherited WAYLAND_SOCKET fd with no WAYLAND_DISPLAY', async () => { - setPlatform('linux') - statSyncMock.mockImplementation(() => { - throw Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - }) - readFileSyncMock.mockImplementation(() => { - throw Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - }) - const { hasUsableLinuxDisplay } = await import('./ensure-virtual-display') - - expect(hasUsableLinuxDisplay({ WAYLAND_SOCKET: '7' })).toBe(true) - expect(hasUsableLinuxDisplay({ WAYLAND_SOCKET: 'not-an-fd' })).toBe(false) - }) - - // Own lockless :99 can be half-finished teardown even when inherited DISPLAY names it. - it('does not trust a lockless socket on its own managed display number', async () => { - setPlatform('linux') - statSyncMock.mockReturnValue({ isSocket: () => true, uid: OWN_UID }) - readFileSyncMock.mockImplementation(() => { - throw Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - }) - const { hasUsableLinuxDisplay } = await import('./ensure-virtual-display') - - expect(hasUsableLinuxDisplay({ DISPLAY: ':99' })).toBe(false) - expect(hasUsableLinuxDisplay({ DISPLAY: ':0' })).toBe(true) - }) - - it('rejects an orphaned local X11 socket whose server PID is gone', async () => { - setPlatform('linux') - statSyncMock.mockReturnValue({ isSocket: () => true, uid: OWN_UID }) - existsSyncMock.mockReturnValue(true) - readFileSyncMock.mockReturnValue('9999\n') - vi.spyOn(process, 'kill').mockImplementation(() => { - throw Object.assign(new Error('no such process'), { code: 'ESRCH' }) - }) - const { hasUsableLinuxDisplay } = await import('./ensure-virtual-display') - - expect(hasUsableLinuxDisplay({ DISPLAY: ':77' })).toBe(false) - expect(readFileSyncMock).toHaveBeenCalledWith('/tmp/.X77-lock', 'utf8') - }) - - // External lockless sockets can come from container mounts/WSLg; a crashed local X server leaves its lock too. - it('accepts a local X11 socket published without a lock file', async () => { - setPlatform('linux') - statSyncMock.mockReturnValue({ isSocket: () => true, uid: OWN_UID }) - readFileSyncMock.mockImplementation(() => { - throw Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - }) - const killSpy = vi.spyOn(process, 'kill') - const { hasUsableLinuxDisplay } = await import('./ensure-virtual-display') - - expect(hasUsableLinuxDisplay({ DISPLAY: ':0' })).toBe(true) - expect(hasUsableLinuxDisplay({ DISPLAY: ':100' })).toBe(true) - expect(killSpy).not.toHaveBeenCalled() - }) - - // Pinned X11 cannot rely on a Wayland fallback in WSLg. - it('accepts a lockless X11 socket when x11 is pinned and Wayland is unavailable', async () => { - setPlatform('linux') - statSyncMock.mockImplementation((path: string) => ({ - isSocket: () => path === '/tmp/.X11-unix/X0' - })) - readFileSyncMock.mockImplementation(() => { - throw Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - }) - const { hasUsableLinuxDisplay } = await import('./ensure-virtual-display') - - expect(hasUsableLinuxDisplay({ DISPLAY: ':0', ELECTRON_OZONE_PLATFORM_HINT: 'x11' })).toBe( - true - ) - }) - - it('still rejects a missing socket even when no lock file exists', async () => { - setPlatform('linux') - statSyncMock.mockReturnValue({ isSocket: () => false }) - readFileSyncMock.mockImplementation(() => { - throw Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - }) - const { hasUsableLinuxDisplay } = await import('./ensure-virtual-display') - - expect(hasUsableLinuxDisplay({ DISPLAY: ':0' })).toBe(false) - }) - - it('rejects a lock that exists but cannot be read', async () => { - setPlatform('linux') - statSyncMock.mockReturnValue({ isSocket: () => true, uid: OWN_UID }) - readFileSyncMock.mockImplementation(() => { - throw Object.assign(new Error('permission denied'), { code: 'EACCES' }) - }) - const { hasUsableLinuxDisplay } = await import('./ensure-virtual-display') - - expect(hasUsableLinuxDisplay({ DISPLAY: ':0' })).toBe(false) - }) - - it('accepts a live local X11 server owned by another user', async () => { - setPlatform('linux') - statSyncMock.mockReturnValue({ isSocket: () => true, uid: OWN_UID }) - existsSyncMock.mockReturnValue(true) - readFileSyncMock.mockReturnValue('4321\n') - vi.spyOn(process, 'kill').mockImplementation(() => { - throw Object.assign(new Error('not permitted'), { code: 'EPERM' }) - }) - const { hasUsableLinuxDisplay } = await import('./ensure-virtual-display') - - expect(hasUsableLinuxDisplay({ DISPLAY: ':0' })).toBe(true) - }) - - it('rejects absent, blank, and stale local displays', async () => { - setPlatform('linux') - statSyncMock.mockImplementation(() => { - throw new Error('ENOENT') - }) - const { hasUsableLinuxDisplay } = await import('./ensure-virtual-display') - - expect(hasUsableLinuxDisplay({})).toBe(false) - expect(hasUsableLinuxDisplay({ DISPLAY: ' ', WAYLAND_DISPLAY: '' })).toBe(false) - expect(hasUsableLinuxDisplay({ DISPLAY: ':77' })).toBe(false) - expect( - hasUsableLinuxDisplay({ WAYLAND_DISPLAY: 'wayland-0', XDG_RUNTIME_DIR: '/run/user/1000' }) - ).toBe(false) - expect(hasUsableLinuxDisplay({ WAYLAND_DISPLAY: 'wayland-0' })).toBe(false) - }) - - it.each([ - ['localhost:10.0', true], - ['build-host.example:1', true], - ['[2001:db8::1]:2.0', true], - ['tcp/build-host.example:3', true], - ['garbage', false], - ['build host:1', false], - ['build-host.example:', false], - ['build-host.example:abc', false] - ])('validates remote X display syntax for %s', async (display, expected) => { - setPlatform('linux') - const { hasUsableLinuxDisplay } = await import('./ensure-virtual-display') - - expect(hasUsableLinuxDisplay({ DISPLAY: display })).toBe(expected) - expect(statSyncMock).not.toHaveBeenCalled() - }) - - it('honors forced X11 and Wayland platform selection', async () => { - setPlatform('linux') - statSyncMock.mockImplementation((path: string) => ({ - isSocket: () => path === '/run/user/1000/wayland-0' - })) - const { hasUsableLinuxDisplay } = await import('./ensure-virtual-display') - const env = { - DISPLAY: ':77', - WAYLAND_DISPLAY: 'wayland-0', - XDG_RUNTIME_DIR: '/run/user/1000' - } - - appMock.commandLine.getSwitchValue.mockReturnValue('x11') - expect(hasUsableLinuxDisplay(env)).toBe(false) - appMock.commandLine.getSwitchValue.mockReturnValue('wayland') - expect(hasUsableLinuxDisplay(env)).toBe(true) - - statSyncMock.mockImplementation((path: string) => ({ - isSocket: () => path === '/tmp/.X11-unix/X0' - })) - expect(hasUsableLinuxDisplay({ ...env, DISPLAY: ':0' })).toBe(false) - - appMock.commandLine.getSwitchValue.mockReturnValue('') - expect(hasUsableLinuxDisplay({ ...env, ELECTRON_OZONE_PLATFORM_HINT: 'x11' })).toBe(false) - }) - - it('never gates a non-Linux platform', async () => { - setPlatform('darwin') - const { hasUsableLinuxDisplay } = await import('./ensure-virtual-display') - - expect(hasUsableLinuxDisplay({})).toBe(true) - expect(statSyncMock).not.toHaveBeenCalled() - }) - }) -}) diff --git a/src/main/startup/gpu-fallback-marker.test.ts b/src/main/startup/gpu-recovery/gpu-fallback-marker.test.ts similarity index 100% rename from src/main/startup/gpu-fallback-marker.test.ts rename to src/main/startup/gpu-recovery/gpu-fallback-marker.test.ts diff --git a/src/main/startup/gpu-fallback-marker.ts b/src/main/startup/gpu-recovery/gpu-fallback-marker.ts similarity index 100% rename from src/main/startup/gpu-fallback-marker.ts rename to src/main/startup/gpu-recovery/gpu-fallback-marker.ts diff --git a/src/main/startup/gpu-fallback-switches.ts b/src/main/startup/gpu-recovery/gpu-fallback-switches.ts similarity index 100% rename from src/main/startup/gpu-fallback-switches.ts rename to src/main/startup/gpu-recovery/gpu-fallback-switches.ts diff --git a/src/main/startup/gpu-lifecycle-install-dir-acl-guard.test.ts b/src/main/startup/gpu-recovery/gpu-lifecycle-install-dir-acl-guard.test.ts similarity index 62% rename from src/main/startup/gpu-lifecycle-install-dir-acl-guard.test.ts rename to src/main/startup/gpu-recovery/gpu-lifecycle-install-dir-acl-guard.test.ts index 32983147666..753ec176d41 100644 --- a/src/main/startup/gpu-lifecycle-install-dir-acl-guard.test.ts +++ b/src/main/startup/gpu-recovery/gpu-lifecycle-install-dir-acl-guard.test.ts @@ -26,27 +26,23 @@ vi.mock('electron', () => ({ dialog: { showMessageBox } })) -import { grantsFrom } from './windows-install-dir-acl.test-fixture' +import { grantsFrom } from '../windows-install-permissions/windows-install-dir-acl.test-fixture' import { DEFAULT_GPU_CRASH_FALLBACK_THRESHOLD, DEFAULT_GPU_CRASH_FALLBACK_WINDOW_MS, GpuCrashFallbackTracker -} from '../crash-reporting/recovery/gpu-crash-fallback-decision' -import { - readGpuFallbackMarker, - writeGpuFallbackMarker, - type GpuFallbackMarker -} from './gpu-fallback-marker' -import { handleGpuChildCrash, presentGpuFallbackRecoveredLaunchPrompt } from './gpu-lifecycle' -import { gpuFallbackEnvironment, mainProcessState as state } from './main-process-state' -import './windows-install-dir-acl-poison-marker' +} from '../../crash-reporting/recovery/gpu-crash-fallback-decision' +import { readGpuFallbackMarker } from './gpu-fallback-marker' +import { handleGpuChildCrash } from './gpu-lifecycle' +import { mainProcessState as state } from '../main-process-state' +import '../windows-install-permissions/windows-install-dir-acl-poison-marker' import { isInstallDirAclRepairPending, noteWindowsInstallDirAclProbePending, resetWindowsInstallDirAclRecoveryForTest, startWindowsInstallDirAclRepairIfPoisoned -} from './windows-install-dir-acl-recovery' -import { resetWindowsInstallDirAclRepairForTest } from './windows-install-dir-package-acl-repair' +} from '../windows-install-permissions/windows-install-dir-acl-recovery' +import { resetWindowsInstallDirAclRepairForTest } from '../windows-install-permissions/windows-install-dir-package-acl-repair' const INSTALL_DIR = 'C:\\Users\\neil\\AppData\\Local\\Programs\\orca' @@ -112,13 +108,6 @@ async function reportProbePoisonedWithSettledRepair( } } -function reportProbeClean(): void { - startWindowsInstallDirAclRepairIfPoisoned( - { status: 'ok', matchesPoisonSignature: false }, - recoveryOptions() - ) -} - async function crashUpToThreshold(): Promise { for (let i = 1; i < DEFAULT_GPU_CRASH_FALLBACK_THRESHOLD; i += 1) { await handleGpuChildCrash('crashed', null, i * 200) @@ -184,76 +173,8 @@ describe('handleGpuChildCrash vs the install-dir ACL verdict', () => { }) // A quit may begin during the verdict wait; do not answer it with a modal. - it('does not prompt when the user quits during the verdict wait', async () => { - noteWindowsInstallDirAclProbePending() - await crashUpToThreshold() - const decisive = handleGpuChildCrash('crashed', null, 600) - state.isQuitting = true - reportProbeClean() - await decisive - expect(showMessageBox).not.toHaveBeenCalled() - }) // Withholding consumes a latched threshold report; re-arm so a repaired tree can recover from later driver crashes. - it('can still engage a later burst after a withheld one, once the tree is repaired', async () => { - const repair = reportProbePoisoned() - await crashUpToThreshold() - await handleGpuChildCrash('crashed', null, 600) - expect(showMessageBox).not.toHaveBeenCalled() - - await repair.finishRepair() - expect(isInstallDirAclRepairPending()).toBe(false) - - for (let i = 1; i <= DEFAULT_GPU_CRASH_FALLBACK_THRESHOLD; i += 1) { - await handleGpuChildCrash('crashed', null, 10_000 + i * 200) - } - expect(showMessageBox).toHaveBeenCalledTimes(1) - }) }) // The pre-window gate may retire an earlier-read marker; asking afterward can permanently pin healthy hardware to software. -describe('presentGpuFallbackRecoveredLaunchPrompt vs a marker retired since it was read', () => { - const realPlatform = process.platform - const window = { isDestroyed: () => false } as unknown as Parameters< - typeof presentGpuFallbackRecoveredLaunchPrompt - >[0] - - beforeAll(() => { - Object.defineProperty(process, 'platform', { value: 'win32', configurable: true }) - }) - - afterAll(() => { - Object.defineProperty(process, 'platform', { value: realPlatform, configurable: true }) - }) - - beforeEach(() => { - userData.path = mkdtempSync(join(tmpdir(), 'orca-acl-gpu-recovered-')) - resetWindowsInstallDirAclRepairForTest() - resetWindowsInstallDirAclRecoveryForTest() - showMessageBox.mockClear() - state.isQuitting = false - const info = { engagedAt: Date.now(), crashesInWindow: 3, userConfirmed: false } - writeGpuFallbackMarker(userData.path, info, { - ...gpuFallbackEnvironment(), - platform: 'win32' - }) - state.activeGpuFallbackMarker = readGpuFallbackMarker(userData.path) as GpuFallbackMarker - }) - - it('stays silent once the install-DACL repair has cleared it', async () => { - await reportProbePoisonedWithSettledRepair(true, userData.path) - expect(readGpuFallbackMarker(userData.path)).toBeNull() - - await presentGpuFallbackRecoveredLaunchPrompt(window) - expect(showMessageBox).not.toHaveBeenCalled() - }) - - // Failed repair leaves a blank suspect window; default Keep would pin a marker no later repair may clear. - it('stays silent while the install DACL is still the suspect', async () => { - await reportProbePoisonedWithSettledRepair(false, userData.path) - expect(readGpuFallbackMarker(userData.path)).not.toBeNull() - - await presentGpuFallbackRecoveredLaunchPrompt(window) - expect(showMessageBox).not.toHaveBeenCalled() - }) -}) diff --git a/src/main/startup/gpu-lifecycle.ts b/src/main/startup/gpu-recovery/gpu-lifecycle.ts similarity index 90% rename from src/main/startup/gpu-lifecycle.ts rename to src/main/startup/gpu-recovery/gpu-lifecycle.ts index db00f19a618..893b337b4da 100644 --- a/src/main/startup/gpu-lifecycle.ts +++ b/src/main/startup/gpu-recovery/gpu-lifecycle.ts @@ -1,6 +1,6 @@ import { app, type BrowserWindow } from 'electron' -import { relaunchApp } from './quit/app-relaunch' -import { destroySystemTray } from '../tray/system-tray' +import { relaunchApp } from '../quit/app-relaunch' +import { destroySystemTray } from '../../tray/system-tray' import { applyGpuFallbackCommandLineSwitches } from './gpu-fallback-switches' import { clearGpuFallbackMarker, @@ -11,20 +11,20 @@ import { import { handleGpuFallbackRecoveredLaunch, promptForGpuFallbackRecoveredLaunch -} from '../crash-reporting/recovery/gpu-fallback-recovered-launch' -import { promptForGpuFallbackRestart } from '../crash-reporting/recovery/gpu-fallback-restart-prompt' -import { engageGpuFallbackAfterCrashBurst } from '../crash-reporting/recovery/gpu-fallback-engagement' -import { recordCrashBreadcrumb } from '../crash-reporting/breadcrumbs/crash-breadcrumb-store' -import { recordDurableCrashBreadcrumb } from '../crash-reporting/breadcrumbs/durable-crash-breadcrumb' -import { GpuCrashDiagnosticsRecorder } from '../crash-reporting/capture/gpu-crash-diagnostics' +} from '../../crash-reporting/recovery/gpu-fallback-recovered-launch' +import { promptForGpuFallbackRestart } from '../../crash-reporting/recovery/gpu-fallback-restart-prompt' +import { engageGpuFallbackAfterCrashBurst } from '../../crash-reporting/recovery/gpu-fallback-engagement' +import { recordCrashBreadcrumb } from '../../crash-reporting/breadcrumbs/crash-breadcrumb-store' +import { recordDurableCrashBreadcrumb } from '../../crash-reporting/breadcrumbs/durable-crash-breadcrumb' +import { GpuCrashDiagnosticsRecorder } from '../../crash-reporting/capture/gpu-crash-diagnostics' import { isInstallDirAclRepairExhausted, isInstallDirAclRepairPending, isInstallDirAclSuspect, waitForInstallDirAclVerdict -} from './windows-install-dir-acl-recovery' -import { mainProcessState as state, gpuFallbackEnvironment } from './main-process-state' -import { createGpuAccelerationAboutPanelOptions } from '../menu/gpu-acceleration-about-panel' +} from '../windows-install-permissions/windows-install-dir-acl-recovery' +import { mainProcessState as state, gpuFallbackEnvironment } from '../main-process-state' +import { createGpuAccelerationAboutPanelOptions } from '../../menu/gpu-acceleration-about-panel' export function createGpuCrashDiagnosticsRecorder(): GpuCrashDiagnosticsRecorder | null { if (process.platform !== 'win32') { diff --git a/src/main/startup/headless-serve-x11-reexec.test.ts b/src/main/startup/headless-serve-x11-reexec.test.ts deleted file mode 100644 index dc538cd1dc0..00000000000 --- a/src/main/startup/headless-serve-x11-reexec.test.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { afterEach, describe, expect, it, vi } from 'vitest' -import { reexecHeadlessServeOnX11IfNeeded } from './headless-serve-x11-reexec' - -vi.mock('electron', () => ({ app: { commandLine: { getSwitchValue: () => 'wayland' } } })) - -const EXEC_PATH = '/opt/Orca/orca-ide' - -describe('reexecHeadlessServeOnX11IfNeeded', () => { - afterEach(() => { - vi.restoreAllMocks() - }) - - it('keeps the pid, env and argv order, with the switch ahead of a `--` terminator', () => { - const execve = vi.fn() - const env = { XDG_SESSION_TYPE: 'wayland', HOME: '/home/orca' } - reexecHeadlessServeOnX11IfNeeded({ - isServeMode: true, - readResolvedOzonePlatform: () => 'wayland', - argv: [EXEC_PATH, '--serve', '--', '--ozone-platform=wayland'], - platform: 'linux', - execPath: EXEC_PATH, - env, - execve - }) - expect(execve).toHaveBeenCalledWith( - EXEC_PATH, - [EXEC_PATH, '--ozone-platform=x11', '--serve', '--', '--ozone-platform=wayland'], - env - ) - }) -}) diff --git a/src/main/startup/legacy-worker-renderer-recovery.test.ts b/src/main/startup/legacy-worker-renderer-recovery.test.ts deleted file mode 100644 index 737ebb0eabd..00000000000 --- a/src/main/startup/legacy-worker-renderer-recovery.test.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import { recoverLegacyWorkerTerminalsForRendererStartup } from './legacy-worker-renderer-recovery' -import { - FIRST_WINDOW_STARTUP_SERVICE_TIMEOUT_MS, - LOCAL_PTY_STARTUP_FAIL_OPEN_TIMEOUT_MS, - startFirstWindowStartupServices -} from './first-window-startup-services' - -describe('legacy worker renderer recovery', () => { - it('waits for daemon adoption before renderer recovery can continue', async () => { - let resolveFirstWindow!: () => void - let resolveWslBarrier!: () => void - let resolveProvider!: () => void - const firstWindowReady = new Promise((resolve) => { - resolveFirstWindow = resolve - }) - const wslBarrierReady = new Promise((resolve) => { - resolveWslBarrier = resolve - }) - const providerReady = new Promise((resolve) => { - resolveProvider = resolve - }) - const reconcile = vi.fn().mockResolvedValue(undefined) - const startup = recoverLegacyWorkerTerminalsForRendererStartup({ - firstWindowStartupServicesReady: firstWindowReady, - managedWslCliStartupBarrierReady: wslBarrierReady, - localPtyProviderStartupReady: providerReady, - reconcile, - onDeferredRecoveryError: vi.fn() - }) - - resolveFirstWindow() - await Promise.resolve() - expect(reconcile).not.toHaveBeenCalled() - - resolveWslBarrier() - await Promise.resolve() - expect(reconcile).not.toHaveBeenCalled() - - resolveProvider() - await startup - expect(reconcile).toHaveBeenCalledOnce() - }) - - it('contains provider startup rejection after initial recovery', async () => { - const providerError = new Error('provider failed') - const reconcile = vi.fn().mockResolvedValue(undefined) - let reportError!: (error: unknown) => void - const reportedError = new Promise((resolve) => { - reportError = resolve - }) - - await recoverLegacyWorkerTerminalsForRendererStartup({ - firstWindowStartupServicesReady: Promise.resolve(), - managedWslCliStartupBarrierReady: Promise.resolve(), - localPtyProviderStartupReady: Promise.reject(providerError), - reconcile, - onDeferredRecoveryError: reportError - }) - - await expect(reportedError).resolves.toBe(providerError) - expect(reconcile).not.toHaveBeenCalled() - }) - - it('contains recovery rejection', async () => { - const recoveryError = new Error('recovery failed') - const reconcile = vi.fn().mockRejectedValueOnce(recoveryError) - let reportError!: (error: unknown) => void - const reportedError = new Promise((resolve) => { - reportError = resolve - }) - - await recoverLegacyWorkerTerminalsForRendererStartup({ - firstWindowStartupServicesReady: Promise.resolve(), - managedWslCliStartupBarrierReady: Promise.resolve(), - localPtyProviderStartupReady: Promise.resolve(), - reconcile, - onDeferredRecoveryError: reportError - }) - - await expect(reportedError).resolves.toBe(recoveryError) - expect(reconcile).toHaveBeenCalledOnce() - }) - - it('fails open at the hard cap without allowing a premature recovery', async () => { - vi.useFakeTimers() - let daemonSignal: AbortSignal | undefined - try { - const services = startFirstWindowStartupServices({ - startDaemonPtyProvider: (signal) => { - daemonSignal = signal - return new Promise(() => {}) - }, - startAgentHookServer: () => Promise.resolve(), - onDaemonError: vi.fn(), - onAgentHookServerError: vi.fn() - }) - const reconcile = vi.fn().mockResolvedValue(undefined) - const startup = recoverLegacyWorkerTerminalsForRendererStartup({ - firstWindowStartupServicesReady: services.firstWindowReady, - managedWslCliStartupBarrierReady: Promise.resolve(), - localPtyProviderStartupReady: services.localPtyProviderReady, - reconcile, - onDeferredRecoveryError: vi.fn() - }) - - await vi.advanceTimersByTimeAsync(FIRST_WINDOW_STARTUP_SERVICE_TIMEOUT_MS) - expect(reconcile).not.toHaveBeenCalled() - - await vi.advanceTimersByTimeAsync( - LOCAL_PTY_STARTUP_FAIL_OPEN_TIMEOUT_MS - FIRST_WINDOW_STARTUP_SERVICE_TIMEOUT_MS - ) - await startup - expect(reconcile).toHaveBeenCalledOnce() - expect(daemonSignal?.aborted).toBe(true) - } finally { - vi.useRealTimers() - } - }) -}) diff --git a/src/main/startup/ensure-virtual-display.ts b/src/main/startup/linux-display/ensure-virtual-display.ts similarity index 100% rename from src/main/startup/ensure-virtual-display.ts rename to src/main/startup/linux-display/ensure-virtual-display.ts diff --git a/src/main/startup/x-display-artifacts.ts b/src/main/startup/linux-display/x-display-artifacts.ts similarity index 100% rename from src/main/startup/x-display-artifacts.ts rename to src/main/startup/linux-display/x-display-artifacts.ts diff --git a/src/main/startup/linux-dev-shm-policy.ts b/src/main/startup/linux-runtime/linux-dev-shm-policy.ts similarity index 94% rename from src/main/startup/linux-dev-shm-policy.ts rename to src/main/startup/linux-runtime/linux-dev-shm-policy.ts index da3356395a7..a6877378de5 100644 --- a/src/main/startup/linux-dev-shm-policy.ts +++ b/src/main/startup/linux-runtime/linux-dev-shm-policy.ts @@ -1,6 +1,6 @@ import { statfsSync } from 'node:fs' import { app } from 'electron' -import { recordCrashBreadcrumb } from '../crash-reporting/breadcrumbs/crash-breadcrumb-store' +import { recordCrashBreadcrumb } from '../../crash-reporting/breadcrumbs/crash-breadcrumb-store' const DEV_SHM_PATH = '/dev/shm' const DEV_SHM_OVERRIDE_ENV_VAR = 'ORCA_DEV_SHM' diff --git a/src/main/startup/linux-keyring-backend-selection.test.ts b/src/main/startup/linux-runtime/linux-keyring-backend-selection.test.ts similarity index 90% rename from src/main/startup/linux-keyring-backend-selection.test.ts rename to src/main/startup/linux-runtime/linux-keyring-backend-selection.test.ts index 8370626639c..fd7f63595b4 100644 --- a/src/main/startup/linux-keyring-backend-selection.test.ts +++ b/src/main/startup/linux-runtime/linux-keyring-backend-selection.test.ts @@ -108,14 +108,4 @@ describe('resolveLinuxPasswordStore', () => { expect(decision.store).toBeNull() expect(probeCollection).not.toHaveBeenCalled() }) - - it('treats an empty session bus address as no session bus', () => { - const probeCollection = vi.fn((): SecretServiceCollectionState => 'unlocked') - resolveLinuxPasswordStore({ - env: { XDG_CURRENT_DESKTOP: 'Hyprland', DBUS_SESSION_BUS_ADDRESS: ' ' }, - passwordStoreAlreadySelected: false, - probeCollection - }) - expect(probeCollection).not.toHaveBeenCalled() - }) }) diff --git a/src/main/startup/linux-keyring-backend-selection.ts b/src/main/startup/linux-runtime/linux-keyring-backend-selection.ts similarity index 100% rename from src/main/startup/linux-keyring-backend-selection.ts rename to src/main/startup/linux-runtime/linux-keyring-backend-selection.ts diff --git a/src/main/startup/linux-realtime-scheduling-guard.ts b/src/main/startup/linux-runtime/linux-realtime-scheduling-guard.ts similarity index 97% rename from src/main/startup/linux-realtime-scheduling-guard.ts rename to src/main/startup/linux-runtime/linux-realtime-scheduling-guard.ts index f21f480878d..46266cbb27b 100644 --- a/src/main/startup/linux-realtime-scheduling-guard.ts +++ b/src/main/startup/linux-runtime/linux-realtime-scheduling-guard.ts @@ -1,6 +1,6 @@ import { existsSync, readdirSync, readFileSync } from 'node:fs' import { runProcess } from '@orca/process-host' -import { recordCrashBreadcrumb } from '../crash-reporting/breadcrumbs/crash-breadcrumb-store' +import { recordCrashBreadcrumb } from '../../crash-reporting/breadcrumbs/crash-breadcrumb-store' import { allowsRealtimePriority, readZeroRtTimeLimit, diff --git a/src/main/startup/linux-rttime-limit.test.ts b/src/main/startup/linux-runtime/linux-rttime-limit.test.ts similarity index 100% rename from src/main/startup/linux-rttime-limit.test.ts rename to src/main/startup/linux-runtime/linux-rttime-limit.test.ts diff --git a/src/main/startup/linux-rttime-limit.ts b/src/main/startup/linux-runtime/linux-rttime-limit.ts similarity index 100% rename from src/main/startup/linux-rttime-limit.ts rename to src/main/startup/linux-runtime/linux-rttime-limit.ts diff --git a/src/main/startup/linux-secret-service-probe.ts b/src/main/startup/linux-runtime/linux-secret-service-probe.ts similarity index 100% rename from src/main/startup/linux-secret-service-probe.ts rename to src/main/startup/linux-runtime/linux-secret-service-probe.ts diff --git a/src/main/startup/select-linux-keyring-backend.ts b/src/main/startup/linux-runtime/select-linux-keyring-backend.ts similarity index 100% rename from src/main/startup/select-linux-keyring-backend.ts rename to src/main/startup/linux-runtime/select-linux-keyring-backend.ts diff --git a/src/main/startup/main-process-ipc-bootstrap.ts b/src/main/startup/main-process-ipc-bootstrap.ts index e987aa33936..02d8e943408 100644 --- a/src/main/startup/main-process-ipc-bootstrap.ts +++ b/src/main/startup/main-process-ipc-bootstrap.ts @@ -1,14 +1,14 @@ import { ipcMain } from 'electron' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../shared/layout-owner-switch' import { placeUnshownLiveTerminalsBestEffort } from '../runtime/terminal/adoption/unshown-live-terminal-placement' -import { recoverLegacyWorkerTerminalsForRendererStartup } from './legacy-worker-renderer-recovery' -import { logStartupMilestone } from './startup-diagnostics' +import { recoverLegacyWorkerTerminalsForRendererStartup } from './pty-startup/legacy-worker-renderer-recovery' +import { logStartupMilestone } from './diagnostics/startup-diagnostics' import { mainProcessState as state } from './main-process-state' import { consumeQuitAndStopAllSessionsRequest, quitAfterRendererStoppedAllSessions -} from './main-window-actions' -import { resolveOsOpenedDocuments } from './os-opened-documents' +} from './main-window/main-window-actions' +import { resolveOsOpenedDocuments } from './open-routing/os-opened-documents' import { onStructuredAgentSessionsHeldChanged, structuredAgentSessionsHeld diff --git a/src/main/startup/main-process-observers.ts b/src/main/startup/main-process-observers.ts index a4a94d511fa..9ed997eaff7 100644 --- a/src/main/startup/main-process-observers.ts +++ b/src/main/startup/main-process-observers.ts @@ -25,7 +25,7 @@ import { UsageWorktreeHistory } from '../usage/worktree-attribution/usage-worktr import { feedAgentSessionStats } from '../stats/agent-session-stats-feed' import { installRepoMaintenanceIdleGate } from '../workspaces/catalog/repo-maintenance-idle-gate' import { mainProcessState as state } from './main-process-state' -import { runAfterFirstWindowShown } from './first-window-deferral' +import { runAfterFirstWindowShown } from './main-window/first-window-deferral' const TELEMETRY_CLIENT_START_FALLBACK_MS = 15_000 diff --git a/src/main/startup/main-process-preflight-failure.ts b/src/main/startup/main-process-preflight-failure.ts index 5ac4ff30e66..66462e23346 100644 --- a/src/main/startup/main-process-preflight-failure.ts +++ b/src/main/startup/main-process-preflight-failure.ts @@ -1,10 +1,10 @@ import { app, dialog } from 'electron' import { prepareEarlyMainUiLanguage, translateMain } from '../i18n/main-i18n' import { formatProfileStateStartupFailure } from '../persistence/profile-state/startup/profile-state-startup-failure' -import { isBackgroundLaunch } from '../window/foreground-activation-policy' +import { isBackgroundLaunch } from '../window/activation/foreground-activation-policy' import { mainProcessState as state } from './main-process-state' -import { SINGLE_INSTANCE_ALREADY_RUNNING_EXIT_CODE } from './single-instance-lock' -import { acquireDesktopProfileInstanceLock } from './desktop-profile-instance-lock' +import { SINGLE_INSTANCE_ALREADY_RUNNING_EXIT_CODE } from '../../shared/single-instance-exit-code' +import { acquireDesktopProfileInstanceLock } from './profile-startup/desktop-profile-instance-lock' /** False when orcad holds the profile; unlike a second desktop, nothing else would say why. */ export function acquireDesktopProfileLockOrExplain(userDataPath: string): boolean { diff --git a/src/main/startup/main-process-preflight.ts b/src/main/startup/main-process-preflight.ts index a1ecab2621b..090ef91e592 100644 --- a/src/main/startup/main-process-preflight.ts +++ b/src/main/startup/main-process-preflight.ts @@ -4,9 +4,9 @@ import { getRelocatedDaemonHost } from '../daemon/executable-host/windows/daemon import { app, ipcMain, powerMonitor, session } from 'electron' import os from 'node:os' import { join } from 'node:path' -import { maybeRedirectCliLaunch } from './cli-launch-redirect' -import { runProfileStateRecoveryPreflight } from './profile-state-recovery-preflight' -import { argvRequestsServeMode, normalizeServeModeArgv } from './serve-mode-argv' +import { maybeRedirectCliLaunch } from './cli-launch/cli-launch-redirect' +import { runProfileStateRecoveryPreflight } from './profile-startup/profile-state-recovery-preflight' +import { argvRequestsServeMode, normalizeServeModeArgv } from './serve-launch/serve-mode-argv' import { configureDevUserDataPath, configureElectronNetworkCompatibility, @@ -23,8 +23,8 @@ import { installServeSupervisorDisconnectQuit } from '../updater/serve-update-ha import { installUncaughtPipeErrorGuard, installUnhandledRejectionLogging -} from './main-process-error-guards' -import { hydrateShellPath, mergePathSegments } from './hydrate-shell-path' +} from './process-failure/main-process-error-guards' +import { hydrateShellPath, mergePathSegments } from './shell-environment/hydrate-shell-path' import { configureRemoteServerUpdater } from '../runtime/hosts/management/remote-server-updater' import { getRemoteServerUpdaterSnapshot, @@ -33,11 +33,17 @@ import { installRemoteServerUpdate, isQuittingForUpdate } from '../updater/updater-service' -import { getDevInstanceIdentity, shouldApplyPreReadyAppName } from './dev-instance-identity' -import { enableRendererHeapHeadroom } from './renderer-heap-headroom' -import { configureLinuxDevShmUsage } from './linux-dev-shm-policy' -import { isStartupDiagnosticsEnabled, logStartupDiagnostic } from './startup-diagnostics' -import { startEventLoopStallProbe } from './event-loop-stall-probe' +import { + getDevInstanceIdentity, + shouldApplyPreReadyAppName +} from './profile-startup/dev-instance-identity' +import { enableRendererHeapHeadroom } from './chromium-policy/renderer-heap-headroom' +import { configureLinuxDevShmUsage } from './linux-runtime/linux-dev-shm-policy' +import { + isStartupDiagnosticsEnabled, + logStartupDiagnostic +} from './diagnostics/startup-diagnostics' +import { startEventLoopStallProbe } from './diagnostics/event-loop-stall-probe' import { startEventLoopDelayProbe } from '../diagnostics/event-loop-delay-probe' import { isMainThreadDiagnosticsEnabled, @@ -47,21 +53,21 @@ import { import { setSpawnObserver } from '@orca/process-host/spawn-observer' import { settledDiffCache } from '../git/source-control/git-read-cache-invalidation' import { reserveServeStdoutForReadiness } from '../server/serve-stdout-boundary' -import { createServeDesktopActivationGate } from './serve-desktop-activation' +import { createServeDesktopActivationGate } from './serve-launch/serve-desktop-activation' import { shouldBypassSingleInstanceLock, shouldSkipSingleInstanceLock, acquireSingleInstanceLock, logSingleInstanceLockBypass, - logSingleInstanceLockFailure, - SINGLE_INSTANCE_ALREADY_RUNNING_EXIT_CODE -} from './single-instance-lock' + logSingleInstanceLockFailure +} from './profile-startup/single-instance-lock' +import { SINGLE_INSTANCE_ALREADY_RUNNING_EXIT_CODE } from '../../shared/single-instance-exit-code' import { setAppEnvironment } from '../../shared/app-environment' import { ElectronAppEnvironment } from '../host/electron-app-environment' import { installMainProcessTreeKillGate } from '../pty/process-retirement/own-chromium-tree-kill-guard' import { setSecretStore } from '../../shared/secret-store' import { ElectronSecretStore } from '../host/electron-secret-store' -import { selectLinuxKeyringBackend } from './select-linux-keyring-backend' +import { selectLinuxKeyringBackend } from './linux-runtime/select-linux-keyring-backend' import { setPtyHostBindings } from '../ipc/pty/pty-host-bindings' import { electronRuntimeDesktopSurface } from '../host/electron-runtime-desktop-surface' import { setRuntimeDesktopSurface } from '../runtime/construction/runtime-desktop-surface' @@ -82,7 +88,7 @@ import { getProfileUserDataPath, initOrcaProfilePaths } from '../orca-profiles/p import { recoverPendingProfileProjectMoves } from '../orca-profiles/project-transfer/profile-project-move-intent' import { initStatsPath } from '../stats/collector' import { registerDocPreviewSchemePrivileges } from '../browser/document-preview/doc-preview-protocol' -import { PRIVILEGED_CUSTOM_SCHEMES } from './privileged-custom-schemes' +import { PRIVILEGED_CUSTOM_SCHEMES } from './chromium-policy/privileged-custom-schemes' import { startCrashpadCapture } from '../crash-reporting/capture/crashpad-capture' import { CrashReportStore } from '../crash-reporting/reports/crash-report-store' import { recordCrashBreadcrumb } from '../crash-reporting/breadcrumbs/crash-breadcrumb-store' @@ -91,14 +97,14 @@ import { ensureVirtualDisplayForHeadlessServe, hasUsableLinuxDisplay, missingLinuxDisplayMessage -} from './ensure-virtual-display' +} from './linux-display/ensure-virtual-display' import { createGpuCrashDiagnosticsRecorder, maybeApplyGpuFallbackForThisLaunch, registerGpuLifecycleHandlers -} from './gpu-lifecycle' +} from './gpu-recovery/gpu-lifecycle' import { mainProcessState as state } from './main-process-state' -import { initializeSyntheticTitleRuntime } from './synthetic-title-runtime' +import { initializeSyntheticTitleRuntime } from './main-window/synthetic-title-runtime' import { initializeBrowserProcessUserAgent } from '../browser/identity/browser-process-user-agent' import { initializeBrowserIdentityModeStore } from '../browser/identity/mode/browser-identity-mode-store' import { acquireProfileStateRuntimeAdmission } from '../persistence/profile-state/access/profile-state-access' @@ -107,7 +113,7 @@ import { acquireDesktopProfileLockOrExplain, handleMainProcessPreflightFailure } from './main-process-preflight-failure' -import { ensureWindowsAppDataPath } from './windows-app-data-path' +import { ensureWindowsAppDataPath } from './windows-startup/windows-app-data-path' export type MainProcessPreflightOptions = { focusExistingWindow: () => void diff --git a/src/main/startup/main-process-quit-pending-writer.test.ts b/src/main/startup/main-process-quit-pending-writer.test.ts deleted file mode 100644 index 95451a1393b..00000000000 --- a/src/main/startup/main-process-quit-pending-writer.test.ts +++ /dev/null @@ -1,209 +0,0 @@ -import { EventEmitter } from 'node:events' -import { afterEach, expect, it, vi } from 'vitest' -import { WILL_QUIT_TEARDOWN_DEADLINE_MS } from '../../shared/quit-teardown-deadline' - -const settled = () => vi.fn(async () => {}) -const idle = () => vi.fn() -const stopAgentHookServer = idle() -const stopStructuredAgentSessionRuntime = settled() -const beginSshShutdown = settled() -const killAllPty = idle() -/** Final-save calls seen by the first microtask after the SSH shutdown began. */ -let flushesByNextMicrotask = -1 - -// Every teardown member settles except the profile store, so only the writer can hold quit. -const dependencies: Record> = { - '../ipc/filesystem-watcher': { closeAllWatchers: settled() }, - '../ipc/worktree-base-directory-watcher': { disposeWorktreeBaseDirectoryWatchers: settled() }, - '../ipc/folder-repo-git-upgrade': { stopFolderRepoGitUpgradeWatch: idle() }, - '../ipc/pty/kill-all': { killAllPty }, - '../daemon/providers/lifecycle/daemon-provider-state': { - disconnectDaemon: settled(), - shutdownDaemon: settled() - }, - '../ipc/ssh/ssh-shutdown-drain': { beginSshShutdown }, - './main-process-connector-startup': { desktopConnectorCloud: () => null }, - '../agent-hooks/server/agent-hook-server': { agentHookServer: { stop: stopAgentHookServer } }, - '../agent-hooks/wsl-relay/wsl-hook-relay-manager': { - wslHookRelayManager: { disposeAll: idle() } - }, - '../agent-hooks/installation/managed-agent-hook-controls': { - removeManagedAgentHooksAsync: vi.fn(async () => []) - }, - '../runtime/agent-session/structured-agent-session-runtime': { - stopStructuredAgentSessionRuntime - }, - '../runtime/agent-session/structured-agent-session-runtime-teardown': { - setStructuredAgentSessionTeardownTrigger: idle() - }, - '../runtime/files/watch/file-watcher-leases': { awaitRuntimeFileWatcherUnsubscribes: settled() }, - '../runtime/rpc/server/runtime-metadata': { clearRuntimeMetadataIfOwned: idle() }, - '../browser/client-hosts/lifecycle/paired-runtime-browser-client-host-runtime': { - shutdownPairedRuntimeBrowserClientHosts: settled() - }, - '../ipc/browser/desktop-browser-bridge-wiring': { disposeDesktopBrowserBridge: idle() }, - '../orca-profiles/profile-cloud-session-owner': { flushUnsavedCloudSessions: idle() }, - '../browser/guest-lifecycle/manager/browser-manager': { - browserManager: { setBrowserGuestStateChangedListener: idle(), setOffscreenTabOpener: idle() } - }, - '../browser/sessions/profiles/browser-session-registry': { browserSessionRegistry: {} }, - '../browser/routing/local-host-partitions/local-ssh-browser-route': { - closeAllLocalSshBrowserRoutes: settled() - }, - '../codex/codex-state-db-backfill-recovery': { stopCodexStateDbBackfillRecoveries: settled() }, - '../codex/codex-account-session-bridge': { stopCodexAccountSessionBridges: idle() }, - '../git/refs/maintenance/local-repo-ref-maintenance': { awaitPackedRefsLockRelease: settled() }, - '../worktree-background-removal': { stopBackgroundWorktreeRemovals: idle() }, - '../dock/unread-badge': { setUnreadDockBadgeCount: idle() }, - '../tray/system-tray': { destroySystemTray: idle() }, - '../telemetry/client': { shutdownTelemetry: settled() }, - '../observability/index': { shutdownObservability: settled() }, - '../updater': { isQuittingForUpdate: vi.fn(() => false) }, - '../updater-lifecycle-diagnostics': { recordUpdaterLifecycle: idle() }, - '../macos-permissions/macos-tcc-prompt-notice': { stopTccPromptNotice: idle() }, - '../pty/history/terminal-history-gc': { cancelHistoryGc: idle() }, - './window-all-closed-quit-policy': { shouldQuitWhenAllWindowsClosed: vi.fn(() => false) }, - './configure-process': { isDevParentShutdownRequested: vi.fn(() => false) }, - '../persistence/loading-store/user-data-path': { - getCanonicalUserDataPath: vi.fn(() => '/unused') - } -} - -afterEach(() => { - vi.doUnmock('electron') - vi.doUnmock('./main-process-state') - for (const moduleName of Object.keys(dependencies)) { - vi.doUnmock(moduleName) - } - vi.restoreAllMocks() - vi.useRealTimers() - vi.resetModules() -}) - -async function startQuit( - flushFinalOrThrowAsync: () => Promise, - services: Record = {} -) { - beginSshShutdown.mockClear() - killAllPty.mockClear() - flushesByNextMicrotask = -1 - vi.resetModules() - vi.useFakeTimers() - const app = Object.assign(new EventEmitter(), { quit: vi.fn() }) - const admission = { release: vi.fn() } - const store = { - flushFinalOrThrowAsync: vi.fn(flushFinalOrThrowAsync), - freezeWritesAsync: settled() - } - beginSshShutdown.mockImplementation(async () => { - void Promise.resolve().then(() => { - flushesByNextMicrotask = store.flushFinalOrThrowAsync.mock.calls.length - }) - }) - const profileStateAdmission: typeof admission | undefined = admission - const state = { - isQuitting: false, - watcherShutdownDone: true, - store, - profileStateAdmission, - ...services - } - vi.doMock('electron', () => ({ app })) - vi.doMock('./main-process-state', () => ({ mainProcessState: state })) - for (const [moduleName, exports] of Object.entries(dependencies)) { - vi.doMock(moduleName, () => exports) - } - vi.spyOn(console, 'warn').mockImplementation(() => {}) - const { installMainProcessQuitHandlers } = await import('./main-process-quit') - const { quitTeardownStartGate } = await import('./quit/quit-teardown-start-gate') - quitTeardownStartGate.resetForTests() - installMainProcessQuitHandlers() - app.emit('before-quit', { defaultPrevented: false }) - app.emit('will-quit', { preventDefault: vi.fn() }) - return { app, admission, store, state } -} - -it('quits at the teardown deadline without releasing admission while the writer is pending', async () => { - const { app, admission, store, state } = await startQuit(() => new Promise(() => {})) - await vi.advanceTimersByTimeAsync(WILL_QUIT_TEARDOWN_DEADLINE_MS - 1) - expect(app.quit).not.toHaveBeenCalled() - await vi.advanceTimersByTimeAsync(1) - expect(app.quit).toHaveBeenCalledOnce() - expect(console.warn).toHaveBeenCalledWith('[shutdown] Quit teardown deadline reached', { - pendingTeardowns: ['state'] - }) - expect(store.flushFinalOrThrowAsync).toHaveBeenCalledOnce() - expect(store.freezeWritesAsync).not.toHaveBeenCalled() - expect(admission.release).not.toHaveBeenCalled() - expect(state.profileStateAdmission).toBe(admission) -}) - -it('writes a pane grid still inside its write burst before the final flush', async () => { - const paneGrids = Promise.withResolvers() - const { store } = await startQuit(async () => {}, { - runtime: { - getOffscreenBrowserBackend: () => null, - getAgentBrowserBridge: () => null, - getEmulatorBridge: () => null, - disposeSkillUploadSessions: settled(), - getRuntimeId: () => undefined, - closeNotificationDismissals: settled(), - flushPaneGrids: () => paneGrids.promise - } - }) - await vi.advanceTimersByTimeAsync(0) - // Before the SSH shutdown too: nothing is awaited between it and the final save. - expect(beginSshShutdown).not.toHaveBeenCalled() - expect(store.flushFinalOrThrowAsync).not.toHaveBeenCalled() - paneGrids.resolve() - await vi.advanceTimersByTimeAsync(0) - expect(beginSshShutdown).toHaveBeenCalledOnce() - expect(store.flushFinalOrThrowAsync).toHaveBeenCalledOnce() - expect(beginSshShutdown.mock.invocationCallOrder[0]).toBeLessThan( - store.flushFinalOrThrowAsync.mock.invocationCallOrder[0]! - ) - // Nothing awaited between them: the save started in the same turn as the SSH shutdown. - expect(flushesByNextMicrotask).toBe(1) -}) - -it.each([ - ['chat teardown', 'RPC stop'], - ['RPC stop', 'chat teardown'] -] as const)( - 'closes notification dismissals only once %s and then %s settle', - async (first, second) => { - const sessionTeardown = Promise.withResolvers() - const rpcStop = Promise.withResolvers() - const release = { 'chat teardown': sessionTeardown.resolve, 'RPC stop': rpcStop.resolve } - stopStructuredAgentSessionRuntime.mockClear() - stopStructuredAgentSessionRuntime.mockImplementationOnce(() => sessionTeardown.promise) - const closeNotificationDismissals = vi.fn(() => new Promise(() => {})) - const { app } = await startQuit(async () => {}, { - runtime: { - getOffscreenBrowserBackend: () => null, - getAgentBrowserBridge: () => null, - getEmulatorBridge: () => null, - disposeSkillUploadSessions: settled(), - getRuntimeId: () => undefined, - closeNotificationDismissals, - flushPaneGrids: () => null - }, - runtimeRpc: { setMobileRelayPairingProvider: idle(), stop: vi.fn(() => rpcStop.promise) } - }) - expect(stopStructuredAgentSessionRuntime).toHaveBeenCalledOnce() - await vi.advanceTimersByTimeAsync(0) - expect(closeNotificationDismissals).not.toHaveBeenCalled() - release[first]() - await vi.advanceTimersByTimeAsync(0) - expect(closeNotificationDismissals).not.toHaveBeenCalled() - release[second]() - await vi.advanceTimersByTimeAsync(0) - expect(closeNotificationDismissals).toHaveBeenCalledOnce() - expect(app.quit).not.toHaveBeenCalled() - await vi.advanceTimersByTimeAsync(WILL_QUIT_TEARDOWN_DEADLINE_MS) - expect(console.warn).toHaveBeenCalledWith('[shutdown] Quit teardown deadline reached', { - pendingTeardowns: ['notification-dismissals'] - }) - expect(app.quit).toHaveBeenCalledOnce() - } -) diff --git a/src/main/startup/main-process-quit-update-veto.test.ts b/src/main/startup/main-process-quit-update-veto.test.ts deleted file mode 100644 index 9a71b26cd7e..00000000000 --- a/src/main/startup/main-process-quit-update-veto.test.ts +++ /dev/null @@ -1,109 +0,0 @@ -import { EventEmitter } from 'node:events' -import { afterEach, expect, it, vi } from 'vitest' - -const dependencyExports: [string, string[]][] = [ - ['../ipc/filesystem-watcher', ['closeAllWatchers']], - ['../ipc/worktree-base-directory-watcher', ['disposeWorktreeBaseDirectoryWatchers']], - ['../ipc/folder-repo-git-upgrade', ['stopFolderRepoGitUpgradeWatch']], - ['../ipc/pty/kill-all', ['killAllPty']], - ['../daemon/providers/lifecycle/daemon-provider-state', ['disconnectDaemon', 'shutdownDaemon']], - ['../ipc/ssh-shutdown-drain', ['beginSshShutdown']], - ['../agent-hooks/server/agent-hook-server', ['agentHookServer']], - ['../agent-hooks/wsl-relay/wsl-hook-relay-manager', ['wslHookRelayManager']], - ['../agent-hooks/installation/managed-agent-hook-controls', ['removeManagedAgentHooksAsync']], - [ - '../runtime/agent-session/structured-agent-session-runtime', - ['stopStructuredAgentSessionRuntime'] - ], - [ - '../runtime/agent-session/structured-agent-session-runtime-teardown', - ['setStructuredAgentSessionTeardownTrigger'] - ], - ['../runtime/files/watch/file-watcher-leases', ['awaitRuntimeFileWatcherUnsubscribes']], - ['../runtime/rpc/server/runtime-metadata', ['clearRuntimeMetadataIfOwned']], - [ - '../browser/client-hosts/lifecycle/paired-runtime-browser-client-host-runtime', - ['shutdownPairedRuntimeBrowserClientHosts'] - ], - ['../ipc/browser/desktop-browser-bridge-wiring', ['disposeDesktopBrowserBridge']], - ['../orca-profiles/profile-cloud-session-owner', ['flushUnsavedCloudSessions']], - ['../browser/guest-lifecycle/manager/browser-manager', ['browserManager']], - ['../browser/sessions/profiles/browser-session-registry', ['browserSessionRegistry']], - ['../codex/codex-state-db-backfill-recovery', ['stopCodexStateDbBackfillRecoveries']], - ['../codex/codex-account-session-bridge', ['stopCodexAccountSessionBridges']], - ['../git/refs/maintenance/local-repo-ref-maintenance', ['awaitPackedRefsLockRelease']], - ['../worktree-background-removal', ['stopBackgroundWorktreeRemovals']], - ['./quit/quit-teardown-deadline', ['settleTeardownWithinDeadline', 'settleWithinMs']], - ['./quit/quit-teardown-start-gate', ['quitTeardownStartGate']], - ['../dock/unread-badge', ['setUnreadDockBadgeCount']], - ['../tray/system-tray', ['destroySystemTray']], - ['../telemetry/client', ['shutdownTelemetry']], - ['../observability/index', ['shutdownObservability']], - ['../updater', ['isQuittingForUpdate']], - ['../updater-lifecycle-diagnostics', ['recordUpdaterLifecycle']], - ['../macos-permissions/macos-tcc-prompt-notice', ['stopTccPromptNotice']], - ['../pty/history/terminal-history-gc', ['cancelHistoryGc']], - ['./window-all-closed-quit-policy', ['shouldQuitWhenAllWindowsClosed']], - ['./configure-process', ['isDevParentShutdownRequested']], - ['../persistence/loading-store/user-data-path', ['getCanonicalUserDataPath']] -] - -it('keeps startup services live when the updater has vetoed before-quit', async () => { - vi.resetModules() - const app = new EventEmitter() - const fenceAndCloseNow = vi.fn() - const setMobileRelayPairingProvider = vi.fn() - const unsubscribeAgentAwakeStatusChanges = vi.fn() - const dispose = vi.fn() - const stop = vi.fn() - const state = { - isQuitting: false, - desktopRelayService: { fenceAndCloseNow }, - runtimeRpc: { setMobileRelayPairingProvider }, - unsubscribeAgentAwakeStatusChanges, - agentAwakeService: { dispose }, - rateLimits: { stop } - } - vi.doMock('electron', () => ({ app })) - vi.doMock('./main-process-state', () => ({ mainProcessState: state })) - for (const [moduleName, exports] of dependencyExports) { - vi.doMock(moduleName, () => Object.fromEntries(exports.map((name) => [name, vi.fn()]))) - } - const exitListenersBefore = process.listeners('exit') - const { installMainProcessQuitHandlers } = await import('./main-process-quit') - installMainProcessQuitHandlers() - - app.emit('before-quit', { defaultPrevented: true }) - - expect(state.isQuitting).toBe(false) - expect(fenceAndCloseNow).not.toHaveBeenCalled() - expect(setMobileRelayPairingProvider).not.toHaveBeenCalled() - expect(unsubscribeAgentAwakeStatusChanges).not.toHaveBeenCalled() - expect(dispose).not.toHaveBeenCalled() - expect(stop).not.toHaveBeenCalled() - expect(state.agentAwakeService).toEqual({ dispose }) - expect(state.unsubscribeAgentAwakeStatusChanges).toBe(unsubscribeAgentAwakeStatusChanges) - - app.emit('before-quit', { defaultPrevented: false }) - - expect(state.isQuitting).toBe(true) - expect(fenceAndCloseNow).toHaveBeenCalledOnce() - expect(setMobileRelayPairingProvider).toHaveBeenCalledWith(null) - expect(unsubscribeAgentAwakeStatusChanges).toHaveBeenCalledOnce() - expect(dispose).toHaveBeenCalledOnce() - expect(stop).toHaveBeenCalledOnce() - for (const listener of process.listeners('exit')) { - if (!exitListenersBefore.includes(listener)) { - process.removeListener('exit', listener) - } - } -}) - -afterEach(() => { - vi.doUnmock('electron') - vi.doUnmock('./main-process-state') - for (const [moduleName] of dependencyExports) { - vi.doUnmock(moduleName) - } - vi.resetModules() -}) diff --git a/src/main/startup/main-process-ready-activation-failure.test.ts b/src/main/startup/main-process-ready-activation-failure.test.ts index b2b75c42c2b..c87b24eb29a 100644 --- a/src/main/startup/main-process-ready-activation-failure.test.ts +++ b/src/main/startup/main-process-ready-activation-failure.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { MainProcessRuntimeLaunchOptions } from './main-process-runtime-launch' +import type { MainProcessRuntimeLaunchOptions } from './runtime-startup/main-process-runtime-launch' const phases = vi.hoisted(() => ({ foundation: vi.fn<() => Promise>(), @@ -14,14 +14,16 @@ vi.mock('./main-process-ready-foundation', () => ({ vi.mock('./main-process-ready-runtime', () => ({ initializeReadyRuntimeServices: phases.runtimeServices })) -vi.mock('./main-process-i18n-menu', () => ({ initializeMainProcessI18nAndMenu: phases.menu })) -vi.mock('./main-process-runtime-launch', () => ({ +vi.mock('./main-window/main-process-i18n-menu', () => ({ + initializeMainProcessI18nAndMenu: phases.menu +})) +vi.mock('./runtime-startup/main-process-runtime-launch', () => ({ initializeMainProcessRuntimeLaunch: phases.launch })) const { initializeMainProcessReady } = await import('./main-process-ready') const { mainProcessState: state } = await import('./main-process-state') -const { createServeDesktopActivationGate } = await import('./serve-desktop-activation') +const { createServeDesktopActivationGate } = await import('./serve-launch/serve-desktop-activation') const activateWindow = vi.fn() const launchOptions: MainProcessRuntimeLaunchOptions = { diff --git a/src/main/startup/main-process-ready-foundation.ts b/src/main/startup/main-process-ready-foundation.ts index af0d0d23b60..354f4df927b 100644 --- a/src/main/startup/main-process-ready-foundation.ts +++ b/src/main/startup/main-process-ready-foundation.ts @@ -1,5 +1,5 @@ import { app, session } from 'electron' -import { applyBackgroundActivationPolicy } from '../window/foreground-activation-policy' +import { applyBackgroundActivationPolicy } from '../window/activation/foreground-activation-policy' import { applyElectronProxySettings } from '../network/proxy-settings' import { installElectronProxyRequestGuard } from '../network/electron-proxy-request-guard' import { handleElectronProxyLogin } from '../network/electron-proxy-credentials' @@ -27,7 +27,7 @@ import { withholdUnreachableKeychainForServe } from '../host/serve-keychain-guar import { initSshHostKeyStoreFile } from '../ssh/host-keys/ssh-host-key-store' import { initOrcadHeldFenceTokenFile } from '../managed-server/activation/orcad-held-fence-tokens' import { neutralizeLegacyTerminalShimDir } from '../pty/shell-startup/legacy-terminal-shim-dir' -import { createWindowsShellPathHydration } from './windows-shell-path-hydration' +import { createWindowsShellPathHydration } from './shell-environment/windows-shell-path-hydration' import { configureWindowsHostGitEnvironmentReadiness } from '../git/command-runner/host-routing/windows-host-git-environment' import { setDefaultWslDistroOverride } from '../git/command-runner/host-routing/wsl-command-resolution' import { wslHookRelayManager } from '../agent-hooks/wsl-relay/wsl-hook-relay-manager' @@ -35,7 +35,7 @@ import { applyAppIcon } from '../window/desktop-integration/app-icon' import { shouldSuppressDevEducation, suppressDevEducationForStore -} from './dev-education-suppression' +} from './profile-startup/dev-education-suppression' import { awaitBrowserSessionProxies, setBrowserNetworkProxySettingsResolver @@ -51,20 +51,20 @@ import { } from '../browser/extensions/browser-extension-startup' import { whenBrowserExtensionSessionsLoaded } from '../browser/extensions/profile-sessions/browser-extension-session-loader' import { browserSessionRegistry } from '../browser/sessions/profiles/browser-session-registry' -import { logStartupMilestone } from './startup-diagnostics' -import { writeHttp1CompatibilityMarker } from './http1-compatibility-marker' +import { logStartupMilestone } from './diagnostics/startup-diagnostics' +import { writeHttp1CompatibilityMarker } from './network-compatibility/http1-compatibility-marker' import { mainProcessState as state } from './main-process-state' -import { syncMacMenuBarIcon } from './main-window-actions' -import { updateGpuAccelerationAboutPanel } from './gpu-lifecycle' +import { syncMacMenuBarIcon } from './main-window/main-window-actions' +import { updateGpuAccelerationAboutPanel } from './gpu-recovery/gpu-lifecycle' import { logWslCliReconciliationResults, reconcileManagedWslCliRegistrations } from '../cli/wsl/wsl-cli-registration-reconciliation' -import { createWslCliReconciliationStartupBarrier } from './wsl-cli-reconciliation-startup-barrier' +import { createWslCliReconciliationStartupBarrier } from './wsl-startup/wsl-cli-reconciliation-startup-barrier' import { agentHookServer } from '../agent-hooks/server/agent-hook-server' import { isAgentStatusHooksEnabled } from '../../shared/agent-hook-listener/configuration/agent-status-hooks-setting' -import { reportProfileStateWriteFailure } from './profile-state-write-failure' -import { reportProfileStateSaveDelay } from './profile-state-save-delay' +import { reportProfileStateWriteFailure } from './profile-startup/profile-state-write-failure' +import { reportProfileStateSaveDelay } from './profile-startup/profile-state-save-delay' import { preloadSsh2 } from '../ssh/authentication/ssh2-module-load' export async function initializeReadyFoundation(): Promise { diff --git a/src/main/startup/main-process-ready-persistence-cleanup.test.ts b/src/main/startup/main-process-ready-persistence-cleanup.test.ts index ee7765acb9d..4151a587e4d 100644 --- a/src/main/startup/main-process-ready-persistence-cleanup.test.ts +++ b/src/main/startup/main-process-ready-persistence-cleanup.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { ServeDesktopActivationGate } from './serve-desktop-activation' +import type { ServeDesktopActivationGate } from './serve-launch/serve-desktop-activation' const { state, foundation, runtime, i18n, launch } = vi.hoisted(() => ({ state: { @@ -25,8 +25,10 @@ function initialActivationGate(): ServeDesktopActivationGate | null { vi.mock('./main-process-state', () => ({ mainProcessState: state })) vi.mock('./main-process-ready-foundation', () => ({ initializeReadyFoundation: foundation })) vi.mock('./main-process-ready-runtime', () => ({ initializeReadyRuntimeServices: runtime })) -vi.mock('./main-process-i18n-menu', () => ({ initializeMainProcessI18nAndMenu: i18n })) -vi.mock('./main-process-runtime-launch', () => ({ initializeMainProcessRuntimeLaunch: launch })) +vi.mock('./main-window/main-process-i18n-menu', () => ({ initializeMainProcessI18nAndMenu: i18n })) +vi.mock('./runtime-startup/main-process-runtime-launch', () => ({ + initializeMainProcessRuntimeLaunch: launch +})) import { initializeMainProcessReady } from './main-process-ready' @@ -66,25 +68,6 @@ describe('startup persistence lifetime', () => { expect(launch).not.toHaveBeenCalled() }) - it('joins concurrent startup branches before closing their Store', async () => { - const failure = new Error('translations failed') - i18n.mockRejectedValueOnce(failure) - let release = () => {} - launch.mockImplementationOnce( - () => - new Promise((resolve) => { - release = resolve - }) - ) - const ready = initializeMainProcessReady(options) - const rejected = expect(ready).rejects.toBe(failure) - await vi.waitFor(() => expect(launch).toHaveBeenCalledOnce()) - expect(state.store.freezeWritesAsync).not.toHaveBeenCalled() - release() - await rejected - expect(state.store.freezeWritesAsync).toHaveBeenCalledOnce() - }) - it('keeps the original startup failure when cleanup also fails', async () => { const log = vi.spyOn(console, 'error').mockImplementation(() => {}) const failure = new Error('foundation failed') diff --git a/src/main/startup/main-process-ready-phase-ordering.test.ts b/src/main/startup/main-process-ready-phase-ordering.test.ts index a66597549b7..2fb4881cd82 100644 --- a/src/main/startup/main-process-ready-phase-ordering.test.ts +++ b/src/main/startup/main-process-ready-phase-ordering.test.ts @@ -13,7 +13,7 @@ vi.mock('./main-process-ready-runtime', () => ({ phaseEvents.push('runtime-services') }) })) -vi.mock('./main-process-i18n-menu', () => ({ +vi.mock('./main-window/main-process-i18n-menu', () => ({ initializeMainProcessI18nAndMenu: vi.fn( () => new Promise((resolve) => { @@ -25,7 +25,7 @@ vi.mock('./main-process-i18n-menu', () => ({ }) ) })) -vi.mock('./main-process-runtime-launch', () => ({ +vi.mock('./runtime-startup/main-process-runtime-launch', () => ({ initializeMainProcessRuntimeLaunch: vi.fn(async () => { phaseEvents.push('launch-start') await Promise.resolve() @@ -34,7 +34,7 @@ vi.mock('./main-process-runtime-launch', () => ({ })) const { initializeMainProcessReady } = await import('./main-process-ready') -const { mainProcessState } = await import('./main-process-state') +await import('./main-process-state') describe('ready-phase concurrency', () => { beforeEach(() => { @@ -42,31 +42,6 @@ describe('ready-phase concurrency', () => { releaseI18n = null }) - it('creates the window without waiting for i18n and the native menu', async () => { - const options = { - openMainWindow: vi.fn(), - handleMacAppActivation: vi.fn() - } as unknown as Parameters[0] - - const ready = initializeMainProcessReady(options) - // Drain the launch phase's microtasks while i18n is still pending. - for (let tick = 0; tick < 8; tick += 1) { - await Promise.resolve() - } - - expect(phaseEvents).toEqual([ - 'foundation', - 'runtime-services', - 'i18n-start', - 'launch-start', - 'window-created' - ]) - - releaseI18n?.() - await ready - expect(phaseEvents.at(-1)).toBe('i18n-done') - }) - it('still resolves only once i18n and the menu have settled', async () => { const options = { openMainWindow: vi.fn(), @@ -87,37 +62,4 @@ describe('ready-phase concurrency', () => { await ready expect(settled).toBe(true) }) - - it('waits for the startup WSL move rewrite before runtime services and the window', async () => { - let finishRewrite: () => void = () => {} - mainProcessState.wslMoveStartupRewriteReady = new Promise((resolve) => { - finishRewrite = () => { - phaseEvents.push('wsl-move-rewrite-done') - resolve() - } - }) - const options = { - openMainWindow: vi.fn(), - handleMacAppActivation: vi.fn() - } as unknown as Parameters[0] - - const ready = initializeMainProcessReady(options) - for (let tick = 0; tick < 8; tick += 1) { - await Promise.resolve() - } - expect(phaseEvents).toEqual(['foundation']) - - finishRewrite() - for (let tick = 0; tick < 8; tick += 1) { - await Promise.resolve() - } - releaseI18n?.() - await ready - mainProcessState.wslMoveStartupRewriteReady = Promise.resolve() - expect(phaseEvents.slice(0, 3)).toEqual([ - 'foundation', - 'wsl-move-rewrite-done', - 'runtime-services' - ]) - }) }) diff --git a/src/main/startup/main-process-ready-runtime.ts b/src/main/startup/main-process-ready-runtime.ts index 4b70bdb6b37..397c78792ce 100644 --- a/src/main/startup/main-process-ready-runtime.ts +++ b/src/main/startup/main-process-ready-runtime.ts @@ -5,15 +5,18 @@ import { StarNagService } from '../star-nag/service' import { AgentBrowserBridge } from '../browser/agent-browser/agent-browser-bridge' import { EmulatorBridge } from '../emulator/emulator-bridge' import { RpcDispatcher } from '../runtime/rpc/dispatcher' -import { DESKTOP_RPC_CALLER, LOCAL_CLI_RPC_CALLER } from '../runtime/rpc/rpc-caller-identity' +import { + DESKTOP_RPC_CALLER, + LOCAL_CLI_RPC_CALLER +} from '../runtime/rpc/callers/rpc-caller-identity' import { browserManager } from '../browser/guest-lifecycle/manager/browser-manager' import { configureBrowserClientPageAutomationRuntime } from '../browser/client-pages/execution/browser-client-page-automation-runtime' import { BrowserExpectedUrlMismatch } from '../../shared/browser/client-hosting/browser-expected-url' import { BrowserClientPageCommandError } from '../browser/client-pages/execution/browser-client-page-command-failure' import { startPreGoneCrashSampling } from '../crash-reporting/process-exits/process-gone-diagnostics' -import { refuseRealtimeSchedulingUnderZeroRtTime } from './linux-realtime-scheduling-guard' -import { recordProcessGoneCrash } from './main-window-lifecycle-flags' -import { handleGpuChildCrash } from './gpu-lifecycle' +import { refuseRealtimeSchedulingUnderZeroRtTime } from './linux-runtime/linux-realtime-scheduling-guard' +import { recordProcessGoneCrash } from './main-window/main-window-lifecycle-flags' +import { handleGpuChildCrash } from './gpu-recovery/gpu-lifecycle' import { isGpuFallbackCrashCandidate } from '../crash-reporting/recovery/gpu-crash-fallback-decision' import { startCodexHooks } from '../codex/hooks/reconciliation/codex-hook-reconcile' import { hydrateAgentCliShellPath } from '../agent-hooks/installation/local-agent-cli-presence' @@ -22,22 +25,22 @@ import { reconcileStartupManagedAgentHooks } from '../agent-hooks/installation/m import { shouldInstallManagedHooks } from './configure-process' import { mainProcessState as state } from './main-process-state' import { initializeMainProcessObservers } from './main-process-observers' -import { installFirstWorkRenameHookSubscription } from './branch-rename-hook' -import { initializeMainProcessAccountServices } from './main-process-account-services' +import { installFirstWorkRenameHookSubscription } from './workspace-startup/branch-rename-hook' +import { initializeMainProcessAccountServices } from './agent-accounts/main-process-account-services' import { initializeMainProcessRuntime, configureRuntimeServices -} from './main-process-runtime-service' -import { initializeMainProcessAutomations } from './main-process-automations' -import { initializeMainProcessPlugins } from './main-process-plugins' +} from './runtime-startup/main-process-runtime-service' +import { initializeMainProcessAutomations } from './runtime-startup/main-process-automations' +import { initializeMainProcessPlugins } from './plugin-startup/main-process-plugins' import { collectWorktreeTrashSweepRoots, sweepStaleWorktreeTrash } from '../workspaces/removal/worktree-trash' -import { loadWorktreeRemovalRecordsForStore } from './worktree-removal-records-load' -import { runAfterFirstWindowShown } from './first-window-deferral' +import { loadWorktreeRemovalRecordsForStore } from './workspace-startup/worktree-removal-records-load' +import { runAfterFirstWindowShown } from './main-window/first-window-deferral' import { startSpeechModelWarmup } from '../speech/speech-model-warmup' -import { logStartupMilestone } from './startup-diagnostics' +import { logStartupMilestone } from './diagnostics/startup-diagnostics' import { refreshInstalledOpenCodeStatusPlugins } from '../opencode/status-hooks/opencode-status-plugin-startup-refresh' import { pruneDesktopOrcadArtifactCache } from '../orcad/orcad-artifact-cache-retention' import { runGatedWslMoveDesktopRewritePass } from '../persistence/moving-wsl-projects/desktop-state/wsl-move-desktop-rewrite' diff --git a/src/main/startup/main-process-ready.ts b/src/main/startup/main-process-ready.ts index 780f3ad8670..74c5043cd86 100644 --- a/src/main/startup/main-process-ready.ts +++ b/src/main/startup/main-process-ready.ts @@ -1,12 +1,12 @@ -import { initializeMainProcessI18nAndMenu } from './main-process-i18n-menu' +import { initializeMainProcessI18nAndMenu } from './main-window/main-process-i18n-menu' import { mainProcessState as state } from './main-process-state' import { initializeReadyFoundation } from './main-process-ready-foundation' import { initializeReadyRuntimeServices } from './main-process-ready-runtime' -import { releaseDesktopActivationAfter } from './serve-desktop-activation' +import { releaseDesktopActivationAfter } from './serve-launch/serve-desktop-activation' import { initializeMainProcessRuntimeLaunch, type MainProcessRuntimeLaunchOptions -} from './main-process-runtime-launch' +} from './runtime-startup/main-process-runtime-launch' export async function initializeMainProcessReady( launchOptions: MainProcessRuntimeLaunchOptions diff --git a/src/main/startup/main-process-state.ts b/src/main/startup/main-process-state.ts index ecb42038b0a..eedad7ac700 100644 --- a/src/main/startup/main-process-state.ts +++ b/src/main/startup/main-process-state.ts @@ -29,24 +29,27 @@ import type { KeybindingService } from '../keybindings/keybinding-service' import type { MobileRelayStatusDetail } from '../../shared/remote-runtime/relay/mobile-relay-status' import type { AgentBrowserBridge } from '../browser/agent-browser/agent-browser-bridge' import type { EmulatorBridge } from '../emulator/emulator-bridge' -import type { GpuFallbackMarker, GpuFallbackEnvironment } from './gpu-fallback-marker' +import type { GpuFallbackMarker, GpuFallbackEnvironment } from './gpu-recovery/gpu-fallback-marker' import type { createCodexSessionMigrationScheduler } from '../codex/history/backfill/codex-session-migration-scheduler' -import type { getDevInstanceIdentity } from './dev-instance-identity' -import type { createServeDesktopActivationGate } from './serve-desktop-activation' +import type { getDevInstanceIdentity } from './profile-startup/dev-instance-identity' +import type { createServeDesktopActivationGate } from './serve-launch/serve-desktop-activation' import type { ensureActiveOrcaProfile } from '../orca-profiles/profile-index-store' -import type { createWindowsShellPathHydration } from './windows-shell-path-hydration' -import type { ServeOptions } from './main-process-serve' +import type { createWindowsShellPathHydration } from './shell-environment/windows-shell-path-hydration' +import type { ServeOptions } from './serve-launch/serve-options' import type { HangDetectionMarker } from '../hang-watchdog/hang-detection-marker' import { ServeReadinessPublisher } from '../server/serve-readiness' -import { PluginInstallLinkState, SkillShareDeepLinkState } from './skill-share-deep-link-state' -import { OsOpenedDocumentState } from './os-opened-documents' +import { + PluginInstallLinkState, + SkillShareDeepLinkState +} from './open-routing/skill-share-deep-link-state' +import { OsOpenedDocumentState } from './open-routing/os-opened-documents' import { DEFAULT_GPU_CRASH_FALLBACK_THRESHOLD, DEFAULT_GPU_CRASH_FALLBACK_WINDOW_MS, GpuCrashFallbackTracker } from '../crash-reporting/recovery/gpu-crash-fallback-decision' import type { GpuCrashDiagnosticsRecorder } from '../crash-reporting/capture/gpu-crash-diagnostics' -import { createWebContentsTimedFlag } from './web-contents-timed-flag' +import { createWebContentsTimedFlag } from './main-window/web-contents-timed-flag' import type { ProfileStateStorageClassification } from '../persistence/profile-state/database/profile-state-storage-classification' import type { ProfileStateRuntimeAdmission } from '../persistence/profile-state/access/profile-state-access' diff --git a/src/main/startup/first-window-deferral.ts b/src/main/startup/main-window/first-window-deferral.ts similarity index 100% rename from src/main/startup/first-window-deferral.ts rename to src/main/startup/main-window/first-window-deferral.ts diff --git a/src/main/startup/main-process-i18n-menu.ts b/src/main/startup/main-window/main-process-i18n-menu.ts similarity index 85% rename from src/main/startup/main-process-i18n-menu.ts rename to src/main/startup/main-window/main-process-i18n-menu.ts index a586fb49562..8478c84e938 100644 --- a/src/main/startup/main-process-i18n-menu.ts +++ b/src/main/startup/main-window/main-process-i18n-menu.ts @@ -1,14 +1,14 @@ import { app, BrowserWindow } from 'electron' -import { setMainUiLanguage } from '../i18n/main-i18n' +import { setMainUiLanguage } from '../../i18n/main-i18n' import { registerAppMenu, rebuildAppMenu, getNextDefaultOnAppearanceSettingValue -} from '../menu/register-app-menu' -import { zoomDashboardPopoutIfFocused } from '../window/dashboard-popout-window' -import { zoomWorkspaceSpaceWindowIfFocused } from '../window/workspace-space-window' -import { recordCrashBreadcrumb } from '../crash-reporting/breadcrumbs/crash-breadcrumb-store' -import { mainProcessState as state } from './main-process-state' +} from '../../menu/register-app-menu' +import { zoomDashboardPopoutIfFocused } from '../../window/dashboard-popout-window' +import { zoomWorkspaceSpaceWindowIfFocused } from '../../window/workspace-space-window' +import { recordCrashBreadcrumb } from '../../crash-reporting/breadcrumbs/crash-breadcrumb-store' +import { mainProcessState as state } from '../main-process-state' import { getAppMenuQuitHandlers, openSettingsFromSystemMenu, @@ -17,9 +17,9 @@ import { sendOpenFeatureTour, sendOpenSetupGuide } from './main-window-actions' -import { ensureAutoUpdaterConfigured } from '../window/attach-main-window-services' -import { logStartupMilestone } from './startup-diagnostics' -import { browserManager } from '../browser/guest-lifecycle/manager/browser-manager' +import { ensureAutoUpdaterConfigured } from '../../updater/lifecycle/main-window-updater' +import { logStartupMilestone } from '../diagnostics/startup-diagnostics' +import { browserManager } from '../../browser/guest-lifecycle/manager/browser-manager' export async function initializeMainProcessI18nAndMenu(): Promise { const store = state.store diff --git a/src/main/startup/main-window-actions-quit-and-stop-all-sessions.test.ts b/src/main/startup/main-window/main-window-actions-quit-and-stop-all-sessions.test.ts similarity index 76% rename from src/main/startup/main-window-actions-quit-and-stop-all-sessions.test.ts rename to src/main/startup/main-window/main-window-actions-quit-and-stop-all-sessions.test.ts index f4af590118f..138e953b20d 100644 --- a/src/main/startup/main-window-actions-quit-and-stop-all-sessions.test.ts +++ b/src/main/startup/main-window/main-window-actions-quit-and-stop-all-sessions.test.ts @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { confirmQuitAndStopAllSessions, explainStopAllSessionsUnavailable -} from './quit-and-stop-all-sessions-prompt' +} from '../quit/quit-and-stop-all-sessions-prompt' const electron = vi.hoisted(() => ({ quit: vi.fn(), showMessageBox: vi.fn() })) const prompt = vi.hoisted(() => ({ @@ -19,49 +19,55 @@ vi.mock('electron', () => ({ app: { quit: electron.quit }, dialog: { showMessageBox: electron.showMessageBox } })) -vi.mock('./quit-and-stop-all-sessions-prompt', () => ({ +vi.mock('../quit/quit-and-stop-all-sessions-prompt', () => ({ confirmQuitAndStopAllSessions: prompt.confirm, explainStopAllSessionsUnavailable: prompt.explain })) -vi.mock('../daemon/providers/routing/daemon-newer-protocol-hold', () => ({ +vi.mock('../../daemon/providers/routing/daemon-newer-protocol-hold', () => ({ isHoldingForNewerProtocolDaemon: daemon.holdingNewer })) -vi.mock('../daemon/providers/lifecycle/daemon-provider-state', () => ({ +vi.mock('../../daemon/providers/lifecycle/daemon-provider-state', () => ({ getDaemonProvider: daemon.provider })) -vi.mock('../ipc/pty/pty-management', () => ({ +vi.mock('../../ipc/pty/pty-management', () => ({ confirmNoDaemonSessionsRemain: daemon.noSessionsRemain })) -vi.mock('../updater/updater-service', () => ({ +vi.mock('../../updater/updater-service', () => ({ checkForUpdatesFromMenu: vi.fn(), isQuittingForUpdate: vi.fn() })) -vi.mock('../tray/system-tray', () => ({ +vi.mock('../../tray/system-tray', () => ({ createSystemTray: vi.fn(), setMacMenuBarIconVisible: vi.fn() })) -vi.mock('../window/attach-main-window-services', () => ({ ensureAutoUpdaterConfigured: vi.fn() })) -vi.mock('../window/focus-existing-window', () => ({ +vi.mock('../../updater/lifecycle/main-window-updater', () => ({ + ensureAutoUpdaterConfigured: vi.fn() +})) +vi.mock('../../window/activation/focus-existing-window', () => ({ focusExistingMainWindow: vi.fn(), safelyRevealWindow: vi.fn() })) -vi.mock('../window/dashboard-popout-window', () => ({ getDashboardPopoutWindow: () => null })) -vi.mock('../window/createMainWindow', () => ({ loadMainWindow: vi.fn() })) -vi.mock('./windows-install-dir-acl-recovery', () => ({ +vi.mock('../../window/dashboard-popout-window', () => ({ getDashboardPopoutWindow: () => null })) +vi.mock('../../window/createMainWindow', () => ({ loadMainWindow: vi.fn() })) +vi.mock('../windows-install-permissions/windows-install-dir-acl-recovery', () => ({ describeInstallDirAclPoison: vi.fn(), isBlockingInstallDirAclRepairInFlight: vi.fn() })) -vi.mock('../window/renderer-recovery-prompt', () => ({ presentRendererRecoveryPrompt: vi.fn() })) -vi.mock('../window/renderer-launch-failure-probe', () => ({ probeRendererLaunchCapacity: vi.fn() })) +vi.mock('../../window/renderer-recovery/renderer-recovery-prompt', () => ({ + presentRendererRecoveryPrompt: vi.fn() +})) +vi.mock('../../window/renderer-recovery/renderer-launch-failure-probe', () => ({ + probeRendererLaunchCapacity: vi.fn() +})) -import { safelyRevealWindow } from '../window/focus-existing-window' +import { safelyRevealWindow } from '../../window/activation/focus-existing-window' import { consumeQuitAndStopAllSessionsRequest, quitAfterRendererStoppedAllSessions, quitAndStopAllSessionsFromUserCommand } from './main-window-actions' -import { mainProcessState as state } from './main-process-state' -import { quitTeardownStartGate } from './quit/quit-teardown-start-gate' +import { mainProcessState as state } from '../main-process-state' +import { quitTeardownStartGate } from '../quit/quit-teardown-start-gate' const MAIN_WEB_CONTENTS_ID = 7 diff --git a/src/main/startup/main-window-actions.ts b/src/main/startup/main-window/main-window-actions.ts similarity index 85% rename from src/main/startup/main-window-actions.ts rename to src/main/startup/main-window/main-window-actions.ts index e6ad7d3caf8..988d5e75d0a 100644 --- a/src/main/startup/main-window-actions.ts +++ b/src/main/startup/main-window/main-window-actions.ts @@ -8,42 +8,45 @@ import { type Tray, type WebContents } from 'electron' -import { isNativeBrowserPopupWindow } from '../browser/guest-lifecycle/popups/presentation/native-browser-popup-windows' -import type { UpdateCheckOptions } from '../../shared/update-status-types' -import type { AppMenuQuitHandlers } from '../menu/app-menu-quit-item' +import { isNativeBrowserPopupWindow } from '../../browser/guest-lifecycle/popups/presentation/native-browser-popup-windows' +import type { UpdateCheckOptions } from '../../../shared/update-status-types' +import type { AppMenuQuitHandlers } from '../../menu/app-menu-quit-item' import type { createWebContentsTimedFlag } from './web-contents-timed-flag' -import { recordCrashBreadcrumb } from '../crash-reporting/breadcrumbs/crash-breadcrumb-store' -import { recordDurableCrashBreadcrumb } from '../crash-reporting/breadcrumbs/durable-crash-breadcrumb' -import { checkForUpdatesFromMenu, isQuittingForUpdate } from '../updater/updater-service' +import { recordCrashBreadcrumb } from '../../crash-reporting/breadcrumbs/crash-breadcrumb-store' +import { recordDurableCrashBreadcrumb } from '../../crash-reporting/breadcrumbs/durable-crash-breadcrumb' +import { checkForUpdatesFromMenu, isQuittingForUpdate } from '../../updater/updater-service' import { createSystemTray, setMacMenuBarIconVisible, type SystemTrayOptions -} from '../tray/system-tray' -import { ensureAutoUpdaterConfigured } from '../window/attach-main-window-services' -import { focusExistingMainWindow, safelyRevealWindow } from '../window/focus-existing-window' -import { mainProcessState as state } from './main-process-state' -import { quitTeardownStartGate } from './quit/quit-teardown-start-gate' -import { getDashboardPopoutWindow } from '../window/dashboard-popout-window' -import { getWorkspaceSpaceWindow } from '../window/workspace-space-window' -import { markUserQuitWindowClose } from '../window/user-quit-window-close' -import { loadMainWindow } from '../window/createMainWindow' +} from '../../tray/system-tray' +import { ensureAutoUpdaterConfigured } from '../../updater/lifecycle/main-window-updater' +import { + focusExistingMainWindow, + safelyRevealWindow +} from '../../window/activation/focus-existing-window' +import { mainProcessState as state } from '../main-process-state' +import { quitTeardownStartGate } from '../quit/quit-teardown-start-gate' +import { getDashboardPopoutWindow } from '../../window/dashboard-popout-window' +import { getWorkspaceSpaceWindow } from '../../window/workspace-space-window' +import { markUserQuitWindowClose } from '../../window/main-window/user-quit-window-close' +import { loadMainWindow } from '../../window/createMainWindow' import { describeInstallDirAclPoison, isBlockingInstallDirAclRepairInFlight -} from './windows-install-dir-acl-recovery' +} from '../windows-install-permissions/windows-install-dir-acl-recovery' import { presentRendererRecoveryPrompt, type RendererRecoveryPromptFailure -} from '../window/renderer-recovery-prompt' -import { probeRendererLaunchCapacity } from '../window/renderer-launch-failure-probe' +} from '../../window/renderer-recovery/renderer-recovery-prompt' +import { probeRendererLaunchCapacity } from '../../window/renderer-recovery/renderer-launch-failure-probe' import { confirmQuitAndStopAllSessions, explainStopAllSessionsUnavailable -} from './quit-and-stop-all-sessions-prompt' -import { isHoldingForNewerProtocolDaemon } from '../daemon/providers/routing/daemon-newer-protocol-hold' -import { getDaemonProvider } from '../daemon/providers/lifecycle/daemon-provider-state' -import { confirmNoDaemonSessionsRemain } from '../ipc/pty/pty-management' +} from '../quit/quit-and-stop-all-sessions-prompt' +import { isHoldingForNewerProtocolDaemon } from '../../daemon/providers/routing/daemon-newer-protocol-hold' +import { getDaemonProvider } from '../../daemon/providers/lifecycle/daemon-provider-state' +import { confirmNoDaemonSessionsRemain } from '../../ipc/pty/pty-management' // Inject the opener to avoid an actions/lifecycle import cycle. let openWindow: (options?: { revealOnDidFinishLoad?: boolean }) => BrowserWindow diff --git a/src/main/startup/main-window-agent-status.ts b/src/main/startup/main-window/main-window-agent-status.ts similarity index 92% rename from src/main/startup/main-window-agent-status.ts rename to src/main/startup/main-window/main-window-agent-status.ts index e4e0b994d4e..0e224e8d7df 100644 --- a/src/main/startup/main-window-agent-status.ts +++ b/src/main/startup/main-window/main-window-agent-status.ts @@ -1,10 +1,10 @@ import type { BrowserWindow } from 'electron' -import { agentHookServer } from '../agent-hooks/server/agent-hook-server' -import { setMigrationUnsupportedPtyListener } from '../agent-hooks/observations/migration-unsupported-pty-state' -import { getDashboardPopoutWindow } from '../window/dashboard-popout-window' +import { agentHookServer } from '../../agent-hooks/server/agent-hook-server' +import { setMigrationUnsupportedPtyListener } from '../../agent-hooks/observations/migration-unsupported-pty-state' +import { getDashboardPopoutWindow } from '../../window/dashboard-popout-window' import { stopSyntheticTitleSpinnerTimer } from './synthetic-title-runtime' -import { mainProcessState as state } from './main-process-state' -import { pickHostTurnEnd } from '../../shared/agent-status/contracts/agent-status-types' +import { mainProcessState as state } from '../main-process-state' +import { pickHostTurnEnd } from '../../../shared/agent-status/contracts/agent-status-types' export type MainWindowAgentStatusOptions = { window: BrowserWindow diff --git a/src/main/startup/main-window-controller.ts b/src/main/startup/main-window/main-window-controller.ts similarity index 84% rename from src/main/startup/main-window-controller.ts rename to src/main/startup/main-window/main-window-controller.ts index e8366b54d63..1e3e4031df3 100644 --- a/src/main/startup/main-window-controller.ts +++ b/src/main/startup/main-window/main-window-controller.ts @@ -1,29 +1,29 @@ import { app, type BrowserWindow } from 'electron' -import { createMainWindow, loadMainWindow } from '../window/createMainWindow' +import { createMainWindow, loadMainWindow } from '../../window/createMainWindow' import { recordCrashBreadcrumb, recordCoalescedCrashBreadcrumb -} from '../crash-reporting/breadcrumbs/crash-breadcrumb-store' -import { recordDurableCrashBreadcrumb } from '../crash-reporting/breadcrumbs/durable-crash-breadcrumb' -import { shouldRecoverRendererAfterProcessGone } from '../crash-reporting/process-exits/process-gone-classification' -import { resolveConsent } from '../telemetry/consent' -import { trackAppOpenedOnce } from '../telemetry/client' -import { ensureWindowsUserDataAclGrant } from './windows-user-data-acl' -import { probeWindowsInstallDirAcl } from './windows-install-dir-acl-probe' +} from '../../crash-reporting/breadcrumbs/crash-breadcrumb-store' +import { recordDurableCrashBreadcrumb } from '../../crash-reporting/breadcrumbs/durable-crash-breadcrumb' +import { shouldRecoverRendererAfterProcessGone } from '../../crash-reporting/process-exits/process-gone-classification' +import { resolveConsent } from '../../telemetry/consent' +import { trackAppOpenedOnce } from '../../telemetry/client' +import { ensureWindowsUserDataAclGrant } from '../windows-startup/windows-user-data-acl' +import { probeWindowsInstallDirAcl } from '../windows-install-permissions/windows-install-dir-acl-probe' import { noteWindowsInstallDirAclProbePending, startWindowsInstallDirAclRepairIfPoisoned -} from './windows-install-dir-acl-recovery' -import { logStartupMilestone } from './startup-diagnostics' -import { notifyMainWindowBecameVisible } from '../window/main-window-visibility' -import { setTrayAttention } from '../tray/system-tray' +} from '../windows-install-permissions/windows-install-dir-acl-recovery' +import { logStartupMilestone } from '../diagnostics/startup-diagnostics' +import { notifyMainWindowBecameVisible } from '../../window/visibility/main-window-visibility' +import { setTrayAttention } from '../../tray/system-tray' import { createSystemTrayDeferred, showRendererRecoveryPrompt } from './main-window-actions' import { attachMainWindowCoreServices } from './main-window-core-services' import { clearMainWindowAgentStatusListeners, installMainWindowAgentStatusListeners } from './main-window-agent-status' -import { mainProcessState as state } from './main-process-state' +import { mainProcessState as state } from '../main-process-state' import { clearExpectedRendererReload, markExpectedRendererReload, @@ -31,20 +31,20 @@ import { getExpectedTeardownScope, recordProcessGoneCrash } from './main-window-lifecycle-flags' -import { presentGpuFallbackRecoveredLaunchPrompt } from './gpu-lifecycle' +import { presentGpuFallbackRecoveredLaunchPrompt } from '../gpu-recovery/gpu-lifecycle' import { resumeSyntheticTitleSpinnerTimer, stopSyntheticTitleSpinnerTimer } from './synthetic-title-runtime' import { requireMainWindowServices } from './main-window-service-readiness' -import { recordRendererLaunchFailureProbe } from '../window/renderer-launch-failure-probe' -import { trackBrowserExtensionMainWindow } from '../browser/extensions/tabs-and-windows/browser-extension-window-model' +import { recordRendererLaunchFailureProbe } from '../../window/renderer-recovery/renderer-launch-failure-probe' +import { trackBrowserExtensionMainWindow } from '../../browser/extensions/tabs-and-windows/browser-extension-window-model' -import { isResourceWindowVisible } from '../window/resource-view-admission' +import { isResourceWindowVisible } from '../../window/visibility/resource-view-admission' import { applyBackgroundActivationPolicy, applyServeDesktopWindowActivationPolicy -} from '../window/foreground-activation-policy' +} from '../../window/activation/foreground-activation-policy' const TRAY_CREATE_FALLBACK_MS = 12_000 const AGENT_STATE_CRASH_BREADCRUMB_MIN_INTERVAL_MS = 30_000 diff --git a/src/main/startup/main-window-core-services.ts b/src/main/startup/main-window/main-window-core-services.ts similarity index 78% rename from src/main/startup/main-window-core-services.ts rename to src/main/startup/main-window/main-window-core-services.ts index 5e997750b2b..ac215606b70 100644 --- a/src/main/startup/main-window-core-services.ts +++ b/src/main/startup/main-window/main-window-core-services.ts @@ -1,28 +1,28 @@ import type { BrowserWindow } from 'electron' -import { registerCoreHandlers } from '../ipc/register-core-handlers/register-core-handlers' -import { attachMainWindowServices } from '../window/attach-main-window-services' -import { initTccPromptNotice } from '../macos-permissions/macos-tcc-prompt-notice' -import { resolveUpdateInstallMode } from '../updater/updater-service' -import { desktopConnectorCloud } from './main-process-connector-startup' -import { mainProcessState as state } from './main-process-state' -import { prepareCodexAiVaultSessionResume } from '../codex/history/resume/codex-ai-vault-session-resume' -import { resolveHostCodexSessionSourceHome } from '../codex/history/rollouts/codex-session-source-home' -import { preserveAgentAuthBeforeRestart } from '../providers/accounts/agent-auth-restart-preservation' -import { preserveStateBeforeUpdateRestart } from '../updater/update-restart-preservation' +import { registerCoreHandlers } from '../../ipc/register-core-handlers/register-core-handlers' +import { attachMainWindowServices } from '../../window/attach-main-window-services' +import { initTccPromptNotice } from '../../macos-permissions/macos-tcc-prompt-notice' +import { resolveUpdateInstallMode } from '../../updater/updater-service' +import { desktopConnectorCloud } from '../cloud-startup/main-process-connector-startup' +import { mainProcessState as state } from '../main-process-state' +import { prepareCodexAiVaultSessionResume } from '../../codex/history/resume/codex-ai-vault-session-resume' +import { resolveHostCodexSessionSourceHome } from '../../codex/history/rollouts/codex-session-source-home' +import { preserveAgentAuthBeforeRestart } from '../../providers/accounts/agent-auth-restart-preservation' +import { preserveStateBeforeUpdateRestart } from '../../updater/update-restart-preservation' import { emitPluginWorktreeLifecycle, handleCodexHomePtySpawned, handlePtyExit -} from './main-process-pty-startup' -import { prepareCodexRuntimeHomeForLaunch } from './codex-launch-preparation' -import { resolveHostAgentBaseEnvironment } from '../runtime/agent-session/environment/structured-agent-shell-environment' +} from '../pty-startup/main-process-pty-startup' +import { prepareCodexRuntimeHomeForLaunch } from '../agent-accounts/codex-launch-preparation' +import { resolveHostAgentBaseEnvironment } from '../../runtime/agent-session/environment/structured-agent-shell-environment' import { prepareCodexPinnedLaunchHome, prepareCodexSessionResumeForLaunch -} from './codex-session-resume-launch' +} from '../agent-accounts/codex-session-resume-launch' import { isRecoveryReloadInFlight } from './main-window-lifecycle-flags' -import { RELAY_HOST_CLOSE_REASON } from '../../shared/relay-host-close-reason' -import { holdLaunchReconnectOptOuts } from '../ipc/ssh/ssh-host-user-disconnect' +import { RELAY_HOST_CLOSE_REASON } from '../../../shared/relay-host-close-reason' +import { holdLaunchReconnectOptOuts } from '../../ipc/ssh/ssh-host-user-disconnect' export function attachMainWindowCoreServices( window: BrowserWindow, diff --git a/src/main/startup/main-window-lifecycle-flags.ts b/src/main/startup/main-window/main-window-lifecycle-flags.ts similarity index 79% rename from src/main/startup/main-window-lifecycle-flags.ts rename to src/main/startup/main-window/main-window-lifecycle-flags.ts index d469966e990..64cc5c00fdf 100644 --- a/src/main/startup/main-window-lifecycle-flags.ts +++ b/src/main/startup/main-window/main-window-lifecycle-flags.ts @@ -1,8 +1,8 @@ -import { resolveExpectedTeardownScope } from '../crash-reporting/process-exits/expected-teardown-state' -import type { ExpectedTeardownScope } from '../crash-reporting/process-exits/process-gone-classification' -import { recordProcessGoneCrash as recordProcessGoneCrashEvent } from '../crash-reporting/process-exits/process-gone-recorder' -import { isQuittingForUpdate } from '../updater/updater-service' -import { mainProcessState as state } from './main-process-state' +import { resolveExpectedTeardownScope } from '../../crash-reporting/process-exits/expected-teardown-state' +import type { ExpectedTeardownScope } from '../../crash-reporting/process-exits/process-gone-classification' +import { recordProcessGoneCrash as recordProcessGoneCrashEvent } from '../../crash-reporting/process-exits/process-gone-recorder' +import { isQuittingForUpdate } from '../../updater/updater-service' +import { mainProcessState as state } from '../main-process-state' export function markExpectedRendererReload(webContentsId: number, durationMs = 10_000): void { state.expectedRendererReload.mark(webContentsId, durationMs) diff --git a/src/main/startup/main-window-service-readiness.ts b/src/main/startup/main-window/main-window-service-readiness.ts similarity index 100% rename from src/main/startup/main-window-service-readiness.ts rename to src/main/startup/main-window/main-window-service-readiness.ts diff --git a/src/main/startup/synthetic-title-runtime.ts b/src/main/startup/main-window/synthetic-title-runtime.ts similarity index 92% rename from src/main/startup/synthetic-title-runtime.ts rename to src/main/startup/main-window/synthetic-title-runtime.ts index d4a78ac35bb..284110aa61e 100644 --- a/src/main/startup/synthetic-title-runtime.ts +++ b/src/main/startup/main-window/synthetic-title-runtime.ts @@ -1,21 +1,21 @@ -import { registerPaneKeyTeardownListener, getPtyIdForPaneKey } from '../ipc/pty/pane/key-state' -import { agentHookServer } from '../agent-hooks/server/agent-hook-server' -import type { AgentStatusState } from '../../shared/agent-status/contracts/agent-status-types' -import { normalizeTerminalTitle } from '../../shared/agent-status/title/agent-title-status' +import { registerPaneKeyTeardownListener, getPtyIdForPaneKey } from '../../ipc/pty/pane/key-state' +import { agentHookServer } from '../../agent-hooks/server/agent-hook-server' +import type { AgentStatusState } from '../../../shared/agent-status/contracts/agent-status-types' +import { normalizeTerminalTitle } from '../../../shared/agent-status/title/agent-title-status' import { getSyntheticAgentTitleProfile, shouldDriveSyntheticAgentTitleFromHook, type SyntheticAgentTitleProfile -} from '../../shared/agent-status/title/synthetic-agent-title' +} from '../../../shared/agent-status/title/synthetic-agent-title' import { advanceSyntheticTitleSpinnerEntries, getSyntheticTitleSpinnerPaneKeyToStop, type SyntheticTitleSpinnerEntry -} from '../runtime/terminal/title/synthetic-title-spinner' -import { shouldSendSyntheticTitleFrame } from '../runtime/terminal/title/synthetic-title-visibility' -import { shouldCopySyntheticTitleFrameToPtyData } from '../runtime/terminal/title/synthetic-title-frame-routing' -import { mainProcessState as state } from './main-process-state' -import { CODEX_ASYNC_QUESTION_TOOL } from '../../shared/codex-async-question-input' +} from '../../runtime/terminal/title/synthetic-title-spinner' +import { shouldSendSyntheticTitleFrame } from '../../runtime/terminal/title/synthetic-title-visibility' +import { shouldCopySyntheticTitleFrameToPtyData } from '../../runtime/terminal/title/synthetic-title-frame-routing' +import { mainProcessState as state } from '../main-process-state' +import { CODEX_ASYNC_QUESTION_TOOL } from '../../../shared/codex-async-question-input' // Agent redraws can overwrite one-shot OSC titles; reassert at Pi's 80ms cadence. const SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'] diff --git a/src/main/startup/web-contents-timed-flag.ts b/src/main/startup/main-window/web-contents-timed-flag.ts similarity index 100% rename from src/main/startup/web-contents-timed-flag.ts rename to src/main/startup/main-window/web-contents-timed-flag.ts diff --git a/src/main/startup/http1-compatibility-marker.ts b/src/main/startup/network-compatibility/http1-compatibility-marker.ts similarity index 93% rename from src/main/startup/http1-compatibility-marker.ts rename to src/main/startup/network-compatibility/http1-compatibility-marker.ts index 54da41194e9..e4c99724cd3 100644 --- a/src/main/startup/http1-compatibility-marker.ts +++ b/src/main/startup/network-compatibility/http1-compatibility-marker.ts @@ -1,7 +1,7 @@ import { readFileSync, rmSync } from 'node:fs' import { join } from 'node:path' -import { durableWriteTempPath, writeFileDurableSync } from '../filesystem/durable-file-write' -import { bestEffortFsyncDirectorySync } from '../../shared/secure-storage/secure-file' +import { durableWriteTempPath, writeFileDurableSync } from '../../filesystem/durable-file-write' +import { bestEffortFsyncDirectorySync } from '../../../shared/secure-storage/secure-file' /** A tiny profile-scoped marker selects HTTP/2 before the first Electron session without reparsing multi-MB settings before Store startup. Profile identity prevents cross-profile reuse. */ diff --git a/src/main/startup/http1-compatibility-profile-state.ts b/src/main/startup/network-compatibility/http1-compatibility-profile-state.ts similarity index 89% rename from src/main/startup/http1-compatibility-profile-state.ts rename to src/main/startup/network-compatibility/http1-compatibility-profile-state.ts index 97e714f1e2c..88230ae75bd 100644 --- a/src/main/startup/http1-compatibility-profile-state.ts +++ b/src/main/startup/network-compatibility/http1-compatibility-profile-state.ts @@ -1,9 +1,9 @@ import { existsSync, readFileSync } from 'node:fs' import { dirname, join } from 'node:path' -import { profileStateJsonExportPaths } from '../persistence/profile-state/legacy-json/profile-state-export-path' -import { hasProfileStateAuthorityMarker } from '../persistence/profile-state/database/profile-state-authority-marker' -import { profileStateDatabaseBackups } from '../persistence/profile-state/backup/profile-state-backup-path' -import { hasProfileStateDatabaseFiles } from '../persistence/profile-state/database/profile-state-storage-classification' +import { profileStateJsonExportPaths } from '../../persistence/profile-state/legacy-json/profile-state-export-path' +import { hasProfileStateAuthorityMarker } from '../../persistence/profile-state/database/profile-state-authority-marker' +import { profileStateDatabaseBackups } from '../../persistence/profile-state/backup/profile-state-backup-path' +import { hasProfileStateDatabaseFiles } from '../../persistence/profile-state/database/profile-state-storage-classification' // Keep the pre-ready graph small; this stable ID mirrors DEFAULT_LOCAL_ORCA_PROFILE_ID. const DEFAULT_LOCAL_PROFILE_ID = 'local-default' diff --git a/src/main/startup/orca-deep-link-url.ts b/src/main/startup/open-routing/orca-deep-link-url.ts similarity index 58% rename from src/main/startup/orca-deep-link-url.ts rename to src/main/startup/open-routing/orca-deep-link-url.ts index 528425c05c4..5f386db779d 100644 --- a/src/main/startup/orca-deep-link-url.ts +++ b/src/main/startup/open-routing/orca-deep-link-url.ts @@ -1,5 +1,5 @@ -import { isPluginInstallLinkArgument } from '../../shared/plugins/catalog/plugin-install-link' -import { parseSkillShareId } from '../../shared/skill-share-link' +import { isPluginInstallLinkArgument } from '../../../shared/plugins/catalog/plugin-install-link' +import { parseSkillShareId } from '../../../shared/skill-share-link' /** macOS open-url: claim only links Orca routes, so other schemes keep their default handling. */ export function isRoutedOrcaDeepLink(url: string): boolean { diff --git a/src/main/startup/orca-protocol-registration.ts b/src/main/startup/open-routing/orca-protocol-registration.ts similarity index 100% rename from src/main/startup/orca-protocol-registration.ts rename to src/main/startup/open-routing/orca-protocol-registration.ts diff --git a/src/main/startup/os-opened-document-resolution.test.ts b/src/main/startup/open-routing/os-opened-document-resolution.test.ts similarity index 92% rename from src/main/startup/os-opened-document-resolution.test.ts rename to src/main/startup/open-routing/os-opened-document-resolution.test.ts index 50d10d338ec..cc79d35ee09 100644 --- a/src/main/startup/os-opened-document-resolution.test.ts +++ b/src/main/startup/open-routing/os-opened-document-resolution.test.ts @@ -4,11 +4,12 @@ import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { resolveOsOpenedDocuments } from './os-opened-documents' -vi.mock('../ipc/floating-workspace-directory', () => ({ +vi.mock('../../ipc/floating-workspace-directory', () => ({ ensureDefaultFloatingWorkspacePath: vi.fn() })) -const { ensureDefaultFloatingWorkspacePath } = await import('../ipc/floating-workspace-directory') +const { ensureDefaultFloatingWorkspacePath } = + await import('../../ipc/floating-workspace-directory') describe('resolveOsOpenedDocuments', () => { let floatingRoot: string diff --git a/src/main/startup/open-routing/os-opened-documents.test.ts b/src/main/startup/open-routing/os-opened-documents.test.ts new file mode 100644 index 00000000000..12063024ee0 --- /dev/null +++ b/src/main/startup/open-routing/os-opened-documents.test.ts @@ -0,0 +1,28 @@ +import { resolve, sep } from 'node:path' +import { describe, expect, it } from 'vitest' +import { OsOpenedDocumentState } from './os-opened-documents' + +// Normalize fixture paths with host rules, including Windows drive/separators. +const hostPath = (name: string): string => resolve(sep, 'notes', name) + +describe('OsOpenedDocumentState', () => { + it('does not duplicate a path captured twice', () => { + const state = new OsOpenedDocumentState() + const filePath = hostPath('a.csv') + + state.captureFilePaths([filePath]) + state.captureFilePaths([filePath]) + state.capture(['orca', filePath]) + + expect(state.consume()).toEqual([filePath]) + }) + + it('restores an undelivered batch at the front of the buffer', () => { + const state = new OsOpenedDocumentState() + state.captureFilePaths([hostPath('later.md')]) + + state.restore([hostPath('undelivered.md')]) + + expect(state.consume()).toEqual([hostPath('undelivered.md'), hostPath('later.md')]) + }) +}) diff --git a/src/main/startup/os-opened-documents.ts b/src/main/startup/open-routing/os-opened-documents.ts similarity index 95% rename from src/main/startup/os-opened-documents.ts rename to src/main/startup/open-routing/os-opened-documents.ts index 1e8287d02a9..dfe20bcc1d2 100644 --- a/src/main/startup/os-opened-documents.ts +++ b/src/main/startup/open-routing/os-opened-documents.ts @@ -1,12 +1,12 @@ import { stat } from 'node:fs/promises' import path from 'node:path' import { fileURLToPath } from 'node:url' -import type { FileDocument } from '../../shared/file-listing/file-document' -import { ensureDefaultFloatingWorkspacePath } from '../ipc/floating-workspace-directory' +import type { FileDocument } from '../../../shared/file-listing/file-document' +import { ensureDefaultFloatingWorkspacePath } from '../../ipc/floating-workspace-directory' import { fileDocumentFromFilePath, isMarkdownDocumentName -} from '../../shared/file-listing/markdown-document-paths' +} from '../../../shared/file-listing/markdown-document-paths' export function isOsOpenedDocumentName(name: string): boolean { const extension = path.extname(name).toLowerCase() diff --git a/src/main/startup/plugin-install-link-state.test.ts b/src/main/startup/open-routing/plugin-install-link-state.test.ts similarity index 73% rename from src/main/startup/plugin-install-link-state.test.ts rename to src/main/startup/open-routing/plugin-install-link-state.test.ts index 56bbc158c0c..669985290d8 100644 --- a/src/main/startup/plugin-install-link-state.test.ts +++ b/src/main/startup/open-routing/plugin-install-link-state.test.ts @@ -19,22 +19,6 @@ describe('PluginInstallLinkState', () => { expect(publish).toHaveBeenCalledWith('orca://plugins/not valid') expect(state.capture(['orca.exe', '--flag'], publish)).toBe(false) }) - - it('drops repeats and bursts', () => { - let now = 0 - const state = new PluginInstallLinkState(() => now) - const publish = vi.fn() - state.capture([LINK], publish) - state.capture([LINK], publish) - expect(publish).toHaveBeenCalledTimes(1) - for (let index = 0; index < 10; index += 1) { - state.capture([`orca://plugins/acme.p${index}`], publish) - } - expect(publish).toHaveBeenCalledTimes(5) - now = 5_000 - state.capture([LINK], publish) - expect(publish).toHaveBeenCalledTimes(6) - }) }) describe('isRoutedOrcaDeepLink', () => { diff --git a/src/main/startup/skill-share-deep-link-state.test.ts b/src/main/startup/open-routing/skill-share-deep-link-state.test.ts similarity index 100% rename from src/main/startup/skill-share-deep-link-state.test.ts rename to src/main/startup/open-routing/skill-share-deep-link-state.test.ts diff --git a/src/main/startup/skill-share-deep-link-state.ts b/src/main/startup/open-routing/skill-share-deep-link-state.ts similarity index 88% rename from src/main/startup/skill-share-deep-link-state.ts rename to src/main/startup/open-routing/skill-share-deep-link-state.ts index 9d58f3d6824..baa00e0d1c7 100644 --- a/src/main/startup/skill-share-deep-link-state.ts +++ b/src/main/startup/open-routing/skill-share-deep-link-state.ts @@ -1,5 +1,5 @@ -import { pluginInstallLinkFromArguments } from '../../shared/plugins/catalog/plugin-install-link' -import { skillShareIdFromArguments } from '../../shared/skill-share-link' +import { pluginInstallLinkFromArguments } from '../../../shared/plugins/catalog/plugin-install-link' +import { skillShareIdFromArguments } from '../../../shared/skill-share-link' const REPEAT_WINDOW_MS = 3_000 const BURST_LIMIT = 5 diff --git a/src/main/startup/os-opened-documents.test.ts b/src/main/startup/os-opened-documents.test.ts deleted file mode 100644 index 684ed8755be..00000000000 --- a/src/main/startup/os-opened-documents.test.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { resolve, sep } from 'node:path' -import { describe, expect, it, vi } from 'vitest' -import { MAX_PENDING_OS_OPENED_DOCUMENTS, OsOpenedDocumentState } from './os-opened-documents' - -// Normalize fixture paths with host rules, including Windows drive/separators. -const hostPath = (name: string): string => resolve(sep, 'notes', name) - -describe('OsOpenedDocumentState', () => { - it('does not duplicate a path captured twice', () => { - const state = new OsOpenedDocumentState() - const filePath = hostPath('a.csv') - - state.captureFilePaths([filePath]) - state.captureFilePaths([filePath]) - state.capture(['orca', filePath]) - - expect(state.consume()).toEqual([filePath]) - }) - - it('restores an undelivered batch at the front of the buffer', () => { - const state = new OsOpenedDocumentState() - state.captureFilePaths([hostPath('later.md')]) - - state.restore([hostPath('undelivered.md')]) - - expect(state.consume()).toEqual([hostPath('undelivered.md'), hostPath('later.md')]) - }) - - it('caps the buffer when a restore overflows it', () => { - const state = new OsOpenedDocumentState() - state.captureFilePaths([hostPath('pending.md')]) - const restored = Array.from({ length: MAX_PENDING_OS_OPENED_DOCUMENTS }, (_, index) => - hostPath(`restored-${index}.md`) - ) - - state.restore(restored) - - const pending = state.consume() - expect(pending).toHaveLength(MAX_PENDING_OS_OPENED_DOCUMENTS) - expect(pending).toEqual(restored) - }) -}) - -describe('OsOpenedDocumentState delivery cap', () => { - // Queue limits drop explicit user selections; pin shell order and require diagnostics for lost tail entries. - it('keeps the first paths in shell order and reports the dropped tail', () => { - const state = new OsOpenedDocumentState() - const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - const total = MAX_PENDING_OS_OPENED_DOCUMENTS + 8 - const paths = Array.from({ length: total }, (_, index) => - resolve(`/notes/${String(index).padStart(3, '0')}.md`) - ) - try { - expect(state.captureFilePaths(paths)).toBe(true) - expect(warn).toHaveBeenCalledWith( - expect.stringContaining(`Dropped 8 of ${total} OS-opened documents`) - ) - } finally { - warn.mockRestore() - } - expect(state.consume()).toEqual(paths.slice(0, MAX_PENDING_OS_OPENED_DOCUMENTS)) - }) - - it('reports a drop when an already-full queue rejects a later batch', () => { - const state = new OsOpenedDocumentState() - const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - try { - state.captureFilePaths( - Array.from({ length: MAX_PENDING_OS_OPENED_DOCUMENTS }, (_, index) => - resolve(`/first/${index}.md`) - ) - ) - expect(warn).not.toHaveBeenCalled() - state.captureFilePaths([resolve('/second/a.md'), resolve('/second/b.md')]) - expect(warn).toHaveBeenCalledWith(expect.stringContaining('Dropped 2 of 2')) - } finally { - warn.mockRestore() - } - expect(state.consume()).toEqual( - Array.from({ length: MAX_PENDING_OS_OPENED_DOCUMENTS }, (_, index) => - resolve(`/first/${index}.md`) - ) - ) - }) -}) diff --git a/src/main/startup/main-process-plugin-rpc.ts b/src/main/startup/plugin-startup/main-process-plugin-rpc.ts similarity index 58% rename from src/main/startup/main-process-plugin-rpc.ts rename to src/main/startup/plugin-startup/main-process-plugin-rpc.ts index efe605ae1a3..b4400dcf9a7 100644 --- a/src/main/startup/main-process-plugin-rpc.ts +++ b/src/main/startup/plugin-startup/main-process-plugin-rpc.ts @@ -1,11 +1,11 @@ -import type { Store } from '../persistence/loading-store/store' -import { applyPluginConsent, applyPluginEnablement } from '../plugins/plugin-enablement' -import type { PluginService } from '../plugins/plugin-service' -import type { PluginCliCatalogs } from '../plugins/plugin-cli-catalog-candidates' -import { clearPluginFrameStorage } from '../plugins/panels/guest-isolation/plugin-frame-guest-sessions' -import { openPluginFrameGuestDevTools } from '../plugins/panels/guest-isolation/plugin-frame-guest-diagnostics' -import { setPluginServiceForRpc } from '../runtime/rpc/methods/plugins/plugins' -import { setPluginInstallServicesForRpc } from '../runtime/rpc/methods/plugins/plugin-install-methods' +import type { Store } from '../../persistence/loading-store/store' +import { applyPluginConsent, applyPluginEnablement } from '../../plugins/plugin-enablement' +import type { PluginService } from '../../plugins/plugin-service' +import type { PluginCliCatalogs } from '../../plugins/plugin-cli-catalog-candidates' +import { clearPluginFrameStorage } from '../../plugins/panels/guest-isolation/plugin-frame-guest-sessions' +import { openPluginFrameGuestDevTools } from '../../plugins/panels/guest-isolation/plugin-frame-guest-diagnostics' +import { setPluginServiceForRpc } from '../../runtime/rpc/methods/plugins/plugins' +import { setPluginInstallServicesForRpc } from '../../runtime/rpc/methods/plugins/plugin-install-methods' /** Headless RPC resolves these too; consent shares the desktop hash-keyed write path. */ export function bindPluginRpcServices( diff --git a/src/main/startup/main-process-plugins.ts b/src/main/startup/plugin-startup/main-process-plugins.ts similarity index 79% rename from src/main/startup/main-process-plugins.ts rename to src/main/startup/plugin-startup/main-process-plugins.ts index 39c43791044..22dc5d33ad9 100644 --- a/src/main/startup/main-process-plugins.ts +++ b/src/main/startup/plugin-startup/main-process-plugins.ts @@ -1,52 +1,52 @@ import { join } from 'node:path' -import { PluginImageCache } from '../plugins/plugin-image-cache' -import { installPluginImageProtocolHandler } from '../plugins/plugin-image-protocol' -import { getPluginDesktopFrameServices } from '../plugins/panels/desktop-actions/plugin-frame-desktop-services' -import { pluginHostVersion } from '../../shared/plugins/installation/plugin-host-version' +import { PluginImageCache } from '../../plugins/plugin-image-cache' +import { installPluginImageProtocolHandler } from '../../plugins/plugin-image-protocol' +import { getPluginDesktopFrameServices } from '../../plugins/panels/desktop-actions/plugin-frame-desktop-services' +import { pluginHostVersion } from '../../../shared/plugins/installation/plugin-host-version' import { app, BrowserWindow, net } from 'electron' import { performance } from 'node:perf_hooks' -import { PluginService } from '../plugins/plugin-service' -import { PluginKillListService } from '../plugins/catalog/plugin-kill-list-service' -import { PluginInstallStatsService } from '../plugins/catalog/plugin-install-stats-service' -import { PluginMarketplaceService } from '../plugins/catalog/plugin-marketplace-service' -import { PluginMarketplaceInstaller } from '../plugins/catalog/plugin-marketplace-installer' -import { PluginAutoUpdater } from '../plugins/catalog/plugin-auto-updater' -import { PluginReleaseFirstSeenStore } from '../plugins/catalog/plugin-release-first-seen-store' -import { PluginUpdateReviewNotices } from '../plugins/catalog/plugin-update-review-notices' -import { isPluginAutoUpdateOn } from '../../shared/plugins/catalog/plugin-update-policy' -import { PluginBundledBootstrapCoordinator } from '../plugins/plugin-bundled-bootstrap-coordinator' -import { getPluginsDataDir } from '../plugins/plugin-discovery' -import { bundledPluginRootForApp } from '../plugins/plugin-bundled-bootstrap' -import { approveBundledPluginsFromStore } from '../plugins/plugin-bundled-approval' -import { resolvePluginHostEntryPath } from '../plugins/workers/parent-process/plugin-host-process' -import { applyPluginConsent, revokePluginConsent } from '../plugins/plugin-enablement' -import { clearRemovedPluginSettings } from '../plugins/plugin-removal-settings' -import { clearPluginFrameStorage } from '../plugins/panels/guest-isolation/plugin-frame-guest-sessions' +import { PluginService } from '../../plugins/plugin-service' +import { PluginKillListService } from '../../plugins/catalog/plugin-kill-list-service' +import { PluginInstallStatsService } from '../../plugins/catalog/plugin-install-stats-service' +import { PluginMarketplaceService } from '../../plugins/catalog/plugin-marketplace-service' +import { PluginMarketplaceInstaller } from '../../plugins/catalog/plugin-marketplace-installer' +import { PluginAutoUpdater } from '../../plugins/catalog/plugin-auto-updater' +import { PluginReleaseFirstSeenStore } from '../../plugins/catalog/plugin-release-first-seen-store' +import { PluginUpdateReviewNotices } from '../../plugins/catalog/plugin-update-review-notices' +import { isPluginAutoUpdateOn } from '../../../shared/plugins/catalog/plugin-update-policy' +import { PluginBundledBootstrapCoordinator } from '../../plugins/plugin-bundled-bootstrap-coordinator' +import { getPluginsDataDir } from '../../plugins/plugin-discovery' +import { bundledPluginRootForApp } from '../../plugins/plugin-bundled-bootstrap' +import { approveBundledPluginsFromStore } from '../../plugins/plugin-bundled-approval' +import { resolvePluginHostEntryPath } from '../../plugins/workers/parent-process/plugin-host-process' +import { applyPluginConsent, revokePluginConsent } from '../../plugins/plugin-enablement' +import { clearRemovedPluginSettings } from '../../plugins/plugin-removal-settings' +import { clearPluginFrameStorage } from '../../plugins/panels/guest-isolation/plugin-frame-guest-sessions' import { bindPluginRpcServices } from './main-process-plugin-rpc' -import { bindPluginDesktopViews } from '../plugins/view/plugin-view-desktop-binding' +import { bindPluginDesktopViews } from '../../plugins/view/plugin-view-desktop-binding' import { normalizePluginConsents, normalizePluginIdList -} from '../../shared/plugins/approval/plugin-consent-state' -import { projectPluginAgentStatusChangedPayload } from '../plugins/plugin-agent-status-event' -import { setMainPluginLanguagePacks, setMainUiLanguage } from '../i18n/main-i18n' -import { isUsablePluginLanguagePack } from '../../shared/plugins/languages/plugin-language-pack-coverage' -import { rebuildAppMenu } from '../menu/register-app-menu' -import { rebuildSystemTrayMenu } from '../tray/system-tray' -import { logStartupMilestone } from './startup-diagnostics' -import { agentHookServer } from '../agent-hooks/server/agent-hook-server' +} from '../../../shared/plugins/approval/plugin-consent-state' +import { projectPluginAgentStatusChangedPayload } from '../../plugins/plugin-agent-status-event' +import { setMainPluginLanguagePacks, setMainUiLanguage } from '../../i18n/main-i18n' +import { isUsablePluginLanguagePack } from '../../../shared/plugins/languages/plugin-language-pack-coverage' +import { rebuildAppMenu } from '../../menu/register-app-menu' +import { rebuildSystemTrayMenu } from '../../tray/system-tray' +import { logStartupMilestone } from '../diagnostics/startup-diagnostics' +import { agentHookServer } from '../../agent-hooks/server/agent-hook-server' import { bindPluginRuntime, createPluginAgentStatusForwarder, watchPluginWorkspaceContext -} from '../plugins/plugin-runtime-binding' -import { emitPluginWorktreeLifecycle } from './main-process-pty-startup' -import { mainProcessState as state } from './main-process-state' -import type { OrcaRuntimeService } from '../runtime/orca-runtime' -import { PluginStatusBarState } from '../plugins/status-bar/plugin-status-bar-state' -import { createDesktopPluginAppearance } from '../plugins/appearance/desktop-plugin-appearance' -import { bindPluginEditorTypography } from '../plugins/appearance/plugin-editor-typography' -import { ALL_RPC_METHODS } from '../runtime/rpc/methods/rpc-method-registry' +} from '../../plugins/plugin-runtime-binding' +import { emitPluginWorktreeLifecycle } from '../pty-startup/main-process-pty-startup' +import { mainProcessState as state } from '../main-process-state' +import type { OrcaRuntimeService } from '../../runtime/orca-runtime' +import { PluginStatusBarState } from '../../plugins/status-bar/plugin-status-bar-state' +import { createDesktopPluginAppearance } from '../../plugins/appearance/desktop-plugin-appearance' +import { bindPluginEditorTypography } from '../../plugins/appearance/plugin-editor-typography' +import { ALL_RPC_METHODS } from '../../runtime/rpc/methods/rpc-method-registry' const PLUGIN_AUTO_UPDATE_STARTUP_DELAY_MS = 60_000 // Why: the official catalog fetch must not compete with first paint; opening the marketplace seeds sooner. @@ -298,7 +298,7 @@ export async function initializeMainProcessPlugins(runtime: OrcaRuntimeService): // Filter hook/worktree events server-side by each plugin subscription. const forwardAgentStatus = createPluginAgentStatusForwarder(pluginDelegate, pluginService) agentHookServer.subscribeEnrichedStatus((enriched) => { - const payload = projectPluginAgentStatusChangedPayload(enriched) + const payload = projectPluginAgentStatusChangedPayload(enriched, store) if (payload) { forwardAgentStatus(payload, enriched.terminalHandle) } diff --git a/src/main/startup/privileged-custom-schemes.ts b/src/main/startup/privileged-custom-schemes.ts deleted file mode 100644 index 89dd69adaa1..00000000000 --- a/src/main/startup/privileged-custom-schemes.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { BROWSER_EXTENSION_API_CUSTOM_SCHEME } from '../browser/extensions/api-runtime/browser-extension-api-scheme' -import { JIRA_IMAGE_CUSTOM_SCHEME } from '../jira/attachments/image-protocol' -import { MEDIA_PREVIEW_CUSTOM_SCHEME } from '../media/media-preview-protocol' -import { PLUGIN_IMAGE_CUSTOM_SCHEME } from '../plugins/plugin-image-scheme' -import { PLUGIN_FRAME_CUSTOM_SCHEME } from '../plugins/panels/guest-isolation/plugin-frame-scheme' - -/** Registered with doc preview's in one call: each registerSchemesAsPrivileged call replaces the last. */ -export const PRIVILEGED_CUSTOM_SCHEMES: Electron.CustomScheme[] = [ - MEDIA_PREVIEW_CUSTOM_SCHEME, - JIRA_IMAGE_CUSTOM_SCHEME, - BROWSER_EXTENSION_API_CUSTOM_SCHEME, - PLUGIN_IMAGE_CUSTOM_SCHEME, - PLUGIN_FRAME_CUSTOM_SCHEME -] diff --git a/src/main/startup/bootstrap-fatal-exit-guard.ts b/src/main/startup/process-failure/bootstrap-fatal-exit-guard.ts similarity index 100% rename from src/main/startup/bootstrap-fatal-exit-guard.ts rename to src/main/startup/process-failure/bootstrap-fatal-exit-guard.ts diff --git a/src/main/startup/main-process-error-guards.test.ts b/src/main/startup/process-failure/main-process-error-guards.test.ts similarity index 92% rename from src/main/startup/main-process-error-guards.test.ts rename to src/main/startup/process-failure/main-process-error-guards.test.ts index cc198e46458..186ffed4fe7 100644 --- a/src/main/startup/main-process-error-guards.test.ts +++ b/src/main/startup/process-failure/main-process-error-guards.test.ts @@ -7,7 +7,7 @@ afterEach(() => { describe('main-process fatal error guards (issue #9441)', () => { it('never throws when the breadcrumb sink fails', async () => { vi.resetModules() - vi.doMock('../crash-reporting/breadcrumbs/durable-crash-breadcrumb', () => ({ + vi.doMock('../../crash-reporting/breadcrumbs/durable-crash-breadcrumb', () => ({ recordDurableCrashBreadcrumb: vi.fn(() => { throw new Error('sink offline') }) @@ -26,7 +26,7 @@ describe('main-process fatal error guards (issue #9441)', () => { it('bounds and isolates console formatting for hostile rejection values', async () => { vi.resetModules() const record = vi.fn() - vi.doMock('../crash-reporting/breadcrumbs/durable-crash-breadcrumb', () => ({ + vi.doMock('../../crash-reporting/breadcrumbs/durable-crash-breadcrumb', () => ({ recordDurableCrashBreadcrumb: record })) const { recordFatalMainProcessError } = await import('./main-process-error-guards') @@ -61,7 +61,7 @@ describe('main-process fatal error guards (issue #9441)', () => { it('caps oversized rejection diagnostics before recording or logging', async () => { vi.resetModules() const record = vi.fn() - vi.doMock('../crash-reporting/breadcrumbs/durable-crash-breadcrumb', () => ({ + vi.doMock('../../crash-reporting/breadcrumbs/durable-crash-breadcrumb', () => ({ recordDurableCrashBreadcrumb: record })) const { recordFatalMainProcessError } = await import('./main-process-error-guards') @@ -82,7 +82,7 @@ describe('main-process fatal error guards (issue #9441)', () => { it('rethrows non-pipe errors outside the uncaughtException handler', async () => { vi.resetModules() - vi.doMock('../crash-reporting/breadcrumbs/durable-crash-breadcrumb', () => ({ + vi.doMock('../../crash-reporting/breadcrumbs/durable-crash-breadcrumb', () => ({ recordDurableCrashBreadcrumb: vi.fn() })) const { installUncaughtPipeErrorGuard } = await import('./main-process-error-guards') diff --git a/src/main/startup/main-process-error-guards.ts b/src/main/startup/process-failure/main-process-error-guards.ts similarity index 97% rename from src/main/startup/main-process-error-guards.ts rename to src/main/startup/process-failure/main-process-error-guards.ts index 1f65cc51d36..b0a75f8cade 100644 --- a/src/main/startup/main-process-error-guards.ts +++ b/src/main/startup/process-failure/main-process-error-guards.ts @@ -1,4 +1,4 @@ -import { recordDurableCrashBreadcrumb } from '../crash-reporting/breadcrumbs/durable-crash-breadcrumb' +import { recordDurableCrashBreadcrumb } from '../../crash-reporting/breadcrumbs/durable-crash-breadcrumb' import { removeBootstrapFatalExitGuard } from './bootstrap-fatal-exit-guard' type FatalMainProcessErrorKind = 'main_uncaught_exception' | 'main_unhandled_rejection' diff --git a/src/main/startup/desktop-profile-instance-lock.ts b/src/main/startup/profile-startup/desktop-profile-instance-lock.ts similarity index 81% rename from src/main/startup/desktop-profile-instance-lock.ts rename to src/main/startup/profile-startup/desktop-profile-instance-lock.ts index ff95300a834..24255078740 100644 --- a/src/main/startup/desktop-profile-instance-lock.ts +++ b/src/main/startup/profile-startup/desktop-profile-instance-lock.ts @@ -1,7 +1,11 @@ /** Share orcad's profile lock to prevent concurrent desktop/serve writers; Electron's own instance lock cannot fence plain Node. */ -import { acquireOrcadInstanceLock, type OrcadInstanceLock } from '../orcad/orcad-instance-lock' -import { OrcadInstanceLockError } from '../orcad/orcad-data-root-privacy' -import { writeStartupDiagnosticLine, type StartupDiagnosticSink } from './startup-diagnostics' +import { acquireOrcadInstanceLock } from '../../orcad/orcad-instance-lock' +import type { OrcadInstanceLock } from '../../orcad/orcad-instance-lock-hold' +import { OrcadInstanceLockError } from '../../orcad/orcad-data-root-privacy' +import { + writeStartupDiagnosticLine, + type StartupDiagnosticSink +} from '../diagnostics/startup-diagnostics' export type DesktopProfileLockResult = | { state: 'acquired'; lock: OrcadInstanceLock } diff --git a/src/main/startup/dev-education-suppression.ts b/src/main/startup/profile-startup/dev-education-suppression.ts similarity index 84% rename from src/main/startup/dev-education-suppression.ts rename to src/main/startup/profile-startup/dev-education-suppression.ts index 1d8fb360a61..aebcfd1204b 100644 --- a/src/main/startup/dev-education-suppression.ts +++ b/src/main/startup/profile-startup/dev-education-suppression.ts @@ -1,12 +1,10 @@ -import { ONBOARDING_FINAL_STEP, ONBOARDING_FLOW_VERSION } from '../../shared/onboarding-defaults' -import { CONTEXTUAL_TOUR_IDS } from '../../shared/contextual-tours' -import { - FEATURE_INTERACTION_IDS, - type FeatureInteractionState -} from '../../shared/feature-interactions' -import { FEATURE_TIP_SEEN_IDS } from '../../shared/feature-tips' -import type { PersistedUIState } from '../../shared/persisted-ui-state-types' -import type { Store } from '../persistence/loading-store/store' +import { ONBOARDING_FINAL_STEP, ONBOARDING_FLOW_VERSION } from '../../../shared/onboarding-defaults' +import { CONTEXTUAL_TOUR_IDS } from '../../../shared/contextual-tours' +import { FEATURE_INTERACTION_IDS } from '../../../shared/feature-interaction-catalog' +import type { FeatureInteractionState } from '../../../shared/feature-interactions' +import { FEATURE_TIP_SEEN_IDS } from '../../../shared/feature-tips' +import type { PersistedUIState } from '../../../shared/persisted-ui-state-types' +import type { Store } from '../../persistence/loading-store/store' export const DEV_SHOW_FIRST_RUN_EDUCATION_ENV = 'ORCA_DEV_SHOW_FIRST_RUN_EDUCATION' diff --git a/src/main/startup/dev-instance-identity.ts b/src/main/startup/profile-startup/dev-instance-identity.ts similarity index 97% rename from src/main/startup/dev-instance-identity.ts rename to src/main/startup/profile-startup/dev-instance-identity.ts index 1e11943398b..96baec5733a 100644 --- a/src/main/startup/dev-instance-identity.ts +++ b/src/main/startup/profile-startup/dev-instance-identity.ts @@ -1,6 +1,6 @@ import { createHash } from 'node:crypto' import path from 'node:path' -import type { AppIdentity } from '../../shared/app-identity' +import type { AppIdentity } from '../../../shared/app-identity' const BASE_APP_NAME = 'Orca' const BASE_APP_USER_MODEL_ID = 'com.stablyai.orca' diff --git a/src/main/startup/profile-state-recovery-preflight.test.ts b/src/main/startup/profile-startup/profile-state-recovery-preflight.test.ts similarity index 92% rename from src/main/startup/profile-state-recovery-preflight.test.ts rename to src/main/startup/profile-startup/profile-state-recovery-preflight.test.ts index 4e4af59452c..0c0cd88d412 100644 --- a/src/main/startup/profile-state-recovery-preflight.test.ts +++ b/src/main/startup/profile-startup/profile-state-recovery-preflight.test.ts @@ -14,23 +14,23 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { PROFILE_STATE_RECOVERY_FLAG, PROFILE_STATE_RECOVERY_RESULT_PREFIX -} from '../../shared/profile-state-recovery-command' -import { acquireProfileStateRuntimeAdmission } from '../persistence/profile-state/access/profile-state-access' -import { profileStateJsonExportPath } from '../persistence/profile-state/legacy-json/profile-state-export-path' +} from '../../../shared/profile-state-recovery-command' +import { acquireProfileStateRuntimeAdmission } from '../../persistence/profile-state/access/profile-state-access' +import { profileStateJsonExportPath } from '../../persistence/profile-state/legacy-json/profile-state-export-path' import { createProfileStateDatabaseBackupId, profileStateDatabaseBackupPath -} from '../persistence/profile-state/backup/profile-state-backup-path' +} from '../../persistence/profile-state/backup/profile-state-backup-path' import { openProfileStateDatabase, openProfileStateDatabaseReadOnly -} from '../persistence/profile-state/database/profile-state-database' +} from '../../persistence/profile-state/database/profile-state-database' import { importProfileStateJson, readProfileStateSnapshot -} from '../persistence/profile-state/documents/profile-state-documents' -import { writeProfileStateDatabaseSnapshotAsync } from '../persistence/profile-state/database/profile-state-database-snapshot' -import * as marker from './http1-compatibility-marker' +} from '../../persistence/profile-state/documents/profile-state-documents' +import { writeProfileStateDatabaseSnapshotAsync } from '../../persistence/profile-state/database/profile-state-database-snapshot' +import * as marker from '../network-compatibility/http1-compatibility-marker' import { profileStateDesktopRecoveryArgs, runProfileStateRecoveryPreflight @@ -51,7 +51,7 @@ vi.mock('electron', () => ({ app: mocks, dialog: { showMessageBox: mocks.showMessageBox } })) -vi.mock('../window/foreground-activation-policy', () => ({ +vi.mock('../../window/activation/foreground-activation-policy', () => ({ applyBackgroundActivationPolicy: mocks.background })) vi.mock('node:fs', async (original) => { diff --git a/src/main/startup/profile-state-recovery-preflight.ts b/src/main/startup/profile-startup/profile-state-recovery-preflight.ts similarity index 91% rename from src/main/startup/profile-state-recovery-preflight.ts rename to src/main/startup/profile-startup/profile-state-recovery-preflight.ts index 098381ba60c..2f57764585f 100644 --- a/src/main/startup/profile-state-recovery-preflight.ts +++ b/src/main/startup/profile-startup/profile-state-recovery-preflight.ts @@ -10,11 +10,11 @@ import { profileStateRecoveryRequestSchema, type ProfileStateRecoveryRequest, type ProfileStateRecoveryResponse -} from '../../shared/profile-state-recovery-command' -import { prepareEarlyMainUiLanguage, translateMain } from '../i18n/main-i18n' -import { acquireProfileStateMaintenance } from '../persistence/profile-state/access/profile-state-access' -import { rollbackProfileState } from '../persistence/profile-state/recovery/profile-state-recovery-command' -import { applyBackgroundActivationPolicy } from '../window/foreground-activation-policy' +} from '../../../shared/profile-state-recovery-command' +import { prepareEarlyMainUiLanguage, translateMain } from '../../i18n/main-i18n' +import { acquireProfileStateMaintenance } from '../../persistence/profile-state/access/profile-state-access' +import { rollbackProfileState } from '../../persistence/profile-state/recovery/profile-state-recovery-command' +import { applyBackgroundActivationPolicy } from '../../window/activation/foreground-activation-policy' import { acquireSingleInstanceLock } from './single-instance-lock' /** The process owning both locks performs recovery before Electron can initialize a runtime. */ diff --git a/src/main/startup/profile-state-save-delay.test.ts b/src/main/startup/profile-startup/profile-state-save-delay.test.ts similarity index 95% rename from src/main/startup/profile-state-save-delay.test.ts rename to src/main/startup/profile-startup/profile-state-save-delay.test.ts index a360d1c97b5..bf5a59ac9d5 100644 --- a/src/main/startup/profile-state-save-delay.test.ts +++ b/src/main/startup/profile-startup/profile-state-save-delay.test.ts @@ -1,7 +1,7 @@ import { afterEach, beforeEach, expect, it, vi } from 'vitest' const send = vi.hoisted(() => vi.fn()) -vi.mock('../ipc/ui', () => ({ sendToTrustedUIRenderer: send })) +vi.mock('../../ipc/ui', () => ({ sendToTrustedUIRenderer: send })) import { isProfileStateSaveDelayed, reportProfileStateSaveDelay } from './profile-state-save-delay' diff --git a/src/main/startup/profile-state-save-delay.ts b/src/main/startup/profile-startup/profile-state-save-delay.ts similarity index 89% rename from src/main/startup/profile-state-save-delay.ts rename to src/main/startup/profile-startup/profile-state-save-delay.ts index 7cd965d9374..86f7f003d48 100644 --- a/src/main/startup/profile-state-save-delay.ts +++ b/src/main/startup/profile-startup/profile-state-save-delay.ts @@ -1,4 +1,4 @@ -import { sendToTrustedUIRenderer } from '../ipc/ui' +import { sendToTrustedUIRenderer } from '../../ipc/ui' let saveDelayed = false diff --git a/src/main/startup/profile-state-write-failure.ts b/src/main/startup/profile-startup/profile-state-write-failure.ts similarity index 85% rename from src/main/startup/profile-state-write-failure.ts rename to src/main/startup/profile-startup/profile-state-write-failure.ts index ac56f0f348d..cf1a3de02ae 100644 --- a/src/main/startup/profile-state-write-failure.ts +++ b/src/main/startup/profile-startup/profile-state-write-failure.ts @@ -1,10 +1,10 @@ import { app, dialog, type BrowserWindow, type MessageBoxOptions } from 'electron' -import { translateMain } from '../i18n/main-i18n' -import { profileStateWriterFailureOutcome } from '../persistence/profile-state/writer/profile-state-writer-errors' -import { recordProfileStateWriteFailureReport } from '../persistence/profile-state/writer/profile-state-writer-diagnostics' -import { isBackgroundLaunch } from '../window/foreground-activation-policy' -import { waitForWindowToShow } from '../window/wait-for-window-to-show' -import { mainProcessState } from './main-process-state' +import { translateMain } from '../../i18n/main-i18n' +import { profileStateWriterFailureOutcome } from '../../persistence/profile-state/writer/profile-state-writer-errors' +import { recordProfileStateWriteFailureReport } from '../../persistence/profile-state/writer/profile-state-writer-diagnostics' +import { isBackgroundLaunch } from '../../window/activation/foreground-activation-policy' +import { waitForWindowToShow } from '../../window/visibility/wait-for-window-to-show' +import { mainProcessState } from '../main-process-state' let presenting = false diff --git a/src/main/startup/single-instance-lock.ts b/src/main/startup/profile-startup/single-instance-lock.ts similarity index 92% rename from src/main/startup/single-instance-lock.ts rename to src/main/startup/profile-startup/single-instance-lock.ts index 8edcd844111..c0c9c06502b 100644 --- a/src/main/startup/single-instance-lock.ts +++ b/src/main/startup/profile-startup/single-instance-lock.ts @@ -1,6 +1,9 @@ import type { App } from 'electron' -import { argvRequestsServeMode } from './serve-mode-argv' -import { writeStartupDiagnosticLine, type StartupDiagnosticSink } from './startup-diagnostics' +import { argvRequestsServeMode } from '../serve-launch/serve-mode-argv' +import { + writeStartupDiagnosticLine, + type StartupDiagnosticSink +} from '../diagnostics/startup-diagnostics' export const SINGLE_INSTANCE_LOCK_FAILURE_MESSAGE = '[single-instance] Another Orca instance is already running for this userData profile; exiting this launch after requesting the existing window. If no Orca process is running, this may be an Electron/macOS single-instance lock failure.' @@ -8,7 +11,6 @@ export const SINGLE_INSTANCE_LOCK_BYPASS_ENV = 'ORCA_BYPASS_SINGLE_INSTANCE_LOCK export const SINGLE_INSTANCE_LOCK_E2E_ENFORCE_ENV = 'ORCA_E2E_ENFORCE_SINGLE_INSTANCE_LOCK' export const SINGLE_INSTANCE_LOCK_BYPASS_MESSAGE = '[single-instance] ORCA_BYPASS_SINGLE_INSTANCE_LOCK=1 is set; bypassing the packaged macOS single-instance lock for diagnostics. Do not use this with another Orca instance running for the same profile.' -export { SINGLE_INSTANCE_ALREADY_RUNNING_EXIT_CODE } from '../../shared/single-instance-exit-code' // Supervisor duplicate serve launches must not activate desktop; recognize CLI-form argv too (#12677, #11935). Missing argv preserves activation. export function shouldActivateDesktopForSecondInstance(argv: readonly string[] = []): boolean { diff --git a/src/main/startup/profile-state-write-failure.test.ts b/src/main/startup/profile-state-write-failure.test.ts deleted file mode 100644 index 0ded8f3db67..00000000000 --- a/src/main/startup/profile-state-write-failure.test.ts +++ /dev/null @@ -1,170 +0,0 @@ -import { EventEmitter } from 'node:events' -import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import { ProfileStateWriterError } from '../persistence/profile-state/writer/profile-state-writer-errors' - -const fixture = await vi.hoisted(async () => { - const events = await import('node:events') - const state: { isServeMode: boolean; isQuitting: boolean; mainWindow: unknown } = { - isServeMode: false, - isQuitting: false, - mainWindow: null - } - return { show: vi.fn(), background: false, app: new events.EventEmitter(), state } -}) -vi.mock('electron', () => ({ app: fixture.app, dialog: { showMessageBox: fixture.show } })) -vi.mock('../window/foreground-activation-policy', () => ({ - isBackgroundLaunch: () => fixture.background -})) -vi.mock('./main-process-state', () => ({ mainProcessState: fixture.state })) -vi.mock('../persistence/profile-state/writer/profile-state-writer-diagnostics', () => ({ - recordProfileStateWriteFailureReport: vi.fn() -})) - -const { reportProfileStateWriteFailure } = await import('./profile-state-write-failure') -const { recordProfileStateWriteFailureReport } = - await import('../persistence/profile-state/writer/profile-state-writer-diagnostics') - -class FakeWindow extends EventEmitter { - visible: boolean - destroyed = false - readonly webContents = Object.assign(new EventEmitter(), { isDestroyed: () => false }) - readonly reveal = vi.fn() - constructor(visible: boolean) { - super() - this.visible = visible - } - isVisible() { - return this.visible - } - isDestroyed() { - return this.destroyed - } - // Any reveal/activation fails: persistence errors must remain in the background. - show = this.reveal - showInactive = this.reveal - focus = this.reveal - moveTop = this.reveal -} - -const workerExit = new ProfileStateWriterError( - 'profile-state-writer-exit', - 'exited', - 'indeterminate' -) -const conflict = new ProfileStateWriterError( - 'profile-state-revision-conflict', - 'conflict', - 'known-failure' -) - -beforeEach(() => { - fixture.background = false - fixture.state.isServeMode = false - fixture.state.isQuitting = false - fixture.state.mainWindow = null - fixture.show.mockResolvedValue({ response: 0 }) - vi.spyOn(console, 'error').mockImplementation(() => {}) - vi.spyOn(console, 'warn').mockImplementation(() => {}) -}) -afterEach(async () => { - // Release pending reporters so module state cannot leak across tests. - fixture.state.isQuitting = true - fixture.app.emit('browser-window-created', {}, new FakeWindow(false)) - await new Promise((resolve) => setImmediate(resolve)) - await new Promise((resolve) => setImmediate(resolve)) - vi.restoreAllMocks() - vi.clearAllMocks() -}) - -it('attaches the alert to the visible main window and explains an unconfirmed write', async () => { - const window = new FakeWindow(true) - fixture.state.mainWindow = window - reportProfileStateWriteFailure(workerExit) - await vi.waitFor(() => expect(fixture.show).toHaveBeenCalledOnce()) - expect(fixture.show).toHaveBeenCalledWith(window, { - type: 'error', - title: 'Saving stopped', - message: 'Orca has stopped saving this profile.', - detail: - 'Orca could not confirm whether your most recent change was saved. New changes will not be saved until you restart Orca.', - buttons: ['OK'] - }) - expect(recordProfileStateWriteFailureReport).toHaveBeenCalledWith(workerExit, 'dialog') -}) - -it('waits for a hidden window to be shown by the user instead of revealing it', async () => { - const window = new FakeWindow(false) - fixture.state.mainWindow = window - reportProfileStateWriteFailure(workerExit) - await new Promise((resolve) => setImmediate(resolve)) - expect(fixture.show).not.toHaveBeenCalled() - expect(window.reveal).not.toHaveBeenCalled() - expect(recordProfileStateWriteFailureReport).toHaveBeenCalledWith(workerExit, 'deferred') - window.visible = true - window.emit('show') - await vi.waitFor(() => - expect(fixture.show).toHaveBeenCalledExactlyOnceWith(window, expect.anything()) - ) -}) - -it('never falls back to a parentless alert when no main window exists', async () => { - reportProfileStateWriteFailure(workerExit) - await new Promise((resolve) => setImmediate(resolve)) - expect(fixture.show).not.toHaveBeenCalled() - const window = new FakeWindow(true) - fixture.app.emit('browser-window-created', {}, window) - fixture.state.mainWindow = window - await vi.waitFor(() => - expect(fixture.show).toHaveBeenCalledExactlyOnceWith(window, expect.anything()) - ) - for (const call of fixture.show.mock.calls) { - expect(call).toHaveLength(2) - } -}) - -it('waits for a replacement after the main window is destroyed', async () => { - const destroyed = new FakeWindow(true) - destroyed.destroyed = true - fixture.state.mainWindow = destroyed - reportProfileStateWriteFailure(workerExit) - await new Promise((resolve) => setImmediate(resolve)) - expect(fixture.show).not.toHaveBeenCalled() - const replacement = new FakeWindow(true) - fixture.state.mainWindow = replacement - fixture.app.emit('browser-window-created', {}, replacement) - await vi.waitFor(() => - expect(fixture.show).toHaveBeenCalledExactlyOnceWith(replacement, expect.anything()) - ) -}) - -it('shows one alert for concurrent failures', async () => { - fixture.state.mainWindow = new FakeWindow(true) - let close!: () => void - fixture.show.mockReturnValue(new Promise((resolve) => (close = () => resolve({ response: 0 })))) - reportProfileStateWriteFailure(workerExit) - reportProfileStateWriteFailure(conflict) - await vi.waitFor(() => expect(fixture.show).toHaveBeenCalledOnce()) - expect(recordProfileStateWriteFailureReport).toHaveBeenCalledWith(conflict, 'duplicate') - close() -}) - -it.each(['background', 'serve'])('keeps %s runs free of native dialogs', async (mode) => { - fixture.background = mode === 'background' - fixture.state.isServeMode = mode === 'serve' - fixture.state.mainWindow = new FakeWindow(true) - reportProfileStateWriteFailure(workerExit) - await new Promise((resolve) => setImmediate(resolve)) - expect(fixture.show).not.toHaveBeenCalled() - expect(console.error).toHaveBeenCalledWith( - expect.stringContaining('stopped saving'), - expect.any(Error) - ) - expect(recordProfileStateWriteFailureReport).toHaveBeenCalledWith(workerExit, 'suppressed') -}) - -it('handles a failed dialog without an unhandled rejection', async () => { - fixture.state.mainWindow = new FakeWindow(true) - fixture.show.mockRejectedValue(new Error('window system unavailable')) - reportProfileStateWriteFailure(workerExit) - await vi.waitFor(() => expect(console.warn).toHaveBeenCalled()) -}) diff --git a/src/main/startup/first-window-startup-services.test.ts b/src/main/startup/pty-startup/first-window-startup-services.test.ts similarity index 100% rename from src/main/startup/first-window-startup-services.test.ts rename to src/main/startup/pty-startup/first-window-startup-services.test.ts diff --git a/src/main/startup/first-window-startup-services.ts b/src/main/startup/pty-startup/first-window-startup-services.ts similarity index 100% rename from src/main/startup/first-window-startup-services.ts rename to src/main/startup/pty-startup/first-window-startup-services.ts diff --git a/src/main/startup/pty-startup/legacy-worker-renderer-recovery.test.ts b/src/main/startup/pty-startup/legacy-worker-renderer-recovery.test.ts new file mode 100644 index 00000000000..4a8b4c899df --- /dev/null +++ b/src/main/startup/pty-startup/legacy-worker-renderer-recovery.test.ts @@ -0,0 +1,44 @@ +import { describe, expect, it, vi } from 'vitest' +import { recoverLegacyWorkerTerminalsForRendererStartup } from './legacy-worker-renderer-recovery' + +describe('legacy worker renderer recovery', () => { + it('contains provider startup rejection after initial recovery', async () => { + const providerError = new Error('provider failed') + const reconcile = vi.fn().mockResolvedValue(undefined) + let reportError!: (error: unknown) => void + const reportedError = new Promise((resolve) => { + reportError = resolve + }) + + await recoverLegacyWorkerTerminalsForRendererStartup({ + firstWindowStartupServicesReady: Promise.resolve(), + managedWslCliStartupBarrierReady: Promise.resolve(), + localPtyProviderStartupReady: Promise.reject(providerError), + reconcile, + onDeferredRecoveryError: reportError + }) + + await expect(reportedError).resolves.toBe(providerError) + expect(reconcile).not.toHaveBeenCalled() + }) + + it('contains recovery rejection', async () => { + const recoveryError = new Error('recovery failed') + const reconcile = vi.fn().mockRejectedValueOnce(recoveryError) + let reportError!: (error: unknown) => void + const reportedError = new Promise((resolve) => { + reportError = resolve + }) + + await recoverLegacyWorkerTerminalsForRendererStartup({ + firstWindowStartupServicesReady: Promise.resolve(), + managedWslCliStartupBarrierReady: Promise.resolve(), + localPtyProviderStartupReady: Promise.resolve(), + reconcile, + onDeferredRecoveryError: reportError + }) + + await expect(reportedError).resolves.toBe(recoveryError) + expect(reconcile).toHaveBeenCalledOnce() + }) +}) diff --git a/src/main/startup/legacy-worker-renderer-recovery.ts b/src/main/startup/pty-startup/legacy-worker-renderer-recovery.ts similarity index 100% rename from src/main/startup/legacy-worker-renderer-recovery.ts rename to src/main/startup/pty-startup/legacy-worker-renderer-recovery.ts diff --git a/src/main/startup/main-process-pty-startup.ts b/src/main/startup/pty-startup/main-process-pty-startup.ts similarity index 78% rename from src/main/startup/main-process-pty-startup.ts rename to src/main/startup/pty-startup/main-process-pty-startup.ts index f914308f0c1..0309796d2bf 100644 --- a/src/main/startup/main-process-pty-startup.ts +++ b/src/main/startup/pty-startup/main-process-pty-startup.ts @@ -1,48 +1,48 @@ import { app } from 'electron' -import { parseWorkspaceKey } from '../../shared/workspace-scope' -import { isLocalExecutionHost } from '../../shared/execution-host' -import { classifyError } from '../telemetry/classify-error' -import { track } from '../telemetry/client' -import { getPtyIdForPaneKey } from '../ipc/pty/pane/key-state' +import { parseWorkspaceKey } from '../../../shared/workspace-scope' +import { isLocalExecutionHost } from '../../../shared/execution-host' +import { classifyError } from '../../telemetry/classify-error' +import { track } from '../../telemetry/client' +import { getPtyIdForPaneKey } from '../../ipc/pty/pane/key-state' import { getDaemonProvider, listLiveDaemonPtyIds -} from '../daemon/providers/lifecycle/daemon-provider-state' -import { initDaemonPtyProvider } from '../daemon/providers/lifecycle/daemon-provider-init' -import { restartLocalTerminalsAfterElevation } from '../windows/windows-administrator-restart' -import { resolveTerminalSpawnAdmissionMode } from '../daemon/admission/terminal-spawn-admission-mode' +} from '../../daemon/providers/lifecycle/daemon-provider-state' +import { initDaemonPtyProvider } from '../../daemon/providers/lifecycle/daemon-provider-init' +import { restartLocalTerminalsAfterElevation } from '../../windows/windows-administrator-restart' +import { resolveTerminalSpawnAdmissionMode } from '../../daemon/admission/terminal-spawn-admission-mode' import { getCodexPaneAccount, hasAnyRecordedLegacyWslCodexPane, hasRecordedManagedHostCodexPane, isCodexPaneHomeRouteProvenAwayFromSharedHome, reconcileCodexPaneAccountsWithLivePtys -} from '../codex/configuration/homes/codex-pane-account-registry' -import type { CodexPaneHomeRoute } from '../codex/configuration/homes/codex-pane-account-registry-types' -import { reconcileRetainedCodexHookHomes } from '../codex/hooks/installation/retained-codex-hook-state' -import { codexHookService } from '../codex/hooks/installation/hook-service' +} from '../../codex/configuration/homes/codex-pane-account-registry' +import type { CodexPaneHomeRoute } from '../../codex/configuration/homes/codex-pane-account-registry-types' +import { reconcileRetainedCodexHookHomes } from '../../codex/hooks/installation/retained-codex-hook-state' +import { codexHookService } from '../../codex/hooks/installation/hook-service' import { isAgentStatusHooksEnabled, isAgentStatusHooksEnabledForAgent -} from '../../shared/agent-hook-listener/configuration/agent-status-hooks-setting' -import { agentHookServer } from '../agent-hooks/server/agent-hook-server' -import { createLocalTmuxManagedPtyResolver } from '../agent-hooks/observations/local-tmux-managed-pty' -import { installLocalHookRootEvidence } from '../agent-hooks/observations/local-hook-root-evidence' +} from '../../../shared/agent-hook-listener/configuration/agent-status-hooks-setting' +import { agentHookServer } from '../../agent-hooks/server/agent-hook-server' +import { createLocalTmuxManagedPtyResolver } from '../../agent-hooks/observations/local-tmux-managed-pty' +import { installLocalHookRootEvidence } from '../../agent-hooks/observations/local-hook-root-evidence' import { indexPersistedPaneKeyPtyIds, resolveAgentWorkspaceExecutionHostId, retireRestoredStatusesWithDeadTerminals -} from '../agent-hooks/observations/restored-status-dead-terminal-sweep' +} from '../../agent-hooks/observations/restored-status-dead-terminal-sweep' import { startFirstWindowStartupServices } from './first-window-startup-services' -import { logStartupMilestone } from './startup-diagnostics' -import type { WindowsDesktopStartupServices } from './windows-desktop-shell-path-startup' -import type { RuntimeWorktreeLifecycleEvent } from '../runtime/workspaces/lifecycle/worktree-lifecycle-event' -import { mainProcessState as state } from './main-process-state' -import { shortPluginBranchName } from '../../shared/plugins/events/plugin-events' -import { notifyWorkspaceCreatedPluginHook } from '../plugins/hooks/workspace-create-plugin-hook' +import { logStartupMilestone } from '../diagnostics/startup-diagnostics' +import type { WindowsDesktopStartupServices } from '../shell-environment/windows-desktop-shell-path-startup' +import type { RuntimeWorktreeLifecycleEvent } from '../../runtime/workspaces/lifecycle/worktree-lifecycle-event' +import { mainProcessState as state } from '../main-process-state' +import { shortPluginBranchName } from '../../../shared/plugins/events/plugin-events' +import { notifyWorkspaceCreatedPluginHook } from '../../plugins/hooks/workspace-create-plugin-hook' +import { pluginListedWorkspaceId } from '../../plugins/workers/host-api/plugin-workspace-projection' export function emitPluginWorktreeLifecycle(event: RuntimeWorktreeLifecycleEvent): void { - const identity = { workspaceId: event.worktreeId, kind: 'worktree', path: event.path } const folder = parseWorkspaceKey(event.worktreeId)?.type === 'folder' if (event.kind === 'created') { notifyWorkspaceCreatedPluginHook({ ...event, folder }) @@ -51,6 +51,16 @@ export function emitPluginWorktreeLifecycle(event: RuntimeWorktreeLifecycleEvent if (folder) { return } + const workspaceListId = pluginListedWorkspaceId({ + id: event.worktreeId, + identityKey: event.identityKey + }) + const identity = { + workspaceId: event.worktreeId, + ...(workspaceListId ? { workspaceListId } : {}), + kind: 'worktree', + path: event.path + } state.pluginService?.emitEvent( event.kind === 'created' ? 'workspace.created' : 'workspace.removed', event.kind === 'created' diff --git a/src/main/startup/quit/app-relaunch.test.ts b/src/main/startup/quit/app-relaunch.test.ts index 3299a686550..03c8687100d 100644 --- a/src/main/startup/quit/app-relaunch.test.ts +++ b/src/main/startup/quit/app-relaunch.test.ts @@ -21,7 +21,7 @@ vi.mock('../../crash-reporting/breadcrumbs/durable-crash-breadcrumb', () => ({ import { relaunchApp } from './app-relaunch' import { restartLocalTerminalsAfterElevation } from '../../windows/windows-administrator-restart' -import { _resetHydrateShellPathCache, _setLaunchPathForTests } from '../hydrate-shell-path' +import { _resetHydrateShellPathCache } from '../shell-environment/hydrate-shell-path' beforeEach(() => { appRelaunchMock.mockReset() @@ -67,18 +67,4 @@ describe('relaunchApp', () => { relaunchApp('windows-administrator', undefined, custom) expect(appRelaunchMock).toHaveBeenLastCalledWith(custom) }) - - it('does not carry Orca PATH seeds into the replacement process', () => { - process.env.PATH = '/seeded/newest-nvm/bin:/usr/bin' - _setLaunchPathForTests('/usr/bin') - let inheritedPath: string | undefined - appRelaunchMock.mockImplementation(() => { - inheritedPath = process.env.PATH - }) - - relaunchApp('renderer-request') - - expect(inheritedPath).toBe('/usr/bin') - expect(process.env.PATH).toBe('/seeded/newest-nvm/bin:/usr/bin') - }) }) diff --git a/src/main/startup/quit/app-relaunch.ts b/src/main/startup/quit/app-relaunch.ts index 36a56856e6f..3059783d668 100644 --- a/src/main/startup/quit/app-relaunch.ts +++ b/src/main/startup/quit/app-relaunch.ts @@ -1,7 +1,7 @@ import { app } from 'electron' import type { CrashReportBreadcrumbData } from '../../../shared/crash-reporting' import { recordDurableCrashBreadcrumb } from '../../crash-reporting/breadcrumbs/durable-crash-breadcrumb' -import { runWithLaunchPath } from '../hydrate-shell-path' +import { runWithLaunchPath } from '../shell-environment/hydrate-shell-path' import { getWindowsAdministratorRelaunchOptions } from '../../windows/windows-administrator-restart' export type AppRelaunchReason = diff --git a/src/main/startup/quit/main-process-quit-pending-writer.test.ts b/src/main/startup/quit/main-process-quit-pending-writer.test.ts new file mode 100644 index 00000000000..4a565b9e709 --- /dev/null +++ b/src/main/startup/quit/main-process-quit-pending-writer.test.ts @@ -0,0 +1,145 @@ +import { EventEmitter } from 'node:events' +import { afterEach, expect, it, vi } from 'vitest' +import { WILL_QUIT_TEARDOWN_DEADLINE_MS } from '../../../shared/quit-teardown-deadline' + +const settled = () => vi.fn(async () => {}) +const idle = () => vi.fn() +const stopAgentHookServer = idle() +const stopStructuredAgentSessionRuntime = settled() +const beginSshShutdown = settled() +const killAllPty = idle() + +// Every teardown member settles except the profile store, so only the writer can hold quit. +const dependencies: Record> = { + '../../ipc/filesystem/watchers/filesystem-watcher-shutdown': { closeAllWatchers: settled() }, + '../../ipc/worktrees/creation/worktree-base-directory-watcher': { + disposeWorktreeBaseDirectoryWatchers: settled() + }, + '../../ipc/folder-repo-git-upgrade': { stopFolderRepoGitUpgradeWatch: idle() }, + '../../ipc/pty/kill-all': { killAllPty }, + '../../daemon/providers/lifecycle/daemon-provider-state': { + disconnectDaemon: settled(), + shutdownDaemon: settled() + }, + '../../ipc/ssh/ssh-shutdown-drain': { beginSshShutdown }, + '../cloud-startup/main-process-connector-startup': { desktopConnectorCloud: () => null }, + '../../agent-hooks/server/agent-hook-server': { agentHookServer: { stop: stopAgentHookServer } }, + '../../agent-hooks/wsl-relay/wsl-hook-relay-manager': { + wslHookRelayManager: { disposeAll: idle() } + }, + '../../agent-hooks/installation/managed-agent-hook-controls': { + removeManagedAgentHooksAsync: vi.fn(async () => []) + }, + '../../runtime/agent-session/structured-agent-session-runtime': { + stopStructuredAgentSessionRuntime + }, + '../../runtime/agent-session/structured-agent-session-runtime-teardown': { + setStructuredAgentSessionTeardownTrigger: idle() + }, + '../../runtime/files/watch/file-watcher-leases': { + awaitRuntimeFileWatcherUnsubscribes: settled() + }, + '../../runtime/rpc/server/runtime-metadata': { clearRuntimeMetadataIfOwned: idle() }, + '../../browser/client-hosts/lifecycle/paired-runtime-browser-client-host-runtime': { + shutdownPairedRuntimeBrowserClientHosts: settled() + }, + '../../ipc/browser/desktop-browser-bridge-wiring': { disposeDesktopBrowserBridge: idle() }, + '../../orca-profiles/cloud-session/profile-cloud-session-owner': { + flushUnsavedCloudSessions: idle() + }, + '../../browser/guest-lifecycle/manager/browser-manager': { + browserManager: { setBrowserGuestStateChangedListener: idle(), setOffscreenTabOpener: idle() } + }, + '../../browser/sessions/profiles/browser-session-registry': { browserSessionRegistry: {} }, + '../../browser/routing/local-host-partitions/local-ssh-browser-route': { + closeAllLocalSshBrowserRoutes: settled() + }, + '../../codex/history/index/codex-state-db-backfill-recovery': { + stopCodexStateDbBackfillRecoveries: settled() + }, + '../../codex/history/bridges/codex-account-session-bridge': { + stopCodexAccountSessionBridges: idle() + }, + '../../git/refs/maintenance/local-repo-ref-maintenance': { + awaitPackedRefsLockRelease: settled() + }, + '../../workspaces/removal/worktree-background-removal': { + stopBackgroundWorktreeRemovals: idle() + }, + '../../dock/unread-badge': { setUnreadDockBadgeCount: idle() }, + '../../tray/system-tray': { destroySystemTray: idle() }, + '../../telemetry/client': { shutdownTelemetry: settled() }, + '../../observability/index': { shutdownObservability: settled() }, + '../../updater/updater-service': { isQuittingForUpdate: vi.fn(() => false) }, + '../../updater/updater-lifecycle-diagnostics': { recordUpdaterLifecycle: idle() }, + '../../macos-permissions/macos-tcc-prompt-notice': { stopTccPromptNotice: idle() }, + '../../pty/history/terminal-history-gc': { cancelHistoryGc: idle() }, + './window-all-closed-quit-policy': { shouldQuitWhenAllWindowsClosed: vi.fn(() => false) }, + '../configure-process': { isDevParentShutdownRequested: vi.fn(() => false) }, + '../../persistence/loading-store/user-data-path': { + getCanonicalUserDataPath: vi.fn(() => '/unused') + } +} + +afterEach(() => { + vi.doUnmock('electron') + vi.doUnmock('../main-process-state') + for (const moduleName of Object.keys(dependencies)) { + vi.doUnmock(moduleName) + } + vi.restoreAllMocks() + vi.useRealTimers() + vi.resetModules() +}) + +async function startQuit( + flushFinalOrThrowAsync: () => Promise, + services: Record = {} +) { + beginSshShutdown.mockClear() + killAllPty.mockClear() + vi.resetModules() + vi.useFakeTimers() + const app = Object.assign(new EventEmitter(), { quit: vi.fn() }) + const admission = { release: vi.fn() } + const store = { + flushFinalOrThrowAsync: vi.fn(flushFinalOrThrowAsync), + freezeWritesAsync: settled() + } + const profileStateAdmission: typeof admission | undefined = admission + const state = { + isQuitting: false, + watcherShutdownDone: true, + store, + profileStateAdmission, + ...services + } + vi.doMock('electron', () => ({ app })) + vi.doMock('../main-process-state', () => ({ mainProcessState: state })) + for (const [moduleName, exports] of Object.entries(dependencies)) { + vi.doMock(moduleName, () => exports) + } + vi.spyOn(console, 'warn').mockImplementation(() => {}) + const { installMainProcessQuitHandlers } = await import('./main-process-quit') + const { quitTeardownStartGate } = await import('./quit-teardown-start-gate') + quitTeardownStartGate.resetForTests() + installMainProcessQuitHandlers() + app.emit('before-quit', { defaultPrevented: false }) + app.emit('will-quit', { preventDefault: vi.fn() }) + return { app, admission, store, state } +} + +it('quits at the teardown deadline without releasing admission while the writer is pending', async () => { + const { app, admission, store, state } = await startQuit(() => new Promise(() => {})) + await vi.advanceTimersByTimeAsync(WILL_QUIT_TEARDOWN_DEADLINE_MS - 1) + expect(app.quit).not.toHaveBeenCalled() + await vi.advanceTimersByTimeAsync(1) + expect(app.quit).toHaveBeenCalledOnce() + expect(console.warn).toHaveBeenCalledWith('[shutdown] Quit teardown deadline reached', { + pendingTeardowns: ['state'] + }) + expect(store.flushFinalOrThrowAsync).toHaveBeenCalledOnce() + expect(store.freezeWritesAsync).not.toHaveBeenCalled() + expect(admission.release).not.toHaveBeenCalled() + expect(state.profileStateAdmission).toBe(admission) +}) diff --git a/src/main/startup/quit/main-process-quit-update-veto.test.ts b/src/main/startup/quit/main-process-quit-update-veto.test.ts new file mode 100644 index 00000000000..053177162a0 --- /dev/null +++ b/src/main/startup/quit/main-process-quit-update-veto.test.ts @@ -0,0 +1,118 @@ +import { EventEmitter } from 'node:events' +import { afterEach, expect, it, vi } from 'vitest' + +const dependencyExports: [string, string[]][] = [ + ['../../ipc/filesystem/watchers/filesystem-watcher-shutdown', ['closeAllWatchers']], + [ + '../../ipc/worktrees/creation/worktree-base-directory-watcher', + ['disposeWorktreeBaseDirectoryWatchers'] + ], + ['../../ipc/folder-repo-git-upgrade', ['stopFolderRepoGitUpgradeWatch']], + ['../../ipc/pty/kill-all', ['killAllPty']], + [ + '../../daemon/providers/lifecycle/daemon-provider-state', + ['disconnectDaemon', 'shutdownDaemon'] + ], + ['../../ipc/ssh/ssh-shutdown-drain', ['beginSshShutdown']], + ['../../agent-hooks/server/agent-hook-server', ['agentHookServer']], + ['../../agent-hooks/wsl-relay/wsl-hook-relay-manager', ['wslHookRelayManager']], + ['../../agent-hooks/installation/managed-agent-hook-controls', ['removeManagedAgentHooksAsync']], + [ + '../../runtime/agent-session/structured-agent-session-runtime', + ['stopStructuredAgentSessionRuntime'] + ], + [ + '../../runtime/agent-session/structured-agent-session-runtime-teardown', + ['setStructuredAgentSessionTeardownTrigger'] + ], + ['../../runtime/files/watch/file-watcher-leases', ['awaitRuntimeFileWatcherUnsubscribes']], + ['../../runtime/rpc/server/runtime-metadata', ['clearRuntimeMetadataIfOwned']], + [ + '../../browser/client-hosts/lifecycle/paired-runtime-browser-client-host-runtime', + ['shutdownPairedRuntimeBrowserClientHosts'] + ], + ['../../ipc/browser/desktop-browser-bridge-wiring', ['disposeDesktopBrowserBridge']], + ['../../orca-profiles/cloud-session/profile-cloud-session-owner', ['flushUnsavedCloudSessions']], + ['../../browser/guest-lifecycle/manager/browser-manager', ['browserManager']], + ['../../browser/sessions/profiles/browser-session-registry', ['browserSessionRegistry']], + [ + '../../codex/history/index/codex-state-db-backfill-recovery', + ['stopCodexStateDbBackfillRecoveries'] + ], + ['../../codex/history/bridges/codex-account-session-bridge', ['stopCodexAccountSessionBridges']], + ['../../git/refs/maintenance/local-repo-ref-maintenance', ['awaitPackedRefsLockRelease']], + ['../../workspaces/removal/worktree-background-removal', ['stopBackgroundWorktreeRemovals']], + ['./quit-teardown-deadline', ['settleTeardownWithinDeadline', 'settleWithinMs']], + ['./quit-teardown-start-gate', ['quitTeardownStartGate']], + ['../../dock/unread-badge', ['setUnreadDockBadgeCount']], + ['../../tray/system-tray', ['destroySystemTray']], + ['../../telemetry/client', ['shutdownTelemetry']], + ['../../observability/index', ['shutdownObservability']], + ['../../updater/updater-service', ['isQuittingForUpdate']], + ['../../updater/updater-lifecycle-diagnostics', ['recordUpdaterLifecycle']], + ['../../macos-permissions/macos-tcc-prompt-notice', ['stopTccPromptNotice']], + ['../../pty/history/terminal-history-gc', ['cancelHistoryGc']], + ['./window-all-closed-quit-policy', ['shouldQuitWhenAllWindowsClosed']], + ['../configure-process', ['isDevParentShutdownRequested']], + ['../../persistence/loading-store/user-data-path', ['getCanonicalUserDataPath']] +] + +it('keeps startup services live when the updater has vetoed before-quit', async () => { + vi.resetModules() + const app = new EventEmitter() + const fenceAndCloseNow = vi.fn() + const setMobileRelayPairingProvider = vi.fn() + const unsubscribeAgentAwakeStatusChanges = vi.fn() + const dispose = vi.fn() + const stop = vi.fn() + const state = { + isQuitting: false, + desktopRelayService: { fenceAndCloseNow }, + runtimeRpc: { setMobileRelayPairingProvider }, + unsubscribeAgentAwakeStatusChanges, + agentAwakeService: { dispose }, + rateLimits: { stop } + } + vi.doMock('electron', () => ({ app })) + vi.doMock('../main-process-state', () => ({ mainProcessState: state })) + for (const [moduleName, exports] of dependencyExports) { + vi.doMock(moduleName, () => Object.fromEntries(exports.map((name) => [name, vi.fn()]))) + } + const exitListenersBefore = process.listeners('exit') + const { installMainProcessQuitHandlers } = await import('./main-process-quit') + installMainProcessQuitHandlers() + + app.emit('before-quit', { defaultPrevented: true }) + + expect(state.isQuitting).toBe(false) + expect(fenceAndCloseNow).not.toHaveBeenCalled() + expect(setMobileRelayPairingProvider).not.toHaveBeenCalled() + expect(unsubscribeAgentAwakeStatusChanges).not.toHaveBeenCalled() + expect(dispose).not.toHaveBeenCalled() + expect(stop).not.toHaveBeenCalled() + expect(state.agentAwakeService).toEqual({ dispose }) + expect(state.unsubscribeAgentAwakeStatusChanges).toBe(unsubscribeAgentAwakeStatusChanges) + + app.emit('before-quit', { defaultPrevented: false }) + + expect(state.isQuitting).toBe(true) + expect(fenceAndCloseNow).toHaveBeenCalledOnce() + expect(setMobileRelayPairingProvider).toHaveBeenCalledWith(null) + expect(unsubscribeAgentAwakeStatusChanges).toHaveBeenCalledOnce() + expect(dispose).toHaveBeenCalledOnce() + expect(stop).toHaveBeenCalledOnce() + for (const listener of process.listeners('exit')) { + if (!exitListenersBefore.includes(listener)) { + process.removeListener('exit', listener) + } + } +}) + +afterEach(() => { + vi.doUnmock('electron') + vi.doUnmock('../main-process-state') + for (const [moduleName] of dependencyExports) { + vi.doUnmock(moduleName) + } + vi.resetModules() +}) diff --git a/src/main/startup/main-process-quit.ts b/src/main/startup/quit/main-process-quit.ts similarity index 80% rename from src/main/startup/main-process-quit.ts rename to src/main/startup/quit/main-process-quit.ts index 0aec0ea1f8e..0bfe1a50e84 100644 --- a/src/main/startup/main-process-quit.ts +++ b/src/main/startup/quit/main-process-quit.ts @@ -1,45 +1,45 @@ -import { killWslChannelsInCloseGrace } from '../wsl/execution/wsl-command-channel' -import { markHostShuttingDown } from './quit/host-shutdown-state' +import { killWslChannelsInCloseGrace } from '../../wsl/execution/wsl-command-channel' +import { markHostShuttingDown } from './host-shutdown-state' import { app, type Event } from 'electron' -import { closeAllWatchers } from '../ipc/filesystem/watchers/filesystem-watcher-shutdown' -import { disposeWorktreeBaseDirectoryWatchers } from '../ipc/worktrees/creation/worktree-base-directory-watcher' -import { stopFolderRepoGitUpgradeWatch } from '../ipc/folder-repo-git-upgrade' -import { killAllPty } from '../ipc/pty/kill-all' +import { closeAllWatchers } from '../../ipc/filesystem/watchers/filesystem-watcher-shutdown' +import { disposeWorktreeBaseDirectoryWatchers } from '../../ipc/worktrees/creation/worktree-base-directory-watcher' +import { stopFolderRepoGitUpgradeWatch } from '../../ipc/folder-repo-git-upgrade' +import { killAllPty } from '../../ipc/pty/kill-all' import { disconnectDaemon, shutdownDaemon -} from '../daemon/providers/lifecycle/daemon-provider-state' -import { beginSshShutdown } from '../ipc/ssh/ssh-shutdown-drain' -import { agentHookServer } from '../agent-hooks/server/agent-hook-server' -import { wslHookRelayManager } from '../agent-hooks/wsl-relay/wsl-hook-relay-manager' -import { removeManagedAgentHooksAsync } from '../agent-hooks/installation/managed-agent-hook-controls' -import { stopStructuredAgentSessionRuntime } from '../runtime/agent-session/structured-agent-session-runtime' -import { setStructuredAgentSessionTeardownTrigger } from '../runtime/agent-session/structured-agent-session-runtime-teardown' -import { awaitRuntimeFileWatcherUnsubscribes } from '../runtime/files/watch/file-watcher-leases' -import { clearRuntimeMetadataIfOwned } from '../runtime/rpc/server/runtime-metadata' -import { shutdownPairedRuntimeBrowserClientHosts } from '../browser/client-hosts/lifecycle/paired-runtime-browser-client-host-runtime' -import { disposeDesktopBrowserBridge } from '../ipc/browser/desktop-browser-bridge-wiring' -import { browserManager } from '../browser/guest-lifecycle/manager/browser-manager' -import { stopCodexStateDbBackfillRecoveries } from '../codex/history/index/codex-state-db-backfill-recovery' -import { stopCodexAccountSessionBridges } from '../codex/history/bridges/codex-account-session-bridge' -import { awaitPackedRefsLockRelease } from '../git/refs/maintenance/local-repo-ref-maintenance' -import { stopBackgroundWorktreeRemovals } from '../workspaces/removal/worktree-background-removal' -import { settleTeardownWithinDeadline, settleWithinMs } from './quit/quit-teardown-deadline' -import { quitTeardownStartGate } from './quit/quit-teardown-start-gate' -import { setUnreadDockBadgeCount } from '../dock/unread-badge' -import { destroySystemTray } from '../tray/system-tray' -import { shutdownTelemetry } from '../telemetry/client' -import { shutdownObservability } from '../observability/index' -import { isQuittingForUpdate } from '../updater/updater-service' -import { recordUpdaterLifecycle } from '../updater/updater-lifecycle-diagnostics' -import { stopTccPromptNotice } from '../macos-permissions/macos-tcc-prompt-notice' -import { cancelHistoryGc } from '../pty/history/terminal-history-gc' +} from '../../daemon/providers/lifecycle/daemon-provider-state' +import { beginSshShutdown } from '../../ipc/ssh/ssh-shutdown-drain' +import { agentHookServer } from '../../agent-hooks/server/agent-hook-server' +import { wslHookRelayManager } from '../../agent-hooks/wsl-relay/wsl-hook-relay-manager' +import { removeManagedAgentHooksAsync } from '../../agent-hooks/installation/managed-agent-hook-controls' +import { stopStructuredAgentSessionRuntime } from '../../runtime/agent-session/structured-agent-session-runtime' +import { setStructuredAgentSessionTeardownTrigger } from '../../runtime/agent-session/structured-agent-session-runtime-teardown' +import { awaitRuntimeFileWatcherUnsubscribes } from '../../runtime/files/watch/file-watcher-leases' +import { clearRuntimeMetadataIfOwned } from '../../runtime/rpc/server/runtime-metadata' +import { shutdownPairedRuntimeBrowserClientHosts } from '../../browser/client-hosts/lifecycle/paired-runtime-browser-client-host-runtime' +import { disposeDesktopBrowserBridge } from '../../ipc/browser/desktop-browser-bridge-wiring' +import { browserManager } from '../../browser/guest-lifecycle/manager/browser-manager' +import { stopCodexStateDbBackfillRecoveries } from '../../codex/history/index/codex-state-db-backfill-recovery' +import { stopCodexAccountSessionBridges } from '../../codex/history/bridges/codex-account-session-bridge' +import { awaitPackedRefsLockRelease } from '../../git/refs/maintenance/local-repo-ref-maintenance' +import { stopBackgroundWorktreeRemovals } from '../../workspaces/removal/worktree-background-removal' +import { settleTeardownWithinDeadline, settleWithinMs } from './quit-teardown-deadline' +import { quitTeardownStartGate } from './quit-teardown-start-gate' +import { setUnreadDockBadgeCount } from '../../dock/unread-badge' +import { destroySystemTray } from '../../tray/system-tray' +import { shutdownTelemetry } from '../../telemetry/client' +import { shutdownObservability } from '../../observability/index' +import { isQuittingForUpdate } from '../../updater/updater-service' +import { recordUpdaterLifecycle } from '../../updater/updater-lifecycle-diagnostics' +import { stopTccPromptNotice } from '../../macos-permissions/macos-tcc-prompt-notice' +import { cancelHistoryGc } from '../../pty/history/terminal-history-gc' import { shouldQuitWhenAllWindowsClosed } from './window-all-closed-quit-policy' -import { desktopConnectorCloud } from './main-process-connector-startup' -import { mainProcessState as state } from './main-process-state' -import { isDevParentShutdownRequested } from './configure-process' -import { getCanonicalUserDataPath } from '../persistence/loading-store/user-data-path' -import { flushUnsavedCloudSessions } from '../orca-profiles/cloud-session/profile-cloud-session-owner' +import { desktopConnectorCloud } from '../cloud-startup/main-process-connector-startup' +import { mainProcessState as state } from '../main-process-state' +import { isDevParentShutdownRequested } from '../configure-process' +import { getCanonicalUserDataPath } from '../../persistence/loading-store/user-data-path' +import { flushUnsavedCloudSessions } from '../../orca-profiles/cloud-session/profile-cloud-session-owner' // First will-quit pass awaits teardown; the re-fired pass must exit without starting writes again. let daemonDisconnectDone = false @@ -200,7 +200,7 @@ function installWillQuitHandler(): void { })() // Local SSH browser routes own loopback listeners and ssh -N -D children that must not outlive the app (P2-4). const localSshRouteShutdown = - import('../browser/routing/local-host-partitions/local-ssh-browser-route') + import('../../browser/routing/local-host-partitions/local-ssh-browser-route') .then((routes) => routes.closeAllLocalSshBrowserRoutes()) .catch(() => {}) browserManager.setBrowserGuestStateChangedListener(null) diff --git a/src/main/startup/process-quit-request.ts b/src/main/startup/quit/process-quit-request.ts similarity index 100% rename from src/main/startup/process-quit-request.ts rename to src/main/startup/quit/process-quit-request.ts diff --git a/src/main/startup/quit-and-stop-all-sessions-prompt.ts b/src/main/startup/quit/quit-and-stop-all-sessions-prompt.ts similarity index 97% rename from src/main/startup/quit-and-stop-all-sessions-prompt.ts rename to src/main/startup/quit/quit-and-stop-all-sessions-prompt.ts index 388be0b580a..0805e2c6675 100644 --- a/src/main/startup/quit-and-stop-all-sessions-prompt.ts +++ b/src/main/startup/quit/quit-and-stop-all-sessions-prompt.ts @@ -1,5 +1,5 @@ import type { MessageBoxOptions, MessageBoxReturnValue } from 'electron' -import { translateMain } from '../i18n/main-i18n' +import { translateMain } from '../../i18n/main-i18n' const CONFIRM_BUTTON_INDEX = 0 const CANCEL_BUTTON_INDEX = 1 diff --git a/src/main/startup/window-all-closed-quit-policy.ts b/src/main/startup/quit/window-all-closed-quit-policy.ts similarity index 100% rename from src/main/startup/window-all-closed-quit-policy.ts rename to src/main/startup/quit/window-all-closed-quit-policy.ts diff --git a/src/main/startup/main-process-automations.ts b/src/main/startup/runtime-startup/main-process-automations.ts similarity index 74% rename from src/main/startup/main-process-automations.ts rename to src/main/startup/runtime-startup/main-process-automations.ts index e17222404c2..08824bb5833 100644 --- a/src/main/startup/main-process-automations.ts +++ b/src/main/startup/runtime-startup/main-process-automations.ts @@ -1,6 +1,6 @@ -import type { AutomationService } from '../automations/service' -import { createRuntimeAutomationService } from '../automations/runtime-automation-service' -import { mainProcessState as state } from './main-process-state' +import type { AutomationService } from '../../automations/service' +import { createRuntimeAutomationService } from '../../automations/runtime-automation-service' +import { mainProcessState as state } from '../main-process-state' export function initializeMainProcessAutomations(): AutomationService { const store = state.store diff --git a/src/main/startup/main-process-runtime-launch.ts b/src/main/startup/runtime-startup/main-process-runtime-launch.ts similarity index 77% rename from src/main/startup/main-process-runtime-launch.ts rename to src/main/startup/runtime-startup/main-process-runtime-launch.ts index d6443259642..d1894ac7e42 100644 --- a/src/main/startup/main-process-runtime-launch.ts +++ b/src/main/startup/runtime-startup/main-process-runtime-launch.ts @@ -1,59 +1,60 @@ import { app, type BrowserWindow } from 'electron' -import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../shared/layout-owner-switch' -import { placeUnshownLiveTerminalsBestEffort } from '../runtime/terminal/adoption/unshown-live-terminal-placement' +import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../shared/layout-owner-switch' +import { placeUnshownLiveTerminalsBestEffort } from '../../runtime/terminal/adoption/unshown-live-terminal-placement' import { getCanonicalUserDataPath, migrateMobilePairingDataToCanonicalUserDataPath -} from '../persistence/loading-store/user-data-path' -import { OrcaRuntimeRpcServer } from '../runtime/rpc/server/runtime-rpc' -import { resolveServePinnedBindHost } from './serve-pinned-bind-host' -import { isOrcadSidecarLaunch } from '../window/foreground-activation-policy' -import { registerMobileHandlers } from '../ipc/mobile' -import { createRuntimeEnvironmentMobileRelayHosts } from '../ipc/runtime-environments/runtime-environment-mobile-relay-hosts' -import { getLocalPtyProvider } from '../ipc/pty/provider/registry' -import { registerHeadlessPtyRuntime } from '../ipc/pty/register-headless-runtime' -import { LocalPtyProvider } from '../providers/local-pty/local-pty-provider' -import { publishHeadlessRuntimeGraph } from '../runtime/session-graph/headless-runtime-graph' -import { OffscreenBrowserBackend } from '../browser/backends/offscreen-browser-backend' -import { browserManager } from '../browser/guest-lifecycle/manager/browser-manager' -import { getDesktopRelayStatus } from './main-process-relay-status' -import { startDesktopRelayService } from './main-process-relay-startup' -import { getServeOptions, getBundledWebClientRoot, printServeReady } from './main-process-serve' +} from '../../persistence/loading-store/user-data-path' +import { OrcaRuntimeRpcServer } from '../../runtime/rpc/server/runtime-rpc' +import { resolveServePinnedBindHost } from '../serve-launch/serve-pinned-bind-host' +import { isOrcadSidecarLaunch } from '../../window/activation/foreground-activation-policy' +import { registerMobileHandlers } from '../../ipc/mobile' +import { createRuntimeEnvironmentMobileRelayHosts } from '../../ipc/runtime-environments/runtime-environment-mobile-relay-hosts' +import { getLocalPtyProvider } from '../../ipc/pty/provider/registry' +import { registerHeadlessPtyRuntime } from '../../ipc/pty/register-headless-runtime' +import { LocalPtyProvider } from '../../providers/local-pty/local-pty-provider' +import { publishHeadlessRuntimeGraph } from '../../runtime/session-graph/headless-runtime-graph' +import { OffscreenBrowserBackend } from '../../browser/backends/offscreen-browser-backend' +import { browserManager } from '../../browser/guest-lifecycle/manager/browser-manager' +import { getDesktopRelayStatus } from '../cloud-startup/main-process-relay-status' +import { startDesktopRelayService } from '../cloud-startup/main-process-relay-startup' +import { getServeOptions } from '../serve-launch/serve-options' +import { getBundledWebClientRoot, printServeReady } from '../serve-launch/main-process-serve' import { bindTerminalRuntimeStartupServices, handleCodexHomePtySpawned, handlePtyExit, startTerminalRuntimeStartupServices -} from './main-process-pty-startup' -import { prepareCodexRuntimeHomeForLaunch } from './codex-launch-preparation' -import { prepareCodexSessionResumeForLaunch } from './codex-session-resume-launch' -import { startWindowsDesktopBeforeShellPathReady } from './windows-desktop-shell-path-startup' -import { repairKnownPoisonedInstallDirBeforeWindow } from './windows-install-dir-acl-recovery' -import { installServeQuitHandling } from './serve-quit-handling' -import { installCloudSessionShutdownFlush } from './cloud-session-shutdown-flush' -import { registerHeadlessServeSshHandlers } from './headless-serve-ssh-registration' -import { settleServeDesktopActivation } from './serve-desktop-activation' +} from '../pty-startup/main-process-pty-startup' +import { prepareCodexRuntimeHomeForLaunch } from '../agent-accounts/codex-launch-preparation' +import { prepareCodexSessionResumeForLaunch } from '../agent-accounts/codex-session-resume-launch' +import { startWindowsDesktopBeforeShellPathReady } from '../shell-environment/windows-desktop-shell-path-startup' +import { repairKnownPoisonedInstallDirBeforeWindow } from '../windows-install-permissions/windows-install-dir-acl-recovery' +import { installServeQuitHandling } from '../serve-launch/serve-quit-handling' +import { installCloudSessionShutdownFlush } from '../cloud-startup/cloud-session-shutdown-flush' +import { registerHeadlessServeSshHandlers } from '../serve-launch/headless-serve-ssh-registration' +import { settleServeDesktopActivation } from '../serve-launch/serve-desktop-activation' import { recordRuntimeRpcStartFailure, showRuntimeRpcStartupFailureDialog -} from '../runtime/rpc/server/runtime-rpc-startup-failure' -import { registerCliForHeadlessServe } from './serve-cli-registration' -import { startAppImageCopyPreExtraction } from '../cli/appimage/appimage-copy-pre-extraction' -import { scheduleAllPendingHistoryTreeRemovals } from '../pty/history/terminal-history-deletion' -import { triggerStartupNotificationRegistration } from '../ipc/startup-notification-registration' -import { startDesktopPushService } from './main-process-push-startup' +} from '../../runtime/rpc/server/runtime-rpc-startup-failure' +import { registerCliForHeadlessServe } from '../serve-launch/serve-cli-registration' +import { startAppImageCopyPreExtraction } from '../../cli/appimage/appimage-copy-pre-extraction' +import { scheduleAllPendingHistoryTreeRemovals } from '../../pty/history/terminal-history-deletion' +import { triggerStartupNotificationRegistration } from '../../ipc/startup-notification-registration' +import { startDesktopPushService } from '../cloud-startup/main-process-push-startup' import { connectDesktopConnectorCloud, installDesktopConnectorCloud -} from './main-process-connector-startup' -import { mainProcessState as state } from './main-process-state' -import { logStartupMilestone } from './startup-diagnostics' -import { setupHeadlessServeAutoUpdater } from '../window/main-window-updater' -import { preserveStateBeforeUpdateRestart } from '../updater/update-restart-preservation' -import { resolveUpdateInstallMode } from '../updater/updater-service' -import { scheduleAgentLaunchRecordWarmup } from './agent-launch-record-warmup' -import { emitServeBrowserIdentityActionLine } from '../server/serve-stdout-boundary' -import { getBrowserIdentityModeStatus } from '../browser/identity/mode/browser-identity-mode-store' +} from '../cloud-startup/main-process-connector-startup' +import { mainProcessState as state } from '../main-process-state' +import { logStartupMilestone } from '../diagnostics/startup-diagnostics' +import { setupHeadlessServeAutoUpdater } from '../../updater/lifecycle/main-window-updater' +import { preserveStateBeforeUpdateRestart } from '../../updater/update-restart-preservation' +import { resolveUpdateInstallMode } from '../../updater/updater-service' +import { scheduleAgentLaunchRecordWarmup } from '../agent-accounts/agent-launch-record-warmup' +import { emitServeBrowserIdentityActionLine } from '../../server/serve-stdout-boundary' +import { getBrowserIdentityModeStatus } from '../../browser/identity/mode/browser-identity-mode-store' type RuntimeService = NonNullable diff --git a/src/main/startup/main-process-runtime-service.ts b/src/main/startup/runtime-startup/main-process-runtime-service.ts similarity index 66% rename from src/main/startup/main-process-runtime-service.ts rename to src/main/startup/runtime-startup/main-process-runtime-service.ts index 3bb76f1a7da..356795082a6 100644 --- a/src/main/startup/main-process-runtime-service.ts +++ b/src/main/startup/runtime-startup/main-process-runtime-service.ts @@ -1,68 +1,68 @@ -import { wireRecipeWorkspaceRemoval } from '../ephemeral-vm/recipe-workspace-removal-wiring' -import { wireGitHubIssueLinkTitleFill } from '../github/github-issue-link-title-wiring' +import { wireRecipeWorkspaceRemoval } from '../../ephemeral-vm/recipe-workspace-removal-wiring' +import { wireGitHubIssueLinkTitleFill } from '../../github/workspace-links/github-issue-link-title-wiring' import { applySessionSearchSettingsChange, installChildSessionSearchService -} from '../ai-vault-search/session-search-enablement' -import { LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host' -import { sessionSearchScopeCatalogFromStore } from '../ai-vault-search/scope/session-search-store-scope-catalog' -import { getCanonicalUserDataPath } from '../persistence/loading-store/user-data-path' +} from '../../ai-vault-search/session-search-enablement' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { sessionSearchScopeCatalogFromStore } from '../../ai-vault-search/scope/session-search-store-scope-catalog' +import { getCanonicalUserDataPath } from '../../persistence/loading-store/user-data-path' import { app } from 'electron' -import { translateMain } from '../i18n/main-i18n' -import { OrcaRuntimeService } from '../runtime/orca-runtime' -import { getLocalPtyProvider } from '../ipc/pty/provider/registry' -import { clearProviderPtyState } from '../ipc/pty/provider/state-cleanup' -import { agentHookServer } from '../agent-hooks/server/agent-hook-server' -import { toAgentStatusIpcPayload } from '../agent-hooks/server/server-status-identity' -import { browserManager } from '../browser/guest-lifecycle/manager/browser-manager' -import { browserSessionRegistry } from '../browser/sessions/profiles/browser-session-registry' -import { loadAgentSessionClaimSigner } from '../runtime/agent-session/ownership/agent-session-claim-identity' -import { getProfileUserDataPath } from '../orca-profiles/profile-storage-paths' -import { codexAiVaultSessionResumePreparation } from '../codex/history/resume/codex-ai-vault-session-resume' -import { prepareCodexPinnedLaunchHome } from './codex-session-resume-launch' -import { resolveHostCodexSessionSourceHome } from '../codex/history/rollouts/codex-session-source-home' -import { agentHookRuntimeDeps } from '../agent-hooks/runtime/agent-hook-runtime-deps' -import { getDaemonProvider } from '../daemon/providers/lifecycle/daemon-provider-state' -import type { TerminalSideEffectBatch } from '../../shared/terminal/output/terminal-side-effect-facts' -import { resolveTuiAgentLaunchEnv } from '../../shared/agent-launch/choices/tui-agent-launch-defaults' -import { callRuntimeEnvironment } from '../ipc/runtime-environments/runtime-environment-transport-routing' -import { createOrchestrationEnvironmentTransport } from '../ipc/runtime-environments/orchestration-environment-transport' -import { trackRuntimeEnvironmentVerifiedTransitions } from '../ipc/runtime-environments/runtime-environment-verified-transitions' -import { onRuntimeEnvironmentStatusPublished } from '../ipc/runtime-environments/runtime-environment-status-owner' -import { mainProcessState as state } from './main-process-state' -import { suspendEphemeralVmWorkspace } from '../ephemeral-vm/workspace-suspend' +import { translateMain } from '../../i18n/main-i18n' +import { OrcaRuntimeService } from '../../runtime/orca-runtime' +import { getLocalPtyProvider } from '../../ipc/pty/provider/registry' +import { clearProviderPtyState } from '../../ipc/pty/provider/state-cleanup' +import { agentHookServer } from '../../agent-hooks/server/agent-hook-server' +import { toAgentStatusIpcPayload } from '../../agent-hooks/server/server-status-identity' +import { browserManager } from '../../browser/guest-lifecycle/manager/browser-manager' +import { browserSessionRegistry } from '../../browser/sessions/profiles/browser-session-registry' +import { loadAgentSessionClaimSigner } from '../../runtime/agent-session/ownership/agent-session-claim-identity' +import { getProfileUserDataPath } from '../../orca-profiles/profile-storage-paths' +import { codexAiVaultSessionResumePreparation } from '../../codex/history/resume/codex-ai-vault-session-resume' +import { prepareCodexPinnedLaunchHome } from '../agent-accounts/codex-session-resume-launch' +import { resolveHostCodexSessionSourceHome } from '../../codex/history/rollouts/codex-session-source-home' +import { agentHookRuntimeDeps } from '../../agent-hooks/runtime/agent-hook-runtime-deps' +import { getDaemonProvider } from '../../daemon/providers/lifecycle/daemon-provider-state' +import type { TerminalSideEffectBatch } from '../../../shared/terminal/output/terminal-side-effect-facts' +import { resolveTuiAgentLaunchEnv } from '../../../shared/agent-launch/choices/tui-agent-launch-defaults' +import { callRuntimeEnvironment } from '../../ipc/runtime-environments/runtime-environment-transport-routing' +import { createOrchestrationEnvironmentTransport } from '../../ipc/runtime-environments/orchestration-environment-transport' +import { trackRuntimeEnvironmentVerifiedTransitions } from '../../ipc/runtime-environments/runtime-environment-verified-transitions' +import { onRuntimeEnvironmentStatusPublished } from '../../ipc/runtime-environments/runtime-environment-status-owner' +import { mainProcessState as state } from '../main-process-state' +import { suspendEphemeralVmWorkspace } from '../../ephemeral-vm/workspace-suspend' import { acceptEphemeralVmWorkspaceWake, resumeEphemeralVmWorkspace -} from '../ephemeral-vm/workspace-resume' -import { registerRecipeVmWaker } from '../runtime/workspaces/sleep/recipe-vm-waker-registry' -import { setSshHostAsleepCheck } from '../ssh/connection/ssh-host-sleep-hold' +} from '../../ephemeral-vm/workspace-resume' +import { registerRecipeVmWaker } from '../../runtime/workspaces/sleep/recipe-vm-waker-registry' +import { setSshHostAsleepCheck } from '../../ssh/connection/ssh-host-sleep-hold' import { isRecipeVmSshTargetAsleep, setRecipeVmAsleepStoreRoot -} from '../ephemeral-vm/recipe-vm-asleep' -import { openRecipeVmEnvironment } from '../ipc/runtime-environments/runtime-environment-recipe-vm-wake' -import { resolveEnvironment } from '../../shared/remote-runtime/host-store/runtime-environment-store' -import { findWorkspaceEphemeralVmRuntime } from '../../shared/ephemeral-vm-workspace-runtime' -import { installWslOrcadAccountShim } from './wsl-orcad-account-env-wiring' +} from '../../ephemeral-vm/recipe-vm-asleep' +import { openRecipeVmEnvironment } from '../../ipc/runtime-environments/runtime-environment-recipe-vm-wake' +import { resolveEnvironment } from '../../../shared/remote-runtime/host-store/runtime-environment-store' +import { findWorkspaceEphemeralVmRuntime } from '../../../shared/ephemeral-vm-workspace-runtime' +import { installWslOrcadAccountShim } from '../wsl-startup/wsl-orcad-account-env-wiring' import { codexStructuredLaunchHomeResolvers, prepareCodexRuntimeHomeForLaunch -} from './codex-launch-preparation' -import { resolveHostAgentBaseEnvironment } from '../runtime/agent-session/environment/structured-agent-shell-environment' -import type { RuntimeDesktopWindowStatus } from '../../shared/runtime-types' -import { ArtifactCloudService } from '../artifacts/artifact-cloud-service' -import { SkillCloudService } from '../skills/cloud/skill-cloud-package-service' -import { isArtifactSharingEnabled } from '../../shared/artifacts/artifact-sharing-gate' +} from '../agent-accounts/codex-launch-preparation' +import { resolveHostAgentBaseEnvironment } from '../../runtime/agent-session/environment/structured-agent-shell-environment' +import type { RuntimeDesktopWindowStatus } from '../../../shared/runtime-session-contracts' +import { ArtifactCloudService } from '../../artifacts/artifact-cloud-service' +import { SkillCloudService } from '../../skills/cloud/skill-cloud-package-service' +import { isArtifactSharingEnabled } from '../../../shared/artifacts/artifact-sharing-gate' import { AgentStatusObservedPaneIdentities, recordObservedAgentStatusPaneIdentity -} from '../runtime/terminal/identity/agent-status-observed-pane-identity' -import { startAgentStateRulesLiveUpdates } from '../runtime/agent-state-rules/agent-state-rules-live-update' -import { recordDurableCrashBreadcrumb } from '../crash-reporting/breadcrumbs/durable-crash-breadcrumb' -import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../shared/layout-owner-switch' -import { getRuntimeEnvironmentRegistryRoot } from '../ipc/runtime-environments/runtime-environment-registry-root' -import { openOffscreenBrowserPageLink } from '../runtime/browser/commands/offscreen-browser-page-link' +} from '../../runtime/terminal/identity/agent-status-observed-pane-identity' +import { startAgentStateRulesLiveUpdates } from '../../runtime/agent-state-rules/agent-state-rules-live-update' +import { recordDurableCrashBreadcrumb } from '../../crash-reporting/breadcrumbs/durable-crash-breadcrumb' +import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../shared/layout-owner-switch' +import { getRuntimeEnvironmentRegistryRoot } from '../../ipc/runtime-environments/runtime-environment-registry-root' +import { openOffscreenBrowserPageLink } from '../../runtime/browser/commands/offscreen-browser-page-link' export function getDesktopWindowStatus(): RuntimeDesktopWindowStatus { const activation = state.desktopActivationGate diff --git a/src/main/startup/headless-serve-ssh-registration.ts b/src/main/startup/serve-launch/headless-serve-ssh-registration.ts similarity index 55% rename from src/main/startup/headless-serve-ssh-registration.ts rename to src/main/startup/serve-launch/headless-serve-ssh-registration.ts index 41f0b4f7395..6750ad92440 100644 --- a/src/main/startup/headless-serve-ssh-registration.ts +++ b/src/main/startup/serve-launch/headless-serve-ssh-registration.ts @@ -1,7 +1,7 @@ -import type { Store } from '../persistence/loading-store/store' -import type { OrcaRuntimeService } from '../runtime/orca-runtime' -import { registerSshHandlers } from '../ipc/ssh/ssh' -import { mainProcessState as state } from './main-process-state' +import type { Store } from '../../persistence/loading-store/store' +import type { OrcaRuntimeService } from '../../runtime/orca-runtime' +import { registerSshHandlers } from '../../ipc/ssh/ssh' +import { mainProcessState as state } from '../main-process-state' /** Register SSH before any window so headless serve can list/connect targets (#25886, #8489); later window registration is idempotent. */ export function registerHeadlessServeSshHandlers(store: Store, runtime: OrcaRuntimeService): void { diff --git a/src/main/startup/headless-serve-x11-reexec.ts b/src/main/startup/serve-launch/headless-serve-x11-reexec.ts similarity index 97% rename from src/main/startup/headless-serve-x11-reexec.ts rename to src/main/startup/serve-launch/headless-serve-x11-reexec.ts index 68f6319ca60..e6782cfb9d0 100644 --- a/src/main/startup/headless-serve-x11-reexec.ts +++ b/src/main/startup/serve-launch/headless-serve-x11-reexec.ts @@ -2,7 +2,7 @@ import { app } from 'electron' import { HEADLESS_SERVE_OZONE_PLATFORM_SWITCH, hasExplicitOzonePlatform -} from '../../shared/headless-serve-ozone-platform' +} from '../../../shared/headless-serve-ozone-platform' export type HeadlessServeX11ReexecOptions = { isServeMode: boolean diff --git a/src/main/startup/main-process-serve.ts b/src/main/startup/serve-launch/main-process-serve.ts similarity index 72% rename from src/main/startup/main-process-serve.ts rename to src/main/startup/serve-launch/main-process-serve.ts index 61cc4bacd1f..a6c7fa3735b 100644 --- a/src/main/startup/main-process-serve.ts +++ b/src/main/startup/serve-launch/main-process-serve.ts @@ -1,12 +1,10 @@ import { app } from 'electron' -import { notifyServeSupervisorReady } from '../updater/serve-update-handoff' -import { clearServeAbortPark } from '../../shared/serve-abort-park' -import { findBundledWebClientRoot } from '../../shared/bundled-web-client-root' -import { buildServePairingReadiness, servePublishMode } from '../server/serve-pairing-readiness' -import { mainProcessState as state } from './main-process-state' -import { getServeOptions, type ServeOptions } from './serve-options' - -export { getServeOptions, type ServeOptions } +import { notifyServeSupervisorReady } from '../../updater/serve-update-handoff' +import { clearServeAbortPark } from '../../../shared/serve-abort-park' +import { findBundledWebClientRoot } from '../../../shared/bundled-web-client-root' +import { buildServePairingReadiness, servePublishMode } from '../../server/serve-pairing-readiness' +import { mainProcessState as state } from '../main-process-state' +import type { ServeOptions } from './serve-options' export function getBundledWebClientRoot(): string | undefined { return findBundledWebClientRoot(app.getAppPath()) diff --git a/src/main/startup/serve-cli-registration.ts b/src/main/startup/serve-launch/serve-cli-registration.ts similarity index 87% rename from src/main/startup/serve-cli-registration.ts rename to src/main/startup/serve-launch/serve-cli-registration.ts index e4925df94ba..5d15c335957 100644 --- a/src/main/startup/serve-cli-registration.ts +++ b/src/main/startup/serve-launch/serve-cli-registration.ts @@ -1,8 +1,8 @@ import { app } from 'electron' -import { resolveAppImageRuntimeIdentity } from '../updater/linux-package/appimage-runtime-identity' -import { prepareAppImageCopyForServe } from '../cli/appimage/appimage-serve-preparation' -import { CliInstaller } from '../cli/cli-installer' -import { installLinuxBareOrcaDispatcher } from '../cli/launchers/linux-bare-orca-dispatcher' +import { resolveAppImageRuntimeIdentity } from '../../updater/linux-package/appimage-runtime-identity' +import { prepareAppImageCopyForServe } from '../../cli/appimage/appimage-serve-preparation' +import { CliInstaller } from '../../cli/cli-installer' +import { installLinuxBareOrcaDispatcher } from '../../cli/launchers/linux-bare-orca-dispatcher' /** Headless serve has no renderer to run the normal cli:install flow, so it registers here. */ export async function registerCliForHeadlessServe(): Promise { diff --git a/src/main/startup/serve-desktop-activation.test.ts b/src/main/startup/serve-launch/serve-desktop-activation.test.ts similarity index 100% rename from src/main/startup/serve-desktop-activation.test.ts rename to src/main/startup/serve-launch/serve-desktop-activation.test.ts diff --git a/src/main/startup/serve-desktop-activation.ts b/src/main/startup/serve-launch/serve-desktop-activation.ts similarity index 96% rename from src/main/startup/serve-desktop-activation.ts rename to src/main/startup/serve-launch/serve-desktop-activation.ts index 3e653366104..e1bc1731f23 100644 --- a/src/main/startup/serve-desktop-activation.ts +++ b/src/main/startup/serve-launch/serve-desktop-activation.ts @@ -1,4 +1,4 @@ -import type { RuntimeDesktopWindowStatus } from '../../shared/runtime-types' +import type { RuntimeDesktopWindowStatus } from '../../../shared/runtime-session-contracts' type ActivationGateState = Exclude | 'ready' diff --git a/src/main/startup/serve-mode-argv.test.ts b/src/main/startup/serve-launch/serve-mode-argv.test.ts similarity index 100% rename from src/main/startup/serve-mode-argv.test.ts rename to src/main/startup/serve-launch/serve-mode-argv.test.ts diff --git a/src/main/startup/serve-mode-argv.ts b/src/main/startup/serve-launch/serve-mode-argv.ts similarity index 100% rename from src/main/startup/serve-mode-argv.ts rename to src/main/startup/serve-launch/serve-mode-argv.ts diff --git a/src/main/startup/serve-native-quit-guard.ts b/src/main/startup/serve-launch/serve-native-quit-guard.ts similarity index 96% rename from src/main/startup/serve-native-quit-guard.ts rename to src/main/startup/serve-launch/serve-native-quit-guard.ts index d17fc1cc1c8..0c3890ac6e1 100644 --- a/src/main/startup/serve-native-quit-guard.ts +++ b/src/main/startup/serve-launch/serve-native-quit-guard.ts @@ -1,5 +1,5 @@ import { app, powerMonitor, type Event } from 'electron' -import { isProcessQuitRequested, markProcessQuitRequested } from './process-quit-request' +import { isProcessQuitRequested, markProcessQuitRequested } from '../quit/process-quit-request' /** macOS native Quit must close serve windows without disconnecting paired clients (#15537). Signals/supervisor/updates mark process quit; shutdown/logout do too so they remain allowed. */ export function installServeNativeQuitGuard(deps: { diff --git a/src/main/startup/serve-options.ts b/src/main/startup/serve-launch/serve-options.ts similarity index 97% rename from src/main/startup/serve-options.ts rename to src/main/startup/serve-launch/serve-options.ts index a06564ed78e..97e69df8727 100644 --- a/src/main/startup/serve-options.ts +++ b/src/main/startup/serve-launch/serve-options.ts @@ -1,8 +1,8 @@ import { getServeFlagTypoError, getServeOptionValidationError -} from '../../shared/serve-option-validation' -import { resolveOrcadBindHost } from '../../shared/orcad-bind-address' +} from '../../../shared/serve-option-validation' +import { resolveOrcadBindHost } from '../../../shared/orcad-bind-address' export type ServeOptions = { json: boolean diff --git a/src/main/startup/serve-pinned-bind-host.test.ts b/src/main/startup/serve-launch/serve-pinned-bind-host.test.ts similarity index 93% rename from src/main/startup/serve-pinned-bind-host.test.ts rename to src/main/startup/serve-launch/serve-pinned-bind-host.test.ts index 01ffca08b0b..3d30df04722 100644 --- a/src/main/startup/serve-pinned-bind-host.test.ts +++ b/src/main/startup/serve-launch/serve-pinned-bind-host.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import '../runtime/rpc/server/runtime-rpc-pairing-types' +import '../../runtime/rpc/server/runtime-rpc-pairing-types' import './serve-mode-argv' import { getServeOptions } from './serve-options' import './serve-pinned-bind-host' diff --git a/src/main/startup/serve-pinned-bind-host.ts b/src/main/startup/serve-launch/serve-pinned-bind-host.ts similarity index 85% rename from src/main/startup/serve-pinned-bind-host.ts rename to src/main/startup/serve-launch/serve-pinned-bind-host.ts index 6288bd0eefb..a9a6aa4a122 100644 --- a/src/main/startup/serve-pinned-bind-host.ts +++ b/src/main/startup/serve-launch/serve-pinned-bind-host.ts @@ -1,4 +1,4 @@ -import { WS_BIND_HOST_LOOPBACK } from '../runtime/rpc/server/runtime-rpc-pairing-types' +import { WS_BIND_HOST_LOOPBACK } from '../../runtime/rpc/server/runtime-rpc-pairing-types' import type { ServeOptions } from './serve-options' /** Undefined keeps the runtime's own choice: all interfaces for serve, loopback until pairing for the desktop. */ diff --git a/src/main/startup/serve-quit-handling.ts b/src/main/startup/serve-launch/serve-quit-handling.ts similarity index 76% rename from src/main/startup/serve-quit-handling.ts rename to src/main/startup/serve-launch/serve-quit-handling.ts index c7e5a25f1f3..c0b6996b35c 100644 --- a/src/main/startup/serve-quit-handling.ts +++ b/src/main/startup/serve-launch/serve-quit-handling.ts @@ -1,6 +1,6 @@ -import { isQuittingForUpdate } from '../updater/updater-service' -import { quitFromUserCommand } from './main-window-actions' -import { quitProcess } from './process-quit-request' +import { isQuittingForUpdate } from '../../updater/updater-service' +import { quitFromUserCommand } from '../main-window/main-window-actions' +import { quitProcess } from '../quit/process-quit-request' import { installServeNativeQuitGuard } from './serve-native-quit-guard' import { registerServeSignalHandlers } from './serve-signal-handlers' diff --git a/src/main/startup/serve-signal-handlers.ts b/src/main/startup/serve-launch/serve-signal-handlers.ts similarity index 100% rename from src/main/startup/serve-signal-handlers.ts rename to src/main/startup/serve-launch/serve-signal-handlers.ts diff --git a/src/main/startup/serve-user-data-path-guard.test.ts b/src/main/startup/serve-launch/serve-user-data-path-guard.test.ts similarity index 96% rename from src/main/startup/serve-user-data-path-guard.test.ts rename to src/main/startup/serve-launch/serve-user-data-path-guard.test.ts index 5030ced5b37..e5be57f3dcd 100644 --- a/src/main/startup/serve-user-data-path-guard.test.ts +++ b/src/main/startup/serve-launch/serve-user-data-path-guard.test.ts @@ -39,7 +39,7 @@ describe('checkServeUserDataPath', () => { describe('configureOrcaUserDataPathEnv on a serve launch', () => { it('throws before the instance lock instead of publishing a mismatched profile', async () => { vi.doMock('electron', () => ({ app: { getPath: () => '/default/orca' } })) - const { configureOrcaUserDataPathEnv } = await import('./configure-process') + const { configureOrcaUserDataPathEnv } = await import('../configure-process') const argv = process.argv const previous = process.env.ORCA_USER_DATA_PATH process.argv = [...argv, '--serve'] diff --git a/src/main/startup/serve-user-data-path-guard.ts b/src/main/startup/serve-launch/serve-user-data-path-guard.ts similarity index 96% rename from src/main/startup/serve-user-data-path-guard.ts rename to src/main/startup/serve-launch/serve-user-data-path-guard.ts index c447ceb1b9c..32a3d2dd603 100644 --- a/src/main/startup/serve-user-data-path-guard.ts +++ b/src/main/startup/serve-launch/serve-user-data-path-guard.ts @@ -1,4 +1,4 @@ -import { SERVE_USER_DATA_PATH_ENV, isSameUserDataPath } from '../../shared/serve-user-data-path' +import { SERVE_USER_DATA_PATH_ENV, isSameUserDataPath } from '../../../shared/serve-user-data-path' /** Reject mismatched serve profiles before locking: a lock loss on the wrong profile can activate the user's desktop. */ export function checkServeUserDataPath(options: { diff --git a/src/main/startup/serve-native-quit-guard.test.ts b/src/main/startup/serve-native-quit-guard.test.ts deleted file mode 100644 index 8bf75573123..00000000000 --- a/src/main/startup/serve-native-quit-guard.test.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' - -type Listener = (...args: any[]) => void -const electron = vi.hoisted(() => { - const beforeQuit: Listener[] = [] - const powerListeners: Record = {} - return { beforeQuit, powerListeners, quit: vi.fn() } -}) - -vi.mock('electron', () => ({ - app: { - quit: electron.quit, - prependListener: (event: string, listener: Listener) => { - if (event === 'before-quit') { - electron.beforeQuit.unshift(listener) - } - } - }, - powerMonitor: { - on: (event: string, listener: Listener) => { - electron.powerListeners[event] = listener - } - } -})) - -import { installServeNativeQuitGuard } from './serve-native-quit-guard' -import { quitProcess, resetProcessQuitRequestForTest } from './process-quit-request' - -function emitBeforeQuit(): { preventDefault: ReturnType } { - const event = { preventDefault: vi.fn() } - for (const listener of electron.beforeQuit) { - listener(event) - } - return event -} - -describe('installServeNativeQuitGuard', () => { - const closeDesktopWindows = vi.fn() - const isQuittingForUpdate = vi.fn(() => false) - - beforeEach(() => { - electron.beforeQuit.length = 0 - for (const key of Object.keys(electron.powerListeners)) { - delete electron.powerListeners[key] - } - electron.quit.mockReset() - closeDesktopWindows.mockReset() - isQuittingForUpdate.mockReturnValue(false) - resetProcessQuitRequestForTest() - }) - - it('turns a macOS Dock or app-switcher Quit into closing the desktop windows (#15537)', () => { - installServeNativeQuitGuard({ platform: 'darwin', isQuittingForUpdate, closeDesktopWindows }) - - const event = emitBeforeQuit() - - expect(event.preventDefault).toHaveBeenCalledOnce() - expect(closeDesktopWindows).toHaveBeenCalledOnce() - }) - - it('lets a signal, supervisor or relaunch quit through, and keeps it allowed on re-entry', () => { - installServeNativeQuitGuard({ platform: 'darwin', isQuittingForUpdate, closeDesktopWindows }) - - quitProcess() - expect(electron.quit).toHaveBeenCalledOnce() - expect(emitBeforeQuit().preventDefault).not.toHaveBeenCalled() - expect(emitBeforeQuit().preventDefault).not.toHaveBeenCalled() - expect(closeDesktopWindows).not.toHaveBeenCalled() - }) - - it('lets an update install quit through', () => { - isQuittingForUpdate.mockReturnValue(true) - installServeNativeQuitGuard({ platform: 'darwin', isQuittingForUpdate, closeDesktopWindows }) - - expect(emitBeforeQuit().preventDefault).not.toHaveBeenCalled() - }) - - it('does not cancel a macOS logout or shutdown', () => { - installServeNativeQuitGuard({ platform: 'darwin', isQuittingForUpdate, closeDesktopWindows }) - - electron.powerListeners.shutdown?.() - - expect(emitBeforeQuit().preventDefault).not.toHaveBeenCalled() - expect(closeDesktopWindows).not.toHaveBeenCalled() - }) - - it.each(['linux', 'win32'] as const)('installs nothing on %s', (platform) => { - installServeNativeQuitGuard({ platform, isQuittingForUpdate, closeDesktopWindows }) - - expect(electron.beforeQuit).toHaveLength(0) - expect(electron.powerListeners).toEqual({}) - }) -}) diff --git a/src/main/startup/serve-signal-handlers.test.ts b/src/main/startup/serve-signal-handlers.test.ts deleted file mode 100644 index 1ec9da580ad..00000000000 --- a/src/main/startup/serve-signal-handlers.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { EventEmitter } from 'node:events' -import { describe, expect, it, vi } from 'vitest' -import { registerServeSignalHandlers, type ServeSignalSource } from './serve-signal-handlers' - -function signalSourceFor(emitter: EventEmitter): ServeSignalSource { - return { - on: (event, listener) => emitter.on(event, listener), - removeListener: (event, listener) => emitter.removeListener(event, listener), - listeners: (event) => - emitter - .listeners(event) - .filter( - (listener): listener is (signal: NodeJS.Signals) => void => typeof listener === 'function' - ) - } -} - -describe('registerServeSignalHandlers', () => { - it('retries a vetoed quit on every delivered signal', () => { - const signalSource = new EventEmitter() - const quitApplication = vi.fn() - - registerServeSignalHandlers(signalSourceFor(signalSource), quitApplication) - signalSource.emit('SIGINT') - signalSource.emit('SIGINT') - signalSource.emit('SIGTERM') - signalSource.emit('SIGHUP') - - expect(quitApplication).toHaveBeenCalledTimes(4) - expect(signalSource.listenerCount('SIGINT')).toBe(1) - expect(signalSource.listenerCount('SIGTERM')).toBe(1) - expect(signalSource.listenerCount('SIGHUP')).toBe(1) - }) - - it('drops every earlier listener before re-adding it, so Node reinstalls its signal handler', () => { - const signalSource = new EventEmitter() - const earlier = vi.fn() - signalSource.on('SIGTERM', earlier) - const counts: number[] = [] - signalSource.on('removeListener', (event) => { - if (event === 'SIGTERM') { - counts.push(signalSource.listenerCount('SIGTERM')) - } - }) - const quitApplication = vi.fn() - - registerServeSignalHandlers(signalSourceFor(signalSource), quitApplication) - signalSource.emit('SIGTERM') - - // Node closes a signal's native handle only when its last listener is removed. - expect(counts).toEqual([0]) - expect(signalSource.listeners('SIGTERM')).toEqual([earlier, quitApplication]) - expect(earlier).toHaveBeenCalledOnce() - expect(quitApplication).toHaveBeenCalledOnce() - }) -}) diff --git a/src/main/startup/hydrate-shell-path.ts b/src/main/startup/shell-environment/hydrate-shell-path.ts similarity index 97% rename from src/main/startup/hydrate-shell-path.ts rename to src/main/startup/shell-environment/hydrate-shell-path.ts index 95f1e25ef1c..b155adca4a2 100644 --- a/src/main/startup/hydrate-shell-path.ts +++ b/src/main/startup/shell-environment/hydrate-shell-path.ts @@ -1,9 +1,9 @@ import type { ChildProcess } from 'node:child_process' import { delimiter, win32 as pathWin32 } from 'node:path' import { spawnProcess } from '@orca/process-host' -import { stripAnsiEscapeSequences } from '../../shared/ansi-escape-sequences' -import type { ShellHydrationFailureReason } from '../../shared/shell/launch/shell-path-hydration-types' -import { resolveWindowsShellStartupFamily } from '../../shared/windows-terminal-shell' +import { stripAnsiEscapeSequences } from '../../../shared/ansi-escape-sequences' +import type { ShellHydrationFailureReason } from '../../../shared/shell/launch/shell-path-hydration-types' +import { resolveWindowsShellStartupFamily } from '../../../shared/windows-terminal-shell' import { SHELL_PATH_DELIMITER as DELIMITER, shellPathProbe } from './shell-path-probe' import { WindowsShellPathOwnership, createWindowsPathKey } from './windows-shell-path-ownership' import { bindShellProbeLifetime } from './shell-probe-lifetime' diff --git a/src/main/startup/hydrate-shell-path.windows.test.ts b/src/main/startup/shell-environment/hydrate-shell-path.windows.test.ts similarity index 100% rename from src/main/startup/hydrate-shell-path.windows.test.ts rename to src/main/startup/shell-environment/hydrate-shell-path.windows.test.ts diff --git a/src/main/startup/login-shell-environment-cache.test.ts b/src/main/startup/shell-environment/login-shell-environment-cache.test.ts similarity index 100% rename from src/main/startup/login-shell-environment-cache.test.ts rename to src/main/startup/shell-environment/login-shell-environment-cache.test.ts diff --git a/src/main/startup/login-shell-environment.test.ts b/src/main/startup/shell-environment/login-shell-environment.test.ts similarity index 84% rename from src/main/startup/login-shell-environment.test.ts rename to src/main/startup/shell-environment/login-shell-environment.test.ts index d94cbc4aa52..4afb3b9fbf5 100644 --- a/src/main/startup/login-shell-environment.test.ts +++ b/src/main/startup/shell-environment/login-shell-environment.test.ts @@ -2,7 +2,7 @@ import { existsSync } from 'node:fs' import { mkdtemp, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' -import { afterEach, describe, expect, it, vi } from 'vitest' +import { afterEach, describe, expect, it } from 'vitest' import { resetLoginShellEnvironmentCacheForTests, resolveLoginShellEnvironment @@ -46,17 +46,6 @@ afterEach(async () => { }) describe('resolveLoginShellEnvironment', () => { - it('returns variables exported by the profile-loading shell', async () => { - const spawner = vi.fn(async () => ({ - ...process.env, - EXAMPLE_GATEWAY_TOKEN: 'shell-exported' - })) - - await expect( - resolveLoginShellEnvironment({ shellOverride: '/bin/zsh', spawner }) - ).resolves.toMatchObject({ EXAMPLE_GATEWAY_TOKEN: 'shell-exported' }) - }) - it.runIf(realShell !== null)( 'captures a profile export missing from the parent process', async () => { diff --git a/src/main/startup/login-shell-environment.ts b/src/main/startup/shell-environment/login-shell-environment.ts similarity index 99% rename from src/main/startup/login-shell-environment.ts rename to src/main/startup/shell-environment/login-shell-environment.ts index 70d21e43d67..6620ea5e687 100644 --- a/src/main/startup/login-shell-environment.ts +++ b/src/main/startup/shell-environment/login-shell-environment.ts @@ -1,7 +1,7 @@ import { createHash } from 'node:crypto' import { win32 as pathWin32 } from 'node:path' import { spawnProcess } from '@orca/process-host' -import { resolveWindowsShellStartupFamily } from '../../shared/windows-terminal-shell' +import { resolveWindowsShellStartupFamily } from '../../../shared/windows-terminal-shell' import { resolveProfileLoadingFallbackShell, resolveProfileLoadingShell diff --git a/src/main/startup/shell-path-probe.ts b/src/main/startup/shell-environment/shell-path-probe.ts similarity index 95% rename from src/main/startup/shell-path-probe.ts rename to src/main/startup/shell-environment/shell-path-probe.ts index c52a90eed99..e88a9610e16 100644 --- a/src/main/startup/shell-path-probe.ts +++ b/src/main/startup/shell-environment/shell-path-probe.ts @@ -1,5 +1,5 @@ import { delimiter, win32 as pathWin32 } from 'node:path' -import { resolveWindowsShellStartupFamily } from '../../shared/windows-terminal-shell' +import { resolveWindowsShellStartupFamily } from '../../../shared/windows-terminal-shell' export const SHELL_PATH_DELIMITER = '__ORCA_SHELL_PATH__' diff --git a/src/main/startup/shell-probe-lifetime.live-shell.test.ts b/src/main/startup/shell-environment/shell-probe-lifetime.live-shell.test.ts similarity index 95% rename from src/main/startup/shell-probe-lifetime.live-shell.test.ts rename to src/main/startup/shell-environment/shell-probe-lifetime.live-shell.test.ts index e82eefecb7b..1ddb399110b 100644 --- a/src/main/startup/shell-probe-lifetime.live-shell.test.ts +++ b/src/main/startup/shell-environment/shell-probe-lifetime.live-shell.test.ts @@ -72,8 +72,8 @@ describe.skipIf(process.platform === 'win32')('a login shell probe left running' await build({ stdin: { contents: ` - import { captureLoginShellEnvironment } from ${JSON.stringify(resolve('src/main/startup/login-shell-environment.ts'))}; - import { hydrateShellPath } from ${JSON.stringify(resolve('src/main/startup/hydrate-shell-path.ts'))}; + import { captureLoginShellEnvironment } from ${JSON.stringify(resolve('src/main/startup/shell-environment/login-shell-environment.ts'))}; + import { hydrateShellPath } from ${JSON.stringify(resolve('src/main/startup/shell-environment/hydrate-shell-path.ts'))}; // As orcad and Electron do: INT/TERM end in an exit. process.on('SIGTERM', () => process.exit(143)); void ${call}; diff --git a/src/main/startup/shell-probe-lifetime.ts b/src/main/startup/shell-environment/shell-probe-lifetime.ts similarity index 100% rename from src/main/startup/shell-probe-lifetime.ts rename to src/main/startup/shell-environment/shell-probe-lifetime.ts diff --git a/src/main/startup/shell-probe-terminal-detach.live-shell.test.ts b/src/main/startup/shell-environment/shell-probe-terminal-detach.live-shell.test.ts similarity index 93% rename from src/main/startup/shell-probe-terminal-detach.live-shell.test.ts rename to src/main/startup/shell-environment/shell-probe-terminal-detach.live-shell.test.ts index 68052d45f3c..a4cfd4ad656 100644 --- a/src/main/startup/shell-probe-terminal-detach.live-shell.test.ts +++ b/src/main/startup/shell-environment/shell-probe-terminal-detach.live-shell.test.ts @@ -5,7 +5,7 @@ import { tmpdir } from 'node:os' import { join, resolve } from 'node:path' import * as pty from 'node-pty' import { afterEach, beforeEach, describe, expect, it } from 'vitest' -import { hasZsh, ZSH_PATH } from '../pty/shell-startup/zsh-startup-hook-pty-harness' +import { hasZsh, ZSH_PATH } from '../../pty/shell-startup/zsh-startup-hook-pty-harness' const DONE = 'ORCA-PROBE-PARENT-DONE' @@ -16,8 +16,8 @@ function fixtureSource(probe: 'login-environment' | 'path'): string { ? `captureLoginShellEnvironment({ shellOverride: ${JSON.stringify(ZSH_PATH)} })` : `hydrateShellPath({ shellOverride: ${JSON.stringify(ZSH_PATH)} })` return ` - import { captureLoginShellEnvironment } from ${JSON.stringify(resolve('src/main/startup/login-shell-environment.ts'))}; - import { hydrateShellPath } from ${JSON.stringify(resolve('src/main/startup/hydrate-shell-path.ts'))}; + import { captureLoginShellEnvironment } from ${JSON.stringify(resolve('src/main/startup/shell-environment/login-shell-environment.ts'))}; + import { hydrateShellPath } from ${JSON.stringify(resolve('src/main/startup/shell-environment/hydrate-shell-path.ts'))}; const probe = ${call}; setTimeout(() => { process.stdin.setRawMode(true); process.stdin.setRawMode(false); }, 300); probe.then(() => { console.log(${JSON.stringify(DONE)}); process.exit(0); }); diff --git a/src/main/startup/windows-desktop-shell-path-startup.ts b/src/main/startup/shell-environment/windows-desktop-shell-path-startup.ts similarity index 100% rename from src/main/startup/windows-desktop-shell-path-startup.ts rename to src/main/startup/shell-environment/windows-desktop-shell-path-startup.ts diff --git a/src/main/startup/windows-shell-path-hydration.ts b/src/main/startup/shell-environment/windows-shell-path-hydration.ts similarity index 94% rename from src/main/startup/windows-shell-path-hydration.ts rename to src/main/startup/shell-environment/windows-shell-path-hydration.ts index 609501bf1b2..8ef89142a17 100644 --- a/src/main/startup/windows-shell-path-hydration.ts +++ b/src/main/startup/shell-environment/windows-shell-path-hydration.ts @@ -1,11 +1,11 @@ import { win32 as pathWin32 } from 'node:path' -import { resolveWindowsGitBashShellPath } from '../pty/shell-startup/git-bash' +import { resolveWindowsGitBashShellPath } from '../../pty/shell-startup/git-bash' import { resolveEffectiveWindowsPowerShell, type WindowsPowerShellImplementation, type WindowsPowerShellShellFamily -} from '../providers/windows-powershell' -import { resolveWindowsPowerShellSpawnChain } from '../providers/windows-powershell-executable' +} from '../../providers/windows-powershell' +import { resolveWindowsPowerShellSpawnChain } from '../../providers/windows-powershell-executable' import { configureWindowsShellPathHydration, hydrateShellPath, diff --git a/src/main/startup/windows-shell-path-ownership.test.ts b/src/main/startup/shell-environment/windows-shell-path-ownership.test.ts similarity index 100% rename from src/main/startup/windows-shell-path-ownership.test.ts rename to src/main/startup/shell-environment/windows-shell-path-ownership.test.ts diff --git a/src/main/startup/windows-shell-path-ownership.ts b/src/main/startup/shell-environment/windows-shell-path-ownership.ts similarity index 100% rename from src/main/startup/windows-shell-path-ownership.ts rename to src/main/startup/shell-environment/windows-shell-path-ownership.ts diff --git a/src/main/startup/windows-shell-path-restoration.windows.test.ts b/src/main/startup/shell-environment/windows-shell-path-restoration.windows.test.ts similarity index 100% rename from src/main/startup/windows-shell-path-restoration.windows.test.ts rename to src/main/startup/shell-environment/windows-shell-path-restoration.windows.test.ts diff --git a/src/main/startup/single-instance-lock-exit.electron.test.ts b/src/main/startup/single-instance-lock-exit.electron.test.ts deleted file mode 100644 index 1c88a312fee..00000000000 --- a/src/main/startup/single-instance-lock-exit.electron.test.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { spawnSync } from 'node:child_process' -import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' -import { createRequire } from 'node:module' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterAll, describe, expect, it } from 'vitest' -import { SINGLE_INSTANCE_ALREADY_RUNNING_EXIT_CODE } from './single-instance-lock' - -// Before-ready quit is deferred; execute shipped gate termination under real Electron. A live Linux lock race needs ready/display, so isolate loser exit semantics here; lock/argv tests cover ownership. - -const electronBinary = createRequire(import.meta.url)('electron') as string -const GATE_ENTERED = 'GATE_ENTERED' -const CONTINUED_INTO_STARTUP = 'CONTINUED_INTO_STARTUP' -const REACHED_TAIL = 'REACHED_TAIL' -const MARKER_ENV = 'ORCA_PRE_READY_EXIT_FIXTURE_MARKER' - -const fixtureRoots: string[] = [] - -afterAll(() => { - for (const root of fixtureRoots) { - rmSync(root, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 }) - } -}) - -function readPreReadyTermination(gate: string): string { - const source = readFileSync( - join(process.cwd(), 'src/main/startup/main-process-preflight.ts'), - 'utf8' - ) - const start = source.indexOf(gate) - expect(start).toBeGreaterThanOrEqual(0) - const end = source.indexOf('\n }', start) - expect(end).toBeGreaterThan(start) - - return source - .slice(start, end) - .split('\n') - .map((line) => line.trim()) - .filter((line) => line.startsWith('app.')) - .join('\n') -} - -function buildFixtureMain(termination: string): string { - return [ - `const { app } = require('electron')`, - `const { appendFileSync } = require('node:fs')`, - // Use environment for markers because Chromium rewrites argv before main. - `const marker = process.env.${MARKER_ENV}`, - `const mark = (name) => appendFileSync(marker, name + '\\n')`, - `const SINGLE_INSTANCE_ALREADY_RUNNING_EXIT_CODE = ${SINGLE_INSTANCE_ALREADY_RUNNING_EXIT_CODE}`, - `mark('${GATE_ENTERED}')`, - termination, - `mark('${CONTINUED_INTO_STARTUP}')`, - // Model startup tail that must not run after a fatal pre-ready gate. - `mark('${REACHED_TAIL}')`, - `process.exit(0)` - ].join('\n') -} - -type FixtureRun = { status: number | null; markers: string[] } - -function runPreReadyGate(termination: string): FixtureRun { - const root = mkdtempSync(join(tmpdir(), 'orca-pre-ready-exit-')) - fixtureRoots.push(root) - const dir = join(root, 'fixture') - const marker = join(root, 'markers.log') - mkdirSync(dir, { recursive: true }) - writeFileSync( - join(dir, 'package.json'), - '{ "name": "orca-pre-ready-exit-fixture", "main": "main.js" }' - ) - writeFileSync(join(dir, 'main.js'), buildFixtureMain(termination)) - writeFileSync(marker, '') - - const result = spawnSync(electronBinary, [dir, '--no-sandbox'], { - stdio: 'ignore', - timeout: 60_000, - env: { ...process.env, [MARKER_ENV]: marker } - }) - expect(result.error).toBeUndefined() - - return { - status: result.status, - markers: readFileSync(marker, 'utf8').split('\n').filter(Boolean) - } -} - -describe('pre-ready termination under real Electron', () => { - it('stops the duplicate launch before any further startup runs, with the already-running code', () => { - const termination = readPreReadyTermination('if (!hasLock) {') - // Reject an empty source slice or the fixture's own exit passes vacuously. - expect(termination).not.toBe('') - - const run = runPreReadyGate(termination) - - expect(run.markers).toEqual([GATE_ENTERED]) - expect(run.status).toBe(SINGLE_INSTANCE_ALREADY_RUNNING_EXIT_CODE) - }, 90_000) - - it('#17615 stops serve when display setup fails instead of entering Chromium startup', () => { - const termination = readPreReadyTermination( - 'if (state.isServeMode && !state.headlessBrowserDisplayAvailable) {' - ) - - const run = runPreReadyGate(termination) - - expect(run.markers).toEqual([GATE_ENTERED]) - expect(run.status).toBe(1) - }, 90_000) -}) diff --git a/src/main/startup/e2e-external-open-guard.ts b/src/main/startup/testing/e2e-external-open-guard.ts similarity index 100% rename from src/main/startup/e2e-external-open-guard.ts rename to src/main/startup/testing/e2e-external-open-guard.ts diff --git a/src/main/startup/e2e-spawn-log-env.test.ts b/src/main/startup/testing/e2e-spawn-log-env.test.ts similarity index 100% rename from src/main/startup/e2e-spawn-log-env.test.ts rename to src/main/startup/testing/e2e-spawn-log-env.test.ts diff --git a/src/main/startup/e2e-spawn-log-env.ts b/src/main/startup/testing/e2e-spawn-log-env.ts similarity index 100% rename from src/main/startup/e2e-spawn-log-env.ts rename to src/main/startup/testing/e2e-spawn-log-env.ts diff --git a/src/main/startup/windows-isolated-spawn-electron-fixture.ts b/src/main/startup/testing/windows-isolated-spawn-electron-fixture.ts similarity index 100% rename from src/main/startup/windows-isolated-spawn-electron-fixture.ts rename to src/main/startup/testing/windows-isolated-spawn-electron-fixture.ts diff --git a/src/main/startup/agent-hooks-uninstall-preflight.ts b/src/main/startup/uninstall/agent-hooks-uninstall-preflight.ts similarity index 84% rename from src/main/startup/agent-hooks-uninstall-preflight.ts rename to src/main/startup/uninstall/agent-hooks-uninstall-preflight.ts index 7d9ea337188..8ad2fe9a29f 100644 --- a/src/main/startup/agent-hooks-uninstall-preflight.ts +++ b/src/main/startup/uninstall/agent-hooks-uninstall-preflight.ts @@ -1,8 +1,8 @@ import { app } from 'electron' -import type { AgentHookInstallStatus } from '../../shared/agent-hook-listener/configuration/agent-hook-types' -import { setAppEnvironment } from '../../shared/app-environment' -import { ElectronAppEnvironment } from '../host/electron-app-environment' -import { ensureWindowsAppDataPath } from './windows-app-data-path' +import type { AgentHookInstallStatus } from '../../../shared/agent-hook-listener/configuration/agent-hook-types' +import { setAppEnvironment } from '../../../shared/app-environment' +import { ElectronAppEnvironment } from '../../host/electron-app-environment' +import { ensureWindowsAppDataPath } from '../windows-startup/windows-app-data-path' /** The NSIS uninstaller's flag (config/nsis/orca-installer-hooks.nsh); keep the two in sync. */ export const AGENT_HOOKS_UNINSTALL_FLAG = '--orca-uninstall-remove-agent-hooks' @@ -55,7 +55,7 @@ export function runAgentHooksUninstallPreflight(argv: readonly string[] = proces // Loaded only here, so ordinary startup never pays for every agent's hook module. void removeAgentHooksForUninstall(async () => { const { removeManagedAgentHooks } = - await import('../agent-hooks/installation/managed-agent-hook-controls') + await import('../../agent-hooks/installation/managed-agent-hook-controls') return removeManagedAgentHooks() }).then((code) => { clearTimeout(timeout) diff --git a/src/main/startup/wsl-holder-uninstall-preflight.test.ts b/src/main/startup/uninstall/wsl-holder-uninstall-preflight.test.ts similarity index 77% rename from src/main/startup/wsl-holder-uninstall-preflight.test.ts rename to src/main/startup/uninstall/wsl-holder-uninstall-preflight.test.ts index f3ab7fe6f26..4e38e7f4359 100644 --- a/src/main/startup/wsl-holder-uninstall-preflight.test.ts +++ b/src/main/startup/uninstall/wsl-holder-uninstall-preflight.test.ts @@ -8,22 +8,21 @@ const { exit, stopServers, releaseAll } = vi.hoisted(() => ({ vi.mock('electron', () => ({ app: { exit, getPath: () => 'C:\\Users\\u\\AppData\\Roaming\\orca' } })) -vi.mock('./windows-app-data-path', () => ({ ensureWindowsAppDataPath: vi.fn() })) -vi.mock('../wsl/discovery/wsl-distro-holder', () => ({ +vi.mock('../windows-startup/windows-app-data-path', () => ({ ensureWindowsAppDataPath: vi.fn() })) +vi.mock('../../wsl/discovery/wsl-distro-holder', () => ({ createWslDistroHolder: () => ({ releaseAll }) })) -vi.mock('../wsl/host-lifecycle/wsl-host-uninstall-server-stop', () => ({ +vi.mock('../../wsl/host-lifecycle/wsl-host-uninstall-server-stop', () => ({ stopWslHostServersForUninstall: stopServers, wslHostUninstallStopDependencies: () => ({ distros: () => [], listRunning: async () => [] }) })) -import type { WslDistroHolder } from '../wsl/discovery/wsl-distro-holder-types' -import type { WslHostUninstallStopDependencies } from '../wsl/host-lifecycle/wsl-host-uninstall-server-stop' +import type { WslDistroHolder } from '../../wsl/discovery/wsl-distro-holder-types' +import type { WslHostUninstallStopDependencies } from '../../wsl/host-lifecycle/wsl-host-uninstall-server-stop' import { releaseWslHoldersForUninstall, runWslHolderUninstallPreflight, - WSL_HOLDER_UNINSTALL_FLAG, - WSL_SERVER_UNINSTALL_FLAG + WSL_HOLDER_UNINSTALL_FLAG } from './wsl-holder-uninstall-preflight' function holderReleasing(states: { distro: string; state: string }[]): WslDistroHolder { @@ -83,15 +82,4 @@ describe('runWslHolderUninstallPreflight', () => { expect(stopServers).not.toHaveBeenCalled() }) - - it('stops the servers when the uninstaller adds the server flag', async () => { - runWslHolderUninstallPreflight([ - 'Orca.exe', - WSL_HOLDER_UNINSTALL_FLAG, - WSL_SERVER_UNINSTALL_FLAG - ]) - await vi.waitFor(() => expect(exit).toHaveBeenCalledWith(0)) - - expect(stopServers).toHaveBeenCalledTimes(1) - }) }) diff --git a/src/main/startup/wsl-holder-uninstall-preflight.ts b/src/main/startup/uninstall/wsl-holder-uninstall-preflight.ts similarity index 90% rename from src/main/startup/wsl-holder-uninstall-preflight.ts rename to src/main/startup/uninstall/wsl-holder-uninstall-preflight.ts index e924122d786..0d71ed1a983 100644 --- a/src/main/startup/wsl-holder-uninstall-preflight.ts +++ b/src/main/startup/uninstall/wsl-holder-uninstall-preflight.ts @@ -1,12 +1,12 @@ import { app } from 'electron' -import { createWslDistroHolder } from '../wsl/discovery/wsl-distro-holder' -import type { WslDistroHolder } from '../wsl/discovery/wsl-distro-holder-types' -import { ensureWindowsAppDataPath } from './windows-app-data-path' +import { createWslDistroHolder } from '../../wsl/discovery/wsl-distro-holder' +import type { WslDistroHolder } from '../../wsl/discovery/wsl-distro-holder-types' +import { ensureWindowsAppDataPath } from '../windows-startup/windows-app-data-path' import { stopWslHostServersForUninstall, wslHostUninstallStopDependencies, type WslHostUninstallStopDependencies -} from '../wsl/host-lifecycle/wsl-host-uninstall-server-stop' +} from '../../wsl/host-lifecycle/wsl-host-uninstall-server-stop' /** The NSIS uninstaller's flag (config/nsis/orca-installer-hooks.nsh); keep the two in sync. */ export const WSL_HOLDER_UNINSTALL_FLAG = '--orca-uninstall-release-wsl-holders' diff --git a/src/main/startup/windows-install-dir-acl-recovery.test.ts b/src/main/startup/windows-install-dir-acl-recovery.test.ts deleted file mode 100644 index 3cd0c8ce706..00000000000 --- a/src/main/startup/windows-install-dir-acl-recovery.test.ts +++ /dev/null @@ -1,870 +0,0 @@ -import { mkdtempSync, writeFileSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { resetWindowsSecurityLoadForTests } from '../../shared/windows-security-addon' - -import type { CrashReportBreadcrumbData } from '../../shared/crash-reporting' -import { readActiveGpuFallbackMarker, writeGpuFallbackMarker } from './gpu-fallback-marker' -import { - probeWindowsInstallDirAcl, - resetWindowsInstallDirAclProbeForTest -} from './windows-install-dir-acl-probe' -import { - hasInstallDirAclPoisonMarker, - writeInstallDirAclPoisonMarker -} from './windows-install-dir-acl-poison-marker' -import { - describeInstallDirAclPoison, - isBlockingInstallDirAclRepairInFlight, - isInstallDirAclRepairExhausted, - isInstallDirAclSuspect, - noteWindowsInstallDirAclProbePending, - repairKnownPoisonedInstallDirBeforeWindow, - resetWindowsInstallDirAclRecoveryForTest, - startWindowsInstallDirAclRepairIfPoisoned, - type WindowsInstallDirAclRecoveryOptions -} from './windows-install-dir-acl-recovery' -import { - resetWindowsInstallDirAclRepairForTest, - WINDOWS_INSTALL_DIR_ACL_REPAIR_MARKER_FILE, - WINDOWS_INSTALL_DIR_ACL_REPAIR_SCHEME_VERSION -} from './windows-install-dir-package-acl-repair' -import type { InstallDirPackageGrantOutcome } from './windows-install-dir-package-acl-grant' -import { - ALL_PACKAGES_ACE, - grantsFrom, - installFakeDacls, - ORPHAN_PACKAGE_ACE, - RESTRICTED_PACKAGES_ACE, - type InstallDirPackageGrant, - type InstallDirPackageGrantPass -} from './windows-install-dir-acl.test-fixture' - -const INSTALL_DIR = 'C:\\Users\\neil\\AppData\\Local\\Programs\\orca' -const APP_VERSION = '1.4.184' - -type Runner = InstallDirPackageGrant - -const OK: InstallDirPackageGrantOutcome = { ok: true, failedFileCount: 0 } -const DENIED: InstallDirPackageGrantOutcome = { - ok: false, - failedFileCount: 1, - reason: 'Access is denied.' -} - -/** Keep probe-to-gate decisions real; fake only DACL reads and grants. */ -function probeThenRecover( - savedAces: (target: string) => string[], - options: { failRepair?: boolean } = {} -): Promise { - const specs: InstallDirPackageGrantPass[] = [] - const grantFn: Runner = async (_installDir, pass) => { - specs.push(pass) - return options.failRepair === true ? DENIED : OK - } - installFakeDacls(savedAces) - return new Promise((resolve) => { - probeWindowsInstallDirAcl({ - platform: 'win32', - installDir: INSTALL_DIR, - fileExists: (path) => path.endsWith('ffmpeg.dll'), - recordBreadcrumb: () => undefined, - onDone: (data) => { - startWindowsInstallDirAclRepairIfPoisoned(data, { - platform: 'win32', - installDir: INSTALL_DIR, - appVersion: APP_VERSION, - userDataPath: mkdtempSync(join(tmpdir(), 'orca-acl-recovery-')), - grants: grantsFrom(grantFn), - recordBreadcrumb: () => undefined - }) - // Wait past the repair's deferred grant hop before asserting. - setTimeout(() => resolve(specs), 25) - } - }) - }) -} - -describe('startWindowsInstallDirAclRepairIfPoisoned', () => { - beforeEach(() => { - resetWindowsInstallDirAclProbeForTest() - resetWindowsInstallDirAclRepairForTest() - resetWindowsInstallDirAclRecoveryForTest() - }) - - it('repairs when the probe sees an orphan package ACE and no well-known grant', async () => { - const specs = await probeThenRecover(() => [ORPHAN_PACKAGE_ACE]) - expect(specs).toEqual(['root', 'tree']) - }) - - // ALL APPLICATION PACKAGES launched clean with an orphan on Windows 10.0.26200/Electron 43.4.1; require no repair or accusation. - it('leaves an install whose package grant is ALL APPLICATION PACKAGES alone', async () => { - const specs = await probeThenRecover(() => [ORPHAN_PACKAGE_ACE, ALL_PACKAGES_ACE]) - expect(specs).toHaveLength(0) - expect(describeInstallDirAclPoison()).toBeNull() - }) - - it('does not touch an install that already carries the restricted grant', async () => { - const specs = await probeThenRecover(() => [ORPHAN_PACKAGE_ACE, RESTRICTED_PACKAGES_ACE]) - expect(specs).toHaveLength(0) - expect(describeInstallDirAclPoison()).toBeNull() - }) - - it('does not act when the probe could not read the DACL', async () => { - installFakeDacls(() => null) - const specs = await new Promise((resolve) => { - const collected: InstallDirPackageGrantPass[] = [] - probeWindowsInstallDirAcl({ - platform: 'win32', - installDir: INSTALL_DIR, - fileExists: () => false, - recordBreadcrumb: () => undefined, - onDone: (data) => { - startWindowsInstallDirAclRepairIfPoisoned(data, { - platform: 'win32', - installDir: INSTALL_DIR, - appVersion: APP_VERSION, - userDataPath: mkdtempSync(join(tmpdir(), 'orca-acl-recovery-')), - grants: grantsFrom(async (_installDir, pass) => { - collected.push(pass) - throw new Error('unreachable') - }), - recordBreadcrumb: () => undefined - }) - setTimeout(() => resolve(collected), 25) - } - }) - }) - expect(specs).toHaveLength(0) - expect(describeInstallDirAclPoison()).toBeNull() - }) -}) - -describe('describeInstallDirAclPoison', () => { - beforeEach(() => { - resetWindowsInstallDirAclProbeForTest() - resetWindowsInstallDirAclRepairForTest() - resetWindowsInstallDirAclRecoveryForTest() - }) - - it('walks a standard user through icacls when the repair could not write', async () => { - await probeThenRecover(() => [ORPHAN_PACKAGE_ACE], { - failRepair: true - }) - const failed = describeInstallDirAclPoison() - expect(failed?.detail).toContain('needs an administrator') - expect(failed?.detail).toContain(`icacls "${INSTALL_DIR}" /grant "*S-1-15-2-2:(RX)" /T /C`) - }) - - it('reports the repair as in flight before the grant has answered', () => { - startWindowsInstallDirAclRepairIfPoisoned( - { status: 'ok', matchesPoisonSignature: true }, - { - platform: 'win32', - installDir: INSTALL_DIR, - appVersion: APP_VERSION, - userDataPath: mkdtempSync(join(tmpdir(), 'orca-acl-recovery-')), - grants: grantsFrom(() => new Promise(() => undefined)), - recordBreadcrumb: () => undefined - } - ) - expect(describeInstallDirAclPoison()?.detail).toContain('repairing the permissions now') - }) -}) - -const POISON_VERDICT: CrashReportBreadcrumbData = { - status: 'ok', - matchesPoisonSignature: true -} -const GPU_ENV = { appVersion: APP_VERSION, electronVersion: '43.4.1', platform: 'win32' } as const - -function recoveryOptions(userDataPath: string, run: Runner): WindowsInstallDirAclRecoveryOptions { - return { - platform: 'win32', - installDir: INSTALL_DIR, - appVersion: APP_VERSION, - userDataPath, - grants: grantsFrom(run), - recordBreadcrumb: () => undefined - } -} - -const okRun: Runner = async () => OK - -describe('install-dir ACL repair vs the GPU safe-graphics marker', () => { - beforeEach(() => { - resetWindowsInstallDirAclProbeForTest() - resetWindowsInstallDirAclRepairForTest() - resetWindowsInstallDirAclRecoveryForTest() - }) - - it('clears the sticky safe-graphics marker once the real cause is repaired', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-gpu-')) - // Model poisoned-DACL GPU deaths that engaged the build's safe-graphics latch. - writeGpuFallbackMarker( - userDataPath, - { engagedAt: Date.now(), crashesInWindow: 3, userConfirmed: false }, - GPU_ENV - ) - expect(readActiveGpuFallbackMarker(userDataPath, GPU_ENV)).not.toBeNull() - - await new Promise((resolve) => { - startWindowsInstallDirAclRepairIfPoisoned(POISON_VERDICT, { - ...recoveryOptions(userDataPath, okRun), - // Wait for both deferred grant passes. - recordBreadcrumb: () => { - setTimeout(resolve, 0) - return undefined - } - }) - }) - - expect(describeInstallDirAclPoison()?.detail).toContain('repaired the permissions') - // Successful ACL repair must retire unconfirmed safe graphics, which hides future sibling-death evidence. - expect(readActiveGpuFallbackMarker(userDataPath, GPU_ENV)).toBeNull() - }) - - // Preserve user-confirmed safe graphics; only Orca's automatic latch may be retired. - it('leaves a user-confirmed safe-graphics marker alone', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-gpu-')) - writeGpuFallbackMarker( - userDataPath, - { engagedAt: Date.now(), crashesInWindow: 3, userConfirmed: true }, - GPU_ENV - ) - - await new Promise((resolve) => { - startWindowsInstallDirAclRepairIfPoisoned(POISON_VERDICT, { - ...recoveryOptions(userDataPath, okRun), - recordBreadcrumb: () => { - setTimeout(resolve, 0) - return undefined - } - }) - }) - - expect(describeInstallDirAclPoison()?.detail).toContain('repaired the permissions') - expect(readActiveGpuFallbackMarker(userDataPath, GPU_ENV)?.userConfirmed).toBe(true) - }) -}) - -describe('isInstallDirAclSuspect', () => { - beforeEach(() => { - resetWindowsInstallDirAclProbeForTest() - resetWindowsInstallDirAclRepairForTest() - resetWindowsInstallDirAclRecoveryForTest() - }) - - // GPU deaths can precede the probe by seconds; pending verdict is the misdiagnosis window. - it('holds while the probe verdict is outstanding, and releases on a clean verdict', () => { - noteWindowsInstallDirAclProbePending() - expect(isInstallDirAclSuspect()).toBe(true) - - startWindowsInstallDirAclRepairIfPoisoned( - { status: 'ok', matchesPoisonSignature: false }, - recoveryOptions(mkdtempSync(join(tmpdir(), 'orca-acl-suspect-')), okRun) - ) - expect(isInstallDirAclSuspect()).toBe(false) - }) - - it('releases once the wait exceeds the grace window, so a silent probe cannot pin it', () => { - noteWindowsInstallDirAclProbePending() - expect(isInstallDirAclSuspect(Date.now() + 14_000)).toBe(true) - expect(isInstallDirAclSuspect(Date.now() + 16_000)).toBe(false) - }) - - it('holds through a repair that failed, and releases once one succeeds', async () => { - const failing: Runner = async () => DENIED - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-suspect-')) - startWindowsInstallDirAclRepairIfPoisoned( - POISON_VERDICT, - recoveryOptions(userDataPath, failing) - ) - expect(isInstallDirAclSuspect()).toBe(true) - await vi.waitFor(() => expect(describeInstallDirAclPoison()?.detail).toContain('could not')) - expect(isInstallDirAclSuspect()).toBe(true) - - resetWindowsInstallDirAclRecoveryForTest() - resetWindowsInstallDirAclRepairForTest() - startWindowsInstallDirAclRepairIfPoisoned( - POISON_VERDICT, - recoveryOptions(mkdtempSync(join(tmpdir(), 'orca-acl-suspect-')), okRun) - ) - await vi.waitFor(() => expect(isInstallDirAclSuspect()).toBe(false)) - }) -}) - -describe('repairKnownPoisonedInstallDirBeforeWindow', () => { - beforeEach(() => { - resetWindowsInstallDirAclProbeForTest() - resetWindowsInstallDirAclRepairForTest() - resetWindowsInstallDirAclRecoveryForTest() - }) - - it('costs a healthy machine one absent-file read and no grant', async () => { - const specs: InstallDirPackageGrantPass[] = [] - const run: Runner = async (_installDir, pass) => { - specs.push(pass) - return OK - } - const mode = await repairKnownPoisonedInstallDirBeforeWindow( - recoveryOptions(mkdtempSync(join(tmpdir(), 'orca-acl-gate-')), run) - ) - expect(mode).toBe('not-marked') - expect(specs).toHaveLength(0) - }) - - // Persisted poison must repair before launch-two window creation; launch one's deferred probe was too late. - it('repairs a launch that a previous one recorded as poisoned, before returning', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-gate-')) - // First launch dies after recording poison but before repair completes. - startWindowsInstallDirAclRepairIfPoisoned( - POISON_VERDICT, - recoveryOptions(userDataPath, () => new Promise(() => undefined)) - ) - expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) - - resetWindowsInstallDirAclRecoveryForTest() - resetWindowsInstallDirAclRepairForTest() - writeGpuFallbackMarker( - userDataPath, - { engagedAt: Date.now(), crashesInWindow: 3, userConfirmed: false }, - GPU_ENV - ) - const specs: InstallDirPackageGrantPass[] = [] - const run: Runner = async (_installDir, pass) => { - specs.push(pass) - return OK - } - const mode = await repairKnownPoisonedInstallDirBeforeWindow(recoveryOptions(userDataPath, run)) - expect(mode).toBe('repaired') - expect(specs).toEqual(['root', 'tree']) - expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(false) - expect(readActiveGpuFallbackMarker(userDataPath, GPU_ENV)).toBeNull() - }) - - it('gives up on its budget rather than holding the window open forever', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-gate-')) - startWindowsInstallDirAclRepairIfPoisoned( - POISON_VERDICT, - recoveryOptions(userDataPath, () => new Promise(() => undefined)) - ) - resetWindowsInstallDirAclRecoveryForTest() - resetWindowsInstallDirAclRepairForTest() - - const mode = await repairKnownPoisonedInstallDirBeforeWindow({ - ...recoveryOptions(userDataPath, () => new Promise(() => undefined)), - timeoutMs: 20 - }) - expect(mode).toBe('timeout') - }) - - it('is a no-op off win32 and in serve mode', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-gate-')) - startWindowsInstallDirAclRepairIfPoisoned( - POISON_VERDICT, - recoveryOptions(userDataPath, () => new Promise(() => undefined)) - ) - resetWindowsInstallDirAclRecoveryForTest() - resetWindowsInstallDirAclRepairForTest() - - expect( - await repairKnownPoisonedInstallDirBeforeWindow({ - ...recoveryOptions(userDataPath, okRun), - platform: 'darwin' - }) - ).toBe('skipped') - expect( - await repairKnownPoisonedInstallDirBeforeWindow({ - ...recoveryOptions(userDataPath, okRun), - isServeMode: true - }) - ).toBe('skipped') - }) - - it('retires the marker when a later probe reports the install clean', () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-gate-')) - startWindowsInstallDirAclRepairIfPoisoned( - POISON_VERDICT, - recoveryOptions(userDataPath, () => new Promise(() => undefined)) - ) - expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) - - resetWindowsInstallDirAclRecoveryForTest() - startWindowsInstallDirAclRepairIfPoisoned( - { status: 'ok', matchesPoisonSignature: false }, - recoveryOptions(userDataPath, okRun) - ) - expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(false) - }) - - // Unreadable DACL cannot retire poison evidence or the next launch repeats a known crash. - it('keeps the marker when the probe could not read the DACL', () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-gate-')) - startWindowsInstallDirAclRepairIfPoisoned( - POISON_VERDICT, - recoveryOptions(userDataPath, () => new Promise(() => undefined)) - ) - resetWindowsInstallDirAclRecoveryForTest() - startWindowsInstallDirAclRepairIfPoisoned( - { status: 'failed', reason: 'all-targets-unreadable' }, - recoveryOptions(userDataPath, okRun) - ) - expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) - }) - - // A 20s gate can time out before its 120s grant. Later poison readings outrank that grant's success claim or it falsely disarms recovery and enables in-process GPU. - it('does not let a timed-out gate repair outrank a poison reading taken after it', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-gate-timeout-')) - writeInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION) - writeGpuFallbackMarker( - userDataPath, - { engagedAt: Date.now(), crashesInWindow: 3, userConfirmed: false }, - GPU_ENV - ) - - let releaseIcacls: () => void = () => undefined - const stalled = new Promise((resolve) => { - releaseIcacls = resolve - }) - let repairReported: () => void = () => undefined - const reported = new Promise((resolve) => { - repairReported = resolve - }) - - const mode = await repairKnownPoisonedInstallDirBeforeWindow({ - ...recoveryOptions(userDataPath, async () => { - await stalled - return OK - }), - recordBreadcrumb: () => { - setTimeout(repairReported, 0) - return undefined - }, - timeoutMs: 20 - }) - expect(mode).toBe('timeout') - - // Probe after window creation supplies newer poison evidence than the still-running grant. - startWindowsInstallDirAclRepairIfPoisoned(POISON_VERDICT, recoveryOptions(userDataPath, okRun)) - expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) - - releaseIcacls() - await reported - - expect(isInstallDirAclSuspect()).toBe(true) - expect(describeInstallDirAclPoison()?.detail).toContain('could not repair them') - expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) - expect(readActiveGpuFallbackMarker(userDataPath, GPU_ENV)).not.toBeNull() - }) - - // Reverse ordering: a later poison reading must restore safe graphics already cleared by the grant's disproved success claim. - it('restores the safe-graphics marker when the probe disproves a timed-out gate repair', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-gate-timeout-restore-')) - writeInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION) - writeGpuFallbackMarker( - userDataPath, - { engagedAt: Date.now(), crashesInWindow: 3, userConfirmed: false }, - GPU_ENV - ) - - let releaseIcacls: () => void = () => undefined - const stalled = new Promise((resolve) => { - releaseIcacls = resolve - }) - let repairReported: () => void = () => undefined - const reported = new Promise((resolve) => { - repairReported = resolve - }) - - const mode = await repairKnownPoisonedInstallDirBeforeWindow({ - ...recoveryOptions(userDataPath, async () => { - await stalled - return OK - }), - recordBreadcrumb: () => { - setTimeout(repairReported, 0) - return undefined - }, - timeoutMs: 20 - }) - expect(mode).toBe('timeout') - - releaseIcacls() - await reported - expect(readActiveGpuFallbackMarker(userDataPath, GPU_ENV)).toBeNull() - - startWindowsInstallDirAclRepairIfPoisoned(POISON_VERDICT, recoveryOptions(userDataPath, okRun)) - - expect(readActiveGpuFallbackMarker(userDataPath, GPU_ENV)?.userConfirmed).toBe(false) - expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) - expect(isInstallDirAclSuspect()).toBe(true) - }) -}) - -// With outstanding poison evidence, a completed-repair marker proves no current health; marker-hit means spent budget only. -describe('a repair marker recording a completed repair', () => { - beforeEach(() => { - resetWindowsInstallDirAclProbeForTest() - resetWindowsInstallDirAclRepairForTest() - resetWindowsInstallDirAclRecoveryForTest() - }) - - /** Reset process latches between launches while retaining persisted evidence. */ - async function gateLaunch( - userDataPath: string, - run: Runner - ): Promise>> { - resetWindowsInstallDirAclProbeForTest() - resetWindowsInstallDirAclRepairForTest() - resetWindowsInstallDirAclRecoveryForTest() - return repairKnownPoisonedInstallDirBeforeWindow(recoveryOptions(userDataPath, run)) - } - - // Three-launch regression: old successful repair, re-poisoning/crash mid-repair, then poison plus stale-success markers. The third gate must grant again within budget. - it('re-runs the grant when a poison marker outlives it', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-repaired-hit-')) - - // First launch repairs and retires poison. - writeInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION) - expect(await gateLaunch(userDataPath, okRun)).toBe('repaired') - expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(false) - - // Second launch dies mid-repair after recording new poison; the old success marker remains. - resetWindowsInstallDirAclRecoveryForTest() - resetWindowsInstallDirAclRepairForTest() - startWindowsInstallDirAclRepairIfPoisoned( - POISON_VERDICT, - recoveryOptions(userDataPath, () => new Promise(() => undefined)) - ) - expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) - - // Third launch must repair rather than trust first-launch success. - const spent: InstallDirPackageGrantPass[] = [] - const mode = await gateLaunch(userDataPath, async (_installDir, pass) => { - spent.push(pass) - return DENIED - }) - expect(mode).toBe('failed') - expect(spent).toEqual(['root', 'tree']) - expect(isInstallDirAclSuspect()).toBe(true) - expect(describeInstallDirAclPoison()?.detail).toContain('could not repair them') - expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) - }) - - // Spent budget must report unrepaired, without falsely clearing poison. - it('does not let the gate report a spent budget as a repair', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-gate-budget-')) - writeFileSync( - join(userDataPath, WINDOWS_INSTALL_DIR_ACL_REPAIR_MARKER_FILE), - JSON.stringify({ - schemeVersion: WINDOWS_INSTALL_DIR_ACL_REPAIR_SCHEME_VERSION, - installDir: INSTALL_DIR, - appVersion: APP_VERSION, - attemptedAt: Date.now(), - outcome: 'repaired', - attempts: 3 - }) - ) - writeInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION) - const spent: InstallDirPackageGrantPass[] = [] - const mode = await gateLaunch(userDataPath, async (_installDir, pass) => { - spent.push(pass) - return OK - }) - expect(mode).toBe('marker-hit') - expect(spent).toHaveLength(0) - expect(isInstallDirAclSuspect()).toBe(true) - expect(isInstallDirAclRepairExhausted()).toBe(true) - expect(describeInstallDirAclPoison()?.detail).toContain('could not repair them') - expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) - }) - - // A later probe reading outranks gate success if the tree still matches poison. - it('is overruled by a probe that reads the tree poisoned after the gate repaired it', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-noop-grant-')) - writeInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION) - expect( - await repairKnownPoisonedInstallDirBeforeWindow(recoveryOptions(userDataPath, okRun)) - ).toBe('repaired') - - startWindowsInstallDirAclRepairIfPoisoned(POISON_VERDICT, recoveryOptions(userDataPath, okRun)) - - expect(isInstallDirAclSuspect()).toBe(true) - expect(isInstallDirAclRepairExhausted()).toBe(false) - expect(describeInstallDirAclPoison()?.detail).toContain('could not repair them') - expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) - }) - - // Gate success is provisional until probe/grace expiry: child deaths can precede the probe, and early in-process GPU would hide evidence. - it('keeps a gate-repaired tree suspect until this launch probe has read it', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-provisional-')) - writeInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION) - expect( - await repairKnownPoisonedInstallDirBeforeWindow(recoveryOptions(userDataPath, okRun)) - ).toBe('repaired') - - // Model window creation dispatching a still-pending probe. - noteWindowsInstallDirAclProbePending() - expect(isInstallDirAclSuspect()).toBe(true) - // Probe timeout bounds suspicion when no reading arrives. - expect(isInstallDirAclSuspect(Date.now() + 15_000)).toBe(false) - - // A clean reading corroborates repair and releases immediately. - startWindowsInstallDirAclRepairIfPoisoned( - { status: 'ok', matchesPoisonSignature: false }, - recoveryOptions(userDataPath, okRun) - ) - expect(isInstallDirAclSuspect()).toBe(false) - }) - - // Disproved repair must restore cleared safe graphics or hardware relaunch can abort before the re-armed gate repairs. - it('restores the safe-graphics marker a disproved repair claim cleared', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-gpu-restore-')) - writeInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION) - writeGpuFallbackMarker( - userDataPath, - { engagedAt: Date.now(), crashesInWindow: 3, userConfirmed: false }, - GPU_ENV - ) - expect( - await repairKnownPoisonedInstallDirBeforeWindow(recoveryOptions(userDataPath, okRun)) - ).toBe('repaired') - expect(readActiveGpuFallbackMarker(userDataPath, GPU_ENV)).toBeNull() - - startWindowsInstallDirAclRepairIfPoisoned(POISON_VERDICT, recoveryOptions(userDataPath, okRun)) - - expect(readActiveGpuFallbackMarker(userDataPath, GPU_ENV)?.userConfirmed).toBe(false) - expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) - }) - - // Fresh poison evidence contradicts prior success; rerun within budget rather than disarm the gate or claim repaired permissions. - it('re-runs the grant when a fresh probe verdict contradicts the repaired marker', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-repoisoned-')) - writeInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION) - expect( - await repairKnownPoisonedInstallDirBeforeWindow(recoveryOptions(userDataPath, okRun)) - ).toBe('repaired') - - // Next launch re-probes poison after the old repair disarmed the gate. - resetWindowsInstallDirAclRecoveryForTest() - resetWindowsInstallDirAclRepairForTest() - const spent: InstallDirPackageGrantPass[] = [] - const failing: Runner = async (_installDir, pass) => { - spent.push(pass) - return DENIED - } - await new Promise((resolve) => { - startWindowsInstallDirAclRepairIfPoisoned(POISON_VERDICT, { - ...recoveryOptions(userDataPath, failing), - recordBreadcrumb: () => { - setTimeout(resolve, 0) - return undefined - } - }) - }) - - expect(spent).toEqual(['root', 'tree']) - expect(isInstallDirAclSuspect()).toBe(true) - expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) - expect(describeInstallDirAclPoison()?.detail).toContain('could not repair them') - }) - - // New poison evidence cannot remove the attempt cap or every launch would re-walk permanently broken trees. - it('still stops at the attempt budget when the probe keeps reporting poison', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-repoisoned-budget-')) - writeFileSync( - join(userDataPath, WINDOWS_INSTALL_DIR_ACL_REPAIR_MARKER_FILE), - JSON.stringify({ - schemeVersion: WINDOWS_INSTALL_DIR_ACL_REPAIR_SCHEME_VERSION, - installDir: INSTALL_DIR, - appVersion: APP_VERSION, - attemptedAt: Date.now(), - outcome: 'repaired', - attempts: 3 - }) - ) - const spent: InstallDirPackageGrantPass[] = [] - const run: Runner = async (_installDir, pass) => { - spent.push(pass) - return OK - } - await new Promise((resolve) => { - startWindowsInstallDirAclRepairIfPoisoned(POISON_VERDICT, { - ...recoveryOptions(userDataPath, run), - recordBreadcrumb: () => { - setTimeout(resolve, 0) - return undefined - } - }) - }) - - expect(spent).toHaveLength(0) - // Unrepaired trees retain commands and next-launch gating. - expect(isInstallDirAclSuspect()).toBe(true) - expect(describeInstallDirAclPoison()?.detail).toContain('could not repair them') - expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) - }) -}) - -describe('a clean probe verdict', () => { - beforeEach(() => { - resetWindowsInstallDirAclProbeForTest() - resetWindowsInstallDirAclRepairForTest() - resetWindowsInstallDirAclRecoveryForTest() - }) - - // A clean probe retires suspicion even after the gate exhausted its repair budget. - it('retires a verdict the gate could no longer act on', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-clean-')) - writeFileSync( - join(userDataPath, WINDOWS_INSTALL_DIR_ACL_REPAIR_MARKER_FILE), - JSON.stringify({ - schemeVersion: WINDOWS_INSTALL_DIR_ACL_REPAIR_SCHEME_VERSION, - installDir: INSTALL_DIR, - appVersion: APP_VERSION, - attemptedAt: Date.now(), - outcome: 'failed', - attempts: 3 - }) - ) - startWindowsInstallDirAclRepairIfPoisoned( - POISON_VERDICT, - recoveryOptions(userDataPath, () => new Promise(() => undefined)) - ) - resetWindowsInstallDirAclRecoveryForTest() - resetWindowsInstallDirAclRepairForTest() - expect( - await repairKnownPoisonedInstallDirBeforeWindow(recoveryOptions(userDataPath, okRun)) - ).toBe('marker-hit') - expect(isInstallDirAclSuspect()).toBe(true) - - startWindowsInstallDirAclRepairIfPoisoned( - { status: 'ok', matchesPoisonSignature: false }, - recoveryOptions(userDataPath, okRun) - ) - expect(isInstallDirAclSuspect()).toBe(false) - expect(describeInstallDirAclPoison()).toBeNull() - }) - - // A clean reading outranks a later failed repair result about a tree with nothing left to fix. - it('outranks a repair verdict that lands after it', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-clean-')) - const failing: Runner = async () => DENIED - let repairSettled = false - startWindowsInstallDirAclRepairIfPoisoned(POISON_VERDICT, { - ...recoveryOptions(userDataPath, failing), - recordBreadcrumb: () => { - repairSettled = true - return undefined - } - }) - startWindowsInstallDirAclRepairIfPoisoned( - { status: 'ok', matchesPoisonSignature: false }, - recoveryOptions(userDataPath, okRun) - ) - await vi.waitFor(() => expect(repairSettled).toBe(true)) - expect(isInstallDirAclSuspect()).toBe(false) - expect(describeInstallDirAclPoison()).toBeNull() - }) -}) - -describe('the probe-pending grace window', () => { - beforeEach(() => { - resetWindowsInstallDirAclProbeForTest() - resetWindowsInstallDirAclRepairForTest() - resetWindowsInstallDirAclRecoveryForTest() - }) - - // Reopen must not re-arm the once-per-process probe wait and suppress real GPU recovery for another 15s. - it('is armed by a dispatched probe only, so a reopen cannot re-arm it', async () => { - installFakeDacls(() => [RESTRICTED_PACKAGES_ACE]) - const probeArgs = { - platform: 'win32' as const, - installDir: INSTALL_DIR, - fileExists: () => false, - recordBreadcrumb: () => undefined - } - let settleVerdict: () => void = () => undefined - const verdict = new Promise((resolve) => (settleVerdict = resolve)) - // Use the same dispatch-gated arming as window startup. - const dispatched = probeWindowsInstallDirAcl({ - ...probeArgs, - onDone: (data) => { - startWindowsInstallDirAclRepairIfPoisoned( - data, - recoveryOptions(mkdtempSync(join(tmpdir(), 'orca-acl-rearm-')), okRun) - ) - settleVerdict() - } - }) - if (dispatched) { - noteWindowsInstallDirAclProbePending() - } - expect(dispatched).toBe(true) - expect(isInstallDirAclSuspect()).toBe(true) - await verdict - expect(isInstallDirAclSuspect()).toBe(false) - - // Reopen: the probe declines, so nothing arms the grace window again. - const reopened = probeWindowsInstallDirAcl({ ...probeArgs, onDone: () => undefined }) - if (reopened) { - noteWindowsInstallDirAclProbePending() - } - expect(reopened).toBe(false) - expect(isInstallDirAclSuspect()).toBe(false) - expect(isInstallDirAclSuspect(Date.now() + 14_000)).toBe(false) - }) -}) - -describe('isBlockingInstallDirAclRepairInFlight', () => { - beforeEach(() => { - resetWindowsInstallDirAclProbeForTest() - resetWindowsInstallDirAclRepairForTest() - resetWindowsInstallDirAclRecoveryForTest() - }) - - it('is false on a healthy machine and clears once the gate returns', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-inflight-')) - expect(isBlockingInstallDirAclRepairInFlight()).toBe(false) - - startWindowsInstallDirAclRepairIfPoisoned( - POISON_VERDICT, - recoveryOptions(userDataPath, () => new Promise(() => undefined)) - ) - resetWindowsInstallDirAclRecoveryForTest() - resetWindowsInstallDirAclRepairForTest() - - let inFlightDuringRepair = false - const gate = repairKnownPoisonedInstallDirBeforeWindow({ - ...recoveryOptions(userDataPath, async () => { - inFlightDuringRepair = isBlockingInstallDirAclRepairInFlight() - return OK - }), - timeoutMs: 5_000 - }) - expect(await gate).toBe('repaired') - expect(inFlightDuringRepair).toBe(true) - expect(isBlockingInstallDirAclRepairInFlight()).toBe(false) - }) - - // A second entry has no `onDone` coming, so waiting out the 20s budget for it - // would hold the window closed for nothing. - it('returns immediately when the once-per-process repair already ran', async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-inflight-')) - startWindowsInstallDirAclRepairIfPoisoned(POISON_VERDICT, recoveryOptions(userDataPath, okRun)) - resetWindowsInstallDirAclRecoveryForTest() - - const mode = await repairKnownPoisonedInstallDirBeforeWindow({ - ...recoveryOptions(userDataPath, okRun), - timeoutMs: 30_000 - }) - expect(mode).toBe('skipped') - expect(isBlockingInstallDirAclRepairInFlight()).toBe(false) - }) -}) - -afterEach(() => { - resetWindowsSecurityLoadForTests() -}) diff --git a/src/main/startup/windows-install-dir-acl-poison-marker.ts b/src/main/startup/windows-install-permissions/windows-install-dir-acl-poison-marker.ts similarity index 100% rename from src/main/startup/windows-install-dir-acl-poison-marker.ts rename to src/main/startup/windows-install-permissions/windows-install-dir-acl-poison-marker.ts diff --git a/src/main/startup/windows-install-dir-acl-probe.ts b/src/main/startup/windows-install-permissions/windows-install-dir-acl-probe.ts similarity index 93% rename from src/main/startup/windows-install-dir-acl-probe.ts rename to src/main/startup/windows-install-permissions/windows-install-dir-acl-probe.ts index bf1ea6b91de..debdabdf867 100644 --- a/src/main/startup/windows-install-dir-acl-probe.ts +++ b/src/main/startup/windows-install-permissions/windows-install-dir-acl-probe.ts @@ -1,16 +1,15 @@ import { existsSync } from 'node:fs' import { dirname, join } from 'node:path' -import { - sanitizeCrashReportString, - type CrashReportBreadcrumbData -} from '../../shared/crash-reporting' -import { recordDurableCrashBreadcrumb } from '../crash-reporting/breadcrumbs/durable-crash-breadcrumb' -import { loadWindowsSecurity, type WindowsDacl } from '../../shared/windows-security-addon' +import { sanitizeCrashReportString } from '../../../shared/crash-report-redaction' +import type { CrashReportBreadcrumbData } from '../../../shared/crash-reporting' +import { recordDurableCrashBreadcrumb } from '../../crash-reporting/breadcrumbs/durable-crash-breadcrumb' +import { loadWindowsSecurity } from '../../../shared/windows-security-addon' +import type { WindowsDacl } from '@orca/windows-security' import { ACCESS_ALLOWED_ACE_TYPE, ACCESS_DENIED_ACE_TYPE, INHERIT_ONLY_ACE -} from '../../shared/windows-secure-dacl' +} from '../../../shared/windows-secure-dacl' import { RESTRICTED_APP_PACKAGES_SID } from './windows-install-dir-package-acl-grant' /** Read-only evidence for electron/electron#51761: orphan package ACEs without either well-known package grant reproduced child-init 0x80000003. Either grant launched clean on Windows 10.0.26200/Electron 43.4.1; report restricted-grant presence separately. */ diff --git a/src/main/startup/windows-install-permissions/windows-install-dir-acl-recovery.test.ts b/src/main/startup/windows-install-permissions/windows-install-dir-acl-recovery.test.ts new file mode 100644 index 00000000000..6342e219380 --- /dev/null +++ b/src/main/startup/windows-install-permissions/windows-install-dir-acl-recovery.test.ts @@ -0,0 +1,201 @@ +import { mkdtempSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, beforeEach, describe, expect, it } from 'vitest' +import { resetWindowsSecurityLoadForTests } from '../../../shared/windows-security-addon' + +import type { CrashReportBreadcrumbData } from '../../../shared/crash-reporting' +import { + readActiveGpuFallbackMarker, + writeGpuFallbackMarker +} from '../gpu-recovery/gpu-fallback-marker' +import { resetWindowsInstallDirAclProbeForTest } from './windows-install-dir-acl-probe' +import { + hasInstallDirAclPoisonMarker, + writeInstallDirAclPoisonMarker +} from './windows-install-dir-acl-poison-marker' +import { + describeInstallDirAclPoison, + isInstallDirAclSuspect, + repairKnownPoisonedInstallDirBeforeWindow, + resetWindowsInstallDirAclRecoveryForTest, + startWindowsInstallDirAclRepairIfPoisoned, + type WindowsInstallDirAclRecoveryOptions +} from './windows-install-dir-acl-recovery' +import { resetWindowsInstallDirAclRepairForTest } from './windows-install-dir-package-acl-repair' +import type { InstallDirPackageGrantOutcome } from './windows-install-dir-package-acl-grant' +import { + grantsFrom, + type InstallDirPackageGrant, + type InstallDirPackageGrantPass +} from './windows-install-dir-acl.test-fixture' + +const INSTALL_DIR = 'C:\\Users\\neil\\AppData\\Local\\Programs\\orca' +const APP_VERSION = '1.4.184' + +type Runner = InstallDirPackageGrant + +const OK: InstallDirPackageGrantOutcome = { ok: true, failedFileCount: 0 } +const DENIED: InstallDirPackageGrantOutcome = { + ok: false, + failedFileCount: 1, + reason: 'Access is denied.' +} + +const POISON_VERDICT: CrashReportBreadcrumbData = { + status: 'ok', + matchesPoisonSignature: true +} +const GPU_ENV = { appVersion: APP_VERSION, electronVersion: '43.4.1', platform: 'win32' } as const + +function recoveryOptions(userDataPath: string, run: Runner): WindowsInstallDirAclRecoveryOptions { + return { + platform: 'win32', + installDir: INSTALL_DIR, + appVersion: APP_VERSION, + userDataPath, + grants: grantsFrom(run), + recordBreadcrumb: () => undefined + } +} + +const okRun: Runner = async () => OK + +describe('install-dir ACL recovery evidence ordering', () => { + beforeEach(() => { + resetWindowsInstallDirAclProbeForTest() + resetWindowsInstallDirAclRepairForTest() + resetWindowsInstallDirAclRecoveryForTest() + }) + + /** Reset process latches between launches while retaining persisted evidence. */ + async function gateLaunch( + userDataPath: string, + run: Runner + ): Promise>> { + resetWindowsInstallDirAclProbeForTest() + resetWindowsInstallDirAclRepairForTest() + resetWindowsInstallDirAclRecoveryForTest() + return repairKnownPoisonedInstallDirBeforeWindow(recoveryOptions(userDataPath, run)) + } + + it('does not let a timed-out gate repair outrank a poison reading taken after it', async () => { + const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-gate-timeout-')) + writeInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION) + writeGpuFallbackMarker( + userDataPath, + { engagedAt: Date.now(), crashesInWindow: 3, userConfirmed: false }, + GPU_ENV + ) + + let releaseIcacls: () => void = () => undefined + const stalled = new Promise((resolve) => { + releaseIcacls = resolve + }) + let repairReported: () => void = () => undefined + const reported = new Promise((resolve) => { + repairReported = resolve + }) + + const mode = await repairKnownPoisonedInstallDirBeforeWindow({ + ...recoveryOptions(userDataPath, async () => { + await stalled + return OK + }), + recordBreadcrumb: () => { + setTimeout(repairReported, 0) + return undefined + }, + timeoutMs: 20 + }) + expect(mode).toBe('timeout') + + // Probe after window creation supplies newer poison evidence than the still-running grant. + startWindowsInstallDirAclRepairIfPoisoned(POISON_VERDICT, recoveryOptions(userDataPath, okRun)) + expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) + + releaseIcacls() + await reported + + expect(isInstallDirAclSuspect()).toBe(true) + expect(describeInstallDirAclPoison()?.detail).toContain('could not repair them') + expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) + expect(readActiveGpuFallbackMarker(userDataPath, GPU_ENV)).not.toBeNull() + }) + + it('restores the safe-graphics marker when the probe disproves a timed-out gate repair', async () => { + const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-gate-timeout-restore-')) + writeInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION) + writeGpuFallbackMarker( + userDataPath, + { engagedAt: Date.now(), crashesInWindow: 3, userConfirmed: false }, + GPU_ENV + ) + + let releaseIcacls: () => void = () => undefined + const stalled = new Promise((resolve) => { + releaseIcacls = resolve + }) + let repairReported: () => void = () => undefined + const reported = new Promise((resolve) => { + repairReported = resolve + }) + + const mode = await repairKnownPoisonedInstallDirBeforeWindow({ + ...recoveryOptions(userDataPath, async () => { + await stalled + return OK + }), + recordBreadcrumb: () => { + setTimeout(repairReported, 0) + return undefined + }, + timeoutMs: 20 + }) + expect(mode).toBe('timeout') + + releaseIcacls() + await reported + expect(readActiveGpuFallbackMarker(userDataPath, GPU_ENV)).toBeNull() + + startWindowsInstallDirAclRepairIfPoisoned(POISON_VERDICT, recoveryOptions(userDataPath, okRun)) + + expect(readActiveGpuFallbackMarker(userDataPath, GPU_ENV)?.userConfirmed).toBe(false) + expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) + expect(isInstallDirAclSuspect()).toBe(true) + }) + + it('re-runs the grant when a poison marker outlives it', async () => { + const userDataPath = mkdtempSync(join(tmpdir(), 'orca-acl-repaired-hit-')) + + // First launch repairs and retires poison. + writeInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION) + expect(await gateLaunch(userDataPath, okRun)).toBe('repaired') + expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(false) + + // Second launch dies mid-repair after recording new poison; the old success marker remains. + resetWindowsInstallDirAclRecoveryForTest() + resetWindowsInstallDirAclRepairForTest() + startWindowsInstallDirAclRepairIfPoisoned( + POISON_VERDICT, + recoveryOptions(userDataPath, () => new Promise(() => undefined)) + ) + expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) + + // Third launch must repair rather than trust first-launch success. + const spent: InstallDirPackageGrantPass[] = [] + const mode = await gateLaunch(userDataPath, async (_installDir, pass) => { + spent.push(pass) + return DENIED + }) + expect(mode).toBe('failed') + expect(spent).toEqual(['root', 'tree']) + expect(isInstallDirAclSuspect()).toBe(true) + expect(describeInstallDirAclPoison()?.detail).toContain('could not repair them') + expect(hasInstallDirAclPoisonMarker(userDataPath, INSTALL_DIR, APP_VERSION)).toBe(true) + }) +}) + +afterEach(() => { + resetWindowsSecurityLoadForTests() +}) diff --git a/src/main/startup/windows-install-dir-acl-recovery.ts b/src/main/startup/windows-install-permissions/windows-install-dir-acl-recovery.ts similarity index 97% rename from src/main/startup/windows-install-dir-acl-recovery.ts rename to src/main/startup/windows-install-permissions/windows-install-dir-acl-recovery.ts index 5c25087ac77..13a334aaa1a 100644 --- a/src/main/startup/windows-install-dir-acl-recovery.ts +++ b/src/main/startup/windows-install-permissions/windows-install-dir-acl-recovery.ts @@ -1,13 +1,14 @@ +// @protected-copy import { dirname } from 'node:path' -import type { CrashReportBreadcrumbData } from '../../shared/crash-reporting' -import { translateMain } from '../i18n/main-i18n' -import { logStartupMilestone } from './startup-diagnostics' +import type { CrashReportBreadcrumbData } from '../../../shared/crash-reporting' +import { translateMain } from '../../i18n/main-i18n' +import { logStartupMilestone } from '../diagnostics/startup-diagnostics' import { clearGpuFallbackMarker, readGpuFallbackMarker, writeGpuFallbackMarker, type GpuFallbackMarker -} from './gpu-fallback-marker' +} from '../gpu-recovery/gpu-fallback-marker' import { clearInstallDirAclPoisonMarker, hasInstallDirAclPoisonMarker, diff --git a/src/main/startup/windows-install-dir-acl-repair.win32.test.ts b/src/main/startup/windows-install-permissions/windows-install-dir-acl-repair.win32.test.ts similarity index 96% rename from src/main/startup/windows-install-dir-acl-repair.win32.test.ts rename to src/main/startup/windows-install-permissions/windows-install-dir-acl-repair.win32.test.ts index 1e4a572a42a..3e1cc65c824 100644 --- a/src/main/startup/windows-install-dir-acl-repair.win32.test.ts +++ b/src/main/startup/windows-install-permissions/windows-install-dir-acl-repair.win32.test.ts @@ -2,13 +2,13 @@ import { mkdirSync, mkdtempSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import type { CrashReportBreadcrumbData } from '../../shared/crash-reporting' -import { removeTreeSync } from '../../shared/windows-transient-lock-removal' +import type { CrashReportBreadcrumbData } from '../../../shared/crash-reporting' +import { removeTreeSync } from '../../../shared/windows-transient-lock-removal' import { loadWindowsSecurity, WINDOWS_FILE_READ_EXECUTE, type WindowsSecurity -} from '../../shared/windows-security-addon' +} from '../../../shared/windows-security-addon' import { probeWindowsInstallDirAcl, resetWindowsInstallDirAclProbeForTest diff --git a/src/main/startup/windows-install-dir-acl.test-fixture.ts b/src/main/startup/windows-install-permissions/windows-install-dir-acl.test-fixture.ts similarity index 94% rename from src/main/startup/windows-install-dir-acl.test-fixture.ts rename to src/main/startup/windows-install-permissions/windows-install-dir-acl.test-fixture.ts index c49e22868ad..0de350387c4 100644 --- a/src/main/startup/windows-install-dir-acl.test-fixture.ts +++ b/src/main/startup/windows-install-permissions/windows-install-dir-acl.test-fixture.ts @@ -1,8 +1,8 @@ -import { setWindowsSecurityForTests } from '../../shared/windows-security-addon' +import { setWindowsSecurityForTests } from '../../../shared/windows-security-addon' import { createFakeWindowsSecurity, daclFromSddl -} from '../../shared/windows-security-addon.test-fixture' +} from '../../../shared/windows-security-addon.test-fixture' import type { InstallDirPackageGrantOutcome, InstallDirPackageGrants diff --git a/src/main/startup/windows-install-dir-package-acl-grant.test.ts b/src/main/startup/windows-install-permissions/windows-install-dir-package-acl-grant.test.ts similarity index 74% rename from src/main/startup/windows-install-dir-package-acl-grant.test.ts rename to src/main/startup/windows-install-permissions/windows-install-dir-package-acl-grant.test.ts index aaca43a9c24..eb3d4d96ee4 100644 --- a/src/main/startup/windows-install-dir-package-acl-grant.test.ts +++ b/src/main/startup/windows-install-permissions/windows-install-dir-package-acl-grant.test.ts @@ -1,4 +1,4 @@ -import { mkdirSync, mkdtempSync, rmSync, symlinkSync, writeFileSync } from 'node:fs' +import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it } from 'vitest' @@ -7,7 +7,7 @@ import { setWindowsSecurityForTests, type GrantAccessOptions, type WindowsSecurityAddon -} from '../../shared/windows-security-addon' +} from '../../../shared/windows-security-addon' import { grantInstallDirPackageTree } from './windows-install-dir-package-acl-grant' @@ -71,28 +71,6 @@ describe('install-dir package grant passes', () => { rmSync(installDir, { recursive: true, force: true }) }) - it('does not follow a link out of the install tree', async (context) => { - const outside = mkdtempSync(join(tmpdir(), 'orca-acl-grant-outside-')) - writeFileSync(join(outside, 'elsewhere.dll'), 'binary') - try { - symlinkSync(outside, join(installDir, 'linked'), 'junction') - } catch { - rmSync(outside, { recursive: true, force: true }) - context.skip() - return - } - try { - const calls = installFakeAddon() - await grantInstallDirPackageTree(installDir) - const paths = calls.map((call) => call.path) - expect(paths).not.toContain(join(installDir, 'linked')) - expect(paths.some((path) => path.includes('elsewhere.dll'))).toBe(false) - } finally { - rmSync(join(installDir, 'linked'), { force: true }) - rmSync(outside, { recursive: true, force: true }) - } - }) - it('keeps going past failed entries and counts them, like icacls /T /C', async () => { const calls = installFakeAddon((path) => path.endsWith('.dll') || path.endsWith('.node')) const outcome = await grantInstallDirPackageTree(installDir) diff --git a/src/main/startup/windows-install-dir-package-acl-grant.ts b/src/main/startup/windows-install-permissions/windows-install-dir-package-acl-grant.ts similarity index 96% rename from src/main/startup/windows-install-dir-package-acl-grant.ts rename to src/main/startup/windows-install-permissions/windows-install-dir-package-acl-grant.ts index b5937ba7f44..03ece70478a 100644 --- a/src/main/startup/windows-install-dir-package-acl-grant.ts +++ b/src/main/startup/windows-install-permissions/windows-install-dir-package-acl-grant.ts @@ -1,11 +1,11 @@ import { readdirSync, type Dirent } from 'node:fs' import { join } from 'node:path' -import { sanitizeCrashReportString } from '../../shared/crash-reporting' +import { sanitizeCrashReportString } from '../../../shared/crash-report-redaction' import { loadWindowsSecurity, WINDOWS_FILE_READ_EXECUTE, type WindowsSecurity -} from '../../shared/windows-security-addon' +} from '../../../shared/windows-security-addon' /** ALL RESTRICTED APPLICATION PACKAGES: the grant that cleared electron/electron#51761. */ export const RESTRICTED_APP_PACKAGES_SID = 'S-1-15-2-2' diff --git a/src/main/startup/windows-install-dir-package-acl-repair.test.ts b/src/main/startup/windows-install-permissions/windows-install-dir-package-acl-repair.test.ts similarity index 86% rename from src/main/startup/windows-install-dir-package-acl-repair.test.ts rename to src/main/startup/windows-install-permissions/windows-install-dir-package-acl-repair.test.ts index 02db09af01b..5a781ede083 100644 --- a/src/main/startup/windows-install-dir-package-acl-repair.test.ts +++ b/src/main/startup/windows-install-permissions/windows-install-dir-package-acl-repair.test.ts @@ -1,4 +1,4 @@ -import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' +import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' @@ -15,13 +15,11 @@ vi.mock('@orca/process-host', () => ({ runProcessSync: runProcessSyncMock })) -import type { CrashReportBreadcrumbData } from '../../shared/crash-reporting' +import type { CrashReportBreadcrumbData } from '../../../shared/crash-reporting' import { repairWindowsInstallDirPackageAcl, resetWindowsInstallDirAclRepairForTest, WINDOWS_INSTALL_DIR_ACL_REPAIR_BREADCRUMB, - WINDOWS_INSTALL_DIR_ACL_REPAIR_MARKER_FILE, - WINDOWS_INSTALL_DIR_ACL_REPAIR_SCHEME_VERSION, type WindowsInstallDirAclRepairResult } from './windows-install-dir-package-acl-repair' @@ -121,28 +119,6 @@ describe('repairWindowsInstallDirPackageAcl', () => { expect(moved.passes).toHaveLength(2) }) - it('re-runs when the marker is from an older scheme or is corrupt', async () => { - const userDataPath = userDataDir() - const markerFile = join(userDataPath, WINDOWS_INSTALL_DIR_ACL_REPAIR_MARKER_FILE) - writeFileSync( - markerFile, - JSON.stringify({ - schemeVersion: WINDOWS_INSTALL_DIR_ACL_REPAIR_SCHEME_VERSION - 1, - installDir: INSTALL_DIR, - appVersion: APP_VERSION - }) - ) - const stale = fakePackageGrant() - await repair({ userDataPath, grants: stale.grants }) - expect(stale.passes).toHaveLength(2) - - resetWindowsInstallDirAclRepairForTest() - writeFileSync(markerFile, '{ not json') - const corrupt = fakePackageGrant() - await repair({ userDataPath, grants: corrupt.grants }) - expect(corrupt.passes).toHaveLength(2) - }) - it('records the summed failed-entry count when a standard user cannot write the ACL', async () => { const { grants, passes } = fakePackageGrant((pass) => pass === 'tree' diff --git a/src/main/startup/windows-install-dir-package-acl-repair.ts b/src/main/startup/windows-install-permissions/windows-install-dir-package-acl-repair.ts similarity index 96% rename from src/main/startup/windows-install-dir-package-acl-repair.ts rename to src/main/startup/windows-install-permissions/windows-install-dir-package-acl-repair.ts index 970f4923327..8329a51f836 100644 --- a/src/main/startup/windows-install-dir-package-acl-repair.ts +++ b/src/main/startup/windows-install-permissions/windows-install-dir-package-acl-repair.ts @@ -1,10 +1,8 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs' import { dirname, join } from 'node:path' -import { - sanitizeCrashReportString, - type CrashReportBreadcrumbData -} from '../../shared/crash-reporting' -import { recordDurableCrashBreadcrumb } from '../crash-reporting/breadcrumbs/durable-crash-breadcrumb' +import { sanitizeCrashReportString } from '../../../shared/crash-report-redaction' +import type { CrashReportBreadcrumbData } from '../../../shared/crash-reporting' +import { recordDurableCrashBreadcrumb } from '../../crash-reporting/breadcrumbs/durable-crash-breadcrumb' import { installDirPackageGrants, RESTRICTED_APP_PACKAGES_SID, diff --git a/src/main/startup/windows-app-data-path.test.ts b/src/main/startup/windows-startup/windows-app-data-path.test.ts similarity index 91% rename from src/main/startup/windows-app-data-path.test.ts rename to src/main/startup/windows-startup/windows-app-data-path.test.ts index 00cd57ae063..97b86b2ec73 100644 --- a/src/main/startup/windows-app-data-path.test.ts +++ b/src/main/startup/windows-startup/windows-app-data-path.test.ts @@ -2,7 +2,7 @@ import { existsSync, mkdtempSync } from 'node:fs' import { tmpdir } from 'node:os' import { join, win32 } from 'node:path' import { afterEach, describe, expect, it } from 'vitest' -import { removeTreeSync } from '../../shared/windows-transient-lock-removal' +import { removeTreeSync } from '../../../shared/windows-transient-lock-removal' import { deriveWindowsAppDataPath, ensureWindowsAppDataPath, @@ -78,12 +78,6 @@ describe('ensureWindowsAppDataPath', () => { expect(host.paths.get('userData')).toBe('C:\\Users\\me\\AppData\\Roaming\\orca') }) - it('leaves userData to an explicit --user-data-dir switch', () => { - const host = createHost('C:\\Users\\me\\AppData\\Roaming', ['user-data-dir']) - ensureWindowsAppDataPath(host, {}, 'win32') - expect(host.calls).toEqual(['get:appData']) - }) - it('creates and sets appData from the environment before userData when the lookup throws', () => { // Use real missing directories to prove profileless sessions get their fallback created. const root = mkdtempSync(join(tmpdir(), 'orca-appdata-')) diff --git a/src/main/startup/windows-app-data-path.ts b/src/main/startup/windows-startup/windows-app-data-path.ts similarity index 100% rename from src/main/startup/windows-app-data-path.ts rename to src/main/startup/windows-startup/windows-app-data-path.ts diff --git a/src/main/startup/windows-isolated-spawner.ts b/src/main/startup/windows-startup/windows-isolated-spawner.ts similarity index 94% rename from src/main/startup/windows-isolated-spawner.ts rename to src/main/startup/windows-startup/windows-isolated-spawner.ts index 6b33f017468..28ae4342107 100644 --- a/src/main/startup/windows-isolated-spawner.ts +++ b/src/main/startup/windows-startup/windows-isolated-spawner.ts @@ -1,5 +1,5 @@ import { setIsolatedSpawner } from '@orca/process-host/isolated-detached-spawn' -import { loadWindowsSecurity } from '../../shared/windows-security-addon' +import { loadWindowsSecurity } from '../../../shared/windows-security-addon' /** Long-lived detached children (the WSL holder) then inherit none of main's handles, e.g. a * DevTools socket. A missing or stale addon keeps libuv's spawn, which inherits them. */ diff --git a/src/main/startup/windows-isolated-spawner.win32.test.ts b/src/main/startup/windows-startup/windows-isolated-spawner.win32.test.ts similarity index 97% rename from src/main/startup/windows-isolated-spawner.win32.test.ts rename to src/main/startup/windows-startup/windows-isolated-spawner.win32.test.ts index 130082cb5b2..b70a1009adf 100644 --- a/src/main/startup/windows-isolated-spawner.win32.test.ts +++ b/src/main/startup/windows-startup/windows-isolated-spawner.win32.test.ts @@ -10,10 +10,10 @@ import { setIsolatedSpawner, spawnDetachedWithoutInheritance } from '@orca/process-host/isolated-detached-spawn' -import { loadWindowsSecurity } from '../../shared/windows-security-addon' +import { loadWindowsSecurity } from '../../../shared/windows-security-addon' const describeOnWindows = process.platform === 'win32' ? describe : describe.skip -const ADDON = resolve(__dirname, '..', '..', '..', 'native', 'windows-security', 'index.js') +const ADDON = resolve(__dirname, '../../../../native/windows-security/index.js') const root = mkdtempSync(join(tmpdir(), 'orca-isolated-spawn-')) const entry = join(root, 'main.cjs') @@ -79,7 +79,7 @@ async function runElectron(mode: 'isolated' | 'libuv', holderMs: number) { describeOnWindows('isolated detached spawn against real Windows processes', () => { beforeAll(async () => { await build({ - entryPoints: [resolve(__dirname, 'windows-isolated-spawn-electron-fixture.ts')], + entryPoints: [resolve(__dirname, '../testing/windows-isolated-spawn-electron-fixture.ts')], outfile: entry, bundle: true, platform: 'node', diff --git a/src/main/startup/windows-renderer-runtime-files.test.ts b/src/main/startup/windows-startup/windows-renderer-runtime-files.test.ts similarity index 97% rename from src/main/startup/windows-renderer-runtime-files.test.ts rename to src/main/startup/windows-startup/windows-renderer-runtime-files.test.ts index c28e9f0bd58..c4add320906 100644 --- a/src/main/startup/windows-renderer-runtime-files.test.ts +++ b/src/main/startup/windows-startup/windows-renderer-runtime-files.test.ts @@ -9,7 +9,7 @@ const { electronApp, handleFailure } = vi.hoisted(() => ({ })) vi.mock('electron', () => ({ app: electronApp })) -vi.mock('./main-process-preflight-failure', () => ({ +vi.mock('../main-process-preflight-failure', () => ({ handleMainProcessPreflightFailure: handleFailure })) diff --git a/src/main/startup/windows-renderer-runtime-files.ts b/src/main/startup/windows-startup/windows-renderer-runtime-files.ts similarity index 95% rename from src/main/startup/windows-renderer-runtime-files.ts rename to src/main/startup/windows-startup/windows-renderer-runtime-files.ts index e3a477c0402..98f48fe6dff 100644 --- a/src/main/startup/windows-renderer-runtime-files.ts +++ b/src/main/startup/windows-startup/windows-renderer-runtime-files.ts @@ -1,7 +1,7 @@ import { app } from 'electron' import { closeSync, fstatSync, openSync } from 'node:fs' import { dirname, join } from 'node:path' -import { handleMainProcessPreflightFailure } from './main-process-preflight-failure' +import { handleMainProcessPreflightFailure } from '../main-process-preflight-failure' /** Every renderer delay-loads this at child init; without it each one dies with 0x80000003 before any page loads. */ const RENDERER_RUNTIME_FILES = ['ffmpeg.dll'] as const diff --git a/src/main/startup/windows-std-handle-inheritance.ts b/src/main/startup/windows-startup/windows-std-handle-inheritance.ts similarity index 91% rename from src/main/startup/windows-std-handle-inheritance.ts rename to src/main/startup/windows-startup/windows-std-handle-inheritance.ts index 224068740f3..f25dead3cad 100644 --- a/src/main/startup/windows-std-handle-inheritance.ts +++ b/src/main/startup/windows-startup/windows-std-handle-inheritance.ts @@ -1,4 +1,4 @@ -import { loadWindowsSecurity } from '../../shared/windows-security-addon' +import { loadWindowsSecurity } from '../../../shared/windows-security-addon' /** libuv spawns with bInheritHandles=TRUE, so an inheritable std handle reaches every child, and a * long-lived one (the WSL holder, the daemon) keeps a launcher's pipe open after Orca exits. */ diff --git a/src/main/startup/windows-std-handle-inheritance.win32.test.ts b/src/main/startup/windows-startup/windows-std-handle-inheritance.win32.test.ts similarity index 89% rename from src/main/startup/windows-std-handle-inheritance.win32.test.ts rename to src/main/startup/windows-startup/windows-std-handle-inheritance.win32.test.ts index 2fd9d6d486c..989804f6e6f 100644 --- a/src/main/startup/windows-std-handle-inheritance.win32.test.ts +++ b/src/main/startup/windows-startup/windows-std-handle-inheritance.win32.test.ts @@ -7,7 +7,7 @@ import { afterAll, describe, expect, it } from 'vitest' import { spawnProcess } from '@orca/process-host' const describeOnWindows = process.platform === 'win32' ? describe : describe.skip -const ADDON = resolve(__dirname, '..', '..', '..', 'native', 'windows-security', 'index.js') +const ADDON = resolve(__dirname, '..', '..', '..', '..', 'native', 'windows-security', 'index.js') const root = mkdtempSync(join(tmpdir(), 'orca-std-handles-')) const entry = join(root, 'main.cjs') @@ -84,11 +84,4 @@ describeOnWindows('clearing std handle inheritance', () => { }, 90_000) // Cold Electron start on a CI runner plus the 3 s holder exceeds the 5 s default. - it('without it, Electron main lets the holder keep the pipe open until it exits', async () => { - const run = await runChild('electron', 'keep', 3_000) - - expect(run.code, run.output).toBe(0) - expect(run.output).toContain('inherited-output') - expect(run.holderAliveAtClose).toBe(false) - }, 60_000) }) diff --git a/src/main/startup/windows-user-data-acl.test.ts b/src/main/startup/windows-startup/windows-user-data-acl.test.ts similarity index 97% rename from src/main/startup/windows-user-data-acl.test.ts rename to src/main/startup/windows-startup/windows-user-data-acl.test.ts index c278fa95d44..fccc6c71b02 100644 --- a/src/main/startup/windows-user-data-acl.test.ts +++ b/src/main/startup/windows-startup/windows-user-data-acl.test.ts @@ -5,12 +5,12 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { resetWindowsSecurityLoadForTests, setWindowsSecurityForTests -} from '../../shared/windows-security-addon' +} from '../../../shared/windows-security-addon' import { createFakeWindowsSecurity, FAKE_USER_SID, type FakeWindowsSecurity -} from '../../shared/windows-security-addon.test-fixture' +} from '../../../shared/windows-security-addon.test-fixture' import { ensureWindowsUserDataAclGrant, WINDOWS_ACL_GRANT_MARKER_FILE, diff --git a/src/main/startup/windows-user-data-acl.ts b/src/main/startup/windows-startup/windows-user-data-acl.ts similarity index 96% rename from src/main/startup/windows-user-data-acl.ts rename to src/main/startup/windows-startup/windows-user-data-acl.ts index b39ff0b3559..0bd92275ae2 100644 --- a/src/main/startup/windows-user-data-acl.ts +++ b/src/main/startup/windows-startup/windows-user-data-acl.ts @@ -1,7 +1,7 @@ import { readdirSync, readFileSync, writeFileSync } from 'node:fs' import { join } from 'node:path' -import { grantDirAclAsync } from '../windows/windows-directory-acl' -import { loadWindowsSecurity } from '../../shared/windows-security-addon' +import { grantDirAclAsync } from '../../windows/windows-directory-acl' +import { loadWindowsSecurity } from '../../../shared/windows-security-addon' /** #1152: Chromium replaces userData DACL and inherited child ACEs become inherit-only, causing EPERM. Grant explicit root/immediate-child access once per identity; inherited propagation covers descendants (full 28k-file walk measured 62s). Run in the pool; per-write EPERM retries cover startup races. */ diff --git a/src/main/startup/branch-rename-hook.ts b/src/main/startup/workspace-startup/branch-rename-hook.ts similarity index 81% rename from src/main/startup/branch-rename-hook.ts rename to src/main/startup/workspace-startup/branch-rename-hook.ts index 76e96b1af69..f2907c14ef0 100644 --- a/src/main/startup/branch-rename-hook.ts +++ b/src/main/startup/workspace-startup/branch-rename-hook.ts @@ -1,7 +1,7 @@ -import { maybeAutoRenameBranchOnFirstWork } from '../agent-hooks/first-work/first-work-branch-rename' -import { firstWorkRenameDeps } from '../agent-hooks/first-work/first-work-rename-runtime' -import { agentHookServer } from '../agent-hooks/server/agent-hook-server' -import { mainProcessState as state } from './main-process-state' +import { maybeAutoRenameBranchOnFirstWork } from '../../agent-hooks/first-work/first-work-branch-rename' +import { firstWorkRenameDeps } from '../../agent-hooks/first-work/first-work-rename-runtime' +import { agentHookServer } from '../../agent-hooks/server/agent-hook-server' +import { mainProcessState as state } from '../main-process-state' /** Arms first-work rename from the hook store itself, so headless serve (no window) renames too. */ export function installFirstWorkRenameHookSubscription(): () => void { diff --git a/src/main/startup/worktree-removal-records-load.ts b/src/main/startup/workspace-startup/worktree-removal-records-load.ts similarity index 77% rename from src/main/startup/worktree-removal-records-load.ts rename to src/main/startup/workspace-startup/worktree-removal-records-load.ts index da0766d897e..453a274ef33 100644 --- a/src/main/startup/worktree-removal-records-load.ts +++ b/src/main/startup/workspace-startup/worktree-removal-records-load.ts @@ -1,6 +1,6 @@ -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host' -import type { Repo } from '../../shared/repo-types' -import { loadWorktreeRemovalRecords } from '../workspaces/removal/worktree-background-removal' +import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import type { Repo } from '../../../shared/repo-types' +import { loadWorktreeRemovalRecords } from '../../workspaces/removal/worktree-background-removal' /** Retain failed deletions only while this host has the local repo copy; an SSH copy under the same ID cannot show its deletion row. */ export function loadWorktreeRemovalRecordsForStore(store: { diff --git a/src/main/startup/wsl-orcad-account-env-wiring.test.ts b/src/main/startup/wsl-orcad-account-env-wiring.test.ts deleted file mode 100644 index 72033c147c0..00000000000 --- a/src/main/startup/wsl-orcad-account-env-wiring.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' - -vi.mock('electron', () => ({ BrowserWindow: { getAllWindows: () => [] } })) - -import { oncePerDistro } from './wsl-orcad-account-env-wiring' - -describe('oncePerDistro', () => { - it('tells the user about each distro once per run, whatever its casing', () => { - const send = vi.fn() - const notify = oncePerDistro(send) - notify('Ubuntu') - notify('ubuntu') - notify('Debian') - notify('Ubuntu') - expect(send.mock.calls).toEqual([['Ubuntu'], ['Debian']]) - }) -}) diff --git a/src/main/startup/wsl-cli-reconciliation-startup-barrier.test.ts b/src/main/startup/wsl-startup/wsl-cli-reconciliation-startup-barrier.test.ts similarity index 100% rename from src/main/startup/wsl-cli-reconciliation-startup-barrier.test.ts rename to src/main/startup/wsl-startup/wsl-cli-reconciliation-startup-barrier.test.ts diff --git a/src/main/startup/wsl-cli-reconciliation-startup-barrier.ts b/src/main/startup/wsl-startup/wsl-cli-reconciliation-startup-barrier.ts similarity index 100% rename from src/main/startup/wsl-cli-reconciliation-startup-barrier.ts rename to src/main/startup/wsl-startup/wsl-cli-reconciliation-startup-barrier.ts diff --git a/src/main/startup/wsl-orcad-account-env-wiring.ts b/src/main/startup/wsl-startup/wsl-orcad-account-env-wiring.ts similarity index 76% rename from src/main/startup/wsl-orcad-account-env-wiring.ts rename to src/main/startup/wsl-startup/wsl-orcad-account-env-wiring.ts index b6be8bb453a..c05145db9a5 100644 --- a/src/main/startup/wsl-orcad-account-env-wiring.ts +++ b/src/main/startup/wsl-startup/wsl-orcad-account-env-wiring.ts @@ -1,14 +1,14 @@ import { BrowserWindow } from 'electron' -import { withClaudeProfileTerminalEnv } from '../claude-accounts/profiles/routing/claude-profile-installed-router' -import { getSelectedClaudeAccountIdForTarget } from '../claude-accounts/selection/runtime-selection' -import { getSelectedCodexAccountIdForTarget } from '../codex-accounts/account-management/runtime-selection' -import type { Store } from '../persistence/loading-store/store' -import { installWslOrcadAccountEnvDependencies } from '../wsl/orcad/wsl-orcad-account-env' +import { withClaudeProfileTerminalEnv } from '../../claude-accounts/profiles/routing/claude-profile-installed-router' +import { getSelectedClaudeAccountIdForTarget } from '../../claude-accounts/selection/runtime-selection' +import { getSelectedCodexAccountIdForTarget } from '../../codex-accounts/account-management/runtime-selection' +import type { Store } from '../../persistence/loading-store/store' +import { installWslOrcadAccountEnvDependencies } from '../../wsl/orcad/wsl-orcad-account-env' import { WSL_ORCAD_ACCOUNT_NOT_APPLIED_CHANNEL, type WslOrcadAccountNotAppliedEvent -} from '../../shared/wsl-orcad-account-notice' -import { mainProcessState as state } from './main-process-state' +} from '../../../shared/wsl-orcad-account-notice' +import { mainProcessState as state } from '../main-process-state' /** Calls `send` once per distro (case-insensitive) for the life of this process. */ export function oncePerDistro(send: (distro: string) => void): (distro: string) => void { diff --git a/src/main/telemetry/structured-chat-prompt-owner.test.ts b/src/main/telemetry/structured-chat-prompt-owner.test.ts deleted file mode 100644 index ff0cdbed471..00000000000 --- a/src/main/telemetry/structured-chat-prompt-owner.test.ts +++ /dev/null @@ -1,155 +0,0 @@ -import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import type { RpcContext } from '../runtime/rpc/core' -import type { RpcCallerIdentity } from '../runtime/rpc/rpc-caller-identity' -import { structuredCallerFor } from '../runtime/rpc/methods/structured-sessions/creation/structured-agent-session-gate' -import type { StructuredChatTelemetryEvent } from '../../shared/structured-chat-dispatch-telemetry' -import { _setCommonPropsForTests } from './client' -import { - BASE_COMMON, - cleanupTelemetryClientTest, - setupTelemetryClientTest, - type TelemetryClientTestState -} from './client-test-harness' -import { - recordRemoteStructuredChatTelemetry, - recordStructuredChatPromptAccepted, - subscribeStructuredChatTelemetry -} from './structured-chat-dispatch' - -const HOST_INSTALL = '11111111-1111-4111-8111-111111111111' -const OWNER_INSTALL = '22222222-2222-4222-8222-222222222222' -let active: TelemetryClientTestState | undefined -let relayed: { event: StructuredChatTelemetryEvent; owner: string }[] -let unsubscribe: () => void - -beforeEach(() => { - vi.useFakeTimers() - vi.setSystemTime(new Date('2026-11-08T23:58:00Z')) - relayed = [] - unsubscribe = subscribeStructuredChatTelemetry((event, owner) => relayed.push({ event, owner })) -}) -afterEach(() => { - unsubscribe() - if (active) { - cleanupTelemetryClientTest(active.envStash) - active = undefined - } - vi.useRealTimers() -}) - -function desktop(installId: string, optedIn: boolean): TelemetryClientTestState { - if (active) { - cleanupTelemetryClientTest(active.envStash) - } - active = setupTelemetryClientTest({ - installId, - optedIn, - existedBeforeTelemetryRelease: false, - protectedMilestones: { installCohort: 'fresh' } - }) - _setCommonPropsForTests({ ...BASE_COMMON, install_id: installId }) - return active -} - -function accept( - caller: RpcCallerIdentity, - clientKind?: 'mobile' | 'runtime', - pairedDeviceParentId?: string -): void { - const context: Partial = { caller, clientKind, pairedDeviceParentId } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: caller derivation reads only the supplied transport identity fields. - const identity = structuredCallerFor(context as RpcContext) - if (!identity.userClient) { - throw new Error('expected a transport-proven user') - } - recordStructuredChatPromptAccepted( - { agent_kind: 'codex', runtime: 'unknown', client: identity.userClient }, - identity.telemetryOwnerKey - ) -} - -const captured = (state: TelemetryClientTestState, name: string) => - state.mock.capture.mock.calls.map(([event]) => event).filter((event) => event.event === name) - -it('lets the originating desktop opt in even when its initialized execution host opts out', () => { - const host = desktop(HOST_INSTALL, false) - accept({ kind: 'paired-device', deviceId: 'originating-desktop' }, 'runtime') - expect(relayed).toEqual([ - { - owner: 'originating-desktop', - event: { - type: 'structuredChatPromptAccepted', - id: expect.any(String), - agent_kind: 'codex', - client: 'desktop' - } - } - ]) - expect(host.settings.telemetry?.protectedMilestones).toEqual({ installCohort: 'fresh' }) - expect(host.mock.capture.mock.calls).toEqual([]) - - const owner = desktop(OWNER_INSTALL, true) - recordRemoteStructuredChatTelemetry(relayed[0].event) - expect(owner.settings.telemetry?.protectedMilestones).toEqual({ - installCohort: 'fresh', - firstAgentInteractionDay: 20_765, - meaningfulActivityDay: 20_765 - }) - expect(captured(owner, 'first_agent_interaction')[0].properties).toMatchObject({ - install_id: OWNER_INSTALL, - source: 'native_chat' - }) - expect(captured(owner, 'meaningful_activity_day')[0].properties).toMatchObject({ - install_id: OWNER_INSTALL, - trigger: 'native_chat' - }) -}) - -it('respects a delegated phone owners opt-out even when its initialized execution host opts in', () => { - const host = desktop(HOST_INSTALL, true) - accept({ kind: 'paired-device', deviceId: 'delegated-phone' }, 'mobile', 'originating-desktop') - expect(relayed).toEqual([ - { - owner: 'originating-desktop', - event: { - type: 'structuredChatPromptAccepted', - id: expect.any(String), - agent_kind: 'codex', - client: 'mobile' - } - } - ]) - expect(host.settings.telemetry?.protectedMilestones).toEqual({ installCohort: 'fresh' }) - expect(host.mock.capture.mock.calls).toEqual([]) - - const owner = desktop(OWNER_INSTALL, false) - recordRemoteStructuredChatTelemetry(relayed[0].event) - expect(owner.settings.telemetry?.protectedMilestones).toEqual({ installCohort: 'fresh' }) - expect(owner.mock.capture.mock.calls).toEqual([]) -}) - -it('keeps the local desktop and its directly paired phone on host installation consent', () => { - const host = desktop(HOST_INSTALL, true) - accept({ kind: 'desktop' }) - vi.setSystemTime(new Date('2026-11-09T00:01:00Z')) - accept({ kind: 'paired-device', deviceId: 'direct-phone' }, 'mobile') - expect(relayed).toEqual([]) - expect(host.settings.telemetry?.protectedMilestones).toEqual({ - installCohort: 'fresh', - firstAgentInteractionDay: 20_765, - meaningfulActivityDay: 20_766 - }) - expect(captured(host, 'first_agent_interaction')[0].properties).toMatchObject({ - install_id: HOST_INSTALL, - source: 'native_chat' - }) - expect( - captured(host, 'meaningful_activity_day').map((event) => ({ - install_id: event.properties.install_id, - trigger: event.properties.trigger - })) - ).toEqual([ - { install_id: HOST_INSTALL, trigger: 'native_chat' }, - { install_id: HOST_INSTALL, trigger: 'mobile_chat' } - ]) -}) diff --git a/src/main/text-generation/conversation-name-generation-request.test.ts b/src/main/text-generation/conversation-name-generation-request.test.ts index d92a4052890..048a04deb62 100644 --- a/src/main/text-generation/conversation-name-generation-request.test.ts +++ b/src/main/text-generation/conversation-name-generation-request.test.ts @@ -1,7 +1,4 @@ -import { - sourceShapedKimiOutput, - realKimiOccupiedOutput -} from '../../shared/__fixtures__/kimi-generation-source-shaped' +import { realKimiOccupiedOutput } from '../../shared/__fixtures__/kimi-generation-source-shaped' import { describe, expect, it, vi } from 'vitest' import { createMockDiscoveryChild } from './commit-message-text-generation-test-harness' import { generateConversationNameFromContext } from './commit-message-text-generation' @@ -108,33 +105,4 @@ describe('generateConversationName', () => { cancelLocalGeneration('conversation-name', '/repo') expect(await pending).toMatchObject({ success: false, canceled: true }) }) - - it.each(['custom', 'kimi'] as const)('%s local title', async (agentId) => { - const child = createMockDiscoveryChild() - const spawnAgent = vi.fn(() => { - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: The test child implements every process member the generation lane reads. - return child as unknown as SpawnedSourceControlAgentProcess - }) - const pending = generateConversationName({ - context: { firstPrompt: 'Fix login' }, - params: { agentId, model: agentId === 'kimi' ? 'default' : '', customAgentCommand: 'agent' }, - target: { kind: 'local', cwd: '/repo' }, - spawnAgent - }) - await vi.waitFor(() => expect(spawnAgent).toHaveBeenCalledOnce()) - child.stdout.emit( - 'data', - Buffer.from( - agentId === 'kimi' - ? sourceShapedKimiOutput('Title: "Fix login flow"') - : 'Title: "Fix login flow"\n' - ) - ) - child.emit('close', 0) - expect(await pending).toEqual({ - success: true, - name: 'Fix login flow', - agentLabel: agentId === 'kimi' ? 'Kimi' : 'agent' - }) - }) }) diff --git a/src/main/updater/browser-sidecar-owner.test.ts b/src/main/updater/browser-sidecar-owner.test.ts index e6db659f923..b918c796c49 100644 --- a/src/main/updater/browser-sidecar-owner.test.ts +++ b/src/main/updater/browser-sidecar-owner.test.ts @@ -4,7 +4,7 @@ import { BROWSER_SIDECAR_OWNER_ENV } from '../../shared/browser-sidecar-lifetime import { installServeSupervisorDisconnectQuit } from './serve-update-handoff' const { quit } = vi.hoisted(() => ({ quit: vi.fn() })) -vi.mock('../startup/process-quit-request', () => ({ quitProcess: quit })) +vi.mock('../startup/quit/process-quit-request', () => ({ quitProcess: quit })) vi.mock('../persistence/loading-store/user-data-path', () => ({ getCanonicalUserDataPath: () => { throw new Error('No profile access for sidecar owner') @@ -27,16 +27,3 @@ it('couples the browser to its IPC owner on every platform and removes the inher expect(quit).toHaveBeenCalledOnce() dispose() }) - -it('quits when the owner disappeared before startup finished', () => { - const parent = Object.assign(new EventEmitter(), { connected: false }) - installServeSupervisorDisconnectQuit(true, parent) - expect(quit).toHaveBeenCalledOnce() -}) - -it('removes the listener on disposal', () => { - const parent = Object.assign(new EventEmitter(), { connected: true }) - installServeSupervisorDisconnectQuit(true, parent)() - parent.emit('disconnect') - expect(quit).not.toHaveBeenCalled() -}) diff --git a/src/main/window/main-window-updater-deferred-setup.test.ts b/src/main/updater/lifecycle/main-window-updater-deferred-setup.test.ts similarity index 57% rename from src/main/window/main-window-updater-deferred-setup.test.ts rename to src/main/updater/lifecycle/main-window-updater-deferred-setup.test.ts index b1a0d2490fa..37ba6575344 100644 --- a/src/main/window/main-window-updater-deferred-setup.test.ts +++ b/src/main/updater/lifecycle/main-window-updater-deferred-setup.test.ts @@ -1,8 +1,8 @@ import { EventEmitter } from 'node:events' import type { BrowserWindow } from 'electron' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from '../persistence/loading-store/store' -import type { UpdaterSetupOptions } from '../updater/lifecycle/updater-setup' +import type { Store } from '../../persistence/loading-store/store' +import type { UpdaterSetupOptions } from './updater-setup' const { setupMock, milestoneMock, getMainWindowMock } = vi.hoisted(() => ({ getMainWindowMock: vi.fn<() => BrowserWindow | null>(() => null), @@ -11,15 +11,17 @@ const { setupMock, milestoneMock, getMainWindowMock } = vi.hoisted(() => ({ })) vi.mock('electron', () => ({ app: {}, ipcMain: {} })) -vi.mock('../updater/updater-service', () => ({ setupAutoUpdater: setupMock })) -vi.mock('../updater/lifecycle/electron-updater-proxy-session', () => ({ +vi.mock('../updater-service', () => ({ setupAutoUpdater: setupMock })) +vi.mock('./electron-updater-proxy-session', () => ({ applyProxyToElectronUpdaterSession: vi.fn() })) -vi.mock('../ipc/ui', () => ({ +vi.mock('../../ipc/ui', () => ({ isTrustedUIRenderer: () => true, getTrustedUIRendererWindow: getMainWindowMock })) -vi.mock('../startup/startup-diagnostics', () => ({ logStartupMilestone: milestoneMock })) +vi.mock('../../startup/diagnostics/startup-diagnostics', () => ({ + logStartupMilestone: milestoneMock +})) function createWindowOwner() { const window = Object.assign(new EventEmitter(), { @@ -111,41 +113,6 @@ describe('completed deferred updater setup ownership', () => { expect(weakTimer.deref()).toBeUndefined() }) - it('keeps the fallback guard when destruction happens after ready but before immediate', async () => { - const updater = await import('./main-window-updater') - const owner = createWindowOwner() - updater.scheduleMainWindowAutoUpdaterSetup(owner.mainWindow, owner.persistence) - owner.window.emit('ready-to-show') - owner.window.isDestroyed.mockReturnValue(true) - await vi.advanceTimersByTimeAsync(0) - expect(owner.window.isDestroyed).toHaveBeenCalledOnce() - expect(vi.getTimerCount()).toBe(1) - await vi.advanceTimersByTimeAsync(15_000) - expect(owner.window.isDestroyed).toHaveBeenCalledTimes(2) - expect(setupMock).not.toHaveBeenCalled() - }) - - it('retains original setup order and avoids reentrant initialization', async () => { - const updater = await import('./main-window-updater') - const owner = createWindowOwner() - const trace: string[] = [] - setupMock.mockImplementation(() => { - trace.push('setup') - updater.ensureAutoUpdaterConfigured() - trace.push('setup-return') - }) - milestoneMock.mockImplementation(() => { - trace.push('milestone') - updater.ensureAutoUpdaterConfigured() - }) - updater.scheduleMainWindowAutoUpdaterSetup(owner.mainWindow, owner.persistence) - updater.ensureAutoUpdaterConfigured() - expect(trace).toEqual(['setup', 'setup-return', 'milestone']) - expect(setupMock).toHaveBeenCalledOnce() - expect(owner.window.isDestroyed).toHaveBeenCalledOnce() - expect(vi.getTimerCount()).toBe(0) - }) - it('preserves pending retry after a failed destroyed-state read', async () => { const updater = await import('./main-window-updater') const owner = createWindowOwner() @@ -162,40 +129,6 @@ describe('completed deferred updater setup ownership', () => { expect(vi.getTimerCount()).toBe(0) }) - it('releases the fallback created after synchronous registration reentry', async () => { - const updater = await import('./main-window-updater') - const owner = createWindowOwner() - const once = owner.window.once.bind(owner.window) - vi.spyOn(owner.window, 'once').mockImplementationOnce((event, listener) => { - updater.ensureAutoUpdaterConfigured() - return once(event, listener) - }) - updater.scheduleMainWindowAutoUpdaterSetup(owner.mainWindow, owner.persistence) - expect(setupMock).toHaveBeenCalledOnce() - expect(milestoneMock).toHaveBeenCalledOnce() - expect(vi.getTimerCount()).toBe(0) - owner.window.emit('ready-to-show') - await vi.advanceTimersByTimeAsync(0) - expect(setupMock).toHaveBeenCalledOnce() - }) - - it('keeps a same-ID successor pending after the old window becomes ready', async () => { - const updater = await import('./main-window-updater') - const old = createWindowOwner() - const successor = createWindowOwner() - updater.scheduleMainWindowAutoUpdaterSetup(old.mainWindow, old.persistence) - updater.scheduleMainWindowAutoUpdaterSetup(successor.mainWindow, successor.persistence) - expect(vi.getTimerCount()).toBe(2) - old.window.emit('ready-to-show') - await vi.advanceTimersByTimeAsync(0) - expect(setupMock).toHaveBeenLastCalledWith(old.mainWindow, expect.any(Object)) - expect(vi.getTimerCount()).toBe(1) - updater.ensureAutoUpdaterConfigured() - expect(setupMock).toHaveBeenLastCalledWith(successor.mainWindow, expect.any(Object)) - expect(setupMock).toHaveBeenCalledTimes(2) - expect(vi.getTimerCount()).toBe(0) - }) - it.each(['setup', 'milestone'] as const)( 'preserves a reentrant successor when the old %s throws', async (failure) => { @@ -221,20 +154,4 @@ describe('completed deferred updater setup ownership', () => { expect(vi.getTimerCount()).toBe(0) } ) - - it('preserves the successor after an old destroyed fallback', async () => { - const updater = await import('./main-window-updater') - const old = createWindowOwner() - const successor = createWindowOwner() - updater.scheduleMainWindowAutoUpdaterSetup(old.mainWindow, old.persistence) - old.window.isDestroyed.mockReturnValue(true) - await vi.advanceTimersByTimeAsync(5_000) - updater.scheduleMainWindowAutoUpdaterSetup(successor.mainWindow, successor.persistence) - await vi.advanceTimersByTimeAsync(10_000) - expect(setupMock).not.toHaveBeenCalled() - expect(vi.getTimerCount()).toBe(1) - updater.ensureAutoUpdaterConfigured() - expect(setupMock).toHaveBeenCalledWith(successor.mainWindow, expect.any(Object)) - expect(vi.getTimerCount()).toBe(0) - }) }) diff --git a/src/main/window/main-window-updater.ts b/src/main/updater/lifecycle/main-window-updater.ts similarity index 88% rename from src/main/window/main-window-updater.ts rename to src/main/updater/lifecycle/main-window-updater.ts index 586d0b187b6..c634b515e72 100644 --- a/src/main/window/main-window-updater.ts +++ b/src/main/updater/lifecycle/main-window-updater.ts @@ -1,14 +1,17 @@ import { app, ipcMain } from 'electron' import type { BrowserWindow, IpcMainInvokeEvent } from 'electron' -import type { ReleaseBuildListResult, UpdateCheckOptions } from '../../shared/update-status-types' -import { RELEASE_CHANNELS, type ReleaseChannel } from '../../shared/release-channel' -import { getTrustedUIRendererWindow, isTrustedUIRenderer } from '../ipc/ui' -import type { Store } from '../persistence/loading-store/store' -import { logStartupMilestone } from '../startup/startup-diagnostics' -import { applyProxyToElectronUpdaterSession } from '../updater/lifecycle/electron-updater-proxy-session' -import { updaterErrorMessage } from '../updater/lifecycle/updater-coded-error' -import { updaterCodedMessage } from '../../shared/updater-failure-copy' -import { normalizeUpdateDelayDays } from '../../shared/update-delay' +import type { + ReleaseBuildListResult, + UpdateCheckOptions +} from '../../../shared/update-status-types' +import { RELEASE_CHANNELS, type ReleaseChannel } from '../../../shared/release-channel' +import { getTrustedUIRendererWindow, isTrustedUIRenderer } from '../../ipc/ui' +import type { Store } from '../../persistence/loading-store/store' +import { logStartupMilestone } from '../../startup/diagnostics/startup-diagnostics' +import { applyProxyToElectronUpdaterSession } from './electron-updater-proxy-session' +import { updaterErrorMessage } from './updater-coded-error' +import { updaterCodedMessage } from '../../../shared/updater-failure-copy' +import { normalizeUpdateDelayDays } from '../../../shared/update-delay' import { checkForUpdatesFromMenu, dismissAvailableUpdate, @@ -20,12 +23,9 @@ import { quitAndInstall, setupAutoUpdater, showLinuxPackage -} from '../updater/updater-service' -import type { - PreQuitCleanupFailureMode, - UpdateInstallMode -} from '../updater/lifecycle/updater-state' -import type { UpdaterSetupOptions } from '../updater/lifecycle/updater-setup' +} from '../updater-service' +import type { PreQuitCleanupFailureMode, UpdateInstallMode } from './updater-state' +import type { UpdaterSetupOptions } from './updater-setup' const UPDATER_SETUP_FALLBACK_MS = 15_000 diff --git a/src/main/updater/lifecycle/updater-install-execution.ts b/src/main/updater/lifecycle/updater-install-execution.ts index d135b64bafb..a8f068c7cab 100644 --- a/src/main/updater/lifecycle/updater-install-execution.ts +++ b/src/main/updater/lifecycle/updater-install-execution.ts @@ -1,6 +1,6 @@ import { releaseSessionsForInstaller } from './updater-installer-session-release' import { withUpdaterSpan } from '../../observability/instrumentation' -import { runWithLaunchPath } from '../../startup/hydrate-shell-path' +import { runWithLaunchPath } from '../../startup/shell-environment/hydrate-shell-path' import { markMacQuitAndInstallInFlight, isMacInstallerReady, diff --git a/src/main/window/updater-package-recovery-ipc.test.ts b/src/main/updater/lifecycle/updater-package-recovery-ipc.test.ts similarity index 81% rename from src/main/window/updater-package-recovery-ipc.test.ts rename to src/main/updater/lifecycle/updater-package-recovery-ipc.test.ts index 60c1ab212c9..30adc0f477f 100644 --- a/src/main/window/updater-package-recovery-ipc.test.ts +++ b/src/main/updater/lifecycle/updater-package-recovery-ipc.test.ts @@ -1,7 +1,7 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest' import type { IpcMainInvokeEvent, WebContents } from 'electron' -import type { Store } from '../persistence/loading-store/store' -import type * as IpcUiModule from '../ipc/ui' +import type { Store } from '../../persistence/loading-store/store' +import type * as IpcUiModule from '../../ipc/ui' const { handleMock, @@ -31,27 +31,27 @@ vi.mock('electron', () => ({ powerMonitor: { on: vi.fn(), off: vi.fn() } })) -vi.mock('../ipc/repos', () => ({ registerRepoHandlers: vi.fn() })) -vi.mock('../ipc/worktrees', () => ({ registerWorktreeHandlers: vi.fn() })) -vi.mock('../ipc/worktrees/listing/worktree-change-invalidators', () => ({ +vi.mock('../../ipc/repos', () => ({ registerRepoHandlers: vi.fn() })) +vi.mock('../../ipc/worktrees', () => ({ registerWorktreeHandlers: vi.fn() })) +vi.mock('../../ipc/worktrees/listing/worktree-change-invalidators', () => ({ runWorktreeChangeInvalidators: vi.fn() })) -vi.mock('../ipc/pty/provider/registry', () => ({ getLocalPtyProvider: vi.fn() })) -vi.mock('../ipc/pty/register-handlers', () => ({ registerPtyHandlers: vi.fn() })) -vi.mock('../memory/hydrate-local-pty-registry', () => ({ +vi.mock('../../ipc/pty/provider/registry', () => ({ getLocalPtyProvider: vi.fn() })) +vi.mock('../../ipc/pty/register-handlers', () => ({ registerPtyHandlers: vi.fn() })) +vi.mock('../../memory/hydrate-local-pty-registry', () => ({ hydrateLocalPtyRegistryAtBoot: vi.fn() })) -vi.mock('../browser/guest-lifecycle/manager/browser-manager', () => ({ +vi.mock('../../browser/guest-lifecycle/manager/browser-manager', () => ({ browserManager: { unregisterAll: vi.fn() } })) -vi.mock('../macos-permissions/macos-tcc-prompt-notice', () => ({ +vi.mock('../../macos-permissions/macos-tcc-prompt-notice', () => ({ acknowledgePendingTccPromptNotice: vi.fn(), consumePendingTccPromptNotice: vi.fn(), dismissTccPromptNotice: vi.fn(), releasePendingTccPromptNotice: vi.fn() })) -vi.mock('../updater/updater-service', () => ({ +vi.mock('../updater-service', () => ({ checkForUpdates: vi.fn(), checkForUpdatesFromMenu: vi.fn(), downloadUpdate: vi.fn(), @@ -65,7 +65,7 @@ vi.mock('../updater/updater-service', () => ({ })) // Keep the seam mock for wiring proof but delegate to the real predicate for sender-authorization branches. -vi.mock('../ipc/ui', async (importOriginal) => ({ +vi.mock('../../ipc/ui', async (importOriginal) => ({ ...(await importOriginal()), isTrustedUIRenderer: (sender: unknown) => isTrustedUIRendererMock(sender) })) @@ -120,7 +120,7 @@ function expectBothChannelsRejected(sender: Partial): void { describe('updater linux package recovery IPC handlers', () => { beforeAll(async () => { // Read the real predicate using the same trusted-ID state these tests set. - actualUi = await vi.importActual('../ipc/ui') + actualUi = await vi.importActual('../../ipc/ui') }) beforeEach(() => { @@ -141,17 +141,6 @@ describe('updater linux package recovery IPC handlers', () => { vi.unstubAllEnvs() }) - it('serves the current main UI renderer', async () => { - const event = senderEvent(webContents({})) - - await expect(getHandler(RECOVERY_CHANNELS[0])(event)).resolves.toEqual({ - ok: true, - command: "sudo apt install -- ''", - packageFileName: 'p' - }) - await expect(getHandler(RECOVERY_CHANNELS[1])(event)).resolves.toBeUndefined() - }) - // Exercise distinct real authorization branches, not relabelled mock verdicts. it.each([ ['a guest webview', webContents({ getType: () => 'webview' })], diff --git a/src/main/updater/mac-install/updater.mac-install.test.ts b/src/main/updater/mac-install/updater.mac-install.test.ts index e372541c0dc..290508bcc95 100644 --- a/src/main/updater/mac-install/updater.mac-install.test.ts +++ b/src/main/updater/mac-install/updater.mac-install.test.ts @@ -212,134 +212,6 @@ describe('updater mac install handoff', () => { vi.useRealTimers() }) - it('lets leftover ShipIt state be cleared before Squirrel can stage the download', async () => { - vi.useFakeTimers() - let finishPreparing: () => void = () => undefined - prepareShipItStagingMock.mockReturnValue( - new Promise((resolve) => { - finishPreparing = resolve - }) - ) - autoUpdaterMock.checkForUpdates.mockResolvedValue(undefined) - const { setupAutoUpdater, downloadUpdate } = await loadUpdaterModule() - setupAutoUpdater(updaterMainWindow(vi.fn())) - await vi.waitFor(() => expect(autoUpdaterMock.checkForUpdates).toHaveBeenCalledTimes(1)) - autoUpdaterMock.emit('checking-for-update') - autoUpdaterMock.emit('update-available', { version: '1.0.61' }) - await vi.advanceTimersByTimeAsync(0) - - downloadUpdate() - expect(prepareShipItStagingMock).toHaveBeenCalledTimes(1) - expect(autoUpdaterMock.downloadUpdate).not.toHaveBeenCalled() - finishPreparing() - await vi.advanceTimersByTimeAsync(0) - expect(autoUpdaterMock.downloadUpdate).toHaveBeenCalledTimes(1) - }) - - it.runIf(process.platform === 'darwin')( - 'resumes an ordinary quit when Squirrel becomes ready without checking blockers or relaunching', - async () => { - vi.useFakeTimers() - const sendMock = vi.fn() - const mainWindow = updaterMainWindow(sendMock) - - autoUpdaterMock.checkForUpdates.mockResolvedValue(undefined) - getMacUpdateRunningInstancesMock.mockResolvedValue([9654]) - const { setupAutoUpdater, downloadUpdate } = await loadUpdaterModule() - - setupAutoUpdater(mainWindow) - await vi.waitFor(() => { - expect(autoUpdaterMock.checkForUpdates).toHaveBeenCalledTimes(1) - }) - autoUpdaterMock.emit('checking-for-update') - autoUpdaterMock.emit('update-available', { version: '1.0.61' }) - // Let async update-available state land before emitting update-downloaded. - await vi.advanceTimersByTimeAsync(0) - downloadUpdate() - autoUpdaterMock.emit('update-downloaded', { version: '1.0.61' }) - - const preventDefault = vi.fn() - appMock.emit('before-quit', { preventDefault }) - - expect(preventDefault).toHaveBeenCalledTimes(1) - expect(autoUpdaterMock.quitAndInstall).not.toHaveBeenCalled() - - const nativeDownloadedHandler = nativeUpdaterMock.on.mock.calls.find( - ([eventName]) => eventName === 'update-downloaded' - )?.[1] as (() => void) | undefined - expect(nativeDownloadedHandler).toBeTypeOf('function') - - nativeDownloadedHandler?.() - - await vi.advanceTimersByTimeAsync(0) - expect(appMock.quit).toHaveBeenCalledOnce() - expect(getMacUpdateRunningInstancesMock).not.toHaveBeenCalled() - expect(autoUpdaterMock.quitAndInstall).not.toHaveBeenCalled() - const resumedPreventDefault = vi.fn() - appMock.emit('before-quit', { preventDefault: resumedPreventDefault }) - appMock.emit('before-quit', { preventDefault: resumedPreventDefault }) - expect(resumedPreventDefault).not.toHaveBeenCalled() - expect(sendMock).toHaveBeenCalledWith('updater:status', { - state: 'downloading', - percent: 100, - version: '1.0.61' - }) - } - ) - - it.runIf(process.platform === 'darwin')( - 'checks blockers for an explicit install requested before Squirrel becomes ready', - async () => { - vi.useFakeTimers() - const send = vi.fn() - autoUpdaterMock.checkForUpdates.mockResolvedValue(undefined) - getMacUpdateRunningInstancesMock.mockResolvedValue([9654]) - const { - setupAutoUpdater, - downloadUpdate, - quitAndInstall, - isQuittingForUpdate, - checkForUpdates, - checkForUpdatesFromMenu, - getUpdateStatus - } = await loadUpdaterModule() - setupAutoUpdater(updaterMainWindow(send)) - await vi.waitFor(() => expect(autoUpdaterMock.checkForUpdates).toHaveBeenCalledOnce()) - autoUpdaterMock.emit('checking-for-update') - autoUpdaterMock.emit('update-available', { version: '1.0.61' }) - await vi.advanceTimersByTimeAsync(0) - downloadUpdate() - autoUpdaterMock.emit('update-downloaded', { version: '1.0.61' }) - quitAndInstall() - checkForUpdatesFromMenu() - checkForUpdatesFromMenu({ localBuild: true }) - checkForUpdatesFromMenu({ channel: 'stable', targetTag: 'v1.0.70' }) - checkForUpdates() - downloadUpdate() - await vi.advanceTimersByTimeAsync(0) - expect(autoUpdaterMock.checkForUpdates).toHaveBeenCalledOnce() - expect(autoUpdaterMock.downloadUpdate).toHaveBeenCalledOnce() - expect(getUpdateStatus()).toEqual( - expect.objectContaining({ state: 'downloading', percent: 100, version: '1.0.61' }) - ) - const nativeReady = nativeUpdaterMock.on.mock.calls.find( - ([event]) => event === 'update-downloaded' - )?.[1] - nativeReady?.() - await vi.advanceTimersByTimeAsync(0) - - expect(getMacUpdateRunningInstancesMock).toHaveBeenCalledOnce() - expect(autoUpdaterMock.quitAndInstall).not.toHaveBeenCalled() - expect(appMock.quit).not.toHaveBeenCalled() - expect(isQuittingForUpdate()).toBe(false) - expect(send).toHaveBeenCalledWith('updater:quitAndInstallAborted') - expect(send).toHaveBeenCalledWith( - 'updater:status', - expect.objectContaining({ state: 'error', version: '1.0.61', retryAction: 'install' }) - ) - } - ) - it.runIf(process.platform === 'darwin')( 'ignores duplicate quit requests while deferred mac install cleanup is running', async () => { @@ -394,83 +266,6 @@ describe('updater mac install handoff', () => { } ) - it.runIf(process.platform === 'darwin')( - 'logs rejected deferred mac install handoffs without unhandled rejection', - async () => { - const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - const reportDownloaded = vi.fn() - const { deferMacQuitUntilInstallerReady, handleMacInstallerReady } = - await import('./updater-mac-install') - - expect( - deferMacQuitUntilInstallerReady( - { state: 'downloading', percent: 100, version: '1.0.61' }, - true, - () => '1.0.61', - vi.fn() - ) - ).toBe(true) - - handleMacInstallerReady( - true, - async () => { - throw new Error('handoff-secret') - }, - reportDownloaded - ) - await Promise.resolve() - - expect(reportDownloaded).not.toHaveBeenCalled() - await vi.waitFor(() => { - expect(warn).toHaveBeenCalledWith( - '[updater] Deferred macOS install handoff failed {"errorType":"Error"}' - ) - }) - expect(JSON.stringify(warn.mock.calls)).not.toContain('handoff-secret') - } - ) - - it.runIf(process.platform === 'darwin')( - 'falls back to a normal quit if Squirrel.Mac never becomes ready', - async () => { - vi.useFakeTimers() - - const sendMock = vi.fn() - const mainWindow = updaterMainWindow(sendMock) - - autoUpdaterMock.checkForUpdates.mockResolvedValue(undefined) - const { setupAutoUpdater, downloadUpdate } = await loadUpdaterModule() - - setupAutoUpdater(mainWindow) - await vi.waitFor(() => { - expect(autoUpdaterMock.checkForUpdates).toHaveBeenCalledTimes(1) - }) - autoUpdaterMock.emit('checking-for-update') - autoUpdaterMock.emit('update-available', { version: '1.0.61' }) - // Let async update-available state land before emitting update-downloaded. - await vi.advanceTimersByTimeAsync(0) - downloadUpdate() - autoUpdaterMock.emit('update-downloaded', { version: '1.0.61' }) - - const preventDefault = vi.fn() - appMock.emit('before-quit', { preventDefault }) - - expect(preventDefault).toHaveBeenCalledTimes(1) - expect(appMock.quit).not.toHaveBeenCalled() - - await vi.advanceTimersByTimeAsync(15000) - - expect(appMock.quit).toHaveBeenCalledTimes(1) - - const secondPreventDefault = vi.fn() - appMock.emit('before-quit', { preventDefault: secondPreventDefault }) - expect(secondPreventDefault).not.toHaveBeenCalled() - appMock.emit('before-quit', { preventDefault: secondPreventDefault }) - expect(secondPreventDefault).not.toHaveBeenCalled() - expect(autoUpdaterMock.quitAndInstall).not.toHaveBeenCalled() - } - ) - it.runIf(process.platform === 'darwin')( 'keeps the app and terminals open when another bundle instance blocks installation, then allows retry', async () => { @@ -532,230 +327,6 @@ describe('updater mac install handoff', () => { } ) - it.runIf(process.platform === 'darwin')( - 'recovers orphan browser blockers before native install without asking for another download', - async () => { - vi.useFakeTimers() - const send = vi.fn() - const onBeforeQuit = vi.fn() - autoUpdaterMock.checkForUpdates.mockResolvedValue(undefined) - const { setupAutoUpdater, downloadUpdate, quitAndInstall } = await loadUpdaterModule() - setupAutoUpdater(updaterMainWindow(send), { onBeforeQuit }) - await prepareStagedMacUpdate(downloadUpdate) - getMacUpdateRunningInstancesMock.mockResolvedValue([9654]) - recoverBrowserSidecarsMock.mockResolvedValue([]) - quitAndInstall() - await vi.advanceTimersByTimeAsync(1000) - expect(recoverBrowserSidecarsMock).toHaveBeenCalledWith(process.execPath, [9654]) - expect(send).toHaveBeenCalledWith( - 'updater:status', - expect.objectContaining({ - state: 'downloaded', - installing: true - }) - ) - expect(onBeforeQuit).toHaveBeenCalledOnce() - expect(autoUpdaterMock.quitAndInstall).toHaveBeenCalledOnce() - expect(send).not.toHaveBeenCalledWith( - 'updater:status', - expect.objectContaining({ installBlock: expect.anything() }) - ) - } - ) - - it.runIf(process.platform === 'darwin')( - 'keeps the app open when process enumeration fails', - async () => { - vi.useFakeTimers() - const send = vi.fn() - const onBeforeQuit = vi.fn() - autoUpdaterMock.checkForUpdates.mockResolvedValue(undefined) - const { setupAutoUpdater, downloadUpdate, quitAndInstall, isQuittingForUpdate } = - await loadUpdaterModule() - setupAutoUpdater(updaterMainWindow(send), { onBeforeQuit }) - await prepareStagedMacUpdate(downloadUpdate) - getMacUpdateRunningInstancesMock.mockRejectedValue(new Error('probe failed')) - quitAndInstall() - await vi.advanceTimersByTimeAsync(1000) - expect(onBeforeQuit).not.toHaveBeenCalled() - expect(autoUpdaterMock.quitAndInstall).not.toHaveBeenCalled() - expect(isQuittingForUpdate()).toBe(false) - expect(send).toHaveBeenCalledWith('updater:quitAndInstallAborted') - expect(send).toHaveBeenCalledWith( - 'updater:status', - expect.objectContaining({ - state: 'error', - message: expect.stringContaining('Could not check'), - retryAction: 'install' - }) - ) - expect(send).toHaveBeenCalledWith( - 'updater:status', - expect.objectContaining({ - message: expect.stringMatching(/close the other Orca instances.*quit Orca/i) - }) - ) - } - ) - - it.runIf(process.platform === 'darwin')( - 'leaves an ordinary quit with a staged update to Squirrel instead of starting a relaunching install', - async () => { - vi.useFakeTimers() - const onBeforeQuit = vi.fn() - autoUpdaterMock.checkForUpdates.mockResolvedValue(undefined) - const { setupAutoUpdater, downloadUpdate } = await loadUpdaterModule() - setupAutoUpdater(updaterMainWindow(vi.fn()), { onBeforeQuit }) - await prepareStagedMacUpdate(downloadUpdate) - const preventDefault = vi.fn() - appMock.emit('before-quit', { preventDefault }) - appMock.emit('before-quit', { preventDefault }) - await vi.advanceTimersByTimeAsync(0) - expect(preventDefault).not.toHaveBeenCalled() - expect(getMacUpdateRunningInstancesMock).not.toHaveBeenCalled() - expect(onBeforeQuit).not.toHaveBeenCalled() - expect(autoUpdaterMock.quitAndInstall).not.toHaveBeenCalled() - } - ) - - it.runIf(process.platform === 'darwin')( - 'blocks duplicate quits while the running-instance check is pending', - async () => { - vi.useFakeTimers() - const onBeforeQuit = vi.fn() - autoUpdaterMock.checkForUpdates.mockResolvedValue(undefined) - const { setupAutoUpdater, downloadUpdate, quitAndInstall } = await loadUpdaterModule() - setupAutoUpdater(updaterMainWindow(vi.fn()), { onBeforeQuit }) - await prepareStagedMacUpdate(downloadUpdate) - - let finishProbe: (pids: number[]) => void = () => {} - getMacUpdateRunningInstancesMock.mockImplementation( - () => - new Promise((resolve) => { - finishProbe = resolve - }) - ) - quitAndInstall() - await vi.advanceTimersByTimeAsync(1000) - const preventDefault = vi.fn() - appMock.emit('before-quit', { preventDefault }) - appMock.emit('before-quit', { preventDefault }) - expect(preventDefault).toHaveBeenCalledTimes(2) - expect(getMacUpdateRunningInstancesMock).toHaveBeenCalledTimes(1) - finishProbe([9654]) - await vi.advanceTimersByTimeAsync(0) - expect(onBeforeQuit).not.toHaveBeenCalled() - expect(autoUpdaterMock.quitAndInstall).not.toHaveBeenCalled() - } - ) - - it.runIf(process.platform === 'darwin')( - 'allows ordinary quitting after a refused install without requiring background servers to exit', - async () => { - vi.useFakeTimers() - autoUpdaterMock.checkForUpdates.mockResolvedValue(undefined) - const { setupAutoUpdater, downloadUpdate, quitAndInstall } = await loadUpdaterModule() - setupAutoUpdater(updaterMainWindow(vi.fn())) - await prepareStagedMacUpdate(downloadUpdate) - getMacUpdateRunningInstancesMock.mockResolvedValue([9654]) - quitAndInstall() - await vi.advanceTimersByTimeAsync(1000) - const preventDefault = vi.fn() - appMock.emit('before-quit', { preventDefault }) - expect(preventDefault).not.toHaveBeenCalled() - // The main will-quit handler requests quit again after asynchronous teardown. - appMock.emit('before-quit', { preventDefault }) - expect(preventDefault).not.toHaveBeenCalled() - expect(autoUpdaterMock.quitAndInstall).not.toHaveBeenCalled() - } - ) - - it.runIf(process.platform === 'darwin')( - 'prevents duplicate quits until asynchronous update cleanup finishes', - async () => { - vi.useFakeTimers() - let finishCleanup = (): void => {} - const onBeforeQuit = vi.fn( - () => - new Promise((resolve) => { - finishCleanup = resolve - }) - ) - autoUpdaterMock.checkForUpdates.mockResolvedValue(undefined) - const { setupAutoUpdater, downloadUpdate, quitAndInstall } = await loadUpdaterModule() - setupAutoUpdater(updaterMainWindow(vi.fn()), { onBeforeQuit }) - await prepareStagedMacUpdate(downloadUpdate) - quitAndInstall() - await vi.advanceTimersByTimeAsync(1000) - expect(onBeforeQuit).toHaveBeenCalledTimes(1) - const preventDefault = vi.fn() - appMock.emit('before-quit', { preventDefault }) - expect(preventDefault).toHaveBeenCalledTimes(1) - expect(autoUpdaterMock.quitAndInstall).not.toHaveBeenCalled() - finishCleanup() - await vi.advanceTimersByTimeAsync(0) - const nativePreventDefault = vi.fn() - appMock.emit('before-quit', { preventDefault: nativePreventDefault }) - expect(nativePreventDefault).not.toHaveBeenCalled() - expect(autoUpdaterMock.quitAndInstall).toHaveBeenCalledTimes(1) - } - ) - - it.runIf(process.platform === 'darwin')( - 'cannot use a previous refusal to bypass a pending retry check', - async () => { - vi.useFakeTimers() - autoUpdaterMock.checkForUpdates.mockResolvedValue(undefined) - const { setupAutoUpdater, downloadUpdate, quitAndInstall } = await loadUpdaterModule() - setupAutoUpdater(updaterMainWindow(vi.fn())) - await prepareStagedMacUpdate(downloadUpdate) - getMacUpdateRunningInstancesMock.mockResolvedValue([9654]) - quitAndInstall() - await vi.advanceTimersByTimeAsync(1000) - let finishProbe = (_pids: number[]): void => {} - getMacUpdateRunningInstancesMock.mockImplementation( - () => - new Promise((resolve) => { - finishProbe = resolve - }) - ) - quitAndInstall() - const preventDefault = vi.fn() - appMock.emit('before-quit', { preventDefault }) - expect(preventDefault).toHaveBeenCalledOnce() - await vi.advanceTimersByTimeAsync(1000) - appMock.emit('before-quit', { preventDefault }) - expect(preventDefault).toHaveBeenCalledTimes(2) - expect(autoUpdaterMock.quitAndInstall).not.toHaveBeenCalled() - finishProbe([]) - await vi.advanceTimersByTimeAsync(0) - expect(autoUpdaterMock.quitAndInstall).toHaveBeenCalledOnce() - } - ) - - it.runIf(process.platform === 'darwin')( - 'permits ordinary shutdown after required update cleanup rejects', - async () => { - vi.useFakeTimers() - autoUpdaterMock.checkForUpdates.mockResolvedValue(undefined) - const onBeforeQuit = vi.fn().mockRejectedValue(new Error('required cleanup failed')) - const { setupAutoUpdater, downloadUpdate, quitAndInstall } = await loadUpdaterModule() - setupAutoUpdater(updaterMainWindow(vi.fn()), { - onBeforeQuit, - onBeforeQuitFailure: 'abort' - }) - await prepareStagedMacUpdate(downloadUpdate) - quitAndInstall() - await vi.advanceTimersByTimeAsync(1000) - expect(autoUpdaterMock.quitAndInstall).not.toHaveBeenCalled() - const preventDefault = vi.fn() - appMock.emit('before-quit', { preventDefault }) - appMock.emit('before-quit', { preventDefault }) - expect(preventDefault).not.toHaveBeenCalled() - expect(onBeforeQuit).toHaveBeenCalledOnce() - } - ) - it.runIf(process.platform === 'darwin')( 'keeps the install target and quit guard when checks or downloads are requested during a retry', async () => { diff --git a/src/main/updater/serve-update-handoff.ts b/src/main/updater/serve-update-handoff.ts index 5b42259ff9b..eeb57598236 100644 --- a/src/main/updater/serve-update-handoff.ts +++ b/src/main/updater/serve-update-handoff.ts @@ -2,7 +2,7 @@ import { mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync } from ' import { basename, dirname } from 'node:path' import { BROWSER_SIDECAR_OWNER_ENV } from '../../shared/browser-sidecar-lifetime' import { app } from 'electron' -import { quitProcess } from '../startup/process-quit-request' +import { quitProcess } from '../startup/quit/process-quit-request' import { SERVE_UPDATE_HANDOFF_PATH_ENV, getServeUpdateHandoffPath, diff --git a/src/main/updater/updater.quit-and-install.test.ts b/src/main/updater/updater.quit-and-install.test.ts index b38932b1c06..3c501177a47 100644 --- a/src/main/updater/updater.quit-and-install.test.ts +++ b/src/main/updater/updater.quit-and-install.test.ts @@ -39,7 +39,7 @@ vi.mock('./releases/updater-release-readiness', async (importOriginal) => ({ })) vi.mock('../local-builds/local-build-switch', () => moduleFactories.localBuildSwitch()) vi.mock('../local-builds/local-build-feed-server', () => moduleFactories.localBuildFeedServer()) -vi.mock('../startup/hydrate-shell-path', () => ({ +vi.mock('../startup/shell-environment/hydrate-shell-path', () => ({ runWithLaunchPath: (action: () => unknown): unknown => { launchPathScope.active = true launchPathScope.calls += 1 @@ -60,45 +60,6 @@ describe('updater', () => { launchPathScope.calls = 0 }) - it('still surfaces updater error events while a download is in flight', async () => { - fetchNewerReleaseTagsMock.mockResolvedValue({ tags: ['v1.0.61'], state: 'ready' }) - autoUpdaterMock.checkForUpdates.mockImplementation(() => { - autoUpdaterMock.emit('checking-for-update') - queueMicrotask(() => { - autoUpdaterMock.emit('update-available', { version: '1.0.61' }) - }) - return Promise.resolve(undefined) - }) - autoUpdaterMock.downloadUpdate.mockImplementation(() => { - autoUpdaterMock.emit('error', new Error('download failed')) - return new Promise(() => {}) - }) - const sendMock = vi.fn() - const mainWindow = updaterMainWindow(sendMock) - - const { setupAutoUpdater, checkForUpdatesFromMenu, downloadUpdate } = await loadUpdaterModule() - - setupAutoUpdater(mainWindow, { getLastUpdateCheckAt: () => Date.now() }) - checkForUpdatesFromMenu() - - await vi.waitFor(() => { - expect(sendMock).toHaveBeenCalledWith('updater:status', { - state: 'available', - version: '1.0.61', - changelog: null - }) - }) - - sendMock.mockClear() - downloadUpdate() - - expect(autoUpdaterMock.downloadUpdate).toHaveBeenCalledTimes(1) - expect(sendMock).toHaveBeenCalledWith( - 'updater:status', - expect.objectContaining({ state: 'error', message: 'download failed' }) - ) - }) - it('aborts native install when required pre-quit cleanup fails', async () => { vi.useFakeTimers() @@ -128,18 +89,6 @@ describe('updater', () => { ) }) - it('allows a required profile export to finish beyond the optional cleanup budget', async () => { - vi.useFakeTimers() - const onBeforeQuit = vi.fn(() => new Promise((resolve) => setTimeout(resolve, 5_000))) - const { setupAutoUpdater, quitAndInstall } = await loadUpdaterModule() - setupAutoUpdater(updaterMainWindow(vi.fn()), { onBeforeQuit, onBeforeQuitFailure: 'abort' }) - quitAndInstall() - await vi.advanceTimersByTimeAsync(2_600) - expect(autoUpdaterMock.quitAndInstall).not.toHaveBeenCalled() - await vi.advanceTimersByTimeAsync(2_500) - expect(autoUpdaterMock.quitAndInstall).toHaveBeenCalledOnce() - }) - it('aborts native install when required pre-quit cleanup times out', async () => { vi.useFakeTimers() @@ -172,35 +121,6 @@ describe('updater', () => { ) }) - it('ignores duplicate quitAndInstall requests while async pre-quit cleanup is running', async () => { - vi.useFakeTimers() - - let finishCleanup!: () => void - const onBeforeQuit = vi.fn( - () => - new Promise((resolve) => { - finishCleanup = resolve - }) - ) - const mainWindow = updaterMainWindow(vi.fn()) - const { setupAutoUpdater, quitAndInstall } = await loadUpdaterModule() - - setupAutoUpdater(mainWindow, { onBeforeQuit }) - quitAndInstall() - - await vi.advanceTimersByTimeAsync(100) - - expect(onBeforeQuit).toHaveBeenCalledTimes(1) - expect(autoUpdaterMock.quitAndInstall).not.toHaveBeenCalled() - - quitAndInstall() - finishCleanup() - await vi.advanceTimersByTimeAsync(0) - - expect(onBeforeQuit).toHaveBeenCalledTimes(1) - expect(autoUpdaterMock.quitAndInstall).toHaveBeenCalledTimes(1) - }) - it('recovers quit-for-update state on sync quitAndInstall error event without killing PTYs', async () => { vi.useFakeTimers() diff --git a/src/main/usage/cache/usage-cache-json.ts b/src/main/usage/cache/usage-cache-json.ts new file mode 100644 index 00000000000..520cc71ea27 --- /dev/null +++ b/src/main/usage/cache/usage-cache-json.ts @@ -0,0 +1,154 @@ +import { createReadStream } from 'node:fs' +import Assembler from 'stream-json/assembler.js' +import { createJsonTokenReader } from '../../../shared/json-stream/json-token-reader' +import { + JsonStringifyByteLimitError, + stringifyJsonWithinByteLimit +} from '../../../shared/json-stream/node-bounded-json-stringify' + +const TEXT_BATCH_CHARS = 64 * 1024 +const STRING_SLICE_CHARS = 4 * 1024 + +function prepareValue(value: unknown, key: string): unknown { + if (value !== null && typeof value === 'object') { + if ('toJSON' in value && typeof value.toJSON === 'function') { + value = value.toJSON(key) + } + const tag = Object.prototype.toString.call(value) + if ( + value !== null && + typeof value === 'object' && + (tag === '[object Number]' || tag === '[object String]' || tag === '[object Boolean]') + ) { + return value.valueOf() + } + } + return value +} + +function omitted(value: unknown): boolean { + return value === undefined || typeof value === 'function' || typeof value === 'symbol' +} + +function* encodeString(value: string): Generator { + if (value.length <= STRING_SLICE_CHARS) { + yield JSON.stringify(value) + return + } + yield '"' + for (let offset = 0; offset < value.length;) { + let end = Math.min(offset + STRING_SLICE_CHARS, value.length) + const last = value.charCodeAt(end - 1) + const next = value.charCodeAt(end) + // Each piece is encoded independently by both file writes and integrity hashes. + if (last >= 0xd800 && last <= 0xdbff && next >= 0xdc00 && next <= 0xdfff) { + end-- + } + yield JSON.stringify(value.slice(offset, end)).slice(1, -1) + offset = end + } + yield '"' +} + +function* encodeValue( + value: unknown, + ancestors: Set, + nativeRecord = false +): Generator { + if (typeof value === 'string') { + yield* encodeString(value) + return + } + if (value === null || typeof value !== 'object') { + const text = JSON.stringify(value) + if (text === undefined) { + throw new TypeError('Usage cache value is not JSON serializable') + } + yield text + return + } + if (ancestors.has(value)) { + throw new TypeError('Usage cache contains a circular value') + } + if (nativeRecord) { + try { + yield stringifyJsonWithinByteLimit(value, 256 * 1024).serialized + return + } catch (error) { + if (!(error instanceof JsonStringifyByteLimitError)) { + throw error + } + } + } + ancestors.add(value) + try { + if (Array.isArray(value)) { + yield '[' + for (let index = 0; index < value.length; index++) { + if (index > 0) { + yield ',' + } + const item = prepareValue(value[index], String(index)) + yield* encodeValue(omitted(item) ? null : item, ancestors, true) + } + yield ']' + } else { + yield '{' + let first = true + for (const [key, raw] of Object.entries(value)) { + const item = prepareValue(raw, key) + if (omitted(item)) { + continue + } + if (!first) { + yield ',' + } + first = false + yield* encodeString(key) + yield ':' + yield* encodeValue(item, ancestors) + } + yield '}' + } + } finally { + ancestors.delete(value) + } +} + +/** Batch traversal output without materializing a whole source, string or document. */ +export function* encodeUsageCacheJson(value: unknown): Generator { + let parts: string[] = [] + let length = 0 + for (const part of encodeValue(prepareValue(value, ''), new Set())) { + if (length + part.length > TEXT_BATCH_CHARS && length > 0) { + yield parts.join('') + parts = [] + length = 0 + } + parts.push(part) + length += part.length + } + if (length > 0) { + yield parts.join('') + } +} + +/** EOF validation precedes exposing any of the privately assembled records. */ +export async function parseUsageCacheJson(chunks: AsyncIterable): Promise { + const assembler = new Assembler() + const reader = createJsonTokenReader((token) => assembler.consume(token)) + for await (const text of chunks) { + reader.write(text) + } + reader.end() + return assembler.current +} + +export function readUsageCacheJson(path: string): Promise { + return parseUsageCacheJson( + createReadStream(path, { + encoding: 'utf8', + highWaterMark: TEXT_BATCH_CHARS + }) + ) +} diff --git a/src/main/usage/cache/usage-cache-protected-json.ts b/src/main/usage/cache/usage-cache-protected-json.ts new file mode 100644 index 00000000000..1e91c55469b --- /dev/null +++ b/src/main/usage/cache/usage-cache-protected-json.ts @@ -0,0 +1,85 @@ +import { createHash } from 'node:crypto' +import { encodeUsageCacheJson, parseUsageCacheJson } from './usage-cache-json' + +const INTEGRITY_HEADER = /^\{"usageIntegrity":"([a-f0-9]{64})",/ +const HEADER_CHARS = '{"usageIntegrity":"'.length + 64 + '",'.length + +export function protectedUsageCacheJson( + value: unknown, + domain: string, + sealed = true +): { + bytes: number + encode: () => Generator +} { + const hash = createHash('sha256').update(domain).update('\n') + let bytes = 0 + for (const text of encodeUsageCacheJson(value)) { + hash.update(text) + bytes += Buffer.byteLength(text) + } + const digest = hash.digest('hex') + const prefix = `{"usageIntegrity":"${digest}",` + return { + bytes: bytes + (sealed ? Buffer.byteLength(prefix) - 1 : 0), + encode: function* () { + let first = true + for (const text of encodeUsageCacheJson(value)) { + if (first && sealed) { + if (!text.startsWith('{')) { + throw new Error('Usage cache integrity requires a JSON object.') + } + yield prefix + yield text.slice(1) + } else { + yield text + } + first = false + } + } + } +} + +/** Verify the original decoded text, never an equivalent re-encoding. */ +export async function readProtectedUsageCacheJson( + chunks: AsyncIterable, + domain: string, + strict = true +): Promise<{ parsed: T; verified: boolean }> { + const hash = createHash('sha256').update(domain).update('\n{') + let leading = '' + let header: RegExpExecArray | null | undefined + async function* inspect(): AsyncGenerator { + for await (const text of chunks) { + if (header === undefined) { + const taken = Math.min(HEADER_CHARS - leading.length, text.length) + leading += text.slice(0, taken) + if (leading.length === HEADER_CHARS) { + header = INTEGRITY_HEADER.exec(leading) + if (header) { + hash.update(text.slice(taken)) + } + } + } else if (header) { + hash.update(text) + } + yield text + } + } + const parsed = await parseUsageCacheJson(inspect()) + if (!parsed || typeof parsed !== 'object') { + throw new Error('Saved usage cache must be a JSON object.') + } + header ??= INTEGRITY_HEADER.exec(leading) + if (!header) { + if (strict && parsed.usageIntegrity !== undefined) { + throw new Error('Saved usage cache integrity framing is invalid.') + } + return { parsed, verified: false } + } + const verified = parsed.usageIntegrity === header[1] && hash.digest('hex') === header[1] + if (strict && !verified) { + throw new Error('Saved usage cache integrity does not match its contents.') + } + return { parsed, verified } +} diff --git a/src/main/usage/cache/usage-cache-snapshot-writer.ts b/src/main/usage/cache/usage-cache-snapshot-writer.ts index f3f2527ef4f..03737455a46 100644 --- a/src/main/usage/cache/usage-cache-snapshot-writer.ts +++ b/src/main/usage/cache/usage-cache-snapshot-writer.ts @@ -3,7 +3,8 @@ import { dirname } from 'node:path' import { durableWriteTempPath, removeStaleDurableWriteTempFiles, - writeFileDurableIfCurrent + writeFileDurableIfCurrent, + type DurableFilePayload } from '../../filesystem/durable-file-write' // Serialize durable writes per store and skip superseded snapshots. @@ -20,7 +21,7 @@ export class UsageCacheSnapshotWriter { } /** `serialize` runs only if this snapshot is still the newest one when its turn comes. */ - write(serialize: () => string): Promise { + write(serialize: () => DurableFilePayload): Promise { const generation = ++this.generation const write = this.pending.then(() => this.commit(generation, serialize)) // Keep the queue usable after failure; the caller still receives the rejection. @@ -35,7 +36,7 @@ export class UsageCacheSnapshotWriter { return this.pending } - private async commit(generation: number, serialize: () => string): Promise { + private async commit(generation: number, serialize: () => DurableFilePayload): Promise { if (generation !== this.generation) { return } diff --git a/src/main/usage/cache/usage-inline-cache-preservation.ts b/src/main/usage/cache/usage-inline-cache-preservation.ts index 8a2c3d04081..7125a8f536d 100644 --- a/src/main/usage/cache/usage-inline-cache-preservation.ts +++ b/src/main/usage/cache/usage-inline-cache-preservation.ts @@ -1,5 +1,5 @@ -import { readFile } from 'node:fs/promises' import type { UsageCacheSnapshotWriter } from './usage-cache-snapshot-writer' +import { encodeUsageCacheJson, readUsageCacheJson } from './usage-cache-json' export class UsageInlineCachePreservation { active = false @@ -18,11 +18,12 @@ export class UsageInlineCachePreservation { this.pending = this.pending .catch(() => {}) .then(async () => { - const parsed: { scanState: { enabled: boolean } } = JSON.parse( - await readFile(cacheFile, 'utf8') - ) + const parsed = await readUsageCacheJson<{ scanState: { enabled: boolean } }>(cacheFile) + if (!parsed) { + throw new Error('Saved inline usage cache is invalid') + } parsed.scanState.enabled = enabled() - await writer.write(() => (this.active ? JSON.stringify(parsed) : serializeReport())) + await writer.write(() => (this.active ? encodeUsageCacheJson(parsed) : serializeReport())) }) return this.pending } diff --git a/src/main/usage/cache/usage-source-cache-file.test.ts b/src/main/usage/cache/usage-source-cache-file.test.ts index dc5d2675322..8f5bebf06a6 100644 --- a/src/main/usage/cache/usage-source-cache-file.test.ts +++ b/src/main/usage/cache/usage-source-cache-file.test.ts @@ -1,8 +1,13 @@ -import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' +import { mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it } from 'vitest' -import { splitUsageCacheFile, usageSourceCachePath } from './usage-source-cache-file' +import { + readUsageSourceCache, + splitUsageCacheFile, + usageSourceCachePath, + writeUsageSourceCache +} from './usage-source-cache-file' describe('usage source cache file', () => { let directory: string @@ -39,4 +44,78 @@ describe('usage source cache file', () => { sources: [{ path: 'a.jsonl' }] }) }) + + it('preserves large ownership records, JSON values and Unicode across encoded boundaries', async () => { + const ref = { + path: join(directory, 'sources.json'), + schemaVersion: 7, + worktreeFingerprint: 'w', + reuse: true + } + const label = `${'a'.repeat(4095)}😀é\n"\\\u0000\ud800` + const shared = { totalTokens: 29 } + const sources = [ + { + path: label, + ownedEventKeys: Array.from({ length: 1600 }, () => label), + hasDeferredClaims: true, + parseResumeState: { parsedBytes: 123, headDigest: 'head', boundaryDigest: 'tail' }, + dailyAggregates: [shared, shared], + optional: undefined, + extra: [undefined, Infinity], + packed: { toJSON: () => ({ ownedTokenColumns: [29, null] }) } + } + ] + await writeUsageSourceCache(ref, sources) + const saved = readFileSync(ref.path, 'utf8') + expect(saved).not.toContain('optional') + expect(JSON.parse(saved).sources[0].extra).toEqual([null, null]) + expect(await readUsageSourceCache(ref)).toEqual([ + { + path: label, + ownedEventKeys: Array.from({ length: 1600 }, () => label), + hasDeferredClaims: true, + parseResumeState: { parsedBytes: 123, headDigest: 'head', boundaryDigest: 'tail' }, + dailyAggregates: [{ totalTokens: 29 }, { totalTokens: 29 }], + extra: [null, null], + packed: { ownedTokenColumns: [29, null] } + } + ]) + + const prefix = '{"schemaVersion":7,"worktreeFingerprint":"w","sources":[{"path":"' + const padding = 'p'.repeat(65535 - Buffer.byteLength(prefix)) + writeFileSync(ref.path, `${prefix}${padding}😀é"}]}`) + expect(await readUsageSourceCache(ref)).toEqual([{ path: `${padding}😀é` }]) + }) + + it('never reuses a source prefix from a truncated or trailing-invalid document', async () => { + const ref = { + path: join(directory, 'sources.json'), + schemaVersion: 7, + worktreeFingerprint: 'w', + reuse: true + } + const complete = '{"schemaVersion":7,"worktreeFingerprint":"w","sources":[{"tokens":29}]}' + for (const text of [complete.slice(0, -1), `${complete} null`, `${complete} garbage`]) { + writeFileSync(ref.path, text) + expect(await readUsageSourceCache(ref)).toEqual([]) + } + }) + + it('keeps the prior cache and removes the partial temp when encoding fails after writing', async () => { + const ref = { + path: join(directory, 'sources.json'), + schemaVersion: 7, + worktreeFingerprint: 'w', + reuse: true + } + await writeUsageSourceCache(ref, [{ totalTokens: 29 }]) + const cyclic: { self?: unknown } = {} + cyclic.self = cyclic + await expect( + writeUsageSourceCache(ref, [{ path: 'a'.repeat(2_000_000) }, cyclic]) + ).rejects.toThrow() + expect(await readUsageSourceCache(ref)).toEqual([{ totalTokens: 29 }]) + expect(readdirSync(directory)).toEqual(['sources.json']) + }) }) diff --git a/src/main/usage/cache/usage-source-cache-file.ts b/src/main/usage/cache/usage-source-cache-file.ts index 81e7e51463a..d775c5fa708 100644 --- a/src/main/usage/cache/usage-source-cache-file.ts +++ b/src/main/usage/cache/usage-source-cache-file.ts @@ -1,11 +1,13 @@ -import { mkdir, readFile } from 'node:fs/promises' +import { mkdir } from 'node:fs/promises' import { dirname, join, parse } from 'node:path' import { threadId } from 'node:worker_threads' import { durableWriteTempPath, removeStaleDurableWriteTempFiles, - writeFileDurable + writeFileDurable, + type DurableFilePayload } from '../../filesystem/durable-file-write' +import { encodeUsageCacheJson, readUsageCacheJson } from './usage-cache-json' // Only scans need bulky per-source records; worker-owned sidecars keep them off main. @@ -35,7 +37,11 @@ export async function readUsageSourceCache(ref: UsageSourceCacheRef): Promise return [] } try { - const parsed = JSON.parse(await readFile(ref.path, 'utf-8')) + const parsed = await readUsageCacheJson<{ + schemaVersion: number + worktreeFingerprint: string | null + sources: T[] + }>(ref.path) // The sidecar can commit before its report, so validate attribution independently. return parsed?.schemaVersion === ref.schemaVersion && parsed.worktreeFingerprint === ref.worktreeFingerprint && @@ -51,9 +57,9 @@ export async function writeUsageSourceCache( ref: UsageSourceCacheRef, sources: readonly unknown[] ): Promise { - await writeUsageSourceCacheText( + await writeUsageSourceCacheData( ref, - JSON.stringify({ + encodeUsageCacheJson({ schemaVersion: ref.schemaVersion, worktreeFingerprint: ref.worktreeFingerprint, sources @@ -70,7 +76,7 @@ export async function writeUsageSourceCacheText( export async function writeUsageSourceCacheData( ref: UsageSourceCacheRef, - data: string | Uint8Array + data: DurableFilePayload ): Promise { await mkdir(dirname(ref.path), { recursive: true }).catch(() => {}) // Reclaim old durable-write temps left by workers terminated mid-write. @@ -87,25 +93,26 @@ export async function writeUsageSourceCacheData( export async function splitUsageCacheFile( request: UsageCacheSplitRequest ): Promise { - let text: string + let parsed: Record | null try { - text = await readFile(request.cacheFile, 'utf-8') + parsed = await readUsageCacheJson>(request.cacheFile) } catch (error) { if (error instanceof Error && 'code' in error && error.code === 'ENOENT') { return { reportText: null, migrated: false } } throw error } - const parsed = JSON.parse(text) - if (!parsed || typeof parsed !== 'object' || !Array.isArray(parsed[request.sourceKey])) { - return { reportText: text, migrated: false } + const sources = parsed?.[request.sourceKey] + if (!parsed || typeof parsed !== 'object' || !Array.isArray(sources)) { + return { reportText: JSON.stringify(parsed), migrated: false } } - const { [request.sourceKey]: sources, ...report } = parsed + const { [request.sourceKey]: _sources, ...report } = parsed await writeUsageSourceCache( { path: usageSourceCachePath(request.cacheFile), - schemaVersion: report.schemaVersion, - worktreeFingerprint: report.worktreeFingerprint ?? null, + schemaVersion: typeof report.schemaVersion === 'number' ? report.schemaVersion : 0, + worktreeFingerprint: + typeof report.worktreeFingerprint === 'string' ? report.worktreeFingerprint : null, reuse: true }, sources diff --git a/src/main/usage/provider-lifecycle/usage-provider-store-contract.ts b/src/main/usage/provider-lifecycle/usage-provider-store-contract.ts index 586f64a70e8..184e3ef0d54 100644 --- a/src/main/usage/provider-lifecycle/usage-provider-store-contract.ts +++ b/src/main/usage/provider-lifecycle/usage-provider-store-contract.ts @@ -37,6 +37,7 @@ export type UsageProviderStoreLifecycleConfig< integrityVerified?: boolean ) => State | Promise serializeReport?: (state: State) => string + readFallbackCache?: (path: string) => Promise<{ state: State; integrityVerified: boolean }> providerId?: 'claude' sourceKey: SourceKey dataPresenceKey: DataPresenceKey diff --git a/src/main/usage/provider-lifecycle/usage-provider-store-lifecycle.test.ts b/src/main/usage/provider-lifecycle/usage-provider-store-lifecycle.test.ts index ebbf500cea7..333deb2b3ba 100644 --- a/src/main/usage/provider-lifecycle/usage-provider-store-lifecycle.test.ts +++ b/src/main/usage/provider-lifecycle/usage-provider-store-lifecycle.test.ts @@ -1,4 +1,4 @@ -import { mkdtempSync, readFileSync, rmSync } from 'node:fs' +import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { dirname, join } from 'node:path' @@ -9,6 +9,8 @@ import type { UsageScanWorktreeRef } from './usage-provider-contract' import { UsageProviderStoreLifecycle } from './usage-provider-store-lifecycle' import { splitUsageCacheFile, + readUsageSourceCache, + usageSourceCachePath, type UsageCacheSplitRequest, type UsageCacheSplitResult, type UsageSourceCacheRef @@ -146,6 +148,52 @@ describe('UsageProviderStoreLifecycle', () => { vi.restoreAllMocks() }) + it('preserves inline sources across failed migration, an enabled toggle and a later retry', async () => { + const cacheFile = join(tempDirectory, 'inline.json') + const sidecar = usageSourceCachePath(cacheFile) + const sources = [{ id: 'owner', ownedEventKeys: ['turn-1|10,0,0,0,10|'], checkpoint: 123 }] + writeFileSync( + cacheFile, + JSON.stringify( + makeState({ + processedSources: sources, + sessions: [{ id: 'session' }], + dailyAggregates: [{ day: '2026-04-10' }], + scanState: { enabled: true } + }) + ) + ) + mkdirSync(sidecar) + vi.spyOn(console, 'warn').mockImplementation(() => {}) + const first = new TestUsageStore(cacheFile, scan, split, capture) + stores.push(first) + await first.whenLoaded() + expect(first.getState().sessions).toEqual([{ id: 'session' }]) + await first.setEnabled(false) + await first.flush() + expect(JSON.parse(readFileSync(cacheFile, 'utf8'))).toMatchObject({ + processedSources: sources, + dailyAggregates: [{ day: '2026-04-10' }], + scanState: { enabled: false } + }) + rmSync(sidecar, { recursive: true }) + const retried = new TestUsageStore(cacheFile, scan, split, capture) + stores.push(retried) + await retried.whenLoaded() + await retried.flush() + expect(retried.getState().sessions).toEqual([{ id: 'session' }]) + expect(retried.getScanState().enabled).toBe(false) + expect( + await readUsageSourceCache({ + path: sidecar, + schemaVersion: 1, + worktreeFingerprint: null, + reuse: true + }) + ).toEqual(sources) + expect(JSON.parse(readFileSync(cacheFile, 'utf8')).processedSources).toBeUndefined() + }) + it('keeps a successful scan when the first async telemetry consent request rejects', async () => { const cacheFile = join(tempDirectory, 'consent-rejection.json') const consent = vi diff --git a/src/main/usage/provider-lifecycle/usage-provider-store-lifecycle.ts b/src/main/usage/provider-lifecycle/usage-provider-store-lifecycle.ts index 9bbada658b3..a76137d9dd1 100644 --- a/src/main/usage/provider-lifecycle/usage-provider-store-lifecycle.ts +++ b/src/main/usage/provider-lifecycle/usage-provider-store-lifecycle.ts @@ -1,5 +1,4 @@ import { readFileSync, statSync } from 'node:fs' -import { readFile } from 'node:fs/promises' import { AgentTokenUsageReporter } from '../reporting/token-usage/agent-token-usage-reporter' import { join, parse } from 'node:path' import { @@ -14,6 +13,7 @@ import { } from '../worktree-attribution/usage-worktree-refs' import { UsageInlineCachePreservation } from '../cache/usage-inline-cache-preservation' import { usageSourceCachePath } from '../cache/usage-source-cache-file' +import { readUsageCacheJson } from '../cache/usage-cache-json' import type { UsageProviderStoreState, UsageProviderStoreLifecycleConfig, @@ -180,6 +180,7 @@ export abstract class UsageProviderStoreLifecycle< private async loadOnWorker(cacheFile: string): Promise { try { let fallback = false + let fallbackState: State | null = null const { reportText, migrated, reportIntegrityVerified } = await Promise.resolve() .then(() => this.config.splitCacheFile({ @@ -192,22 +193,29 @@ export abstract class UsageProviderStoreLifecycle< // Preserve usage history when the worker cannot start. console.warn(`${this.config.logTag} Reading the usage cache on the main thread:`, error) fallback = true + const loaded = this.config.readFallbackCache + ? await this.config.readFallbackCache(cacheFile) + : { state: await readUsageCacheJson(cacheFile), integrityVerified: false } + fallbackState = loaded.state + if (!fallbackState) { + throw new Error('Saved usage cache is invalid') + } return { - reportText: await readFile(cacheFile, 'utf-8'), + reportText: '', migrated: false, - reportIntegrityVerified: false + reportIntegrityVerified: loaded.integrityVerified } }) if (reportText === null) { return } - const parsed: State = JSON.parse(reportText) + const parsed: State = fallbackState ?? JSON.parse(reportText) this.inlineCache.active = fallback && !('usageIntegrity' in parsed) && Array.isArray(parsed[this.config.sourceKey]) && parsed[this.config.sourceKey].length > 0 - await this.applyReport(reportText, parsed, !fallback && reportIntegrityVerified === true) + await this.applyReport(reportText, parsed, reportIntegrityVerified === true) if (migrated) { // Future launches can read the compact report synchronously. await this.writeToDisk().catch(() => {}) diff --git a/src/main/usage/source-input/usage-record-coercion.ts b/src/main/usage/source-input/usage-record-coercion.ts index fe0700418d5..a409c7da406 100644 --- a/src/main/usage/source-input/usage-record-coercion.ts +++ b/src/main/usage/source-input/usage-record-coercion.ts @@ -1,11 +1,3 @@ export function ensureNumber(value: unknown): number { return typeof value === 'number' && Number.isFinite(value) ? value : 0 } - -export function extractString(value: unknown): string | null { - if (typeof value !== 'string') { - return null - } - const trimmed = value.trim() - return trimmed.length > 0 ? trimmed : null -} diff --git a/src/main/warp-themes/index.test.ts b/src/main/warp-themes/index.test.ts index 89b72abb79a..d7776d39761 100644 --- a/src/main/warp-themes/index.test.ts +++ b/src/main/warp-themes/index.test.ts @@ -56,24 +56,6 @@ function fileEntry(name: string) { } } -function symlinkEntry(name: string) { - return { - name, - isFile: () => false, - isDirectory: () => false, - isSymbolicLink: () => true - } -} - -function directoryEntry(name: string) { - return { - name, - isFile: () => false, - isDirectory: () => true, - isSymbolicLink: () => false - } -} - function mockDirectory( entries: { name: string @@ -108,220 +90,6 @@ describe('previewWarpThemeImport', () => { parseWarpThemeYamlWithTimeoutMock.mockImplementation(parseWarpThemeYaml) }) - it('sorts theme files before duplicate id suffixing', async () => { - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview.themes.map((theme) => theme.id)).toEqual([ - 'warp:duplicate:a-yml', - 'warp:duplicate:z-yml' - ]) - expect(readFileMock.mock.calls.map(([filePath]) => path.basename(filePath as string))).toEqual([ - 'a.yml', - 'z.yml' - ]) - }) - - it('returns an empty errorless preview when no local Warp theme folder exists', async () => { - statMock.mockImplementation(() => { - throw new Error('missing local themes') - }) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview).toMatchObject({ - found: false, - sourceLabel: 'Warp themes', - themes: [], - skippedFiles: [] - }) - expect(preview.error).toBeUndefined() - expect(readFileMock).not.toHaveBeenCalled() - }) - - it('returns an empty errorless preview for an empty readable local Warp theme folder', async () => { - opendirMock.mockResolvedValue(mockDirectory([])) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview).toMatchObject({ - found: false, - sourceLabel: 'Warp themes', - themes: [], - skippedFiles: [] - }) - expect(preview.error).toBeUndefined() - expect(readFileMock).not.toHaveBeenCalled() - }) - - it('merges themes from multiple readable Warp directories', async () => { - getWarpThemeDirectoriesMock.mockReturnValue([ - '/Users/alice/.warp/themes', - '/Users/alice/.warp-preview/themes' - ]) - opendirMock.mockImplementation((directoryPath: string) => { - if (directoryPath === '/Users/alice/.warp/themes') { - return Promise.resolve(mockDirectory([fileEntry('stable.yaml')])) - } - if (directoryPath === '/Users/alice/.warp-preview/themes') { - return Promise.resolve(mockDirectory([fileEntry('preview.yaml')])) - } - return Promise.resolve(mockDirectory([])) - }) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(readFileMock.mock.calls.map(([filePath]) => filePath)).toEqual([ - path.join('/Users/alice/.warp/themes', 'stable.yaml'), - path.join('/Users/alice/.warp-preview/themes', 'preview.yaml') - ]) - expect(preview.themes.map((theme) => theme.sourceLabel)).toEqual(['.warp', '.warp-preview']) - }) - - it('continues scanning when an earlier Warp directory is empty', async () => { - getWarpThemeDirectoriesMock.mockReturnValue([ - '/Users/alice/.warp/themes', - '/Users/alice/.warp-oss/themes' - ]) - opendirMock.mockImplementation((directoryPath: string) => { - if (directoryPath === '/Users/alice/.warp/themes') { - return Promise.resolve(mockDirectory([])) - } - if (directoryPath === '/Users/alice/.warp-oss/themes') { - return Promise.resolve(mockDirectory([fileEntry('oss.yaml')])) - } - return Promise.resolve(mockDirectory([])) - }) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview.found).toBe(true) - expect(readFileMock.mock.calls.map(([filePath]) => filePath)).toEqual([ - path.join('/Users/alice/.warp-oss/themes', 'oss.yaml') - ]) - expect(preview.themes.map((theme) => theme.sourceLabel)).toEqual(['.warp-oss']) - }) - - it('dedupes symlinked theme files by canonical path while preserving stable-first order', async () => { - getWarpThemeDirectoriesMock.mockReturnValue([ - '/Users/alice/.warp/themes', - '/Users/alice/.warp-preview/themes' - ]) - opendirMock.mockImplementation((directoryPath: string) => { - if (directoryPath === '/Users/alice/.warp/themes') { - return Promise.resolve(mockDirectory([fileEntry('shared.yaml')])) - } - if (directoryPath === '/Users/alice/.warp-preview/themes') { - return Promise.resolve(mockDirectory([fileEntry('shared.yaml')])) - } - return Promise.resolve(mockDirectory([])) - }) - realpathMock.mockResolvedValue('/Users/alice/.warp/themes/shared.yaml') - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview.themes).toHaveLength(1) - expect(readFileMock).toHaveBeenCalledWith( - path.join('/Users/alice/.warp/themes', 'shared.yaml'), - 'utf-8' - ) - expect(preview.themes[0]?.sourceLabel).toBe('.warp') - expect(preview.skippedFiles).not.toContainEqual({ - label: 'Warp themes', - reason: 'Only the first 200 theme files were scanned.' - }) - }) - - it('discovers YAML files exposed as symlinked Warp theme entries', async () => { - opendirMock.mockResolvedValue(mockDirectory([symlinkEntry('linked.yaml')])) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview.found).toBe(true) - expect(readFileMock).toHaveBeenCalledWith( - path.join('/Users/alice/.warp/themes', 'linked.yaml'), - 'utf-8' - ) - }) - - it('dedupes theme files by normalized resolved path when canonical paths are unavailable', async () => { - getWarpThemeDirectoriesMock.mockReturnValue([ - '/Users/alice/.warp/themes', - '/Users/alice/.warp/themes/../themes' - ]) - opendirMock.mockResolvedValue(mockDirectory([fileEntry('same.yaml')])) - realpathMock.mockRejectedValue(new Error('realpath unavailable')) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview.themes).toHaveLength(1) - expect(readFileMock).toHaveBeenCalledTimes(1) - }) - - it('applies the theme file cap globally across merged auto-discovery directories', async () => { - getWarpThemeDirectoriesMock.mockReturnValue([ - '/Users/alice/.warp/themes', - '/Users/alice/.warp-preview/themes' - ]) - opendirMock.mockImplementation((directoryPath: string) => { - if (directoryPath === '/Users/alice/.warp/themes') { - return Promise.resolve( - mockDirectory( - Array.from({ length: 150 }, (_, index) => fileEntry(`stable-${index}.yaml`)) - ) - ) - } - if (directoryPath === '/Users/alice/.warp-preview/themes') { - return Promise.resolve( - mockDirectory( - Array.from({ length: 150 }, (_, index) => fileEntry(`preview-${index}.yaml`)) - ) - ) - } - return Promise.resolve(mockDirectory([])) - }) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview.themes).toHaveLength(200) - expect(readFileMock).toHaveBeenCalledTimes(200) - expect(preview.skippedFiles).toContainEqual({ - label: 'Warp themes', - reason: 'Only the first 200 theme files were scanned.' - }) - }) - - it('reports the theme cap when later Warp directories contain themes after the cap is full', async () => { - getWarpThemeDirectoriesMock.mockReturnValue([ - '/Users/alice/.warp/themes', - '/Users/alice/.warp-preview/themes' - ]) - opendirMock.mockImplementation((directoryPath: string) => { - if (directoryPath === '/Users/alice/.warp/themes') { - return Promise.resolve( - mockDirectory( - Array.from({ length: 200 }, (_, index) => fileEntry(`stable-${index}.yaml`)) - ) - ) - } - if (directoryPath === '/Users/alice/.warp-preview/themes') { - return Promise.resolve(mockDirectory([fileEntry('preview.yaml')])) - } - return Promise.resolve(mockDirectory([])) - }) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview.themes).toHaveLength(200) - expect(readFileMock).not.toHaveBeenCalledWith( - path.join('/Users/alice/.warp-preview/themes', 'preview.yaml'), - 'utf-8' - ) - expect(preview.skippedFiles).toContainEqual({ - label: 'Warp themes', - reason: 'Only the first 200 theme files were scanned.' - }) - }) - it('keeps scanning later directories for unique themes after duplicate canonical files', async () => { const stableDirectory = '/Users/alice/.warp/themes' const previewDirectory = '/Users/alice/.warp-preview/themes' @@ -361,100 +129,6 @@ describe('previewWarpThemeImport', () => { expect(readFileMock).toHaveBeenCalledWith(path.join(previewDirectory, 'unique.yaml'), 'utf-8') }) - it('reports bounded skips when local Warp folders are unreadable', async () => { - opendirMock.mockRejectedValue( - new Error("EACCES: permission denied, scandir '/Users/alice/.warp/themes'") - ) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview.found).toBe(false) - expect(preview.sourceLabel).toBe('Warp themes') - expect(preview.skippedFiles).toEqual([{ label: '.warp', reason: 'Could not read folder.' }]) - expect(preview.themes).toEqual([]) - }) - - it('labels root skipped entries by auto-discovered Warp data home', async () => { - getWarpThemeDirectoriesMock.mockReturnValue([ - '/Users/alice/.warp/themes', - '/Users/alice/.warp-preview/themes' - ]) - opendirMock.mockRejectedValue(new Error('permission denied')) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview.skippedFiles).toEqual([ - { label: '.warp', reason: 'Could not read folder.' }, - { label: '.warp-preview', reason: 'Could not read folder.' } - ]) - }) - - it('returns a bounded preview error for invalid sources without auto discovery', async () => { - const preview = await previewWarpThemeImport({} as Store, { kind: 'surprise' }) - const nullPreview = await previewWarpThemeImport({} as Store, null) - const extraFieldPreview = await previewWarpThemeImport({} as Store, { - kind: 'auto', - path: '/Users/alice/.warp/themes' - }) - - expect(preview).toEqual({ - found: false, - themes: [], - skippedFiles: [], - error: 'Invalid Warp theme import source.' - }) - expect(nullPreview.error).toBe('Invalid Warp theme import source.') - expect(extraFieldPreview.error).toBe('Invalid Warp theme import source.') - expect(getWarpThemeDirectoriesMock).not.toHaveBeenCalled() - }) - - it('uses stable file labels in imported theme ids', async () => { - opendirMock.mockImplementation((directoryPath: string) => { - if (directoryPath.endsWith('themes')) { - return Promise.resolve( - mockDirectory([directoryEntry('standard'), directoryEntry('custom')]) - ) - } - if (directoryPath.endsWith('standard')) { - return Promise.resolve(mockDirectory([fileEntry('duplicate.yaml')])) - } - if (directoryPath.endsWith('custom')) { - return Promise.resolve(mockDirectory([fileEntry('duplicate.yaml')])) - } - return Promise.resolve(mockDirectory([])) - }) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview.themes.map((theme) => theme.id)).toEqual([ - 'warp:duplicate:custom-duplicate-yaml', - 'warp:duplicate:standard-duplicate-yaml' - ]) - }) - - it('stops scheduling parser work when the preview budget expires', async () => { - let currentTime = 0 - parseWarpThemeYamlWithTimeoutMock.mockImplementation( - (...args: Parameters) => { - currentTime = 10 - return parseWarpThemeYaml(...args) - } - ) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }, undefined, { - operationBudgetMs: 5, - now: () => currentTime - }) - - expect(preview.themes).toHaveLength(1) - expect(parseWarpThemeYamlWithTimeoutMock).toHaveBeenCalledTimes(1) - expect(parseWarpThemeYamlWithTimeoutMock.mock.calls[0]?.[3]).toEqual({ timeoutMs: 5 }) - expect(preview.skippedFiles).toContainEqual({ - label: 'Warp themes', - reason: 'Preview budget expired before 1 theme file could be parsed.' - }) - }) - it('keeps same-basename manual file ids stable independent of dialog order', async () => { const firstPath = path.join('/Users/alice/light', 'duplicate.yaml') const secondPath = path.join('/Users/alice/dark', 'duplicate.yaml') @@ -485,195 +159,6 @@ describe('previewWarpThemeImport', () => { expect(ids.every((id) => id.startsWith('warp:duplicate:duplicate-yaml-'))).toBe(true) }) - it('marks dismissed file pickers as canceled', async () => { - showOpenDialogMock.mockResolvedValueOnce({ canceled: true, filePaths: [] }) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'chooseFile' }) - - expect(preview).toEqual({ found: false, canceled: true, themes: [], skippedFiles: [] }) - }) - - it('starts the preview budget after a manual file picker returns', async () => { - let currentTime = 0 - showOpenDialogMock.mockImplementationOnce(() => { - currentTime = 10 - return Promise.resolve({ - canceled: false, - filePaths: [path.join('/Users/alice/themes', 'manual.yaml')] - }) - }) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'chooseFile' }, undefined, { - operationBudgetMs: 5, - now: () => currentTime - }) - - expect(preview.themes).toHaveLength(1) - expect(parseWarpThemeYamlWithTimeoutMock.mock.calls[0]?.[3]).toEqual({ timeoutMs: 5 }) - expect(preview.skippedFiles).toEqual([]) - }) - - it('starts the preview budget after a manual folder picker returns', async () => { - let currentTime = 0 - showOpenDialogMock.mockImplementationOnce(() => { - currentTime = 10 - return Promise.resolve({ - canceled: false, - filePaths: ['/Users/alice/themes'] - }) - }) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'chooseFolder' }, undefined, { - operationBudgetMs: 5, - now: () => currentTime - }) - - expect(preview.themes).toHaveLength(2) - expect(parseWarpThemeYamlWithTimeoutMock.mock.calls[0]?.[3]).toEqual({ timeoutMs: 5 }) - expect(preview.skippedFiles).toEqual([]) - }) - - it('finds themes in a cloned Warp themes repository layout', async () => { - opendirMock.mockImplementation((directoryPath: string) => { - if (directoryPath.endsWith('themes')) { - return Promise.resolve( - mockDirectory([directoryEntry('standard'), directoryEntry('warp_bundled')]) - ) - } - if (directoryPath.endsWith('standard')) { - return Promise.resolve(mockDirectory([fileEntry('tokyo-night.yaml')])) - } - if (directoryPath.endsWith('warp_bundled')) { - return Promise.resolve(mockDirectory([fileEntry('dracula.yml')])) - } - return Promise.resolve(mockDirectory([])) - }) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview.found).toBe(true) - expect(readFileMock.mock.calls.map(([filePath]) => filePath)).toEqual([ - path.join('/Users/alice/.warp/themes', 'standard', 'tokyo-night.yaml'), - path.join('/Users/alice/.warp/themes', 'warp_bundled', 'dracula.yml') - ]) - expect(preview.themes.map((theme) => theme.sourceLabel)).toEqual(['.warp', '.warp']) - }) - - it('caps broad folder scans before walking unbounded child directories', async () => { - opendirMock.mockImplementation((directoryPath: string) => { - if (directoryPath.endsWith('themes')) { - return Promise.resolve( - mockDirectory( - Array.from({ length: 100 }, (_, index) => directoryEntry(`folder-${index}`)) - ) - ) - } - return Promise.resolve(mockDirectory([fileEntry(`${path.basename(directoryPath)}.yaml`)])) - }) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview.themes).toHaveLength(79) - expect(preview.skippedFiles).toContainEqual({ - label: '.warp', - reason: 'Only the first 80 folders were scanned.' - }) - }) - - it('reports the theme cap when a nested folder fills the cap before later folders', async () => { - opendirMock.mockImplementation((directoryPath: string) => { - if (directoryPath.endsWith('themes')) { - return Promise.resolve( - mockDirectory([directoryEntry('standard'), directoryEntry('warp_bundled')]) - ) - } - if (directoryPath.endsWith('standard')) { - return Promise.resolve( - mockDirectory(Array.from({ length: 200 }, (_, index) => fileEntry(`theme-${index}.yaml`))) - ) - } - if (directoryPath.endsWith('warp_bundled')) { - return Promise.resolve(mockDirectory([fileEntry('extra.yaml')])) - } - return Promise.resolve(mockDirectory([])) - }) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview.themes).toHaveLength(200) - expect(preview.skippedFiles).toContainEqual({ - label: 'Warp themes', - reason: 'Only the first 200 theme files were scanned.' - }) - expect(opendirMock).not.toHaveBeenCalledWith( - path.join('/Users/alice/.warp/themes', 'warp_bundled'), - expect.anything() - ) - }) - - it('caps entries processed from one large folder', async () => { - opendirMock.mockResolvedValue( - mockDirectory(Array.from({ length: 501 }, (_, index) => fileEntry(`theme-${index}.yaml`))) - ) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview.themes).toHaveLength(200) - expect(preview.skippedFiles).toEqual( - expect.arrayContaining([ - { - label: '.warp', - reason: 'Only the first 500 folder entries were scanned.' - }, - { - label: 'Warp themes', - reason: 'Only the first 200 theme files were scanned.' - } - ]) - ) - }) - - it('reports capped manually selected theme files after deterministic YAML sorting', async () => { - const themePaths = Array.from({ length: 201 }, (_, index) => - path.join('/Users/alice/warp-themes', `theme-${String(index).padStart(3, '0')}.yaml`) - ) - showOpenDialogMock.mockResolvedValue({ - canceled: false, - filePaths: [ - path.join('/Users/alice/warp-themes', 'aaa-not-theme.txt'), - ...themePaths - ].toReversed() - }) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'chooseFile' }) - - expect(preview.themes).toHaveLength(200) - expect(readFileMock.mock.calls[0]?.[0]).toBe(themePaths[0]) - expect(readFileMock.mock.calls.at(-1)?.[0]).toBe(themePaths[199]) - expect(preview.skippedFiles).toContainEqual({ - label: 'Selected Warp themes', - reason: 'Only the first 200 theme files were scanned.' - }) - }) - - it('does not report the manual theme cap for extra non-YAML selections', async () => { - const themePaths = Array.from({ length: 200 }, (_, index) => - path.join('/Users/alice/warp-themes', `theme-${String(index).padStart(3, '0')}.yaml`) - ) - showOpenDialogMock.mockResolvedValue({ - canceled: false, - filePaths: [...themePaths, path.join('/Users/alice/warp-themes', 'readme.txt')] - }) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'chooseFile' }) - - expect(preview.themes).toHaveLength(200) - expect(preview.skippedFiles).not.toContainEqual({ - label: 'Selected Warp themes', - reason: 'Only the first 200 theme files were scanned.' - }) - }) - it('stops streaming a large folder after the entry budget', async () => { const yieldedNames: string[] = [] opendirMock.mockResolvedValue({ @@ -692,18 +177,4 @@ describe('previewWarpThemeImport', () => { expect(yieldedNames).not.toContain('theme-501.yaml') expect(yieldedNames).not.toContain('theme-999.yaml') }) - - it('does not copy absolute file paths into skipped reasons', async () => { - opendirMock.mockResolvedValue(mockDirectory([fileEntry('private.yml')])) - statMock.mockImplementation((filePath: string) => { - if (filePath.endsWith('private.yml')) { - throw new Error("EACCES: permission denied, stat '/Users/alice/.warp/themes/private.yml'") - } - return mockStat(filePath) - }) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview.skippedFiles).toEqual([{ label: 'private.yml', reason: 'Could not read file.' }]) - }) }) diff --git a/src/main/window/focus-existing-window.ts b/src/main/window/activation/focus-existing-window.ts similarity index 100% rename from src/main/window/focus-existing-window.ts rename to src/main/window/activation/focus-existing-window.ts diff --git a/src/main/window/foreground-activation-policy.test.ts b/src/main/window/activation/foreground-activation-policy.test.ts similarity index 55% rename from src/main/window/foreground-activation-policy.test.ts rename to src/main/window/activation/foreground-activation-policy.test.ts index aa37676f455..c89d058302e 100644 --- a/src/main/window/foreground-activation-policy.test.ts +++ b/src/main/window/activation/foreground-activation-policy.test.ts @@ -1,43 +1,9 @@ -import type { BrowserWindow } from 'electron' import { describe, expect, it, vi } from 'vitest' vi.mock('electron', () => ({ app: { dock: { hide: vi.fn() }, setActivationPolicy: vi.fn() } })) -const { - applyBackgroundActivationPolicy, - applyServeDesktopWindowActivationPolicy, - showWindowWithoutStealingFocus -} = await import('./foreground-activation-policy') - -function makeWindow(destroyed = false): BrowserWindow & { - show: ReturnType - showInactive: ReturnType -} { - return { - isDestroyed: () => destroyed, - show: vi.fn(() => {}), - showInactive: vi.fn(() => {}) - } as unknown as BrowserWindow & { - show: ReturnType - showInactive: ReturnType - } -} - -describe('showWindowWithoutStealingFocus', () => { - it('never reveals an explicitly background window', () => { - const window = makeWindow() - showWindowWithoutStealingFocus(window, { ORCA_BACKGROUND_LAUNCH: '1' }) - expect(window.showInactive).not.toHaveBeenCalled() - expect(window.show).not.toHaveBeenCalled() - }) - - it('still reveals explicitly headful E2E without activation', () => { - const window = makeWindow() - showWindowWithoutStealingFocus(window, { ORCA_E2E_HEADFUL: '1' }) - expect(window.showInactive).toHaveBeenCalledOnce() - expect(window.show).not.toHaveBeenCalled() - }) -}) +const { applyBackgroundActivationPolicy, applyServeDesktopWindowActivationPolicy } = + await import('./foreground-activation-policy') describe('applyBackgroundActivationPolicy', () => { function makeApp() { diff --git a/src/main/window/foreground-activation-policy.ts b/src/main/window/activation/foreground-activation-policy.ts similarity index 100% rename from src/main/window/foreground-activation-policy.ts rename to src/main/window/activation/foreground-activation-policy.ts diff --git a/src/main/window/macos-app-activation.ts b/src/main/window/activation/macos-app-activation.ts similarity index 100% rename from src/main/window/macos-app-activation.ts rename to src/main/window/activation/macos-app-activation.ts diff --git a/src/main/window/macos-desktop-handoff.ts b/src/main/window/activation/macos-desktop-handoff.ts similarity index 100% rename from src/main/window/macos-desktop-handoff.ts rename to src/main/window/activation/macos-desktop-handoff.ts diff --git a/src/main/window/attach-main-window-services.ts b/src/main/window/attach-main-window-services.ts index af4bbf2911a..e76388c6a9e 100644 --- a/src/main/window/attach-main-window-services.ts +++ b/src/main/window/attach-main-window-services.ts @@ -36,23 +36,21 @@ import { openCodeHookService, openCode2HookService } from '../opencode/status-ho import { listLiveDaemonPtyIds } from '../daemon/providers/lifecycle/daemon-provider-state' import { hydrateLocalPtyRegistryAtBoot } from '../memory/hydrate-local-pty-registry' import type { ClaudeRuntimeAuthPreparation } from '../claude-accounts/runtime-auth/runtime-auth-types' -import { getKnownWorktreeIdsForHistoryGc } from './history-gc-worktree-ids' +import { getKnownWorktreeIdsForHistoryGc } from '../pty/history/history-gc-worktree-ids' import type { ClaudeAccountSelectionTarget } from '../claude-accounts/selection/runtime-selection' import { scheduleWorktreeBaseDirectoryWatcherSync, setWorktreeBaseDirectoryWatcherSyncContext } from '../ipc/worktrees/creation/worktree-base-directory-watcher' import { startFolderRepoGitUpgradeWatch } from '../ipc/folder-repo-git-upgrade' -import { scheduleMainWindowAutoUpdaterSetup } from './main-window-updater' +import { scheduleMainWindowAutoUpdaterSetup } from '../updater/lifecycle/main-window-updater' import { registerRuntimeWindowLifecycle } from './runtime-window-lifecycle' import { ensureStructuredAgentSessionHostUnlessRefused } from '../runtime/agent-session/structured-agent-session-host-refusal' import { getAgentSessionAttachmentStore } from '../native-chat/agent-session-attachments/agent-session-attachment-store-registry' -import { registerDroppedPathPreparation } from './dropped-path-preparation-ipc' -import { isPluginFramePermissionRequest } from './host-frame-permission-policy' +import { registerDroppedPathPreparation } from './file-drop/dropped-path-preparation-ipc' +import { isPluginFramePermissionRequest } from './security/host-frame-permission-policy' import { installPluginDesktopFrameServices } from '../plugins/panels/desktop-actions/plugin-frame-desktop-services' -export { ensureAutoUpdaterConfigured, registerUpdaterHandlers } from './main-window-updater' - let appReloadHandlerTokenCounter = 0 let activeAppReloadHandlerToken: number | null = null let tccPromptHandlerTokenCounter = 0 diff --git a/src/main/window/clipboard-image-temp-file.test.ts b/src/main/window/clipboard-image-temp-file.test.ts deleted file mode 100644 index 292268b672b..00000000000 --- a/src/main/window/clipboard-image-temp-file.test.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { mkdtemp, rm } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import path from 'node:path' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' - -const environment = vi.hoisted(() => ({ temp: '' })) -vi.mock('../../shared/app-environment', () => ({ - getAppEnvironment: () => ({ getPath: () => environment.temp }) -})) - -import { saveClipboardImageBufferAsTempFile } from './clipboard-image-temp-file' - -describe('saveClipboardImageBufferAsTempFile', () => { - beforeEach(async () => { - environment.temp = await mkdtemp(path.join(tmpdir(), 'orca-clipboard-name-')) - }) - - afterEach(async () => { - await rm(environment.temp, { recursive: true, force: true }) - }) - - it.each([ - ['HEIC', Buffer.from('\x00\x00\x00\x18ftypheic\x00\x00\x00\x00', 'latin1'), /\.heic$/], - ['TIFF', Buffer.from([0x4d, 0x4d, 0x00, 0x2a, 0, 0, 0, 8]), /\.tiff$/], - ['unrecognised', Buffer.from(''), /^orca-paste-[^.]+$/] - ])('names %s bytes by what they are, never .png', async (_label, bytes, expected) => { - const saved = await saveClipboardImageBufferAsTempFile(bytes) - - expect(path.basename(saved)).toMatch(expected) - }) -}) diff --git a/src/main/window/clipboard-agent-session-attachment-paste.test.ts b/src/main/window/clipboard/clipboard-agent-session-attachment-paste.test.ts similarity index 87% rename from src/main/window/clipboard-agent-session-attachment-paste.test.ts rename to src/main/window/clipboard/clipboard-agent-session-attachment-paste.test.ts index ababc677469..9931c6994fd 100644 --- a/src/main/window/clipboard-agent-session-attachment-paste.test.ts +++ b/src/main/window/clipboard/clipboard-agent-session-attachment-paste.test.ts @@ -3,7 +3,7 @@ import { mkdtemp, readFile, rm } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { beforeEach, describe, expect, it, vi } from 'vitest' -import { AgentSessionAttachmentStore } from '../native-chat/agent-session-attachments/agent-session-attachment-store' +import { AgentSessionAttachmentStore } from '../../native-chat/agent-session-attachments/agent-session-attachment-store' const mocks = vi.hoisted(() => ({ handle: vi.fn(), @@ -21,22 +21,20 @@ vi.mock('electron', () => ({ ipcMain: { removeHandler: vi.fn(), handle: mocks.handle }, nativeImage: { createFromBuffer: vi.fn() } })) -vi.mock('../ipc/runtime-environments/runtime-environment-transport-routing', () => ({ +vi.mock('../../ipc/runtime-environments/runtime-environment-transport-routing', () => ({ callRuntimeEnvironment: mocks.callRuntimeEnvironment })) -vi.mock('../../shared/remote-runtime/host-store/runtime-environment-store', () => ({ +vi.mock('../../../shared/remote-runtime/host-store/runtime-environment-store', () => ({ resolveEnvironment: (_userDataPath: string, selector: string) => ({ id: selector }) })) vi.mock('./clipboard-remote-file-copy', () => ({ cleanupExpiredRemoteClipboardFiles: vi.fn(async () => {}), scheduleLegacyRemoteClipboardFileCleanup: vi.fn() })) -vi.mock('./dashboard-popout-window', () => ({ isDashboardPopoutRenderer: () => false })) +vi.mock('../dashboard-popout-window', () => ({ isDashboardPopoutRenderer: () => false })) -import { - registerClipboardHandlers, - setTrustedClipboardRendererWebContentsId -} from './clipboard-ipc-handlers' +import { registerClipboardHandlers } from './clipboard-ipc-handlers' +import { setTrustedClipboardRendererWebContentsId } from './clipboard-ipc-sender-trust' function saveHandler(): (...args: unknown[]) => Promise { const entry = mocks.handle.mock.calls.find( diff --git a/src/main/window/clipboard-copied-file-paths.test.ts b/src/main/window/clipboard/clipboard-copied-file-paths.test.ts similarity index 100% rename from src/main/window/clipboard-copied-file-paths.test.ts rename to src/main/window/clipboard/clipboard-copied-file-paths.test.ts diff --git a/src/main/window/clipboard-copied-file-paths.ts b/src/main/window/clipboard/clipboard-copied-file-paths.ts similarity index 100% rename from src/main/window/clipboard-copied-file-paths.ts rename to src/main/window/clipboard/clipboard-copied-file-paths.ts diff --git a/src/main/window/clipboard-dashboard-popout-access.test.ts b/src/main/window/clipboard/clipboard-dashboard-popout-access.test.ts similarity index 94% rename from src/main/window/clipboard-dashboard-popout-access.test.ts rename to src/main/window/clipboard/clipboard-dashboard-popout-access.test.ts index 889afa780e0..62ef2923e39 100644 --- a/src/main/window/clipboard-dashboard-popout-access.test.ts +++ b/src/main/window/clipboard/clipboard-dashboard-popout-access.test.ts @@ -36,16 +36,14 @@ vi.mock('electron', () => ({ nativeImage: { createFromBuffer: vi.fn() } })) -vi.mock('./dashboard-popout-window', () => ({ isDashboardPopoutRenderer })) +vi.mock('../dashboard-popout-window', () => ({ isDashboardPopoutRenderer })) vi.mock('./clipboard-remote-file-copy', () => ({ cleanupExpiredRemoteClipboardFiles: vi.fn(async () => undefined), scheduleLegacyRemoteClipboardFileCleanup: vi.fn() })) -import { - registerClipboardHandlers, - setTrustedClipboardRendererWebContentsId -} from './clipboard-ipc-handlers' +import { registerClipboardHandlers } from './clipboard-ipc-handlers' +import { setTrustedClipboardRendererWebContentsId } from './clipboard-ipc-sender-trust' const popoutEvent = { sender: { diff --git a/src/main/window/clipboard-file-copy.ts b/src/main/window/clipboard/clipboard-file-copy.ts similarity index 98% rename from src/main/window/clipboard-file-copy.ts rename to src/main/window/clipboard/clipboard-file-copy.ts index 43886735ac2..c2cc2044eeb 100644 --- a/src/main/window/clipboard-file-copy.ts +++ b/src/main/window/clipboard/clipboard-file-copy.ts @@ -2,7 +2,7 @@ import { isAbsolute } from 'node:path' import { pathToFileURL } from 'node:url' import type { ProcessResult, ProcessSpec } from '@orca/process-host/process-spec' import { windowsPowerShellPath } from '@orca/process-host/windows-system-binary' -import { withTimeout } from '../../shared/promise-timeout-fallback' +import { withTimeout } from '../../../shared/promise-timeout-fallback' export type ClipboardFileResult = { ok: boolean; reason?: string } diff --git a/src/main/window/clipboard-image-png-encode.ts b/src/main/window/clipboard/clipboard-image-png-encode.ts similarity index 84% rename from src/main/window/clipboard-image-png-encode.ts rename to src/main/window/clipboard/clipboard-image-png-encode.ts index a40df8f3641..701ebd1a0a7 100644 --- a/src/main/window/clipboard-image-png-encode.ts +++ b/src/main/window/clipboard/clipboard-image-png-encode.ts @@ -1,5 +1,5 @@ import type { NativeImage } from 'electron' -import { encodeClipboardImageWithinLimit } from '../../shared/clipboard-image' +import { encodeClipboardImageWithinLimit } from '../../../shared/clipboard-image' export function encodeClipboardNativeImagePng( image: Pick diff --git a/src/main/window/clipboard-image-source.ts b/src/main/window/clipboard/clipboard-image-source.ts similarity index 94% rename from src/main/window/clipboard-image-source.ts rename to src/main/window/clipboard/clipboard-image-source.ts index 6bcb4e168ee..1f64770008f 100644 --- a/src/main/window/clipboard-image-source.ts +++ b/src/main/window/clipboard/clipboard-image-source.ts @@ -1,4 +1,4 @@ -import { clipboardFormatsIncludeImage } from '../../shared/clipboard-image' +import { clipboardFormatsIncludeImage } from '../../../shared/clipboard-image' import { readWindowsCopiedImageFilePath, type WindowsClipboardFileFormats diff --git a/src/main/window/clipboard-image-temp-file.ts b/src/main/window/clipboard/clipboard-image-temp-file.ts similarity index 84% rename from src/main/window/clipboard-image-temp-file.ts rename to src/main/window/clipboard/clipboard-image-temp-file.ts index 869ba3622ce..ba443aebdbb 100644 --- a/src/main/window/clipboard-image-temp-file.ts +++ b/src/main/window/clipboard/clipboard-image-temp-file.ts @@ -2,16 +2,16 @@ import fs from 'node:fs/promises' import path from 'node:path' import { randomUUID } from 'node:crypto' -import { SshHostNotServedError } from '../providers/ssh-host-not-served-error' -import { getAppEnvironment } from '../../shared/app-environment' -import { assertClipboardImageByteLengthWithinLimit } from '../../shared/clipboard-image' +import { SshHostNotServedError } from '../../providers/ssh-host-not-served-error' +import { getAppEnvironment } from '../../../shared/app-environment' +import { assertClipboardImageByteLengthWithinLimit } from '../../../shared/clipboard-image' import { agentSessionPastedImageName, sanitizeAgentSessionAttachmentName, type AgentSessionAttachmentClipboardTarget -} from '../../shared/agent-session/agent-session-attachments' -import { detectImageFileExtension } from '../media/image-file-signature' -import { nativeChatPasteFolder } from './native-chat-paste-files' +} from '../../../shared/agent-session/agent-session-attachments' +import { detectImageFileExtension } from '../../../shared/image-file-signature' +import { nativeChatPasteFolder } from '../../native-chat/paste-files/native-chat-paste-files' export type SaveClipboardImageAsTempFileArgs = { connectionId?: string | null diff --git a/src/main/window/clipboard-image-thumbnail.ts b/src/main/window/clipboard/clipboard-image-thumbnail.ts similarity index 96% rename from src/main/window/clipboard-image-thumbnail.ts rename to src/main/window/clipboard/clipboard-image-thumbnail.ts index 3d9e9633eea..9976597f0ca 100644 --- a/src/main/window/clipboard-image-thumbnail.ts +++ b/src/main/window/clipboard/clipboard-image-thumbnail.ts @@ -2,7 +2,7 @@ import { clipboardImageThumbnailSize, type ClipboardImageDimensions, type ClipboardImageThumbnail -} from '../../shared/clipboard-image' +} from '../../../shared/clipboard-image' /** Minimal NativeImage surface for tests without an Electron runtime. */ export type ClipboardImageLike = { diff --git a/src/main/window/clipboard-ipc-handlers.ts b/src/main/window/clipboard/clipboard-ipc-handlers.ts similarity index 91% rename from src/main/window/clipboard-ipc-handlers.ts rename to src/main/window/clipboard/clipboard-ipc-handlers.ts index 4ab7419c76c..0696415f903 100644 --- a/src/main/window/clipboard-ipc-handlers.ts +++ b/src/main/window/clipboard/clipboard-ipc-handlers.ts @@ -2,10 +2,10 @@ import { app, clipboard, ipcMain, nativeImage } from 'electron' import { randomUUID } from 'node:crypto' import { open, stat } from 'node:fs/promises' import { runProcess } from '@orca/process-host' -import type { Store } from '../persistence/loading-store/store' -import { PATH_ACCESS_DENIED_MESSAGE } from '../ipc/filesystem/access/filesystem-auth' -import { resolveDesktopAuthorizedPath } from '../ipc/filesystem/access/local-file-access-resolution' -import { isENOENT } from '../ipc/filesystem/access/filesystem-path-containment' +import type { Store } from '../../persistence/loading-store/store' +import { PATH_ACCESS_DENIED_MESSAGE } from '../../ipc/filesystem/access/filesystem-auth' +import { resolveDesktopAuthorizedPath } from '../../ipc/filesystem/access/local-file-access-resolution' +import { isENOENT } from '../../ipc/filesystem/access/filesystem-path-containment' import { assertTrustedClipboardSender, assertTrustedClipboardTextSender @@ -14,8 +14,8 @@ import { assertClipboardTextWriteWithinLimitWithYield, assertClipboardTextWithinLimitWithYield, type ReadClipboardTextOptions -} from '../../shared/clipboard-text' -import { clipboardHtmlMayHaveLinks } from '../../shared/clipboard-link-html' +} from '../../../shared/clipboard-text' +import { clipboardHtmlMayHaveLinks } from '../../../shared/clipboard-link-html' import { saveClipboardImageBufferAsTempFile, type SaveClipboardImageAsTempFileArgs @@ -25,19 +25,19 @@ import { assertClipboardImageByteLengthWithinLimit, assertClipboardImageDimensionsWithinLimit, type ClipboardImageThumbnail -} from '../../shared/clipboard-image' +} from '../../../shared/clipboard-image' import { writeFileToClipboard, type ClipboardFileDeps, type ClipboardFileResult } from './clipboard-file-copy' -import { SshHostNotServedError } from '../providers/ssh-host-not-served-error' +import { SshHostNotServedError } from '../../providers/ssh-host-not-served-error' import { cleanupExpiredRemoteClipboardFiles, scheduleLegacyRemoteClipboardFileCleanup } from './clipboard-remote-file-copy' import { saveClipboardImageBufferInRuntime } from './clipboard-runtime-image-upload' -import { uploadPasteToAgentSessionAttachments } from '../ipc/agent-session-attachment-upload' +import { uploadPasteToAgentSessionAttachments } from '../../ipc/agent-session-attachment-upload' import { readWindowsClipboardImageFileAsPng } from './clipboard-windows-image-file' import { readClipboardImageSource } from './clipboard-image-source' import { readClipboardCopiedFilePaths } from './clipboard-copied-file-paths' @@ -50,12 +50,10 @@ import { publishClipboardOperation, publishClipboardText } from './clipboard-text-publisher' -import { restoreNativeChatPastes } from './native-chat-paste-files' +import { restoreNativeChatPastes } from '../../native-chat/paste-files/native-chat-paste-files' import { savePastedTextAsFile, type SavePastedTextAsFileArgs } from './native-chat-pasted-text-file' -import { agentSessionPastedImageName } from '../../shared/agent-session/agent-session-attachments' -import type { AgentSessionAttachmentStore } from '../native-chat/agent-session-attachments/agent-session-attachment-store' - -export { setTrustedClipboardRendererWebContentsId } from './clipboard-ipc-sender-trust' +import { agentSessionPastedImageName } from '../../../shared/agent-session/agent-session-attachments' +import type { AgentSessionAttachmentStore } from '../../native-chat/agent-session-attachments/agent-session-attachment-store' type ClipboardWriteFileRequest = { filePath: string diff --git a/src/main/window/clipboard-ipc-sender-trust.ts b/src/main/window/clipboard/clipboard-ipc-sender-trust.ts similarity index 86% rename from src/main/window/clipboard-ipc-sender-trust.ts rename to src/main/window/clipboard/clipboard-ipc-sender-trust.ts index 8961d5147de..7febecd0dff 100644 --- a/src/main/window/clipboard-ipc-sender-trust.ts +++ b/src/main/window/clipboard/clipboard-ipc-sender-trust.ts @@ -1,6 +1,6 @@ import type { IpcMainInvokeEvent, WebContents } from 'electron' -import { isTrustedMainRendererSender } from '../ipc/main-renderer-sender-trust' -import { isDashboardPopoutRenderer } from './dashboard-popout-window' +import { isTrustedMainRendererSender } from '../../ipc/main-renderer-sender-trust' +import { isDashboardPopoutRenderer } from '../dashboard-popout-window' let trustedClipboardRendererWebContentsId: number | null = null diff --git a/src/main/window/clipboard-macos-image-paste.test.ts b/src/main/window/clipboard/clipboard-macos-image-paste.test.ts similarity index 86% rename from src/main/window/clipboard-macos-image-paste.test.ts rename to src/main/window/clipboard/clipboard-macos-image-paste.test.ts index 66c5f3b103a..3b3e9bd95b6 100644 --- a/src/main/window/clipboard-macos-image-paste.test.ts +++ b/src/main/window/clipboard/clipboard-macos-image-paste.test.ts @@ -1,7 +1,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type * as FsPromises from 'node:fs/promises' -import { installFakeAppEnvironment } from '../../../config/scripts/test-runtime/environment/vitest-host-ports-setup' -import '../../shared/clipboard-image' +import { installFakeAppEnvironment } from '../../../../config/scripts/test-runtime/environment/vitest-host-ports-setup' +import '../../../shared/clipboard-image' const mocks = vi.hoisted(() => ({ handlers: new Map unknown>(), @@ -32,22 +32,20 @@ vi.mock('node:fs/promises', async (importOriginal) => { const fs = await importOriginal() return { ...fs, default: { ...fs, writeFile: mocks.writeFile } } }) -vi.mock('../persistence/loading-store/store', () => ({ Store: vi.fn() })) +vi.mock('../../persistence/loading-store/store', () => ({ Store: vi.fn() })) vi.mock('./clipboard-remote-file-copy', () => ({ cleanupExpiredRemoteClipboardFiles: vi.fn(), scheduleLegacyRemoteClipboardFileCleanup: vi.fn() })) -vi.mock('./native-chat-paste-files', () => ({ +vi.mock('../../native-chat/paste-files/native-chat-paste-files', () => ({ restoreNativeChatPastes: vi.fn(), nativeChatPasteFolder: () => '/tmp/native-chat-pastes' })) -vi.mock('./dashboard-popout-window', () => ({ isDashboardPopoutRenderer: () => false })) +vi.mock('../dashboard-popout-window', () => ({ isDashboardPopoutRenderer: () => false })) -import { Store } from '../persistence/loading-store/store' -import { - registerClipboardHandlers, - setTrustedClipboardRendererWebContentsId -} from './clipboard-ipc-handlers' +import { Store } from '../../persistence/loading-store/store' +import { registerClipboardHandlers } from './clipboard-ipc-handlers' +import { setTrustedClipboardRendererWebContentsId } from './clipboard-ipc-sender-trust' const event = { sender: { diff --git a/src/main/window/clipboard-native-image.ts b/src/main/window/clipboard/clipboard-native-image.ts similarity index 84% rename from src/main/window/clipboard-native-image.ts rename to src/main/window/clipboard/clipboard-native-image.ts index b93b8273478..1028333734c 100644 --- a/src/main/window/clipboard-native-image.ts +++ b/src/main/window/clipboard/clipboard-native-image.ts @@ -2,8 +2,8 @@ import { clipboard, nativeImage, type NativeImage } from 'electron' import { assertClipboardImageByteLengthWithinLimit, assertClipboardImageDimensionsWithinLimit -} from '../../shared/clipboard-image' -import { readRasterImageDimensions } from '../../shared/file-preview/raster-image-dimensions' +} from '../../../shared/clipboard-image' +import { readRasterImageDimensions } from '../../../shared/file-preview/raster-image-dimensions' export function readClipboardNativeImage(): NativeImage { const image = clipboard.readImage() diff --git a/src/main/window/clipboard-plain-text-read.test.ts b/src/main/window/clipboard/clipboard-plain-text-read.test.ts similarity index 100% rename from src/main/window/clipboard-plain-text-read.test.ts rename to src/main/window/clipboard/clipboard-plain-text-read.test.ts diff --git a/src/main/window/clipboard-plain-text-read.ts b/src/main/window/clipboard/clipboard-plain-text-read.ts similarity index 100% rename from src/main/window/clipboard-plain-text-read.ts rename to src/main/window/clipboard/clipboard-plain-text-read.ts diff --git a/src/main/window/clipboard-publisher-executable.test.ts b/src/main/window/clipboard/clipboard-publisher-executable.test.ts similarity index 100% rename from src/main/window/clipboard-publisher-executable.test.ts rename to src/main/window/clipboard/clipboard-publisher-executable.test.ts diff --git a/src/main/window/clipboard-publisher-executable.ts b/src/main/window/clipboard/clipboard-publisher-executable.ts similarity index 100% rename from src/main/window/clipboard-publisher-executable.ts rename to src/main/window/clipboard/clipboard-publisher-executable.ts diff --git a/src/main/window/clipboard-remote-file-copy.ts b/src/main/window/clipboard/clipboard-remote-file-copy.ts similarity index 100% rename from src/main/window/clipboard-remote-file-copy.ts rename to src/main/window/clipboard/clipboard-remote-file-copy.ts diff --git a/src/main/window/clipboard-remote-file-staging-fs.test.ts b/src/main/window/clipboard/clipboard-remote-file-staging-fs.test.ts similarity index 100% rename from src/main/window/clipboard-remote-file-staging-fs.test.ts rename to src/main/window/clipboard/clipboard-remote-file-staging-fs.test.ts diff --git a/src/main/window/clipboard-remote-file-staging.test.ts b/src/main/window/clipboard/clipboard-remote-file-staging.test.ts similarity index 100% rename from src/main/window/clipboard-remote-file-staging.test.ts rename to src/main/window/clipboard/clipboard-remote-file-staging.test.ts diff --git a/src/main/window/clipboard-remote-file-staging.ts b/src/main/window/clipboard/clipboard-remote-file-staging.ts similarity index 97% rename from src/main/window/clipboard-remote-file-staging.ts rename to src/main/window/clipboard/clipboard-remote-file-staging.ts index d7043d22869..114f5f8272a 100644 --- a/src/main/window/clipboard-remote-file-staging.ts +++ b/src/main/window/clipboard/clipboard-remote-file-staging.ts @@ -5,10 +5,10 @@ import { getOwnedTempStagingRoot, isDirectChild, isMissingPathError, - isSafeOwnedDirectory, removeOwnedDirectory, sweepExpiredOwnedDirectories -} from './owned-temp-staging-root' +} from '../../filesystem/owned-temp-staging-root' +import { isSafeOwnedDirectory } from '../../../shared/owned-private-directory' const REMOTE_CLIPBOARD_STAGING_ROOT_NAME = 'orca-clipboard-files' const REMOTE_CLIPBOARD_LEGACY_PREFIX = 'orca-clipboard-file-' diff --git a/src/main/window/clipboard-runtime-image-upload.ts b/src/main/window/clipboard/clipboard-runtime-image-upload.ts similarity index 96% rename from src/main/window/clipboard-runtime-image-upload.ts rename to src/main/window/clipboard/clipboard-runtime-image-upload.ts index 6b1f293503f..950baab483b 100644 --- a/src/main/window/clipboard-runtime-image-upload.ts +++ b/src/main/window/clipboard/clipboard-runtime-image-upload.ts @@ -1,5 +1,5 @@ -import { assertClipboardImageByteLengthWithinLimit } from '../../shared/clipboard-image' -import { callRuntimeEnvironment } from '../ipc/runtime-environments/runtime-environment-transport-routing' +import { assertClipboardImageByteLengthWithinLimit } from '../../../shared/clipboard-image' +import { callRuntimeEnvironment } from '../../ipc/runtime-environments/runtime-environment-transport-routing' const CLIPBOARD_IMAGE_UPLOAD_CHUNK_BASE64_CHARS = 512 * 1024 const CLIPBOARD_IMAGE_SINGLE_FRAME_FALLBACK_BASE64_CHARS = 256 * 1024 diff --git a/src/main/window/clipboard-text-publisher.test.ts b/src/main/window/clipboard/clipboard-text-publisher.test.ts similarity index 56% rename from src/main/window/clipboard-text-publisher.test.ts rename to src/main/window/clipboard/clipboard-text-publisher.test.ts index 3f585fec2d8..64c7c3fabfe 100644 --- a/src/main/window/clipboard-text-publisher.test.ts +++ b/src/main/window/clipboard/clipboard-text-publisher.test.ts @@ -2,10 +2,9 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import type { ProcessResult, ProcessSpec } from '@orca/process-host/process-spec' import { assertClipboardTextWriteWithinLimitWithYield, - CLIPBOARD_TEXT_MEASURE_YIELD_CODE_UNITS, CLIPBOARD_TEXT_WRITE_MAX_BYTES -} from '../../shared/clipboard-text' -import { CLIPBOARD_IMAGE_MAX_BASE64_CHARS } from '../../shared/clipboard-image' +} from '../../../shared/clipboard-text' +import { CLIPBOARD_IMAGE_MAX_BASE64_CHARS } from '../../../shared/clipboard-image' import { createClipboardPublisher } from './clipboard-text-publisher' vi.mock('electron', () => ({ app: {}, clipboard: {} })) @@ -34,38 +33,6 @@ describe('terminal clipboard writes', () => { run.mockResolvedValue(ok) }) - it('publishes different and duplicate text without asking Electron to own the selection', async () => { - const copy = writer() - const text = '遥か\r\nline two\n' - await copy(text) - await copy(text) - expect(run).toHaveBeenCalledTimes(2) - expect(run).toHaveBeenCalledWith({ - program: '/bundle/bin/orca-wayland-clipboard', - input: text, - timeoutMs: 2000, - stdio: ['pipe', 'ignore', 'ignore'] - }) - expect(write).not.toHaveBeenCalled() - expect(clearCache).toHaveBeenCalledTimes(2) - }) - - it('only discards a rejected Chromium source after the new owner is acknowledged', async () => { - let release: (value: typeof ok) => void = () => undefined - run.mockImplementationOnce( - () => - new Promise((resolve) => { - release = resolve - }) - ) - const pending = writer()('copy') - await vi.waitFor(() => expect(run).toHaveBeenCalledTimes(1)) - expect(clearCache).not.toHaveBeenCalled() - release(ok) - await pending - expect(clearCache).toHaveBeenCalledTimes(1) - }) - it.each([ ['timeout', { ...ok, code: null, timedOut: true }], ['helper failure', { ...ok, code: 70 }] @@ -76,20 +43,6 @@ describe('terminal clipboard writes', () => { expect(clearCache).not.toHaveBeenCalled() }) - it('preserves the existing clipboard when the bundled helper cannot start', async () => { - run.mockRejectedValueOnce(new Error('ENOENT')) - await expect(writer()('copy')).rejects.toThrow('ENOENT') - expect(write).not.toHaveBeenCalled() - expect(clearCache).not.toHaveBeenCalled() - }) - - it('retains verified Electron writes outside native Wayland', async () => { - await writer(false)('copy') - expect(write).toHaveBeenCalledWith('copy', 'terminal') - expect(run).not.toHaveBeenCalled() - expect(clearCache).not.toHaveBeenCalled() - }) - it('rejects oversized text before either clipboard backend is invoked', async () => { await expect(writer()('x'.repeat(CLIPBOARD_TEXT_WRITE_MAX_BYTES + 1))).rejects.toThrow( 'Clipboard text is too large' @@ -98,60 +51,6 @@ describe('terminal clipboard writes', () => { expect(write).not.toHaveBeenCalled() }) - it.each([false, true])( - 'keeps a newer copy after yielding validation (Wayland=%s)', - async (wayland) => { - vi.useFakeTimers() - try { - const copy = writer(wayland) - const large = 'x'.repeat(CLIPBOARD_TEXT_MEASURE_YIELD_CODE_UNITS * 2) - const first = copy(large, 'terminal') - const second = copy('newer', 'ordinary') - - await vi.runAllTimersAsync() - await Promise.all([first, second]) - - if (wayland) { - expect(run.mock.calls.map(([spec]) => spec.input === large)).toEqual([true, false]) - expect(run.mock.calls[1]?.[0].input).toBe('newer') - expect(write).not.toHaveBeenCalled() - } else { - expect(write.mock.calls.map(([text, kind]) => [text === large, kind])).toEqual([ - [true, 'terminal'], - [false, 'ordinary'] - ]) - expect(write.mock.calls[1]?.[0]).toBe('newer') - expect(run).not.toHaveBeenCalled() - } - } finally { - vi.useRealTimers() - } - } - ) - - it('preserves request order across yielding validation and resumes after failure', async () => { - let release: (text: string) => void = () => undefined - const validate = vi.fn(async (text: string) => text) - validate.mockImplementationOnce( - () => - new Promise((resolve) => { - release = resolve - }) - ) - run.mockRejectedValueOnce(new Error('helper failed')) - const copy = writer(true, validate) - const first = copy('first') - const firstRejected = expect(first).rejects.toThrow('helper failed') - const second = copy('second') - await vi.waitFor(() => expect(validate).toHaveBeenCalledTimes(1)) - expect(run).not.toHaveBeenCalled() - release('first') - await firstRejected - await second - expect(run.mock.calls.map(([spec]) => spec.input)).toEqual(['first', 'second']) - expect(clearCache).toHaveBeenCalledTimes(1) - }) - it.each([ { label: 'count', count: 32, bytes: 1 }, { label: 'retained bytes', count: 1, bytes: CLIPBOARD_IMAGE_MAX_BASE64_CHARS * 2 } diff --git a/src/main/window/clipboard-text-publisher.ts b/src/main/window/clipboard/clipboard-text-publisher.ts similarity index 93% rename from src/main/window/clipboard-text-publisher.ts rename to src/main/window/clipboard/clipboard-text-publisher.ts index 022338b6fed..0a66ffb3098 100644 --- a/src/main/window/clipboard-text-publisher.ts +++ b/src/main/window/clipboard/clipboard-text-publisher.ts @@ -5,13 +5,13 @@ import { assertClipboardTextWriteWithinLimitWithYield, CLIPBOARD_TEXT_WRITE_MAX_BYTES, CLIPBOARD_TEXT_WRITE_TOO_LARGE_ERROR -} from '../../shared/clipboard-text' -import { CLIPBOARD_IMAGE_MAX_BASE64_CHARS } from '../../shared/clipboard-image' -import { isLinuxWaylandSession } from '../../shared/linux-wayland-session' +} from '../../../shared/clipboard-text' +import { CLIPBOARD_IMAGE_MAX_BASE64_CHARS } from '../../../shared/clipboard-image' +import { isLinuxWaylandSession } from '../../../shared/linux-wayland-session' import { writeClipboardTextAndVerify } from './clipboard-text-write-verify' import { stageClipboardPublisher } from './clipboard-publisher-executable' -import { envWithoutAppImageRuntime } from '../pty/shell-startup/appimage-terminal-env' -import { isLegacyAppImageRuntimeIdentity } from '../updater/linux-package/linux-update-package-type' +import { envWithoutAppImageRuntime } from '../../pty/shell-startup/appimage-terminal-env' +import { isLegacyAppImageRuntimeIdentity } from '../../updater/linux-package/linux-update-package-type' const WAYLAND_CLIPBOARD_WRITE_FAILED_ERROR = 'Wayland clipboard write failed' const MAX_PENDING_CLIPBOARD_WRITES = 32 diff --git a/src/main/window/clipboard-text-write-verify.ts b/src/main/window/clipboard/clipboard-text-write-verify.ts similarity index 100% rename from src/main/window/clipboard-text-write-verify.ts rename to src/main/window/clipboard/clipboard-text-write-verify.ts diff --git a/src/main/window/clipboard-windows-image-file.test.ts b/src/main/window/clipboard/clipboard-windows-image-file.test.ts similarity index 97% rename from src/main/window/clipboard-windows-image-file.test.ts rename to src/main/window/clipboard/clipboard-windows-image-file.test.ts index c9657718077..d80d9f45d99 100644 --- a/src/main/window/clipboard-windows-image-file.test.ts +++ b/src/main/window/clipboard/clipboard-windows-image-file.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { CLIPBOARD_IMAGE_MAX_PIXELS } from '../../shared/clipboard-image' +import { CLIPBOARD_IMAGE_MAX_PIXELS } from '../../../shared/clipboard-image' import { readWindowsClipboardImageFileAsPng } from './clipboard-windows-image-file' function fileNameW(filePath: string): Buffer { diff --git a/src/main/window/clipboard-windows-image-file.ts b/src/main/window/clipboard/clipboard-windows-image-file.ts similarity index 99% rename from src/main/window/clipboard-windows-image-file.ts rename to src/main/window/clipboard/clipboard-windows-image-file.ts index 814f262fe33..c6f8483a91c 100644 --- a/src/main/window/clipboard-windows-image-file.ts +++ b/src/main/window/clipboard/clipboard-windows-image-file.ts @@ -4,7 +4,7 @@ import type { NativeImage } from 'electron' import { assertClipboardImageByteLengthWithinLimit, assertClipboardImageDimensionsWithinLimit -} from '../../shared/clipboard-image' +} from '../../../shared/clipboard-image' import { encodeClipboardNativeImagePng } from './clipboard-image-png-encode' type ClipboardImageFileHandle = Pick diff --git a/src/main/window/native-chat-pasted-text-file.test.ts b/src/main/window/clipboard/native-chat-pasted-text-file.test.ts similarity index 79% rename from src/main/window/native-chat-pasted-text-file.test.ts rename to src/main/window/clipboard/native-chat-pasted-text-file.test.ts index 3770e9f8259..e70c9dacaa8 100644 --- a/src/main/window/native-chat-pasted-text-file.test.ts +++ b/src/main/window/clipboard/native-chat-pasted-text-file.test.ts @@ -2,17 +2,17 @@ import { mkdtempSync, readFileSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import path from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { installFakeAppEnvironment } from '../../../config/scripts/test-runtime/environment/vitest-host-ports-setup' +import { installFakeAppEnvironment } from '../../../../config/scripts/test-runtime/environment/vitest-host-ports-setup' const mocks = vi.hoisted(() => ({ upload: vi.fn() })) vi.mock('electron', () => ({ app: { getPath: () => '/user-data' } })) -vi.mock('../ipc/agent-session-attachment-upload', () => ({ +vi.mock('../../ipc/agent-session-attachment-upload', () => ({ uploadPasteToAgentSessionAttachments: mocks.upload })) import { savePastedTextAsFile } from './native-chat-pasted-text-file' -import { AgentSessionAttachmentStore } from '../native-chat/agent-session-attachments/agent-session-attachment-store' +import { AgentSessionAttachmentStore } from '../../native-chat/agent-session-attachments/agent-session-attachment-store' describe('a long paste saved as a file', () => { let root: string diff --git a/src/main/window/native-chat-pasted-text-file.ts b/src/main/window/clipboard/native-chat-pasted-text-file.ts similarity index 79% rename from src/main/window/native-chat-pasted-text-file.ts rename to src/main/window/clipboard/native-chat-pasted-text-file.ts index 406b88e1f78..81fa1571d0c 100644 --- a/src/main/window/native-chat-pasted-text-file.ts +++ b/src/main/window/clipboard/native-chat-pasted-text-file.ts @@ -4,10 +4,10 @@ import { app } from 'electron' import { agentSessionPastedTextName, type AgentSessionAttachmentClipboardTarget -} from '../../shared/agent-session/agent-session-attachments' -import { assertClipboardTextWithinLimit } from '../../shared/clipboard-text' -import { uploadPasteToAgentSessionAttachments } from '../ipc/agent-session-attachment-upload' -import type { AgentSessionAttachmentStore } from '../native-chat/agent-session-attachments/agent-session-attachment-store' +} from '../../../shared/agent-session/agent-session-attachments' +import { assertClipboardTextWithinLimit } from '../../../shared/clipboard-text' +import { uploadPasteToAgentSessionAttachments } from '../../ipc/agent-session-attachment-upload' +import type { AgentSessionAttachmentStore } from '../../native-chat/agent-session-attachments/agent-session-attachment-store' export type SavePastedTextAsFileArgs = { text: string diff --git a/src/main/window/createMainWindow-close-confirmation.test.ts b/src/main/window/createMainWindow-close-confirmation.test.ts deleted file mode 100644 index ad620060a01..00000000000 --- a/src/main/window/createMainWindow-close-confirmation.test.ts +++ /dev/null @@ -1,365 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' - -vi.mock('electron', async () => - (await import('./createMainWindow-test-harness')).electronModuleMock() -) -vi.mock('./macos-tahoe-release', async () => - (await import('./createMainWindow-test-harness')).macosTahoeReleaseMock() -) -vi.mock('./desktop-integration/app-icon', async () => - (await import('./createMainWindow-test-harness')).appIconMock() -) -vi.mock('../browser/guest-lifecycle/manager/browser-manager', async () => - (await import('./createMainWindow-test-harness')).browserManagerMock() -) -vi.mock('../browser/routing/sessions/browser-route-session-runtime', async () => { - const harness = await import('./createMainWindow-test-harness') - return { - browserRouteSessionRegistry: { isAllowedPartition: harness.routePartitionAllowedMock }, - browserRouteWebContentsRegistry: { - attachGuest: harness.attachRouteGuestMock, - retireRenderer: harness.retireRouteRendererMock - } - } -}) -vi.mock('../browser/client-pages/renderer/browser-client-page-renderer-runtime', async () => { - const harness = await import('./createMainWindow-test-harness') - return { - attachBrowserClientPageRenderer: harness.attachClientPageRendererMock, - retireBrowserClientPageRenderer: harness.retireClientPageRendererMock - } -}) - -import { createMainWindow, WINDOW_QUIT_RENDERER_ACK_TIMEOUT_MS } from './createMainWindow' -import { ipcMain } from 'electron' -import { resetExpectedTeardownStateForTest } from '../crash-reporting/process-exits/expected-teardown-state' -import { - attachClientPageRendererMock, - browserWindowMock, - createRendererRecoveryWindowHarness, - resetMainWindowMocks, - retireClientPageRendererMock, - retireRouteRendererMock -} from './createMainWindow-test-harness' - -describe('createMainWindow', () => { - beforeEach(() => { - resetMainWindowMocks() - resetExpectedTeardownStateForTest() - vi.useRealTimers() - }) - - it('sends the next close as a plain close once its renderer cancels the newest quit request', () => { - const ipcHandlers: Record void> = {} - vi.mocked(ipcMain.on).mockImplementation((channel, handler) => { - ipcHandlers[channel] = handler as (...args: any[]) => void - return ipcMain - }) - const { browserWindowInstance, windowHandlers } = createRendererRecoveryWindowHarness() - let isQuitting = true - createMainWindow(null, { - getIsQuitting: () => isQuitting, - onQuitAborted: () => { - isQuitting = false - } - }) - const cancel = (senderId: number): void => - ipcHandlers['window:close-cancelled']?.({ sender: { id: senderId } }) - const retryClose = (): unknown => { - windowHandlers.close({ preventDefault: vi.fn() } as never) - return browserWindowInstance.webContents.send.mock.lastCall - } - - expect(retryClose()).toEqual(['window:close-requested', { isQuitting: true, requestId: 1 }]) - // Why: a cancel sent before the renderer saw this quit belongs to an older prompt. - cancel(143) - ipcHandlers['window:close-request-received']?.({ sender: { id: 143 } }, 1) - cancel(99) - expect(retryClose()).toEqual(['window:close-requested', { isQuitting: true, requestId: 2 }]) - ipcHandlers['window:close-request-received']?.({ sender: { id: 143 } }, 2) - cancel(143) - expect(retryClose()).toEqual(['window:close-requested', { isQuitting: false, requestId: 3 }]) - }) - - it('allows close after the renderer process is gone', () => { - const windowHandlers: Record void> = {} - const webContents = { - id: 71, - on: vi.fn((event, handler) => { - windowHandlers[event] = handler - }), - setZoomLevel: vi.fn(), - setBackgroundThrottling: vi.fn(), - setWebRTCIPHandlingPolicy: vi.fn(), - invalidate: vi.fn(), - setWindowOpenHandler: vi.fn(), - send: vi.fn(), - isCrashed: vi.fn(() => false) - } - const browserWindowInstance = { - webContents, - on: vi.fn((event, handler) => { - windowHandlers[event] = handler - }), - isDestroyed: vi.fn(() => false), - isMaximized: vi.fn(() => true), - isFullScreen: vi.fn(() => false), - getSize: vi.fn(() => [1200, 800]), - setSize: vi.fn(), - maximize: vi.fn(), - show: vi.fn(), - loadFile: vi.fn(() => Promise.resolve()), - loadURL: vi.fn(() => Promise.resolve()) - } - const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) - browserWindowMock.mockImplementation(function () { - return browserWindowInstance - }) - - createMainWindow(null, { getIsQuitting: () => true }) - - windowHandlers['render-process-gone']?.( - {} as never, - { - reason: 'crashed', - exitCode: 5 - } as never - ) - expect(retireRouteRendererMock).toHaveBeenCalledWith(71) - const preventDefault = vi.fn() - windowHandlers.close({ preventDefault } as never) - - expect(preventDefault).not.toHaveBeenCalled() - expect(webContents.send).not.toHaveBeenCalledWith( - 'window:close-requested', - expect.objectContaining({ isQuitting: true }) - ) - - consoleError.mockRestore() - }) - - it('does not persist pending bounds after bypassing close for a gone renderer', () => { - vi.useFakeTimers() - - const windowHandlers: Record void> = {} - const webContents = { - on: vi.fn((event, handler) => { - windowHandlers[event] = handler - }), - setZoomLevel: vi.fn(), - setBackgroundThrottling: vi.fn(), - setWebRTCIPHandlingPolicy: vi.fn(), - invalidate: vi.fn(), - setWindowOpenHandler: vi.fn(), - send: vi.fn(), - isCrashed: vi.fn(() => false) - } - const browserWindowInstance = { - webContents, - on: vi.fn((event, handler) => { - windowHandlers[event] = handler - }), - isDestroyed: vi.fn(() => false), - isMaximized: vi.fn(() => false), - isFullScreen: vi.fn(() => false), - getSize: vi.fn(() => [1200, 800]), - getBounds: vi.fn(() => ({ x: 10, y: 20, width: 1000, height: 700 })), - setSize: vi.fn(), - maximize: vi.fn(), - show: vi.fn(), - loadFile: vi.fn(() => Promise.resolve()), - loadURL: vi.fn(() => Promise.resolve()) - } - const updateUI = vi.fn() - const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) - browserWindowMock.mockImplementation(function () { - return browserWindowInstance - }) - - createMainWindow({ - getUI: () => ({}), - getSettings: () => ({ windowBackgroundBlur: false }), - updateUI - } as never) - - windowHandlers.resize() - windowHandlers['render-process-gone']?.( - {} as never, - { - reason: 'crashed', - exitCode: 5 - } as never - ) - const preventDefault = vi.fn() - windowHandlers.close({ preventDefault } as never) - vi.advanceTimersByTime(500) - - expect(preventDefault).not.toHaveBeenCalled() - expect(updateUI).not.toHaveBeenCalled() - - consoleError.mockRestore() - }) - - it('resumes close confirmation after a renderer process reloads', () => { - const windowHandlers: Record void> = {} - const webContents = { - on: vi.fn((event, handler) => { - windowHandlers[event] = handler - }), - setZoomLevel: vi.fn(), - setBackgroundThrottling: vi.fn(), - setWebRTCIPHandlingPolicy: vi.fn(), - invalidate: vi.fn(), - setWindowOpenHandler: vi.fn(), - send: vi.fn(), - isCrashed: vi.fn(() => false) - } - const browserWindowInstance = { - webContents, - on: vi.fn((event, handler) => { - windowHandlers[event] = handler - }), - isDestroyed: vi.fn(() => false), - isMaximized: vi.fn(() => true), - isFullScreen: vi.fn(() => false), - getSize: vi.fn(() => [1200, 800]), - setSize: vi.fn(), - maximize: vi.fn(), - show: vi.fn(), - loadFile: vi.fn(() => Promise.resolve()), - loadURL: vi.fn(() => Promise.resolve()) - } - const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) - browserWindowMock.mockImplementation(function () { - return browserWindowInstance - }) - - createMainWindow(null, { getIsQuitting: () => true }) - - windowHandlers['render-process-gone']?.( - {} as never, - { - reason: 'crashed', - exitCode: 5 - } as never - ) - windowHandlers['did-finish-load']?.() - const preventDefault = vi.fn() - windowHandlers.close({ preventDefault } as never) - - expect(preventDefault).toHaveBeenCalledTimes(1) - expect(retireClientPageRendererMock).toHaveBeenCalledWith(webContents) - expect(attachClientPageRendererMock).toHaveBeenCalledWith(webContents) - expect(webContents.send).toHaveBeenCalledWith('window:close-requested', { - isQuitting: true, - requestId: expect.any(Number) - }) - - consoleError.mockRestore() - }) - - it('destroys an already-unresponsive renderer after an app-wide quit deadline', async () => { - vi.useFakeTimers() - const windowHandlers: Record void> = {} - const webContents = { - id: 42, - on: vi.fn((event, handler) => { - windowHandlers[event] = handler - }), - setZoomLevel: vi.fn(), - setBackgroundThrottling: vi.fn(), - setWebRTCIPHandlingPolicy: vi.fn(), - invalidate: vi.fn(), - setWindowOpenHandler: vi.fn(), - send: vi.fn(), - isCrashed: vi.fn(() => false) - } - const destroy = vi.fn() - browserWindowMock.mockImplementation(function () { - return { - webContents, - on: vi.fn((event, handler) => { - windowHandlers[event] = handler - }), - isDestroyed: vi.fn(() => false), - isMaximized: vi.fn(() => true), - isFullScreen: vi.fn(() => false), - getSize: vi.fn(() => [1200, 800]), - setSize: vi.fn(), - maximize: vi.fn(), - show: vi.fn(), - destroy, - loadFile: vi.fn(() => Promise.resolve()), - loadURL: vi.fn(() => Promise.resolve()) - } - }) - createMainWindow(null, { getIsQuitting: () => true }) - - windowHandlers.close({ preventDefault: vi.fn() } as never) - await vi.advanceTimersByTimeAsync(WINDOW_QUIT_RENDERER_ACK_TIMEOUT_MS - 1) - expect(destroy).not.toHaveBeenCalled() - await vi.advanceTimersByTimeAsync(1) - - expect(destroy).toHaveBeenCalledOnce() - }) - - it('keeps the renderer-owned close flow after the quit request is acknowledged', async () => { - vi.useFakeTimers() - const windowHandlers: Record void> = {} - const ipcHandlers: Record void> = {} - vi.mocked(ipcMain.on).mockImplementation((channel, handler) => { - ipcHandlers[channel] = handler as (...args: any[]) => void - return ipcMain - }) - const webContents = { - id: 42, - on: vi.fn((event, handler) => { - windowHandlers[event] = handler - }), - setZoomLevel: vi.fn(), - setBackgroundThrottling: vi.fn(), - setWebRTCIPHandlingPolicy: vi.fn(), - invalidate: vi.fn(), - setWindowOpenHandler: vi.fn(), - send: vi.fn(), - isCrashed: vi.fn(() => false) - } - const destroy = vi.fn() - browserWindowMock.mockImplementation(function () { - return { - webContents, - on: vi.fn((event, handler) => { - windowHandlers[event] = handler - }), - isDestroyed: vi.fn(() => false), - isMaximized: vi.fn(() => true), - isFullScreen: vi.fn(() => false), - getSize: vi.fn(() => [1200, 800]), - setSize: vi.fn(), - maximize: vi.fn(), - show: vi.fn(), - destroy, - loadFile: vi.fn(() => Promise.resolve()), - loadURL: vi.fn(() => Promise.resolve()) - } - }) - createMainWindow(null, { getIsQuitting: () => true }) - - windowHandlers.close({ preventDefault: vi.fn() } as never) - windowHandlers.close({ preventDefault: vi.fn() } as never) - const closeRequests = vi - .mocked(webContents.send) - .mock.calls.filter(([channel]) => channel === 'window:close-requested') - .map(([, request]) => request as { requestId: number }) - expect(closeRequests).toHaveLength(2) - const [staleRequest, currentRequest] = closeRequests - ipcHandlers['window:close-request-received']?.({ sender: { id: 99 } }, currentRequest.requestId) - ipcHandlers['window:close-request-received']?.({ sender: { id: 42 } }, staleRequest.requestId) - await vi.advanceTimersByTimeAsync(WINDOW_QUIT_RENDERER_ACK_TIMEOUT_MS - 1) - expect(destroy).not.toHaveBeenCalled() - ipcHandlers['window:close-request-received']?.({ sender: { id: 42 } }, currentRequest.requestId) - await vi.advanceTimersByTimeAsync(1) - - expect(destroy).not.toHaveBeenCalled() - }) -}) diff --git a/src/main/window/createMainWindow-low-commit-oom-recovery.test.ts b/src/main/window/createMainWindow-low-commit-oom-recovery.test.ts deleted file mode 100644 index 7ee68f4178a..00000000000 --- a/src/main/window/createMainWindow-low-commit-oom-recovery.test.ts +++ /dev/null @@ -1,183 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' - -vi.mock('electron', async () => - (await import('./createMainWindow-test-harness')).electronModuleMock() -) -vi.mock('./macos-tahoe-release', async () => - (await import('./createMainWindow-test-harness')).macosTahoeReleaseMock() -) -vi.mock('./desktop-integration/app-icon', async () => - (await import('./createMainWindow-test-harness')).appIconMock() -) -vi.mock('../browser/guest-lifecycle/manager/browser-manager', async () => - (await import('./createMainWindow-test-harness')).browserManagerMock() -) -vi.mock('../browser/client-pages/renderer/browser-client-page-renderer-runtime', async () => { - const harness = await import('./createMainWindow-test-harness') - return { - attachBrowserClientPageRenderer: harness.attachClientPageRendererMock, - retireBrowserClientPageRenderer: harness.retireClientPageRendererMock - } -}) - -import { createMainWindow } from './createMainWindow' -import { resetExpectedTeardownStateForTest } from '../crash-reporting/process-exits/expected-teardown-state' -import { - resetPreGoneSystemMemorySamplingForTest, - samplePreGoneSystemMemory -} from '../crash-reporting/memory/pre-gone-host-memory' -import { setSystemMemoryInfoReaderForTest } from '../crash-reporting/memory/system-memory-details' -import { setSwapVolumeFreeSpaceReaderForTest } from '../crash-reporting/memory/swap-volume-free-space' -import { - createRendererRecoveryWindowHarness, - resetMainWindowMocks, - withPlatform -} from './createMainWindow-test-harness' - -// Launch 13084 (Scan-31 1790683596/1790684449/1790684587): the second reload OOMed 3.458 s after the first. -const OOM_AT = [ - '2026-09-29T12:06:19.869Z', - '2026-09-29T12:20:37.207Z', - '2026-09-29T12:20:40.665Z', - '2026-09-29T12:22:59.975Z' -].map((iso) => Date.parse(iso)) -// Commit at the two OOMs of launch 22912 (Scan-30 1790622432/1790622459): 744 MB, then 60 MB of a 130 GB limit. -const HEALTHY_FIRST_OOM_COMMIT_MB = 744 -const EXHAUSTED_COMMIT_MB = 60 -const RECOVERED_COMMIT_MB = 2_029 - -const OOM: Electron.RenderProcessGoneDetails = { reason: 'oom', exitCode: -536870904 } - -function hostWithAvailableCommit(swapFreeMB: number): void { - setSystemMemoryInfoReaderForTest(() => ({ - total: 32_000 * 1024, - free: 976 * 1024, - swapTotal: 130_000 * 1024, - swapFree: swapFreeMB * 1024 - })) - void samplePreGoneSystemMemory(Date.now()) -} - -async function runOomSequence( - platform: NodeJS.Platform, - commitAtEachOomMB: readonly (number | null)[], - goneTimeCommitMB?: number -): Promise<{ reloads: number; onRendererRecoveryExhausted: ReturnType }> { - const onRendererRecoveryExhausted = vi.fn() - const { browserWindowInstance, windowHandlers } = createRendererRecoveryWindowHarness() - createMainWindow(null, { onRendererRecoveryExhausted }) - for (const [index, goneAt] of OOM_AT.entries()) { - const commitMB = commitAtEachOomMB[index] - // null: no sampler tick since the previous OOM. - if (commitMB !== null) { - vi.setSystemTime(goneAt - 2_000) - withPlatform(platform, () => hostWithAvailableCommit(commitMB)) - } - vi.setSystemTime(goneAt) - if (goneTimeCommitMB !== undefined) { - // Only the host changes; no sampler tick commits it. - setSystemMemoryInfoReaderForTest(() => ({ swapFree: goneTimeCommitMB * 1024 })) - } - withPlatform(platform, () => windowHandlers['render-process-gone']?.({}, OOM)) - await vi.advanceTimersByTimeAsync(250) - } - return { - reloads: browserWindowInstance.loadFile.mock.calls.length - 1, - onRendererRecoveryExhausted - } -} - -describe('Windows renderer OOM recovery under exhausted commit', () => { - beforeEach(() => { - resetMainWindowMocks() - resetExpectedTeardownStateForTest() - resetPreGoneSystemMemorySamplingForTest() - setSwapVolumeFreeSpaceReaderForTest(async () => undefined) - vi.useFakeTimers() - vi.spyOn(console, 'error').mockImplementation(() => {}) - }) - - afterEach(() => { - setSystemMemoryInfoReaderForTest(null) - setSwapVolumeFreeSpaceReaderForTest(null) - resetPreGoneSystemMemorySamplingForTest() - vi.useRealTimers() - vi.restoreAllMocks() - }) - - it('stops reloading into a repeat OOM and tells the user how much commit is left', async () => { - const { reloads, onRendererRecoveryExhausted } = await runOomSequence('win32', [ - HEALTHY_FIRST_OOM_COMMIT_MB, - EXHAUSTED_COMMIT_MB, - EXHAUSTED_COMMIT_MB, - EXHAUSTED_COMMIT_MB - ]) - expect(reloads).toBe(2) - expect(onRendererRecoveryExhausted).toHaveBeenCalledOnce() - expect(onRendererRecoveryExhausted).toHaveBeenCalledWith( - expect.objectContaining({ - details: OOM, - cause: 'low-commit', - lowCommit: { - availableCommitMB: EXHAUSTED_COMMIT_MB, - sincePreviousOomMs: 3_458, - commitReading: 'pre-gone' - } - }) - ) - }) - - // Reproduce the 3.458s OOM gap with no intervening 10s sampler tick. - it('reads commit at gone time when no sampler tick landed since the previous OOM', async () => { - const { reloads, onRendererRecoveryExhausted } = await runOomSequence('win32', [ - HEALTHY_FIRST_OOM_COMMIT_MB, - EXHAUSTED_COMMIT_MB, - null, - EXHAUSTED_COMMIT_MB - ]) - expect(reloads).toBe(2) - expect(onRendererRecoveryExhausted).toHaveBeenCalledOnce() - expect(onRendererRecoveryExhausted).toHaveBeenCalledWith( - expect.objectContaining({ - cause: 'low-commit', - lowCommit: { - availableCommitMB: EXHAUSTED_COMMIT_MB, - sincePreviousOomMs: 3_458, - commitReading: 'gone-time' - } - }) - ) - }) - - it('keeps reloading when the gone-time read shows commit recovered and no tick landed', async () => { - const { reloads, onRendererRecoveryExhausted } = await runOomSequence( - 'win32', - [HEALTHY_FIRST_OOM_COMMIT_MB, EXHAUSTED_COMMIT_MB, null, null], - RECOVERED_COMMIT_MB - ) - expect(reloads).toBe(4) - expect(onRendererRecoveryExhausted).not.toHaveBeenCalled() - }) - - it('keeps auto-reloading repeat OOMs once commit has recovered', async () => { - const { reloads, onRendererRecoveryExhausted } = await runOomSequence('win32', [ - HEALTHY_FIRST_OOM_COMMIT_MB, - RECOVERED_COMMIT_MB, - RECOVERED_COMMIT_MB, - RECOVERED_COMMIT_MB - ]) - expect(reloads).toBe(4) - expect(onRendererRecoveryExhausted).not.toHaveBeenCalled() - }) - - it.each(['darwin', 'linux'] as const)('is a no-op on %s', async (platform) => { - const { reloads, onRendererRecoveryExhausted } = await runOomSequence(platform, [ - EXHAUSTED_COMMIT_MB, - EXHAUSTED_COMMIT_MB, - EXHAUSTED_COMMIT_MB, - EXHAUSTED_COMMIT_MB - ]) - expect(reloads).toBe(4) - expect(onRendererRecoveryExhausted).not.toHaveBeenCalled() - }) -}) diff --git a/src/main/window/createMainWindow-markdown-editor-focus.test.ts b/src/main/window/createMainWindow-markdown-editor-focus.test.ts deleted file mode 100644 index a49f4e214b9..00000000000 --- a/src/main/window/createMainWindow-markdown-editor-focus.test.ts +++ /dev/null @@ -1,385 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' - -vi.mock('electron', async () => - (await import('./createMainWindow-test-harness')).electronModuleMock() -) -vi.mock('./macos-tahoe-release', async () => - (await import('./createMainWindow-test-harness')).macosTahoeReleaseMock() -) -vi.mock('./desktop-integration/app-icon', async () => - (await import('./createMainWindow-test-harness')).appIconMock() -) -vi.mock('../browser/guest-lifecycle/manager/browser-manager', async () => - (await import('./createMainWindow-test-harness')).browserManagerMock() -) - -import { createMainWindow } from './createMainWindow' -import { ipcMain } from 'electron' -import { resetExpectedTeardownStateForTest } from '../crash-reporting/process-exits/expected-teardown-state' -import { - browserWindowMock, - buildFromTemplateMock, - menuPopupMock, - resetMainWindowMocks -} from './createMainWindow-test-harness' - -function openMainWindowForContextMenu() { - const windowHandlers: Record void> = {} - const webContents = { - on: vi.fn((event, handler) => { - windowHandlers[event] = handler - }), - setZoomLevel: vi.fn(), - setBackgroundThrottling: vi.fn(), - setWebRTCIPHandlingPolicy: vi.fn(), - invalidate: vi.fn(), - setWindowOpenHandler: vi.fn(), - send: vi.fn(), - isDevToolsOpened: vi.fn(), - openDevTools: vi.fn(), - closeDevTools: vi.fn(), - replaceMisspelling: vi.fn(), - session: { addWordToSpellCheckerDictionary: vi.fn() }, - getURL: vi.fn(() => 'file:///opt/orca/renderer/index.html'), - isLoadingMainFrame: vi.fn(() => true) - } - const browserWindowInstance = { - webContents, - on: vi.fn(), - isDestroyed: vi.fn(() => false), - isMaximized: vi.fn(() => true), - isFullScreen: vi.fn(() => false), - getSize: vi.fn(() => [1200, 800]), - setSize: vi.fn(), - maximize: vi.fn(), - show: vi.fn(), - loadFile: vi.fn(() => Promise.resolve()), - loadURL: vi.fn(() => Promise.resolve()) - } - browserWindowMock.mockImplementation(function () { - return browserWindowInstance - }) - - createMainWindow(null) - return { webContents, windowHandlers, browserWindowInstance } -} - -describe('createMainWindow', () => { - beforeEach(() => { - resetMainWindowMocks() - resetExpectedTeardownStateForTest() - vi.useRealTimers() - }) - - it('intercepts Cmd+B for sidebar when the markdown editor is not focused', () => { - const windowHandlers: Record void> = {} - const webContents = { - on: vi.fn((event, handler) => { - windowHandlers[event] = handler - }), - setZoomLevel: vi.fn(), - setBackgroundThrottling: vi.fn(), - setWebRTCIPHandlingPolicy: vi.fn(), - invalidate: vi.fn(), - setWindowOpenHandler: vi.fn(), - send: vi.fn(), - isDevToolsOpened: vi.fn(), - openDevTools: vi.fn(), - closeDevTools: vi.fn() - } - const browserWindowInstance = { - webContents, - on: vi.fn(), - isDestroyed: vi.fn(() => false), - isMaximized: vi.fn(() => true), - isFullScreen: vi.fn(() => false), - getSize: vi.fn(() => [1200, 800]), - setSize: vi.fn(), - maximize: vi.fn(), - show: vi.fn(), - loadFile: vi.fn(() => Promise.resolve()), - loadURL: vi.fn(() => Promise.resolve()) - } - browserWindowMock.mockImplementation(function () { - return browserWindowInstance - }) - - createMainWindow(null) - - const preventDefault = vi.fn() - const isDarwin = process.platform === 'darwin' - windowHandlers['before-input-event']( - { preventDefault } as never, - { - type: 'keyDown', - code: 'KeyB', - key: 'b', - meta: isDarwin, - control: !isDarwin, - alt: false, - shift: false - } as never - ) - - expect(preventDefault).toHaveBeenCalledTimes(1) - expect(webContents.send).toHaveBeenCalledWith('ui:toggleLeftSidebar') - }) - - it('leaves bold and logical link shortcuts to the focused markdown editor', () => { - const windowHandlers: Record void> = {} - const webContents = { - on: vi.fn((event, handler) => { - windowHandlers[event] = handler - }), - setZoomLevel: vi.fn(), - setBackgroundThrottling: vi.fn(), - setWebRTCIPHandlingPolicy: vi.fn(), - invalidate: vi.fn(), - setWindowOpenHandler: vi.fn(), - send: vi.fn(), - isDevToolsOpened: vi.fn(), - openDevTools: vi.fn(), - closeDevTools: vi.fn() - } - const browserWindowInstance = { - webContents, - on: vi.fn(), - isDestroyed: vi.fn(() => false), - isMaximized: vi.fn(() => true), - isFullScreen: vi.fn(() => false), - getSize: vi.fn(() => [1200, 800]), - setSize: vi.fn(), - maximize: vi.fn(), - show: vi.fn(), - loadFile: vi.fn(() => Promise.resolve()), - loadURL: vi.fn(() => Promise.resolve()) - } - browserWindowMock.mockImplementation(function () { - return browserWindowInstance - }) - - createMainWindow(null) - - const setFocusedListener = vi - .mocked(ipcMain.on) - .mock.calls.find(([channel]) => channel === 'ui:setMarkdownEditorFocused')?.[1] - expect(setFocusedListener).toBeTypeOf('function') - setFocusedListener?.({ sender: webContents } as never, true) - - const event = new Event('before-input-event', { cancelable: true }) - const isDarwin = process.platform === 'darwin' - windowHandlers['before-input-event'](event, { - type: 'keyDown', - code: 'KeyB', - key: 'b', - meta: isDarwin, - control: !isDarwin, - alt: false, - shift: false - } as never) - - windowHandlers['before-input-event'](event, { - type: 'keyDown', - code: 'KeyV', - key: 'k', - meta: isDarwin, - control: !isDarwin, - alt: false, - shift: false - }) - expect(event.defaultPrevented).toBe(false) - }) - - it('lets the shortcut recorder capture app shortcuts before main interception', () => { - const windowHandlers: Record void> = {} - const webContents = { - on: vi.fn((event, handler) => { - windowHandlers[event] = handler - }), - setZoomLevel: vi.fn(), - setBackgroundThrottling: vi.fn(), - setWebRTCIPHandlingPolicy: vi.fn(), - invalidate: vi.fn(), - setWindowOpenHandler: vi.fn(), - send: vi.fn(), - isDevToolsOpened: vi.fn(), - openDevTools: vi.fn(), - closeDevTools: vi.fn() - } - const browserWindowInstance = { - webContents, - on: vi.fn(), - isDestroyed: vi.fn(() => false), - isMaximized: vi.fn(() => true), - isFullScreen: vi.fn(() => false), - getSize: vi.fn(() => [1200, 800]), - setSize: vi.fn(), - maximize: vi.fn(), - show: vi.fn(), - loadFile: vi.fn(() => Promise.resolve()), - loadURL: vi.fn(() => Promise.resolve()) - } - browserWindowMock.mockImplementation(function () { - return browserWindowInstance - }) - - createMainWindow(null) - - const setFocusedListener = vi - .mocked(ipcMain.on) - .mock.calls.find(([channel]) => channel === 'ui:setShortcutRecorderFocused')?.[1] - expect(setFocusedListener).toBeTypeOf('function') - setFocusedListener?.({ sender: webContents } as never, true) - - const preventDefault = vi.fn() - const isDarwin = process.platform === 'darwin' - windowHandlers['before-input-event']( - { preventDefault } as never, - { - type: 'keyDown', - code: 'KeyB', - key: 'b', - meta: isDarwin, - control: !isDarwin, - alt: false, - shift: false - } as never - ) - - expect(preventDefault).not.toHaveBeenCalled() - expect(webContents.send).not.toHaveBeenCalledWith('ui:toggleLeftSidebar') - }) - - it('skips Cmd+B interception when floating terminal input is focused', () => { - const windowHandlers: Record void> = {} - const webContents = { - on: vi.fn((event, handler) => { - windowHandlers[event] = handler - }), - setZoomLevel: vi.fn(), - setBackgroundThrottling: vi.fn(), - setWebRTCIPHandlingPolicy: vi.fn(), - invalidate: vi.fn(), - setWindowOpenHandler: vi.fn(), - send: vi.fn(), - isDevToolsOpened: vi.fn(), - openDevTools: vi.fn(), - closeDevTools: vi.fn() - } - const browserWindowInstance = { - webContents, - on: vi.fn(), - isDestroyed: vi.fn(() => false), - isMaximized: vi.fn(() => true), - isFullScreen: vi.fn(() => false), - getSize: vi.fn(() => [1200, 800]), - setSize: vi.fn(), - maximize: vi.fn(), - show: vi.fn(), - loadFile: vi.fn(() => Promise.resolve()), - loadURL: vi.fn(() => Promise.resolve()) - } - browserWindowMock.mockImplementation(function () { - return browserWindowInstance - }) - - createMainWindow(null) - - const setFocusedListener = vi - .mocked(ipcMain.on) - .mock.calls.find(([channel]) => channel === 'ui:setFloatingFocus')?.[1] - expect(setFocusedListener).toBeTypeOf('function') - setFocusedListener?.( - { sender: webContents } as never, - { panelFocused: true, terminalFocused: true } as never - ) - - const preventDefault = vi.fn() - const isDarwin = process.platform === 'darwin' - windowHandlers['before-input-event']( - { preventDefault } as never, - { - type: 'keyDown', - code: 'KeyB', - key: 'b', - meta: isDarwin, - control: !isDarwin, - alt: false, - shift: false - } as never - ) - - expect(preventDefault).not.toHaveBeenCalled() - expect(webContents.send).not.toHaveBeenCalledWith('ui:toggleLeftSidebar') - - webContents.send.mockClear() - const newWorkspacePreventDefault = vi.fn() - windowHandlers['before-input-event']( - { preventDefault: newWorkspacePreventDefault } as never, - { - type: 'keyDown', - code: 'KeyN', - key: 'n', - meta: isDarwin, - control: !isDarwin, - alt: false, - shift: false - } as never - ) - - expect(newWorkspacePreventDefault).toHaveBeenCalledTimes(1) - expect(webContents.send).toHaveBeenCalledWith('ui:openNewWorkspace') - }) - - it('retires the edit menu with its document but not on same-document navigation', () => { - const { webContents } = openMainWindowForContextMenu() - const emit = (event: string, ...args: unknown[]): void => { - for (const [name, handler] of webContents.on.mock.calls) { - if (name === event) { - handler(...args) - } - } - } - const openMenu = () => { - const closePopup = vi.fn() - buildFromTemplateMock.mockImplementationOnce(() => ({ - popup: menuPopupMock, - closePopup - })) - emit( - 'context-menu', - {}, - { - x: 1, - y: 2, - isEditable: true, - formControlType: 'input', - dictionarySuggestions: [], - misspelledWord: '' - } - ) - const template = buildFromTemplateMock.mock.calls.at(-1)?.[0] - const paste = Array.isArray(template) - ? template.find((item) => item.label === 'Paste') - : undefined - expect(paste?.click).toBeTypeOf('function') - return { closePopup, paste } - } - const nextDocument = 'file:///opt/orca/renderer/index.html?reload' - - const first = openMenu() - emit('did-start-navigation', {}, `${nextDocument}#hash`, true, true) - expect(first.closePopup).not.toHaveBeenCalled() - emit('did-start-navigation', {}, nextDocument, false, true) - expect(first.closePopup).toHaveBeenCalledTimes(1) - - // The old document still takes right-clicks until the pending reload commits. - const pending = openMenu() - emit('did-frame-navigate', {}, nextDocument, 200, 'OK', false) - expect(pending.closePopup).not.toHaveBeenCalled() - emit('did-frame-navigate', {}, nextDocument, 200, 'OK', true) - expect(pending.closePopup).toHaveBeenCalledTimes(1) - pending.paste.click() - expect(webContents.send).not.toHaveBeenCalledWith('ui:editableContextPaste', expect.anything()) - }) -}) diff --git a/src/main/window/createMainWindow-renderer-crash-recovery.test.ts b/src/main/window/createMainWindow-renderer-crash-recovery.test.ts deleted file mode 100644 index abf52e7510f..00000000000 --- a/src/main/window/createMainWindow-renderer-crash-recovery.test.ts +++ /dev/null @@ -1,383 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' - -vi.mock('electron', async () => - (await import('./createMainWindow-test-harness')).electronModuleMock() -) -vi.mock('./macos-tahoe-release', async () => - (await import('./createMainWindow-test-harness')).macosTahoeReleaseMock() -) -vi.mock('./desktop-integration/app-icon', async () => - (await import('./createMainWindow-test-harness')).appIconMock() -) -vi.mock('../browser/guest-lifecycle/manager/browser-manager', async () => - (await import('./createMainWindow-test-harness')).browserManagerMock() -) -vi.mock('../browser/client-pages/renderer/browser-client-page-renderer-runtime', async () => { - const harness = await import('./createMainWindow-test-harness') - return { - attachBrowserClientPageRenderer: harness.attachClientPageRendererMock, - retireBrowserClientPageRenderer: harness.retireClientPageRendererMock - } -}) - -import { createMainWindow } from './createMainWindow' -import { ipcMain } from 'electron' -import { shouldRecoverRendererAfterProcessGone } from '../crash-reporting/process-exits/process-gone-classification' -import { - resetExpectedTeardownStateForTest, - resolveExpectedTeardownScope -} from '../crash-reporting/process-exits/expected-teardown-state' -import { - attachClientPageRendererMock, - browserWindowMock, - createRendererRecoveryWindowHarness, - resetMainWindowMocks, - retireClientPageRendererMock, - withPlatform -} from './createMainWindow-test-harness' - -describe('createMainWindow', () => { - beforeEach(() => { - resetMainWindowMocks() - resetExpectedTeardownStateForTest() - vi.useRealTimers() - }) - - it('does not read destroyed webContents during closed cleanup', () => { - const windowHandlers: Record void> = {} - const webContents = { - on: vi.fn(), - setZoomLevel: vi.fn(), - setBackgroundThrottling: vi.fn(), - setWebRTCIPHandlingPolicy: vi.fn(), - invalidate: vi.fn(), - setWindowOpenHandler: vi.fn(), - send: vi.fn(), - isDevToolsOpened: vi.fn(), - openDevTools: vi.fn(), - closeDevTools: vi.fn() - } - let webContentsDestroyed = false - const browserWindowInstance = { - get webContents() { - if (webContentsDestroyed) { - throw new Error('Object has been destroyed') - } - return webContents - }, - on: vi.fn((event, handler) => { - windowHandlers[event] = handler - }), - isDestroyed: vi.fn(() => false), - isMaximized: vi.fn(() => true), - isFullScreen: vi.fn(() => false), - getSize: vi.fn(() => [1200, 800]), - setSize: vi.fn(), - maximize: vi.fn(), - show: vi.fn(), - loadFile: vi.fn(() => Promise.resolve()), - loadURL: vi.fn(() => Promise.resolve()) - } - browserWindowMock.mockImplementation(function () { - return browserWindowInstance - }) - - createMainWindow(null) - - webContentsDestroyed = true - - // Updater teardown may destroy WebContents before closed cleanup; throwing would prevent Squirrel relaunch. - expect(() => windowHandlers.closed?.()).not.toThrow() - }) - - it('retires renderer generations and resets focus on crash, navigation, and destroy', async () => { - const windowHandlers: Record void> = {} - const webContents = { - getURL: vi.fn(() => 'file:///opt/orca/renderer/index.html'), - isDestroyed: vi.fn(() => false), - isLoadingMainFrame: vi.fn(() => false), - mainFrame: {}, - on: vi.fn((event, handler) => { - // Retain multiple lifecycle listeners like EventEmitter. - const previous = windowHandlers[event] - windowHandlers[event] = previous - ? (...args: unknown[]) => { - previous(...args) - handler(...args) - } - : handler - }), - setZoomLevel: vi.fn(), - setBackgroundThrottling: vi.fn(), - setWebRTCIPHandlingPolicy: vi.fn(), - invalidate: vi.fn(), - setWindowOpenHandler: vi.fn(), - send: vi.fn(), - isDevToolsOpened: vi.fn(), - openDevTools: vi.fn(), - closeDevTools: vi.fn() - } - const browserWindowInstance = { - webContents, - on: vi.fn(), - isDestroyed: vi.fn(() => false), - isMaximized: vi.fn(() => true), - isFullScreen: vi.fn(() => false), - getSize: vi.fn(() => [1200, 800]), - setSize: vi.fn(), - maximize: vi.fn(), - show: vi.fn(), - loadFile: vi.fn(() => Promise.resolve()), - loadURL: vi.fn(() => Promise.resolve()) - } - browserWindowMock.mockImplementation(function () { - return browserWindowInstance - }) - - createMainWindow(null) - windowHandlers['did-finish-load']?.() - expect(attachClientPageRendererMock).toHaveBeenCalledWith(webContents) - - const setFocusedListener = vi - .mocked(ipcMain.on) - .mock.calls.find(([channel]) => channel === 'ui:setMarkdownEditorFocused')?.[1] - const isDarwin = process.platform === 'darwin' - - const cmdBInput = { - type: 'keyDown', - code: 'KeyB', - key: 'b', - meta: isDarwin, - control: !isDarwin, - alt: false, - shift: false - } as never - - const assertInterceptsAfterReset = (): void => { - webContents.send.mockClear() - const preventDefault = vi.fn() - windowHandlers['before-input-event']({ preventDefault } as never, cmdBInput) - expect(preventDefault).toHaveBeenCalledTimes(1) - expect(webContents.send).toHaveBeenCalledWith('ui:toggleLeftSidebar') - } - - retireClientPageRendererMock.mockClear() - setFocusedListener?.({ sender: webContents } as never, true) - windowHandlers['render-process-gone']?.() - expect(retireClientPageRendererMock).toHaveBeenCalledWith(webContents) - assertInterceptsAfterReset() - windowHandlers['did-finish-load']?.() - - retireClientPageRendererMock.mockClear() - setFocusedListener?.({ sender: webContents } as never, true) - windowHandlers['did-start-navigation']?.({} as never, 'https://example.com/', false, true) - expect(retireClientPageRendererMock).not.toHaveBeenCalled() - - windowHandlers['did-start-navigation']?.( - {} as never, - 'file:///opt/orca/renderer/index.html?reload=1', - false, - true - ) - expect(retireClientPageRendererMock).toHaveBeenCalledWith(webContents) - assertInterceptsAfterReset() - - attachClientPageRendererMock.mockClear() - windowHandlers['did-fail-provisional-load']?.( - {} as never, - -3, - 'aborted', - 'file:///opt/orca/renderer/index.html?reload=1', - true - ) - await Promise.resolve() - expect(attachClientPageRendererMock).toHaveBeenCalledWith(webContents) - - retireClientPageRendererMock.mockClear() - setFocusedListener?.({ sender: webContents } as never, true) - windowHandlers['did-start-navigation']?.({} as never, '#same-document', true, true) - expect(retireClientPageRendererMock).not.toHaveBeenCalled() - windowHandlers['did-start-navigation']?.({} as never, 'https://example.com/', false, false) - expect(retireClientPageRendererMock).not.toHaveBeenCalled() - webContents.send.mockClear() - const subframePreventDefault = vi.fn() - windowHandlers['before-input-event']( - { preventDefault: subframePreventDefault } as never, - cmdBInput - ) - expect(subframePreventDefault).not.toHaveBeenCalled() - expect(webContents.send).not.toHaveBeenCalledWith('ui:toggleLeftSidebar') - - retireClientPageRendererMock.mockClear() - setFocusedListener?.({ sender: webContents } as never, true) - windowHandlers['destroyed']?.() - expect(retireClientPageRendererMock).toHaveBeenCalledWith(webContents) - assertInterceptsAfterReset() - }) - - it('still preserves PTYs and reloads after Windows session-end', () => { - vi.useFakeTimers() - - const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) - const { browserWindowInstance, windowHandlers } = createRendererRecoveryWindowHarness() - const onBeforeRecoveryReload = vi.fn() - const onRendererRecoveryExhausted = vi.fn() - - withPlatform('win32', () => { - createMainWindow(null, { - onBeforeRecoveryReload, - onRendererRecoveryExhausted, - shouldRecoverRenderer: (details) => - shouldRecoverRendererAfterProcessGone({ - reason: details.reason, - expectedTeardown: resolveExpectedTeardownScope({ - isQuitting: false, - isQuittingForUpdate: false, - isExpectedRendererReload: false, - includeSystemSessionEnd: false - }) - }) - }) - }) - windowHandlers['session-end']?.({} as never) - windowHandlers['render-process-gone']?.( - {} as never, - { reason: 'killed', exitCode: 1 } as Electron.RenderProcessGoneDetails - ) - vi.advanceTimersByTime(250) - - expect(onBeforeRecoveryReload).toHaveBeenCalledWith(143, 'automatic') - expect(browserWindowInstance.loadFile).toHaveBeenCalledTimes(2) - // Deliberate logoff reloads must never raise recovery dialogs during teardown. - vi.runAllTimers() - expect(onRendererRecoveryExhausted).not.toHaveBeenCalled() - consoleError.mockRestore() - }) - - it('rechecks the renderer recovery predicate before reloading', () => { - vi.useFakeTimers() - - const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) - const { browserWindowInstance, windowHandlers } = createRendererRecoveryWindowHarness() - let shouldRecover = true - - createMainWindow(null, { shouldRecoverRenderer: () => shouldRecover }) - - windowHandlers['render-process-gone']?.( - {} as never, - { - reason: 'crashed', - exitCode: 5 - } as Electron.RenderProcessGoneDetails - ) - shouldRecover = false - vi.advanceTimersByTime(250) - - expect(browserWindowInstance.loadFile).toHaveBeenCalledTimes(1) - expect(browserWindowInstance.loadURL).not.toHaveBeenCalled() - - consoleError.mockRestore() - }) - - it('coalesces repeated renderer losses into one recovery reload', () => { - vi.useFakeTimers() - - const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) - const { browserWindowInstance, windowHandlers } = createRendererRecoveryWindowHarness() - - createMainWindow(null) - - const details = { - reason: 'crashed', - exitCode: 5 - } as Electron.RenderProcessGoneDetails - windowHandlers['render-process-gone']?.({} as never, details) - windowHandlers['render-process-gone']?.({} as never, details) - vi.advanceTimersByTime(250) - - expect(browserWindowInstance.loadFile).toHaveBeenCalledTimes(2) - expect(browserWindowInstance.loadURL).not.toHaveBeenCalled() - - consoleError.mockRestore() - }) - - it('does not reload after a clean renderer exit', () => { - vi.useFakeTimers() - - const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) - const { browserWindowInstance, windowHandlers } = createRendererRecoveryWindowHarness() - - createMainWindow(null) - - windowHandlers['render-process-gone']?.( - {} as never, - { - reason: 'clean-exit', - exitCode: 0 - } as Electron.RenderProcessGoneDetails - ) - vi.advanceTimersByTime(250) - - expect(browserWindowInstance.loadFile).toHaveBeenCalledTimes(1) - expect(browserWindowInstance.loadURL).not.toHaveBeenCalled() - - consoleError.mockRestore() - }) - - it('cancels renderer recovery when the crashed window is closing', () => { - vi.useFakeTimers() - - const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) - const { browserWindowInstance, windowHandlers } = createRendererRecoveryWindowHarness() - - createMainWindow(null) - - windowHandlers['render-process-gone']?.( - {} as never, - { - reason: 'crashed', - exitCode: 5 - } as Electron.RenderProcessGoneDetails - ) - windowHandlers.close({ preventDefault: vi.fn() } as never) - vi.advanceTimersByTime(250) - - expect(browserWindowInstance.loadFile).toHaveBeenCalledTimes(1) - expect(browserWindowInstance.loadURL).not.toHaveBeenCalled() - - consoleError.mockRestore() - }) - - it('serves a manual retry while the breaker stays open for the next crash', () => { - vi.useFakeTimers() - - const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) - const onRendererRecoveryExhausted = vi.fn() - const { browserWindowInstance, windowHandlers } = createRendererRecoveryWindowHarness() - - createMainWindow(null, { onRendererRecoveryExhausted }) - - const details = { reason: 'crashed', exitCode: 5 } as Electron.RenderProcessGoneDetails - const driveCrashCycle = (): void => { - windowHandlers['render-process-gone']?.({} as never, details) - vi.advanceTimersByTime(250) - } - driveCrashCycle() - driveCrashCycle() - driveCrashCycle() - driveCrashCycle() - expect(onRendererRecoveryExhausted).toHaveBeenCalledTimes(1) - expect(browserWindowInstance.loadFile).toHaveBeenCalledTimes(4) - - // Manual watched retry bypasses the automatic-recovery breaker. - onRendererRecoveryExhausted.mock.calls[0]?.[0].retry() - expect(browserWindowInstance.loadFile).toHaveBeenCalledTimes(5) - - // Manual retry must not reset the poisoned machine's automatic-reload breaker. - driveCrashCycle() - expect(browserWindowInstance.loadFile).toHaveBeenCalledTimes(5) - expect(onRendererRecoveryExhausted).toHaveBeenCalledTimes(2) - - consoleError.mockRestore() - }) -}) diff --git a/src/main/window/createMainWindow-test-harness.ts b/src/main/window/createMainWindow-test-harness.ts deleted file mode 100644 index f99b477f67c..00000000000 --- a/src/main/window/createMainWindow-test-harness.ts +++ /dev/null @@ -1,193 +0,0 @@ -import { vi } from 'vitest' -import type { Mock } from 'vitest' - -/** Loose spy signature: these stand in for electron APIs the suites only assert calls on. */ -export type MainWindowSpy = Mock<(...args: unknown[]) => unknown> - -export const menuPopupMock: MainWindowSpy = vi.fn() -export const notificationShowMock: MainWindowSpy = vi.fn() -/** Constructor spy: suites read the options object back off `mock.calls`. */ -export const browserWindowMock: Mock< - (options: Electron.BrowserWindowConstructorOptions) => unknown -> = vi.fn() -export const openExternalMock: MainWindowSpy = vi.fn() -export const attachGuestPoliciesMock: MainWindowSpy = vi.fn() -export const attachRouteGuestMock: MainWindowSpy = vi.fn(() => false) -export const retireRouteRendererMock: MainWindowSpy = vi.fn() -export const attachClientPageRendererMock: MainWindowSpy = vi.fn() -export const retireClientPageRendererMock: MainWindowSpy = vi.fn() -export const buildFromTemplateMock: Mock< - (...args: unknown[]) => { popup: MainWindowSpy; closePopup: MainWindowSpy } -> = vi.fn(() => ({ popup: menuPopupMock, closePopup: vi.fn() })) -export const notificationMock: Mock<(...args: unknown[]) => { show: MainWindowSpy }> = vi.fn( - function () { - return { show: notificationShowMock } - } -) -export const powerMonitorOnMock: MainWindowSpy = vi.fn() -export const powerMonitorRemoveListenerMock: MainWindowSpy = vi.fn() -export const routePartitionAllowedMock: Mock<(partition: string) => boolean> = vi.fn(() => false) -export const appMock: { isPackaged: boolean; on: MainWindowSpy; removeListener: MainWindowSpy } = { - isPackaged: true, - on: vi.fn(), - removeListener: vi.fn() -} -export const macosTahoeMock = { value: false } - -type IpcMainMock = { - on: MainWindowSpy - removeListener: MainWindowSpy - handle: MainWindowSpy - removeHandler: MainWindowSpy -} - -const ipcMainMock: IpcMainMock = { - on: vi.fn(), - removeListener: vi.fn(), - handle: vi.fn(), - removeHandler: vi.fn() -} - -export type ElectronModuleMock = { - app: typeof appMock - BrowserWindow: typeof browserWindowMock - ipcMain: IpcMainMock - Menu: { buildFromTemplate: typeof buildFromTemplateMock } - Notification: typeof notificationMock - nativeTheme: { shouldUseDarkColors: boolean } - powerMonitor: { on: MainWindowSpy; removeListener: MainWindowSpy } - screen: { - getPrimaryDisplay: () => { workAreaSize: { width: number; height: number } } - getDisplayMatching: () => { scaleFactor: number } - } - shell: { openExternal: MainWindowSpy } -} - -export type BrowserManagerModuleMock = { - browserManager: { - attachGuestPolicies: MainWindowSpy - setDictationShortcutForwardingPredicate: MainWindowSpy - } -} - -// vi.mock factories are hoisted per suite; builders reuse the Electron surface without duplicating it. -export function electronModuleMock(): ElectronModuleMock { - return { - app: appMock, - BrowserWindow: browserWindowMock, - ipcMain: ipcMainMock, - Menu: { buildFromTemplate: buildFromTemplateMock }, - Notification: notificationMock, - nativeTheme: { shouldUseDarkColors: false }, - powerMonitor: { on: powerMonitorOnMock, removeListener: powerMonitorRemoveListenerMock }, - screen: { - getPrimaryDisplay: () => ({ workAreaSize: { width: 1440, height: 900 } }), - getDisplayMatching: () => ({ scaleFactor: 2 }) - }, - shell: { openExternal: openExternalMock } - } -} - -export function macosTahoeReleaseMock() { - return { - isMacosTahoeOrNewer: vi.fn(() => macosTahoeMock.value) - } -} - -export function appIconMock() { - return { - getAppIconPath: vi.fn(() => 'icon') - } -} - -export function browserManagerMock(): BrowserManagerModuleMock { - return { - browserManager: { - attachGuestPolicies: attachGuestPoliciesMock, - setDictationShortcutForwardingPredicate: vi.fn() - } - } -} - -export function resetMainWindowMocks(): void { - browserWindowMock.mockReset() - openExternalMock.mockReset() - attachGuestPoliciesMock.mockReset() - attachRouteGuestMock.mockReset() - attachRouteGuestMock.mockReturnValue(false) - retireRouteRendererMock.mockReset() - attachClientPageRendererMock.mockReset() - retireClientPageRendererMock.mockReset() - buildFromTemplateMock.mockClear() - menuPopupMock.mockClear() - notificationMock.mockClear() - notificationShowMock.mockClear() - powerMonitorOnMock.mockReset() - powerMonitorRemoveListenerMock.mockReset() - routePartitionAllowedMock.mockReset() - routePartitionAllowedMock.mockReturnValue(false) - appMock.isPackaged = true - macosTahoeMock.value = false - ipcMainMock.on.mockReset() - ipcMainMock.removeListener.mockReset() - ipcMainMock.handle.mockReset() - ipcMainMock.removeHandler.mockReset() -} - -export function withPlatform(platform: NodeJS.Platform, run: () => T): T { - const original = process.platform - Object.defineProperty(process, 'platform', { configurable: true, value: platform }) - try { - return run() - } finally { - Object.defineProperty(process, 'platform', { configurable: true, value: original }) - } -} - -export type RendererRecoveryWindowHarness = { - browserWindowInstance: { - loadFile: Mock<() => Promise> - loadURL: Mock<() => Promise> - webContents: { send: Mock } - } - windowHandlers: Record void> -} - -/** A main window whose webContents events land in `windowHandlers` for suites that drive renderer recovery. */ -export function createRendererRecoveryWindowHarness(): RendererRecoveryWindowHarness { - const windowHandlers: RendererRecoveryWindowHarness['windowHandlers'] = {} - const webContents = { - id: 143, - getURL: vi.fn(() => 'file:///opt/orca/renderer/index.html'), - isDestroyed: vi.fn(() => false), - on: vi.fn((event: string, handler: (...args: unknown[]) => void) => { - windowHandlers[event] = handler - }), - setZoomLevel: vi.fn(), - setBackgroundThrottling: vi.fn(), - setWebRTCIPHandlingPolicy: vi.fn(), - invalidate: vi.fn(), - setWindowOpenHandler: vi.fn(), - send: vi.fn() - } - const browserWindowInstance = { - webContents, - on: vi.fn((event: string, handler: (...args: unknown[]) => void) => { - windowHandlers[event] = handler - }), - isDestroyed: vi.fn(() => false), - isMaximized: vi.fn(() => true), - isFullScreen: vi.fn(() => false), - getSize: vi.fn(() => [1200, 800]), - setSize: vi.fn(), - maximize: vi.fn(), - show: vi.fn(), - loadFile: vi.fn(() => Promise.resolve()), - loadURL: vi.fn(() => Promise.resolve()) - } - browserWindowMock.mockImplementation(function () { - return browserWindowInstance - }) - - return { browserWindowInstance, windowHandlers } -} diff --git a/src/main/window/createMainWindow-user-quit-close.test.ts b/src/main/window/createMainWindow-user-quit-close.test.ts deleted file mode 100644 index 8726de70d0c..00000000000 --- a/src/main/window/createMainWindow-user-quit-close.test.ts +++ /dev/null @@ -1,133 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' - -vi.mock('electron', async () => - (await import('./createMainWindow-test-harness')).electronModuleMock() -) -vi.mock('./macos-tahoe-release', async () => - (await import('./createMainWindow-test-harness')).macosTahoeReleaseMock() -) -vi.mock('./desktop-integration/app-icon', async () => - (await import('./createMainWindow-test-harness')).appIconMock() -) -vi.mock('../browser/guest-lifecycle/manager/browser-manager', async () => - (await import('./createMainWindow-test-harness')).browserManagerMock() -) - -import { ipcMain } from 'electron' -import { createMainWindow, WINDOW_QUIT_RENDERER_ACK_TIMEOUT_MS } from './createMainWindow' -import { resetExpectedTeardownStateForTest } from '../crash-reporting/process-exits/expected-teardown-state' -import { browserWindowMock, resetMainWindowMocks } from './createMainWindow-test-harness' -import { markUserQuitWindowClose } from './user-quit-window-close' - -type Handler = (...args: any[]) => void - -function setupWindow() { - const windowHandlers: Record = {} - const ipcHandlers: Record = {} - vi.mocked(ipcMain.on).mockImplementation((channel, handler) => { - ipcHandlers[channel] = handler - return ipcMain - }) - const webContents = { - id: 42, - on: vi.fn((event: string, handler: Handler) => { - windowHandlers[event] = handler - }), - setZoomLevel: vi.fn(), - setBackgroundThrottling: vi.fn(), - setWebRTCIPHandlingPolicy: vi.fn(), - invalidate: vi.fn(), - setWindowOpenHandler: vi.fn(), - send: vi.fn(), - isCrashed: vi.fn(() => false) - } - const instance = { - webContents, - on: vi.fn((event: string, handler: Handler) => { - windowHandlers[event] = handler - }), - isDestroyed: vi.fn(() => false), - isMaximized: vi.fn(() => false), - isFullScreen: vi.fn(() => false), - isMinimized: vi.fn(() => false), - getSize: vi.fn(() => [1200, 800]), - setSize: vi.fn(), - maximize: vi.fn(), - show: vi.fn(), - hide: vi.fn(), - destroy: vi.fn(), - loadFile: vi.fn(() => Promise.resolve()), - loadURL: vi.fn(() => Promise.resolve()) - } - browserWindowMock.mockImplementation(function () { - return instance - }) - return { windowHandlers, ipcHandlers, webContents, instance } -} - -function lastCloseRequestId(send: ReturnType): number { - const requests = send.mock.calls.filter(([channel]) => channel === 'window:close-requested') - const request: unknown = requests.at(-1)?.[1] - return typeof request === 'object' && request !== null && 'requestId' in request - ? Number(request.requestId) - : -1 -} - -describe('serve user-Quit window close', () => { - const originalPlatform = process.platform - - beforeEach(() => { - resetMainWindowMocks() - resetExpectedTeardownStateForTest() - vi.useFakeTimers() - }) - - afterEach(() => { - Object.defineProperty(process, 'platform', { value: originalPlatform, configurable: true }) - vi.useRealTimers() - }) - - it('destroys a frozen renderer after the quit ack deadline without quitting the process', async () => { - const { windowHandlers, webContents, instance } = setupWindow() - createMainWindow(null, { getIsQuitting: () => false }) - - markUserQuitWindowClose(instance) - windowHandlers.close({ preventDefault: vi.fn() }) - - expect(webContents.send).toHaveBeenCalledWith('window:close-requested', { - isQuitting: false, - requestId: expect.any(Number) - }) - await vi.advanceTimersByTimeAsync(WINDOW_QUIT_RENDERER_ACK_TIMEOUT_MS) - expect(instance.destroy).toHaveBeenCalledOnce() - }) - - it('leaves a responsive renderer free to veto the close', async () => { - const { windowHandlers, ipcHandlers, webContents, instance } = setupWindow() - createMainWindow(null, { getIsQuitting: () => false }) - - markUserQuitWindowClose(instance) - windowHandlers.close({ preventDefault: vi.fn() }) - ipcHandlers['window:close-request-received']?.( - { sender: { id: 42 } }, - lastCloseRequestId(webContents.send) - ) - await vi.advanceTimersByTimeAsync(WINDOW_QUIT_RENDERER_ACK_TIMEOUT_MS) - - expect(instance.destroy).not.toHaveBeenCalled() - }) - - it('keeps a plain window close without a deadline', async () => { - const { windowHandlers, instance } = setupWindow() - createMainWindow(null, { getIsQuitting: () => false }) - - markUserQuitWindowClose(instance) - windowHandlers.close({ preventDefault: vi.fn() }) - windowHandlers['will-prevent-unload']?.() - windowHandlers.close({ preventDefault: vi.fn() }) - // The first attempt's deadline is cleared by the veto; the second is a plain close. - await vi.advanceTimersByTimeAsync(WINDOW_QUIT_RENDERER_ACK_TIMEOUT_MS * 2) - - expect(instance.destroy).not.toHaveBeenCalled() - }) -}) diff --git a/src/main/window/createMainWindow.ts b/src/main/window/createMainWindow.ts index 1e12a11b8a6..d7a1ef426ac 100644 --- a/src/main/window/createMainWindow.ts +++ b/src/main/window/createMainWindow.ts @@ -8,8 +8,8 @@ import { browserManager } from '../browser/guest-lifecycle/manager/browser-manag import { getBrowserClientHostId } from '../browser/client-hosts/lifecycle/browser-client-host-id' import { formatBrowserClientHostIdArgument } from '../../shared/browser/client-hosting/browser-client-host-id-argument' import { formatWindowMaterialArgument, resolveWindowMaterial } from '../../shared/window-material' -import { windowMaterialOptions } from './window-material-options' -import { rememberWindowMaterial } from './window-material-suppression' +import { windowMaterialOptions } from './presentation/window-material-options' +import { rememberWindowMaterial } from './presentation/window-material-suppression' import { markSystemSessionEnding } from '../crash-reporting/process-exits/expected-teardown-state' import { recordDurableCrashBreadcrumb } from '../crash-reporting/breadcrumbs/durable-crash-breadcrumb' import { clearTrustedUIRendererWebContentsId, setTrustedUIRendererWebContentsId } from '../ipc/ui' @@ -17,17 +17,17 @@ import { flushUnsavedCloudSessions } from '../orca-profiles/cloud-session/profil import type { Store } from '../persistence/loading-store/store' import { closeDashboardPopout } from './dashboard-popout-window' import { closeWorkspaceSpaceWindow } from './workspace-space-window' -import { - installMainWindowCloseLifecycle, - WINDOW_QUIT_RENDERER_ACK_TIMEOUT_MS -} from './main-window-close-lifecycle' -import type { CreateMainWindowOptions, MainWindowLoadObserver } from './main-window-contracts' -import { mainWindowLoadErrorCode } from './main-window-load-error-code' -import { installMainWindowFocusLifecycle } from './main-window-focus-lifecycle' -import { installMainWindowShortcutRouting } from './main-window-shortcut-routing' -import { installMainWindowStateLifecycle } from './main-window-state-lifecycle' -import { installMainWindowActivityRelay } from './main-window-activity' -import { stopHiddenWindowFramePumpOnShow } from './hidden-window-frame-pump' +import { installMainWindowCloseLifecycle } from './main-window/main-window-close-lifecycle' +import type { + CreateMainWindowOptions, + MainWindowLoadObserver +} from './main-window/main-window-contracts' +import { mainWindowLoadErrorCode } from './renderer-recovery/main-window-load-error-code' +import { installMainWindowFocusLifecycle } from './main-window/main-window-focus-lifecycle' +import { installMainWindowShortcutRouting } from './main-window/main-window-shortcut-routing' +import { installMainWindowStateLifecycle } from './main-window/main-window-state-lifecycle' +import { installMainWindowActivityRelay } from './main-window/main-window-activity' +import { stopHiddenWindowFramePumpOnShow } from './visibility/hidden-window-frame-pump' import { wslHostsWindowArguments } from '../wsl/host-lifecycle/wsl-host-gate' import { formatHiddenWindowFramePumpArgument, @@ -41,14 +41,12 @@ import { TITLEBAR_CSS_CENTER, TRAFFIC_LIGHT_RADIUS, TRAFFIC_LIGHT_X -} from './main-window-visual-lifecycle' -import { installMainWindowWebviewSecurity } from './main-window-webview-security' -import { rectHasVisibleAreaOnAnyDisplay } from './window-bounds-validation' +} from './main-window/main-window-visual-lifecycle' +import { installMainWindowWebviewSecurity } from './security/main-window-webview-security' +import { rectHasVisibleAreaOnAnyDisplay } from './presentation/window-bounds-validation' import { installWindowsPathRegistryChangeListener } from '../pty/environment/windows-path-registry-change' import { recordAgentSessionRuntimeEnd } from '../runtime/agent-session/records/agent-session-runtime-end-record' -export { WINDOW_QUIT_RENDERER_ACK_TIMEOUT_MS } - export function loadMainWindow(mainWindow: BrowserWindow, observer?: MainWindowLoadObserver): void { installRendererHangStackPolicy( mainWindow.webContents, diff --git a/src/main/window/dashboard-popout-window.ts b/src/main/window/dashboard-popout-window.ts index 2da942050a3..441b38458f0 100644 --- a/src/main/window/dashboard-popout-window.ts +++ b/src/main/window/dashboard-popout-window.ts @@ -2,20 +2,23 @@ import { mainI18n, translateMain } from '../i18n/main-i18n' import { app, BrowserWindow, nativeTheme, type WebContents, type Event } from 'electron' import { join } from 'node:path' import type { Store } from '../persistence/loading-store/store' -import { isBackgroundLaunch, showWindowWithoutStealingFocus } from './foreground-activation-policy' -import { rectHasVisibleAreaOnAnyDisplay } from './window-bounds-validation' +import { + isBackgroundLaunch, + showWindowWithoutStealingFocus +} from './activation/foreground-activation-policy' +import { rectHasVisibleAreaOnAnyDisplay } from './presentation/window-bounds-validation' import { sendToTrustedUIRenderer } from '../ipc/ui' -import { installPrivilegedWindowNavigationPolicy } from './privileged-window-navigation' +import { installPrivilegedWindowNavigationPolicy } from './security/privileged-window-navigation' import { stepUIZoomLevel, type UIZoomDirection } from '../../shared/ui-zoom-level' import { nativeZoomCommandMatchesKeybindings } from '../../shared/window-shortcut-policy' -import { - keybindingMatchesAction, - type KeybindingActionId, - type KeybindingInput, - type KeybindingOverrides -} from '../../shared/keybindings' +import { keybindingMatchesAction } from '../../shared/keybindings/matching' +import type { + KeybindingActionId, + KeybindingInput, + KeybindingOverrides +} from '../../shared/keybindings/types' import { wslHostsWindowArguments } from '../wsl/host-lifecycle/wsl-host-gate' -import { isMacAppPasteInput } from './mac-app-paste-input' +import { isMacAppPasteInput } from './editing/mac-app-paste-input' const MIN_WIDTH = 480 const MIN_HEIGHT = 360 diff --git a/src/main/window/macos-tahoe-release.ts b/src/main/window/desktop-integration/macos-tahoe-release.ts similarity index 100% rename from src/main/window/macos-tahoe-release.ts rename to src/main/window/desktop-integration/macos-tahoe-release.ts diff --git a/src/main/window/editable-context-menu-labels.ts b/src/main/window/editing/editable-context-menu-labels.ts similarity index 97% rename from src/main/window/editable-context-menu-labels.ts rename to src/main/window/editing/editable-context-menu-labels.ts index ec7b9c580cd..8dbc18939c1 100644 --- a/src/main/window/editable-context-menu-labels.ts +++ b/src/main/window/editing/editable-context-menu-labels.ts @@ -1,4 +1,4 @@ -import { translateMain } from '../i18n/main-i18n' +import { translateMain } from '../../i18n/main-i18n' /** Labels resolve at menu-build time so they follow the current UI language. */ export function editableContextMenuLabels() { diff --git a/src/main/window/editable-context-menu-popup.ts b/src/main/window/editing/editable-context-menu-popup.ts similarity index 100% rename from src/main/window/editable-context-menu-popup.ts rename to src/main/window/editing/editable-context-menu-popup.ts diff --git a/src/main/window/editable-context-menu.ts b/src/main/window/editing/editable-context-menu.ts similarity index 97% rename from src/main/window/editable-context-menu.ts rename to src/main/window/editing/editable-context-menu.ts index 3322028eec1..4949975c440 100644 --- a/src/main/window/editable-context-menu.ts +++ b/src/main/window/editing/editable-context-menu.ts @@ -3,9 +3,9 @@ import { type RichMarkdownContextMenuCommand, type RichMarkdownContextMenuCommandPayload, type RichMarkdownContextMenuTableTarget -} from '../../shared/rich-markdown-context-menu' -import type { ContextMenuSpelling } from '../../shared/browser/guest-lifecycle/browser-guest-events' -import { translateMain } from '../i18n/main-i18n' +} from '../../../shared/rich-markdown-context-menu' +import type { ContextMenuSpelling } from '../../../shared/browser/guest-lifecycle/browser-guest-events' +import { translateMain } from '../../i18n/main-i18n' import { editableContextMenuLabels } from './editable-context-menu-labels' type EditableContextMenuWebContents = Pick< diff --git a/src/main/window/mac-app-paste-input.test.ts b/src/main/window/editing/mac-app-paste-input.test.ts similarity index 100% rename from src/main/window/mac-app-paste-input.test.ts rename to src/main/window/editing/mac-app-paste-input.test.ts diff --git a/src/main/window/mac-app-paste-input.ts b/src/main/window/editing/mac-app-paste-input.ts similarity index 79% rename from src/main/window/mac-app-paste-input.ts rename to src/main/window/editing/mac-app-paste-input.ts index 2b5c91eef02..0459f5c64af 100644 --- a/src/main/window/mac-app-paste-input.ts +++ b/src/main/window/editing/mac-app-paste-input.ts @@ -1,4 +1,7 @@ -import { logicalKeyTokenFromInput, physicalCodeKeyTokenFromInput } from '../../shared/keybindings' +import { + logicalKeyTokenFromInput, + physicalCodeKeyTokenFromInput +} from '../../../shared/keybindings/input' export function isMacAppPasteInput(input: Electron.Input): boolean { return ( diff --git a/src/main/window/checked-drag-temp-source.ts b/src/main/window/file-drop/checked-drag-temp-source.ts similarity index 94% rename from src/main/window/checked-drag-temp-source.ts rename to src/main/window/file-drop/checked-drag-temp-source.ts index 79a0a0f049b..1f831eb060e 100644 --- a/src/main/window/checked-drag-temp-source.ts +++ b/src/main/window/file-drop/checked-drag-temp-source.ts @@ -2,15 +2,15 @@ import { createWriteStream, type Stats } from 'node:fs' import { lstat, mkdtemp, rm, writeFile, type FileHandle } from 'node:fs/promises' import { basename, join } from 'node:path' import { pipeline } from 'node:stream/promises' -import { AGENT_SESSION_ATTACHMENT_MAX_BYTES } from '../../shared/agent-session/agent-session-attachments' -import type { NativeFileDropCopyFailureReason } from '../../shared/file-import/native-file-drop' -import { readNodeFileHandleWithinLimit } from '../../shared/file-content/node-bounded-file-reader' +import { AGENT_SESSION_ATTACHMENT_MAX_BYTES } from '../../../shared/agent-session/agent-session-attachments' +import type { NativeFileDropCopyFailureReason } from '../../../shared/file-import/native-file-drop' +import { readNodeFileHandleWithinLimit } from '../../../shared/file-content/node-bounded-file-reader' import type { DragTempCopyBatch, DragTempCopyEnvironment, DragTempCopyItemResult } from './dragged-temp-file-copy' -import { ensureOwnedTempStagingRoot } from './owned-temp-staging-root' +import { ensureOwnedTempStagingRoot } from '../../filesystem/owned-temp-staging-root' const COPY_DIR_PREFIX = 'orca-drop-' const COPY_HIGH_WATER_MARK = 1024 * 1024 diff --git a/src/main/window/darwin-user-temp-dir.test.ts b/src/main/window/file-drop/darwin-user-temp-dir.test.ts similarity index 100% rename from src/main/window/darwin-user-temp-dir.test.ts rename to src/main/window/file-drop/darwin-user-temp-dir.test.ts diff --git a/src/main/window/darwin-user-temp-dir.ts b/src/main/window/file-drop/darwin-user-temp-dir.ts similarity index 100% rename from src/main/window/darwin-user-temp-dir.ts rename to src/main/window/file-drop/darwin-user-temp-dir.ts diff --git a/src/main/window/drag-temp-path.ts b/src/main/window/file-drop/drag-temp-path.ts similarity index 100% rename from src/main/window/drag-temp-path.ts rename to src/main/window/file-drop/drag-temp-path.ts diff --git a/src/main/window/dragged-temp-file-copy.test.ts b/src/main/window/file-drop/dragged-temp-file-copy.test.ts similarity index 98% rename from src/main/window/dragged-temp-file-copy.test.ts rename to src/main/window/file-drop/dragged-temp-file-copy.test.ts index ba806ce338c..868504568b9 100644 --- a/src/main/window/dragged-temp-file-copy.test.ts +++ b/src/main/window/file-drop/dragged-temp-file-copy.test.ts @@ -15,7 +15,7 @@ import { tmpdir } from 'node:os' import { basename, dirname, join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { runProcess } from '@orca/process-host' -import type * as RuntimeImportLimits from '../ipc/runtime-import-limits' +import type * as RuntimeImportLimits from '../../ipc/runtime-import-limits' const fsFaults: { beforeCopyWrite: (() => void) | null @@ -36,7 +36,7 @@ vi.mock('node:fs/promises', async (importOriginal) => { } }) -vi.mock('../ipc/runtime-import-limits', async (importOriginal) => ({ +vi.mock('../../ipc/runtime-import-limits', async (importOriginal) => ({ ...(await importOriginal()), REMOTE_IMPORT_MAX_FILE_BYTES: 10, REMOTE_IMPORT_MAX_TOTAL_BYTES: 16 diff --git a/src/main/window/dragged-temp-file-copy.ts b/src/main/window/file-drop/dragged-temp-file-copy.ts similarity index 97% rename from src/main/window/dragged-temp-file-copy.ts rename to src/main/window/file-drop/dragged-temp-file-copy.ts index c21519fb377..65f117ef4fe 100644 --- a/src/main/window/dragged-temp-file-copy.ts +++ b/src/main/window/file-drop/dragged-temp-file-copy.ts @@ -1,19 +1,19 @@ import { constants, type Stats } from 'node:fs' import { lstat, open, realpath, rm } from 'node:fs/promises' import { basename, resolve } from 'node:path' -import type { NativeFileDropCopyFailureReason } from '../../shared/file-import/native-file-drop' +import type { NativeFileDropCopyFailureReason } from '../../../shared/file-import/native-file-drop' import { formatByteCeiling, REMOTE_IMPORT_MAX_FILE_BYTES, REMOTE_IMPORT_MAX_TOTAL_BYTES -} from '../ipc/runtime-import-limits' +} from '../../ipc/runtime-import-limits' import { hasDragTempMarker, isPathWithin, mayNeedDragTempCopy, relativeSegments } from './drag-temp-path' -import { getOwnedTempStagingRoot } from './owned-temp-staging-root' +import { getOwnedTempStagingRoot } from '../../filesystem/owned-temp-staging-root' import { classifyFailure, copyCheckedDragTempSource, diff --git a/src/main/window/dropped-path-preparation-ipc.test.ts b/src/main/window/file-drop/dropped-path-preparation-ipc.test.ts similarity index 100% rename from src/main/window/dropped-path-preparation-ipc.test.ts rename to src/main/window/file-drop/dropped-path-preparation-ipc.test.ts diff --git a/src/main/window/dropped-path-preparation-ipc.ts b/src/main/window/file-drop/dropped-path-preparation-ipc.ts similarity index 93% rename from src/main/window/dropped-path-preparation-ipc.ts rename to src/main/window/file-drop/dropped-path-preparation-ipc.ts index 92e5c558c45..fe02210f706 100644 --- a/src/main/window/dropped-path-preparation-ipc.ts +++ b/src/main/window/file-drop/dropped-path-preparation-ipc.ts @@ -2,12 +2,12 @@ import { app, ipcMain, type BrowserWindow } from 'electron' import { createRejectedNativeFileDropPayload, validateNativeFileDropPaths -} from '../../shared/file-import/native-file-drop' +} from '../../../shared/file-import/native-file-drop' import type { PrepareDroppedPathsRequest, PreparedDroppedPaths -} from '../../shared/file-import/native-file-drop-preparation' -import { abortWhenRendererGone } from '../ipc/renderer-lifetime-abort' +} from '../../../shared/file-import/native-file-drop-preparation' +import { abortWhenRendererGone } from '../../ipc/renderer-lifetime-abort' import { getDragTempCopyRoot } from './dragged-temp-file-copy' import { createDroppedPathPreparationQueue, diff --git a/src/main/window/dropped-path-preparation.test.ts b/src/main/window/file-drop/dropped-path-preparation.test.ts similarity index 85% rename from src/main/window/dropped-path-preparation.test.ts rename to src/main/window/file-drop/dropped-path-preparation.test.ts index 50a3264ebb7..8e4ea2f8cc9 100644 --- a/src/main/window/dropped-path-preparation.test.ts +++ b/src/main/window/file-drop/dropped-path-preparation.test.ts @@ -11,8 +11,8 @@ import { writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' -import { AgentSessionAttachmentStore } from '../native-chat/agent-session-attachments/agent-session-attachment-store' -import { AGENT_SESSION_ATTACHMENT_MAX_BYTES } from '../../shared/agent-session/agent-session-attachments' +import { AgentSessionAttachmentStore } from '../../native-chat/agent-session-attachments/agent-session-attachment-store' +import { AGENT_SESSION_ATTACHMENT_MAX_BYTES } from '../../../shared/agent-session/agent-session-attachments' import { runProcess } from '@orca/process-host' import { dirname, join } from 'node:path' import { beforeEach, describe, expect, it, onTestFinished, vi } from 'vitest' @@ -278,32 +278,6 @@ describe('dropped path preparation through the shared copy queue', () => { expect(handles.every((handle) => handle.fd === -1)).toBe(true) }) - it.each(['agent', 'main-reader'] as const)( - 'withholds uncopied originals only from agents: %s', - async (consumer) => { - materialize.mockResolvedValue([ - { sourcePath: ORDINARY, status: 'imported', destPath: ORDINARY }, - { sourcePath: TEMP, status: 'uncopied', reason: 'storage-full' } - ]) - const { enqueue } = queue() - const result = await enqueue({ paths: [ORDINARY, TEMP], consumer }) - expect(result.paths).toEqual(consumer === 'agent' ? [ORDINARY] : [ORDINARY, TEMP]) - expect(result.failures).toEqual( - consumer === 'agent' - ? [ - { - byteLength: 0, - pathCount: 1, - reason: 'temp-copy-failed', - target: 'rejected', - commonReason: 'storage-full' - } - ] - : [] - ) - } - ) - it('shares serialization and the pending cap across replacement-window queues', async () => { materialize.mockReturnValue(new Promise(() => undefined)) const lane = createDragTempCopyLane() @@ -334,36 +308,6 @@ describe('dropped path preparation through the shared copy queue', () => { await pending }) - it('aborts running and queued requests on reload and releases their listeners', async () => { - materialize.mockReturnValue(new Promise(() => undefined)) - const { enqueue, controller, dispose } = queue() - const running = enqueue({ paths: [TEMP], consumer: 'agent' }) - const queued = enqueue({ paths: [TEMP], consumer: 'agent' }) - const assertions = [ - expect(running).rejects.toThrow('reloaded'), - expect(queued).rejects.toThrow('reloaded') - ] - await settle() - controller.abort(new Error('reloaded')) - await Promise.all(assertions) - await settle() - expect(materialize).toHaveBeenCalledTimes(1) - expect(dispose).toHaveBeenCalledTimes(2) - }) - - it('reports timeout, keeps ordinary paths, and serves the next copy', async () => { - materialize - .mockReturnValueOnce(new Promise(() => undefined)) - .mockResolvedValueOnce([{ sourcePath: TEMP, status: 'imported', destPath: COPY }]) - const { enqueue } = queue(undefined, 5) - const first = enqueue({ paths: [ORDINARY, TEMP], consumer: 'agent' }) - const next = enqueue({ paths: [TEMP], consumer: 'agent' }) - await expect(first).resolves.toMatchObject({ - paths: [ORDINARY], - failures: [{ commonReason: 'timed-out' }] - }) - await expect(next).resolves.toEqual({ paths: [COPY], failures: [] }) - }) it('passes drag-temp-looking paths unchanged on Linux and Windows', () => { for (const platform of ['linux', 'win32'] as const) { const enqueue = createDroppedPathPreparationQueue({ diff --git a/src/main/window/dropped-path-preparation.ts b/src/main/window/file-drop/dropped-path-preparation.ts similarity index 95% rename from src/main/window/dropped-path-preparation.ts rename to src/main/window/file-drop/dropped-path-preparation.ts index 2e98806c196..ad6588a3b0b 100644 --- a/src/main/window/dropped-path-preparation.ts +++ b/src/main/window/file-drop/dropped-path-preparation.ts @@ -1,11 +1,11 @@ -import { AGENT_SESSION_ATTACHMENT_MAX_BYTES } from '../../shared/agent-session/agent-session-attachments' +import { AGENT_SESSION_ATTACHMENT_MAX_BYTES } from '../../../shared/agent-session/agent-session-attachments' import { basename } from 'node:path' -import type { AgentSessionAttachmentStore } from '../native-chat/agent-session-attachments/agent-session-attachment-store' -import type { NativeFileDropCopyFailureReason } from '../../shared/file-import/native-file-drop' +import type { AgentSessionAttachmentStore } from '../../native-chat/agent-session-attachments/agent-session-attachment-store' +import type { NativeFileDropCopyFailureReason } from '../../../shared/file-import/native-file-drop' import type { PrepareDroppedPathsRequest, PreparedDroppedPaths -} from '../../shared/file-import/native-file-drop-preparation' +} from '../../../shared/file-import/native-file-drop-preparation' import { DragTempCopyBatch, closeDragTempSource, diff --git a/src/main/window/macos-app-activation.test.ts b/src/main/window/macos-app-activation.test.ts deleted file mode 100644 index e4670422cb4..00000000000 --- a/src/main/window/macos-app-activation.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { BrowserWindow } from 'electron' -import { describe, expect, it, vi } from 'vitest' -import { createMacAppActivationHandler } from './macos-app-activation' - -function makeWindow(destroyed = false): BrowserWindow { - return { - isDestroyed: vi.fn(() => destroyed) - } as unknown as BrowserWindow -} - -describe('createMacAppActivationHandler', () => { - it('leaves an existing window to native macOS activation', () => { - const requestActivation = vi.fn() - const handler = createMacAppActivationHandler({ - getWindow: () => makeWindow(), - requestActivation - }) - - handler() - - expect(requestActivation).not.toHaveBeenCalled() - }) - - it.each([null, makeWindow(true)])( - 'requests desktop activation for a missing or destroyed window', - (window) => { - const requestActivation = vi.fn() - const handler = createMacAppActivationHandler({ - getWindow: () => window, - requestActivation - }) - - handler() - - expect(requestActivation).toHaveBeenCalledTimes(1) - } - ) -}) diff --git a/src/main/window/macos-desktop-handoff.test.ts b/src/main/window/macos-desktop-handoff.test.ts deleted file mode 100644 index 1ad987ec0a9..00000000000 --- a/src/main/window/macos-desktop-handoff.test.ts +++ /dev/null @@ -1,150 +0,0 @@ -import { EventEmitter } from 'node:events' -import { afterEach, describe, expect, it, vi } from 'vitest' - -const { spawnProcessMock } = vi.hoisted(() => ({ spawnProcessMock: vi.fn() })) - -vi.mock('electron', () => ({ - app: { - getPath: () => '/Applications/Orca.app/Contents/MacOS/Orca', - dock: { hide: vi.fn() }, - setActivationPolicy: vi.fn() - } -})) -vi.mock('@orca/process-host', () => ({ spawnProcess: spawnProcessMock })) - -const { createDesktopHandoff, handOffToDesktopApp } = await import('./macos-desktop-handoff') - -function makeChild(): EventEmitter & { unref: ReturnType } { - return Object.assign(new EventEmitter(), { unref: vi.fn() }) -} - -afterEach(() => { - spawnProcessMock.mockReset() - vi.restoreAllMocks() -}) - -describe('handOffToDesktopApp', () => { - it('opens a new instance of the installed bundle with a Dock launch environment', () => { - const child = makeChild() - spawnProcessMock.mockReturnValue(child) - - handOffToDesktopApp([], { - platform: 'darwin', - env: {}, - reapplyActivationPolicy: vi.fn() - }) - - expect(spawnProcessMock).toHaveBeenCalledWith({ - program: '/usr/bin/open', - args: ['-n', '/Applications/Orca.app'], - env: {}, - detached: true, - stdio: 'ignore' - }) - expect(child.unref).toHaveBeenCalledOnce() - }) - - it('passes buffered links and documents to the new instance', () => { - spawnProcessMock.mockReturnValue(makeChild()) - - handOffToDesktopApp(['orca://skills/share/abc', '/Users/me/notes.md'], { - platform: 'darwin', - env: {}, - executablePath: '/Users/me/Applications/Orca.app/Contents/MacOS/Orca', - reapplyActivationPolicy: vi.fn() - }) - - expect(spawnProcessMock.mock.calls[0][0].args).toEqual([ - '-n', - '/Users/me/Applications/Orca.app', - '--args', - 'orca://skills/share/abc', - '/Users/me/notes.md' - ]) - }) - - it('drops back out of the Dock after launching the desktop app', () => { - spawnProcessMock.mockReturnValue(makeChild()) - const reapplyActivationPolicy = vi.fn() - - handOffToDesktopApp([], { - platform: 'darwin', - env: {}, - reapplyActivationPolicy - }) - - expect(reapplyActivationPolicy).toHaveBeenCalledOnce() - expect(reapplyActivationPolicy.mock.invocationCallOrder[0]).toBeGreaterThan( - spawnProcessMock.mock.invocationCallOrder[0] - ) - }) - - it('logs a failed launch instead of taking main down', () => { - const child = makeChild() - spawnProcessMock.mockReturnValue(child) - const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - - handOffToDesktopApp([], { - platform: 'darwin', - env: {}, - reapplyActivationPolicy: vi.fn() - }) - child.emit('error', new Error('spawn /usr/bin/open ENOENT')) - - expect(warn).toHaveBeenCalledOnce() - }) - - it.each([{ ORCA_BACKGROUND_LAUNCH: '1' }, { ORCA_E2E_USER_DATA_DIR: '/tmp/e2e' }])( - 'never launches the real desktop app from an automated sidecar (%o)', - (env) => { - const reapplyActivationPolicy = vi.fn() - - handOffToDesktopApp([], { - platform: 'darwin', - env, - reapplyActivationPolicy - }) - - expect(spawnProcessMock).not.toHaveBeenCalled() - expect(reapplyActivationPolicy).toHaveBeenCalledOnce() - } - ) -}) - -describe('createDesktopHandoff', () => { - const nextTurn = (): Promise => new Promise((resolve) => setImmediate(resolve)) - - it('hands a multi-file open over in one launch carrying every file', async () => { - const pending: string[] = [] - const handOff = vi.fn() - const requestHandoff = createDesktopHandoff({ - drainArguments: () => pending.splice(0), - handOff - }) - - for (const file of ['/Users/me/a.md', '/Users/me/b.md', '/Users/me/c.csv']) { - pending.push(file) - requestHandoff() - } - expect(handOff).not.toHaveBeenCalled() - await nextTurn() - - expect(handOff).toHaveBeenCalledOnce() - expect(handOff).toHaveBeenCalledWith(['/Users/me/a.md', '/Users/me/b.md', '/Users/me/c.csv']) - }) - - it('launches again for a later open', async () => { - const handOff = vi.fn() - const requestHandoff = createDesktopHandoff({ - drainArguments: () => [], - handOff - }) - - requestHandoff() - await nextTurn() - requestHandoff() - await nextTurn() - - expect(handOff).toHaveBeenCalledTimes(2) - }) -}) diff --git a/src/main/window/main-window-state-lifecycle.test.ts b/src/main/window/main-window-state-lifecycle.test.ts deleted file mode 100644 index 5cc44785853..00000000000 --- a/src/main/window/main-window-state-lifecycle.test.ts +++ /dev/null @@ -1,150 +0,0 @@ -import { EventEmitter } from 'node:events' -import { afterEach, beforeEach, expect, it, vi } from 'vitest' - -const { appMock, launchPolicy } = await vi.hoisted(async () => { - const { EventEmitter } = await import('node:events') - return { appMock: new EventEmitter(), launchPolicy: { background: false, windowless: true } } -}) -vi.mock('electron', () => ({ app: appMock })) -vi.mock('./foreground-activation-policy', () => ({ - isBackgroundLaunch: () => launchPolicy.background, - isWindowlessLaunch: () => launchPolicy.windowless, - showWindowWithoutStealingFocus: vi.fn() -})) -vi.mock('./main-window-visual-lifecycle', () => ({ - MIN_WIDTH: 480, - MIN_HEIGHT: 360, - syncTrafficLightPosition: vi.fn() -})) - -import { installMainWindowStateLifecycle } from './main-window-state-lifecycle' - -beforeEach(() => { - vi.useFakeTimers() - appMock.removeAllListeners() - launchPolicy.background = false - launchPolicy.windowless = true -}) -afterEach(() => vi.useRealTimers()) - -it('continues saving bounds after an updater quit veto and freezes them on allowed quit', async () => { - const mainWindow = Object.assign(new EventEmitter(), { - webContents: Object.assign(new EventEmitter(), { - send: vi.fn(), - setZoomLevel: vi.fn() - }), - isDestroyed: () => false, - isFullScreen: () => false, - isMaximized: () => false, - getBounds: () => ({ x: 0, y: 0, width: 1200, height: 800 }) - }) - const updateUI = vi.fn() - const lifecycle = installMainWindowStateLifecycle({ - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: This fixture implements the window members read by the bounds lifecycle. - mainWindow: mainWindow as never, - revealOnDidFinishLoad: false, - savedMaximized: false, - savedFullScreen: false, - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Bounds persistence reads only updateUI from this store fixture. - store: { updateUI } as never - }) - appMock.emit('before-quit', { defaultPrevented: true }) - expect(lifecycle.isWindowClosing()).toBe(false) - mainWindow.emit('resize') - await vi.advanceTimersByTimeAsync(500) - expect(updateUI).toHaveBeenCalledWith({ - windowMaximized: false, - windowBounds: { x: 0, y: 0, width: 1200, height: 800 } - }) - - updateUI.mockClear() - appMock.emit('before-quit', { defaultPrevented: false }) - expect(lifecycle.isWindowClosing()).toBe(true) - mainWindow.emit('resize') - await vi.advanceTimersByTimeAsync(500) - expect(updateUI).not.toHaveBeenCalled() - lifecycle.clearInitialRevealFallbackTimer() - lifecycle.dispose() -}) - -function installFullScreenFixture(): { - lifecycle: ReturnType - mainWindow: EventEmitter & { setFullScreen: (flag: boolean) => void } - windowState: { maximized: boolean; fullScreen: boolean; maximizedUnderFullScreen: boolean } - persisted: Record -} { - launchPolicy.windowless = false - const windowState = { maximized: false, fullScreen: false, maximizedUnderFullScreen: false } - const mainWindow = Object.assign(new EventEmitter(), { - webContents: Object.assign(new EventEmitter(), { send: vi.fn(), setZoomLevel: vi.fn() }), - isDestroyed: () => false, - isFullScreen: () => windowState.fullScreen, - getBounds: () => ({ x: 0, y: 0, width: 2560, height: 1440 }), - maximize: () => { - windowState.maximized = true - }, - setFullScreen: (flag: boolean) => { - if (flag) { - windowState.maximizedUnderFullScreen = windowState.maximized - } - windowState.fullScreen = flag - } - }) - const persisted: Record = {} - const lifecycle = installMainWindowStateLifecycle({ - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: This fixture implements the window members read by reveal and fullscreen persistence. - mainWindow: mainWindow as never, - revealOnDidFinishLoad: false, - savedMaximized: true, - savedFullScreen: true, - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Fullscreen persistence reads only updateUI from this store fixture. - store: { - updateUI: (patch: Record) => Object.assign(persisted, patch) - } as never - }) - return { lifecycle, mainWindow, windowState, persisted } -} - -it('restores native fullscreen over the maximized frame and keeps that frame while fullscreen', () => { - const { lifecycle, mainWindow, windowState, persisted } = installFullScreenFixture() - const leaveFullScreen = (): void => { - mainWindow.setFullScreen(false) - mainWindow.emit('leave-full-screen') - } - mainWindow.emit('ready-to-show') - expect(windowState).toEqual({ maximized: true, fullScreen: true, maximizedUnderFullScreen: true }) - // macOS emits unmaximize mid-transition, after the fullscreen style mask is set. - mainWindow.emit('unmaximize') - mainWindow.emit('enter-full-screen') - expect(persisted).toEqual({ windowFullScreen: true }) - - leaveFullScreen() - expect(persisted).toEqual({ windowFullScreen: false }) - mainWindow.emit('unmaximize') - expect(persisted).toEqual({ - windowFullScreen: false, - windowMaximized: false, - windowBounds: { x: 0, y: 0, width: 2560, height: 1440 } - }) - - mainWindow.setFullScreen(true) - mainWindow.emit('enter-full-screen') - appMock.emit('before-quit', { defaultPrevented: false }) - leaveFullScreen() - expect(persisted).toMatchObject({ windowFullScreen: true }) - lifecycle.clearInitialRevealFallbackTimer() - lifecycle.dispose() -}) - -it('does not restore native fullscreen for background launches', () => { - launchPolicy.background = true - const { lifecycle, mainWindow, windowState } = installFullScreenFixture() - mainWindow.emit('ready-to-show') - expect(windowState).toEqual({ - maximized: true, - fullScreen: false, - maximizedUnderFullScreen: false - }) - lifecycle.clearInitialRevealFallbackTimer() - lifecycle.dispose() -}) diff --git a/src/main/window/main-window-activity.ts b/src/main/window/main-window/main-window-activity.ts similarity index 100% rename from src/main/window/main-window-activity.ts rename to src/main/window/main-window/main-window-activity.ts diff --git a/src/main/window/main-window-close-lifecycle.ts b/src/main/window/main-window/main-window-close-lifecycle.ts similarity index 96% rename from src/main/window/main-window-close-lifecycle.ts rename to src/main/window/main-window/main-window-close-lifecycle.ts index dd6ba13f6cc..2275643160a 100644 --- a/src/main/window/main-window-close-lifecycle.ts +++ b/src/main/window/main-window/main-window-close-lifecycle.ts @@ -1,7 +1,7 @@ import { ipcMain, Menu, Notification, type BrowserWindow } from 'electron' -import { QUIT_RENDERER_ACK_TIMEOUT_MS } from '../../shared/quit-teardown-deadline' -import { translateMain } from '../i18n/main-i18n' -import type { Store } from '../persistence/loading-store/store' +import { QUIT_RENDERER_ACK_TIMEOUT_MS } from '../../../shared/quit-teardown-deadline' +import { translateMain } from '../../i18n/main-i18n' +import type { Store } from '../../persistence/loading-store/store' import { resolveWindowCloseAction } from './window-close-decision' import type { CreateMainWindowOptions } from './main-window-contracts' import type { MainWindowFocusLifecycle } from './main-window-focus-lifecycle' @@ -9,8 +9,6 @@ import type { MainWindowStateLifecycle } from './main-window-state-lifecycle' import { syncTrafficLightPosition } from './main-window-visual-lifecycle' import { consumeUserQuitWindowClose } from './user-quit-window-close' -export const WINDOW_QUIT_RENDERER_ACK_TIMEOUT_MS = QUIT_RENDERER_ACK_TIMEOUT_MS - export function installMainWindowCloseLifecycle(args: { focus: MainWindowFocusLifecycle mainWindow: BrowserWindow @@ -50,7 +48,7 @@ export function installMainWindowCloseLifecycle(args: { console.warn('[window] Renderer did not acknowledge quit; destroying unresponsive window') state.freezeBoundsOnQuit() mainWindow.destroy() - }, WINDOW_QUIT_RENDERER_ACK_TIMEOUT_MS) + }, QUIT_RENDERER_ACK_TIMEOUT_MS) quitRendererAckTimer.unref?.() } let lastAcknowledgedRequestId = 0 diff --git a/src/main/window/main-window-contracts.ts b/src/main/window/main-window/main-window-contracts.ts similarity index 89% rename from src/main/window/main-window-contracts.ts rename to src/main/window/main-window/main-window-contracts.ts index 91937c3b16b..0d84dd910c7 100644 --- a/src/main/window/main-window-contracts.ts +++ b/src/main/window/main-window/main-window-contracts.ts @@ -1,11 +1,11 @@ -import type { KeybindingOverrides } from '../../shared/keybindings' -import type { LowCommitOomVerdict } from '../crash-reporting/recovery/low-commit-oom-recovery-gate' +import type { KeybindingOverrides } from '../../../shared/keybindings/types' +import type { LowCommitOomVerdict } from '../../crash-reporting/recovery/low-commit-oom-recovery-gate' import type { RecoveryExhaustionCause, RecoveryReloadMilestone, RecoveryReloadTrigger -} from './renderer-recovery-reload-watchdog' -import type { RendererLivenessAtDeath } from './renderer-liveness-at-death' +} from '../renderer-recovery/renderer-recovery-reload-watchdog' +import type { RendererLivenessAtDeath } from '../renderer-recovery/renderer-liveness-at-death' /** Per-load outcome from Electron's load promise, which is scoped to that one load unlike `did-finish-load`. */ export type MainWindowLoadObserver = { diff --git a/src/main/window/main-window-focus-lifecycle.ts b/src/main/window/main-window/main-window-focus-lifecycle.ts similarity index 92% rename from src/main/window/main-window-focus-lifecycle.ts rename to src/main/window/main-window/main-window-focus-lifecycle.ts index ba9c1380998..c14f19d2b31 100644 --- a/src/main/window/main-window-focus-lifecycle.ts +++ b/src/main/window/main-window/main-window-focus-lifecycle.ts @@ -1,32 +1,32 @@ import { ipcMain, type BrowserWindow } from 'electron' -import { isCrashReportReason } from '../../shared/crash-reporting' +import { isCrashReportReason } from '../../../shared/crash-reporting' import { plainTextContextMenuTargetChannel, richMarkdownContextMenuTargetChannel, type RichMarkdownContextMenuTableTarget -} from '../../shared/rich-markdown-context-menu' +} from '../../../shared/rich-markdown-context-menu' import { DEFAULT_RENDERER_RECOVERY_MAX_RECOVERIES, DEFAULT_RENDERER_RECOVERY_WINDOW_MS, RendererRecoveryCircuitBreaker -} from '../crash-reporting/recovery/renderer-recovery-circuit-breaker' -import { createLowCommitOomRecoveryGate } from '../crash-reporting/recovery/low-commit-oom-recovery-gate' +} from '../../crash-reporting/recovery/renderer-recovery-circuit-breaker' +import { createLowCommitOomRecoveryGate } from '../../crash-reporting/recovery/low-commit-oom-recovery-gate' import { buildEditableContextMenuTemplate, matchingRichMarkdownContextMenuTableTarget, parseRichMarkdownContextMenuTableTarget -} from './editable-context-menu' -import { createEditableContextMenuPopup } from './editable-context-menu-popup' +} from '../editing/editable-context-menu' +import { createEditableContextMenuPopup } from '../editing/editable-context-menu-popup' import type { CreateMainWindowOptions, MainWindowLoadObserver } from './main-window-contracts' -import { browserRouteWebContentsRegistry } from '../browser/routing/sessions/browser-route-session-runtime' +import { browserRouteWebContentsRegistry } from '../../browser/routing/sessions/browser-route-session-runtime' import { attachBrowserClientPageRenderer, retireBrowserClientPageRenderer -} from '../browser/client-pages/renderer/browser-client-page-renderer-runtime' -import { registerRendererDocumentNavigation } from './renderer-document-navigation' -import { createRendererRecoveryReloadWatchdog } from './renderer-recovery-reload-watchdog' -import { createRendererLaunchFailureBackoff } from './renderer-launch-failure-backoff' -import { trackRendererLivenessAtDeath } from './renderer-liveness-at-death' +} from '../../browser/client-pages/renderer/browser-client-page-renderer-runtime' +import { registerRendererDocumentNavigation } from '../security/renderer-document-navigation' +import { createRendererRecoveryReloadWatchdog } from '../renderer-recovery/renderer-recovery-reload-watchdog' +import { createRendererLaunchFailureBackoff } from '../renderer-recovery/renderer-launch-failure-backoff' +import { trackRendererLivenessAtDeath } from '../renderer-recovery/renderer-liveness-at-death' export type MainWindowFocusLifecycle = { dispose: () => void diff --git a/src/main/window/main-window-shortcut-actions.ts b/src/main/window/main-window/main-window-shortcut-actions.ts similarity index 96% rename from src/main/window/main-window-shortcut-actions.ts rename to src/main/window/main-window/main-window-shortcut-actions.ts index 03acfaa28ab..80663d860f2 100644 --- a/src/main/window/main-window-shortcut-actions.ts +++ b/src/main/window/main-window/main-window-shortcut-actions.ts @@ -1,5 +1,5 @@ import type { BrowserWindow } from 'electron' -import type { WindowShortcutAction } from '../../shared/window-shortcut-policy' +import type { WindowShortcutAction } from '../../../shared/window-shortcut-policy' export function sendResolvedWindowShortcutAction( mainWindow: BrowserWindow, diff --git a/src/main/window/main-window-shortcut-routing.ts b/src/main/window/main-window/main-window-shortcut-routing.ts similarity index 94% rename from src/main/window/main-window-shortcut-routing.ts rename to src/main/window/main-window/main-window-shortcut-routing.ts index ce6f15827eb..32333f87e8a 100644 --- a/src/main/window/main-window-shortcut-routing.ts +++ b/src/main/window/main-window/main-window-shortcut-routing.ts @@ -3,11 +3,9 @@ import type { BrowserWindow } from 'electron' import { ModifierDoubleTapDetector, toModifierDoubleTapEvent -} from '../../shared/modifier-double-tap-detector' -import { - normalizeTerminalShortcutPolicy, - type KeybindingMatchOptions -} from '../../shared/keybindings' +} from '../../../shared/modifier-double-tap-detector' +import { normalizeTerminalShortcutPolicy } from '../../../shared/keybindings/effective' +import type { KeybindingMatchOptions } from '../../../shared/keybindings/types' import { getWindowShortcutActionId, matchesRecentTabSwitcherChord, @@ -15,18 +13,18 @@ import { resolveWindowShortcutAction, windowShortcutActionCapturesTerminal, type WindowShortcutAction -} from '../../shared/window-shortcut-policy' -import type { Store } from '../persistence/loading-store/store' +} from '../../../shared/window-shortcut-policy' +import type { Store } from '../../persistence/loading-store/store' import type { CreateMainWindowOptions } from './main-window-contracts' import type { MainWindowFocusLifecycle } from './main-window-focus-lifecycle' import { sendResolvedWindowShortcutAction } from './main-window-shortcut-actions' -import { isMacAppPasteInput } from './mac-app-paste-input' -import { dictationShortcutMode } from '../../shared/dictation-shortcut-mode' +import { isMacAppPasteInput } from '../editing/mac-app-paste-input' +import { dictationShortcutMode } from '../../../shared/dictation-shortcut-mode' import { nativeChatPromptClaimsShortcut, textInputOwnsComposition, type TextShortcutInput -} from '../../shared/text-input-shortcut-policy' +} from '../../../shared/text-input-shortcut-policy' export function installMainWindowShortcutRouting(args: { focus: MainWindowFocusLifecycle diff --git a/src/main/window/main-window/main-window-state-lifecycle.test.ts b/src/main/window/main-window/main-window-state-lifecycle.test.ts new file mode 100644 index 00000000000..e10da85f2c8 --- /dev/null +++ b/src/main/window/main-window/main-window-state-lifecycle.test.ts @@ -0,0 +1,68 @@ +import { EventEmitter } from 'node:events' +import { afterEach, beforeEach, expect, it, vi } from 'vitest' + +const { appMock, launchPolicy } = await vi.hoisted(async () => { + const { EventEmitter } = await import('node:events') + return { appMock: new EventEmitter(), launchPolicy: { background: false, windowless: true } } +}) +vi.mock('electron', () => ({ app: appMock })) +vi.mock('../activation/foreground-activation-policy', () => ({ + isBackgroundLaunch: () => launchPolicy.background, + isWindowlessLaunch: () => launchPolicy.windowless, + showWindowWithoutStealingFocus: vi.fn() +})) +vi.mock('./main-window-visual-lifecycle', () => ({ + MIN_WIDTH: 480, + MIN_HEIGHT: 360, + syncTrafficLightPosition: vi.fn() +})) + +import { installMainWindowStateLifecycle } from './main-window-state-lifecycle' + +beforeEach(() => { + vi.useFakeTimers() + appMock.removeAllListeners() + launchPolicy.background = false + launchPolicy.windowless = true +}) +afterEach(() => vi.useRealTimers()) + +it('continues saving bounds after an updater quit veto and freezes them on allowed quit', async () => { + const mainWindow = Object.assign(new EventEmitter(), { + webContents: Object.assign(new EventEmitter(), { + send: vi.fn(), + setZoomLevel: vi.fn() + }), + isDestroyed: () => false, + isFullScreen: () => false, + isMaximized: () => false, + getBounds: () => ({ x: 0, y: 0, width: 1200, height: 800 }) + }) + const updateUI = vi.fn() + const lifecycle = installMainWindowStateLifecycle({ + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: This fixture implements the window members read by the bounds lifecycle. + mainWindow: mainWindow as never, + revealOnDidFinishLoad: false, + savedMaximized: false, + savedFullScreen: false, + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Bounds persistence reads only updateUI from this store fixture. + store: { updateUI } as never + }) + appMock.emit('before-quit', { defaultPrevented: true }) + expect(lifecycle.isWindowClosing()).toBe(false) + mainWindow.emit('resize') + await vi.advanceTimersByTimeAsync(500) + expect(updateUI).toHaveBeenCalledWith({ + windowMaximized: false, + windowBounds: { x: 0, y: 0, width: 1200, height: 800 } + }) + + updateUI.mockClear() + appMock.emit('before-quit', { defaultPrevented: false }) + expect(lifecycle.isWindowClosing()).toBe(true) + mainWindow.emit('resize') + await vi.advanceTimersByTimeAsync(500) + expect(updateUI).not.toHaveBeenCalled() + lifecycle.clearInitialRevealFallbackTimer() + lifecycle.dispose() +}) diff --git a/src/main/window/main-window-state-lifecycle.ts b/src/main/window/main-window/main-window-state-lifecycle.ts similarity index 96% rename from src/main/window/main-window-state-lifecycle.ts rename to src/main/window/main-window/main-window-state-lifecycle.ts index d772aa78b5b..7e6db78021d 100644 --- a/src/main/window/main-window-state-lifecycle.ts +++ b/src/main/window/main-window/main-window-state-lifecycle.ts @@ -1,11 +1,11 @@ import { app, type BrowserWindow, type Event } from 'electron' -import type { Store } from '../persistence/loading-store/store' -import { uiZoomFactorFromLevel } from '../../shared/ui-zoom-level' +import type { Store } from '../../persistence/loading-store/store' +import { uiZoomFactorFromLevel } from '../../../shared/ui-zoom-level' import { isBackgroundLaunch, isWindowlessLaunch, showWindowWithoutStealingFocus -} from './foreground-activation-policy' +} from '../activation/foreground-activation-policy' import { MIN_HEIGHT, MIN_WIDTH, syncTrafficLightPosition } from './main-window-visual-lifecycle' export type MainWindowStateLifecycle = { diff --git a/src/main/window/main-window-visual-lifecycle.ts b/src/main/window/main-window/main-window-visual-lifecycle.ts similarity index 97% rename from src/main/window/main-window-visual-lifecycle.ts rename to src/main/window/main-window/main-window-visual-lifecycle.ts index a79ebdda1ca..8b5ee92bb21 100644 --- a/src/main/window/main-window-visual-lifecycle.ts +++ b/src/main/window/main-window/main-window-visual-lifecycle.ts @@ -1,5 +1,5 @@ import { ipcMain, type BrowserWindow } from 'electron' -import { isMacosTahoeOrNewer } from './macos-tahoe-release' +import { isMacosTahoeOrNewer } from '../desktop-integration/macos-tahoe-release' const activeRepaintJiggles = new WeakSet() export function forceRepaint(window: BrowserWindow): void { diff --git a/src/main/window/user-quit-window-close.ts b/src/main/window/main-window/user-quit-window-close.ts similarity index 100% rename from src/main/window/user-quit-window-close.ts rename to src/main/window/main-window/user-quit-window-close.ts diff --git a/src/main/window/window-close-decision.ts b/src/main/window/main-window/window-close-decision.ts similarity index 100% rename from src/main/window/window-close-decision.ts rename to src/main/window/main-window/window-close-decision.ts diff --git a/src/main/window/window-bounds-validation.ts b/src/main/window/presentation/window-bounds-validation.ts similarity index 100% rename from src/main/window/window-bounds-validation.ts rename to src/main/window/presentation/window-bounds-validation.ts diff --git a/src/main/window/window-material-options.ts b/src/main/window/presentation/window-material-options.ts similarity index 95% rename from src/main/window/window-material-options.ts rename to src/main/window/presentation/window-material-options.ts index f5856b6c231..9bf2d84454c 100644 --- a/src/main/window/window-material-options.ts +++ b/src/main/window/presentation/window-material-options.ts @@ -1,5 +1,5 @@ import type { BrowserWindowConstructorOptions } from 'electron' -import type { WindowMaterial } from '../../shared/window-material' +import type { WindowMaterial } from '../../../shared/window-material' type WindowMaterialOptions = Pick< BrowserWindowConstructorOptions, diff --git a/src/main/window/window-material-suppression.ts b/src/main/window/presentation/window-material-suppression.ts similarity index 91% rename from src/main/window/window-material-suppression.ts rename to src/main/window/presentation/window-material-suppression.ts index 16b2f4ab821..f0a9cc5d397 100644 --- a/src/main/window/window-material-suppression.ts +++ b/src/main/window/presentation/window-material-suppression.ts @@ -1,5 +1,5 @@ import type { BrowserWindow } from 'electron' -import type { WindowMaterial } from '../../shared/window-material' +import type { WindowMaterial } from '../../../shared/window-material' import { MAC_BLUR_VIBRANCY } from './window-material-options' const createdMaterials = new WeakMap() diff --git a/src/main/window/privileged-window-navigation.test.ts b/src/main/window/privileged-window-navigation.test.ts deleted file mode 100644 index a1e706bb699..00000000000 --- a/src/main/window/privileged-window-navigation.test.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' - -const openExternal = vi.fn() -vi.mock('electron', () => ({ - shell: { openExternal: (url: string) => openExternal(url) } -})) - -import { installPrivilegedWindowNavigationPolicy } from './privileged-window-navigation' - -describe('privileged window navigation policy', () => { - function createFixture(currentUrl: string) { - const handlers = new Map void>() - const contents = { - getURL: () => currentUrl, - setWindowOpenHandler: vi.fn(), - on: vi.fn((event: string, handler: (...args: unknown[]) => void) => { - handlers.set(event, handler) - }) - } - installPrivilegedWindowNavigationPolicy(contents as never) - return { - willNavigate(url: string) { - const event = { preventDefault: vi.fn() } - const handler = handlers.get('will-navigate') - // Assert handler presence or missing navigation guards pass allow-cases vacuously. - if (!handler) { - throw new Error('no will-navigate handler was registered') - } - handler(event, url) - return event - } - } - } - - beforeEach(() => { - openExternal.mockClear() - }) - - it('lets the packaged renderer document reload itself', () => { - const appUrl = - 'file:///Applications/Orca.app/Contents/Resources/app.asar/out/renderer/index.html' - const event = createFixture(appUrl).willNavigate(appUrl) - - expect(event.preventDefault).not.toHaveBeenCalled() - expect(openExternal).not.toHaveBeenCalled() - }) - - it('still blocks and hands off an external http target', () => { - const appUrl = - 'file:///Applications/Orca.app/Contents/Resources/app.asar/out/renderer/index.html' - const event = createFixture(appUrl).willNavigate('https://example.com/') - - expect(event.preventDefault).toHaveBeenCalled() - expect(openExternal).toHaveBeenCalledWith('https://example.com/') - }) - - it('lets the dev renderer origin navigate but blocks foreign documents', () => { - const fixture = createFixture('http://localhost:5173/') - - expect( - fixture.willNavigate('http://localhost:5173/index.html').preventDefault - ).not.toHaveBeenCalled() - expect(fixture.willNavigate('https://example.com/').preventDefault).toHaveBeenCalled() - expect( - fixture.willNavigate('blob:http://localhost:5173/attacker-document').preventDefault - ).toHaveBeenCalled() - }) - - // The exact packaged file host/path defines privilege; foreign hosts and copied paths under other schemes must fail. - it('blocks a foreign file host and a data: URL that reuse the renderer path', () => { - const appUrl = - 'file:///Applications/Orca.app/Contents/Resources/app.asar/out/renderer/index.html' - const fixture = createFixture(appUrl) - - expect( - fixture.willNavigate( - 'file://evil.example/Applications/Orca.app/Contents/Resources/app.asar/out/renderer/index.html' - ).preventDefault - ).toHaveBeenCalled() - expect( - fixture.willNavigate('data:text/html,').preventDefault - ).toHaveBeenCalled() - expect(openExternal).not.toHaveBeenCalled() - }) - - it('still blocks navigation to an unrelated local file', () => { - const appUrl = - 'file:///Applications/Orca.app/Contents/Resources/app.asar/out/renderer/index.html' - const event = createFixture(appUrl).willNavigate('file:///Users/someone/.ssh/id_rsa') - - expect(event.preventDefault).toHaveBeenCalled() - expect(openExternal).not.toHaveBeenCalled() - }) -}) diff --git a/src/main/window/renderer-document-navigation.test.ts b/src/main/window/renderer-document-navigation.test.ts deleted file mode 100644 index 8c5a9d5eb2a..00000000000 --- a/src/main/window/renderer-document-navigation.test.ts +++ /dev/null @@ -1,131 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import { registerRendererDocumentNavigation } from './renderer-document-navigation' - -describe('renderer document navigation', () => { - function createFixture(currentUrl: string, onStarted = vi.fn(() => vi.fn())) { - const handlers = new Map void>() - let loadingMainFrame = false - const on = vi.fn((event: string, handler: (...args: unknown[]) => void) => { - handlers.set(event, handler) - }) - registerRendererDocumentNavigation( - { getURL: () => currentUrl, isLoadingMainFrame: () => loadingMainFrame, on } as never, - onStarted - ) - return { - navigate: handlers.get('did-start-navigation'), - failProvisionalLoad: handlers.get('did-fail-provisional-load'), - willNavigate: handlers.get('will-navigate'), - commitNavigation: handlers.get('did-frame-navigate'), - stopLoading: handlers.get('did-stop-loading'), - onStarted, - setLoadingMainFrame(value: boolean) { - loadingMainFrame = value - } - } - } - - it('shares one reload fence across concurrent provisional navigations', async () => { - const cancel = vi.fn() - const onStarted = vi.fn(() => cancel) - const fixture = createFixture('http://localhost:5173/', onStarted) - - fixture.navigate?.({}, 'http://localhost:5173/reload-a', false, true) - fixture.navigate?.({}, 'http://localhost:5173/reload-b', false, true) - - expect(onStarted).toHaveBeenCalledOnce() - fixture.setLoadingMainFrame(true) - fixture.failProvisionalLoad?.({}, -3, 'aborted', 'http://localhost:5173/reload-a', true, 1, 1) - await Promise.resolve() - expect(cancel).not.toHaveBeenCalled() - fixture.setLoadingMainFrame(false) - fixture.failProvisionalLoad?.({}, -3, 'aborted', 'http://localhost:5173/reload-b', true, 1, 1) - await Promise.resolve() - expect(cancel).toHaveBeenCalledOnce() - }) - - it('restores an idle surviving document after loading stops', async () => { - const cancel = vi.fn() - const fixture = createFixture( - 'http://localhost:5173/', - vi.fn(() => cancel) - ) - - fixture.navigate?.({}, 'http://localhost:5173/reload', false, true) - fixture.setLoadingMainFrame(true) - fixture.failProvisionalLoad?.({}, -3, 'aborted', 'http://localhost:5173/reload', true, 1, 1) - await Promise.resolve() - expect(cancel).not.toHaveBeenCalled() - - fixture.setLoadingMainFrame(false) - fixture.stopLoading?.() - expect(cancel).toHaveBeenCalledOnce() - }) - - it('restores after a concurrent failure and blocked replacement both settle', async () => { - const cancel = vi.fn() - const fixture = createFixture( - 'http://localhost:5173/', - vi.fn(() => cancel) - ) - const event = { defaultPrevented: false } - - fixture.navigate?.({}, 'http://localhost:5173/reload-a', false, true) - fixture.navigate?.({}, 'http://localhost:5173/reload-b', false, true) - fixture.setLoadingMainFrame(true) - fixture.failProvisionalLoad?.({}, -3, 'aborted', 'http://localhost:5173/reload-a', true) - await Promise.resolve() - expect(cancel).not.toHaveBeenCalled() - - fixture.willNavigate?.(event, 'http://localhost:5173/reload-b', false, true) - event.defaultPrevented = true - fixture.setLoadingMainFrame(false) - await Promise.resolve() - - expect(cancel).toHaveBeenCalledOnce() - }) - - it('does not let a stale same-URL failure cancel a replacement navigation', async () => { - const cancels: ReturnType[] = [] - const fixture = createFixture( - 'http://localhost:5173/', - vi.fn(() => { - const cancel = vi.fn() - cancels.push(cancel) - return cancel - }) - ) - const url = 'http://localhost:5173/reload' - - fixture.navigate?.({}, url, false, true) - fixture.commitNavigation?.({}, url, -1, '', true, 1, 1) - fixture.navigate?.({}, url, false, true) - fixture.setLoadingMainFrame(true) - fixture.failProvisionalLoad?.({}, -3, 'aborted', url, true, 1, 1) - await Promise.resolve() - - expect(cancels).toHaveLength(2) - expect(cancels[1]).not.toHaveBeenCalled() - - fixture.setLoadingMainFrame(false) - fixture.failProvisionalLoad?.({}, -3, 'aborted', url, true, 1, 1) - await Promise.resolve() - expect(cancels[1]).toHaveBeenCalledOnce() - }) - - it('cancels when a later will-navigate listener blocks the navigation', async () => { - const cancel = vi.fn() - const fixture = createFixture( - 'http://localhost:5173/', - vi.fn(() => cancel) - ) - const event = { defaultPrevented: false } - - fixture.navigate?.({}, 'http://localhost:5173/reload', false, true) - fixture.willNavigate?.(event, 'http://localhost:5173/reload', false, true, 1, 1) - event.defaultPrevented = true - await Promise.resolve() - - expect(cancel).toHaveBeenCalledOnce() - }) -}) diff --git a/src/main/window/renderer-recovery-reload-watchdog.test.ts b/src/main/window/renderer-recovery-reload-watchdog.test.ts deleted file mode 100644 index 9148ab5a326..00000000000 --- a/src/main/window/renderer-recovery-reload-watchdog.test.ts +++ /dev/null @@ -1,136 +0,0 @@ -import { EventEmitter } from 'node:events' -import type { BrowserWindow } from 'electron' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { MainWindowLoadObserver } from './main-window-contracts' -import { - createRendererRecoveryReloadWatchdog, - RENDERER_RECOVERY_LOAD_TIMEOUT_MS -} from './renderer-recovery-reload-watchdog' - -vi.mock('electron', () => ({ app: { isPackaged: true } })) - -function createHarness() { - const webContents = Object.assign(new EventEmitter(), { id: 143 }) - const mainWindow = { webContents, isDestroyed: () => false } as unknown as BrowserWindow - const loads: MainWindowLoadObserver[] = [] - const onRecoveryReloadOutcome = vi.fn() - const onRendererRecoveryExhausted = vi.fn() - const watchdog = createRendererRecoveryReloadWatchdog({ - mainWindow, - rendererWebContentsId: webContents.id, - isRecoveryPending: () => false, - isWindowClosing: () => false, - reloadMainWindow: (observer) => loads.push(observer), - opts: { onRecoveryReloadOutcome, onRendererRecoveryExhausted } - }) - const abortLatestLoad = () => loads.at(-1)?.onError?.(new Error('ERR_ABORTED (-3)')) - watchdog.issue({ reason: 'crashed', exitCode: 5 }, 1) - return { - watchdog, - webContents, - loads, - abortLatestLoad, - onRecoveryReloadOutcome, - onRendererRecoveryExhausted - } -} - -describe('superseding recovery navigations', () => { - beforeEach(() => vi.useFakeTimers()) - afterEach(() => vi.useRealTimers()) - - it('removes listeners and the pending stall timer during teardown', () => { - const { watchdog, webContents, loads, onRecoveryReloadOutcome } = createHarness() - expect(webContents.eventNames().sort()).toEqual(['did-fail-load', 'did-navigate', 'dom-ready']) - expect(vi.getTimerCount()).toBe(1) - watchdog.clear() - expect(webContents.eventNames()).toEqual([]) - expect(vi.getTimerCount()).toBe(0) - loads[0]?.onLoaded?.() - loads[0]?.onError?.(new Error('ERR_FILE_NOT_FOUND')) - watchdog.notifySystemResume() - expect(onRecoveryReloadOutcome).not.toHaveBeenCalled() - expect(vi.getTimerCount()).toBe(0) - }) - - it('does not mistake a replacement error page for recovery', () => { - const { - watchdog, - webContents, - abortLatestLoad, - onRecoveryReloadOutcome, - onRendererRecoveryExhausted - } = createHarness() - abortLatestLoad() - webContents.emit('did-navigate') - webContents.emit('did-fail-load', {}, -6, 'ERR_FILE_NOT_FOUND', 'file:///missing', true) - watchdog.notifyDocumentLoaded() - - expect(onRecoveryReloadOutcome).not.toHaveBeenCalledWith( - expect.objectContaining({ status: 'loaded' }) - ) - expect(onRendererRecoveryExhausted).toHaveBeenCalledOnce() - expect(onRecoveryReloadOutcome).toHaveBeenCalledWith( - expect.objectContaining({ status: 'failed', errorCode: 'ERR_FILE_NOT_FOUND' }) - ) - watchdog.clear() - }) - - it('ignores subframe failures and aborted replacement navigations', () => { - const { watchdog, webContents, abortLatestLoad, onRecoveryReloadOutcome } = createHarness() - abortLatestLoad() - webContents.emit('did-fail-load', {}, -6, 'ERR_FILE_NOT_FOUND', 'file:///missing', false) - webContents.emit('did-fail-load', {}, -3, 'ERR_ABORTED', 'file:///previous', true) - watchdog.notifyDocumentLoaded() - expect(onRecoveryReloadOutcome).toHaveBeenCalledWith( - expect.objectContaining({ status: 'loaded', superseded: true }) - ) - watchdog.clear() - }) - - it('keeps Reload available if the replacement fails beneath an existing prompt', () => { - const { - watchdog, - webContents, - loads, - abortLatestLoad, - onRecoveryReloadOutcome, - onRendererRecoveryExhausted - } = createHarness() - abortLatestLoad() - webContents.emit('did-navigate') - vi.advanceTimersByTime(RENDERER_RECOVERY_LOAD_TIMEOUT_MS * 2) - expect(onRendererRecoveryExhausted).toHaveBeenCalledOnce() - webContents.emit('did-fail-load', {}, -6, 'ERR_FILE_NOT_FOUND', 'file:///missing', true) - watchdog.notifyDocumentLoaded() - expect(onRecoveryReloadOutcome).not.toHaveBeenCalledWith( - expect.objectContaining({ status: 'loaded' }) - ) - onRendererRecoveryExhausted.mock.calls[0]?.[0].retry() - expect(loads).toHaveLength(2) - expect(onRendererRecoveryExhausted).toHaveBeenCalledOnce() - watchdog.clear() - }) - - it('recognizes a successful replacement started after the stall prompt', () => { - const { - watchdog, - loads, - abortLatestLoad, - onRecoveryReloadOutcome, - onRendererRecoveryExhausted - } = createHarness() - vi.advanceTimersByTime(RENDERER_RECOVERY_LOAD_TIMEOUT_MS * 2) - expect(onRendererRecoveryExhausted).toHaveBeenCalledOnce() - abortLatestLoad() - watchdog.notifyDocumentLoaded() - expect(onRecoveryReloadOutcome).toHaveBeenCalledWith( - expect.objectContaining({ status: 'loaded', superseded: true, afterPrompt: true }) - ) - onRendererRecoveryExhausted.mock.calls[0]?.[0].retry() - expect(loads).toHaveLength(2) - vi.advanceTimersByTime(RENDERER_RECOVERY_LOAD_TIMEOUT_MS * 2) - expect(onRendererRecoveryExhausted).toHaveBeenCalledOnce() - watchdog.clear() - }) -}) diff --git a/src/main/window/main-window-load-error-code.ts b/src/main/window/renderer-recovery/main-window-load-error-code.ts similarity index 100% rename from src/main/window/main-window-load-error-code.ts rename to src/main/window/renderer-recovery/main-window-load-error-code.ts diff --git a/src/main/window/renderer-launch-failure-backoff.ts b/src/main/window/renderer-recovery/renderer-launch-failure-backoff.ts similarity index 100% rename from src/main/window/renderer-launch-failure-backoff.ts rename to src/main/window/renderer-recovery/renderer-launch-failure-backoff.ts diff --git a/src/main/window/renderer-launch-failure-probe.test.ts b/src/main/window/renderer-recovery/renderer-launch-failure-probe.test.ts similarity index 56% rename from src/main/window/renderer-launch-failure-probe.test.ts rename to src/main/window/renderer-recovery/renderer-launch-failure-probe.test.ts index f762eac4d86..18253cdfd15 100644 --- a/src/main/window/renderer-launch-failure-probe.test.ts +++ b/src/main/window/renderer-recovery/renderer-launch-failure-probe.test.ts @@ -5,11 +5,19 @@ const { runProcessMock, recordDurableCrashBreadcrumbMock } = vi.hoisted(() => ({ recordDurableCrashBreadcrumbMock: vi.fn() })) vi.mock('@orca/process-host', () => ({ runProcess: runProcessMock })) -vi.mock('../crash-reporting/breadcrumbs/durable-crash-breadcrumb', () => ({ +vi.mock('../../crash-reporting/breadcrumbs/durable-crash-breadcrumb', () => ({ recordDurableCrashBreadcrumb: recordDurableCrashBreadcrumbMock })) -import { withPlatform } from './createMainWindow-test-harness' +function withPlatform(platform: NodeJS.Platform, run: () => T): T { + const original = process.platform + Object.defineProperty(process, 'platform', { configurable: true, value: platform }) + try { + return run() + } finally { + Object.defineProperty(process, 'platform', { configurable: true, value: original }) + } +} import { probeRendererLaunchCapacity, @@ -50,17 +58,6 @@ describe('probeRendererLaunchCapacity', () => { expect(runProcessMock).not.toHaveBeenCalled() }) - it('records a skipped Windows probe without spawning a child', async () => { - await expect( - withPlatform('win32', () => recordRendererLaunchFailureProbe({ exitCode: 18 }, 100_000)) - ).resolves.toBe('skipped') - expect(runProcessMock).not.toHaveBeenCalled() - expect(recordDurableCrashBreadcrumbMock).toHaveBeenCalledWith('renderer_launch_failed_probe', { - spawnError: 'skipped', - exitCode: 18 - }) - }) - it('never rejects when the breadcrumb write throws', async () => { runProcessMock.mockRejectedValue(spawnError('EAGAIN')) recordDurableCrashBreadcrumbMock.mockImplementation(() => { @@ -68,26 +65,4 @@ describe('probeRendererLaunchCapacity', () => { }) await expect(recordPosixFailure(90_000)).resolves.toBe('EAGAIN') }) - - it('records the refused spawn as a durable breadcrumb', async () => { - runProcessMock.mockRejectedValue(spawnError('EAGAIN')) - await expect(recordPosixFailure(10_000)).resolves.toBe('EAGAIN') - expect(recordDurableCrashBreadcrumbMock).toHaveBeenCalledWith('renderer_launch_failed_probe', { - spawnError: 'EAGAIN', - exitCode: 1003 - }) - }) - - it('probes once for the duplicate render-process-gone of one failed launch', async () => { - runProcessMock.mockRejectedValue(spawnError('EAGAIN')) - await recordPosixFailure(50_000) - await recordPosixFailure(50_010) - expect(runProcessMock).toHaveBeenCalledOnce() - expect(recordDurableCrashBreadcrumbMock).toHaveBeenCalledOnce() - - // The next backoff retry fails again: a fresh probe and breadcrumb. - await recordPosixFailure(50_250) - expect(runProcessMock).toHaveBeenCalledTimes(2) - expect(recordDurableCrashBreadcrumbMock).toHaveBeenCalledTimes(2) - }) }) diff --git a/src/main/window/renderer-launch-failure-probe.ts b/src/main/window/renderer-recovery/renderer-launch-failure-probe.ts similarity index 92% rename from src/main/window/renderer-launch-failure-probe.ts rename to src/main/window/renderer-recovery/renderer-launch-failure-probe.ts index 9127b53da17..43ae8dec045 100644 --- a/src/main/window/renderer-launch-failure-probe.ts +++ b/src/main/window/renderer-recovery/renderer-launch-failure-probe.ts @@ -1,6 +1,6 @@ import { runProcess } from '@orca/process-host' -import { recordDurableCrashBreadcrumb } from '../crash-reporting/breadcrumbs/durable-crash-breadcrumb' -import { errnoCodeOrUnknown } from '../../shared/errno-code' +import { recordDurableCrashBreadcrumb } from '../../crash-reporting/breadcrumbs/durable-crash-breadcrumb' +import { errnoCodeOrUnknown } from '../../../shared/errno-code' /** 'ok' when a throwaway child could start, the spawn errno (EAGAIN = per-user process limit), or 'skipped' on Windows. */ export type RendererLaunchProbeResult = string diff --git a/src/main/window/renderer-liveness-at-death.test.ts b/src/main/window/renderer-recovery/renderer-liveness-at-death.test.ts similarity index 87% rename from src/main/window/renderer-liveness-at-death.test.ts rename to src/main/window/renderer-recovery/renderer-liveness-at-death.test.ts index 58d2ed252a2..90d4d0b74b0 100644 --- a/src/main/window/renderer-liveness-at-death.test.ts +++ b/src/main/window/renderer-recovery/renderer-liveness-at-death.test.ts @@ -2,7 +2,7 @@ import { EventEmitter } from 'node:events' import { beforeEach, describe, expect, it, vi } from 'vitest' const recordCoalescedDurableCrashBreadcrumb = vi.fn() -vi.mock('../crash-reporting/breadcrumbs/durable-crash-breadcrumb', () => ({ +vi.mock('../../crash-reporting/breadcrumbs/durable-crash-breadcrumb', () => ({ recordCoalescedDurableCrashBreadcrumb: (...args: unknown[]) => recordCoalescedDurableCrashBreadcrumb(...args) })) @@ -97,18 +97,4 @@ describe('trackRendererLivenessAtDeath', () => { expect(state).toMatchObject({ rendererDocumentLoaded: true, rendererDocumentAgeMs: 5_000 }) expect(state.rendererDocumentLoadFailed).toBeUndefined() }) - - it('does not log the replacement renderer as the dead one recovering', () => { - const { window, contents } = createWindow() - const tracker = trackRendererLivenessAtDeath(window, () => now) - contents.emit('did-finish-load') - window.emit('unresponsive') - now += 20_000 - expect(tracker.takeAtRendererGone().rendererUnresponsiveForMs).toBe(20_000) - recordCoalescedDurableCrashBreadcrumb.mockClear() - - window.emit('responsive') - - expect(recordCoalescedDurableCrashBreadcrumb).not.toHaveBeenCalled() - }) }) diff --git a/src/main/window/renderer-liveness-at-death.ts b/src/main/window/renderer-recovery/renderer-liveness-at-death.ts similarity index 96% rename from src/main/window/renderer-liveness-at-death.ts rename to src/main/window/renderer-recovery/renderer-liveness-at-death.ts index b4cc6336711..2c30f95a463 100644 --- a/src/main/window/renderer-liveness-at-death.ts +++ b/src/main/window/renderer-recovery/renderer-liveness-at-death.ts @@ -1,5 +1,5 @@ import type { BrowserWindow } from 'electron' -import { recordCoalescedDurableCrashBreadcrumb } from '../crash-reporting/breadcrumbs/durable-crash-breadcrumb' +import { recordCoalescedDurableCrashBreadcrumb } from '../../crash-reporting/breadcrumbs/durable-crash-breadcrumb' /** Windows killed/exit1 cannot identify Task Manager, EDR or Orca as the cause. Retain prior hang/load state to distinguish users terminating a frozen app from unexplained external kills. */ export type RendererLivenessAtDeath = { @@ -45,7 +45,7 @@ export function trackRendererLivenessAtDeath( const onUnresponsive = (): void => { if (unresponsiveSince === null) { const epoch = ++captureEpoch - void import('../hang-watchdog/renderer-hang-capture') + void import('../../hang-watchdog/renderer-hang-capture') .then((collector) => { if (epoch === captureEpoch && unresponsiveSince !== null && !window.isDestroyed()) { capture = collector.startRendererHangCapture(window) diff --git a/src/main/window/renderer-recovery-prompt.ts b/src/main/window/renderer-recovery/renderer-recovery-prompt.ts similarity index 97% rename from src/main/window/renderer-recovery-prompt.ts rename to src/main/window/renderer-recovery/renderer-recovery-prompt.ts index a55ad7789ec..17e12b73280 100644 --- a/src/main/window/renderer-recovery-prompt.ts +++ b/src/main/window/renderer-recovery/renderer-recovery-prompt.ts @@ -1,6 +1,6 @@ import type { MessageBoxOptions, MessageBoxReturnValue } from 'electron' -import { translateMain } from '../i18n/main-i18n' -import type { InstallDirAclPoisonDiagnosis } from '../startup/windows-install-dir-acl-recovery' +import { translateMain } from '../../i18n/main-i18n' +import type { InstallDirAclPoisonDiagnosis } from '../../startup/windows-install-permissions/windows-install-dir-acl-recovery' import type { RecoveryExhaustionCause } from './renderer-recovery-reload-watchdog' import type { RendererLaunchProbeResult } from './renderer-launch-failure-probe' diff --git a/src/main/window/renderer-recovery-reload-watchdog.ts b/src/main/window/renderer-recovery/renderer-recovery-reload-watchdog.ts similarity index 97% rename from src/main/window/renderer-recovery-reload-watchdog.ts rename to src/main/window/renderer-recovery/renderer-recovery-reload-watchdog.ts index e86d18fae6d..872dd815fc2 100644 --- a/src/main/window/renderer-recovery-reload-watchdog.ts +++ b/src/main/window/renderer-recovery/renderer-recovery-reload-watchdog.ts @@ -1,8 +1,11 @@ import { app, type BrowserWindow } from 'electron' -import { isSystemSessionEnding } from '../crash-reporting/process-exits/expected-teardown-state' -import type { LowCommitOomVerdict } from '../crash-reporting/recovery/low-commit-oom-recovery-gate' -import type { CreateMainWindowOptions, MainWindowLoadObserver } from './main-window-contracts' +import { isSystemSessionEnding } from '../../crash-reporting/process-exits/expected-teardown-state' +import type { LowCommitOomVerdict } from '../../crash-reporting/recovery/low-commit-oom-recovery-gate' +import type { + CreateMainWindowOptions, + MainWindowLoadObserver +} from '../main-window/main-window-contracts' import { mainWindowLoadErrorCode } from './main-window-load-error-code' // Field recoveries took up to 30.4s; allow 45s before retrying a load with no document. diff --git a/src/main/window/agent-launch-tab-publish-relay.ts b/src/main/window/renderer-relays/agent-launch-tab-publish-relay.ts similarity index 96% rename from src/main/window/agent-launch-tab-publish-relay.ts rename to src/main/window/renderer-relays/agent-launch-tab-publish-relay.ts index 753b712c273..547e02b7d80 100644 --- a/src/main/window/agent-launch-tab-publish-relay.ts +++ b/src/main/window/renderer-relays/agent-launch-tab-publish-relay.ts @@ -6,7 +6,7 @@ import type { AgentLaunchTabPublished, AgentLaunchTabPublishReply, AgentLaunchTabPublishRequest -} from '../../shared/agent-launch/contracts/agent-launch-tab-publication' +} from '../../../shared/agent-launch/contracts/agent-launch-tab-publication' const AGENT_LAUNCH_TAB_PUBLISH_TIMEOUT_MS = 10_000 diff --git a/src/main/window/agent-pane-activity-relay.ts b/src/main/window/renderer-relays/agent-pane-activity-relay.ts similarity index 93% rename from src/main/window/agent-pane-activity-relay.ts rename to src/main/window/renderer-relays/agent-pane-activity-relay.ts index a8c33e8231d..92c445e1d87 100644 --- a/src/main/window/agent-pane-activity-relay.ts +++ b/src/main/window/renderer-relays/agent-pane-activity-relay.ts @@ -4,7 +4,7 @@ import type { AgentListPublication, AgentPaneActivityChange, AgentPaneActivityReply -} from '../../shared/agent-status/presentation/agent-list-status' +} from '../../../shared/agent-status/presentation/agent-list-status' import { requestRendererReply } from './renderer-reply-request' // Under the client's call timeout, so the client hears a refusal rather than losing the reply. diff --git a/src/main/window/project-move-pause.test.ts b/src/main/window/renderer-relays/project-move-pause.test.ts similarity index 58% rename from src/main/window/project-move-pause.test.ts rename to src/main/window/renderer-relays/project-move-pause.test.ts index 6f4ab7941f7..0c6407f792d 100644 --- a/src/main/window/project-move-pause.test.ts +++ b/src/main/window/renderer-relays/project-move-pause.test.ts @@ -1,8 +1,8 @@ import { EventEmitter } from 'node:events' import { ipcMain as ipc, type BrowserWindow } from 'electron' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { ProjectMovePauseRequest } from '../../shared/project-move-pause' -import type { WorkspaceSleepOutcome, WorkspaceSleepTarget } from '../../shared/workspace-sleep' +import type { ProjectMovePauseRequest } from '../../../shared/project-move-pause' +import type { WorkspaceSleepOutcome, WorkspaceSleepTarget } from '../../../shared/workspace-sleep' type PauseResponseFixture = { requestId?: string; protocol?: number } & ( | { phase: 'prepare'; targets: WorkspaceSleepTarget[] } @@ -64,31 +64,6 @@ describe('main-owned project move pause', () => { vi.useRealTimers() }) - it('waits for an explicit renderer persistence receipt and preserves all stop receipts', async () => { - const f = fixture() - const paused = pauseWorkspacesForProjectMove(f.mainWindow, f, ['wt', 'wt']) - f.prepare() - await vi.advanceTimersByTimeAsync(0) - expect(f.sleepWorkspaces).toHaveBeenCalledWith({ - targets: [ - { worktreeId: 'wt', terminalHost: { kind: 'self' }, chatHosts: [{ kind: 'self' }] } - ], - markChatsAsleep: false, - projectMovePauseId: expect.any(String) - }) - let returned = false - void paused.then(() => { - returned = true - }) - expect(f.request().phase).toBe('persist') - expect(returned).toBe(false) - f.respond({ phase: 'persist' }) - await expect(paused).resolves.toEqual(f.outcomes) - expect(f.request().phase).toBe('release') - expect(ipc.listenerCount('ui:projectMovePauseResponse')).toBe(0) - expect(f.webContents.eventNames()).toEqual([]) - }) - it('shares one lifecycle listener across overlapping pauses and releases it after', async () => { const f = fixture() const paused = Array.from({ length: 12 }, () => @@ -118,20 +93,6 @@ describe('main-owned project move pause', () => { expect(ipc.listenerCount('ui:projectMovePauseResponse')).toBe(0) }) - it('ignores another window, stale request and unsupported protocol', async () => { - const f = fixture() - const paused = pauseWorkspacesForProjectMove(f.mainWindow, f, ['wt']) - f.respond({ phase: 'prepare', targets: [] }, {}) - f.respond({ phase: 'prepare', targets: [], requestId: 'stale' }) - f.respond({ phase: 'prepare', targets: [], protocol: 0 }) - await vi.advanceTimersByTimeAsync(0) - expect(f.sleepWorkspaces).not.toHaveBeenCalled() - f.prepare() - await vi.advanceTimersByTimeAsync(0) - f.respond({ phase: 'persist' }) - await paused - }) - it('rejects reload during the host stop instead of accepting a new renderer persistence reply', async () => { const f = fixture() const stop = Promise.withResolvers() @@ -144,37 +105,4 @@ describe('main-owned project move pause', () => { await expect(paused).rejects.toThrow('renderer_unavailable') expect(f.webContents.send.mock.calls.map(([, value]) => value.phase)).toEqual(['prepare']) }) - - it('propagates failed durability without returning success to the exporter', async () => { - const f = fixture() - const paused = pauseWorkspacesForProjectMove(f.mainWindow, f, ['wt']) - f.prepare() - await vi.advanceTimersByTimeAsync(0) - f.respond({ phase: 'error', error: 'disk full' }) - await expect(paused).rejects.toMatchObject({ message: 'disk full', outcomes: f.outcomes }) - expect(f.request().phase).toBe('release') - }) - - it('retains partial stop failures and successful sibling receipts when renderer rollback fails', async () => { - const f = fixture() - f.outcomes[0].failure = 'terminal_liveness_unavailable' - f.outcomes.push({ - worktreeId: 'sibling', - chatFailed: false, - receipts: [{ executionHostId: 'runtime:env', stoppedSessionIds: ['remote-chat'] }] - }) - const paused = pauseWorkspacesForProjectMove(f.mainWindow, f, ['wt', 'sibling']) - f.respond({ - phase: 'prepare', - targets: ['wt', 'sibling'].map((worktreeId) => ({ - worktreeId, - terminalHost: { kind: 'self' }, - chatHosts: [{ kind: 'self' }] - })) - }) - await vi.advanceTimersByTimeAsync(0) - f.respond({ phase: 'error', error: 'host_terminal_stop_failed' }) - await expect(paused).rejects.toMatchObject({ outcomes: f.outcomes }) - expect(f.outcomes[1]?.receipts[0]?.stoppedSessionIds).toEqual(['remote-chat']) - }) }) diff --git a/src/main/window/project-move-pause.ts b/src/main/window/renderer-relays/project-move-pause.ts similarity index 96% rename from src/main/window/project-move-pause.ts rename to src/main/window/renderer-relays/project-move-pause.ts index 76121bdcf7d..81c3551bc2c 100644 --- a/src/main/window/project-move-pause.ts +++ b/src/main/window/renderer-relays/project-move-pause.ts @@ -5,9 +5,9 @@ import { projectMovePauseResponseSchema, type ProjectMovePauseRequest, type ProjectMovePauseResponse -} from '../../shared/project-move-pause' -import type { WorkspaceSleepOutcome, WorkspaceSleepRequest } from '../../shared/workspace-sleep' -import { addFanoutListener, addFanoutListeners } from '../runtime/events/event-listener-fanout' +} from '../../../shared/project-move-pause' +import type { WorkspaceSleepOutcome, WorkspaceSleepRequest } from '../../../shared/workspace-sleep' +import { addFanoutListener, addFanoutListeners } from '../../runtime/events/event-listener-fanout' type SleepRuntime = { sleepWorkspaces: (request: WorkspaceSleepRequest) => Promise diff --git a/src/main/window/renderer-reply-request.ts b/src/main/window/renderer-relays/renderer-reply-request.ts similarity index 93% rename from src/main/window/renderer-reply-request.ts rename to src/main/window/renderer-relays/renderer-reply-request.ts index 80582d8b885..ec2ae0b57f9 100644 --- a/src/main/window/renderer-reply-request.ts +++ b/src/main/window/renderer-relays/renderer-reply-request.ts @@ -2,8 +2,8 @@ import { randomUUID } from 'node:crypto' import { ipcMain, type BrowserWindow } from 'electron' -import { addFanoutListener } from '../runtime/events/event-listener-fanout' -import { abortWhenRendererGone } from '../ipc/renderer-lifetime-abort' +import { addFanoutListener } from '../../runtime/events/event-listener-fanout' +import { abortWhenRendererGone } from '../../ipc/renderer-lifetime-abort' /** Sends one request to the window and resolves with the reply its own renderer sends; rejects when it goes away or times out. */ export function requestRendererReply( diff --git a/src/main/window/runtime-renderer-notification-sender.test.ts b/src/main/window/renderer-relays/runtime-renderer-notification-sender.test.ts similarity index 83% rename from src/main/window/runtime-renderer-notification-sender.test.ts rename to src/main/window/renderer-relays/runtime-renderer-notification-sender.test.ts index d482bb404fb..5ae840abb4d 100644 --- a/src/main/window/runtime-renderer-notification-sender.test.ts +++ b/src/main/window/renderer-relays/runtime-renderer-notification-sender.test.ts @@ -76,22 +76,6 @@ describe('runtime renderer notification sender', () => { expect(missingWebContents.onFailure).not.toHaveBeenCalled() }) - it('reports renderer process loss once per load generation', () => { - const fixture = createSender() - - fixture.sender.onRendererProcessGone() - fixture.sender.onRendererProcessGone() - fixture.sender.onMainFrameReloadStarted() - fixture.sender.onMainFrameLoadFinished() - fixture.sender.onRendererProcessGone() - fixture.sender.onRendererProcessGone() - - expect(fixture.warn).toHaveBeenCalledTimes(2) - expect(fixture.onFailure).toHaveBeenCalledTimes(2) - expect(fixture.onFailure).toHaveBeenNthCalledWith(1, 'renderer-process-gone') - expect(fixture.onFailure).toHaveBeenNthCalledWith(2, 'renderer-process-gone') - }) - it('keeps close terminal when renderer lifecycle events arrive late', () => { const fixture = createSender() diff --git a/src/main/window/runtime-renderer-notification-sender.ts b/src/main/window/renderer-relays/runtime-renderer-notification-sender.ts similarity index 100% rename from src/main/window/runtime-renderer-notification-sender.ts rename to src/main/window/renderer-relays/runtime-renderer-notification-sender.ts diff --git a/src/main/window/session-tab-close-request-relay.test.ts b/src/main/window/renderer-relays/session-tab-close-request-relay.test.ts similarity index 58% rename from src/main/window/session-tab-close-request-relay.test.ts rename to src/main/window/renderer-relays/session-tab-close-request-relay.test.ts index 11b7a921d01..62c6a9e939a 100644 --- a/src/main/window/session-tab-close-request-relay.test.ts +++ b/src/main/window/renderer-relays/session-tab-close-request-relay.test.ts @@ -106,64 +106,4 @@ describe('requestSessionTabCloseFromRenderer', () => { await rejection expect(ipcEmitter.listenerCount('ui:sessionTabCloseResponse')).toBe(0) }) - - it('shares one lifecycle listener across overlapping close requests', async () => { - const { requestSessionTabCloseFromRenderer } = await import('./session-tab-close-request-relay') - const { mainWindow, webContents } = createMainWindow() - const pending = Array.from({ length: 15 }, (_, index) => - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the EventEmitter double implements the BrowserWindow members the relay uses. - requestSessionTabCloseFromRenderer(mainWindow as never, `tab-${index}`, 'wt-1') - ) - - expect(ipcEmitter.listenerCount('ui:sessionTabCloseResponse')).toBe(1) - expect(mainWindow.listenerCount('closed')).toBe(1) - for (const event of ['destroyed', 'render-process-gone', 'did-start-loading']) { - expect(webContents.listenerCount(event)).toBe(1) - } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the relay sends only session tab close requests on this double. - const requests = webContents.send.mock.calls as [string, { requestId: string }][] - for (const [, request] of requests) { - ipcEmitter.emit( - 'ui:sessionTabCloseResponse', - { sender: webContents }, - { requestId: request.requestId } - ) - } - - await Promise.all(pending) - expect(mainWindow.eventNames()).toEqual([]) - expect(webContents.eventNames()).toEqual([]) - expect(ipcEmitter.listenerCount('ui:sessionTabCloseResponse')).toBe(0) - }) - - it.each([ - ['window', 'closed'], - ['webContents', 'destroyed'], - ['webContents', 'did-start-loading'] - ] as const)( - 'rejects both overlapping requests on one %s %s and returns to baseline listeners', - async (target, eventName) => { - const { requestSessionTabCloseFromRenderer } = - await import('./session-tab-close-request-relay') - const { mainWindow, webContents } = createMainWindow() - const baseline = { - window: mainWindow.eventNames(), - webContents: webContents.eventNames(), - ipc: ipcEmitter.listenerCount('ui:sessionTabCloseResponse') - } - const pending = ['tab-1', 'tab-2'].map((tabId) => - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the EventEmitter double implements the BrowserWindow members the relay uses. - requestSessionTabCloseFromRenderer(mainWindow as never, tabId, 'wt-1') - ) - - ;(target === 'window' ? mainWindow : webContents).emit(eventName) - - await Promise.all( - pending.map((request) => expect(request).rejects.toThrow('renderer_unavailable')) - ) - expect(mainWindow.eventNames()).toEqual(baseline.window) - expect(webContents.eventNames()).toEqual(baseline.webContents) - expect(ipcEmitter.listenerCount('ui:sessionTabCloseResponse')).toBe(baseline.ipc) - } - ) }) diff --git a/src/main/window/session-tab-close-request-relay.ts b/src/main/window/renderer-relays/session-tab-close-request-relay.ts similarity index 90% rename from src/main/window/session-tab-close-request-relay.ts rename to src/main/window/renderer-relays/session-tab-close-request-relay.ts index e9564342bdc..7ee2fe87939 100644 --- a/src/main/window/session-tab-close-request-relay.ts +++ b/src/main/window/renderer-relays/session-tab-close-request-relay.ts @@ -5,9 +5,9 @@ import type { BrowserWindow } from 'electron' import type { SessionTabCloseRequest, SessionTabCloseResponse -} from '../../shared/session-tab-close' -import { SESSION_TAB_CLOSE_TIMEOUT_ERROR } from '../../shared/session-tab-close' -import { addFanoutListener, addFanoutListeners } from '../runtime/events/event-listener-fanout' +} from '../../../shared/session-tab-close' +import { SESSION_TAB_CLOSE_TIMEOUT_ERROR } from '../../../shared/session-tab-close' +import { addFanoutListener, addFanoutListeners } from '../../runtime/events/event-listener-fanout' const SESSION_TAB_CLOSE_CONFIRMATION_MS = 5 * 60_000 const SESSION_TAB_CLOSE_RESPONSE_GRACE_MS = 5_000 diff --git a/src/main/window/terminal-pane-move-commit-fence.ts b/src/main/window/renderer-relays/terminal-pane-move-commit-fence.ts similarity index 94% rename from src/main/window/terminal-pane-move-commit-fence.ts rename to src/main/window/renderer-relays/terminal-pane-move-commit-fence.ts index ced98706ad8..ed1d9990595 100644 --- a/src/main/window/terminal-pane-move-commit-fence.ts +++ b/src/main/window/renderer-relays/terminal-pane-move-commit-fence.ts @@ -1,4 +1,4 @@ -import type { TerminalLeafMoveResult } from '../../shared/workspace-layout/terminal-topology/terminal-leaf-move' +import type { TerminalLeafMoveResult } from '../../../shared/workspace-layout/terminal-topology/terminal-leaf-move' // Why its own module: the plain-Node runtime commits leaf moves too, so this must stay Electron-free. diff --git a/src/main/window/terminal-pane-move-request-relay.test.ts b/src/main/window/renderer-relays/terminal-pane-move-request-relay.test.ts similarity index 95% rename from src/main/window/terminal-pane-move-request-relay.test.ts rename to src/main/window/renderer-relays/terminal-pane-move-request-relay.test.ts index fdbe0c5fb6c..f8c6ef346ca 100644 --- a/src/main/window/terminal-pane-move-request-relay.test.ts +++ b/src/main/window/renderer-relays/terminal-pane-move-request-relay.test.ts @@ -1,6 +1,6 @@ import { EventEmitter } from 'node:events' import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { TerminalLeafMoveResult } from '../../shared/workspace-layout/terminal-topology/terminal-leaf-move' +import type { TerminalLeafMoveResult } from '../../../shared/workspace-layout/terminal-topology/terminal-leaf-move' const ipcEmitter = new EventEmitter() const ipcMainMock = { diff --git a/src/main/window/terminal-pane-move-request-relay.ts b/src/main/window/renderer-relays/terminal-pane-move-request-relay.ts similarity index 94% rename from src/main/window/terminal-pane-move-request-relay.ts rename to src/main/window/renderer-relays/terminal-pane-move-request-relay.ts index f7242f2832c..869c08fea56 100644 --- a/src/main/window/terminal-pane-move-request-relay.ts +++ b/src/main/window/renderer-relays/terminal-pane-move-request-relay.ts @@ -6,9 +6,9 @@ import type { TerminalLeafMoveResult, TerminalPaneMoveToNewTabReply, TerminalPaneMoveToNewTabRequest -} from '../../shared/workspace-layout/terminal-topology/terminal-leaf-move' -import { addFanoutListener } from '../runtime/events/event-listener-fanout' -import { abortWhenRendererGone } from '../ipc/renderer-lifetime-abort' +} from '../../../shared/workspace-layout/terminal-topology/terminal-leaf-move' +import { addFanoutListener } from '../../runtime/events/event-listener-fanout' +import { abortWhenRendererGone } from '../../ipc/renderer-lifetime-abort' import { holdRelayedPaneMove, type RelayedPaneMove } from './terminal-pane-move-commit-fence' // Why: under the client's 15s call timeout, so the client hears a refusal rather than losing the reply. diff --git a/src/main/window/terminal-pane-reveal-relay.ts b/src/main/window/renderer-relays/terminal-pane-reveal-relay.ts similarity index 87% rename from src/main/window/terminal-pane-reveal-relay.ts rename to src/main/window/renderer-relays/terminal-pane-reveal-relay.ts index 3c652fc04f6..4185c7dbda4 100644 --- a/src/main/window/terminal-pane-reveal-relay.ts +++ b/src/main/window/renderer-relays/terminal-pane-reveal-relay.ts @@ -3,8 +3,8 @@ import { app, type BrowserWindow } from 'electron' import type { TerminalPaneRevealReply, TerminalPaneRevealTarget -} from '../../shared/workspace-layout/terminal-surfaces/terminal-pane-reveal' -import { focusExistingMainWindow } from './focus-existing-window' +} from '../../../shared/workspace-layout/terminal-surfaces/terminal-pane-reveal' +import { focusExistingMainWindow } from '../activation/focus-existing-window' import { requestRendererReply } from './renderer-reply-request' const TERMINAL_PANE_REVEAL_TIMEOUT_MS = 10_000 diff --git a/src/main/window/terminal-tab-close-request-relay.test.ts b/src/main/window/renderer-relays/terminal-tab-close-request-relay.test.ts similarity index 100% rename from src/main/window/terminal-tab-close-request-relay.test.ts rename to src/main/window/renderer-relays/terminal-tab-close-request-relay.test.ts diff --git a/src/main/window/terminal-tab-close-request-relay.ts b/src/main/window/renderer-relays/terminal-tab-close-request-relay.ts similarity index 93% rename from src/main/window/terminal-tab-close-request-relay.ts rename to src/main/window/renderer-relays/terminal-tab-close-request-relay.ts index 5afd1db16c5..8af32bac09e 100644 --- a/src/main/window/terminal-tab-close-request-relay.ts +++ b/src/main/window/renderer-relays/terminal-tab-close-request-relay.ts @@ -5,8 +5,8 @@ import { ipcMain, type BrowserWindow } from 'electron' import type { TerminalTabCloseRequest, TerminalTabCloseResponse -} from '../../shared/workspace-layout/terminal-surfaces/terminal-tab-close' -import { addFanoutListener, addFanoutListeners } from '../runtime/events/event-listener-fanout' +} from '../../../shared/workspace-layout/terminal-surfaces/terminal-tab-close' +import { addFanoutListener, addFanoutListeners } from '../../runtime/events/event-listener-fanout' const TERMINAL_TAB_CLOSE_TIMEOUT_MS = 20_000 diff --git a/src/main/window/runtime-window-lifecycle-terminal-reveal.test.ts b/src/main/window/runtime-window-lifecycle-terminal-reveal.test.ts index 1675208addd..c3ace70cae0 100644 --- a/src/main/window/runtime-window-lifecycle-terminal-reveal.test.ts +++ b/src/main/window/runtime-window-lifecycle-terminal-reveal.test.ts @@ -11,7 +11,9 @@ vi.mock('electron', () => ({ ipcMain })) vi.mock('../ipc/worktrees/listing/worktree-change-invalidators', () => ({ runWorktreeChangeInvalidators: vi.fn() })) -vi.mock('./renderer-document-navigation', () => ({ registerRendererDocumentNavigation: vi.fn() })) +vi.mock('./security/renderer-document-navigation', () => ({ + registerRendererDocumentNavigation: vi.fn() +})) import { registerRuntimeWindowLifecycle } from './runtime-window-lifecycle' @@ -39,6 +41,7 @@ function attachWindow(id: number): { } const runtime = { attachWindow: vi.fn(), + onClientEvent: vi.fn(() => () => {}), markGraphReloadFailed: vi.fn(), setNotifier: (next: RuntimeNotifier | null) => { attached.notifier = next diff --git a/src/main/window/runtime-window-lifecycle.ts b/src/main/window/runtime-window-lifecycle.ts index da078c6d3b4..c82c7d14eec 100644 --- a/src/main/window/runtime-window-lifecycle.ts +++ b/src/main/window/runtime-window-lifecycle.ts @@ -4,18 +4,18 @@ import { ipcMain, type BrowserWindow } from 'electron' import type { CreateWorktreeResult } from '../../shared/worktree/create-types' import type { WorktreeStartupLaunch } from '../../shared/worktree/launch-types' -import type { RuntimeMobileSessionTabMove } from '../../shared/runtime-types' +import type { RuntimeMobileSessionTabMove } from '../../shared/runtime-session-contracts' import type { TerminalTabCreateReply } from '../../shared/workspace-layout/terminal-surfaces/terminal-reveal-identity' import { runWorktreeChangeInvalidators } from '../ipc/worktrees/listing/worktree-change-invalidators' -import { requestAgentLaunchTabPublishFromRenderer } from './agent-launch-tab-publish-relay' -import { requestAgentPaneActivityFromRenderer } from './agent-pane-activity-relay' +import { requestAgentLaunchTabPublishFromRenderer } from './renderer-relays/agent-launch-tab-publish-relay' +import { requestAgentPaneActivityFromRenderer } from './renderer-relays/agent-pane-activity-relay' import type { OrcaRuntimeService } from '../runtime/orca-runtime' -import { registerRendererDocumentNavigation } from './renderer-document-navigation' -import { createRuntimeRendererNotificationSender } from './runtime-renderer-notification-sender' -import { requestSessionTabCloseFromRenderer } from './session-tab-close-request-relay' -import { requestTerminalPaneMoveFromRenderer } from './terminal-pane-move-request-relay' -import { revealTerminalPaneInWindow } from './terminal-pane-reveal-relay' -import { requestTerminalTabCloseFromRenderer } from './terminal-tab-close-request-relay' +import { registerRendererDocumentNavigation } from './security/renderer-document-navigation' +import { createRuntimeRendererNotificationSender } from './renderer-relays/runtime-renderer-notification-sender' +import { requestSessionTabCloseFromRenderer } from './renderer-relays/session-tab-close-request-relay' +import { requestTerminalPaneMoveFromRenderer } from './renderer-relays/terminal-pane-move-request-relay' +import { revealTerminalPaneInWindow } from './renderer-relays/terminal-pane-reveal-relay' +import { requestTerminalTabCloseFromRenderer } from './renderer-relays/terminal-tab-close-request-relay' import { ORCA_SIDEBAR_INPUTS_IS_MAIN } from '../../shared/sidebar-inputs-switch' import type { AgentListPublication } from '../../shared/agent-status/presentation/agent-list-status' import { addFanoutListener } from '../runtime/events/event-listener-fanout' @@ -240,17 +240,16 @@ export function registerRuntimeWindowLifecycle( send('runtime:clientHostedBrowserRowsChanged', event), claudeAccountSelected: (change) => send('claudeAccounts:selectedElsewhere', change) }) - // Switch point: the window reads its sidebar from main's feed and re-reads on each notice. - const detachSidebarInputsNotices = ORCA_SIDEBAR_INPUTS_IS_MAIN - ? runtime.onClientEvent( - (event) => { - if (event.type === 'sidebarInputsChanged') { - send('runtime:sidebarInputsChanged', event) - } - }, - { consumesTerminalSideEffects: false } - ) - : null + const detachClientNotices = runtime.onClientEvent( + (event) => { + if (event.type === 'linearLinkedIssueUpdated') { + send('linear:linkedIssueUpdated', event) + } else if (ORCA_SIDEBAR_INPUTS_IS_MAIN && event.type === 'sidebarInputsChanged') { + send('runtime:sidebarInputsChanged', event) + } + }, + { consumesTerminalSideEffects: false } + ) // Only this window's live document speaks for the Agents list; a gone one leaves no verdicts behind. const releaseAgentListVerdicts = addFanoutListener( ipcMain, @@ -284,7 +283,7 @@ export function registerRuntimeWindowLifecycle( runtime.setAgentListPublication(null) }) mainWindow.on('closed', () => { - detachSidebarInputsNotices?.() + detachClientNotices() releaseAgentListVerdicts() runtime.setAgentListPublication(null) rendererNotifications.close() diff --git a/src/main/window/runtime-window-pane-title-notification.test.ts b/src/main/window/runtime-window-pane-title-notification.test.ts deleted file mode 100644 index 60dc06d5afb..00000000000 --- a/src/main/window/runtime-window-pane-title-notification.test.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import type { BrowserWindow } from 'electron' -import type { OrcaRuntimeService } from '../runtime/orca-runtime' -import type { RuntimeNotifier } from '../runtime/client/events/runtime-notifier-contract' - -vi.mock('electron', () => ({ ipcMain: { on: vi.fn(), removeListener: vi.fn() } })) -vi.mock('../ipc/worktrees/listing/worktree-change-invalidators', () => ({ - runWorktreeChangeInvalidators: vi.fn() -})) -vi.mock('./renderer-document-navigation', () => ({ registerRendererDocumentNavigation: vi.fn() })) -vi.mock('./session-tab-close-request-relay', () => ({ - requestSessionTabCloseFromRenderer: vi.fn() -})) -vi.mock('./terminal-tab-close-request-relay', () => ({ - requestTerminalTabCloseFromRenderer: vi.fn() -})) - -import { registerRuntimeWindowLifecycle } from './runtime-window-lifecycle' - -function attachNotifier() { - const send = vi.fn() - const markGraphReloadFailed = vi.fn() - const attached: { notifier: RuntimeNotifier | null } = { notifier: null } - const windowState = { destroyed: false } - const mainWindow = { - id: 1, - isDestroyed: () => windowState.destroyed, - on: vi.fn(), - webContents: { isDestroyed: () => false, send, on: vi.fn() } - } - const runtime = { - attachWindow: vi.fn(), - markGraphReloadFailed, - setNotifier: (next: RuntimeNotifier | null) => { - attached.notifier = next - } - } - registerRuntimeWindowLifecycle( - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: registration reads only the supplied window lifecycle and webContents members. - mainWindow as unknown as BrowserWindow, - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: registration calls only the supplied runtime attachment and notification members. - runtime as unknown as OrcaRuntimeService - ) - if (!attached.notifier?.setPaneTitle) { - throw new Error('pane-title notifier was not attached') - } - return { setPaneTitle: attached.notifier.setPaneTitle, send, windowState, markGraphReloadFailed } -} - -describe('pane title renderer emission receipts', () => { - it('returns false without emitting to a destroyed desktop', () => { - const { setPaneTitle, send, windowState } = attachNotifier() - windowState.destroyed = true - expect(setPaneTitle('tab-1', 'leaf-1', null)).toBe(false) - expect(send).not.toHaveBeenCalled() - }) - - it('reports a disposed frame once and refuses subsequent emissions', () => { - const { setPaneTitle, send, markGraphReloadFailed } = attachNotifier() - send.mockImplementation(() => { - throw new Error('disposed frame') - }) - expect(setPaneTitle('tab-1', 'leaf-1', 'REVIEWER')).toBe(false) - expect(setPaneTitle('tab-1', 'leaf-1', 'OTHER')).toBe(false) - expect(send).toHaveBeenCalledTimes(1) - expect(markGraphReloadFailed).toHaveBeenCalledExactlyOnceWith(1, 'renderer-frame-unavailable') - }) -}) diff --git a/src/main/window/host-frame-navigation-guard.test.ts b/src/main/window/security/host-frame-navigation-guard.test.ts similarity index 68% rename from src/main/window/host-frame-navigation-guard.test.ts rename to src/main/window/security/host-frame-navigation-guard.test.ts index 2cd3bea64bb..9d48e3aa39b 100644 --- a/src/main/window/host-frame-navigation-guard.test.ts +++ b/src/main/window/security/host-frame-navigation-guard.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { PLUGIN_PANEL_FRAME_NAME_PREFIX } from '../../shared/plugins/frames/plugin-frame-bridge' -import { NATIVE_CHAT_VISUAL_FRAME_NAME_PREFIX } from '../../shared/native-chat/native-chat-visual-shell' +import { PLUGIN_PANEL_FRAME_NAME_PREFIX } from '../../../shared/plugins/frames/plugin-frame-bridge' +import { NATIVE_CHAT_VISUAL_FRAME_NAME_PREFIX } from '../../../shared/native-chat/native-chat-visual-shell' import { HostFrameNavigationRegistry, hostFrameKindForName } from './host-frame-navigation-guard' function frame(input: { id: number; name?: string; url?: string }) { @@ -55,26 +55,4 @@ describe('HostFrameNavigationRegistry', () => { const child = frame({ id: 4 }) expect(registry.shouldBlock(child, visual, 'https://example.com')).toBe(true) }) - - it('does not inspect unrelated guarded frames during registration or navigation', () => { - const registry = new HostFrameNavigationRegistry() - let livenessChecks = 0 - const panels = Array.from({ length: 100 }, (_, id) => ({ - ...frame({ id, name: `${PLUGIN_PANEL_FRAME_NAME_PREFIX}${id}` }), - isDestroyed: () => { - livenessChecks++ - return false - } - })) - for (const panel of panels) { - registry.register(panel) - } - const ordinary = frame({ id: 101 }) - registry.register(ordinary) - expect(registry.shouldBlock(ordinary, null, 'https://example.com')).toBe(false) - expect(registry.shouldBlock(panels[0], null, 'about:srcdoc')).toBe(false) - expect(registry.shouldBlock(panels[0], panels[0], 'https://example.com')).toBe(true) - expect(registry.shouldBlock(ordinary, panels[1], 'https://example.com')).toBe(true) - expect(livenessChecks).toBeLessThanOrEqual(4) - }) }) diff --git a/src/main/window/host-frame-navigation-guard.ts b/src/main/window/security/host-frame-navigation-guard.ts similarity index 93% rename from src/main/window/host-frame-navigation-guard.ts rename to src/main/window/security/host-frame-navigation-guard.ts index 47a516eb3ec..a938260eea2 100644 --- a/src/main/window/host-frame-navigation-guard.ts +++ b/src/main/window/security/host-frame-navigation-guard.ts @@ -1,6 +1,6 @@ import type { WebContents, WebFrameMain } from 'electron' -import { NATIVE_CHAT_VISUAL_FRAME_NAME_PREFIX } from '../../shared/native-chat/native-chat-visual-shell' -import { PLUGIN_PANEL_FRAME_NAME_PREFIX } from '../../shared/plugins/frames/plugin-frame-bridge' +import { NATIVE_CHAT_VISUAL_FRAME_NAME_PREFIX } from '../../../shared/native-chat/native-chat-visual-shell' +import { PLUGIN_PANEL_FRAME_NAME_PREFIX } from '../../../shared/plugins/frames/plugin-frame-bridge' type NavigationFrame = Pick diff --git a/src/main/window/host-frame-permission-policy.test.ts b/src/main/window/security/host-frame-permission-policy.test.ts similarity index 100% rename from src/main/window/host-frame-permission-policy.test.ts rename to src/main/window/security/host-frame-permission-policy.test.ts diff --git a/src/main/window/host-frame-permission-policy.ts b/src/main/window/security/host-frame-permission-policy.ts similarity index 100% rename from src/main/window/host-frame-permission-policy.ts rename to src/main/window/security/host-frame-permission-policy.ts diff --git a/src/main/window/main-window-webview-security.ts b/src/main/window/security/main-window-webview-security.ts similarity index 85% rename from src/main/window/main-window-webview-security.ts rename to src/main/window/security/main-window-webview-security.ts index d403d87e974..315da43ee10 100644 --- a/src/main/window/main-window-webview-security.ts +++ b/src/main/window/security/main-window-webview-security.ts @@ -1,42 +1,42 @@ import type { BrowserWindow } from 'electron' import { join } from 'node:path' -import { ORCA_BROWSER_GUEST_WEB_PREFERENCES } from '../../shared/browser/guest-lifecycle/browser-guest-web-preferences' -import { normalizeBrowserNavigationUrl } from '../../shared/browser-url' -import { browserManager } from '../browser/guest-lifecycle/manager/browser-manager' -import { browserSessionRegistry } from '../browser/sessions/profiles/browser-session-registry' +import { ORCA_BROWSER_GUEST_WEB_PREFERENCES } from '../../../shared/browser/guest-lifecycle/browser-guest-web-preferences' +import { normalizeBrowserNavigationUrl } from '../../../shared/browser-url' +import { browserManager } from '../../browser/guest-lifecycle/manager/browser-manager' +import { browserSessionRegistry } from '../../browser/sessions/profiles/browser-session-registry' import { enforceLocalSshWebRtcPolicyForGuest, isLocalSshBrowserPartition -} from '../browser/routing/local-host-partitions/local-ssh-browser-partitions' +} from '../../browser/routing/local-host-partitions/local-ssh-browser-partitions' import { browserRouteSessionRegistry, browserRouteWebContentsRegistry -} from '../browser/routing/sessions/browser-route-session-runtime' -import '../../shared/constants' -import { ORCA_BROWSER_BLANK_URL } from '../../shared/browser/browser-blank-page' +} from '../../browser/routing/sessions/browser-route-session-runtime' +import '../../../shared/constants' +import { ORCA_BROWSER_BLANK_URL } from '../../../shared/browser/browser-blank-page' import { DOC_PREVIEW_PARTITION, parseDocPreviewUrl -} from '../../shared/document-preview/doc-preview-scheme' -import { setDocPreviewFailureSink } from '../browser/document-preview/doc-preview-failure-notice' +} from '../../../shared/document-preview/doc-preview-scheme' +import { setDocPreviewFailureSink } from '../../browser/document-preview/doc-preview-failure-notice' import { getDocPreviewGrant, revokeAllDocPreviewGrants -} from '../browser/document-preview/doc-preview-grant-registry' -import { isDocPreviewSession } from '../browser/document-preview/doc-preview-protocol' +} from '../../browser/document-preview/doc-preview-grant-registry' +import { isDocPreviewSession } from '../../browser/document-preview/doc-preview-protocol' import { registerHostFrameNavigationGuard } from './host-frame-navigation-guard' import { installPrivilegedWindowNavigationPolicy } from './privileged-window-navigation' -import { parseChromeExtensionUrl } from '../../shared/browser/extensions/browser-extension-url' -import { getBrowserExtensionSessionForProfile } from '../browser/extensions/profile-sessions/browser-extension-session-loader' -import { installBrowserJavaScriptDialogs } from '../browser/guest-lifecycle/prompts/browser-javascript-dialogs' -import { installNativeChatVisualGuestTheme } from '../host/native-chat-visual-guest-theme' +import { parseChromeExtensionUrl } from '../../../shared/browser/extensions/browser-extension-url' +import { getBrowserExtensionSessionForProfile } from '../../browser/extensions/profile-sessions/browser-extension-session-loader' +import { installBrowserJavaScriptDialogs } from '../../browser/guest-lifecycle/prompts/browser-javascript-dialogs' +import { installNativeChatVisualGuestTheme } from '../../host/native-chat-visual-guest-theme' import { admitPluginFrameAttach, attachPluginFrameGuest, isPluginFramePartition, PLUGIN_FRAME_GUEST_RENDERER_ARGUMENTS -} from '../plugins/panels/guest-isolation/plugin-frame-guest-registry' -import { attachBrowserPasswordGuest } from '../browser-passwords/browser-password-guest-service' +} from '../../plugins/panels/guest-isolation/plugin-frame-guest-registry' +import { attachBrowserPasswordGuest } from '../../browser-passwords/browser-password-guest-service' /** orca-preview is outside normal browser URL admission; require the doc partition and a main-minted user-preview grant. */ function isAdmissibleDocPreviewAttach(partition: string, src: string): boolean { diff --git a/src/main/window/privileged-window-navigation.ts b/src/main/window/security/privileged-window-navigation.ts similarity index 92% rename from src/main/window/privileged-window-navigation.ts rename to src/main/window/security/privileged-window-navigation.ts index fd50766d06c..c9d4fa1db93 100644 --- a/src/main/window/privileged-window-navigation.ts +++ b/src/main/window/security/privileged-window-navigation.ts @@ -1,5 +1,5 @@ import { shell, type WebContents } from 'electron' -import { normalizeExternalBrowserUrl } from '../../shared/browser-url' +import { normalizeExternalBrowserUrl } from '../../../shared/browser-url' import { isRendererDocumentNavigation } from './renderer-document-navigation' /** Keep remote documents from inheriting an Orca window's privileged preload. */ diff --git a/src/main/window/renderer-document-navigation.ts b/src/main/window/security/renderer-document-navigation.ts similarity index 100% rename from src/main/window/renderer-document-navigation.ts rename to src/main/window/security/renderer-document-navigation.ts diff --git a/src/main/window/renderer-publication-throttle-electron-fixture.ts b/src/main/window/testing/renderer-publication-throttle-electron-fixture.ts similarity index 93% rename from src/main/window/renderer-publication-throttle-electron-fixture.ts rename to src/main/window/testing/renderer-publication-throttle-electron-fixture.ts index 3a417f1dc9f..ef9c2eb52e0 100644 --- a/src/main/window/renderer-publication-throttle-electron-fixture.ts +++ b/src/main/window/testing/renderer-publication-throttle-electron-fixture.ts @@ -1,6 +1,6 @@ import { app, BrowserWindow } from 'electron' -import { startBrowserScreencast } from '../browser/cdp/screencast/browser-screencast-stream' -import { RendererPublicationThrottle } from './renderer-publication-throttle' +import { startBrowserScreencast } from '../../browser/cdp/screencast/browser-screencast-stream' +import { RendererPublicationThrottle } from '../visibility/renderer-publication-throttle' async function run(): Promise { // Serve must survive with no page open; keep Electron alive after last-window close. diff --git a/src/main/window/hidden-window-frame-pump.ts b/src/main/window/visibility/hidden-window-frame-pump.ts similarity index 88% rename from src/main/window/hidden-window-frame-pump.ts rename to src/main/window/visibility/hidden-window-frame-pump.ts index 70ab990920a..1f7fb1a7b44 100644 --- a/src/main/window/hidden-window-frame-pump.ts +++ b/src/main/window/visibility/hidden-window-frame-pump.ts @@ -1,4 +1,4 @@ -import { HIDDEN_WINDOW_FRAME_PUMP_STOP_CHANNEL } from '../../shared/hidden-window-frame-pump' +import { HIDDEN_WINDOW_FRAME_PUMP_STOP_CHANNEL } from '../../../shared/hidden-window-frame-pump' type FramePumpWindow = { on(event: 'show', listener: () => void): unknown diff --git a/src/main/window/main-window-visibility.ts b/src/main/window/visibility/main-window-visibility.ts similarity index 100% rename from src/main/window/main-window-visibility.ts rename to src/main/window/visibility/main-window-visibility.ts diff --git a/src/main/window/renderer-publication-throttle.electron.test.ts b/src/main/window/visibility/renderer-publication-throttle.electron.test.ts similarity index 89% rename from src/main/window/renderer-publication-throttle.electron.test.ts rename to src/main/window/visibility/renderer-publication-throttle.electron.test.ts index a01dfceb678..90211732c24 100644 --- a/src/main/window/renderer-publication-throttle.electron.test.ts +++ b/src/main/window/visibility/renderer-publication-throttle.electron.test.ts @@ -5,7 +5,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import { describe, expect, it } from 'vitest' import { build } from 'vite' -import { resolveElectronProbeLaunch } from '../browser/electron-fixtures/electron-probe-display-launch' +import { resolveElectronProbeLaunch } from '../../browser/electron-fixtures/electron-probe-display-launch' describe('publication lease release during Electron guest destruction', () => { it('closes streamed guests without terminating the host', async () => { @@ -17,7 +17,10 @@ describe('publication lease release during Electron guest destruction', () => { build: { outDir: root, lib: { - entry: join(import.meta.dirname, 'renderer-publication-throttle-electron-fixture.ts'), + entry: join( + import.meta.dirname, + '../testing/renderer-publication-throttle-electron-fixture.ts' + ), formats: ['cjs'], fileName: () => 'main.cjs' }, diff --git a/src/main/window/renderer-publication-throttle.ts b/src/main/window/visibility/renderer-publication-throttle.ts similarity index 100% rename from src/main/window/renderer-publication-throttle.ts rename to src/main/window/visibility/renderer-publication-throttle.ts diff --git a/src/main/window/resource-view-admission.ts b/src/main/window/visibility/resource-view-admission.ts similarity index 74% rename from src/main/window/resource-view-admission.ts rename to src/main/window/visibility/resource-view-admission.ts index 8bec07bd3eb..4cc6fb030a1 100644 --- a/src/main/window/resource-view-admission.ts +++ b/src/main/window/visibility/resource-view-admission.ts @@ -1,6 +1,6 @@ import type { BrowserWindow, IpcMainInvokeEvent } from 'electron' -import { getRuntimeDesktopSurface } from '../runtime/construction/runtime-desktop-surface' -import type { ResourceViewAdmission } from '../../shared/resource-view-admission' +import { getRuntimeDesktopSurface } from '../../runtime/construction/runtime-desktop-surface' +import type { ResourceViewAdmission } from '../../../shared/resource-view-admission' export function isResourceWindowVisible(window: BrowserWindow | null): boolean { return !!window && !window.isDestroyed() && window.isVisible() && !window.isMinimized() diff --git a/src/main/window/wait-for-window-to-show.ts b/src/main/window/visibility/wait-for-window-to-show.ts similarity index 100% rename from src/main/window/wait-for-window-to-show.ts rename to src/main/window/visibility/wait-for-window-to-show.ts diff --git a/src/main/window/workspace-space-window.ts b/src/main/window/workspace-space-window.ts index 08bbfedc31e..da4deba0e58 100644 --- a/src/main/window/workspace-space-window.ts +++ b/src/main/window/workspace-space-window.ts @@ -1,8 +1,11 @@ import { mainI18n, translateMain } from '../i18n/main-i18n' import { app, BrowserWindow, nativeTheme, type WebContents } from 'electron' import { join } from 'node:path' -import { isBackgroundLaunch, showWindowWithoutStealingFocus } from './foreground-activation-policy' -import { installPrivilegedWindowNavigationPolicy } from './privileged-window-navigation' +import { + isBackgroundLaunch, + showWindowWithoutStealingFocus +} from './activation/foreground-activation-policy' +import { installPrivilegedWindowNavigationPolicy } from './security/privileged-window-navigation' import { sendToTrustedUIRenderer } from '../ipc/ui' import type { Store } from '../persistence/loading-store/store' import { stepUIZoomLevel, type UIZoomDirection } from '../../shared/ui-zoom-level' diff --git a/src/main/windows/windows-process-table.test.ts b/src/main/windows/windows-process-table.test.ts index 9df22f2ead4..8b8db53ac11 100644 --- a/src/main/windows/windows-process-table.test.ts +++ b/src/main/windows/windows-process-table.test.ts @@ -1,23 +1,11 @@ -import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { WindowsProcessTableTimeoutError } from './windows-process-table-timeout-error' -import { tmpdir } from 'node:os' -import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { - __setWindowsProcessTableCimScanForTests, __setWindowsProcessTreeLoaderForTests, - __setWindowsProcessTreeRequireForTests, - isWindowsProcessTableAvailable, - isWindowsProcessStartTimeAvailable, - readWindowsProcessIdentityTable, readWindowsProcessIdentityTableFresh, - readWindowsProcessTable, readWindowsProcessTableFresh, - resetWindowsProcessTableForTests, - type WindowsProcessIdentityRow, - type WindowsProcessRow + resetWindowsProcessTableForTests } from './windows-process-table' -import { resetWindowsCommandLineRecoveryHealthForTests } from './windows-command-line-recovery-health' /** None | CreationTime, and CommandLine on top of it. Memory (1) is never asked for. */ const IDENTITY_FLAGS = 4 @@ -55,48 +43,6 @@ const NATIVE: NativeRow[] = [ let coalescingCalls: { flags: number }[] = [] let maxConcurrentNativeCalls = 0 -function coalescingModule(): { - ProcessDataFlag: { None: number; Memory: number; CommandLine: number; CreationTime: number } - getAllProcesses: (cb: (rows: NativeRow[] | undefined) => void, flags?: number) => void -} { - let requestInProgress = false - const queue: ((rows: NativeRow[]) => void)[] = [] - return { - ProcessDataFlag: { None: 0, Memory: 1, CommandLine: 2, CreationTime: 4 }, - getAllProcesses: (cb, flags) => { - queue.push(cb) - if (requestInProgress) { - return - } - requestInProgress = true - coalescingCalls.push({ flags: flags ?? 0 }) - // Gate each field on its own bit so identity creation-time omissions differ from coalesced flag errors. - const requested = flags ?? 0 - const rows: NativeRow[] = NATIVE.map((row) => ({ - pid: row.pid, - ppid: row.ppid, - name: row.name, - ...(requested & 2 && row.commandLine !== undefined ? { commandLine: row.commandLine } : {}), - ...(requested & 4 && row.creationTimeMs !== undefined - ? { creationTimeMs: row.creationTimeMs } - : {}) - })) - setTimeout(() => { - while (queue.length) { - queue.splice(0).forEach((callback) => callback(rows)) - } - requestInProgress = false - }, 0) - } - } -} - -/** Share the mock's module-global latch across reads. */ -function installCoalescingModule(): void { - const native = coalescingModule() - __setWindowsProcessTreeLoaderForTests(() => native) -} - /** Bare addon exposes overlap directly; the coalescing mock hides concurrent callers behind its own latch. */ function installBareAddonModule(): void { let inFlight = 0 @@ -139,52 +85,6 @@ describe('windows process table', () => { } }) - it('collapses a 32-wide burst into one scan per flag set', async () => { - installCoalescingModule() - const [identity, detailed] = await Promise.all([ - Promise.all(Array.from({ length: 16 }, () => readWindowsProcessIdentityTable())), - Promise.all(Array.from({ length: 16 }, () => readWindowsProcessTable())) - ]) - expect(coalescingCalls.map((call) => call.flags).sort()).toEqual([ - IDENTITY_FLAGS, - DETAILED_FLAGS - ]) - expect(identity).toHaveLength(16) - expect(detailed).toHaveLength(16) - }) - - // The wrapper discards overlapping flags; identity-first used to strip detailed command lines. - async function expectEachViewGotItsOwnFlags( - identity: Promise, - detailed: Promise - ): Promise { - const [identityRows, detailedRows] = await Promise.all([identity, detailed]) - expect(detailedRows.some((row) => row.command === '"C:/a b/orca.exe" --x')).toBe(true) - expect(identityRows.every((row) => !('command' in row))).toBe(true) - // Verify both row shape and requested flags: either alone misses the other failure mode. - expect(identityRows.map((row) => row.creationTimeMs)).toEqual([undefined, 1_700_000_000_000]) - expect(detailedRows.map((row) => row.creationTimeMs)).toEqual([undefined, 1_700_000_000_000]) - // This coalescing mock serializes itself; measure our gate against the bare addon separately. - expect(coalescingCalls.map((call) => call.flags).sort()).toEqual([ - IDENTITY_FLAGS, - DETAILED_FLAGS - ]) - } - - it('gives each flag set its own data when the identity read is issued first', async () => { - installCoalescingModule() - const identity = readWindowsProcessIdentityTableFresh() - const detailed = readWindowsProcessTableFresh() - await expectEachViewGotItsOwnFlags(identity, detailed) - }) - - it('gives each flag set its own data when the detailed read is issued first', async () => { - installCoalescingModule() - const detailed = readWindowsProcessTableFresh() - const identity = readWindowsProcessIdentityTableFresh() - await expectEachViewGotItsOwnFlags(identity, detailed) - }) - it('never re-enters the bare relay addon when both flag sets overlap', async () => { installBareAddonModule() const detailed = readWindowsProcessTableFresh() @@ -197,29 +97,6 @@ describe('windows process table', () => { expect(maxConcurrentNativeCalls).toBe(1) }) - it('does not serve one flag set from the other cache', async () => { - await readWindowsProcessTable() - await readWindowsProcessIdentityTable() - expect(getAllProcesses).toHaveBeenCalledTimes(2) - }) - - it('rejects an empty identity snapshot rather than reporting an idle machine', async () => { - getAllProcesses.mockImplementation((cb: (rows: unknown) => void) => cb([])) - resetWindowsProcessTableForTests() - await expect(readWindowsProcessIdentityTableFresh()).rejects.toThrow(/unreadable/) - }) - - it('applies the deadline to the identity read too', async () => { - vi.useFakeTimers() - getAllProcesses.mockImplementation(() => {}) - resetWindowsProcessTableForTests() - const pending = readWindowsProcessIdentityTableFresh() - const assertion = expect(pending).rejects.toThrow(/timed out/) - await vi.advanceTimersByTimeAsync(3_000) - await assertion - vi.useRealTimers() - }) - it('shares the wedge gate across flag sets, because they share one addon', async () => { // Both flags share one wedged addon; separate gates would accumulate retained callbacks. vi.useFakeTimers() @@ -238,190 +115,6 @@ describe('windows process table', () => { expect(getAllProcesses).toHaveBeenCalledTimes(1) vi.useRealTimers() }) - - it('only advertises PID-safe ownership when the BINARY reports creation-time support', () => { - expect(isWindowsProcessStartTimeAvailable()).toBe(true) - - // Patched JS can advertise CreationTime over a prebuilt that still ignores flag4. - __setWindowsProcessTreeLoaderForTests(() => ({ - ProcessDataFlag: { None: 0, Memory: 1, CommandLine: 2, CreationTime: 4 }, - supportedProcessDataFlags: 3, - getAllProcesses - })) - expect(isWindowsProcessStartTimeAvailable()).toBe(false) - - // Older binaries lack the capability export entirely. - __setWindowsProcessTreeLoaderForTests(() => ({ - ProcessDataFlag: { None: 0, Memory: 1, CommandLine: 2, CreationTime: 4 }, - getAllProcesses - })) - expect(isWindowsProcessStartTimeAvailable()).toBe(false) - }) - - it('serves repeat reads from the shared snapshot', async () => { - await readWindowsProcessTable() - await readWindowsProcessTable() - expect(getAllProcesses).toHaveBeenCalledTimes(1) - }) - - it('rejects rather than reporting an empty machine when the module is absent', async () => { - // Absent or failed readers cannot claim no processes are running. - __setWindowsProcessTreeLoaderForTests(() => null) - __setWindowsProcessTableCimScanForTests(async () => { - throw new Error('powershell unavailable') - }) - await expect(readWindowsProcessTableFresh()).rejects.toThrow(/powershell unavailable/) - expect(isWindowsProcessTableAvailable()).toBe(false) - }) - - it('rejects when the snapshot itself fails', async () => { - getAllProcesses.mockImplementation((cb: (rows: unknown) => void) => cb(undefined)) - resetWindowsProcessTableForTests() - await expect(readWindowsProcessTableFresh()).rejects.toThrow() - }) - - it('rejects, without throwing inside the addon callback, a snapshot that failed natively', async () => { - // node-addon-api reports a failed worker (e.g. bad_alloc) by passing an Error; a throw inside the addon's - // callback loop is uncaught and ends the terminal host with every PTY on it (#33350). - let thrown: unknown - getAllProcesses.mockImplementation((cb: (rows: unknown) => void) => { - try { - cb(new Error('bad allocation')) - } catch (error) { - thrown = error - } - }) - resetWindowsProcessTableForTests() - const read = readWindowsProcessTableFresh() - await vi.waitFor(() => expect(getAllProcesses).toHaveBeenCalled()) - expect(thrown).toBeUndefined() - await expect(read).rejects.toThrow(/no snapshot/) - }) - - it('rejects an empty snapshot rather than reporting an idle machine', async () => { - // A blocked snapshot can return [] without error; it must not prove a live root dead. - getAllProcesses.mockImplementation((cb: (rows: unknown) => void) => cb([])) - resetWindowsProcessTableForTests() - await expect(readWindowsProcessTableFresh()).rejects.toThrow(/unreadable/) - }) - - it('rejects when the snapshot never calls back', async () => { - // A missing callback must not strand process queries forever. - vi.useFakeTimers() - getAllProcesses.mockImplementation(() => {}) - resetWindowsProcessTableForTests() - const pending = readWindowsProcessTableFresh() - const assertion = expect(pending).rejects.toThrow(/timed out/) - await vi.advanceTimersByTimeAsync(3_000) - await assertion - vi.useRealTimers() - }) -}) - -// Relays without a staged addon need fallback; failed evidence otherwise leaves agent names stale. -describe('PowerShell fallback when the native binding is absent', () => { - let platform: PropertyDescriptor | undefined - const cimScan = vi.fn() - const CIM_ROWS = [ - { pid: process.pid, ppid: 0, name: 'node.exe', command: 'node relay.js' }, - { pid: 200, ppid: process.pid, name: 'claude.exe', command: 'claude --resume' } - ] - - beforeEach(() => { - platform = Object.getOwnPropertyDescriptor(process, 'platform') - Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' }) - cimScan.mockReset() - cimScan.mockResolvedValue(CIM_ROWS) - __setWindowsProcessTableCimScanForTests(cimScan) - }) - - afterEach(() => { - __setWindowsProcessTableCimScanForTests() - __setWindowsProcessTreeLoaderForTests() - if (platform) { - Object.defineProperty(process, 'platform', platform) - } - }) - - it('engages when the module cannot be required', async () => { - __setWindowsProcessTreeLoaderForTests(() => null) - await expect(readWindowsProcessTableFresh()).resolves.toEqual(CIM_ROWS) - expect(cimScan).toHaveBeenCalledTimes(1) - }) - - it('serves the identity view from the one scan a relay can afford', async () => { - // Share the expensive CIM scan between views. - __setWindowsProcessTreeLoaderForTests(() => null) - // Strip command lines even on fallback so identity callers cannot depend on them. - await expect(readWindowsProcessIdentityTableFresh()).resolves.toEqual([ - { pid: process.pid, ppid: 0, name: 'node.exe' }, - { pid: 200, ppid: process.pid, name: 'claude.exe' } - ]) - await readWindowsProcessTable() - expect(cimScan).toHaveBeenCalledTimes(1) - }) - - it('rejects an identity read that omits our own pid', async () => { - __setWindowsProcessTreeLoaderForTests(() => null) - cimScan.mockResolvedValue([{ pid: 200, ppid: 4, name: 'claude.exe', command: 'claude' }]) - await expect(readWindowsProcessIdentityTableFresh()).rejects.toThrow(/unreadable/) - }) - - it('does not engage when the native binding is present', async () => { - const getAllProcesses = vi.fn() - getAllProcesses.mockImplementation((cb: (rows: unknown) => void) => cb(NATIVE)) - __setWindowsProcessTreeLoaderForTests(() => ({ - ProcessDataFlag: { None: 0, Memory: 1, CommandLine: 2 }, - getAllProcesses - })) - await readWindowsProcessTableFresh() - expect(cimScan).not.toHaveBeenCalled() - }) - - it('does not engage when a present binding fails its read', async () => { - // Native failure must not start PowerShell at polling cadence. - const getAllProcesses = vi.fn() - getAllProcesses.mockImplementation((cb: (rows: unknown) => void) => cb([])) - __setWindowsProcessTreeLoaderForTests(() => ({ - ProcessDataFlag: { None: 0, Memory: 1, CommandLine: 2 }, - getAllProcesses - })) - await expect(readWindowsProcessTableFresh()).rejects.toThrow(/unreadable/) - expect(cimScan).not.toHaveBeenCalled() - }) - - it('says so in the log, once, rather than falling back silently', async () => { - // Legitimate relay fallback must still emit a capability warning (#16905). - const fallbackWarnings = (): number => - warn.mock.calls.filter((call) => - String(call[0]).includes('falling back to a powershell.exe CIM scan') - ).length - const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - __setWindowsProcessTreeLoaderForTests(() => null) - - await readWindowsProcessTableFresh() - await readWindowsProcessTableFresh() - expect(fallbackWarnings()).toBe(1) - - // Reinjection models a fresh process and must restore its once-only warning. - __setWindowsProcessTreeLoaderForTests(() => null) - await readWindowsProcessTableFresh() - expect(fallbackWarnings()).toBe(2) - warn.mockRestore() - }) - - it('rejects a scan missing our own pid instead of reporting an idle machine', async () => { - __setWindowsProcessTreeLoaderForTests(() => null) - cimScan.mockResolvedValue([{ pid: 200, ppid: 4, name: 'claude.exe', command: 'claude' }]) - await expect(readWindowsProcessTableFresh()).rejects.toThrow(/unreadable/) - }) - - it('stays off Windows-only: darwin still reports unavailable', async () => { - Object.defineProperty(process, 'platform', { configurable: true, value: 'darwin' }) - __setWindowsProcessTreeLoaderForTests(() => null) - await expect(readWindowsProcessTableFresh()).rejects.toThrow(/unavailable/) - expect(cimScan).not.toHaveBeenCalled() - }) }) describe('sticky wedge', () => { @@ -440,37 +133,6 @@ describe('sticky wedge', () => { } }) - it('never re-enters the reader while the timed-out read is still out', async () => { - // Cooldowns limit callback rate, not retention; only the outstanding callback can reopen the gate. - vi.useFakeTimers() - const getAllProcesses = vi.fn(() => {}) - __setWindowsProcessTreeLoaderForTests(() => ({ - ProcessDataFlag: { None: 0, Memory: 1, CommandLine: 2, CreationTime: 4 }, - getAllProcesses - })) - - const wedge = readWindowsProcessTableFresh() - const wedgeAssertion = expect(wedge).rejects.toThrow(/timed out/) - await vi.advanceTimersByTimeAsync(3_000) - await wedgeAssertion - expect(getAllProcesses).toHaveBeenCalledTimes(1) - - // Concurrent retries across four old cooldown windows must retain exactly one callback. - for (let window = 0; window < 4; window += 1) { - await vi.advanceTimersByTimeAsync(30_000) - const attempts = [ - readWindowsProcessTableFresh().catch(() => 'rejected'), - readWindowsProcessTableFresh().catch(() => 'rejected'), - readWindowsProcessTableFresh().catch(() => 'rejected') - ] - // Let any accidentally admitted probe reach its own deadline. - await vi.advanceTimersByTimeAsync(3_000) - expect(await Promise.all(attempts)).toEqual(['rejected', 'rejected', 'rejected']) - } - - expect(getAllProcesses).toHaveBeenCalledTimes(1) - }) - it('resumes as soon as the timed-out read finally calls back', async () => { // Only completion of the stuck request proves the queue drained; recovery needs no further cooldown. vi.useFakeTimers() @@ -497,290 +159,4 @@ describe('sticky wedge', () => { await expect(readWindowsProcessTableFresh()).resolves.toHaveLength(NATIVE.length) expect(getAllProcesses).toHaveBeenCalledTimes(2) }) - - it('clears the deadline when the reader throws synchronously', async () => { - // An uncleared timer can wedge a reader after a synchronous throw already recovered. - vi.useFakeTimers() - const getAllProcesses = vi.fn(() => { - throw new Error('addon exploded') - }) - __setWindowsProcessTreeLoaderForTests(() => ({ - ProcessDataFlag: { None: 0, Memory: 1, CommandLine: 2, CreationTime: 4 }, - getAllProcesses - })) - - await expect(readWindowsProcessTableFresh()).rejects.toThrow(/exploded/) - await vi.advanceTimersByTimeAsync(10_000) - - // Recovery must not inherit the old deadline's wedge. - __setWindowsProcessTreeLoaderForTests(() => ({ - ProcessDataFlag: { None: 0, Memory: 1, CommandLine: 2, CreationTime: 4 }, - getAllProcesses: (cb: (rows: typeof NATIVE | undefined) => void) => cb(NATIVE) - })) - await expect(readWindowsProcessTableFresh()).resolves.toHaveLength(NATIVE.length) - }) -}) - -// Exercise real require resolution: replacing the loader hid missing relay specifiers (#15749). -describe('resolving the native reader', () => { - let platform: PropertyDescriptor | undefined - const PACKAGE_SPECIFIER = '@vscode/windows-process-tree' - const ADDON_SPECIFIER = './windows-process-tree.node' - const stagedAddonDirs: string[] = [] - - beforeEach(() => { - getAllProcesses.mockReset() - getAllProcesses.mockImplementation((cb: (rows: unknown) => void) => cb(NATIVE)) - platform = Object.getOwnPropertyDescriptor(process, 'platform') - Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' }) - }) - - afterEach(() => { - __setWindowsProcessTreeRequireForTests() - __setWindowsProcessTableCimScanForTests() - for (const dir of stagedAddonDirs.splice(0)) { - rmSync(dir, { recursive: true, force: true }) - } - if (platform) { - Object.defineProperty(process, 'platform', platform) - } - }) - - function addonReturning(rows: unknown): { - getProcessList: ReturnType - supportedProcessDataFlags: number - } { - return { - getProcessList: vi.fn((cb: (r: unknown) => void) => cb(rows)), - supportedProcessDataFlags: 7 - } - } - - /** Older binaries have no creation-time capability export. */ - function staleAddonReturning(rows: unknown): { getProcessList: ReturnType } { - return { getProcessList: vi.fn((cb: (r: unknown) => void) => cb(rows)) } - } - - it('prefers the npm package where the desktop app installs it', async () => { - const resolve = vi.fn((specifier: string) => { - if (specifier === PACKAGE_SPECIFIER) { - return { ProcessDataFlag: { None: 0, Memory: 1, CommandLine: 2 }, getAllProcesses } - } - throw new Error('should not reach the addon') - }) - __setWindowsProcessTreeRequireForTests(resolve) - await expect(readWindowsProcessTableFresh()).resolves.toHaveLength(2) - expect(resolve).toHaveBeenCalledWith(PACKAGE_SPECIFIER) - expect(resolve).not.toHaveBeenCalledWith(ADDON_SPECIFIER) - }) - - it('falls through to the addon staged beside the relay bundle', async () => { - const addon = addonReturning(NATIVE) - __setWindowsProcessTreeRequireForTests((specifier: string) => { - if (specifier === ADDON_SPECIFIER) { - return addon - } - throw new Error('MODULE_NOT_FOUND') - }) - const rows = await readWindowsProcessTableFresh() - expect(rows).toEqual([ - { pid: process.pid, ppid: 0, name: 'vitest.exe', command: 'vitest.exe --run' }, - { - pid: 100, - ppid: 4, - name: 'orca.exe', - command: '"C:/a b/orca.exe" --x', - creationTimeMs: 1_700_000_000_000 - } - ]) - expect(isWindowsProcessTableAvailable()).toBe(true) - }) - - it('asks the addon for the command line and creation time, as the package path does', async () => { - const addon = addonReturning(NATIVE) - __setWindowsProcessTreeRequireForTests((specifier: string) => { - if (specifier === ADDON_SPECIFIER) { - return addon - } - throw new Error('MODULE_NOT_FOUND') - }) - await readWindowsProcessTableFresh() - // Detailed reads need creation times for PID-safe teardown and omit unused Memory. - expect(addon.getProcessList).toHaveBeenCalledWith(expect.any(Function), 6) - expect(isWindowsProcessStartTimeAvailable()).toBe(true) - }) - - it('asks the addon for the creation time alone on the identity path', async () => { - const addon = addonReturning(NATIVE) - __setWindowsProcessTreeRequireForTests((specifier: string) => { - if (specifier === ADDON_SPECIFIER) { - return addon - } - throw new Error('MODULE_NOT_FOUND') - }) - await readWindowsProcessIdentityTableFresh() - // CreationTime alone uses a limited handle/GetProcessTimes; no command-line query. - expect(addon.getProcessList).toHaveBeenCalledWith(expect.any(Function), 4) - }) - - it('trusts the staged addon on its own report, not on ours', async () => { - // Old addons still enumerate but cannot prove PID incarnation without creation times. - const addon = staleAddonReturning(NATIVE) - __setWindowsProcessTreeRequireForTests((specifier: string) => { - if (specifier === ADDON_SPECIFIER) { - return addon - } - throw new Error('MODULE_NOT_FOUND') - }) - await expect(readWindowsProcessTableFresh()).resolves.toHaveLength(2) - expect(isWindowsProcessTableAvailable()).toBe(true) - expect(isWindowsProcessStartTimeAvailable()).toBe(false) - }) - - it('reaches the CIM scan when neither the package nor the addon is present', async () => { - const cimScan = vi - .fn() - .mockResolvedValue([ - { pid: process.pid, ppid: 0, name: 'node.exe', command: 'node relay.js' } - ]) - __setWindowsProcessTableCimScanForTests(cimScan) - __setWindowsProcessTreeRequireForTests(() => { - throw new Error('MODULE_NOT_FOUND') - }) - await expect(readWindowsProcessTableFresh()).resolves.toHaveLength(1) - expect(cimScan).toHaveBeenCalledTimes(1) - expect(isWindowsProcessTableAvailable()).toBe(false) - }) - - it('rejects an addon that loads without the call we need', async () => { - // Unusable addon shapes must fall back rather than reject every subsequent read. - const cimScan = vi - .fn() - .mockResolvedValue([ - { pid: process.pid, ppid: 0, name: 'node.exe', command: 'node relay.js' } - ]) - __setWindowsProcessTableCimScanForTests(cimScan) - __setWindowsProcessTreeRequireForTests((specifier: string) => { - if (specifier === ADDON_SPECIFIER) { - return { notTheApi: true } - } - throw new Error('MODULE_NOT_FOUND') - }) - await expect(readWindowsProcessTableFresh()).resolves.toHaveLength(1) - expect(cimScan).toHaveBeenCalledTimes(1) - }) - - // Independent deployment can leave a loadable old addon that still imports ReadProcessMemory. - function withStagedAddonBinary( - bytes: string, - addon: unknown - ): ((specifier: string) => unknown) & { resolve: (specifier: string) => string } { - const dir = mkdtempSync(join(tmpdir(), 'orca-relay-addon-')) - const addonPath = join(dir, 'windows-process-tree.node') - writeFileSync(addonPath, bytes) - stagedAddonDirs.push(dir) - const resolve = (specifier: string): unknown => { - if (specifier === ADDON_SPECIFIER) { - return addon - } - throw new Error('MODULE_NOT_FOUND') - } - resolve.resolve = (specifier: string): string => { - if (specifier === ADDON_SPECIFIER) { - return addonPath - } - throw new Error('MODULE_NOT_FOUND') - } - return resolve - } - - it('refuses a staged relay addon still built from unpatched source', async () => { - const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - const cimScan = vi - .fn() - .mockResolvedValue([ - { pid: process.pid, ppid: 0, name: 'node.exe', command: 'node relay.js' } - ]) - __setWindowsProcessTableCimScanForTests(cimScan) - const addon = addonReturning(NATIVE) - __setWindowsProcessTreeRequireForTests( - withStagedAddonBinary('MZ\0KERNEL32.dll\0ReadProcessMemory\0', addon) - ) - - await expect(readWindowsProcessTableFresh()).resolves.toHaveLength(1) - expect(addon.getProcessList).not.toHaveBeenCalled() - expect(cimScan).toHaveBeenCalledTimes(1) - expect(isWindowsProcessTableAvailable()).toBe(false) - expect(warn.mock.calls[0]?.[0]).toContain('ReadProcessMemory') - warn.mockRestore() - }) - - it('binds a staged relay addon whose binary carries no such import', async () => { - const addon = addonReturning(NATIVE) - __setWindowsProcessTreeRequireForTests( - withStagedAddonBinary('MZ\0ntdll.dll\0NtQueryInformationProcess\0', addon) - ) - - await expect(readWindowsProcessTableFresh()).resolves.toHaveLength(2) - expect(addon.getProcessList).toHaveBeenCalledTimes(1) - }) - - it('never probes either specifier off Windows', async () => { - Object.defineProperty(process, 'platform', { configurable: true, value: 'darwin' }) - const resolve = vi.fn() - __setWindowsProcessTreeRequireForTests(resolve) - await expect(readWindowsProcessTableFresh()).rejects.toThrow(/unavailable/) - expect(resolve).not.toHaveBeenCalled() - }) -}) - -// Kernel command-line refusal leaves enumeration healthy; capability checks alone miss it. -describe('warning when command-line recovery is refused host-wide', () => { - let platform: PropertyDescriptor | undefined - let warn: ReturnType - - beforeEach(() => { - platform = Object.getOwnPropertyDescriptor(process, 'platform') - Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' }) - resetWindowsCommandLineRecoveryHealthForTests() - warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - }) - - afterEach(() => { - __setWindowsProcessTreeLoaderForTests() - warn.mockRestore() - if (platform) { - Object.defineProperty(process, 'platform', platform) - } - }) - - type NativeRow = { pid: number; ppid: number; name: string; commandLine?: string } - - function loaderReturning(rows: NativeRow[], commandLineFlag: number): void { - __setWindowsProcessTreeLoaderForTests(() => ({ - ProcessDataFlag: { None: 0, Memory: 1, CommandLine: commandLineFlag, CreationTime: 4 }, - getAllProcesses: (cb: (r: NativeRow[] | undefined) => void) => cb(rows) - })) - } - - it('warns once when our own row comes back with no command line', async () => { - loaderReturning([{ pid: process.pid, ppid: 0, name: 'vitest.exe' }], 2) - await readWindowsProcessTableFresh() - await readWindowsProcessTableFresh() - expect(warn).toHaveBeenCalledTimes(1) - expect(warn.mock.calls[0][0]).toContain('ProcessCommandLineInformation') - }) - - it('stays quiet when our own command line came back', async () => { - loaderReturning(NATIVE, 2) - await readWindowsProcessTableFresh() - expect(warn).not.toHaveBeenCalled() - }) - - it('stays quiet when the read never asked for a command line', async () => { - // A reader that requests identity fields only must not read as a refusal. - loaderReturning([{ pid: process.pid, ppid: 0, name: 'vitest.exe' }], 0) - await readWindowsProcessTableFresh() - expect(warn).not.toHaveBeenCalled() - }) }) diff --git a/src/main/workspaces/catalog/local-worktree-scan-generation.ts b/src/main/workspaces/catalog/local-worktree-scan-generation.ts index 5a13b2ac716..537271a6bd4 100644 --- a/src/main/workspaces/catalog/local-worktree-scan-generation.ts +++ b/src/main/workspaces/catalog/local-worktree-scan-generation.ts @@ -25,9 +25,37 @@ export function getLocalWorktreeScanGeneration(repoId: string): number { return generation } +const routeInputListeners = new Set<() => void>() +let routeInputsRevision = 0 +let routeInputNotificationQueued = false + +/** Repo, project and runtime-setting writes change which route runs a repo's Git; listeners run after the write. */ +export function onWorktreeRouteInputsChanged(listener: () => void): void { + routeInputListeners.add(listener) +} + +/** Advances synchronously so readers never trust a route snapshot taken before the write. */ +export function getWorktreeRouteInputsRevision(): number { + return routeInputsRevision +} + +export function markWorktreeRouteInputsChanged(): void { + routeInputsRevision += 1 + if (routeInputListeners.size > 0 && !routeInputNotificationQueued) { + routeInputNotificationQueued = true + queueMicrotask(() => { + routeInputNotificationQueued = false + for (const listener of routeInputListeners) { + listener() + } + }) + } +} + export function bumpLocalWorktreeScanGeneration(repoId: string): void { generationByRepoId.set(repoId, ++generationSequence) mutationRevision += 1 + markWorktreeRouteInputsChanged() } export function forgetLocalWorktreeScanGeneration(repoId: string): void { diff --git a/src/main/workspaces/catalog/repo-worktree-catalog-observation.ts b/src/main/workspaces/catalog/repo-worktree-catalog-observation.ts new file mode 100644 index 00000000000..fb6082c5f2b --- /dev/null +++ b/src/main/workspaces/catalog/repo-worktree-catalog-observation.ts @@ -0,0 +1,70 @@ +import type { GitWorktreeInfo } from '../../../shared/worktree/types' +import type { NativeLocalWorktreeMetadataScanExpectation } from '../../persistence/tracking-repos/missing-local-worktree-metadata-pruning' + +/** One `git worktree list`; a confirmed missing/non-repo stays distinct from a failed run. */ +export type WorktreeCatalogOutcome = + | { kind: 'rows'; worktrees: GitWorktreeInfo[] } + | { kind: 'true-empty' } + | { kind: 'failed'; error: unknown } + +/** Captured before Git runs; destructive consumers claim it at most once. */ +export type WorktreeCatalogWitness = { + readonly authorizedRootsRevision: number + /** Roots revision after this observation registered its roots; later side effects fence on it. */ + rootsRevision: number + readonly hygieneDue: boolean + readonly expectation?: NativeLocalWorktreeMetadataScanExpectation + /** Returns an unconsumed claim so the evidence gate can re-arm. */ + readonly release: () => void +} + +export type WorktreeCatalogObservation = { + readonly outcome: WorktreeCatalogOutcome + /** Scan start: verification never moves it, so the full-list ceiling cannot slide. */ + readonly startedAt: number + readonly generation: number + readonly revision: number + /** Only runtime-started flights fingerprint first; without one the rows cannot be verified. */ + readonly adminFingerprint: Promise | null + readonly startedBy: WorktreeCatalogReaderKind + witness: WorktreeCatalogWitness | undefined + /** Scan start, or the latest verifier answer that let a runtime reader reuse these rows. */ + confirmedAt: number +} + +export type WorktreeCatalogFlightPlan = { + scan: () => Promise + captureWitness?: () => WorktreeCatalogWitness | undefined + observed?: (observation: WorktreeCatalogObservation) => void +} + +export type WorktreeCatalogVerifier = { + /** Full-list ceiling measured from scan start. */ + ceilingMs: number + /** One outstanding probe per repo; 'in-flight' and timeouts reuse rows without proving them (#19312). */ + probe: () => Promise | 'in-flight' + timeoutMs: number + onUnknown?: (reason: string) => void +} + +export type WorktreeCatalogReaderKind = 'desktop' | 'runtime' + +export type WorktreeCatalogRequirement = { + kind: WorktreeCatalogReaderKind + /** Oldest confirmation this reader accepts; a fresher demand refreshes the shared observation. */ + maxAgeMs: number + /** Reuse failures only from this reader kind's own attempts; another kind's failure never blacks out a retry. */ + reusesFailure?: boolean + verifier?: WorktreeCatalogVerifier + /** Trailing flights this read follows when mutations overtake it; callers with their own rescan loop keep 1. */ + overtakenFlights?: number + /** Destructive hygiene is due: rows without a pre-scan hygiene claim are not good enough for this reader. */ + needsHygieneClaim?: () => boolean +} + +export type WorktreeCatalogRead = { + /** Null only for a request whose route was replaced before any observation existed. */ + observation: WorktreeCatalogObservation | null + /** Invalidations kept overtaking scans; callers must not treat these rows as authoritative. */ + superseded: boolean +} diff --git a/src/main/workspaces/catalog/repo-worktree-catalog-owner.test.ts b/src/main/workspaces/catalog/repo-worktree-catalog-owner.test.ts new file mode 100644 index 00000000000..2cb0ac67dad --- /dev/null +++ b/src/main/workspaces/catalog/repo-worktree-catalog-owner.test.ts @@ -0,0 +1,268 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import type { Repo } from '../../../shared/repo-types' +import type { GitWorktreeInfo } from '../../../shared/worktree/types' +import { bumpWorktreeScanGeneration } from '../../git/worktrees/catalog/worktree-scan-cache' +import { setWorktreeCatalogRouteResolver } from './repo-worktree-catalog-route' +import { markWorktreeRouteInputsChanged } from './local-worktree-scan-generation' +import { notifyWslDiscoveryChanged } from '../../wsl/discovery/wsl-discovery-change' +import { + _getWorktreeCatalogOwnerSizeForTests, + _resetWorktreeCatalogOwnerForTests, + retireObsoleteWorktreeCatalogs, + invalidateWorktreeCatalogForRepo, + isCurrentWorktreeCatalogObservation, + readWorktreeCatalog +} from './repo-worktree-catalog-owner' +import type { + WorktreeCatalogFlightPlan, + WorktreeCatalogOutcome +} from './repo-worktree-catalog-observation' + +// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the owner reads only these repo fields. +const repo = { id: 'repo-1', path: '/repos/app', kind: 'git' } as Repo +const row = (path: string): GitWorktreeInfo => ({ + path, + head: 'abc', + branch: 'refs/heads/main', + isBare: false, + isMainWorktree: path === '/repos/app' +}) +const desktop = { kind: 'desktop', maxAgeMs: 5_000, overtakenFlights: 3 } as const +const runtime = { + kind: 'runtime', + maxAgeMs: 30_000, + reusesFailure: true, + overtakenFlights: 3 +} as const + +function scanner(outcomes: WorktreeCatalogOutcome[]) { + let resolveNext: (() => void) | null = null + const plan: WorktreeCatalogFlightPlan & { calls: number; gate: boolean; release: () => void } = { + calls: 0, + gate: false, + release: () => resolveNext?.(), + scan: async () => { + const outcome = outcomes[Math.min(plan.calls, outcomes.length - 1)] + plan.calls += 1 + if (plan.gate) { + await new Promise((resolve) => { + resolveNext = resolve + }) + } + if (outcome.kind === 'failed') { + throw outcome.error + } + return outcome + } + } + return plan +} + +const rows = (...paths: string[]): WorktreeCatalogOutcome => ({ + kind: 'rows', + worktrees: paths.map(row) +}) + +describe('repo worktree catalog owner', () => { + beforeEach(() => { + vi.useFakeTimers({ toFake: ['Date'] }) + }) + afterEach(() => { + setWorktreeCatalogRouteResolver(null) + _resetWorktreeCatalogOwnerForTests() + vi.useRealTimers() + }) + + it('serves the sidebar and the runtime from one observation within each reader’s accepted age', async () => { + const plan = scanner([rows('/repos/app'), rows('/repos/app', '/repos/app-feature')]) + + await readWorktreeCatalog(repo, 'local:default', desktop, plan) + vi.advanceTimersByTime(4_000) + const runtimeRead = await readWorktreeCatalog(repo, 'local:default', runtime, plan) + expect(plan.calls).toBe(1) + expect(runtimeRead.observation?.outcome).toEqual(rows('/repos/app')) + + vi.advanceTimersByTime(2_000) + const sidebarRead = await readWorktreeCatalog(repo, 'local:default', desktop, plan) + expect(plan.calls).toBe(2) + expect(sidebarRead.observation?.outcome).toEqual(rows('/repos/app', '/repos/app-feature')) + }) + + it('withdraws destructive authority from rows a newer listing replaced', async () => { + const plan = scanner([rows('/repos/app', '/repos/app-old'), rows('/repos/app')]) + const first = await readWorktreeCatalog(repo, 'local:default', desktop, plan) + vi.advanceTimersByTime(6_000) + + const second = await readWorktreeCatalog(repo, 'local:default', desktop, plan) + + expect(isCurrentWorktreeCatalogObservation(first.observation!)).toBe(false) + expect(isCurrentWorktreeCatalogObservation(second.observation!)).toBe(true) + }) + + it('does not let a runtime verification stretch the sidebar past its 5 seconds', async () => { + const plan = scanner([rows('/repos/app'), rows('/repos/app', '/repos/app-external')]) + const verifier = { + ceilingMs: 300_000, + timeoutMs: 1_000, + probe: () => Promise.resolve('fingerprint-1') + } + await readWorktreeCatalog(repo, 'local:default', { ...runtime, verifier }, plan) + vi.advanceTimersByTime(31_000) + const verified = await readWorktreeCatalog( + repo, + 'local:default', + { ...runtime, verifier }, + plan + ) + expect(plan.calls).toBe(1) + expect(verified.observation?.outcome).toEqual(rows('/repos/app')) + + const sidebar = await readWorktreeCatalog(repo, 'local:default', desktop, plan) + + expect(plan.calls).toBe(2) + expect(sidebar.observation?.outcome).toEqual(rows('/repos/app', '/repos/app-external')) + }) + + it('moves readers that joined an overtaken scan onto one trailing scan', async () => { + const plan = scanner([rows('/repos/app'), rows('/repos/app', '/repos/app-new')]) + plan.gate = true + const first = readWorktreeCatalog(repo, 'local:default', runtime, plan) + const joined = readWorktreeCatalog(repo, 'local:default', desktop, plan) + invalidateWorktreeCatalogForRepo(repo.id) + plan.release() + await vi.waitFor(() => expect(plan.calls).toBe(2)) + plan.release() + + for (const read of await Promise.all([first, joined])) { + expect(read.superseded).toBe(false) + expect(read.observation?.outcome).toEqual(rows('/repos/app', '/repos/app-new')) + } + expect(plan.calls).toBe(2) + }) + + it('stops reusing settled rows after a Git-layer mutation of the repo path', async () => { + const plan = scanner([rows('/repos/app'), rows('/repos/app', '/repos/app-added')]) + await readWorktreeCatalog(repo, 'local:default', runtime, plan) + + bumpWorktreeScanGeneration('/repos/app') + const read = await readWorktreeCatalog(repo, 'local:default', runtime, plan) + + expect(plan.calls).toBe(2) + expect(read.observation?.outcome).toEqual(rows('/repos/app', '/repos/app-added')) + }) + + it('never lets a sidebar failure stop the runtime from listing', async () => { + const plan = scanner([{ kind: 'failed', error: new Error('index.lock') }, rows('/repos/app')]) + const failed = await readWorktreeCatalog(repo, 'local:default', desktop, plan) + expect(failed.observation?.outcome.kind).toBe('failed') + + const read = await readWorktreeCatalog(repo, 'local:default', runtime, plan) + + expect(plan.calls).toBe(2) + expect(read.observation?.outcome).toEqual(rows('/repos/app')) + }) + + it('retires the old Git runtime so switching back lists again', async () => { + const plan = scanner([ + rows('/repos/app'), + rows('/repos/app'), + rows('/repos/app', '/repos/app-new') + ]) + await readWorktreeCatalog(repo, 'local:native', runtime, plan) + await readWorktreeCatalog(repo, 'local:wsl:Ubuntu', runtime, plan) + + const back = await readWorktreeCatalog(repo, 'local:native', runtime, plan) + + expect(plan.calls).toBe(3) + expect(back.observation?.outcome).toEqual(rows('/repos/app', '/repos/app-new')) + }) + + it('lets a request admitted for a replaced runtime neither list nor retire the live one', async () => { + let live = { repoPath: '/repos/app', runtimeKey: 'local:native' } + setWorktreeCatalogRouteResolver(() => live) + const plan = scanner([rows('/repos/app')]) + await readWorktreeCatalog(repo, 'local:native', runtime, plan) + + const delayed = await readWorktreeCatalog(repo, 'local:wsl:Ubuntu', runtime, plan) + const current = await readWorktreeCatalog(repo, 'local:native', runtime, plan) + + expect(delayed).toEqual({ observation: null, superseded: true }) + expect(current.superseded).toBe(false) + expect(plan.calls).toBe(1) + live = { repoPath: '/repos/app-moved', runtimeKey: 'local:native' } + retireObsoleteWorktreeCatalogs() + expect(await readWorktreeCatalog(repo, 'local:native', runtime, plan)).toMatchObject({ + superseded: true + }) + expect(plan.calls).toBe(1) + }) + + it('retires an idle owner when a route input or WSL discovery answer changes, with no reader', async () => { + let live: { repoPath: string; runtimeKey: string } | null = { + repoPath: '/repos/app', + runtimeKey: 'local:default' + } + setWorktreeCatalogRouteResolver(() => live) + const plan = scanner([rows('/repos/app')]) + await readWorktreeCatalog(repo, 'local:default', runtime, plan) + expect(_getWorktreeCatalogOwnerSizeForTests()).toBe(1) + + live = { repoPath: '/repos/app', runtimeKey: 'local:wsl:Ubuntu' } + notifyWslDiscoveryChanged() + expect(_getWorktreeCatalogOwnerSizeForTests()).toBe(0) + + live = { repoPath: '/repos/app', runtimeKey: 'local:default' } + await readWorktreeCatalog(repo, 'local:default', runtime, plan) + live = null + markWorktreeRouteInputsChanged() + await Promise.resolve() + expect(_getWorktreeCatalogOwnerSizeForTests()).toBe(0) + }) + + it('keeps a scan that outlived its repo path out of the live catalog', async () => { + let live = { repoPath: '/repos/app', runtimeKey: 'local:default' } + setWorktreeCatalogRouteResolver(() => live) + const plan = scanner([rows('/repos/app')]) + plan.gate = true + const held = readWorktreeCatalog(repo, 'local:default', runtime, plan) + live = { repoPath: '/repos/app-renamed', runtimeKey: 'local:default' } + plan.release() + + expect((await held).superseded).toBe(true) + expect(plan.calls).toBe(1) + }) + + it('reuses a mismatching verification probe as the rescan fingerprint', async () => { + let fingerprint = 'fingerprint-1' + const probe = vi.fn(() => Promise.resolve(fingerprint)) + const verifier = { ceilingMs: 300_000, timeoutMs: 1_000, probe } + const plan = scanner([rows('/repos/app'), rows('/repos/app', '/repos/app-new')]) + await readWorktreeCatalog(repo, 'local:default', { ...runtime, verifier }, plan) + vi.advanceTimersByTime(31_000) + fingerprint = 'fingerprint-2' + + await readWorktreeCatalog(repo, 'local:default', { ...runtime, verifier }, plan) + + expect(plan.calls).toBe(2) + expect(probe).toHaveBeenCalledTimes(2) + }) + + it('returns an unclaimed hygiene claim when a newer observation replaces it', async () => { + const release = vi.fn() + const plan = { + ...scanner([rows('/repos/app')]), + captureWitness: () => ({ + authorizedRootsRevision: 1, + rootsRevision: 1, + hygieneDue: true, + release + }) + } + await readWorktreeCatalog(repo, 'local:default', desktop, plan) + invalidateWorktreeCatalogForRepo(repo.id) + + await readWorktreeCatalog(repo, 'local:default', desktop, plan) + + expect(release).toHaveBeenCalledTimes(1) + }) +}) diff --git a/src/main/workspaces/catalog/repo-worktree-catalog-owner.ts b/src/main/workspaces/catalog/repo-worktree-catalog-owner.ts new file mode 100644 index 00000000000..fe2778f0032 --- /dev/null +++ b/src/main/workspaces/catalog/repo-worktree-catalog-owner.ts @@ -0,0 +1,325 @@ +import type { Repo } from '../../../shared/repo-types' +import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { areWorktreePathsEqual } from '../../git/worktrees/catalog/worktree-path-comparison' +import { onWorktreeScanGenerationBump } from '../../git/worktrees/catalog/worktree-scan-cache' +import { preserveFolderUpgradeWorktreePath } from './folder-upgrade-worktree-path' +import type { + WorktreeCatalogOutcome, + WorktreeCatalogObservation, + WorktreeCatalogFlightPlan, + WorktreeCatalogRequirement, + WorktreeCatalogRead +} from './repo-worktree-catalog-observation' +import { + getLocalWorktreeScanGeneration, + isLocalWorktreeScanGenerationCurrent, + onWorktreeRouteInputsChanged +} from './local-worktree-scan-generation' +import { + isLiveWorktreeCatalogRoute, + setWorktreeCatalogRouteResolver +} from './repo-worktree-catalog-route' +import { verify } from './repo-worktree-catalog-verification' +import { onWslDiscoveryChanged } from '../../wsl/discovery/wsl-discovery-change' + +type Flight = { + revision: number + promise: Promise +} + +type Entry = { + repoId: string + hostId: string + repoPath: string + runtimeKey: string + revision: number + retired: boolean + success: WorktreeCatalogObservation | null + failure: WorktreeCatalogObservation | null + flight: Flight | null +} + +const entries = new Map() + +onWorktreeScanGenerationBump((repoPath) => invalidateWorktreeCatalogForRepoPath(repoPath)) +// Route-changing writes and WSL discovery answers retire obsolete owners even when no reader follows. +onWorktreeRouteInputsChanged(() => retireObsoleteWorktreeCatalogs()) +onWslDiscoveryChanged(() => retireObsoleteWorktreeCatalogs()) +const entryByObservation = new WeakMap() + +/** Owner identity: repo, host and the project runtime that runs Git (distro, selected Git, repair state). */ +function entryKey(repoId: string, hostId: string, runtimeKey: string): string { + return `${repoId}\0${hostId}\0${runtimeKey}` +} + +function releaseWitness(observation: WorktreeCatalogObservation | null): void { + const witness = observation?.witness + if (witness) { + observation.witness = undefined + witness.release() + } +} + +function retireEntry(key: string, entry: Entry): void { + entries.delete(key) + entry.retired = true + entry.revision += 1 + releaseWitness(entry.success) +} + +function isLive(entry: Entry): boolean { + return ( + !entry.retired && + isLiveWorktreeCatalogRoute(entry.repoId, entry.hostId, { + repoPath: entry.repoPath, + runtimeKey: entry.runtimeKey + }) + ) +} + +/** The owner for a live route; only a live route may create it or retire the repo's other routes. */ +function resolveEntry(repo: Repo, runtimeKey: string): Entry { + const hostId = getRepoExecutionHostId(repo) + const key = entryKey(repo.id, hostId, runtimeKey) + const scope = entryKey(repo.id, hostId, '') + for (const [candidateKey, candidate] of entries) { + // One project runtime runs a repo's Git at a time; rows from another route are obsolete. + if ( + candidateKey.startsWith(scope) && + (candidateKey !== key || !areWorktreePathsEqual(candidate.repoPath, repo.path)) + ) { + retireEntry(candidateKey, candidate) + } + } + let entry = entries.get(key) + if (!entry) { + entry = { + repoId: repo.id, + hostId, + repoPath: repo.path, + runtimeKey, + revision: 0, + retired: false, + success: null, + failure: null, + flight: null + } + entries.set(key, entry) + } + return entry +} + +function isCurrent(entry: Entry, observation: WorktreeCatalogObservation): boolean { + return ( + observation.revision === entry.revision && + isLocalWorktreeScanGenerationCurrent(entry.repoId, observation.generation) && + isLive(entry) + ) +} + +function startFlight( + entry: Entry, + repo: Repo, + requirement: WorktreeCatalogRequirement, + plan: WorktreeCatalogFlightPlan, + pendingProbe: Promise | null +): Flight { + // Capture before Git can yield so a concurrent mutation is never stamped as observed. + const revision = entry.revision + const generation = getLocalWorktreeScanGeneration(entry.repoId) + const startedAt = Date.now() + const probe = pendingProbe ?? requirement.verifier?.probe() ?? null + const adminFingerprint = probe && probe !== 'in-flight' ? probe : null + const witness = plan.captureWitness?.() + const flight: Flight = { + revision, + promise: plan + .scan() + .catch((error: unknown): WorktreeCatalogOutcome => ({ kind: 'failed', error })) + .then((outcome) => { + const observation: WorktreeCatalogObservation = { + outcome: + outcome.kind === 'rows' + ? // Owners are per repo id, so this registration's locator cannot leak into another. + { + kind: 'rows', + worktrees: preserveFolderUpgradeWorktreePath(repo, outcome.worktrees) + } + : outcome, + startedAt, + generation, + revision, + adminFingerprint, + startedBy: requirement.kind, + witness, + confirmedAt: startedAt + } + entryByObservation.set(observation, entry) + if (entry.flight === flight) { + entry.flight = null + } + publish(entry, observation, plan) + return observation + }) + } + entry.flight = flight + return flight +} + +function publish( + entry: Entry, + observation: WorktreeCatalogObservation, + plan: WorktreeCatalogFlightPlan +): void { + const live = isLive(entry) + if (observation.outcome.kind === 'failed') { + // Like the evidence gate's own claim, a failed pass is not retried on every read (#17775); new evidence re-arms it. + observation.witness = undefined + if (live && (entry.failure?.startedAt ?? -1) <= observation.startedAt) { + entry.failure = observation + } + return + } + // An obsolete route or a newer published observation keeps late completions out. + if (!live || (entry.success?.startedAt ?? -1) > observation.startedAt) { + releaseWitness(observation) + return + } + releaseWitness(entry.success) + entry.success = observation + if (entry.failure && entry.failure.startedAt <= observation.startedAt) { + entry.failure = null + } + if (isCurrent(entry, observation)) { + plan.observed?.(observation) + } +} + +function acceptable( + observation: WorktreeCatalogObservation, + requirement: WorktreeCatalogRequirement, + now: number +): boolean { + if (requirement.needsHygieneClaim?.() && !observation.witness?.hygieneDue) { + return false + } + // Verifier confirmations are a runtime admission; other readers need a full observation that young. + const basis = requirement.verifier ? observation.confirmedAt : observation.startedAt + return now - basis <= requirement.maxAgeMs +} + +/** The sole owner of a repo's raw worktree rows: readers state what they accept and share its one flight. */ +export async function readWorktreeCatalog( + repo: Repo, + runtimeKey: string, + requirement: WorktreeCatalogRequirement, + plan: WorktreeCatalogFlightPlan +): Promise { + const hostId = getRepoExecutionHostId(repo) + // A request admitted for a route the registration has since replaced runs no Git and retires nothing. + if (!isLiveWorktreeCatalogRoute(repo.id, hostId, { repoPath: repo.path, runtimeKey })) { + const known = entries.get(entryKey(repo.id, hostId, runtimeKey))?.success ?? null + return { observation: known, superseded: true } + } + const entry = resolveEntry(repo, runtimeKey) + let last: WorktreeCatalogObservation | null = null + for (let flights = 0; flights < (requirement.overtakenFlights ?? 1); flights += 1) { + const now = Date.now() + const failure = entry.failure + if ( + requirement.reusesFailure && + failure?.startedBy === requirement.kind && + isCurrent(entry, failure) && + now - failure.startedAt <= requirement.maxAgeMs + ) { + return { observation: failure, superseded: false } + } + const success = entry.success + let pendingProbe: Promise | null = null + if (success && isCurrent(entry, success)) { + if (acceptable(success, requirement, now)) { + return { observation: success, superseded: false } + } + if (requirement.verifier && !requirement.needsHygieneClaim?.()) { + const verification = await verify(success, requirement.verifier, now) + if (verification.reuse && entry.success === success && isCurrent(entry, success)) { + success.confirmedAt = Math.max(success.confirmedAt, Date.now()) + return { observation: success, superseded: false } + } + pendingProbe = verification.reuse ? null : verification.probe + } + } + // The route can be replaced across any await; obsolete readers never start Git. + if (!isLive(entry)) { + break + } + // At most one flight per owner: a reader arriving after an invalidation waits for the + // overtaken flight, then starts the single trailing one. + last = await (entry.flight ?? startFlight(entry, repo, requirement, plan, pendingProbe)).promise + if (isCurrent(entry, last)) { + return { observation: last, superseded: false } + } + } + return { observation: last ?? entry.success, superseded: true } +} + +/** Last known observation, current or not, for last-known fallbacks and projections. */ +export function peekWorktreeCatalog( + repo: Repo, + runtimeKey: string +): { observation: WorktreeCatalogObservation; current: boolean } | null { + const entry = entries.get(entryKey(repo.id, getRepoExecutionHostId(repo), runtimeKey)) + const observation = entry?.success + if (!entry || !observation || !areWorktreePathsEqual(entry.repoPath, repo.path)) { + return null + } + return { observation, current: isCurrent(entry, observation) } +} + +/** Destructive consumers recheck this after their own awaits, with the owner's own authority rules. */ +export function isCurrentWorktreeCatalogObservation( + observation: WorktreeCatalogObservation +): boolean { + const entry = entryByObservation.get(observation) + // A newer published success supersedes this one even when nothing invalidated the owner. + return entry !== undefined && entry.success === observation && isCurrent(entry, observation) +} + +/** Stops readers from reusing settled rows; joiners of an older flight follow the next one. */ +export function invalidateWorktreeCatalogForRepo(repoId: string): void { + for (const entry of entries.values()) { + if (entry.repoId === repoId) { + entry.revision += 1 + } + } +} + +/** Git-layer mutations know only the path; every namespace listing it is stale. */ +export function invalidateWorktreeCatalogForRepoPath(repoPath: string): void { + for (const entry of entries.values()) { + if (areWorktreePathsEqual(entry.repoPath, repoPath)) { + entry.revision += 1 + } + } +} + +/** Drop owners whose repo, host, path or project runtime is no longer the live route. */ +export function retireObsoleteWorktreeCatalogs(): void { + for (const [key, entry] of entries) { + if (!isLive(entry)) { + retireEntry(key, entry) + } + } +} + +export function _resetWorktreeCatalogOwnerForTests(): void { + // Shared test workers outlive the runtime whose store registered the resolver. + setWorktreeCatalogRouteResolver(null) + for (const [key, entry] of entries) { + retireEntry(key, entry) + } +} + +export function _getWorktreeCatalogOwnerSizeForTests(): number { + return entries.size +} diff --git a/src/main/workspaces/catalog/repo-worktree-catalog-route.ts b/src/main/workspaces/catalog/repo-worktree-catalog-route.ts new file mode 100644 index 00000000000..5bc7daebc84 --- /dev/null +++ b/src/main/workspaces/catalog/repo-worktree-catalog-route.ts @@ -0,0 +1,30 @@ +import { areWorktreePathsEqual } from '../../git/worktrees/catalog/worktree-path-comparison' + +/** Where a registered repo's Git runs right now: its path and project-runtime cache key. */ +export type WorktreeCatalogRoute = Readonly<{ repoPath: string; runtimeKey: string }> + +type RouteResolver = (repoId: string, hostId: string) => WorktreeCatalogRoute | null + +let resolveLiveRoute: RouteResolver | null = null + +/** The live registration decides which route is authoritative, never whichever request arrives last. */ +export function setWorktreeCatalogRouteResolver(resolver: RouteResolver | null): void { + resolveLiveRoute = resolver +} + +/** Without a registered store every request is taken as live (isolated unit callers). */ +export function isLiveWorktreeCatalogRoute( + repoId: string, + hostId: string, + route: WorktreeCatalogRoute +): boolean { + if (!resolveLiveRoute) { + return true + } + const live = resolveLiveRoute(repoId, hostId) + return ( + live !== null && + live.runtimeKey === route.runtimeKey && + areWorktreePathsEqual(live.repoPath, route.repoPath) + ) +} diff --git a/src/main/workspaces/catalog/repo-worktree-catalog-verification.ts b/src/main/workspaces/catalog/repo-worktree-catalog-verification.ts new file mode 100644 index 00000000000..82e064d2b5f --- /dev/null +++ b/src/main/workspaces/catalog/repo-worktree-catalog-verification.ts @@ -0,0 +1,41 @@ +import type { + WorktreeCatalogObservation, + WorktreeCatalogVerifier +} from './repo-worktree-catalog-observation' + +type Verification = { reuse: true } | { reuse: false; probe: Promise | null } + +/** Reuse when a probe proves, or cannot yet disprove (#19312), that rows fingerprinted before their scan still hold. */ +export async function verify( + observation: WorktreeCatalogObservation, + verifier: WorktreeCatalogVerifier, + now: number +): Promise { + // Without a fingerprint from before its scan, no probe can certify these rows. + if ( + observation.outcome.kind !== 'rows' || + !observation.adminFingerprint || + now - observation.startedAt >= verifier.ceilingMs + ) { + return { reuse: false, probe: null } + } + const probe = verifier.probe() + if (probe === 'in-flight') { + verifier.onUnknown?.('previous probe still pending') + return { reuse: true } + } + let timer: ReturnType | undefined + const timeout = new Promise<'timeout'>((resolve) => { + timer = setTimeout(() => resolve('timeout'), verifier.timeoutMs) + }) + const current = await Promise.race([probe, timeout]).finally(() => clearTimeout(timer)) + if (current === 'timeout') { + // Unknown is not proof, but rescanning slow mounts on every read amplifies load (#19312). + verifier.onUnknown?.('probe expired') + return { reuse: true } + } + // A mismatching probe was taken before the rescan, so it becomes that scan's fingerprint. + return current !== null && (await observation.adminFingerprint) === current + ? { reuse: true } + : { reuse: false, probe } +} diff --git a/src/main/workspaces/removal/retirement/worktree-retirement-discovery.ts b/src/main/workspaces/removal/retirement/worktree-retirement-discovery.ts index 5acb7526aec..4f225990cc4 100644 --- a/src/main/workspaces/removal/retirement/worktree-retirement-discovery.ts +++ b/src/main/workspaces/removal/retirement/worktree-retirement-discovery.ts @@ -7,11 +7,11 @@ import { claudeProjectBucketNameBelowScope, mayBeHashedClaudeProjectBucketName } from '../../../ai-vault/scanners/claude/claude-project-dir-encoding' -import { CLAUDE_CWD_BUCKET_LAYOUT } from '../../../ai-vault/session-cwd-bucket-layouts' +import { CLAUDE_CWD_BUCKET_LAYOUT } from '../../../ai-vault/scope/session-cwd-bucket-layouts' import { cachedProjectDirCwd, cwdBucketScopePrefixes -} from '../../../ai-vault/session-scanner-scope-discovery' +} from '../../../ai-vault/scope/session-scanner-scope-discovery' import { wslGatedReaddir, wslGatedStat } from '../../../native-chat/wsl-transcript-fs-access' import { WslTranscriptFsError } from '../../../native-chat/wsl-transcript-fs-error' import { mapWithConcurrency } from '../../../../shared/map-with-concurrency' diff --git a/src/main/workspaces/removal/worktree-failed-removal.test.ts b/src/main/workspaces/removal/worktree-failed-removal.test.ts index dd63e11747f..53870503ea0 100644 --- a/src/main/workspaces/removal/worktree-failed-removal.test.ts +++ b/src/main/workspaces/removal/worktree-failed-removal.test.ts @@ -25,7 +25,7 @@ import { withUnregisteredRemovalCheckouts } from './worktree-removal-listing' import { readWorktreeRemovalRecords } from './worktree-removal-records' -import { loadWorktreeRemovalRecordsForStore } from '../../startup/worktree-removal-records-load' +import { loadWorktreeRemovalRecordsForStore } from '../../startup/workspace-startup/worktree-removal-records-load' const listWorktreesStrictMock = vi.hoisted(() => vi.fn(async () => [])) diff --git a/src/main/wsl/discovery/distro-catalog.ts b/src/main/wsl/discovery/distro-catalog.ts index 29b97a676f4..16bd61f45dc 100644 --- a/src/main/wsl/discovery/distro-catalog.ts +++ b/src/main/wsl/discovery/distro-catalog.ts @@ -27,6 +27,7 @@ import { type RunningWslDistroReadOptions } from './wsl-running-distro-cache' import { clearWslHomeCache, getCachedWslHome, rememberWslHome } from './wsl-home-cache' +import { notifyWslDiscoveryChanged } from './wsl-discovery-change' // Measured on a slow PC: a cold systemd distro takes 4-11 s to answer its first exec, and killing // wsl.exe mid-boot leaves the distro failing every call with Wsl/Service/E_UNEXPECTED for 14+ s. @@ -76,11 +77,16 @@ function cacheWslDistroList(rawDistros: string[], probeSequence: number): string if (userDistros.length === 0 && wslDistroCache !== null && wslDistroCache.length > 0) { return wslDistroCache } + wslDistroCacheSequence = probeSequence + const changed = wslDistroCache?.join('\0') !== userDistros.join('\0') + wslDistroCache = userDistros + // After the list is written, so route reconciliation never sees half-updated discovery. if (userDistros.length > 0) { dropStaleWslAvailabilityFailure() } - wslDistroCacheSequence = probeSequence - wslDistroCache = userDistros + if (changed) { + notifyWslDiscoveryChanged() + } if (wslDistroCache.length === 0) { armWslDistroListRetry() } diff --git a/src/main/wsl/discovery/wsl-availability.ts b/src/main/wsl/discovery/wsl-availability.ts index e370b0a62f8..0ced1f39a0f 100644 --- a/src/main/wsl/discovery/wsl-availability.ts +++ b/src/main/wsl/discovery/wsl-availability.ts @@ -2,6 +2,7 @@ import { runProcess } from '@orca/process-host' import type { ProcessResult, ProcessSpec } from '@orca/process-host/process-spec' import { buildWslExecArgs } from '../../../shared/wsl-login-shell-command' import { wslExeProcessSpec } from '../execution/wsl-exe-process' +import { notifyWslDiscoveryChanged } from './wsl-discovery-change' type WslAvailabilityCache = | { available: true } @@ -52,8 +53,12 @@ function previousWslAvailabilityFailures(): number { } function writeWslAvailabilityCache(cache: WslAvailabilityCache | null): void { + const changed = (wslAvailableCache?.available ?? null) !== (cache?.available ?? null) wslAvailableCache = cache wslAvailabilityCacheGeneration += 1 + if (changed) { + notifyWslDiscoveryChanged() + } } type WslProbeFailure = { retryable: boolean } @@ -157,6 +162,7 @@ export function dropStaleWslAvailabilityFailure(): void { wslAvailabilityCacheGeneration += 1 if (wslAvailableCache && !wslAvailableCache.available && !('unsupported' in wslAvailableCache)) { wslAvailableCache = null + notifyWslDiscoveryChanged() } } diff --git a/src/main/wsl/discovery/wsl-discovery-change.ts b/src/main/wsl/discovery/wsl-discovery-change.ts new file mode 100644 index 00000000000..0b8dea5b201 --- /dev/null +++ b/src/main/wsl/discovery/wsl-discovery-change.ts @@ -0,0 +1,24 @@ +const listeners = new Set<() => void>() +let revision = 0 + +/** Runtime resolution reads the WSL discovery caches, so a changed answer can move a repo's Git route. */ +export function onWslDiscoveryChanged(listener: () => void): void { + listeners.add(listener) +} + +export function getWslDiscoveryRevision(): number { + return revision +} + +/** Synchronous: owners must stop trusting a route the new answer replaced before anything else runs. */ +export function notifyWslDiscoveryChanged(): void { + revision += 1 + for (const listener of listeners) { + try { + listener() + } catch (error) { + // A listener failure must not break the discovery write that notified it. + console.warn('[wsl] discovery change listener failed:', error) + } + } +} diff --git a/src/main/wsl/orcad/wsl-orcad-liveness-supervisor.test.ts b/src/main/wsl/orcad/wsl-orcad-liveness-supervisor.test.ts index 234c3ad0ed5..21922570d8d 100644 --- a/src/main/wsl/orcad/wsl-orcad-liveness-supervisor.test.ts +++ b/src/main/wsl/orcad/wsl-orcad-liveness-supervisor.test.ts @@ -5,19 +5,7 @@ import type { WslRunningDistrosRead } from '../discovery/wsl-background-distro-g import type { WslGuestIdentity } from '../execution/wsl-guest-process-identity' import type { WslOrcadConnection } from './wsl-orcad-connection-types' import type { WslOrcadConnectionStatus } from './wsl-orcad-connection-status' -import { EXIT_SETTLE_MS } from './wsl-orcad-liveness-evidence' -import { WSL_ORCAD_HEARTBEAT_MS } from './wsl-orcad-liveness-state' -import { WSL_ORCAD_IDLE_VERIFY_MS } from './wsl-orcad-liveness-monitor' -import { - WslDistroNotRunningError, - WslDistroUnverifiableConnectError -} from './wsl-orcad-connection-errors' import { WslOrcadLivenessSupervisor } from './wsl-orcad-liveness-supervisor' -import { WSL_ORCAD_RECONNECT_DELAYS_MS } from './wsl-orcad-reconnect-backoff' -import { - WSL_ORCAD_STOPPING_POLL_MS, - WSL_ORCAD_STOPPING_WINDOW_MS -} from './wsl-orcad-liveness-stopping-poll' import type { WslOrcadWatch } from './wsl-orcad-watch' const CENSUS: OrcadTerminalCensus = { @@ -220,166 +208,6 @@ describe('WslOrcadLivenessSupervisor', () => { expect(h.statuses.at(-1)).toEqual({ state: 'ready', census: CENSUS }) }) - it('reports settling right after an exit, while the running list may be stale (E9)', async () => { - const h = harness({ visible: true }) - await h.supervisor.connect('Ubuntu') - expect(h.supervisor.isSettling('Ubuntu')).toBe(false) - // WSL still lists the stopping distro as running. - h.state.running = { status: 'confirmed', distros: ['Ubuntu'] } - h.lastWatch().exit(1) - expect(h.supervisor.isSettling('Ubuntu')).toBe(true) - h.state.running = { status: 'confirmed', distros: [] } - await h.advance(60_000) - expect(h.statuses.at(-1)).toMatchObject({ state: 'distro-stopped' }) - expect(h.supervisor.isSettling('Ubuntu')).toBe(false) - }) - - it('re-verifies after a no-boot connect is refused, so the distro still gets a verdict (E9)', async () => { - const h = harness({ visible: true }) - await h.supervisor.connect('Ubuntu') - h.state.running = { status: 'confirmed', distros: [] } - h.state.ensureFails = 1 - h.state.ensureError = new WslDistroNotRunningError('Ubuntu') - await expect(h.supervisor.connect('Ubuntu', { noBoot: true })).rejects.toBeInstanceOf( - WslDistroNotRunningError - ) - await h.advance(60_000) - expect(h.statuses.at(-1)).toMatchObject({ state: 'distro-stopped' }) - }) - - it('re-verifies, never arms, when a no-boot connect could not read the running list (E9)', async () => { - const h = harness({ visible: true }) - await h.supervisor.connect('Ubuntu') - const watches = h.watchCount() - h.state.running = { status: 'confirmed', distros: [] } - h.state.ensureFails = 1 - h.state.ensureError = new WslDistroUnverifiableConnectError('Ubuntu') - await expect(h.supervisor.connect('Ubuntu', { noBoot: true })).rejects.toBeInstanceOf( - WslDistroUnverifiableConnectError - ) - expect(h.watchCount()).toBe(watches) - await h.advance(60_000) - expect(h.statuses.at(-1)).toMatchObject({ state: 'distro-stopped' }) - }) - - it('reports settling after a clean exit too (code 0 from wsl --shutdown)', async () => { - const h = harness({ visible: true }) - await h.supervisor.connect('Ubuntu') - h.state.running = { status: 'confirmed', distros: ['Ubuntu'] } - h.lastWatch().exit(0) - // Past the verdict pass (settle and re-read), the window after the exit still holds. - await h.advance(1_000) - expect(h.supervisor.isSettling('Ubuntu')).toBe(true) - await h.advance(10_000) - expect(h.supervisor.isSettling('Ubuntu')).toBe(false) - }) - - it('settles a clean exit before reading identity, so a stale list cannot boot the distro', async () => { - const h = harness({ visible: true }) - await h.supervisor.connect('Ubuntu') - const identityReads = h.readIdentity.mock.calls.length - // wsl --shutdown ends the watch cleanly while WSL still lists the distro for a moment. - h.state.running = { status: 'confirmed', distros: [] } - h.readRunning.mockResolvedValueOnce({ status: 'confirmed', distros: ['Ubuntu'] }) - h.lastWatch().exit(0) - await h.advance(60_000) - expect(h.statuses.at(-1)).toMatchObject({ state: 'distro-stopped' }) - // Never exec'd into the stopping distro. - expect(h.readIdentity).toHaveBeenCalledTimes(identityReads) - }) - - it('re-ensures the holder once a connect is armed', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - // An earlier orcad's idle release may have ended the holder the launch adopted. - expect(h.ensureHolder).toHaveBeenCalledExactlyOnceWith('Ubuntu') - }) - - it('never boots a stopped distro for background work; the gate resumes it once running', async () => { - const h = harness({ visible: false }) - await h.supervisor.connect('Ubuntu') - h.ensureHolder.mockClear() - h.state.running = { status: 'confirmed', distros: [] } - h.lastWatch().exit(1) - await h.advance(60_000) - expect(h.statuses).toEqual([ - { state: 'distro-stopped', terminals: 'exited', recovering: false } - ]) - expect(h.ensure).toHaveBeenCalledTimes(1) - expect(h.ensureHolder).not.toHaveBeenCalled() - // A dial to a kept listener would spawn wsl.exe and boot the stopped distro. - expect(h.retireListener).toHaveBeenCalledExactlyOnceWith('Ubuntu') - expect(h.deferred).toHaveLength(1) - // The user started it some other way: the distro restarted, so relaunch into it. - h.state.running = { status: 'confirmed', distros: ['Ubuntu'] } - h.state.identity = { distroInstance: 'boot:2', orcad: null } - h.deferred[0]() - await h.advance(5_000) - expect(h.ensure).toHaveBeenCalledTimes(2) - expect(h.statuses.at(-1)).toEqual({ state: 'ready', census: CENSUS }) - }) - - it('relaunches a crashed orcad and runs the census before reporting ready', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - h.state.identity = { distroInstance: 'boot:1', orcad: null } - h.lastWatch().exit(0) - // The distro stays listed: the list is watched through the stopping window before any exec. - await h.advance(5_000 + WSL_ORCAD_STOPPING_WINDOW_MS) - const states = h.statuses.map((status) => - status.state === 'reconnecting' ? `${status.state}:${status.reason}` : status.state - ) - expect(states).toEqual([ - 'reconnecting:orcad-exited', - 'reconnecting:orcad-exited', - 'reconnecting:census', - 'ready' - ]) - expect(h.statuses[0]).toMatchObject({ terminals: 'unverifiable' }) - expect(h.collectCensus).toHaveBeenCalledTimes(1) - }) - - it('keeps watching the incumbent when an update connect fails', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - h.state.ensureFails = 1 - await expect(h.supervisor.connect('Ubuntu', { intent: 'force' })).rejects.toThrow( - 'relaunch failed' - ) - expect(h.ensure).toHaveBeenLastCalledWith('Ubuntu', { intent: 'force' }) - expect(h.watches).toHaveLength(2) - expect(h.lastWatch().closed).toBe(false) - }) - - it('recovery reconnects only into a distro it confirms running right before spawning (E9)', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - h.state.identity = { distroInstance: 'boot:1', orcad: null } - h.lastWatch().exit(1) - await h.advance(60_000) - const recoveryCalls = h.ensure.mock.calls.slice(1) - expect(recoveryCalls.length).toBeGreaterThan(0) - for (const [, opts] of recoveryCalls) { - expect(opts).toMatchObject({ requireRunning: h.requireRunning }) - } - // Its backoff gate reads too: every read names the distro, so the wiring can settle it. - for (const [target] of h.readRunning.mock.calls) { - expect(target).toMatchObject({ distro: 'Ubuntu' }) - } - }) - - it('reports ready itself when a user connect supersedes a recovery', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - h.state.identity = { distroInstance: 'boot:1', orcad: null } - h.lastWatch().exit(0) - // A clean exit is settled (and the list watched) before the verdict, as a failed one is. - await h.advance(EXIT_SETTLE_MS + WSL_ORCAD_STOPPING_WINDOW_MS) - expect(h.statuses.at(-1)).toMatchObject({ state: 'reconnecting' }) - await h.supervisor.connect('Ubuntu') - expect(h.statuses.at(-1)).toEqual({ state: 'ready', census: null }) - }) - it('never reports ready or holds the distro on a wake after the listener was retired', async () => { const h = harness({ visible: false }) // No pid file at arm: the port is the only liveness evidence. @@ -399,201 +227,6 @@ describe('WslOrcadLivenessSupervisor', () => { expect(h.ensure).toHaveBeenCalledTimes(1) }) - it('leaves an orcad nobody uses stopped instead of undoing its idle exit', async () => { - const h = harness({ visible: false }) - await h.supervisor.connect('Ubuntu') - h.state.identity = { distroInstance: 'boot:1', orcad: null } - h.lastWatch().exit(0) - await h.advance(60_000) - expect(h.statuses).toEqual([{ state: 'idle', terminals: 'unverifiable' }]) - expect(h.ensure).toHaveBeenCalledTimes(1) - expect(h.retireListener).toHaveBeenCalledExactlyOnceWith('Ubuntu') - }) - - it('reattaches the watch when orcad is still the same process', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - h.lastWatch().exit(0) - await h.advance(EXIT_SETTLE_MS + WSL_ORCAD_STOPPING_WINDOW_MS) - expect(h.statuses).toEqual([]) - expect(h.watches).toHaveLength(2) - expect(h.ensure).toHaveBeenCalledTimes(1) - }) - - it('reports unverifiable, never exited, when the running list cannot be read, and keeps looking', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - h.state.running = { status: 'unavailable' } - h.lastWatch().exit(1) - await h.advance(0) - expect(h.statuses).toEqual([ - { state: 'unverifiable', reason: 'running-list-unavailable', terminals: 'unverifiable' } - ]) - await h.advance(120_000) - expect(h.statuses.every((status) => status.state === 'unverifiable')).toBe(true) - expect(h.ensure).toHaveBeenCalledTimes(1) - const reads = h.readRunning.mock.calls.length - expect(reads).toBeGreaterThan(3) - h.state.running = { status: 'confirmed', distros: ['Ubuntu'] } - await h.advance(30_000) - expect(h.statuses.at(-1)).toEqual({ state: 'ready', census: null }) - }) - - it('re-reads after the settle only from a probe started once the exit has settled', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - h.jumpClock(1_000) - const exitedAt = h.clock() - h.lastWatch().exit(1) - await h.advance(EXIT_SETTLE_MS) - // A list probe begun inside the window may still show the stopping distro; it must not answer. - expect(h.readRunning).toHaveBeenNthCalledWith(2, { distro: 'Ubuntu', exitedAt }) - }) - - it('waits for a still-listed distro to settle after a failed exit before probing inside it', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - h.lastWatch().exit(1) - await h.settle() - expect(h.readRunning).toHaveBeenCalledTimes(1) - h.state.running = { status: 'confirmed', distros: [] } - await h.advance(500) - expect(h.readIdentity).toHaveBeenCalledTimes(1) - expect(h.statuses[0]).toMatchObject({ state: 'distro-stopped' }) - }) - - it('gives up after the bounded ladder and says so', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - h.state.identity = { distroInstance: 'boot:1', orcad: null } - h.state.ensureFails = 100 - h.lastWatch().exit(0) - await h.advance(10 * 60_000) - expect(h.ensure).toHaveBeenCalledTimes(1 + WSL_ORCAD_RECONNECT_DELAYS_MS.length) - expect(h.statuses.at(-1)).toMatchObject({ state: 'failed', terminals: 'unverifiable' }) - }) - - it('re-verifies on power resume instead of trusting its timers, but not on subscribe', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - expect(h.readRunning).not.toHaveBeenCalled() - h.power()?.onSuspend() - await h.advance(WSL_ORCAD_HEARTBEAT_MS * 3) - expect(h.readRunning).not.toHaveBeenCalled() - h.state.identity = { distroInstance: 'boot:9', orcad: null } - h.power()?.onResume() - await h.advance(0) - expect(h.readIdentity).toHaveBeenCalledTimes(2) - expect(h.statuses[0]).toMatchObject({ state: 'reconnecting', reason: 'distro-restarted' }) - }) - - it('heartbeats with the running list only, and re-ensures the holder while running', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - await h.advance(WSL_ORCAD_HEARTBEAT_MS) - expect(h.readRunning).toHaveBeenCalledTimes(1) - expect(h.readIdentity).toHaveBeenCalledTimes(1) - expect(h.ensureHolder).toHaveBeenCalledWith('Ubuntu') - }) - - it('verifies fully on a heartbeat while its watch holds no open socket to prove orcad', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - // The desktop's sockets are all closed: the watch proves nothing, so ask the guest. - h.state.watchProves = false - await h.advance(WSL_ORCAD_HEARTBEAT_MS) - expect(h.readIdentity).toHaveBeenCalledTimes(2) - // Same orcad: still ready, no verdict change. - expect(h.statuses.filter((status) => status.state !== 'ready')).toEqual([]) - }) - - it('bounds detection to the idle verify period while no desktop socket is open', async () => { - const h = harness() - h.state.watchProves = false - await h.supervisor.connect('Ubuntu') - const reads = h.readIdentity.mock.calls.length - await h.advance(WSL_ORCAD_IDLE_VERIFY_MS - 1) - expect(h.readIdentity).toHaveBeenCalledTimes(reads) - await h.advance(1) - expect(h.readIdentity).toHaveBeenCalledTimes(reads + 1) - await h.advance(WSL_ORCAD_IDLE_VERIFY_MS) - expect(h.readIdentity).toHaveBeenCalledTimes(reads + 2) - // With a socket open again, ticks go back to the heartbeat's cheap running-list read. - h.state.watchProves = true - await h.advance(WSL_ORCAD_IDLE_VERIFY_MS + WSL_ORCAD_HEARTBEAT_MS) - expect(h.readIdentity).toHaveBeenCalledTimes(reads + 2) - }) - - it('brings the next full check forward when the last desktop socket closes normally', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - const reads = h.readIdentity.mock.calls.length - await h.advance(WSL_ORCAD_HEARTBEAT_MS / 2) - // The desktop closed its last socket: nothing proves orcad until the next check. - h.state.watchProves = false - h.lastWatch().idle() - await h.advance(WSL_ORCAD_IDLE_VERIFY_MS - 1) - expect(h.readIdentity).toHaveBeenCalledTimes(reads) - await h.advance(1) - expect(h.readIdentity).toHaveBeenCalledTimes(reads + 1) - }) - - it('treats a socket orcad closed for another reason as a verify, not a verdict', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - // A watch riding the desktop's sockets reports no exit code. - h.lastWatch().exit(null) - await h.advance(5_000 + WSL_ORCAD_STOPPING_WINDOW_MS) - expect(h.readIdentity).toHaveBeenCalledTimes(2) - expect(h.statuses.filter((status) => status.state !== 'ready')).toEqual([]) - expect(h.ensure).toHaveBeenCalledTimes(1) - expect(h.watches).toHaveLength(2) - }) - - it('treats a heartbeat far past due as a pause and verifies fully', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - h.jumpClock(WSL_ORCAD_HEARTBEAT_MS * 5) - await h.advance(0) - expect(h.readIdentity).toHaveBeenCalledTimes(2) - }) - - it('ignores wall-clock jumps entirely', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - vi.useFakeTimers({ toFake: ['Date'] }) - try { - vi.setSystemTime(Date.now() + 7 * 24 * 3_600_000) - await h.advance(1_000) - vi.setSystemTime(Date.now() - 30 * 24 * 3_600_000) - await h.advance(1_000) - } finally { - vi.useRealTimers() - } - expect(h.readRunning).not.toHaveBeenCalled() - expect(h.statuses).toEqual([]) - }) - - it('stops supervising on stop, closing the watch and ignoring late exits', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - const watch = h.lastWatch() - await h.supervisor.stop('Ubuntu') - expect(watch.closed).toBe(true) - watch.exit(1) - await h.advance(60_000) - expect(h.readRunning).not.toHaveBeenCalled() - }) - - it('treats a holder exit like a bridge exit', async () => { - const h = harness({ visible: false }) - await h.supervisor.connect('Ubuntu') - h.state.running = { status: 'confirmed', distros: [] } - h.supervisor.noteHolderExit('UBUNTU', { code: 1 }) - await h.advance(0) - expect(h.statuses[0]).toMatchObject({ state: 'distro-stopped', terminals: 'exited' }) - }) - it('lets a user connect supersede the deferred re-check of a stopped distro', async () => { const h = harness({ visible: false }) await h.supervisor.connect('Ubuntu') @@ -608,77 +241,4 @@ describe('WslOrcadLivenessSupervisor', () => { expect(h.ensure).toHaveBeenCalledTimes(2) expect(h.statuses.map((status) => status.state)).toEqual(['distro-stopped', 'ready']) }) - - it('reports a stop once when both the holder and the watch exit', async () => { - const h = harness({ visible: false }) - await h.supervisor.connect('Ubuntu') - h.state.running = { status: 'confirmed', distros: [] } - h.supervisor.noteHolderExit('Ubuntu', { code: 1 }) - h.lastWatch().exit(1) - await h.advance(1_000) - expect(h.statuses.map((status) => status.state)).toEqual(['distro-stopped']) - }) - - describe('after an exit, while the distro may still be stopping (E9)', () => { - const STOPPED: WslRunningDistrosRead = { status: 'confirmed', distros: [] } - - it('publishes distro-stopped within a poll of the list dropping it, never exec-ing into it', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - const identityReads = h.readIdentity.mock.calls.length - h.lastWatch().exit(null) - await h.advance(EXIT_SETTLE_MS + 2_000) - // Still listed mid-window: only the list was read, nothing ran inside the distro. - expect(h.readIdentity).toHaveBeenCalledTimes(identityReads) - expect(h.statuses).toEqual([]) - - h.state.running = STOPPED - await h.advance(WSL_ORCAD_STOPPING_POLL_MS) - expect(h.statuses).toEqual([ - { state: 'distro-stopped', terminals: 'exited', recovering: false } - ]) - expect(h.readIdentity).toHaveBeenCalledTimes(identityReads) - }) - - it('falls back to the identity check once the window ends with the distro still listed', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - const identityReads = h.readIdentity.mock.calls.length - h.supervisor.noteHolderExit('Ubuntu', { code: 1 }) - await h.advance(EXIT_SETTLE_MS + WSL_ORCAD_STOPPING_WINDOW_MS - WSL_ORCAD_STOPPING_POLL_MS) - expect(h.readIdentity).toHaveBeenCalledTimes(identityReads) - await h.advance(WSL_ORCAD_STOPPING_POLL_MS) - expect(h.readIdentity).toHaveBeenCalledTimes(identityReads + 1) - expect(h.statuses).toEqual([]) - }) - - it('adds no running-list reads to heartbeats while the distro runs', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - await h.advance(WSL_ORCAD_HEARTBEAT_MS * 3) - expect(h.readRunning).toHaveBeenCalledTimes(3) - }) - - it('ends a recovery backoff when the distro then stops, rather than wait it out', async () => { - const h = harness() - await h.supervisor.connect('Ubuntu') - // orcad crashed and keeps failing to relaunch: recovery sits in a long backoff. - h.state.identity = { distroInstance: 'boot:1', orcad: null } - h.state.ensureFails = 100 - h.lastWatch().exit(0) - await h.advance(EXIT_SETTLE_MS + WSL_ORCAD_STOPPING_WINDOW_MS + 8_000) - const waiting = h.statuses.at(-1) - expect(waiting).toMatchObject({ state: 'reconnecting' }) - expect(waiting && 'retryInMs' in waiting ? waiting.retryInMs : 0).toBeGreaterThan(2_000) - - h.state.running = STOPPED - h.supervisor.noteHolderExit('Ubuntu', { code: 1 }) - await h.advance(EXIT_SETTLE_MS + 100) - expect(h.statuses.at(-1)).toEqual({ - state: 'distro-stopped', - terminals: 'exited', - recovering: false - }) - }) - }) }) diff --git a/src/preload/api/gh-bridge-mutations-and-projects.ts b/src/preload/api/gh-bridge-mutations-and-projects.ts index a057485be6d..ecc75e119e9 100644 --- a/src/preload/api/gh-bridge-mutations-and-projects.ts +++ b/src/preload/api/gh-bridge-mutations-and-projects.ts @@ -1,13 +1,14 @@ -import type { GhAccountBinding } from '../../shared/github/account-binding' +import type { GhAccountBinding } from '../../shared/github/accounts/account-binding' import { ipcRenderer } from 'electron' -import type { GitHubCommentResult } from '../../shared/github/comment-types' -import type { GitHubAssignableUser, GitHubOwnerRepo } from '../../shared/github/pull-request-types' -import type { GetRateLimitResult } from '../../shared/github/rate-limit-types' +import type { GitHubCommentResult } from '../../shared/github/comments/comment-types' +import type { GitHubAssignableUser } from '../../shared/github/pull-requests/pull-request-types' +import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../../shared/github/repositories/repository-identity' +import type { GetRateLimitResult } from '../../shared/github/api/rate-limit-types' import type { GhAccountBindingInventory, GhAccountBindingValidationResult, GhAuthDiagnostic -} from '../../shared/github/auth-types' +} from '../../shared/github/accounts/auth-types' import type { TaskSourceContext } from '../../shared/work-items/task-source-context' import type { GetProjectViewTableResult, @@ -20,7 +21,7 @@ import type { ListProjectViewsResult, ProjectWorkItemDetailsBySlugResult, ResolveProjectRefResult -} from '../../shared/github/project-result-types' +} from '../../shared/github/projects/project-result-types' import type { AddIssueCommentBySlugArgs, ClearProjectItemFieldArgs, @@ -38,7 +39,7 @@ import type { UpdateIssueTypeBySlugArgs, UpdatePullRequestBySlugArgs, UpdateProjectItemFieldArgs -} from '../../shared/github/project-request-types' +} from '../../shared/github/projects/project-request-types' import type { AppStarSource } from '../../shared/gh-star-source' import type { PreloadApi } from '../api-types' diff --git a/src/preload/api/gh-bridge-pull-requests-and-work-items.ts b/src/preload/api/gh-bridge-pull-requests-and-work-items.ts index 5d57a2c2dda..9c9eaa5efa0 100644 --- a/src/preload/api/gh-bridge-pull-requests-and-work-items.ts +++ b/src/preload/api/gh-bridge-pull-requests-and-work-items.ts @@ -1,13 +1,16 @@ -import type { GhAccountBinding } from '../../shared/github/account-binding' +import type { GhAccountBinding } from '../../shared/github/accounts/account-binding' import { ipcRenderer } from 'electron' -import type { GitHubReactionContent } from '../../shared/github/comment-types' +import type { GitHubReactionContent } from '../../shared/github/comments/comment-types' import type { GitHubPRRefreshCandidate, GitHubPRRefreshEvent, GitHubPRRefreshReason -} from '../../shared/github/pull-request-refresh-types' -import type { GitHubOwnerRepo } from '../../shared/github/pull-request-types' -import type { GitHubWorkItem, ListWorkItemsResult } from '../../shared/github/work-item-types' +} from '../../shared/github/pull-requests/refresh/pull-request-refresh-types' +import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../../shared/github/repositories/repository-identity' +import type { + GitHubWorkItem, + ListWorkItemsResult +} from '../../shared/github/work-items/work-item-types' import type { GitHubCreateIssueResult } from '../../shared/issue-mutation-types' import type { TaskSourceContext } from '../../shared/work-items/task-source-context' import type { PreloadApi } from '../api-types' diff --git a/src/preload/api/git-bridge.ts b/src/preload/api/git-bridge.ts index 58607ebc9e1..e2d8ed47d92 100644 --- a/src/preload/api/git-bridge.ts +++ b/src/preload/api/git-bridge.ts @@ -10,6 +10,7 @@ import type { import type { GitStagingArea, GitUpstreamStatus } from '../../shared/git/status/git-status-types' import type { ConflictResolution } from '../../shared/source-control/listing/source-control-entry-actions' import type { GitPushTarget } from '../../shared/worktree/types' +import type { WorktreeAtRiskLocalFiles } from '../../shared/worktree/at-risk-local-files' import type { GitStageWorktreeScope } from '../../shared/git/paths/git-stage-worktree-scope' import type { GitHistoryItemRef, @@ -50,6 +51,10 @@ export const gitApi = { paths: string[] connectionId?: string }): Promise => ipcRenderer.invoke('git:checkIgnored', args), + atRiskLocalFiles: (args: { + worktreePath: string + connectionId?: string + }): Promise => ipcRenderer.invoke('git:atRiskLocalFiles', args), findHugeFoldersToIgnore: (args: { worktreePath: string }): Promise => ipcRenderer.invoke('git:findHugeFoldersToIgnore', args), appendGitignore: (args: { worktreePath: string; folderName: string }): Promise => diff --git a/src/preload/api/git-inspection-api.ts b/src/preload/api/git-inspection-api.ts index 7fa8d767a28..939cc7a9a88 100644 --- a/src/preload/api/git-inspection-api.ts +++ b/src/preload/api/git-inspection-api.ts @@ -11,6 +11,7 @@ import type { GitUpstreamStatus } from '../../shared/git/status/git-status-types' import type { GitPushTarget } from '../../shared/worktree/types' +import type { WorktreeAtRiskLocalFiles } from '../../shared/worktree/at-risk-local-files' import type { GitHistoryItemRef, GitHistoryOptions, @@ -56,6 +57,10 @@ export type GitInspectionApi = { paths: string[] connectionId?: string }) => Promise + atRiskLocalFiles: (args: { + worktreePath: string + connectionId?: string + }) => Promise findHugeFoldersToIgnore: (args: { worktreePath: string }) => Promise refs: (args: { worktreePath: string diff --git a/src/preload/api/github-account-api.ts b/src/preload/api/github-account-api.ts index fe219d55065..4fe0a42066b 100644 --- a/src/preload/api/github-account-api.ts +++ b/src/preload/api/github-account-api.ts @@ -1,7 +1,7 @@ import type { GhAccountBindingInventory, GhAccountBindingValidationResult -} from '../../shared/github/auth-types' +} from '../../shared/github/accounts/auth-types' export type GithubAccountApi = { listBindableAccounts: (args: { diff --git a/src/preload/api/github-pull-request-api.ts b/src/preload/api/github-pull-request-api.ts index 38c8208a861..3284d2b8565 100644 --- a/src/preload/api/github-pull-request-api.ts +++ b/src/preload/api/github-pull-request-api.ts @@ -1,29 +1,29 @@ -import type { GhAccountBinding } from '../../shared/github/account-binding' +import type { GhAccountBinding } from '../../shared/github/accounts/account-binding' import type { AppStarSource } from '../../shared/gh-star-source' -import type { GhAuthDiagnostic } from '../../shared/github/auth-types' +import type { GhAuthDiagnostic } from '../../shared/github/accounts/auth-types' import type { TaskSourceContext } from '../../shared/work-items/task-source-context' -import type { PRCheckDetail, PRCheckRunDetails } from '../../shared/github/check-types' +import type { PRCheckDetail, PRCheckRunDetails } from '../../shared/github/checks/check-types' import type { GitHubCommentResult, GitHubPRReviewCommentInput, GitHubReactionContent, PRComment -} from '../../shared/github/comment-types' +} from '../../shared/github/comments/comment-types' import type { GitHubPRRefreshCandidate, GitHubPRRefreshEnqueueResult, GitHubPRRefreshEvent, GitHubPRRefreshReason, PRRefreshOutcome -} from '../../shared/github/pull-request-refresh-types' +} from '../../shared/github/pull-requests/refresh/pull-request-refresh-types' +import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../../shared/github/repositories/repository-identity' import type { - GitHubOwnerRepo, GitHubPRFile, GitHubPRFileContents, GitHubViewer, PRInfo -} from '../../shared/github/pull-request-types' -import type { GetRateLimitResult } from '../../shared/github/rate-limit-types' +} from '../../shared/github/pull-requests/pull-request-types' +import type { GetRateLimitResult } from '../../shared/github/api/rate-limit-types' import type { GitHubRepoSelectorArgs } from './github-work-item-api' export type GithubPullRequestApi = { diff --git a/src/preload/api/github-work-item-api.ts b/src/preload/api/github-work-item-api.ts index f4ce0fc4d66..e130bae0ff4 100644 --- a/src/preload/api/github-work-item-api.ts +++ b/src/preload/api/github-work-item-api.ts @@ -1,4 +1,4 @@ -import type { GhAccountBinding } from '../../shared/github/account-binding' +import type { GhAccountBinding } from '../../shared/github/accounts/account-binding' import type { GetProjectViewTableResult, GitHubProjectCommentMutationResult, @@ -10,7 +10,7 @@ import type { ListProjectViewsResult, ProjectWorkItemDetailsBySlugResult, ResolveProjectRefResult -} from '../../shared/github/project-result-types' +} from '../../shared/github/projects/project-result-types' import type { AddIssueCommentBySlugArgs, ClearProjectItemFieldArgs, @@ -28,19 +28,19 @@ import type { UpdateIssueTypeBySlugArgs, UpdateProjectItemFieldArgs, UpdatePullRequestBySlugArgs -} from '../../shared/github/project-request-types' +} from '../../shared/github/projects/project-request-types' import type { TaskSourceContext } from '../../shared/work-items/task-source-context' -import type { GitHubCommentResult } from '../../shared/github/comment-types' +import type { GitHubCommentResult } from '../../shared/github/comments/comment-types' import type { GitHubAssignableUser, - GitHubOwnerRepo, IssueInfo -} from '../../shared/github/pull-request-types' +} from '../../shared/github/pull-requests/pull-request-types' +import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../../shared/github/repositories/repository-identity' import type { GitHubWorkItem, GitHubWorkItemDetails, ListWorkItemsResult -} from '../../shared/github/work-item-types' +} from '../../shared/github/work-items/work-item-types' import type { GitHubCreateIssueResult, GitHubIssueUpdate } from '../../shared/issue-mutation-types' export type GitHubRepoSelectorArgs = { diff --git a/src/preload/api/linear-api.ts b/src/preload/api/linear-api.ts index 0b924953d86..8e2e597a1ce 100644 --- a/src/preload/api/linear-api.ts +++ b/src/preload/api/linear-api.ts @@ -1,3 +1,4 @@ +import type { RuntimeClientEvent } from '../../shared/runtime-client-events' import type { LinearIssueAttributeFilter } from '../../shared/linear/issue-attribute-filter' import type { LinearIssueUpdate } from '../../shared/issue-mutation-types' import type { LinearComment, LinearIssue } from '../../shared/linear/issue-types' @@ -18,7 +19,13 @@ import type { LinearWorkspaceSelection } from '../../shared/linear/workspace-types' +export type LinearLinkedIssueUpdated = Extract< + RuntimeClientEvent, + { type: 'linearLinkedIssueUpdated' } +> + export type LinearApi = { + onLinkedIssueUpdated?: (callback: (event: LinearLinkedIssueUpdated) => void) => () => void connect: (args: { apiKey: string }) => Promise<{ ok: true; viewer: LinearViewer } | { ok: false; error: string }> diff --git a/src/preload/api/linear-bridge.ts b/src/preload/api/linear-bridge.ts index 8092a8e70e7..86d4a7a931c 100644 --- a/src/preload/api/linear-bridge.ts +++ b/src/preload/api/linear-bridge.ts @@ -1,8 +1,15 @@ +import type { LinearLinkedIssueUpdated } from './linear-api' import { ipcRenderer } from 'electron' import type { LinearProjectDetail } from '../../shared/linear/project-types' import type { PreloadApi } from '../api-types' export const linearApi = { + onLinkedIssueUpdated: (callback: (event: LinearLinkedIssueUpdated) => void) => { + const listener = (_event: Electron.IpcRendererEvent, update: LinearLinkedIssueUpdated): void => + callback(update) + ipcRenderer.on('linear:linkedIssueUpdated', listener) + return () => ipcRenderer.removeListener('linear:linkedIssueUpdated', listener) + }, connect: (args: { apiKey: string }) => ipcRenderer.invoke('linear:connect', args), disconnect: (args?: { workspaceId?: string }): Promise => diff --git a/src/preload/api/repository-api.ts b/src/preload/api/repository-api.ts index 16c91ac61d3..f8f23e4aaca 100644 --- a/src/preload/api/repository-api.ts +++ b/src/preload/api/repository-api.ts @@ -1,7 +1,7 @@ import type { RepoCreateFailure } from '../../shared/repo-create-failure-copy' import type { CloneTargetArgs, CloneTargetCheck } from '../../shared/git/clone/clone-target-check' import type { ExecutionHostId } from '../../shared/execution-host' -import type { GhAccountBinding } from '../../shared/github/account-binding' +import type { GhAccountBinding } from '../../shared/github/accounts/account-binding' import type { NestedRepoScanResult, ProjectGroup, @@ -76,6 +76,7 @@ export type RepositoryApi = { agentWorktreeVisibility?: Repo['agentWorktreeVisibility'] | null sourceControlAi?: Repo['sourceControlAi'] | null externalWorktreeDiscoverySuppressedAt?: Repo['externalWorktreeDiscoverySuppressedAt'] | null + hiddenAt?: Repo['hiddenAt'] | null ghAccount?: GhAccountBinding | null } }) => Promise diff --git a/src/preload/api/workspace-session-api.ts b/src/preload/api/workspace-session-api.ts index 34fb8f6019a..dc49809d2c4 100644 --- a/src/preload/api/workspace-session-api.ts +++ b/src/preload/api/workspace-session-api.ts @@ -1,4 +1,4 @@ -import type { IssueInfo, PRInfo } from '../../shared/github/pull-request-types' +import type { IssueInfo, PRInfo } from '../../shared/github/pull-requests/pull-request-types' import type { WorkspaceSessionPatch, WorkspaceSessionState diff --git a/src/renderer/src/assets/main.css b/src/renderer/src/assets/main.css index ecaafaac289..883d9061562 100644 --- a/src/renderer/src/assets/main.css +++ b/src/renderer/src/assets/main.css @@ -101,6 +101,9 @@ --color-agent-question: var(--agent-question); --color-agent-working: var(--agent-working); --color-agent-question-text: var(--agent-question-text); + --color-question-card-border: var(--question-card-border); + --color-question-option-border: var(--question-option-border); + --color-chat-focus-ring: var(--chat-focus-ring); --color-chart-1: var(--chart-1); --color-chart-2: var(--chart-2); --color-chart-3: var(--chart-3); @@ -262,6 +265,9 @@ --agent-working: var(--color-yellow-500); /* Legible weight for text/glyphs on a tinted --agent-question surface. */ --agent-question-text: var(--color-orange-700); + /* Answer card edge and the outline shared by its option tiles, badges, answer field and Skip. */ + --question-card-border-mix: 14%; + --question-option-border-mix: 16%; /* Keep PR-state hues stable across theme changes. */ --workspace-status-done: #c7a594; --workspace-status-review: #16a34a; @@ -379,6 +385,8 @@ --ai-action-accent: var(--color-violet-400); --agent-question: var(--color-orange-500); --agent-question-text: var(--color-orange-300); + --question-card-border-mix: 16%; + --question-option-border-mix: 12%; --workspace-status-done: #c7a594; --workspace-status-review: #16a34a; --workspace-status-progress: #d4a300; @@ -743,6 +751,17 @@ body[data-modal-overlay-open] var(--chat-source-foreground) var(--chat-composer-border-mix), transparent ); + /* From the chat's own foreground, so the edges stay visible when chat follows the terminal's colors. */ + --question-card-border: color-mix( + in srgb, + var(--chat-source-foreground) var(--question-card-border-mix), + transparent + ); + --question-option-border: color-mix( + in srgb, + var(--chat-source-foreground) var(--question-option-border-mix), + transparent + ); /* Mixed toward the foreground so each clears text contrast on the canvas in either scheme. */ --chat-focus-ring: color-mix(in srgb, var(--chat-source-foreground) 50%, var(--chat-canvas)); --chat-warning: color-mix(in srgb, var(--status-warning) 70%, var(--chat-source-foreground)); diff --git a/src/renderer/src/attention/hidden-workspace-notification-mute.test.ts b/src/renderer/src/attention/hidden-workspace-notification-mute.test.ts index e8e5944834f..302fecfbdac 100644 --- a/src/renderer/src/attention/hidden-workspace-notification-mute.test.ts +++ b/src/renderer/src/attention/hidden-workspace-notification-mute.test.ts @@ -1,13 +1,10 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { getDefaultSettings } from '../../../shared/constants' -import type { FolderWorkspace } from '../../../shared/folder-workspaces/folder-workspace-types' -import { folderWorkspaceKey } from '../../../shared/workspace-scope' import { getDefaultNotificationSettings } from '../../../shared/notification-settings-defaults' import { createTabsSliceMockApi } from '../store/slices/tabs/tabs-slice-test-harness' import { createTestStore } from '../store/testing/app-store-test-fixture' import { makeWorktree } from '../store/slices/worktrees/worktree.test-fixture' import { TEST_REPO } from '../store/repos/repo.test-fixture' -import { isWorkspaceNotificationMutedBySidebarFilters } from './hidden-workspace-notification-mute' vi.mock('sonner', () => ({ toast: { info: vi.fn(), success: vi.fn(), error: vi.fn() } })) @@ -34,10 +31,6 @@ function setNotifyHiddenWorkspaces(notifyHiddenWorkspaces: boolean): void { }) } -function muted(workspaceId: string): boolean { - return isWorkspaceNotificationMutedBySidebarFilters(store.getState(), workspaceId) -} - beforeEach(() => { store = createTestStore() store.setState({ @@ -50,80 +43,6 @@ beforeEach(() => { setNotifyHiddenWorkspaces(false) }) -describe('isWorkspaceNotificationMutedBySidebarFilters', () => { - it('fails open before settings or UI state hydrate, and for an unknown workspace', () => { - expect(muted('repo1::/tmp/unknown')).toBe(false) - store.setState({ persistedUIReady: false }) - expect(muted(CLI_ID)).toBe(false) - store.setState({ persistedUIReady: true, settings: null }) - expect(muted(CLI_ID)).toBe(false) - }) - - it('fails open until terminals reconnect, when Hide sleeping would read restored work as asleep', () => { - store.setState({ hideCliCreatedWorkspaces: false, showSleepingWorkspaces: false }) - store.setState({ workspaceSessionReady: false }) - expect(muted(PLAIN_ID)).toBe(false) - store.setState({ workspaceSessionReady: true }) - expect(muted(PLAIN_ID)).toBe(true) - }) - - it('keeps notifying for a hidden parent the sidebar shows above a visible child', () => { - store.setState({ - worktreeLineageById: { - [PLAIN_ID]: { - worktreeId: PLAIN_ID, - worktreeInstanceId: 'plain', - parentWorktreeId: CLI_ID, - parentWorktreeInstanceId: 'cli', - origin: 'cli', - capture: { source: 'terminal-context', confidence: 'inferred' }, - createdAt: 1 - } - }, - worktreesByRepo: { - repo1: [ - { ...cliRow, instanceId: 'cli' }, - { ...plainRow, instanceId: 'plain' } - ] - } - }) - expect(muted(CLI_ID)).toBe(false) - }) - - it('keeps notifying for an id whose twin on another host the switches show', () => { - store.setState({ - worktreesByRepo: { - repo1: [cliRow, plainRow], - 'repo1@other-host': [{ ...cliRow, cliProvenance: undefined }] - } - }) - expect(muted(CLI_ID)).toBe(false) - }) - - it('mutes another client’s folder workspace under Hide other-client workspaces only', () => { - const folder: FolderWorkspace = { - id: 'f1', - projectGroupId: 'g1', - name: 'notes', - folderPath: '/notes', - creatorProvenance: { kind: 'paired-device', deviceId: 'phone' }, - linkedTask: null, - comment: '', - isArchived: false, - isUnread: false, - isPinned: false, - sortOrder: 0, - lastActivityAt: 0, - createdAt: 0, - updatedAt: 0 - } - store.setState({ folderWorkspaces: [folder] }) - expect(muted(folderWorkspaceKey('f1'))).toBe(false) - store.setState({ hideWorkspacesFromOtherDevices: true }) - expect(muted(folderWorkspaceKey('f1'))).toBe(true) - }) -}) - describe('muted workspace attention', () => { it('writes no bell marker for a muted workspace, and still does for a visible one', () => { const terminalTab = (id: string, worktreeId: string) => ({ diff --git a/src/renderer/src/attention/hidden-workspace-notification-mute.ts b/src/renderer/src/attention/hidden-workspace-notification-mute.ts index b43b0f99326..a505e0bf09b 100644 --- a/src/renderer/src/attention/hidden-workspace-notification-mute.ts +++ b/src/renderer/src/attention/hidden-workspace-notification-mute.ts @@ -6,6 +6,7 @@ import { parseWorkspaceKey } from '../../../shared/workspace-scope' import { sidebarHasActiveFilters } from '@/components/sidebar/worktree-list/controls/sidebar-filter-actions' import { computeVisibleWorktreeIds } from '@/components/sidebar/worktree-list/listing/compute-visible-worktrees' import { buildVisibleWorktreeOptionsFromState } from '@/components/sidebar/worktree-list/listing/visible-worktree-options-from-state' +import { NO_HIDDEN_PROJECTS } from '../../../shared/hidden-projects' import { isFolderWorkspaceFromOtherDevice } from '../../../shared/workspace-creator-visibility' import { selectFolderWorkspaces, @@ -46,6 +47,8 @@ export function isWorkspaceNotificationMutedBySidebarFilters( // Use the full sidebar pass (~0.2–0.3ms/1,000 workspaces) to preserve every rule that adds rows back. const visibleIds = computeVisibleWorktreeIds(selectWorktreesByRepo(state), [], { ...inputs, + // Hiding a project is a view choice, never a mute: its workspaces notify as if listed. + hiddenProjects: NO_HIDDEN_PROJECTS, filterRepoIds: [], workspaceHostScope: ALL_EXECUTION_HOSTS_SCOPE, visibleWorkspaceHostIds: null diff --git a/src/renderer/src/components/activity/activity-scope-filter-controls.tsx b/src/renderer/src/components/activity/activity-scope-filter-controls.tsx index 3431c3dcfbc..b4f570bd445 100644 --- a/src/renderer/src/components/activity/activity-scope-filter-controls.tsx +++ b/src/renderer/src/components/activity/activity-scope-filter-controls.tsx @@ -88,6 +88,8 @@ export function ActivityScopeFilterMenuItems(): React.JSX.Element {