From 8573f7ce869519cdfb0549c37052260e1625a600 Mon Sep 17 00:00:00 2001
From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
Date: Mon, 9 Nov 2026 17:18:33 -0800
Subject: [PATCH 01/50] Create a worktree per repository from an empty folder
workspace on the phone (#40139)
* feat(mobile): create a worktree per repository from an empty folder workspace
A folder workspace with no attached worktrees lists one card per
repository in its project group, as desktop's empty state does. Tapping
one creates a worktree named after the folder, attached to it, in place;
a taken name or a setup choice opens the new-workspace composer with the
repo, the name and the folder parent filled in. Shown only when the host
creating it supports exact-name creation.
* chore(mobile): merge the folder repo read's execution-host imports
* fix(mobile): folder creates keep their repository until the folder shows them
Every create from a folder's empty state, direct or through the
composer, holds its repository from admission until the folder lists
the new worktree, so a lost reply, a remount or a reopened form can't
start a second one. The composer and toasts belong to the folder
screen, stay on the folder's host, and say nothing once it's left. A
relayed server's repository read holds no desktop event stream, and a
failed read can be retried.
* test(mobile): a folder create resent after a lost reply carries the same mutation id
* fix(mobile): folder creates keep their name, and a left or replaced form shows and holds nothing
* fix(mobile): pause folder rows under the create form; a lost folder create is checked, never resent as another
* fix(mobile): a folder card never resends a form's create, and one form owns the folder screen at a time
* fix(mobile): a folder setup choice resends only its own unconfirmed create, and the newest form silences older ones
* test(mobile): declare the submit hook's folder launch in its recording fixture
* fix(mobile): a create refused on a resend after a lost reply tries no other name and stays unconfirmed
* fix(mobile): a replayed refusal after an agent-launch fallback stops the retry, and the composer says it may have been created
* test(mobile): type the replayed refusal reply in the retry test
* ci: retrigger checks
* fix(mobile): localize the folder and uncertain-create messages in the workspace composer
---
mobile/src/components/MobileStateView.tsx | 10 +-
.../src/components/NewWorktreeModal.test.tsx | 103 ++++++
mobile/src/components/NewWorktreeModal.tsx | 34 +-
.../components/new-workspace-create-copy.ts | 22 ++
.../components/new-worktree-modal-types.ts | 25 ++
.../use-new-workspace-create-submit.ts | 63 +++-
.../use-new-workspace-repositories.test.ts | 74 ++++
.../use-new-workspace-repositories.ts | 39 +-
mobile/src/i18n/locales/en.json | 17 +-
.../MobileSourceControlRoutePanel.tsx | 2 +
.../folder/MobileFolderEmptyState.tsx | 181 +++++++++
.../MobileFolderSourceControlPanel.test.tsx | 126 +++++++
.../folder/MobileFolderSourceControlPanel.tsx | 41 ++-
.../folder-repo-worktree-create.test.ts | 332 +++++++++++++++++
.../folder/folder-repo-worktree-create.ts | 310 ++++++++++++++++
.../folder/folder-source-repos-query.test.ts | 124 +++++++
.../folder/folder-source-repos-query.ts | 73 ++++
.../mobile-folder-attached-worktrees.ts | 3 +-
.../folder/use-folder-create-flow.test.tsx | 343 ++++++++++++++++++
.../folder/use-folder-create-flow.tsx | 284 +++++++++++++++
mobile/src/tasks/blank-workspace-create.ts | 8 +-
mobile/src/tasks/composer-work-item-task.ts | 55 +++
mobile/src/tasks/source-workspace-create.ts | 72 +---
.../src/tasks/worktree-create-retry.test.ts | 148 ++++++++
mobile/src/tasks/worktree-create-retry.ts | 32 +-
.../adapters/workspace-settings-mounts.ts | 4 +-
26 files changed, 2435 insertions(+), 90 deletions(-)
create mode 100644 mobile/src/components/new-workspace-create-copy.ts
create mode 100644 mobile/src/components/use-new-workspace-repositories.test.ts
create mode 100644 mobile/src/source-control/folder/MobileFolderEmptyState.tsx
create mode 100644 mobile/src/source-control/folder/MobileFolderSourceControlPanel.test.tsx
create mode 100644 mobile/src/source-control/folder/folder-repo-worktree-create.test.ts
create mode 100644 mobile/src/source-control/folder/folder-repo-worktree-create.ts
create mode 100644 mobile/src/source-control/folder/folder-source-repos-query.test.ts
create mode 100644 mobile/src/source-control/folder/folder-source-repos-query.ts
create mode 100644 mobile/src/source-control/folder/use-folder-create-flow.test.tsx
create mode 100644 mobile/src/source-control/folder/use-folder-create-flow.tsx
create mode 100644 mobile/src/tasks/composer-work-item-task.ts
create mode 100644 mobile/src/tasks/worktree-create-retry.test.ts
diff --git a/mobile/src/components/MobileStateView.tsx b/mobile/src/components/MobileStateView.tsx
index ef692756a90..791e43c4789 100644
--- a/mobile/src/components/MobileStateView.tsx
+++ b/mobile/src/components/MobileStateView.tsx
@@ -22,6 +22,8 @@ type MobileStateViewProps = {
loading?: boolean
/** Keeps the content centred above a floating bottom bar. */
bottomInset?: number
+ /** Full-width content under the message, such as a list of choices. */
+ children?: ReactNode
}
/** Every screen's loading, empty, no-match, error and offline state: icon, title, one sentence, one action. */
@@ -33,7 +35,8 @@ export function MobileStateView({
details,
action,
loading = false,
- bottomInset = 0
+ bottomInset = 0,
+ children
}: MobileStateViewProps) {
useMobileColorScheme()
return (
@@ -49,6 +52,7 @@ export function MobileStateView({
{message ? {message} : null}
{details ? : null}
{action ? : null}
+ {children ? {children} : null}
)
}
@@ -187,6 +191,10 @@ export function MobileNoMatchState({
}
const styles = themedStyleSheet(() => ({
+ children: {
+ alignSelf: 'stretch',
+ marginTop: spacing.md
+ },
state: {
flex: 1,
alignItems: 'center',
diff --git a/mobile/src/components/NewWorktreeModal.test.tsx b/mobile/src/components/NewWorktreeModal.test.tsx
index b44507b5157..6da85abe6b3 100644
--- a/mobile/src/components/NewWorktreeModal.test.tsx
+++ b/mobile/src/components/NewWorktreeModal.test.tsx
@@ -64,6 +64,7 @@ vi.mock('../host-screen/host-list-queries', () => ({
import '../transport/hosts/host-descriptor-store'
import { FakeSession } from '../transport/connection/mobile-endpoint-supervisor-test-fakes'
+import { markRpcDeliveryUnknown } from '../transport/rpc/rpc-delivery-ambiguity'
import '../../../src/shared/execution-host'
import type { ExecutionHostId } from '../../../src/shared/execution-host'
@@ -194,6 +195,108 @@ describe('NewWorktreeModal project targets', () => {
).toBe('/srv/orca')
})
+ it("offers only the folder host's copy of a repo when opened from a folder", async () => {
+ const serverRepo = { ...repos[0]!, path: '/srv/orca' }
+ const listing = (listed: unknown[]) =>
+ vi.fn((method: string) =>
+ method === 'repo.list' ? replied({ repos: listed }) : new Promise(() => {})
+ )
+
+ await act(async () => {
+ renderer = create(
+ createElement(NewWorktreeModal, {
+ visible: true,
+ client: requestsOnly(listing(repos)),
+ serverClients: new Map([
+ ['runtime:env-1', requestsOnly(listing([serverRepo]))]
+ ]),
+ hostId: 'host-1',
+ onCreated: () => {},
+ onClose: () => {},
+ openExternalUrl: () => {},
+ folderLaunch: {
+ repoId: 'repo-1',
+ executionHostId: 'runtime:env-1',
+ name: 'payments',
+ parentWorkspace: 'folder:f-1',
+ submit: { begin: () => null, presenting: () => true }
+ }
+ })
+ )
+ })
+ await flushUpdates()
+
+ // The desktop's same-id repo is not offered: its store doesn't hold this folder.
+ expect(pickerItems(renderer, 'Run on').map((item) => item.detail)).toEqual(['/srv/orca'])
+ expect(runTargetPicker(renderer).props.selectedId).toBe('runtime:env-1')
+ })
+
+ async function submitFromFolder(createReply: () => Promise) {
+ const serverRepo = { ...repos[0]!, path: '/srv/orca' }
+ const server = requestsOnly(
+ vi.fn((method: string) =>
+ method === 'repo.list'
+ ? replied({ repos: [serverRepo] })
+ : method === 'worktree.create'
+ ? createReply()
+ : Promise.reject(new Error(`unexpected ${method}`))
+ )
+ )
+ const settle = vi.fn()
+
+ await act(async () => {
+ renderer = create(
+ createElement(NewWorktreeModal, {
+ visible: true,
+ client: requestsOnly(() => new Promise(() => {})),
+ serverClients: new Map([['runtime:env-1', server]]),
+ hostId: 'host-1',
+ onCreated: () => {},
+ onClose: () => {},
+ openExternalUrl: () => {},
+ folderLaunch: {
+ repoId: 'repo-1',
+ executionHostId: 'runtime:env-1',
+ name: 'payments',
+ parentWorkspace: 'folder:f-1',
+ submit: { begin: () => ({ settle }), presenting: () => true }
+ }
+ })
+ )
+ })
+ await flushUpdates()
+ const form = renderer.root.find((node) => typeof node.props.onCreate === 'function')
+ await act(async () => form.props.onCreate())
+ await flushUpdates()
+
+ const creates = vi
+ .mocked(server.sendRequest)
+ .mock.calls.filter(([method]) => method === 'worktree.create')
+ return { creates: creates.map(([, params]) => params), settle }
+ }
+
+ it('creates from a folder attached to that folder, on its host', async () => {
+ const { creates, settle } = await submitFromFolder(() =>
+ replied({ worktree: { id: 'repo-1::/srv/w/payments', displayName: 'payments' } })
+ )
+ expect(creates).toEqual([
+ expect.objectContaining({
+ repo: 'id:repo-1',
+ parentWorkspace: 'folder:f-1',
+ parentWorkspaceOrigin: 'manual'
+ })
+ ])
+ expect(settle).toHaveBeenCalledWith('created')
+ })
+
+ it("doesn't try another name when a folder create's reply is lost", async () => {
+ const { creates, settle } = await submitFromFolder(() =>
+ Promise.reject(markRpcDeliveryUnknown(new Error('connection lost')))
+ )
+ expect(creates).toHaveLength(1)
+ expect(settle).toHaveBeenCalledWith('uncertain')
+ })
+
it('ignores a stale repo list after the client changes', async () => {
let resolveOldList: ((value: unknown) => void) | undefined
const oldList = new Promise((resolve) => {
diff --git a/mobile/src/components/NewWorktreeModal.tsx b/mobile/src/components/NewWorktreeModal.tsx
index 11bf01b970f..ccae8181be7 100644
--- a/mobile/src/components/NewWorktreeModal.tsx
+++ b/mobile/src/components/NewWorktreeModal.tsx
@@ -1,4 +1,4 @@
-import { useMemo, useState } from 'react'
+import { useEffect, useMemo, useRef, useState } from 'react'
import { Keyboard } from 'react-native'
import { getComposerRepoWorktreeBranches } from '../../../src/shared/composer-branch-selection'
import { getRepoExecutionHostId, parseExecutionHostId } from '../../../src/shared/execution-host'
@@ -71,14 +71,20 @@ function NewWorktreeModalContent(props: NewWorktreeModalProps) {
existingWorktrees,
openExternalUrl,
onCreated,
- onClose
+ onClose,
+ folderLaunch
} = props
const { repos, allRepos, selectedRepo, setSelectedRepo, loading, loadError, retryLoad } =
useNewWorkspaceRepositories({
client: desktopClient,
serverClients,
hostId,
- visible
+ visible,
+ ...(folderLaunch
+ ? {
+ initialRepo: { id: folderLaunch.repoId, executionHostId: folderLaunch.executionHostId }
+ }
+ : {})
})
// Route picked-repo operations to its host; desktop settings/accounts stay on desktop.
const repoServer = selectedRepo ? serverOf(selectedRepo) : undefined
@@ -126,6 +132,14 @@ function NewWorktreeModalContent(props: NewWorktreeModalProps) {
worktreeBranches: selectedRepoWorktreeBranches,
onError: setError
})
+ // The folder's name, seeded once per opening; the user's edits stand.
+ const seededFolderName = useRef(false)
+ useEffect(() => {
+ if (folderLaunch && !seededFolderName.current) {
+ seededFolderName.current = true
+ composer.setName(folderLaunch.name)
+ }
+ }, [composer, folderLaunch])
const selectedRepoIsGit = selectedRepo ? selectedRepo.kind !== 'folder' : true
useWorktreeCreateBasePrefetch({
client: visible ? client : null,
@@ -179,7 +193,19 @@ function NewWorktreeModalContent(props: NewWorktreeModalProps) {
setNote((current) => (current === note ? '' : current))
onCreated(worktreeId, name, warning, repoServer)
},
- onClose
+ onClose,
+ ...(folderLaunch
+ ? {
+ folderLaunch: {
+ ...folderLaunch.submit,
+ executionHostId: folderLaunch.executionHostId,
+ parent: {
+ parentWorkspace: folderLaunch.parentWorkspace,
+ parentWorkspaceOrigin: 'manual' as const
+ }
+ }
+ }
+ : {})
})
const sourceAvailability: SmartModeAvailabilityInput = {
diff --git a/mobile/src/components/new-workspace-create-copy.ts b/mobile/src/components/new-workspace-create-copy.ts
new file mode 100644
index 00000000000..77a9e3cf7e3
--- /dev/null
+++ b/mobile/src/components/new-workspace-create-copy.ts
@@ -0,0 +1,22 @@
+import { translate } from '../i18n/mobile-i18n'
+
+/** A create whose reply was lost, or whose resend was refused: it may exist, so another could be a second one. */
+export function uncertainCreateMessage(inFolder: boolean): string {
+ return inFolder
+ ? translate(
+ 'components.newWorkspaceCreateSubmit.uncertainFolderCreate',
+ 'This worktree may have been created. Check the folder before creating another.'
+ )
+ : translate(
+ 'components.newWorkspaceCreateSubmit.uncertainCreate',
+ 'This workspace may have been created. Check your workspaces before creating another.'
+ )
+}
+
+/** The folder screen still owns a create for this repository. */
+export function folderCreateBusyMessage(): string {
+ return translate(
+ 'components.newWorkspaceCreateSubmit.folderCreateBusy',
+ 'A worktree in this repository is still being created or checked. It shows in the folder once it lands.'
+ )
+}
diff --git a/mobile/src/components/new-worktree-modal-types.ts b/mobile/src/components/new-worktree-modal-types.ts
index 54fa5d0f4a0..02a7a1e4f9d 100644
--- a/mobile/src/components/new-worktree-modal-types.ts
+++ b/mobile/src/components/new-worktree-modal-types.ts
@@ -18,6 +18,30 @@ export type MobileWorkspaceRepo = Pick
>
+/** Opened from a folder's empty state: that repo and name, created attached to the folder. */
+export type NewWorktreeFolderLaunch = {
+ repoId: string
+ /** The repo's host, so a same-id copy on another host isn't picked. */
+ executionHostId: ExecutionHostId
+ name: string
+ /** The folder's workspace key, `folder:`. */
+ parentWorkspace: string
+ submit: NewWorktreeFolderSubmit
+}
+
+/** A folder's create, kept from admission until its outcome is known. */
+export type NewWorktreeFolderSubmission = {
+ settle: (outcome: 'created' | 'uncertain' | 'failed' | 'cancelled') => void
+}
+
+/** How the folder screen owns its composer's creates. */
+export type NewWorktreeFolderSubmit = {
+ /** Admits a create for the picked repo before anything is sent; null while another is out for it. */
+ begin: (repo: MobileWorkspaceRepo) => NewWorktreeFolderSubmission | null
+ /** False once the folder screen is left: the create runs on, without haptics. */
+ presenting: () => boolean
+}
+
export type NewWorktreeModalProps = {
visible: boolean
client: RpcClient | null
@@ -37,6 +61,7 @@ export type NewWorktreeModalProps = {
executionHost?: ExecutionHostId
) => void
onClose: () => void
+ folderLaunch?: NewWorktreeFolderLaunch
}
export type SetupRunPolicy = 'ask' | 'run-by-default' | 'skip-by-default'
diff --git a/mobile/src/components/use-new-workspace-create-submit.ts b/mobile/src/components/use-new-workspace-create-submit.ts
index 13f5d3cd165..3ee45a87b10 100644
--- a/mobile/src/components/use-new-workspace-create-submit.ts
+++ b/mobile/src/components/use-new-workspace-create-submit.ts
@@ -3,7 +3,9 @@ import { useRef, useState, type Dispatch, type SetStateAction } from 'react'
import type { PersistedTrustedOrcaHooks } from '../../../src/shared/orca-yaml-hook-types'
import type { RetiredNameRegistry } from '../../../src/shared/worktree/retired-name-registry'
import type { RpcClient } from '../transport/rpc/rpc-client-contract'
+import { folderCreateBusyMessage, uncertainCreateMessage } from './new-workspace-create-copy'
import { triggerError, triggerSuccess } from '../platform/haptics'
+import type { WorktreeCreateParent } from '../tasks/worktree-create-retry'
import { createBlankWorkspace } from '../tasks/blank-workspace-create'
import { isMobileTuiAgentEnabled } from '../tasks/mobile-tui-agents'
import {
@@ -24,7 +26,14 @@ import {
type NewWorktreeAgentOption,
type NewWorktreeRuntimeSettings
} from './new-worktree-agent-selection'
-import type { MobileWorkspaceRepo, SetupRunPolicy } from './new-worktree-modal-types'
+import type {
+ MobileWorkspaceRepo,
+ NewWorktreeFolderSubmission,
+ NewWorktreeFolderSubmit,
+ SetupRunPolicy
+} from './new-worktree-modal-types'
+import { getRepoExecutionHostId, type ExecutionHostId } from '../../../src/shared/execution-host'
+import { isRpcDeliveryUnknown } from '../transport/rpc/rpc-delivery-ambiguity'
import type { OrcaHookTrustPrompt } from './OrcaHookTrustDrawer'
import type { NewWorktreeDrawerView } from './use-new-worktree-drawer-navigation'
import { getSuggestedCreatureName } from './worktree-name-suggestion'
@@ -65,6 +74,11 @@ export function useNewWorkspaceCreateSubmit(args: {
setError: Dispatch>
onCreated: (worktreeId: string, name: string, warning?: string) => void
onClose: () => void
+ /** Opened from a folder: creates on that folder's host, attached to it, owned by the folder screen. */
+ folderLaunch?: NewWorktreeFolderSubmit & {
+ executionHostId: ExecutionHostId
+ parent: WorktreeCreateParent
+ }
}): {
creating: boolean
setupTrustPrompt: OrcaHookTrustPrompt | null
@@ -86,7 +100,20 @@ export function useNewWorkspaceCreateSubmit(args: {
createInFlightRef.current = true
setCreating(true)
args.setError('')
+ const folder = args.folderLaunch
+ // Admitted for the repo actually picked, before anything is sent; the folder screen owns it until it settles.
+ const admission = folder
+ ? getRepoExecutionHostId(selectedRepo) === folder.executionHostId
+ ? folder.begin(selectedRepo)
+ : null
+ : undefined
+ const presenting = (): boolean => folder?.presenting() ?? true
+ let outcome: Parameters[0] = 'cancelled'
try {
+ if (admission === null) {
+ args.setError(folderCreateBusyMessage())
+ return
+ }
if (args.sshGate.requiresConnection) {
args.setError(`Connect ${selectedRepo.displayName} before creating a workspace.`)
return
@@ -178,7 +205,8 @@ export function useNewWorkspaceCreateSubmit(args: {
agentLaunchSupported: args.getAgentLaunchSupport(),
branchIntentSupported: args.getBranchIntentSupport(
selection.kind === 'branch' && selection.reuse ? 'open-existing-v2' : 'create-new'
- )
+ ),
+ parent: folder?.parent
})
: await createBlankWorkspace({
client,
@@ -189,20 +217,43 @@ export function useNewWorkspaceCreateSubmit(args: {
comment: trimmedNote,
setupDecision,
worktreeCreateIdempotency: args.getWorktreeCreateCutoverSupport(),
- agentLaunchSupported: args.getAgentLaunchSupport()
+ agentLaunchSupported: args.getAgentLaunchSupport(),
+ parent: folder?.parent
})
if ('error' in result) {
- triggerError()
+ // Refused on a resend after a lost reply: the first send may have created it.
+ outcome = result.replayed ? 'uncertain' : 'failed'
+ if (outcome === 'uncertain') {
+ // Not a failure to retry: creating again could make a second one.
+ args.setError(uncertainCreateMessage(folder !== undefined))
+ return
+ }
+ if (presenting()) {
+ triggerError()
+ }
args.setError(result.error)
return
}
- triggerSuccess()
+ outcome = 'created'
+ if (presenting()) {
+ triggerSuccess()
+ }
args.onClose()
args.onCreated(result.worktreeId, result.name, result.warning)
} catch (error) {
- triggerError()
+ // A lost reply may still have created it.
+ outcome = isRpcDeliveryUnknown(error) ? 'uncertain' : 'failed'
+ if (folder && outcome === 'uncertain') {
+ // The folder screen refreshes and holds it until its list shows it; sending again could create a second one.
+ args.setError(uncertainCreateMessage(true))
+ return
+ }
+ if (presenting()) {
+ triggerError()
+ }
args.setError(error instanceof Error ? error.message : 'Failed to create workspace')
} finally {
+ admission?.settle(outcome)
createInFlightRef.current = false
setCreating(false)
}
diff --git a/mobile/src/components/use-new-workspace-repositories.test.ts b/mobile/src/components/use-new-workspace-repositories.test.ts
new file mode 100644
index 00000000000..14196e03e81
--- /dev/null
+++ b/mobile/src/components/use-new-workspace-repositories.test.ts
@@ -0,0 +1,74 @@
+import { act } from 'react-test-renderer'
+import { afterEach, describe, expect, it, vi } from 'vitest'
+import type { ExecutionHostId } from '../../../src/shared/execution-host'
+import { FakeSession } from '../transport/connection/mobile-endpoint-supervisor-test-fakes'
+import { hookMount, settleQueryNotifications } from '../test-support/rpc-recording/hook-mount'
+import type { MobileWorkspaceRepo } from './new-worktree-modal-types'
+import { useNewWorkspaceRepositories } from './use-new-workspace-repositories'
+
+vi.mock('react-native', () => ({ AppState: {} }))
+const servers = vi.hoisted(() => {
+ const state: { repos: ReadonlyMap } = { repos: new Map() }
+ return state
+})
+vi.mock('../worktree/use-server-repos', () => ({ useServerRepos: () => servers.repos }))
+vi.mock('../worktree/use-last-visited-worktree-repo', () => ({
+ useLastVisitedWorktreeRepoId: () => ({ loaded: true, repoId: 'api' })
+}))
+
+const SERVER: ExecutionHostId = 'runtime:env-1'
+const repo = (executionHostId?: ExecutionHostId): MobileWorkspaceRepo => ({
+ id: 'api',
+ displayName: 'api',
+ path: '/src/api',
+ kind: 'git',
+ ...(executionHostId ? { executionHostId } : {})
+})
+
+function desktopListing(repos: MobileWorkspaceRepo[]) {
+ const client = new FakeSession('connected')
+ client.sendRequest.mockResolvedValue({
+ id: '1',
+ ok: true,
+ result: { repos },
+ _meta: { runtimeId: 'r' }
+ })
+ return client
+}
+
+let mounted: ReturnType | null = null
+afterEach(async () => {
+ await mounted?.unmount()
+ mounted = null
+ servers.repos = new Map()
+})
+
+describe('useNewWorkspaceRepositories initial repo', () => {
+ it.each([
+ { order: 'desktop first', desktopFirst: true },
+ { order: 'server first', desktopFirst: false }
+ ])(
+ 'picks the named host’s copy of a repo id two hosts share ($order)',
+ async ({ desktopFirst }) => {
+ const client = desktopListing(desktopFirst ? [repo()] : [])
+ let picked: MobileWorkspaceRepo | null = null
+ mounted = hookMount(() => {
+ picked = useNewWorkspaceRepositories({
+ client,
+ hostId: 'host-1',
+ visible: true,
+ initialRepo: { id: 'api', executionHostId: SERVER }
+ }).selectedRepo
+ })
+ mounted.mount()
+ await settleQueryNotifications()
+ // The desktop's same-id repo must not stand in while the server's listing is on its way.
+ expect(picked).toBeNull()
+
+ servers.repos = new Map([[SERVER, [repo(SERVER)]]])
+ act(() => mounted?.update())
+ await settleQueryNotifications()
+ expect(picked).toMatchObject({ id: 'api', executionHostId: SERVER })
+ }
+ )
+})
diff --git a/mobile/src/components/use-new-workspace-repositories.ts b/mobile/src/components/use-new-workspace-repositories.ts
index 4961b186ed2..15a0c14e57e 100644
--- a/mobile/src/components/use-new-workspace-repositories.ts
+++ b/mobile/src/components/use-new-workspace-repositories.ts
@@ -1,6 +1,6 @@
import { useEffect, useMemo, useState } from 'react'
import { useQueryClient } from '@tanstack/react-query'
-import type { ExecutionHostId } from '../../../src/shared/execution-host'
+import { getRepoExecutionHostId, type ExecutionHostId } from '../../../src/shared/execution-host'
import type { RpcClient } from '../transport/rpc/rpc-client-contract'
import { cachedHostRepos } from '../host-screen/host-list-queries'
import { listHostRepos } from '../worktree/server-repos'
@@ -21,6 +21,8 @@ export function useNewWorkspaceRepositories(args: {
serverClients?: ReadonlyMap
hostId?: string
visible: boolean
+ /** Picked once it is listed, in place of the last visited repo. */
+ initialRepo?: { id: string; executionHostId: ExecutionHostId }
}): {
repos: MobileWorkspaceRepo[]
allRepos: MobileWorkspaceRepo[]
@@ -31,7 +33,7 @@ export function useNewWorkspaceRepositories(args: {
loadError: string | null
retryLoad: () => void
} {
- const { client, serverClients = NO_SERVER_CLIENTS, hostId, visible } = args
+ const { client, serverClients = NO_SERVER_CLIENTS, hostId, visible, initialRepo } = args
const queryClient = useQueryClient()
// The host list's repos, so the form opens with them while repo.list answers.
const [initialRepos] = useState(() => cachedHostRepos(queryClient, hostId))
@@ -51,7 +53,15 @@ export function useNewWorkspaceRepositories(args: {
: [...desktopRepos, ...[...serverRepos.values()].flat()],
[desktopRepos, serverRepos]
)
- const repos = useMemo(() => getNewWorkspaceDialogEligibleRepos(allRepos), [allRepos])
+ const initialRepoId = initialRepo?.id
+ const initialRepoHost = initialRepo?.executionHostId
+ // Opened for one host's folder: every picker offers only that host, whose store holds the folder.
+ const repos = useMemo(() => {
+ const eligible = getNewWorkspaceDialogEligibleRepos(allRepos)
+ return initialRepoHost
+ ? eligible.filter((repo) => getRepoExecutionHostId(repo) === initialRepoHost)
+ : eligible
+ }, [allRepos, initialRepoHost])
// Derive the pick so it follows updated listings and disappears when its host stops listing it.
const selectedRepo = useMemo(
() => refreshMobileNewWorkspaceDialogSelectedRepo(repos, pickedRepo),
@@ -59,7 +69,26 @@ export function useNewWorkspaceRepositories(args: {
)
useEffect(() => {
- if (!visible || !lastVisitedRepo.loaded || selectedRepo || repos.length === 0) {
+ if (!visible || selectedRepo || !initialRepoId) {
+ return
+ }
+ // Waits for its host's listing: a same-id repo on another host is a different repo.
+ const initial = repos.find(
+ (repo) => repo.id === initialRepoId && getRepoExecutionHostId(repo) === initialRepoHost
+ )
+ if (initial) {
+ setSelectedRepo(initial)
+ }
+ }, [initialRepoHost, initialRepoId, repos, selectedRepo, visible])
+
+ useEffect(() => {
+ if (
+ !visible ||
+ initialRepoId ||
+ !lastVisitedRepo.loaded ||
+ selectedRepo ||
+ repos.length === 0
+ ) {
return
}
const preferredRepoId = resolveNewWorkspaceDialogRepoId({
@@ -70,7 +99,7 @@ export function useNewWorkspaceRepositories(args: {
if (preferredRepo) {
setSelectedRepo(preferredRepo)
}
- }, [lastVisitedRepo.loaded, lastVisitedRepo.repoId, repos, selectedRepo, visible])
+ }, [initialRepoId, lastVisitedRepo.loaded, lastVisitedRepo.repoId, repos, selectedRepo, visible])
useEffect(() => {
if (!visible || !client) {
diff --git a/mobile/src/i18n/locales/en.json b/mobile/src/i18n/locales/en.json
index 7bfae1e60b1..eecc184562f 100644
--- a/mobile/src/i18n/locales/en.json
+++ b/mobile/src/i18n/locales/en.json
@@ -1491,6 +1491,11 @@
"offlineAsOfTime": {
"yesterday": "yesterday, {{time}}"
},
+ "newWorkspaceCreateSubmit": {
+ "uncertainFolderCreate": "This worktree may have been created. Check the folder before creating another.",
+ "uncertainCreate": "This workspace may have been created. Check your workspaces before creating another.",
+ "folderCreateBusy": "A worktree in this repository is still being created or checked. It shows in the folder once it lands."
+ },
"smartRailRow": {
"title": "Smart rail",
"subtitle": "Shows keys for what your agent is doing"
@@ -3673,7 +3678,17 @@
"emptyTitle": "No attached worktrees yet",
"emptyCopy": "Worktrees created from this workspace will show up here.",
"statusUnavailable": "Unavailable",
- "backToFolder": "Back to folder"
+ "backToFolder": "Back to folder",
+ "createSection": "Create a worktree",
+ "createIn": "Create a worktree in {{repo}}",
+ "created": "Created worktree {{name}} in {{repo}}",
+ "createdNamed": "Created worktree {{name}}",
+ "createFailed": "Could not create a worktree in {{repo}}.",
+ "loadReposRetry": "Load repositories",
+ "setupChoiceTitle": "Retry without setup?",
+ "setupChoiceMessage": "Orca couldn't confirm the last create in {{repo}}. Retrying it needs a setup choice; it will be created without running the repository's setup.",
+ "setupChoiceSkip": "Retry without setup",
+ "checking": "A worktree from {{repo}} may already have been created. Checking the folder…"
},
"hostedReviewCopy": {
"updatingBranch": "Updating branch...",
diff --git a/mobile/src/source-control/MobileSourceControlRoutePanel.tsx b/mobile/src/source-control/MobileSourceControlRoutePanel.tsx
index f82fd2915e9..a6096584cee 100644
--- a/mobile/src/source-control/MobileSourceControlRoutePanel.tsx
+++ b/mobile/src/source-control/MobileSourceControlRoutePanel.tsx
@@ -10,6 +10,8 @@ export function MobileSourceControlRoutePanel(props: MobileSourceControlPanelPro
if (parseWorkspaceKey(props.worktreeId)?.type === 'folder') {
return (
void>
+ onCreate: (repo: Repo, target: FolderRepoTarget, client: RpcClient, name: string) => void
+ bottomInset: number
+}
+
+/** A folder with no attached worktrees: desktop's copy, then one create card per repository. */
+export function MobileFolderEmptyState(props: Props) {
+ const { hostId, folder, desktopCapabilities, folderHostCapabilities, observing, refreshers } =
+ props
+ const t = useMobileTranslation()
+ const { client: desktopClient, state } = useHostClient(hostId)
+ // A relayed server's folder is created on that server, through the desktop.
+ const routeHost = workspaceRouteExecutionHost(desktopClient, desktopCapabilities, folder.hostId)
+ const server = routeHost?.startsWith('runtime:') ? routeHost : undefined
+ // Only exact-name creates land as named; a server's rows also need a desktop new enough to relay its folder lineage.
+ const canCreate =
+ state === 'connected' &&
+ routeHost !== null &&
+ folderHostCapabilities.includes(WORKTREE_CREATE_EXACT_NAME_RUNTIME_CAPABILITY) &&
+ (!server || desktopCapabilities.includes(WORKTREE_CREATE_EXACT_NAME_RUNTIME_CAPABILITY))
+ const createClient = useMemo(
+ () =>
+ desktopClient && server
+ ? scopeRpcClientToExecutionHost(desktopClient, server)
+ : desktopClient,
+ [desktopClient, server]
+ )
+ const catalog = useHostQuery(
+ server ? serverFolderSourceCatalogQuery : folderSourceCatalogQuery,
+ { hostId, client: canCreate ? createClient : null },
+ { exec: server ?? 'local' },
+ NO_INPUT,
+ { enabled: canCreate, subscribed: observing }
+ )
+ const refetchCatalog = catalog.refetch
+ useEffect(() => {
+ if (!canCreate) {
+ return
+ }
+ const refresh = () => void refetchCatalog()
+ refreshers.add(refresh)
+ return () => {
+ refreshers.delete(refresh)
+ }
+ }, [canCreate, refetchCatalog, refreshers])
+ const repos = useMemo(
+ () =>
+ canCreate
+ ? selectFolderSourceRepos(catalog.data, projectGroupIdFromRepoId(folder.repoId))
+ : [],
+ [canCreate, catalog.data, folder.repoId]
+ )
+ const name = folder.displayName.trim()
+ const catalogFailed = canCreate && catalog.data === undefined && catalog.error !== null
+
+ return (
+
+ void refetchCatalog()
+ }
+ : null
+ }
+ bottomInset={props.bottomInset}
+ >
+ {repos.length > 0 && createClient && name ? (
+
+
+
+ {repos.map((repo) => {
+ const target: FolderRepoTarget = {
+ hostId,
+ executionHost: server,
+ folderWorktreeId: folder.worktreeId,
+ repoId: repo.id
+ }
+ return (
+ props.onCreate(repo, target, createClient, name)}
+ />
+ )
+ })}
+
+
+ ) : null}
+
+
+ )
+}
+
+function FolderRepoCreateCard(props: {
+ target: FolderRepoTarget
+ repo: Repo
+ onPress: () => void
+}) {
+ const t = useMobileTranslation()
+ const busy = useSyncExternalStore(subscribeFolderRepoCreates, () =>
+ isFolderRepoCreateBusy(props.target)
+ )
+ return (
+
+ }
+ accessory={
+ busy ? (
+
+ ) : (
+
+ )
+ }
+ busy={busy}
+ onPress={props.onPress}
+ accessibilityRole="button"
+ accessibilityLabel={t('sourceControl.folder.createIn', 'Create a worktree in {{repo}}', {
+ repo: props.repo.displayName
+ })}
+ />
+
+ )
+}
+
+const styles = themedStyleSheet(() => ({
+ scroll: { flexGrow: 1 },
+ cards: { gap: spacing.sm }
+}))
diff --git a/mobile/src/source-control/folder/MobileFolderSourceControlPanel.test.tsx b/mobile/src/source-control/folder/MobileFolderSourceControlPanel.test.tsx
new file mode 100644
index 00000000000..102d52bad8b
--- /dev/null
+++ b/mobile/src/source-control/folder/MobileFolderSourceControlPanel.test.tsx
@@ -0,0 +1,126 @@
+import { createElement, type ReactNode } from 'react'
+import { act, create, type ReactTestRenderer } from 'react-test-renderer'
+import { afterEach, describe, expect, it, vi } from 'vitest'
+import type { FolderListRow } from './mobile-folder-attached-worktrees'
+
+const seen = vi.hoisted(() => {
+ const state: { covered: boolean; membersObserving: boolean[]; rowsSubscribed: boolean[] } = {
+ covered: false,
+ membersObserving: [],
+ rowsSubscribed: []
+ }
+ return state
+})
+vi.mock('react-native', () => ({ ScrollView: 'ScrollView', View: 'View' }))
+vi.mock('lucide-react-native', () => ({ GitBranch: 'GitBranch' }))
+vi.mock('expo-router', () => ({ useFocusEffect: () => {} }))
+vi.mock('react-native-safe-area-context', () => ({
+ SafeAreaView: 'SafeAreaView',
+ useSafeAreaInsets: () => ({ bottom: 0 })
+}))
+vi.mock('../../components/MobileStateView', () => ({
+ MobileLoadErrorState: 'MobileLoadErrorState',
+ MobileOfflineState: 'MobileOfflineState',
+ MobileStateView: 'MobileStateView'
+}))
+vi.mock('../../transport/connection/connection-retry-action', () => ({
+ connectionRetryAction: () => () => {}
+}))
+vi.mock('../../transport/connection/host-client-hooks', () => ({
+ useForceReconnect: () => () => {}
+}))
+vi.mock('../../components/bottom-drawer/BottomDrawer', () => ({
+ OptionPager: ({ main }: { main: ReactNode }) => main,
+ useOptionPager: () => ({ page: null, open: () => {}, close: () => {} })
+}))
+vi.mock('../../components/list/ListGroup', () => ({ ListGroup: 'ListGroup' }))
+vi.mock('../../i18n/use-mobile-translation', () => ({
+ useMobileTranslation: () => (_key: string, fallback: string) => fallback
+}))
+vi.mock('../../navigation/use-back-claim', () => ({ useBackClaim: () => {} }))
+vi.mock('../../navigation/workspace-route-handoff', () => ({
+ useWorkspaceRouteHandoff: () => ({ back: () => {} })
+}))
+vi.mock('../../navigation/workspace-route', () => ({
+ WorkspaceExecutionScope: 'WorkspaceExecutionScope'
+}))
+vi.mock('../../theme/mobile-theme', () => ({ colors: {}, spacing: { lg: 16 } }))
+vi.mock('../../theme/themed-styles', () => ({
+ themedStyleSheet: (styles: () => unknown) => styles()
+}))
+vi.mock('../../theme/use-mobile-color-scheme', () => ({ useMobileColorScheme: () => {} }))
+vi.mock('../MobileSourceControlHeader', () => ({
+ MobileSourceControlHeader: 'MobileSourceControlHeader'
+}))
+vi.mock('../MobileSourceControlPanel', () => ({ MobileSourceControlPanel: 'Panel' }))
+vi.mock('../mobile-source-control-styles', () => ({ styles: {} }))
+vi.mock('./MobileFolderEmptyState', () => ({ MobileFolderEmptyState: 'EmptyState' }))
+vi.mock('../../components/host-protocol-gates-context', () => ({
+ useOptionalHostProtocolGates: () => null
+}))
+vi.mock('./use-folder-create-flow', () => ({
+ useFolderCreateFlow: () => ({
+ onCreate: async () => {},
+ covered: seen.covered,
+ composerElement: null,
+ toastElement: null
+ })
+}))
+vi.mock('./MobileFolderWorktreeRow', () => ({
+ MobileFolderWorktreeRow: (props: { subscribed: boolean }) => {
+ seen.rowsSubscribed.push(props.subscribed)
+ return null
+ }
+}))
+vi.mock('./use-mobile-folder-attached-worktrees', () => ({
+ useMobileFolderAttachedWorktrees: (_hostId: string, _folderId: string, observing: boolean) => {
+ seen.membersObserving.push(observing)
+ return {
+ folder: { worktreeId: 'folder:f-1', repoId: 'folder-workspace:f-1', displayName: 'payments' },
+ worktrees: [ROW],
+ desktopCapabilities: [],
+ serverHosts: [],
+ connState: 'connected',
+ loadError: null,
+ refetch: () => {}
+ }
+ }
+}))
+
+import { MobileFolderSourceControlPanel } from './MobileFolderSourceControlPanel'
+
+const ROW: FolderListRow = {
+ worktreeId: 'repo-1::/w/payments',
+ repoId: 'repo-1',
+ repo: 'orca',
+ displayName: 'payments',
+ branch: 'payments'
+}
+
+let renderer: ReactTestRenderer | null = null
+afterEach(() => {
+ act(() => renderer?.unmount())
+ renderer = null
+ seen.covered = false
+ seen.membersObserving = []
+ seen.rowsSubscribed = []
+})
+
+describe('MobileFolderSourceControlPanel', () => {
+ it('pauses row status under the create form while the folder members stay live', () => {
+ seen.covered = true
+ act(() => {
+ renderer = create(
+ createElement(MobileFolderSourceControlPanel, {
+ hostId: 'host-1',
+ folderWorktreeId: 'folder:f-1',
+ name: 'payments',
+ embedded: true
+ })
+ )
+ })
+
+ expect(seen.rowsSubscribed.at(-1)).toBe(false)
+ expect(seen.membersObserving.at(-1)).toBe(true)
+ })
+})
diff --git a/mobile/src/source-control/folder/MobileFolderSourceControlPanel.tsx b/mobile/src/source-control/folder/MobileFolderSourceControlPanel.tsx
index f27ba094d7b..e3d21ea0539 100644
--- a/mobile/src/source-control/folder/MobileFolderSourceControlPanel.tsx
+++ b/mobile/src/source-control/folder/MobileFolderSourceControlPanel.tsx
@@ -24,9 +24,14 @@ import { getWorktreeRowIdentity } from '../../worktree/worktree-host-row-identit
import { MobileSourceControlHeader } from '../MobileSourceControlHeader'
import { MobileSourceControlPanel } from '../MobileSourceControlPanel'
import { styles as sourceControlStyles } from '../mobile-source-control-styles'
+import { MobileFolderEmptyState } from './MobileFolderEmptyState'
+import { useFolderCreateFlow } from './use-folder-create-flow'
import { MobileFolderWorktreeRow } from './MobileFolderWorktreeRow'
+import { useOptionalHostProtocolGates } from '../../components/host-protocol-gates-context'
import { useMobileFolderAttachedWorktrees } from './use-mobile-folder-attached-worktrees'
+const NO_CAPABILITIES: readonly string[] = []
+
type Props = {
hostId: string
folderWorktreeId: string
@@ -61,8 +66,22 @@ export function MobileFolderSourceControlPanel({
const observing = focused && !pageOpen
const { folder, worktrees, desktopCapabilities, serverHosts, connState, loadError, refetch } =
useMobileFolderAttachedWorktrees(hostId, folderWorktreeId, observing)
+ // In a server's scope these are the server's own; otherwise the desktop's.
+ const folderHostGates = useOptionalHostProtocolGates()
const forceReconnect = useForceReconnect()
const [refreshers] = useState(() => new Set<() => void>())
+ const createFlow = useFolderCreateFlow({
+ hostId,
+ folderWorktreeId,
+ executionHost: folder?.hostId?.startsWith('runtime:') ? folder.hostId : undefined,
+ desktopCapabilities,
+ members: worktrees,
+ observing,
+ refetch,
+ bottomInset: insets.bottom
+ })
+ // Rows and repositories under a create form wait; the folder's members stay live so creates still reconcile.
+ const statusObserving = observing && !createFlow.covered
const refresh = () => {
refetch()
for (const refreshNow of refreshers) {
@@ -118,13 +137,17 @@ export function MobileFolderSourceControlPanel({
title={t('sourceControl.panel.unavailableTitle', 'Source Control Unavailable')}
/>
) : worktrees.length === 0 ? (
-
+ void createFlow.onCreate(repo, target, client, createName)
+ }
+ bottomInset={insets.bottom}
/>
) : (
// One card per attached worktree, as desktop shows them.
@@ -141,7 +164,7 @@ export function MobileFolderSourceControlPanel({
serverHosts.find((server) => server.hostId === worktree.hostId)?.relay ===
'update-needed'
}
- subscribed={observing}
+ subscribed={statusObserving}
refreshers={refreshers}
onOpen={open}
/>
@@ -160,6 +183,8 @@ export function MobileFolderSourceControlPanel({
)}
{/* Every state shares the sheet surface the cards sit on, as the phone's option sheets do. */}
{body}
+ {createFlow.toastElement}
+ {createFlow.composerElement}
)
return (
diff --git a/mobile/src/source-control/folder/folder-repo-worktree-create.test.ts b/mobile/src/source-control/folder/folder-repo-worktree-create.test.ts
new file mode 100644
index 00000000000..e89ca544001
--- /dev/null
+++ b/mobile/src/source-control/folder/folder-repo-worktree-create.test.ts
@@ -0,0 +1,332 @@
+import { afterEach, describe, expect, it, vi } from 'vitest'
+import { FakeSession } from '../../transport/connection/mobile-endpoint-supervisor-test-fakes'
+import { markRpcDeliveryUnknown } from '../../transport/rpc/rpc-delivery-ambiguity'
+import type { RpcResponse } from '../../transport/rpc/rpc-wire-types'
+import {
+ beginFolderComposerSubmission,
+ createFolderRepoWorktree,
+ isFolderRepoCreateBusy,
+ reconcileFolderRepoCreates,
+ releaseFolderComposerReservation,
+ type FolderRepoTarget
+} from './folder-repo-worktree-create'
+
+const idempotency = vi.hoisted(() => {
+ const state: { support: { dedupeTtlMs: number } | false } = { support: false }
+ return state
+})
+vi.mock('../../tasks/worktree-create-capability', () => ({
+ readNewWorktreeRuntimeCapabilities: async () => ({
+ worktreeCreateIdempotency: idempotency.support
+ })
+}))
+
+const FOLDER = 'folder:f-1'
+const TAKEN = 'Branch payments already exists\nworktree_create_exact_name_taken'
+
+afterEach(() => {
+ vi.useRealTimers()
+ idempotency.support = false
+})
+
+let repoCount = 0
+// Each test's own repository: the registry is shared, as it is across screens.
+function target(executionHost?: string): FolderRepoTarget {
+ repoCount += 1
+ return { hostId: 'host-1', executionHost, folderWorktreeId: FOLDER, repoId: `repo-${repoCount}` }
+}
+
+function refused(message: string): RpcResponse {
+ return { id: '1', ok: false, error: { code: 'x', message }, _meta: { runtimeId: 'r' } }
+}
+
+const CREATED: RpcResponse = {
+ id: '1',
+ ok: true,
+ result: { worktree: { id: 'repo::/w/payments', displayName: 'payments' } },
+ _meta: { runtimeId: 'r' }
+}
+
+function host(...replies: (RpcResponse | Error)[]): FakeSession {
+ const client = new FakeSession('connected')
+ for (const reply of replies) {
+ if (reply instanceof Error) {
+ client.sendRequest.mockRejectedValueOnce(reply)
+ } else {
+ client.sendRequest.mockResolvedValueOnce(reply)
+ }
+ }
+ return client
+}
+
+const create = (repo: FolderRepoTarget, client: FakeSession) =>
+ createFolderRepoWorktree({ target: repo, client, name: 'payments' })
+
+describe('createFolderRepoWorktree', () => {
+ it('sends one exact-name create attached to the folder', async () => {
+ const repo = target()
+ const client = host(CREATED)
+
+ await expect(create(repo, client)).resolves.toEqual({ kind: 'created', name: 'payments' })
+ expect(client.sendRequest.mock.calls).toEqual([
+ [
+ 'worktree.create',
+ {
+ repo: `id:${repo.repoId}`,
+ name: 'payments',
+ displayName: 'payments',
+ displayNameKind: 'user',
+ branchIntent: 'create-exact',
+ setupDecision: 'inherit',
+ parentWorkspace: FOLDER,
+ parentWorkspaceOrigin: 'manual'
+ },
+ expect.anything()
+ ]
+ ])
+ })
+
+ it('sends nothing for a second tap while the first create runs', async () => {
+ const repo = target()
+ const client = new FakeSession('connected')
+ let answer: (response: RpcResponse) => void = () => {}
+ client.sendRequest.mockReturnValue(new Promise((resolve) => (answer = resolve)))
+
+ const first = create(repo, client)
+ await expect(create(repo, client)).resolves.toEqual({ kind: 'already-running' })
+ answer(CREATED)
+ await first
+ expect(client.sendRequest).toHaveBeenCalledTimes(1)
+ })
+
+ it.each([
+ ['the name is taken', TAKEN],
+ ['the repo asks about setup', 'Setup decision required for this repository']
+ ])('keeps the repository for the composer when %s', async (_case, message) => {
+ const repo = target()
+ const outcome = await create(repo, host(refused(message)))
+
+ expect(outcome.kind).toBe('needs-composer')
+ expect(isFolderRepoCreateBusy(repo)).toBe(true)
+ if (outcome.kind === 'needs-composer') {
+ releaseFolderComposerReservation(repo, outcome.reservation)
+ }
+ expect(isFolderRepoCreateBusy(repo)).toBe(false)
+ })
+
+ it('treats a lost reply as possibly created, past the busy backstop, and never offers the composer', async () => {
+ vi.useFakeTimers({ toFake: ['setTimeout'] })
+ const repo = target()
+ const lost = markRpcDeliveryUnknown(new Error('connection lost'))
+
+ await expect(create(repo, host(lost))).resolves.toEqual({ kind: 'maybe-created' })
+ expect(isFolderRepoCreateBusy(repo)).toBe(true)
+ await expect(create(repo, host(CREATED))).resolves.toEqual({ kind: 'already-running' })
+
+ // The list never showed it; the card takes taps again but the create is still unresolved.
+ vi.advanceTimersByTime(60_000)
+ expect(isFolderRepoCreateBusy(repo)).toBe(false)
+ const retry = host(refused(TAKEN))
+ await expect(create(repo, retry)).resolves.toEqual({ kind: 'maybe-created' })
+ expect(retry.sendRequest).toHaveBeenCalledTimes(1)
+ })
+
+ it('retries an unconfirmed create as the name it was sent as, even after the folder is renamed', async () => {
+ vi.useFakeTimers({ toFake: ['setTimeout'] })
+ const repo = target()
+ await create(repo, host(markRpcDeliveryUnknown(new Error('connection lost'))))
+ vi.advanceTimersByTime(60_000)
+
+ const retry = host(refused(TAKEN))
+ await createFolderRepoWorktree({ target: repo, client: retry, name: 'billing' })
+ expect(retry.sendRequest.mock.calls[0]?.[1]).toMatchObject({ name: 'payments' })
+ })
+
+ it('asks for setup when an unconfirmed create is refused for it, and resends the same exact name', async () => {
+ vi.useFakeTimers({ toFake: ['setTimeout'] })
+ const repo = target()
+ await create(repo, host(markRpcDeliveryUnknown(new Error('connection lost'))))
+ vi.advanceTimersByTime(60_000)
+
+ const asked = await create(repo, host(refused('Setup decision required for this repository')))
+ expect(asked.kind).toBe('needs-setup-choice')
+ expect(isFolderRepoCreateBusy(repo)).toBe(false)
+ const hold = asked.kind === 'needs-setup-choice' ? asked.hold : -1
+
+ const resent = host(refused(TAKEN))
+ await expect(
+ createFolderRepoWorktree({
+ target: repo,
+ client: resent,
+ name: 'billing',
+ skipSetupFor: hold
+ })
+ ).resolves.toEqual({ kind: 'maybe-created' })
+ expect(resent.sendRequest.mock.calls[0]?.[1]).toMatchObject({
+ name: 'payments',
+ branchIntent: 'create-exact',
+ setupDecision: 'skip'
+ })
+ })
+
+ it('sends nothing for a setup choice once its create is listed or replaced', async () => {
+ vi.useFakeTimers({ toFake: ['setTimeout'] })
+ const ask = async (repo: FolderRepoTarget) => {
+ await create(repo, host(markRpcDeliveryUnknown(new Error('connection lost'))))
+ vi.advanceTimersByTime(60_000)
+ const asked = await create(repo, host(refused('Setup decision required for this repository')))
+ return asked.kind === 'needs-setup-choice' ? asked.hold : -1
+ }
+ const listed = target()
+ const listedHold = await ask(listed)
+ const folder = { hostId: 'host-1', executionHost: undefined, folderWorktreeId: FOLDER }
+ reconcileFolderRepoCreates(folder, [{ repoId: listed.repoId }])
+ const replaced = target()
+ const replacedHold = await ask(replaced)
+ await ask(replaced)
+
+ const late = host(CREATED)
+ for (const [repo, hold] of [
+ [listed, listedHold],
+ [replaced, replacedHold]
+ ] as const) {
+ await expect(
+ createFolderRepoWorktree({
+ target: repo,
+ client: late,
+ name: 'billing',
+ skipSetupFor: hold
+ })
+ ).resolves.toEqual({ kind: 'checking' })
+ }
+ expect(late.sendRequest).not.toHaveBeenCalled()
+ })
+})
+
+describe('createFolderRepoWorktree after a lost reply on a host that dedupes', () => {
+ it.each([
+ ['answers with the worktree', CREATED, { kind: 'created', name: 'payments' }],
+ ['refuses the name as taken', refused(TAKEN), { kind: 'maybe-created' }]
+ ])('resends the same create once reconnected; the host %s', async (_case, replay, expected) => {
+ idempotency.support = { dedupeTtlMs: 60_000 }
+ const repo = target()
+ const client = new FakeSession('connected')
+ client.sendRequest
+ .mockImplementationOnce(async () => {
+ client.publishState('reconnecting')
+ setTimeout(() => client.publishState('connected'), 0)
+ throw markRpcDeliveryUnknown(new Error('connection lost'))
+ })
+ .mockResolvedValueOnce(replay)
+
+ await expect(create(repo, client)).resolves.toEqual(expected)
+ const [first, second] = client.sendRequest.mock.calls.map(([, params]) => params)
+ expect(second).toEqual(first)
+ expect(first).toHaveProperty('clientMutationId')
+ })
+})
+
+describe('reconcileFolderRepoCreates', () => {
+ it('forgets a create once the folder lists its worktree on the same host, not another', async () => {
+ const repo = target('runtime:env-1')
+ await create(repo, host(CREATED))
+ const folder = { hostId: 'host-1', executionHost: 'runtime:env-1', folderWorktreeId: FOLDER }
+
+ reconcileFolderRepoCreates(folder, [{ repoId: repo.repoId, hostId: 'runtime:env-2' }])
+ expect(isFolderRepoCreateBusy(repo)).toBe(true)
+ reconcileFolderRepoCreates(folder, [{ repoId: repo.repoId, hostId: 'runtime:env-1' }])
+ expect(isFolderRepoCreateBusy(repo)).toBe(false)
+ })
+
+ it('keeps a create still on its way even if the list already shows the repository', async () => {
+ const repo = target()
+ const client = new FakeSession('connected')
+ let answer: (response: RpcResponse) => void = () => {}
+ client.sendRequest.mockReturnValue(new Promise((resolve) => (answer = resolve)))
+ const folder = { hostId: 'host-1', executionHost: undefined, folderWorktreeId: FOLDER }
+ const members = [{ repoId: repo.repoId }]
+
+ const pending = create(repo, client)
+ reconcileFolderRepoCreates(folder, members)
+ expect(isFolderRepoCreateBusy(repo)).toBe(true)
+ answer(CREATED)
+ await pending
+ reconcileFolderRepoCreates(folder, members)
+ expect(isFolderRepoCreateBusy(repo)).toBe(false)
+ })
+
+ it("doesn't let an earlier create's timer end a newer one", async () => {
+ vi.useFakeTimers({ toFake: ['setTimeout'] })
+ const repo = target()
+ await create(repo, host(markRpcDeliveryUnknown(new Error('lost'))))
+ vi.advanceTimersByTime(10_000)
+ const folder = { hostId: 'host-1', executionHost: undefined, folderWorktreeId: FOLDER }
+ reconcileFolderRepoCreates(folder, [{ repoId: repo.repoId }])
+ await create(repo, host(CREATED))
+
+ vi.advanceTimersByTime(10_000)
+ expect(isFolderRepoCreateBusy(repo)).toBe(true)
+ })
+})
+
+describe('beginFolderComposerSubmission', () => {
+ async function composing() {
+ const repo = target()
+ const outcome = await create(repo, host(refused(TAKEN)))
+ if (outcome.kind !== 'needs-composer') {
+ throw new Error('expected the composer')
+ }
+ return { repo, launch: { target: repo, reservation: outcome.reservation, name: 'payments' } }
+ }
+
+ it('admits one create per repository while it is out, even after the form closes', async () => {
+ const { repo, launch } = await composing()
+ let formOpen = true
+ const submission = beginFolderComposerSubmission(repo, launch, () => formOpen)
+
+ expect(submission).not.toBeNull()
+ formOpen = false
+ releaseFolderComposerReservation(repo, launch.reservation)
+ expect(beginFolderComposerSubmission(repo, launch, () => true)).toBeNull()
+ expect(await create(repo, host(CREATED))).toEqual({ kind: 'already-running' })
+
+ submission?.settle('uncertain')
+ expect(isFolderRepoCreateBusy(repo)).toBe(true)
+ })
+
+ it('gives a refused create back to the open form, and a same-host switch its own admission', async () => {
+ const { repo, launch } = await composing()
+ const other = { ...repo, repoId: `${repo.repoId}-other` }
+
+ beginFolderComposerSubmission(repo, launch, () => true)?.settle('failed')
+ expect(isFolderRepoCreateBusy(repo)).toBe(true)
+ const switched = beginFolderComposerSubmission(other, launch, () => true)
+ expect(switched).not.toBeNull()
+ expect(beginFolderComposerSubmission(other, launch, () => true)).toBeNull()
+ switched?.settle('created')
+ releaseFolderComposerReservation(repo, launch.reservation)
+ expect(isFolderRepoCreateBusy(repo)).toBe(false)
+ expect(isFolderRepoCreateBusy(other)).toBe(true)
+ })
+ it("never sends anything from a card for a form's unconfirmed create, whatever name it used", async () => {
+ vi.useFakeTimers({ toFake: ['setTimeout'] })
+ const { repo, launch } = await composing()
+ // The form may have sent another name or branch than the card's.
+ beginFolderComposerSubmission(repo, launch, () => true)?.settle('uncertain')
+ vi.advanceTimersByTime(60_000)
+
+ expect(beginFolderComposerSubmission(repo, launch, () => true)).toBeNull()
+ const tap = host(CREATED)
+ await expect(create(repo, tap)).resolves.toEqual({ kind: 'checking' })
+ await expect(
+ createFolderRepoWorktree({
+ target: repo,
+ client: tap,
+ name: 'payments',
+ skipSetupFor: 0
+ })
+ ).resolves.toEqual({ kind: 'checking' })
+ expect(tap.sendRequest).not.toHaveBeenCalled()
+ expect(isFolderRepoCreateBusy(repo)).toBe(false)
+ })
+})
diff --git a/mobile/src/source-control/folder/folder-repo-worktree-create.ts b/mobile/src/source-control/folder/folder-repo-worktree-create.ts
new file mode 100644
index 00000000000..f4828651a62
--- /dev/null
+++ b/mobile/src/source-control/folder/folder-repo-worktree-create.ts
@@ -0,0 +1,310 @@
+import { WORKTREE_CREATE_EXACT_NAME_TAKEN_CODE } from '../../../../src/shared/new-workspace/worktree-create-collision'
+import { hasRuntimeRpcErrorCode } from '../../../../src/shared/runtime-rpc-error-code'
+import type { RpcClient } from '../../transport/rpc/rpc-client-contract'
+import { isRpcDeliveryUnknown } from '../../transport/rpc/rpc-delivery-ambiguity'
+import { readNewWorktreeRuntimeCapabilities } from '../../tasks/worktree-create-capability'
+import { createWorktreeWithNameRetry } from '../../tasks/worktree-create-retry'
+
+// The host's refusal before creating, when the repo asks to run or skip setup; desktop matches the same text.
+const SETUP_DECISION_REQUIRED = 'Setup decision required for this repository'
+
+// How long a created or unconfirmed card stays busy waiting for the list; the outcome itself is kept until it shows.
+const HELD_BUSY_MS = 15_000
+
+/** One repository of one folder on one host. */
+export type FolderRepoTarget = {
+ hostId: string
+ /** The folder's server; undefined for the paired desktop's own. */
+ executionHost: string | undefined
+ /** `folder:`. */
+ folderWorktreeId: string
+ repoId: string
+}
+
+type Phase =
+ /** The direct exact-name create is out. */
+ | 'creating'
+ /** Refused before creating; a composer for it is open and nothing has been sent from it. */
+ | 'composing'
+ /** The composer sent its create. */
+ | 'submitting'
+ /** Created, or possibly created: kept until the folder's members show it. */
+ | 'held'
+
+/**
+ * `name` is the exact name a direct create was sent as, so an unresolved one is retried as itself.
+ * A composer's create may have used another name or branch, so it is never resent from a card.
+ */
+type Operation = FolderRepoTarget & {
+ id: number
+ phase: Phase
+ busy: boolean
+ name: string
+ origin: 'direct' | 'composer'
+}
+
+// In memory and shared across screens, so a remount or a reopened composer can't send a second create.
+const operations = new Map()
+const listeners = new Set<() => void>()
+let nextId = 1
+let version = 0
+
+function notify(): void {
+ version += 1
+ listeners.forEach((listener) => listener())
+}
+
+export function folderRepoCreateKey(target: FolderRepoTarget): string {
+ return [target.hostId, target.executionHost ?? '', target.folderWorktreeId, target.repoId].join(
+ '\0'
+ )
+}
+
+export function subscribeFolderRepoCreates(listener: () => void): () => void {
+ listeners.add(listener)
+ return () => listeners.delete(listener)
+}
+
+export function getFolderRepoCreatesVersion(): number {
+ return version
+}
+
+/** The card shows a spinner and takes no taps while its repository's create is busy. */
+export function isFolderRepoCreateBusy(target: FolderRepoTarget): boolean {
+ return operations.get(folderRepoCreateKey(target))?.busy === true
+}
+
+function start(
+ target: FolderRepoTarget,
+ phase: Phase,
+ name: string,
+ origin: Operation['origin']
+): Operation {
+ const operation = { ...target, id: nextId++, phase, busy: true, name, origin }
+ operations.set(folderRepoCreateKey(target), operation)
+ notify()
+ return operation
+}
+
+function isCurrent(operation: Operation): boolean {
+ return operations.get(folderRepoCreateKey(operation))?.id === operation.id
+}
+
+function release(operation: Operation): void {
+ if (isCurrent(operation)) {
+ operations.delete(folderRepoCreateKey(operation))
+ notify()
+ }
+}
+
+function hold(operation: Operation, busy = true): number | undefined {
+ if (!isCurrent(operation)) {
+ return undefined
+ }
+ // A new identity, so an earlier hold's timer can't end this one.
+ const held = { ...operation, id: nextId++, phase: 'held' as const, busy }
+ operations.set(folderRepoCreateKey(held), held)
+ notify()
+ if (!busy) {
+ return held.id
+ }
+ setTimeout(() => {
+ if (isCurrent(held)) {
+ operations.set(folderRepoCreateKey(held), { ...held, busy: false })
+ notify()
+ }
+ }, HELD_BUSY_MS)
+ return held.id
+}
+
+/** Whether `hold` is still this repository's unconfirmed direct create, waiting for a setup choice. */
+export function isFolderRepoHoldPending(target: FolderRepoTarget, hold: number): boolean {
+ const operation = operations.get(folderRepoCreateKey(target))
+ return operation?.id === hold && operation.phase === 'held' && operation.origin === 'direct'
+}
+
+/** Forgets created or unconfirmed creates once the folder lists a worktree from that repository on that host. */
+export function reconcileFolderRepoCreates(
+ folder: Pick,
+ members: readonly { repoId: string; hostId?: string }[]
+): void {
+ let changed = false
+ for (const [key, operation] of operations) {
+ if (
+ operation.phase === 'held' &&
+ operation.hostId === folder.hostId &&
+ operation.executionHost === folder.executionHost &&
+ operation.folderWorktreeId === folder.folderWorktreeId &&
+ members.some(
+ (member) =>
+ member.repoId === operation.repoId &&
+ (member.hostId?.startsWith('runtime:') ? member.hostId : undefined) ===
+ operation.executionHost
+ )
+ ) {
+ operations.delete(key)
+ changed = true
+ }
+ }
+ if (changed) {
+ notify()
+ }
+}
+
+export type FolderRepoCreateOutcome =
+ | { kind: 'created'; name: string; warning?: string }
+ /** Refused before creating: a branch with that name exists, or the repo asks to run or skip setup. The repository stays reserved for the composer. */
+ | { kind: 'needs-composer'; reservation: number }
+ /** The host may have created it: the reply was lost, or a resend was refused as taken. */
+ | { kind: 'maybe-created' }
+ /** An unconfirmed create's resend needs a setup choice; it is resent as the same exact name with it. */
+ | { kind: 'needs-setup-choice'; hold: number }
+ /** A composer's create is unconfirmed: nothing is sent, the folder is checked until it lists it. */
+ | { kind: 'checking' }
+ | { kind: 'failed'; message: string }
+ | { kind: 'already-running' }
+
+/**
+ * Creates a worktree named after the folder in one of its repositories, attached to the folder, the
+ * way desktop's empty state does. Only for hosts that advertise exact-name creation.
+ */
+export async function createFolderRepoWorktree(args: {
+ target: FolderRepoTarget
+ /** The client that creates: the desktop's own, or scoped to the folder's server. */
+ client: RpcClient
+ name: string
+ /** Resends this unconfirmed hold without setup; nothing is sent once the folder shows it or it is replaced. */
+ skipSetupFor?: number
+}): Promise {
+ const existing = operations.get(folderRepoCreateKey(args.target))
+ const staleResend =
+ args.skipSetupFor !== undefined && !isFolderRepoHoldPending(args.target, args.skipSetupFor)
+ if (!staleResend && existing && (existing.phase !== 'held' || existing.busy)) {
+ return { kind: 'already-running' }
+ }
+ if (staleResend || existing?.origin === 'composer') {
+ return { kind: 'checking' }
+ }
+ // An unconfirmed create is retried as the same exact name, even after a rename: a taken name may be its own.
+ const unresolved = existing !== undefined
+ const name = existing?.name ?? args.name
+ const operation = start(args.target, 'creating', name, 'direct')
+ const settleUnresolved = (outcome: FolderRepoCreateOutcome): FolderRepoCreateOutcome => {
+ hold(operation)
+ return outcome
+ }
+ try {
+ const result = await createWorktreeWithNameRetry({
+ client: args.client,
+ baseName: name,
+ // One exact name: a numbered suffix would be a worktree the user didn't ask for.
+ maxAttempts: 1,
+ branchIntentSupported: true,
+ worktreeCreateIdempotency: readNewWorktreeRuntimeCapabilities(args.client).then(
+ (capabilities) => capabilities?.worktreeCreateIdempotency ?? false
+ ),
+ buildParams: (name) => ({
+ repo: `id:${args.target.repoId}`,
+ name,
+ displayName: name,
+ displayNameKind: 'user',
+ branchIntent: 'create-exact',
+ setupDecision: args.skipSetupFor === undefined ? 'inherit' : 'skip',
+ parentWorkspace: args.target.folderWorktreeId,
+ parentWorkspaceOrigin: 'manual'
+ })
+ })
+ if (!('error' in result)) {
+ hold(operation)
+ return {
+ kind: 'created',
+ name: result.name,
+ ...(result.warning ? { warning: result.warning } : {})
+ }
+ }
+ const taken = hasRuntimeRpcErrorCode(result.error, WORKTREE_CREATE_EXACT_NAME_TAKEN_CODE)
+ if (taken && (result.replayed || unresolved)) {
+ return settleUnresolved({ kind: 'maybe-created' })
+ }
+ const needsSetup = result.error.includes(SETUP_DECISION_REQUIRED)
+ if (unresolved && needsSetup) {
+ // That refusal did no git work, but says nothing about the earlier create; it stays unconfirmed.
+ const held = hold(operation, false)
+ return held === undefined
+ ? { kind: 'maybe-created' }
+ : { kind: 'needs-setup-choice', hold: held }
+ }
+ if (unresolved) {
+ return settleUnresolved({ kind: 'failed', message: result.error })
+ }
+ if (taken || needsSetup) {
+ const reserved = { ...operation, phase: 'composing' as const }
+ operations.set(folderRepoCreateKey(reserved), reserved)
+ notify()
+ return { kind: 'needs-composer', reservation: reserved.id }
+ }
+ release(operation)
+ return { kind: 'failed', message: result.error }
+ } catch (error) {
+ // Delivery unknown: the host may have created it, and a fresh create would be refused as taken.
+ if (isRpcDeliveryUnknown(error) || unresolved) {
+ return settleUnresolved({ kind: 'maybe-created' })
+ }
+ release(operation)
+ return { kind: 'failed', message: error instanceof Error ? error.message : String(error) }
+ }
+}
+
+/** A composer closed before sending anything gives its repository back. */
+export function releaseFolderComposerReservation(
+ target: FolderRepoTarget,
+ reservation: number
+): void {
+ const operation = operations.get(folderRepoCreateKey(target))
+ if (operation?.id === reservation && operation.phase === 'composing') {
+ release(operation)
+ }
+}
+
+export type FolderComposerSubmission = {
+ /** `created` and `uncertain` are kept until the folder shows them; `failed` and `cancelled` give the repository back. */
+ settle: (outcome: 'created' | 'uncertain' | 'failed' | 'cancelled') => void
+}
+
+/**
+ * Admits the composer's create for the repository it actually picked, before anything is sent.
+ * Null while another create for that repository is out.
+ */
+export function beginFolderComposerSubmission(
+ target: FolderRepoTarget,
+ launch: { target: FolderRepoTarget; reservation: number; name: string },
+ /** Whether the composer is still open to retry a refused create. */
+ formOpen: () => boolean
+): FolderComposerSubmission | null {
+ const key = folderRepoCreateKey(target)
+ const existing = operations.get(key)
+ const ownsReservation =
+ key === folderRepoCreateKey(launch.target) &&
+ existing?.id === launch.reservation &&
+ existing.phase === 'composing'
+ if (existing && !ownsReservation) {
+ return null
+ }
+ const operation = start(target, 'submitting', launch.name, 'composer')
+ return {
+ settle: (outcome) => {
+ if (outcome === 'created' || outcome === 'uncertain') {
+ hold(operation)
+ return
+ }
+ // A refusal leaves the form to try again; the reservation is back with the launch's repository.
+ if (ownsReservation && formOpen() && isCurrent(operation)) {
+ const reserved = { ...operation, phase: 'composing' as const, id: launch.reservation }
+ operations.set(key, reserved)
+ notify()
+ return
+ }
+ release(operation)
+ }
+ }
+}
diff --git a/mobile/src/source-control/folder/folder-source-repos-query.test.ts b/mobile/src/source-control/folder/folder-source-repos-query.test.ts
new file mode 100644
index 00000000000..523143d4bc8
--- /dev/null
+++ b/mobile/src/source-control/folder/folder-source-repos-query.test.ts
@@ -0,0 +1,124 @@
+import { createElement } from 'react'
+import { act, create, type ReactTestRenderer } from 'react-test-renderer'
+import { afterEach, describe, expect, it, vi } from 'vitest'
+import { stubRpcClient } from '../../transport/rpc/rpc-client-test-stub'
+import { useHostQuery } from '../../query/host-query'
+import { scopeRpcClientToExecutionHost } from '../../worktree/execution-host-scoped-rpc-client'
+import {
+ documentQueryClient,
+ settleQueryNotifications
+} from '../../test-support/rpc-recording/hook-mount'
+import { FakeSession } from '../../transport/connection/mobile-endpoint-supervisor-test-fakes'
+import {
+ folderSourceCatalogQuery,
+ serverFolderSourceCatalogQuery,
+ selectFolderSourceRepos
+} from './folder-source-repos-query'
+
+vi.mock('react-native', () => ({ AppState: {} }))
+
+const GROUP = {
+ id: 'group-1',
+ name: 'payments',
+ parentPath: '/src/payments',
+ parentGroupId: null,
+ createdFrom: 'folder',
+ tabOrder: 0,
+ isCollapsed: false,
+ color: null,
+ createdAt: 1,
+ updatedAt: 1
+}
+
+function hostWith(repos: unknown[]): FakeSession {
+ const client = new FakeSession('connected')
+ client.sendRequest.mockImplementation(async (method: string) => ({
+ id: '1',
+ ok: true,
+ result: method === 'repo.list' ? { repos } : { groups: [GROUP] },
+ _meta: { runtimeId: 'r' }
+ }))
+ return client
+}
+
+const repo = (id: string, path: string) => ({
+ id,
+ path,
+ displayName: id,
+ kind: 'git',
+ badgeColor: 'gray',
+ addedAt: 1
+})
+
+describe('folder source repositories', () => {
+ it("offers a relayed server's repos in its folder", async () => {
+ const client = hostWith([repo('api', '/src/payments/api'), repo('elsewhere', '/src/other')])
+ const catalog = await serverFolderSourceCatalogQuery.fetch!(
+ client,
+ { exec: 'runtime:env-1' },
+ {},
+ undefined,
+ { live: false, previousFromStore: false }
+ )
+
+ expect(selectFolderSourceRepos(catalog, 'group-1').map((found) => found.id)).toEqual(['api'])
+ })
+})
+
+describe('folder source catalog reads', () => {
+ let renderer: ReactTestRenderer | null = null
+ const queries = documentQueryClient()
+ afterEach(async () => {
+ act(() => renderer?.unmount())
+ renderer = null
+ await queries.end()
+ })
+
+ it.each([true, false])(
+ "reads a server folder's catalog on the desktop's one event stream (subscribed: %s)",
+ async (subscribed) => {
+ let eventStreams = 0
+ const desktop = stubRpcClient({
+ getLastConnectedAt: () => 1,
+ sendRequest: async (method) => ({
+ id: '1',
+ ok: true,
+ result: method === 'repo.list' ? { repos: [] } : { groups: [GROUP] },
+ _meta: { runtimeId: 'r' }
+ }),
+ subscribe: (method) => {
+ if (method === 'runtime.clientEvents.subscribe') {
+ eventStreams += 1
+ }
+ return () => {}
+ }
+ })
+ const server = scopeRpcClientToExecutionHost(desktop, 'runtime:env-1')
+ function Harness(): null {
+ useHostQuery(
+ folderSourceCatalogQuery,
+ { hostId: 'host-1', client: desktop },
+ { exec: 'local' },
+ {},
+ {
+ subscribed: true
+ }
+ )
+ useHostQuery(
+ serverFolderSourceCatalogQuery,
+ { hostId: 'host-1', client: server },
+ { exec: 'runtime:env-1' },
+ {},
+ { subscribed }
+ )
+ return null
+ }
+ await act(async () => {
+ renderer = create(queries.wrap(createElement(Harness)))
+ })
+ await settleQueryNotifications()
+
+ expect(eventStreams).toBe(1)
+ }
+ )
+})
diff --git a/mobile/src/source-control/folder/folder-source-repos-query.ts b/mobile/src/source-control/folder/folder-source-repos-query.ts
new file mode 100644
index 00000000000..777b3c8fc26
--- /dev/null
+++ b/mobile/src/source-control/folder/folder-source-repos-query.ts
@@ -0,0 +1,73 @@
+import type { Repo } from '../../../../src/shared/repo-types'
+import type { ProjectGroup } from '../../../../src/shared/project-group-types'
+import { getFolderSourceRepos } from '../../../../src/shared/folder-workspaces/folder-workspace-source-repos'
+import {
+ LOCAL_EXECUTION_HOST_ID,
+ getRepoExecutionHostId,
+ getSshTargetIdForExecutionHost
+} from '../../../../src/shared/execution-host'
+import { defineHostQuery } from '../../query/host-query'
+import type { HostQueryTarget } from '../../query/host-query-key'
+import type { RpcClient } from '../../transport/rpc/rpc-client-contract'
+import { hostProjectGroupsRead } from '../../worktree/project-sections-operations'
+import { listHostRepos, listServerRepos } from '../../worktree/server-repos'
+
+export type FolderSourceCatalog = { repos: Repo[]; groups: ProjectGroup[] }
+
+const NO_REPOS: Repo[] = []
+
+const fetchFolderSourceCatalog = async (
+ client: RpcClient,
+ target: HostQueryTarget
+): Promise => {
+ const server = target.exec === LOCAL_EXECUTION_HOST_ID ? null : target.exec
+ const [repos, groupsRead] = await Promise.all([
+ server ? listServerRepos(server, client) : listHostRepos(client),
+ hostProjectGroupsRead.request(client).then((reply) => hostProjectGroupsRead.interpret(reply))
+ ])
+ if (!repos || !groupsRead.accepted) {
+ throw new Error('Folder repositories unavailable')
+ }
+ // Repos from a server come stamped with it; its groups must match, or the host check drops every repo.
+ const groups = server
+ ? groupsRead.value.map((group) => ({ ...group, executionHostId: server }))
+ : groupsRead.value
+ return { repos, groups }
+}
+
+/** The paired desktop's own repositories and project groups, re-read when its repos change. */
+export const folderSourceCatalogQuery = defineHostQuery, FolderSourceCatalog>(
+ {
+ family: 'folder.sourceCatalog',
+ fetch: fetchFolderSourceCatalog,
+ staleTime: 60_000,
+ refetchOnWindowFocus: true,
+ signal: { events: ['reposChanged'] }
+ }
+)
+
+// A relayed server's changes are not signalled, so its reads hold no event stream; focus and refresh read again.
+export const serverFolderSourceCatalogQuery = defineHostQuery<
+ Record,
+ FolderSourceCatalog
+>({
+ family: 'folder.sourceCatalog.server',
+ fetch: fetchFolderSourceCatalog,
+ staleTime: 60_000,
+ refetchOnWindowFocus: true
+})
+
+/** The folder's repositories a worktree can be created in, as desktop's empty state lists them. */
+export function selectFolderSourceRepos(
+ catalog: FolderSourceCatalog | undefined,
+ projectGroupId: string | null
+): Repo[] {
+ if (!catalog || !projectGroupId) {
+ return NO_REPOS
+ }
+ const group = catalog.groups.find((candidate) => candidate.id === projectGroupId) ?? null
+ // Direct SSH hosts can't create worktrees from here (managed hosts route as runtimes).
+ return getFolderSourceRepos(catalog.repos, catalog.groups, group).filter(
+ (repo) => !getSshTargetIdForExecutionHost(getRepoExecutionHostId(repo))
+ )
+}
diff --git a/mobile/src/source-control/folder/mobile-folder-attached-worktrees.ts b/mobile/src/source-control/folder/mobile-folder-attached-worktrees.ts
index 5fbae1707b5..6ce2e8040b4 100644
--- a/mobile/src/source-control/folder/mobile-folder-attached-worktrees.ts
+++ b/mobile/src/source-control/folder/mobile-folder-attached-worktrees.ts
@@ -11,7 +11,7 @@ import { serializeFolderLineage } from './folder-lineage-serialization'
/** What a folder list row shows of a host row. */
export type FolderListRow = Pick<
Worktree,
- 'worktreeId' | 'hostId' | 'repo' | 'displayName' | 'branch'
+ 'worktreeId' | 'hostId' | 'repoId' | 'repo' | 'displayName' | 'branch'
>
type FolderLineageRow = MobileLineageRow & Pick
@@ -36,6 +36,7 @@ export function toFolderListRow(row: Worktree): FolderListRow {
listRow = {
worktreeId: row.worktreeId,
hostId: row.hostId,
+ repoId: row.repoId,
repo: row.repo,
displayName: row.displayName,
branch: row.branch
diff --git a/mobile/src/source-control/folder/use-folder-create-flow.test.tsx b/mobile/src/source-control/folder/use-folder-create-flow.test.tsx
new file mode 100644
index 00000000000..c59d2644858
--- /dev/null
+++ b/mobile/src/source-control/folder/use-folder-create-flow.test.tsx
@@ -0,0 +1,343 @@
+import { createElement, Fragment } from 'react'
+import { act, create, type ReactTestRenderer } from 'react-test-renderer'
+import { afterEach, describe, expect, it, vi } from 'vitest'
+import { FakeSession } from '../../transport/connection/mobile-endpoint-supervisor-test-fakes'
+import { markRpcDeliveryUnknown } from '../../transport/rpc/rpc-delivery-ambiguity'
+import type { RpcResponse } from '../../transport/rpc/rpc-wire-types'
+import type { NewWorktreeModalProps } from '../../components/new-worktree-modal-types'
+import type { FolderListRow } from './mobile-folder-attached-worktrees'
+import { isFolderRepoCreateBusy, type FolderRepoTarget } from './folder-repo-worktree-create'
+import { useFolderCreateFlow, type FolderCreateRepo } from './use-folder-create-flow'
+
+const seen = vi.hoisted(() => {
+ const state: {
+ composer: NewWorktreeModalProps | null
+ confirm: { visible: boolean; onConfirm?: () => void; onCancel: () => void } | null
+ toasts: string[]
+ haptics: number
+ } = { composer: null, confirm: null, toasts: [], haptics: 0 }
+ return state
+})
+vi.mock('react-native', () => ({ AppState: {} }))
+vi.mock('../../components/NewWorktreeModalController', () => ({
+ NewWorktreeModalController: (props: NewWorktreeModalProps) => {
+ seen.composer = props
+ return null
+ }
+}))
+vi.mock('../../components/ConfirmModal', () => ({
+ ConfirmModal: (props: { visible: boolean; onConfirm?: () => void; onCancel: () => void }) => {
+ seen.confirm = props
+ return null
+ }
+}))
+vi.mock('../../components/TransientToast', () => ({
+ TransientToast: () => null,
+ useTransientToast: () => ({
+ message: null,
+ showToast: (text: string) => seen.toasts.push(text)
+ })
+}))
+vi.mock('../../platform/haptics', () => ({
+ triggerSuccess: () => (seen.haptics += 1),
+ triggerError: () => (seen.haptics += 1)
+}))
+vi.mock('../../platform/external-link', () => ({ openExternalLink: () => {} }))
+vi.mock('../../transport/connection/host-client-hooks', () => ({
+ useHostClient: () => ({ client: null, state: 'connected' })
+}))
+vi.mock('../../tasks/worktree-create-capability', () => ({
+ readNewWorktreeRuntimeCapabilities: async () => ({ worktreeCreateIdempotency: false })
+}))
+vi.mock('../../i18n/use-mobile-translation', () => ({
+ useMobileTranslation: () => (_key: string, fallback: string) => fallback
+}))
+
+const FOLDER = 'folder:f-1'
+const TAKEN = 'Branch payments already exists\nworktree_create_exact_name_taken'
+const CREATED: RpcResponse = {
+ id: '1',
+ ok: true,
+ result: { worktree: { id: 'repo::/w/payments', displayName: 'payments' } },
+ _meta: { runtimeId: 'r' }
+}
+
+let repoCount = 0
+function repoIn(): { repo: FolderCreateRepo; target: FolderRepoTarget } {
+ repoCount += 1
+ const repoId = `flow-repo-${repoCount}`
+ return {
+ repo: { id: repoId, displayName: repoId },
+ target: { hostId: 'host-1', executionHost: undefined, folderWorktreeId: FOLDER, repoId }
+ }
+}
+
+function replying(reply: RpcResponse) {
+ const client = new FakeSession('connected')
+ let answer: () => void = () => {}
+ client.sendRequest.mockReturnValue(
+ new Promise((resolve) => (answer = () => resolve(reply)))
+ )
+ return { client, answer: () => answer() }
+}
+
+type Flow = ReturnType
+let renderer: ReactTestRenderer | null = null
+
+function mountFlow(refetch: () => void) {
+ const flow: { current: Flow | null } = { current: null }
+ let members: FolderListRow[] = []
+ function Harness() {
+ flow.current = useFolderCreateFlow({
+ hostId: 'host-1',
+ folderWorktreeId: FOLDER,
+ executionHost: undefined,
+ desktopCapabilities: [],
+ members,
+ observing: true,
+ refetch,
+ bottomInset: 0
+ })
+ return createElement(Fragment, null, flow.current.composerElement)
+ }
+ act(() => {
+ renderer = create(createElement(Harness))
+ })
+ return {
+ flow,
+ rerender: (next: FolderListRow[]) => {
+ members = next
+ act(() => renderer?.update(createElement(Harness)))
+ }
+ }
+}
+
+const composer = (): NewWorktreeModalProps => {
+ if (!seen.composer) {
+ throw new Error('the composer never rendered')
+ }
+ return seen.composer
+}
+
+afterEach(() => {
+ vi.useRealTimers()
+ act(() => renderer?.unmount())
+ renderer = null
+ seen.composer = null
+ seen.confirm = null
+ seen.toasts = []
+ seen.haptics = 0
+})
+
+describe('useFolderCreateFlow', () => {
+ it("keeps an open form when another repository's create lands", async () => {
+ const { flow, rerender } = mountFlow(() => {})
+ const b = repoIn()
+ const refusal = replying({ id: '1', ok: false, error: { code: 'x', message: TAKEN } })
+ const opening = flow.current!.onCreate(b.repo, b.target, refusal.client, 'payments')
+ refusal.answer()
+ await act(() => opening)
+ expect(composer().folderLaunch?.repoId).toBe(b.target.repoId)
+
+ const a = repoIn()
+ const creating = replying(CREATED)
+ const created = flow.current!.onCreate(a.repo, a.target, creating.client, 'payments')
+ creating.answer()
+ await act(() => created)
+ rerender([
+ {
+ worktreeId: 'a-child',
+ repoId: a.target.repoId,
+ repo: 'a',
+ displayName: 'payments',
+ branch: 'payments'
+ }
+ ])
+
+ expect(composer().visible).toBe(true)
+ expect(composer().folderLaunch?.repoId).toBe(b.target.repoId)
+ })
+
+ it('shows nothing for a create that lands after the screen is left, and still refreshes', async () => {
+ const refetch = vi.fn()
+ const { flow } = mountFlow(refetch)
+ const a = repoIn()
+ const creating = replying(CREATED)
+ const created = flow.current!.onCreate(a.repo, a.target, creating.client, 'payments')
+
+ act(() => renderer?.unmount())
+ renderer = null
+ creating.answer()
+ await created
+
+ expect(refetch).toHaveBeenCalled()
+ expect(seen.toasts).toEqual([])
+ expect(seen.haptics).toBe(0)
+ })
+
+ async function openComposer(flow: { current: Flow | null }, repo = repoIn()) {
+ const refusal = replying({ id: '1', ok: false, error: { code: 'x', message: TAKEN } })
+ const opening = flow.current!.onCreate(repo.repo, repo.target, refusal.client, 'payments')
+ refusal.answer()
+ await act(() => opening)
+ return composer()
+ }
+
+ it("doesn't let an earlier form's close end a newer one", async () => {
+ const { flow } = mountFlow(() => {})
+ const open = () => openComposer(flow)
+ const first = await open()
+ act(() => first.onClose())
+ const second = await open()
+
+ act(() => first.onClose())
+ expect(composer().visible).toBe(true)
+ expect(composer().folderLaunch?.repoId).toBe(second.folderLaunch?.repoId)
+ })
+ it("shows nothing for an earlier form's create once a newer form is open", async () => {
+ const { flow } = mountFlow(() => {})
+ const first = await openComposer(flow)
+ act(() => first.onClose())
+ const second = await openComposer(flow)
+
+ expect(first.folderLaunch?.submit.presenting()).toBe(false)
+ act(() => first.onCreated('repo::/w/payments-2', 'payments-2'))
+ expect(seen.toasts).toEqual([])
+ expect(second.folderLaunch?.submit.presenting()).toBe(true)
+ })
+
+ it('gives the repository back when the screen is left with an unsent form', async () => {
+ const { flow } = mountFlow(() => {})
+ const repo = repoIn()
+ await openComposer(flow, repo)
+ expect(isFolderRepoCreateBusy(repo.target)).toBe(true)
+
+ act(() => renderer?.unmount())
+ renderer = null
+ expect(isFolderRepoCreateBusy(repo.target)).toBe(false)
+ })
+ it('resends an unconfirmed create without setup once the user agrees', async () => {
+ vi.useFakeTimers({ toFake: ['setTimeout'] })
+ const { flow } = mountFlow(() => {})
+ const a = repoIn()
+ const lost = new FakeSession('connected')
+ lost.sendRequest.mockRejectedValueOnce(markRpcDeliveryUnknown(new Error('connection lost')))
+ await act(() => flow.current!.onCreate(a.repo, a.target, lost, 'payments'))
+ vi.advanceTimersByTime(60_000)
+
+ const retry = new FakeSession('connected')
+ retry.sendRequest
+ .mockResolvedValueOnce({
+ id: '1',
+ ok: false,
+ error: { code: 'x', message: 'Setup decision required for this repository' }
+ })
+ .mockResolvedValueOnce(CREATED)
+ await act(() => flow.current!.onCreate(a.repo, a.target, retry, 'payments'))
+ expect(seen.confirm?.visible).toBe(true)
+
+ await act(async () => seen.confirm?.onConfirm?.())
+ expect(retry.sendRequest.mock.calls[1]?.[1]).toMatchObject({
+ name: 'payments',
+ branchIntent: 'create-exact',
+ setupDecision: 'skip'
+ })
+ })
+ it("refreshes the folder when a form's create may have landed", async () => {
+ const refetch = vi.fn()
+ const { flow } = mountFlow(refetch)
+ const b = repoIn()
+ const form = await openComposer(flow, b)
+
+ form.folderLaunch?.submit.begin({ ...b.repo, path: '/w/b' })?.settle('uncertain')
+ expect(refetch).toHaveBeenCalledTimes(1)
+ })
+ async function setupRefusedRetry(flow: { current: Flow | null }) {
+ const a = repoIn()
+ const lost = new FakeSession('connected')
+ lost.sendRequest.mockRejectedValueOnce(markRpcDeliveryUnknown(new Error('connection lost')))
+ await act(() => flow.current!.onCreate(a.repo, a.target, lost, 'payments'))
+ vi.advanceTimersByTime(60_000)
+ const retry = replying({
+ id: '1',
+ ok: false,
+ error: { code: 'x', message: 'Setup decision required for this repository' }
+ })
+ return { a, pending: flow.current!.onCreate(a.repo, a.target, retry.client, 'payments'), retry }
+ }
+
+ it("doesn't open a setup choice over another form, and the repository can retry after", async () => {
+ vi.useFakeTimers({ toFake: ['setTimeout'] })
+ const { flow } = mountFlow(() => {})
+ const { a, pending, retry } = await setupRefusedRetry(flow)
+ const form = await openComposer(flow)
+ retry.answer()
+ await act(() => pending)
+
+ expect(seen.confirm?.visible).toBe(false)
+ expect(composer().folderLaunch?.repoId).toBe(form.folderLaunch?.repoId)
+ expect(isFolderRepoCreateBusy(a.target)).toBe(false)
+ })
+
+ it("doesn't open a composer over a setup choice, and covers the list while it is open", async () => {
+ vi.useFakeTimers({ toFake: ['setTimeout'] })
+ const { flow } = mountFlow(() => {})
+ const { pending, retry } = await setupRefusedRetry(flow)
+ retry.answer()
+ await act(() => pending)
+ expect(seen.confirm?.visible).toBe(true)
+ expect(flow.current!.covered).toBe(true)
+
+ const b = repoIn()
+ const refusal = replying({ id: '1', ok: false, error: { code: 'x', message: TAKEN } })
+ const opening = flow.current!.onCreate(b.repo, b.target, refusal.client, 'payments')
+ refusal.answer()
+ await act(() => opening)
+ expect(composer().visible).toBe(false)
+ expect(isFolderRepoCreateBusy(b.target)).toBe(false)
+
+ act(() => seen.confirm?.onCancel())
+ expect(flow.current!.covered).toBe(false)
+ })
+ it('closes a setup choice once the folder lists its create, and its stale confirm sends nothing', async () => {
+ vi.useFakeTimers({ toFake: ['setTimeout'] })
+ const { flow, rerender } = mountFlow(() => {})
+ const { a, pending, retry } = await setupRefusedRetry(flow)
+ retry.answer()
+ await act(() => pending)
+ const staleConfirm = seen.confirm?.onConfirm
+ expect(seen.confirm?.visible).toBe(true)
+
+ rerender([
+ {
+ worktreeId: 'a-child',
+ repoId: a.target.repoId,
+ repo: 'a',
+ displayName: 'payments',
+ branch: 'payments'
+ }
+ ])
+ expect(seen.confirm?.visible).toBe(false)
+ await act(async () => staleConfirm?.())
+ expect(retry.client.sendRequest).toHaveBeenCalledTimes(1)
+ expect(seen.composer?.visible).toBe(false)
+ })
+
+ it("shows nothing for an older form's create once a setup choice opens, and still refreshes", async () => {
+ vi.useFakeTimers({ toFake: ['setTimeout'] })
+ const refetch = vi.fn()
+ const { flow } = mountFlow(refetch)
+ const form = await openComposer(flow)
+ act(() => form.onClose())
+ const { pending, retry } = await setupRefusedRetry(flow)
+ retry.answer()
+ await act(() => pending)
+ expect(seen.confirm?.visible).toBe(true)
+ refetch.mockClear()
+
+ expect(form.folderLaunch?.submit.presenting()).toBe(false)
+ act(() => form.onCreated('repo::/w/payments', 'payments'))
+ expect(seen.toasts).toEqual([])
+ expect(refetch).toHaveBeenCalledTimes(1)
+ })
+})
diff --git a/mobile/src/source-control/folder/use-folder-create-flow.tsx b/mobile/src/source-control/folder/use-folder-create-flow.tsx
new file mode 100644
index 00000000000..899a510ea38
--- /dev/null
+++ b/mobile/src/source-control/folder/use-folder-create-flow.tsx
@@ -0,0 +1,284 @@
+import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react'
+import type { Repo } from '../../../../src/shared/repo-types'
+import { getRepoExecutionHostId } from '../../../../src/shared/execution-host'
+import { ConfirmModal } from '../../components/ConfirmModal'
+import { NewWorktreeModalController } from '../../components/NewWorktreeModalController'
+import type { MobileWorkspaceRepo } from '../../components/new-worktree-modal-types'
+import { TransientToast, useTransientToast } from '../../components/TransientToast'
+import { useMobileTranslation } from '../../i18n/use-mobile-translation'
+import { openExternalLink } from '../../platform/external-link'
+import { triggerError, triggerSuccess } from '../../platform/haptics'
+import { useHostClient } from '../../transport/connection/host-client-hooks'
+import type { RpcClient } from '../../transport/rpc/rpc-client-contract'
+import type { FolderListRow } from './mobile-folder-attached-worktrees'
+import {
+ beginFolderComposerSubmission,
+ createFolderRepoWorktree,
+ getFolderRepoCreatesVersion,
+ isFolderRepoHoldPending,
+ reconcileFolderRepoCreates,
+ releaseFolderComposerReservation,
+ subscribeFolderRepoCreates,
+ type FolderRepoTarget
+} from './folder-repo-worktree-create'
+
+const NO_LABELS = new Map()
+
+/** What a create reads of a repository: its id, name and host. */
+export type FolderCreateRepo = Pick
+
+type SetupChoice = {
+ /** The unconfirmed create it resends; once that is gone the dialog closes and sends nothing. */
+ hold: number
+ repo: FolderCreateRepo
+ target: FolderRepoTarget
+ client: RpcClient
+ name: string
+}
+
+type ComposerLaunch = {
+ target: FolderRepoTarget
+ reservation: number
+ executionHostId: ReturnType
+ name: string
+}
+
+/**
+ * The folder screen's creates: direct exact-name creates, the composer they fall back to, and their
+ * toasts. Kept above the empty state, so another repository's new card can't close a form being edited.
+ */
+export function useFolderCreateFlow(args: {
+ hostId: string
+ folderWorktreeId: string
+ /** The folder's server; undefined for the paired desktop's own. */
+ executionHost: string | undefined
+ desktopCapabilities: readonly string[]
+ members: readonly FolderListRow[]
+ observing: boolean
+ refetch: () => void
+ bottomInset: number
+}) {
+ const { hostId, folderWorktreeId, executionHost, members, observing, refetch } = args
+ const t = useMobileTranslation()
+ const { client: desktopClient } = useHostClient(hostId)
+ const { message, showToast } = useTransientToast()
+ const [composer, setComposer] = useState(null)
+ const [setupChoice, setSetupChoice] = useState(null)
+ // The one form on screen, composer or setup choice. Set as forms open and close, not after render, so
+ // two answers landing together can't both open one.
+ const openRef = useRef(null)
+ // The newest form opened, still set after it closes: an older form's late answer shows nothing over it.
+ const latestRef = useRef(null)
+ // Late answers show nothing once this screen is left or covered; the create itself still settles.
+ const presentingRef = useRef(observing)
+ useEffect(() => {
+ presentingRef.current = observing
+ }, [observing])
+ useEffect(
+ () => () => {
+ presentingRef.current = false
+ latestRef.current = null
+ const open = openRef.current
+ openRef.current = null
+ // Left without sending from the form: its repository takes taps again.
+ if (open && 'reservation' in open) {
+ releaseFolderComposerReservation(open.target, open.reservation)
+ }
+ },
+ []
+ )
+ const presenting = useCallback(() => presentingRef.current, [])
+
+ // A created or unconfirmed create is done once the folder lists a worktree from its repository.
+ const createsVersion = useSyncExternalStore(
+ subscribeFolderRepoCreates,
+ getFolderRepoCreatesVersion
+ )
+ useEffect(() => {
+ reconcileFolderRepoCreates({ hostId, executionHost, folderWorktreeId }, members)
+ }, [createsVersion, executionHost, folderWorktreeId, hostId, members])
+
+ const onCreate = useCallback(
+ async (
+ repo: FolderCreateRepo,
+ target: FolderRepoTarget,
+ client: RpcClient,
+ name: string,
+ skipSetupFor?: number
+ ) => {
+ const outcome = await createFolderRepoWorktree({ target, client, name, skipSetupFor })
+ if (
+ outcome.kind === 'created' ||
+ outcome.kind === 'maybe-created' ||
+ outcome.kind === 'checking'
+ ) {
+ refetch()
+ }
+ const opensForm = outcome.kind === 'needs-composer' || outcome.kind === 'needs-setup-choice'
+ if (opensForm && (!presenting() || openRef.current)) {
+ // Left, or another form is open: keep that form and leave this repository to try again.
+ if (outcome.kind === 'needs-composer') {
+ releaseFolderComposerReservation(target, outcome.reservation)
+ }
+ return
+ }
+ if (!presenting()) {
+ return
+ }
+ if (outcome.kind === 'created') {
+ triggerSuccess()
+ showToast(
+ outcome.warning ??
+ t('sourceControl.folder.created', 'Created worktree {{name}} in {{repo}}', {
+ name: outcome.name,
+ repo: repo.displayName
+ })
+ )
+ } else if (outcome.kind === 'checking') {
+ showToast(
+ t(
+ 'sourceControl.folder.checking',
+ 'A worktree from {{repo}} may already have been created. Checking the folder…',
+ { repo: repo.displayName }
+ )
+ )
+ } else if (outcome.kind === 'needs-setup-choice') {
+ const choice = { hold: outcome.hold, repo, target, client, name }
+ openRef.current = choice
+ latestRef.current = choice
+ setSetupChoice(choice)
+ } else if (outcome.kind === 'needs-composer') {
+ const launch = {
+ target,
+ reservation: outcome.reservation,
+ executionHostId: getRepoExecutionHostId(repo),
+ name
+ }
+ openRef.current = launch
+ latestRef.current = launch
+ setComposer(launch)
+ } else if (outcome.kind === 'failed') {
+ triggerError()
+ showToast(
+ outcome.message ||
+ t('sourceControl.folder.createFailed', 'Could not create a worktree in {{repo}}.', {
+ repo: repo.displayName
+ })
+ )
+ }
+ },
+ [presenting, refetch, showToast, t]
+ )
+
+ const launch = composer
+ const presentingLaunch = (opened: ComposerLaunch | null) =>
+ presenting() && opened !== null && latestRef.current === opened
+ const composerElement = (
+ {
+ const submission = beginFolderComposerSubmission(
+ { ...launch.target, repoId: repo.id },
+ launch,
+ () => openRef.current === launch
+ )
+ return (
+ submission && {
+ settle: (outcome) => {
+ submission.settle(outcome)
+ // A lost reply may have created it: the list shows it, or the form keeps it from being sent twice.
+ if (outcome === 'uncertain') {
+ refetch()
+ }
+ }
+ }
+ )
+ },
+ presenting: () => presentingLaunch(launch)
+ }
+ }
+ }
+ : {})}
+ onCreated={(_worktreeId, createdName, warning) => {
+ refetch()
+ if (presentingLaunch(launch)) {
+ showToast(
+ warning ??
+ t('sourceControl.folder.createdNamed', 'Created worktree {{name}}', {
+ name: createdName
+ })
+ )
+ }
+ }}
+ onClose={() => {
+ // Only this opening's close: an older submission settling can't close a newer form.
+ if (launch) {
+ releaseFolderComposerReservation(launch.target, launch.reservation)
+ if (openRef.current === launch) {
+ openRef.current = null
+ }
+ }
+ setComposer((current) => (current === launch ? null : current))
+ }}
+ />
+ )
+ const choice = setupChoice
+ // Only this dialog's own answer: it closes itself and nothing newer.
+ const closeChoice = useCallback((closing: SetupChoice | null) => {
+ if (openRef.current === closing) {
+ openRef.current = null
+ }
+ setSetupChoice((current) => (current === closing ? null : current))
+ }, [])
+ // The folder showed it, or another create replaced it: there is nothing left to retry.
+ useEffect(() => {
+ if (choice && !isFolderRepoHoldPending(choice.target, choice.hold)) {
+ closeChoice(choice)
+ }
+ }, [choice, closeChoice, createsVersion])
+ const setupChoiceElement = (
+ {
+ if (choice && openRef.current === choice) {
+ closeChoice(choice)
+ void onCreate(choice.repo, choice.target, choice.client, choice.name, choice.hold)
+ }
+ }}
+ onCancel={() => closeChoice(choice)}
+ />
+ )
+ const toastElement =
+ return {
+ onCreate,
+ /** A form covers the screen: the list under it waits. */
+ covered: composer !== null || setupChoice !== null,
+ composerElement: (
+ <>
+ {composerElement}
+ {setupChoiceElement}
+ >
+ ),
+ toastElement
+ }
+}
diff --git a/mobile/src/tasks/blank-workspace-create.ts b/mobile/src/tasks/blank-workspace-create.ts
index 5cffd77a7db..05ad977ad21 100644
--- a/mobile/src/tasks/blank-workspace-create.ts
+++ b/mobile/src/tasks/blank-workspace-create.ts
@@ -1,6 +1,10 @@
import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent'
import type { RpcClient } from '../transport/rpc/rpc-client-contract'
-import { createWorktreeWithNameRetry, type WorktreeCreateResult } from './worktree-create-retry'
+import {
+ createWorktreeWithNameRetry,
+ type WorktreeCreateParent,
+ type WorktreeCreateResult
+} from './worktree-create-retry'
import type { WorktreeCreateAgentLaunch } from './agent-launch-request'
import type { WorktreeCreateIdempotencyProbe } from './worktree-create-idempotency-policy'
import {
@@ -20,6 +24,7 @@ export async function createBlankWorkspace(args: {
nameWasGenerated: boolean
worktreeCreateIdempotency: WorktreeCreateIdempotencyProbe
agentLaunchSupported: WorktreeCreateAgentLaunch['supported']
+ parent?: WorktreeCreateParent
}): Promise {
const agentLaunch: WorktreeCreateAgentLaunch | undefined = args.createdWithAgentId
? { agent: args.createdWithAgentId, supported: args.agentLaunchSupported }
@@ -28,6 +33,7 @@ export async function createBlankWorkspace(args: {
client: args.client,
baseName: args.baseName,
nameWasGenerated: args.nameWasGenerated,
+ parent: args.parent,
worktreeCreateIdempotency: args.worktreeCreateIdempotency,
...(agentLaunch ? { agentLaunch } : {}),
buildParams: (name) => {
diff --git a/mobile/src/tasks/composer-work-item-task.ts b/mobile/src/tasks/composer-work-item-task.ts
new file mode 100644
index 00000000000..faaa71adb3b
--- /dev/null
+++ b/mobile/src/tasks/composer-work-item-task.ts
@@ -0,0 +1,55 @@
+import type { MobileLinkedWorkItem } from './mobile-composer-source-types'
+import type { WorkspaceCreateTaskItem } from './workspace-create-params'
+
+/** The composer's linked issue, PR or ticket, as the host's task-workspace source. */
+export function toTaskItem(
+ item: MobileLinkedWorkItem,
+ targetRepoId: string
+): WorkspaceCreateTaskItem {
+ if (item.provider === 'github') {
+ return {
+ provider: 'github',
+ source: {
+ type: item.type === 'pr' ? 'pr' : 'issue',
+ repoId: item.repoId ?? targetRepoId,
+ number: item.number,
+ title: item.title,
+ url: item.url
+ }
+ }
+ }
+ if (item.provider === 'gitlab') {
+ return {
+ provider: 'gitlab',
+ source: {
+ type: item.type === 'mr' ? 'mr' : 'issue',
+ repoId: item.repoId ?? targetRepoId,
+ number: item.number,
+ title: item.title,
+ url: item.url
+ }
+ }
+ }
+ if (item.provider === 'jira') {
+ return {
+ provider: 'jira',
+ source: {
+ key: item.jiraIdentifier ?? '',
+ title: item.title,
+ url: item.url
+ }
+ }
+ }
+ return {
+ provider: 'linear',
+ source: {
+ identifier: item.linearIdentifier ?? '',
+ title: item.title,
+ url: item.url,
+ ...(item.linearWorkspaceId ? { workspaceId: item.linearWorkspaceId } : {}),
+ ...(item.linearOrganizationUrlKey
+ ? { organizationUrlKey: item.linearOrganizationUrlKey }
+ : {})
+ }
+ }
+}
diff --git a/mobile/src/tasks/source-workspace-create.ts b/mobile/src/tasks/source-workspace-create.ts
index d86844b6058..50368bbd580 100644
--- a/mobile/src/tasks/source-workspace-create.ts
+++ b/mobile/src/tasks/source-workspace-create.ts
@@ -1,20 +1,21 @@
import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent'
import type { RpcClient } from '../transport/rpc/rpc-client-contract'
import { resolveComposerMrBase, resolveComposerPrBase } from './composer-source-base-resolve'
-import type {
- MobileComposerCreateSelection,
- MobileLinkedWorkItem
-} from './mobile-composer-source-types'
+import type { MobileComposerCreateSelection } from './mobile-composer-source-types'
import { resolveMobileWorkspaceCreateName } from './mobile-workspace-name'
import type { WorkspaceAgentChoice } from './workspace-agent-selection'
+import { toTaskItem } from './composer-work-item-task'
import {
startupAgentCreateFields,
buildTaskWorkspaceCreateParams,
type WorkspaceCreateParams,
- type WorkspaceCreateSetupDecision,
- type WorkspaceCreateTaskItem
+ type WorkspaceCreateSetupDecision
} from './workspace-create-params'
-import { createWorktreeWithNameRetry, type WorktreeCreateResult } from './worktree-create-retry'
+import {
+ createWorktreeWithNameRetry,
+ type WorktreeCreateParent,
+ type WorktreeCreateResult
+} from './worktree-create-retry'
import type { WorktreeCreateAgentLaunch } from './agent-launch-request'
import type { WorktreeCreateIdempotencyProbe } from './worktree-create-idempotency-policy'
import { getClientWorktreeCreateCandidate } from '../../../src/shared/new-workspace/worktree-create-retry-policy'
@@ -36,6 +37,7 @@ export type CreateWorkspaceFromComposerArgs = {
worktreeCreateIdempotency: WorktreeCreateIdempotencyProbe
agentLaunchSupported: WorktreeCreateAgentLaunch['supported']
branchIntentSupported?: boolean | Promise
+ parent?: WorktreeCreateParent
}
export async function createWorkspaceFromComposerSource(
@@ -57,55 +59,6 @@ function resolveComposerAgentLaunch(
return agentId ? { agent: agentId, supported } : undefined
}
-function toTaskItem(item: MobileLinkedWorkItem, targetRepoId: string): WorkspaceCreateTaskItem {
- if (item.provider === 'github') {
- return {
- provider: 'github',
- source: {
- type: item.type === 'pr' ? 'pr' : 'issue',
- repoId: item.repoId ?? targetRepoId,
- number: item.number,
- title: item.title,
- url: item.url
- }
- }
- }
- if (item.provider === 'gitlab') {
- return {
- provider: 'gitlab',
- source: {
- type: item.type === 'mr' ? 'mr' : 'issue',
- repoId: item.repoId ?? targetRepoId,
- number: item.number,
- title: item.title,
- url: item.url
- }
- }
- }
- if (item.provider === 'jira') {
- return {
- provider: 'jira',
- source: {
- key: item.jiraIdentifier ?? '',
- title: item.title,
- url: item.url
- }
- }
- }
- return {
- provider: 'linear',
- source: {
- identifier: item.linearIdentifier ?? '',
- title: item.title,
- url: item.url,
- ...(item.linearWorkspaceId ? { workspaceId: item.linearWorkspaceId } : {}),
- ...(item.linearOrganizationUrlKey
- ? { organizationUrlKey: item.linearOrganizationUrlKey }
- : {})
- }
- }
-}
-
async function createWorkItemWorkspace(args: {
client: RpcClient
selection: Extract
@@ -116,6 +69,7 @@ async function createWorkItemWorkspace(args: {
nameIsAutoManaged?: boolean
note: string | undefined
worktreeCreateIdempotency: WorktreeCreateIdempotencyProbe
+ parent?: WorktreeCreateParent
}): Promise {
const { client, selection, targetRepoId, setupDecision, agent, workspaceName, note } = args
const item = selection.item
@@ -157,6 +111,7 @@ async function createWorkItemWorkspace(args: {
const baseName = String(params.name)
// Keep linked work items on terminals: structured sessions cannot hold their unsent URL draft and would submit it as a turn.
return createWorktreeWithNameRetry({
+ parent: args.parent,
client,
baseName,
worktreeCreateIdempotency: args.worktreeCreateIdempotency,
@@ -176,6 +131,7 @@ async function createBranchWorkspace(args: {
worktreeCreateIdempotency: WorktreeCreateIdempotencyProbe
agentLaunchSupported: WorktreeCreateAgentLaunch['supported']
branchIntentSupported?: boolean | Promise
+ parent?: WorktreeCreateParent
}): Promise {
const {
client,
@@ -206,6 +162,7 @@ async function createBranchWorkspace(args: {
fallback: selection.localBranchName
})
return createWorktreeWithNameRetry({
+ parent: args.parent,
client,
baseName,
worktreeCreateIdempotency: args.worktreeCreateIdempotency,
@@ -232,6 +189,7 @@ async function createBranchWorkspace(args: {
fallback: selection.branchNameOverride || selection.localBranchName
})
return createWorktreeWithNameRetry({
+ parent: args.parent,
client,
baseName,
worktreeCreateIdempotency: args.worktreeCreateIdempotency,
@@ -270,6 +228,7 @@ async function createNewBranchWorkspace(args: {
note: string | undefined
worktreeCreateIdempotency: WorktreeCreateIdempotencyProbe
agentLaunchSupported: WorktreeCreateAgentLaunch['supported']
+ parent?: WorktreeCreateParent
}): Promise {
const {
client,
@@ -287,6 +246,7 @@ async function createNewBranchWorkspace(args: {
const comment = note?.trim()
// Preserve typed git branch names, including slashes; sanitize only the folder, and retry suffixes against the branch name.
return createWorktreeWithNameRetry({
+ parent: args.parent,
client,
baseName: selection.branchName,
worktreeCreateIdempotency: args.worktreeCreateIdempotency,
diff --git a/mobile/src/tasks/worktree-create-retry.test.ts b/mobile/src/tasks/worktree-create-retry.test.ts
new file mode 100644
index 00000000000..175cd7c9860
--- /dev/null
+++ b/mobile/src/tasks/worktree-create-retry.test.ts
@@ -0,0 +1,148 @@
+import { describe, expect, it } from 'vitest'
+import { FakeSession } from '../transport/connection/mobile-endpoint-supervisor-test-fakes'
+import type { RpcClient } from '../transport/rpc/rpc-client-contract'
+import type { RpcResponse } from '../transport/rpc/rpc-wire-types'
+import { markRpcDeliveryUnknown } from '../transport/rpc/rpc-delivery-ambiguity'
+
+import { createWorktreeWithNameRetry } from './worktree-create-retry'
+
+type Attempt = { method: string; params: unknown }
+
+function scriptedClient(
+ outcomes: ({ id: string; displayName?: string; warning?: string } | { errorMessage: string })[],
+ attempts: Attempt[]
+): RpcClient {
+ let call = 0
+ const client = new FakeSession('connected')
+ client.sendRequest.mockImplementation(async (method: string, params?: unknown) => {
+ attempts.push({ method, params: params ?? {} })
+ const outcome = outcomes[Math.min(call, outcomes.length - 1)]!
+ call += 1
+ if ('errorMessage' in outcome) {
+ return {
+ id: '1',
+ ok: false,
+ error: { code: 'x', message: outcome.errorMessage },
+ _meta: { runtimeId: 'r' }
+ }
+ }
+ return {
+ id: '1',
+ ok: true,
+ result: {
+ worktree: {
+ id: outcome.id,
+ ...(outcome.displayName !== undefined ? { displayName: outcome.displayName } : {})
+ },
+ ...(outcome.warning !== undefined ? { warning: outcome.warning } : {})
+ },
+ _meta: { runtimeId: 'r' }
+ }
+ })
+ return client
+}
+
+describe('createWorktreeWithNameRetry parent', () => {
+ it('attaches every collision candidate to the same parent', async () => {
+ const attempts: Attempt[] = []
+ const client = scriptedClient(
+ [{ errorMessage: 'already exists locally' }, { id: 'wt-child' }],
+ attempts
+ )
+
+ await createWorktreeWithNameRetry({
+ client,
+ baseName: 'topic',
+ buildParams: (name) => ({ repo: 'id:r', name }),
+ parent: { parentWorkspace: 'folder:f-1', parentWorkspaceOrigin: 'manual' },
+ worktreeCreateIdempotency: false
+ })
+
+ expect(attempts.map((attempt) => attempt.params)).toEqual([
+ {
+ repo: 'id:r',
+ name: 'topic',
+ parentWorkspace: 'folder:f-1',
+ parentWorkspaceOrigin: 'manual'
+ },
+ {
+ repo: 'id:r',
+ name: 'topic-2',
+ parentWorkspace: 'folder:f-1',
+ parentWorkspaceOrigin: 'manual'
+ }
+ ])
+ })
+})
+
+describe('createWorktreeWithNameRetry after a lost reply', () => {
+ it('tries no other name when the resend is refused as taken', async () => {
+ const client = new FakeSession('connected')
+ client.sendRequest
+ .mockImplementationOnce(async () => {
+ client.publishState('reconnecting')
+ setTimeout(() => client.publishState('connected'), 0)
+ throw markRpcDeliveryUnknown(new Error('connection lost'))
+ })
+ .mockResolvedValue({
+ id: '1',
+ ok: false,
+ error: { code: 'x', message: 'already exists locally' },
+ _meta: { runtimeId: 'r' }
+ })
+
+ const result = await createWorktreeWithNameRetry({
+ client,
+ baseName: 'topic',
+ buildParams: (name) => ({ repo: 'id:r', name }),
+ worktreeCreateIdempotency: { dedupeTtlMs: 60_000 }
+ })
+
+ expect(result).toMatchObject({ replayed: true })
+ expect(client.sendRequest.mock.calls.map(([, params]) => params)).toEqual([
+ expect.objectContaining({ name: 'topic' }),
+ expect.objectContaining({ name: 'topic' })
+ ])
+ })
+ it('tries no other name when a fallback create after a refused agent launch is resent and refused', async () => {
+ const client = new FakeSession('connected')
+ const taken: RpcResponse = {
+ id: '1',
+ ok: false,
+ error: { code: 'x', message: 'already exists locally' },
+ _meta: { runtimeId: 'r' }
+ }
+ client.sendRequest
+ .mockResolvedValueOnce({
+ id: '1',
+ ok: false,
+ error: { code: 'method_not_found', message: 'Unknown method' },
+ _meta: { runtimeId: 'r' }
+ })
+ .mockImplementationOnce(async () => {
+ client.publishState('reconnecting')
+ setTimeout(() => client.publishState('connected'), 0)
+ throw markRpcDeliveryUnknown(new Error('connection lost'))
+ })
+ .mockResolvedValue(taken)
+
+ const result = await createWorktreeWithNameRetry({
+ client,
+ baseName: 'topic',
+ buildParams: (name) => ({ repo: 'id:r', name }),
+ worktreeCreateIdempotency: { dedupeTtlMs: 60_000 },
+ agentLaunch: { agent: 'claude', supported: { replay: false } }
+ })
+
+ expect(result).toMatchObject({ replayed: true })
+ expect(client.sendRequest.mock.calls.map(([method]) => method)).toEqual([
+ 'agent.launch',
+ 'worktree.create',
+ 'worktree.create'
+ ])
+ expect(client.sendRequest.mock.calls.slice(1).map(([, params]) => params)).toEqual([
+ expect.objectContaining({ name: 'topic' }),
+ expect.objectContaining({ name: 'topic' })
+ ])
+ })
+})
diff --git a/mobile/src/tasks/worktree-create-retry.ts b/mobile/src/tasks/worktree-create-retry.ts
index 943ff260096..e85c4dcd67b 100644
--- a/mobile/src/tasks/worktree-create-retry.ts
+++ b/mobile/src/tasks/worktree-create-retry.ts
@@ -35,7 +35,12 @@ import {
// Branches and remote PRs outlive worktrees and escape local preflight dedupe; retry host collision errors with numeric suffixes.
export type WorktreeCreateResult =
| { worktreeId: string; name: string; warning?: string }
- | { error: string }
+ /** `replayed`: the refusal answered a resend after a lost reply, so the first send may have created it. */
+ | { error: string; replayed?: true }
+
+export type WorktreeCreateParent = Required<
+ Pick
+>
export type CreateWorktreeWithNameRetryArgs = {
client: RpcClient
@@ -46,6 +51,8 @@ export type CreateWorktreeWithNameRetryArgs = {
branchIntentSupported?: boolean | Promise
agentLaunch?: WorktreeCreateAgentLaunch
maxAttempts?: number
+ /** The workspace the new worktree is attached to, on every attempt. */
+ parent?: WorktreeCreateParent
mintMutationId?: () => string
mintLaunchOperationId?: () => string
}
@@ -62,11 +69,12 @@ export async function createWorktreeWithNameRetry(
const mintMutationId = args.mintMutationId ?? defaultWorktreeCreateMutationId
const mintLaunchOperationId = args.mintLaunchOperationId ?? structuredSessionOperationId
let lastError: string | null = null
+ let lastReplayed = false
for (let attempt = 0; attempt < maxAttempts; attempt += 1) {
const candidateName = args.nameWasGenerated
? getGeneratedWorktreeCreateRetryCandidate(baseName, attempt)
: getClientWorktreeCreateCandidate(baseName, attempt)
- const candidateParams = buildParams(candidateName, attempt)
+ const candidateParams = { ...buildParams(candidateName, attempt), ...args.parent }
if (attempt === 0 && candidateParams.branchIntent) {
if ((await args.branchIntentSupported) !== true) {
return {
@@ -90,6 +98,7 @@ export async function createWorktreeWithNameRetry(
worktreeCreateIdempotency
)
let response = sent.response
+ let replayed = sent.replayed
if (
!response.ok &&
!sent.replayed &&
@@ -100,9 +109,15 @@ export async function createWorktreeWithNameRetry(
) {
// Method refusal can mean the client advertisement lagged the probe; downgrade permanently for this create.
launch = null
- response = (
- await sendWorktreeCreateResilient(client, null, null, params, worktreeCreateIdempotency)
- ).response
+ const fallback = await sendWorktreeCreateResilient(
+ client,
+ null,
+ null,
+ params,
+ worktreeCreateIdempotency
+ )
+ response = fallback.response
+ replayed = fallback.replayed
}
// Ledger refusal may follow creation; never retry unnamed. Inspect raw refusal messages for legacy collision handling.
if (response.ok) {
@@ -118,7 +133,10 @@ export async function createWorktreeWithNameRetry(
break
}
lastError = response.error.message
+ lastReplayed = replayed
+ // A replayed refusal may follow a create whose reply was lost; another name could be a second worktree.
if (
+ replayed ||
candidateParams.branchIntent === 'open-existing-v2' ||
launch?.replay ||
!isRetryableWorktreeCreateConflict(lastError ?? '')
@@ -128,7 +146,9 @@ export async function createWorktreeWithNameRetry(
}
return {
error:
- lastError ?? translate('tasks.worktreeCreateRetry.createFailed', 'Failed to create workspace')
+ lastError ??
+ translate('tasks.worktreeCreateRetry.createFailed', 'Failed to create workspace'),
+ ...(lastReplayed ? { replayed: true as const } : {})
}
}
diff --git a/mobile/src/test-support/rpc-recording/adapters/workspace-settings-mounts.ts b/mobile/src/test-support/rpc-recording/adapters/workspace-settings-mounts.ts
index 53a17673548..5717b27b063 100644
--- a/mobile/src/test-support/rpc-recording/adapters/workspace-settings-mounts.ts
+++ b/mobile/src/test-support/rpc-recording/adapters/workspace-settings-mounts.ts
@@ -102,7 +102,9 @@ export function workspaceSettingsMounts(
getAgentLaunchSupport: async () => false,
transitionDrawer: (view: unknown) => context.effect('drawer', view),
onCreated: (id: unknown, name: unknown) => context.effect('created', { id, name }),
- onClose: () => context.effect('close', null)
+ onClose: () => context.effect('close', null),
+ // Not opened from a folder.
+ folderLaunch: undefined
})
let state: ReturnType
const hook = hookMount(() => {
From 5ff661378bdb8c00e4000555dbbb9336e8a16a16 Mon Sep 17 00:00:00 2001
From: OrcaWin
Date: Mon, 9 Nov 2026 17:20:55 -0800
Subject: [PATCH 02/50] test: remove low-value markdown, agent, and pricing
cases (#40566)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
---
config/reliability-gates.jsonc | 57 ++-
.../scripts/ci/sharding/ci-shard-timings.json | 2 -
.../orchestration/agent-server-route.test.ts | 105 -----
.../claude-usage/claude-model-pricing.test.ts | 64 +--
.../claude-structured-child-env.test.ts | 92 +----
.../testing/session-launch-note.test.ts | 26 --
.../daemon-launch-note-reattach.test.ts | 193 ----------
.../documents/doc-preview-grants.test.ts | 67 +---
.../documents/file-preview-link-open.test.ts | 363 ------------------
.../editor-markdown-link-activation.test.ts | 291 +-------------
.../editor-markdown-view-state.test.ts | 191 ---------
11 files changed, 43 insertions(+), 1408 deletions(-)
delete mode 100644 src/cli/handlers/orchestration/agent-server-route.test.ts
delete mode 100644 src/main/daemon/sessions/testing/session-launch-note.test.ts
delete mode 100644 src/renderer/src/lib/browser/documents/file-preview-link-open.test.ts
delete mode 100644 src/renderer/src/store/slices/editor/markdown/editor-markdown-view-state.test.ts
diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc
index ba5ff1a6f61..0ad7088de9a 100644
--- a/config/reliability-gates.jsonc
+++ b/config/reliability-gates.jsonc
@@ -4230,10 +4230,10 @@
"providers": ["remote-runtime"],
"coveredPlatforms": ["macos"],
"coveredProviders": ["remote-runtime"],
- "coverageNotes": "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": "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": "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": "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"
@@ -4319,7 +4319,11 @@
"Audit2425 removes use-workspace-copy-status original5, which returns a fixture-supplied readError string through statusReadError. No consumer blocker or attempted branch switch established refusal; the unique error-forwarding sample is intentionally retired. Other copy ownership and stale-refresh cases are not equivalent error-path coverage. No equivalent replacement or fresh validation is claimed.",
"Audit2432 removes BranchPicker.test.tsx original3, which only asserted onOpenChange(true/false) with an always-mounted mocked Popover. It never reopened the picker or consumed the callback in the parent status-refresh owner, despite its title. Lose that unique open/close notification alarm. Retained blocker/collision recovery and asynchronous post-unmount outcome cases are not equivalent replacement coverage. No fresh validation of the reduced selector 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.",
- "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."
+ "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.",
+ "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.",
+ "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."
],
"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."
},
@@ -4437,7 +4441,7 @@
"providers": ["remote-runtime"],
"coveredPlatforms": ["macos"],
"coveredProviders": [],
- "coverageNotes": "Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): 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": "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",
@@ -4448,7 +4452,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": "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": "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 src/renderer/src/runtime/web-session-tabs-sync/placement/web-session-tabs-sync-browser-tabs.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",
@@ -4949,7 +4953,8 @@
"D01 candidate audit retires this complete dated receipt because a named test source changes in the candidate overlay. It supplies no new execution or equivalent-coverage claim. Original receipt verbatim:\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/components/browser-pane/workspace-doc/HtmlDocPreview.failure-message.test.tsx\",\n \"result\": \"failed\",\n \"durationSeconds\": 1.27,\n \"summary\": \"Candidate with the sole delta that every failure sets the blocking reason, asset or not, failed 4/14 on the asset-notice assertions — the same mutant the retired 2026-08-26 record measured at 3/10, re-run at the relocated path. A refused subresource must name itself over a document that stays mounted; only the entry document may take the page away.\",\n \"currentCommand\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.failure-message.test.tsx\"\n }",
"D01 candidate audit retires this complete dated receipt because a named test source changes in the candidate overlay. It supplies no new execution or equivalent-coverage claim. Original receipt verbatim:\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/components/browser-pane/workspace-doc/HtmlDocPreview.failure-message.test.tsx\",\n \"result\": \"passed\",\n \"durationSeconds\": 1.54,\n \"summary\": \"14/14 on the reader-facing failure suite at its relocated path. This and the red run below replace the 2026-08-26 pair recorded against the pre-relocation path (10/10 green, 3/10 red), re-measured today so the entry/subresource split keeps a red half rather than only a green one.\",\n \"currentCommand\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.failure-message.test.tsx\"\n }",
"D01 final candidate whole-registration policy removes retired module selectors and obsolete assertion descriptions prospectively. Existing unaffected receipts retain their original scope; reduced selectors have no new execution or equivalent replacement claim. Retired named modules: [\"src/preload/doc-preview-link-interception.test.ts\",\"src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.failure-message.test.tsx\"]. Retired compound assertion refs, preserved as historical data: [{\"file\":\"src/renderer/src/components/browser-pane/workspace-doc/doc-preview-external-link-confirmation.test.ts\",\"assertions\":[\"an external preview link shows the reader its exact destination and becomes a browser tab only after confirmation\",\"a declined confirmation opens nothing, and a confirmed tab that is refused or fails outright surfaces instead of being dropped\"]}]",
- "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. Retired assertion reference: {\"file\":\"src/renderer/src/hooks/useIpcEvents-close-routing-browser-pages.test.ts\",\"assertions\":[\"closing an absent renderer page returns browser_tab_not_found instead of an untyped failure\"]}"
+ "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. Retired assertion reference: {\"file\":\"src/renderer/src/hooks/useIpcEvents-close-routing-browser-pages.test.ts\",\"assertions\":[\"closing an absent renderer page returns browser_tab_not_found instead of an untyped failure\"]}",
+ "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."
],
"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."
},
@@ -8557,13 +8562,13 @@
"providers": ["paired-runtime", "ssh"],
"coveredPlatforms": ["macos", "linux"],
"coveredProviders": [],
- "coverageNotes": "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": "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": "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": "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",
@@ -9034,7 +9039,11 @@
"Audit2425 removes use-workspace-copy-status original5, which returns a fixture-supplied readError string through statusReadError. No consumer blocker or attempted branch switch established refusal; the unique error-forwarding sample is intentionally retired. Other copy ownership and stale-refresh cases are not equivalent error-path coverage. No equivalent replacement or fresh validation is claimed.",
"Audit2432 removes BranchPicker.test.tsx original3, which only asserted onOpenChange(true/false) with an always-mounted mocked Popover. It never reopened the picker or consumed the callback in the parent status-refresh owner, despite its title. Lose that unique open/close notification alarm. Retained blocker/collision recovery and asynchronous post-unmount outcome cases are not equivalent replacement coverage. No fresh validation of the reduced selector 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.",
- "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."
+ "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.",
+ "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.",
+ "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."
],
"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."
},
@@ -9212,7 +9221,7 @@
"providers": ["local", "daemon", "ssh", "remote-runtime"],
"coveredPlatforms": ["macos"],
"coveredProviders": [],
- "coverageNotes": "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": "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",
@@ -9220,7 +9229,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": "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": "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",
@@ -9363,7 +9372,11 @@
"Historical complete dated writer/backpressure receipt retired after its source changed, preserved verbatim including executed command and path-only currentCommand; not current validation:\n{\n \"date\": \"2026-07-29\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/main/ssh/ssh-multiplexer-transport-writer.test.ts src/main/ssh/ssh-channel-multiplexer-backpressure.test.ts --reporter=dot\",\n \"result\": \"passed\",\n \"durationSeconds\": 6.89,\n \"summary\": \"Thirteen current-head deterministic files passed 150 tests across exit-sealed private recovery, stale-transfer cancellation authority, bounded latest-token retirement, restore retirement, fail-closed recovery cancellation, partial ACK and token rotation, reclaimed-span replacement, mux lane fairness, provisional activation, and exit-proof ordering; no live topology was exercised.\",\n \"currentCommand\": \"pnpm exec vitest run --config config/vitest.config.ts src/main/ssh/protocol/ssh-multiplexer-transport-writer.test.ts src/main/ssh/protocol/ssh-channel-multiplexer-backpressure.test.ts --reporter=dot\"\n }",
"Historical provider scope before changed-source receipt retirement: [\"ssh\"]",
"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.",
- "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."
+ "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.",
+ "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.",
+ "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."
],
"demotionRule": "Cannot promote without metric artifacts and bounded-byte assertions."
},
@@ -12739,14 +12752,14 @@
"providers": ["local", "remote-runtime", "ssh"],
"coveredPlatforms": ["macos", "linux"],
"coveredProviders": ["local", "remote-runtime", "ssh"],
- "coverageNotes": "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": "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": "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": "Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts: delivers remote file changes to listeners for the same worktree. src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Exact retired assertionRefs, preserved as historical objects only: {\n \"file\": \"src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts\",\n \"assertions\": [\n \"terminal watcher error and setup failure evict the shared entry before retrying callbacks run\",\n \"an old stream end cannot evict the replacement stream, which still delivers to its listener\",\n \"two same-worktree listeners share a synthetic subscription until the final stop unsubscribes and sends unwatch\"\n ]\n } Historical prior account (preserved verbatim): Audit1973: Delete the standalone mocked watcher cleanup suite and its entire sole-file prospective command. Retire the removed file-command transport-abort alias; preserve the independent cancellation suite and final-overflow/error/end cleanup callback, and13 unrelated receipt objects. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial runtime files-watch suite retains controlled Windows close-event waiting, shared-client survival, late physical-exit ownership/deadline cleanup and shutdown joining. Its combined Windows close/deadline/late-exit alias remains backed by unchanged callbacks. Retire native-error-close, pre-publication setup ownership and failed-delete rearm aliases; associated delegation, failure forwarding, removal routing and recovery examples are lost. These tests inject watch/subscription seams and do not observe an actual native watcher or physical process. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Partial runtime watcher-host suite loses mocked option/event/overflow/resubscription forwarding, supplied teardown-error propagation, aborted-signal/no-call and private ten-thousand-waiter-count inventories. Retire the 10,000-caller bound and failed-recovery-subscriber-ending assertion aliases. Keep same-root owner cancellation, pre-ready replacement, held root-close join, stale-generation recovery delivery and initial failed-root ownership mappings backed by retained real-host callbacks with injected subscription/error/physical-exit promises. No actual native watcher, process termination or resource bound was observed. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1683 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Fill the global watcher-child reservation, require native desktop, paired-runtime, and WSL setup to retain typed transient capacity and retry after one serialized release, then cancel pending desktop and paired-client watches and require no retry. Hold one live anchor while aborting 10,000 callers at the capacity, quarantine-assignment, runtime-root, relay-setup, and SSH-registration layers; require exactly one explicit waiter and one base-promise reaction to remain, then zero after settlement. Hold an old relay unsubscribe, queue one same-root setup leader and one anchor, then abort 10,000 joiners; require every cancellation to settle before teardown releases, exactly one anchor waiter, and only one later physical install. Advance the former paired-web callback deadline while capacity remains full, require cancellation ownership to stay live, publish the server token before ready, and require files.unwatch to abort setup before a later slot release can install a native root. Reject the first ready-watch unwatch with a physical-exit promise, resolve that exit later, and require a fresh physical unwatch attempt, registry release, and exactly one stream end. Fill one healthy shared child with multiple roots, map a standard SSH repository's base, Git common directory, and worktree roots to one relay supervisor, then inject IPC disconnect-before-exit, queued and active cancellation, operations during termination, kill-without-exit, repeated unkillable generations, initial and recovery timeouts, and shard failure. During local and SSH deletion, attempt a late terminal spawn whose worktree identity and cwd name different roots, enumerate a non-prefix remote PTY by authoritative worktree ownership, withhold daemon/relay exit callbacks, make attach positively prove a concurrent-shutdown PID dead, and make the provider unavailable; require every acquired admission to roll back on rejection, dead-PID proof to settle physical exit before reaping, timeout to retain ownership, and Git/filesystem deletion never to start. Require bounded watcher process count, physical-exit settlement, healthy-root recovery, stale-generation rejection, overflow plus later events, and fail-closed destructive cleanup. Verify relay build hashes and remote install probes require both relay.js and relay-watcher.js. Launch the built relay with a real PTY and Parcel watch, kill only the watcher child, and require the same relay PID and PTY to answer before a replacement child delivers overflow and a post-crash event.",
"commands": [
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-unsubscribe-timeout.test.ts --reporter=dot",
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-native-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/filesystem/watcher-process/runtime-watcher-pending-assignment.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/workspaces/removal/watcher-removal-gate.test.ts src/main/runtime/files/watch/orca-runtime-files-watch.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/methods/files/files.test.ts src/main/runtime/rpc/methods/files/files-watch-cancellation.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/shared/promise-settlement-waiters.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess/testing/pty-subprocess.test.ts src/main/daemon/sessions/testing/session.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts --reporter=dot",
@@ -13165,7 +13178,11 @@
"Audit2425 removes use-workspace-copy-status original5, which returns a fixture-supplied readError string through statusReadError. No consumer blocker or attempted branch switch established refusal; the unique error-forwarding sample is intentionally retired. Other copy ownership and stale-refresh cases are not equivalent error-path coverage. No equivalent replacement or fresh validation is claimed.",
"Audit2432 removes BranchPicker.test.tsx original3, which only asserted onOpenChange(true/false) with an always-mounted mocked Popover. It never reopened the picker or consumed the callback in the parent status-refresh owner, despite its title. Lose that unique open/close notification alarm. Retained blocker/collision recovery and asynchronous post-unmount outcome cases are not equivalent replacement coverage. No fresh validation of the reduced selector 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.",
- "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."
+ "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.",
+ "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.",
+ "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."
],
"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."
},
@@ -14409,10 +14426,10 @@
"providers": ["paired-runtime"],
"coveredPlatforms": ["linux"],
"coveredProviders": ["paired-runtime"],
- "coverageNotes": "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": "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": "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": "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",
@@ -14479,7 +14496,11 @@
"Audit2425 removes use-workspace-copy-status original5, which returns a fixture-supplied readError string through statusReadError. No consumer blocker or attempted branch switch established refusal; the unique error-forwarding sample is intentionally retired. Other copy ownership and stale-refresh cases are not equivalent error-path coverage. No equivalent replacement or fresh validation is claimed.",
"Audit2432 removes BranchPicker.test.tsx original3, which only asserted onOpenChange(true/false) with an always-mounted mocked Popover. It never reopened the picker or consumed the callback in the parent status-refresh owner, despite its title. Lose that unique open/close notification alarm. Retained blocker/collision recovery and asynchronous post-unmount outcome cases are not equivalent replacement coverage. No fresh validation of the reduced selector 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.",
- "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."
+ "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.",
+ "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.",
+ "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."
],
"demotionRule": "Keep experimental if any direction skips or fails; do not extend timeouts or retry to green."
},
diff --git a/config/scripts/ci/sharding/ci-shard-timings.json b/config/scripts/ci/sharding/ci-shard-timings.json
index 8df31614436..43ba5379935 100644
--- a/config/scripts/ci/sharding/ci-shard-timings.json
+++ b/config/scripts/ci/sharding/ci-shard-timings.json
@@ -6378,7 +6378,6 @@
"src/renderer/src/runtime/hosts/platform/execution-host-facts.test.ts": 1796,
"src/renderer/src/lib/feature-education-telemetry.test.ts": 52,
"src/renderer/src/lib/feedback-image-attachments.test.ts": 557,
- "src/renderer/src/lib/browser/documents/file-preview-link-open.test.ts": 2311,
"src/renderer/src/lib/file-search-selection.test.ts": 51,
"src/renderer/src/lib/find-query-bounds.test.ts": 45,
"src/renderer/src/lib/finished-agent-resume-resurrection.test.ts": 1872,
@@ -6827,7 +6826,6 @@
"src/renderer/src/store/slices/editor/git/editor-git-status-reconciliation.test.ts": 870,
"src/renderer/src/store/slices/editor/tabs/editor-layout-owner-records.test.ts": 2006,
"src/renderer/src/store/slices/editor/markdown/editor-markdown-link-activation.test.ts": 953,
- "src/renderer/src/store/slices/editor/markdown/editor-markdown-view-state.test.ts": 801,
"src/renderer/src/store/slices/editor/git/editor-open-diff.test.ts": 1987,
"src/renderer/src/store/slices/editor/tabs/editor-open-link-placement.test.ts": 1987,
"src/renderer/src/store/slices/editor/tabs/editor-preview-tab-setting.test.ts": 1952,
diff --git a/src/cli/handlers/orchestration/agent-server-route.test.ts b/src/cli/handlers/orchestration/agent-server-route.test.ts
deleted file mode 100644
index b84bae4609c..00000000000
--- a/src/cli/handlers/orchestration/agent-server-route.test.ts
+++ /dev/null
@@ -1,105 +0,0 @@
-import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
-import type * as RuntimeClientModule from '../../runtime-client'
-import { refuseAgentServerRoute, requirePeerMailCarrier } from './agent-server-route'
-
-const { callerShow } = vi.hoisted(() => ({ callerShow: vi.fn() }))
-vi.mock('../../runtime-client', async (importOriginal) => {
- const actual = await importOriginal()
- return {
- ...actual,
- RuntimeClient: class {
- call = callerShow
- }
- }
-})
-
-function ctx(command: string[], flags: [string, string | boolean][]) {
- // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: a handler context with only the fields this function reads.
- return {
- flags: new Map(flags),
- client: { isRemote: true },
- cwd: '/',
- json: false,
- rawArgs: [...command, ...flags.flatMap(([name, value]) => [`--${name}`, String(value)])]
- } as unknown as Parameters[1]
-}
-
-describe('an agent pointing mail at another server', () => {
- beforeEach(() => {
- vi.stubEnv('ORCA_AGENT_LAUNCH_TOKEN', 'launch-token')
- vi.stubEnv('ORCA_AGENT_SESSION_ID', '')
- vi.stubEnv('ORCA_CLI_COMMAND', 'orca')
- callerShow.mockResolvedValue({ result: { caller: null, terminal: true } })
- })
-
- afterEach(() => {
- vi.unstubAllEnvs()
- callerShow.mockReset()
- })
-
- it('is refused with the --on command to run instead', async () => {
- await expect(
- refuseAgentServerRoute(
- 'send',
- ctx(
- ['orchestration', 'send'],
- [
- ['environment', 'devB'],
- ['to', 'term_b'],
- ['subject', 'hi']
- ]
- )
- )
- ).rejects.toMatchObject({
- code: 'agent_server_route_refused',
- message:
- 'send with --environment devB runs on devB and nothing comes back to you. To message an agent on devB, use: orca orchestration send --on devB --to term_b --subject hi'
- })
- })
-
- it('refuses a check against another server: the mailbox is local', async () => {
- await expect(
- refuseAgentServerRoute('check', ctx(['orchestration', 'check'], [['environment', 'devB']]))
- ).rejects.toMatchObject({
- code: 'mailbox_is_local',
- message:
- 'Your mailbox is on this Orca; replies from devB arrive here. Drop --environment devB.'
- })
- })
-
- it('leaves a person in a shell running the command on that server', async () => {
- vi.stubEnv('ORCA_AGENT_LAUNCH_TOKEN', '')
- await expect(
- refuseAgentServerRoute('send', ctx(['orchestration', 'send'], [['environment', 'devB']]))
- ).resolves.toBeUndefined()
- expect(callerShow).not.toHaveBeenCalled()
- })
-
- it('leaves a launch its own Orca does not verify running on that server', async () => {
- callerShow.mockResolvedValue({ result: { caller: null, terminal: false } })
- await expect(
- refuseAgentServerRoute('send', ctx(['orchestration', 'send'], [['environment', 'devB']]))
- ).resolves.toBeUndefined()
- })
-})
-
-describe('send --on from an older Orca', () => {
- it('is refused before anything is sent', async () => {
- const call = vi
- .fn()
- .mockResolvedValue({ result: { capabilities: ['orchestration.contract.v1'] } })
- // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: a handler context with only the fields this function reads.
- const context = {
- flags: new Map([['on', 'devB']]),
- client: { call },
- cwd: '/',
- json: false
- } as unknown as Parameters[0]
-
- await expect(requirePeerMailCarrier(context)).rejects.toMatchObject({
- code: 'server_mail_unsupported'
- })
- expect(call).toHaveBeenCalledTimes(1)
- expect(call).toHaveBeenCalledWith('status.get')
- })
-})
diff --git a/src/main/claude-usage/claude-model-pricing.test.ts b/src/main/claude-usage/claude-model-pricing.test.ts
index 5eea907a6cd..08a90fae976 100644
--- a/src/main/claude-usage/claude-model-pricing.test.ts
+++ b/src/main/claude-usage/claude-model-pricing.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest'
import type { ClaudeUsageTokenTotals } from './types'
-import { estimateCostUsd, normalizeModelForPricing } from './claude-model-pricing'
+import { estimateCostUsd } from './claude-model-pricing'
const MTOK = 1_000_000
@@ -18,61 +18,10 @@ function estimate(model: string, ...counts: number[]): number | null {
return estimateCostUsd(model, tokens(...counts))
}
-describe('model pricing name matching', () => {
- it.each([
- [' ANTHROPIC/claude-opus-4.1-thinking ', 'claude-opus-4-1'],
- ['claude-opus-4-20250514', 'claude-opus-4'],
- ['claude-opus-4.20250514', 'claude-opus-4'],
- ['claude-opus-4@20250514', 'claude-opus-4'],
- ['claude-opus-4-5@20251101', 'claude-opus-4-5'],
- ['us.anthropic.claude-sonnet-4-5-20250929-v1:0', 'claude-sonnet-4-5'],
- ['claude-sonnet-5-thinking', 'claude-sonnet-5'],
- ['claude-sonnet-5-5', 'claude-sonnet-5-5'],
- ['claude-sonnet-5.5[1m]', 'claude-sonnet-5-5'],
- ['claude-opus-5.5[1m]', 'claude-opus-5-5'],
- ['claude-opus-5-5-thinking', 'claude-opus-5-5'],
- ['claude-fable-5-1[1m]', 'claude-fable-5-1'],
- ['claude-fable-5-1m', 'claude-fable-5'],
- ['claude-opus-4.8-thinking', 'claude-opus-4-8'],
- ['claude-3-5-sonnet-20241022', 'claude-sonnet-3-5'],
- ['claude-3.5-sonnet', 'claude-sonnet-3-5'],
- ['claude-3-7-sonnet-20250219', 'claude-sonnet-3-7'],
- ['claude-3-5-haiku-20241022', 'claude-haiku-3-5'],
- ['claude-3-haiku-20240307', 'claude-haiku-3'],
- ['claude-4.5-sonnet-thinking', 'claude-sonnet-4-5'],
- ['model_placeholder_m26', 'claude-opus-4-6']
- ])('reads the family and version out of %s', (model, key) => {
- expect(normalizeModelForPricing(model)).toBe(key)
- })
-
- it.each([
- 'claude-opus-5-6',
- 'claude-sonnet-5-6',
- 'claude-fable-5-3',
- 'claude-opus-6',
- 'claude-opus-4.9',
- 'claude-opus-5-50',
- 'claude-sonnet-50',
- 'claude-3-opus-20240229',
- 'sonnet',
- 'gpt-5'
- ])('leaves %s unpriced', (model) => {
- expect(normalizeModelForPricing(model)).toBeNull()
- })
-})
-
describe('estimateCostUsd cache-write TTL rates', () => {
it('splits a mixed write bucket without double-billing the 1-hour share', () => {
expect(estimate('claude-opus-5', 0, 0, 0, 1_000_000, 400_000)).toBeCloseTo(7.75)
})
-
- it('clamps a 1-hour count that exceeds the reported write total', () => {
- expect(estimate('claude-opus-5', 0, 0, 0, 1_000, 5_000)).toBeCloseTo(0.01)
- })
-
- it('still returns null for unknown models', () => {
- expect(estimate('gpt-5', 0, 0, 0, 1_000_000, 1_000_000)).toBeNull()
- })
})
describe('estimateCostUsd long-context requests', () => {
@@ -89,17 +38,6 @@ describe('estimateCostUsd long-context requests', () => {
})
).toBeCloseTo(0.1 + 0.5)
})
-
- it('ignores a long-context subset for a model with flat rates', () => {
- const long = tokens(MTOK)
- expect(estimateCostUsd('claude-sonnet-4-6', { ...long, longContext: long })).toBeCloseTo(3)
- })
-
- it('clamps a long-context subset larger than its totals', () => {
- expect(
- estimateCostUsd('claude-haiku-5-5', { ...tokens(MTOK), longContext: tokens(3 * MTOK) })
- ).toBeCloseTo(0.5)
- })
})
// Rate source: platform.claude.com/docs/en/about-claude/pricing.
diff --git a/src/main/claude/structured/launch/claude-structured-child-env.test.ts b/src/main/claude/structured/launch/claude-structured-child-env.test.ts
index 3eda5aa1cfb..b9c63b68c70 100644
--- a/src/main/claude/structured/launch/claude-structured-child-env.test.ts
+++ b/src/main/claude/structured/launch/claude-structured-child-env.test.ts
@@ -3,11 +3,7 @@ import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { afterEach, expect, it, vi } from 'vitest'
import { runProcess } from '@orca/process-host'
-import {
- claudeChildEnv,
- resolveClaudeChildEnvSources,
- withOrcaClaudeEntrypoint
-} from './claude-structured-child-env'
+import { claudeChildEnv, resolveClaudeChildEnvSources } from './claude-structured-child-env'
import { resolveStructuredAgentCommand } from '../../../native-chat/structured-agent-command-resolution'
afterEach(() => {
@@ -36,92 +32,6 @@ it('resolves a custom Claude command against the login shell PATH', async () =>
}
})
-it('isolates inherited Claude stamps before applying launch settings', () => {
- const sources = {
- command: 'claude',
- prefixArgs: [],
- overlay: undefined,
- inheritedEnv: {
- CLAUDE_CODE_ENTRYPOINT: 'cli',
- CLAUDECODE: '1',
- CLAUDE_CODE_MESSAGING_SOCKET: 'parent-socket',
- CLAUDE_AGENT_SDK_VERSION: 'parent-sdk',
- CLAUDE_EFFORT: 'parent-effort',
- CLAUDE_CODE_HTTP_PROXY: 'http://user-proxy'
- }
- }
- const options = { runtimeOnPath: false }
- expect(claudeChildEnv(sources, undefined, options)).toEqual({
- CLAUDE_CODE_ENTRYPOINT: 'orca',
- CLAUDE_CODE_HTTP_PROXY: 'http://user-proxy'
- })
- const overlay = { CLAUDE_CODE_ENTRYPOINT: 'custom', CLAUDE_EFFORT: 'configured-effort' }
- expect(claudeChildEnv({ ...sources, overlay }, undefined, options)).toEqual({
- ...overlay,
- CLAUDE_CODE_HTTP_PROXY: 'http://user-proxy'
- })
-})
-
-it('keeps a differently cased Windows launch value over the Orca default', () => {
- const inherited = {
- Claude_Code_Entrypoint: 'cli',
- CLAUDE_CODE_MESSAGING_TOKEN: 'parent-token',
- Claude_Agent_Sdk_Version: 'parent-sdk',
- PATH: 'C:\\bin'
- }
- expect(
- withOrcaClaudeEntrypoint(
- inherited,
- { claude_code_entrypoint: 'company-client', claude_agent_sdk_version: 'configured-sdk' },
- 'win32'
- )
- ).toEqual({
- PATH: 'C:\\bin',
- CLAUDE_CODE_ENTRYPOINT: 'company-client',
- CLAUDE_AGENT_SDK_VERSION: 'configured-sdk'
- })
- expect(withOrcaClaudeEntrypoint(inherited, undefined, 'win32')).toEqual({
- PATH: 'C:\\bin',
- CLAUDE_CODE_ENTRYPOINT: 'orca'
- })
- expect(
- withOrcaClaudeEntrypoint(
- inherited,
- {
- CLAUDE_CODE_ENTRYPOINT: 'first',
- claude_code_entrypoint: 'last'
- },
- 'win32'
- )
- ).toEqual({ PATH: 'C:\\bin', CLAUDE_CODE_ENTRYPOINT: 'last' })
-})
-
-it('uses configured Windows values for both Claude lookup and its final child', async () => {
- vi.stubGlobal('process', { ...process, platform: 'win32' })
- const sources = await resolveClaudeChildEnvSources({
- resolveInheritedEnv: async () => ({
- PATH: '/inherited/bin',
- TOKEN: 'inherited',
- CLAUDE_CONFIG_DIR: '/ambient'
- }),
- resolveEnv: () => ({
- path: '/configured/bin',
- tOKEN: 'configured',
- claude_config_dir: '/configured/home'
- }),
- resolveCommand: (options) => {
- expect(options?.pathEnv).toBe('/configured/bin')
- return { command: '/configured/bin/claude.exe', prefixArgs: [] }
- }
- })
- expect(claudeChildEnv(sources, undefined, { runtimeOnPath: false })).toEqual({
- PATH: '/configured/bin',
- TOKEN: 'configured',
- CLAUDE_CONFIG_DIR: '/configured/home',
- CLAUDE_CODE_ENTRYPOINT: 'orca'
- })
-})
-
it.skipIf(process.platform !== 'win32')(
'passes configured values through a real Windows child despite inherited casing',
async () => {
diff --git a/src/main/daemon/sessions/testing/session-launch-note.test.ts b/src/main/daemon/sessions/testing/session-launch-note.test.ts
deleted file mode 100644
index a2daee9b086..00000000000
--- a/src/main/daemon/sessions/testing/session-launch-note.test.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { describe, expect, it } from 'vitest'
-import { SessionLaunchNote } from '../session-launch-note'
-
-const NOTE = { launchToken: 'launch-1', launchConfig: { agentArgs: '--verbose', agentEnv: {} } }
-const NEXT = { launchToken: 'launch-2', launchConfig: { agentArgs: '', agentEnv: {} } }
-
-// The launch can finish while main is down, so the daemon must retire the note without main.
-describe('a daemon session launch note', () => {
- it('retires when the launched command finishes, even across a same-launch re-arm', () => {
- const note = new SessionLaunchNote()
- note.change({ arm: NOTE })
- note.scan('agent output\x1b]133;')
- note.change({ arm: NOTE })
- expect(note.current).toEqual(NOTE)
- note.scan('D;143\x07')
- expect(note.current).toBeNull()
- })
-
- it('ignores a retire for an earlier launch', () => {
- const note = new SessionLaunchNote()
- note.change({ arm: NOTE })
- note.change({ arm: NEXT })
- note.change({ retire: 'launch-1' })
- expect(note.current).toEqual(NEXT)
- })
-})
diff --git a/src/main/runtime/daemon-launch-note-reattach.test.ts b/src/main/runtime/daemon-launch-note-reattach.test.ts
index 66185017d8f..bd97df9a6ca 100644
--- a/src/main/runtime/daemon-launch-note-reattach.test.ts
+++ b/src/main/runtime/daemon-launch-note-reattach.test.ts
@@ -29,52 +29,6 @@ function attach(
})
}
-function holdLaunch(runtime: OrcaRuntimeService) {
- runtime.registerPty(PTY_ID, 'worktree-1', null, {
- tabId: TAB_ID,
- leafId: LEAF_ID,
- incarnationId: INCARNATION,
- agentLaunchAuthority: {
- launchToken: 'launch-1',
- launchAgent: 'claude',
- launchConfig: LAUNCH_CONFIG
- }
- })
-}
-
-// Some hosts register a spawn before they report its incarnation.
-async function launchedBeforeItsIncarnation(foreground: 'agent' | 'unknown') {
- const runtime = new OrcaRuntimeService(null)
- Object.assign(runtime, {
- resolveTerminalWorkspaceLaunchScope: async () => ({
- id: 'worktree-1',
- path: '/tmp/worktree-1',
- connectionId: null
- })
- })
- runtime.setPtyController({
- write: vi.fn(() => true),
- kill: vi.fn(),
- getForegroundProcess: async () => null,
- setLaunchNote: vi.fn(),
- spawn: async () => {
- runtime.registerPty(PTY_ID, 'worktree-1', null, { tabId: TAB_ID, leafId: LEAF_ID })
- return { id: PTY_ID }
- }
- })
- vi.spyOn(runtime, 'readLaunchedAgentForeground').mockResolvedValue(foreground)
- await runtime.createTerminal('id:worktree-1', {
- tabId: TAB_ID,
- leafId: LEAF_ID,
- command: 'claude',
- launchAgent: 'claude',
- launchConfig: LAUNCH_CONFIG,
- presentation: 'background'
- })
- expect(runtime.getLaunchStatementForPaneKey(PANE_KEY, 'claude')).toEqual(LAUNCH_CONFIG)
- return runtime
-}
-
function makeRuntime() {
const runtime = new OrcaRuntimeService(null)
const setLaunchNote = vi.fn()
@@ -87,64 +41,7 @@ function makeRuntime() {
return { runtime, setLaunchNote }
}
-async function reattach(
- foreground: 'agent' | 'shell' | 'unknown',
- mainHoldsLaunch = false,
- launchNote: typeof NOTE | null | 'omitted' = NOTE,
- finishedOnReattach = false
-) {
- const { runtime, setLaunchNote } = makeRuntime()
- vi.spyOn(runtime, 'readLaunchedAgentForeground').mockResolvedValue(foreground)
- if (mainHoldsLaunch) {
- holdLaunch(runtime)
- }
- attach(runtime, launchNote === 'omitted' ? undefined : launchNote)
- await new Promise((resolve) => setTimeout(resolve, 0))
- if (finishedOnReattach) {
- attach(runtime, null)
- }
- return {
- config: runtime.getLaunchStatementForPaneKey(PANE_KEY, 'claude'),
- retired: setLaunchNote.mock.calls.some(([, change]) => 'retire' in change)
- }
-}
-
-// Nothing reaches a daemon PTY while main is down, so only the same agent still running keeps the note.
describe('a daemon reattach after a main restart', () => {
- it('re-arms the unretired launch while its agent still runs', async () => {
- expect(await reattach('agent')).toEqual({ config: LAUNCH_CONFIG, retired: false })
- })
-
- it('says no launch runs when the foreground is the shell', async () => {
- expect(await reattach('shell')).toEqual({ config: null, retired: true })
- })
-
- it('says no launch runs when the daemon retired its note', async () => {
- expect((await reattach('agent', false, null)).config).toBeNull()
- })
-
- // Undecided: readers keep their earlier same-session rule rather than drop the settings.
- it('makes no statement when the foreground is unreadable', async () => {
- expect((await reattach('unknown')).config).toBeUndefined()
- })
-
- it('settles an undecided pane when a later attach reports its launch finished', async () => {
- expect((await reattach('unknown', false, NOTE, true)).config).toBeNull()
- })
-
- it('makes no statement for a daemon that keeps no launch notes', async () => {
- expect((await reattach('agent', false, 'omitted')).config).toBeUndefined()
- })
-
- it('settles an undecided pane once main sees its command finish', async () => {
- const { runtime } = makeRuntime()
- vi.spyOn(runtime, 'readLaunchedAgentForeground').mockResolvedValue('unknown')
- attach(runtime, NOTE)
- await new Promise((resolve) => setTimeout(resolve, 0))
- runtime.emitDaemonPtyTransientFact(PTY_ID, { kind: 'command-finished', exitCode: 0 })
- expect(runtime.getLaunchStatementForPaneKey(PANE_KEY, 'claude')).toBeNull()
- })
-
it('does not let an earlier foreground read revive a launch a later attach saw finish', async () => {
const { runtime } = makeRuntime()
let answer: (foreground: 'agent') => void = () => {}
@@ -157,94 +54,4 @@ describe('a daemon reattach after a main restart', () => {
await new Promise((resolve) => setTimeout(resolve, 0))
expect(runtime.getLaunchStatementForPaneKey(PANE_KEY, 'claude')).toBeNull()
})
-
- it('makes no statement for an older relay that reports no incarnation', () => {
- const { runtime } = makeRuntime()
- runtime.registerPty(PTY_ID, 'worktree-1', 'ssh-1', {
- tabId: TAB_ID,
- leafId: LEAF_ID,
- reattach: {}
- })
- expect(runtime.getLaunchStatementForPaneKey(PANE_KEY, 'claude')).toBeUndefined()
- })
-
- it('starts a replacement process decided even when its spawn is announced first', () => {
- const { runtime } = makeRuntime()
- const binding = { tabId: TAB_ID, leafId: LEAF_ID }
- attach(runtime, undefined)
- runtime.onPtySpawned(PTY_ID, 'next-incarnation')
- runtime.registerPty(PTY_ID, 'worktree-1', null, {
- ...binding,
- incarnationId: 'next-incarnation'
- })
- expect(runtime.getLaunchStatementForPaneKey(PANE_KEY, 'claude')).toBeNull()
- })
-
- it('drops a held launch when a new process replaces it in the same terminal', () => {
- const { runtime } = makeRuntime()
- const binding = { tabId: TAB_ID, leafId: LEAF_ID }
- holdLaunch(runtime)
- runtime.onPtySpawned(PTY_ID, 'next-incarnation')
- runtime.registerPty(PTY_ID, 'worktree-1', null, {
- ...binding,
- incarnationId: 'next-incarnation'
- })
- expect(runtime.getLaunchStatementForPaneKey(PANE_KEY, 'claude')).toBeNull()
- })
-
- // A finished launch stays finished for its process; only a fresh launch supersedes it.
- it.each([
- ['a daemon that keeps no notes', undefined],
- ['a note the daemon has not retired', NOTE]
- ] as const)('keeps a finished launch gone when %s reattaches', async (_, launchNote) => {
- const { runtime } = makeRuntime()
- vi.spyOn(runtime, 'readLaunchedAgentForeground').mockResolvedValue('agent')
- holdLaunch(runtime)
- runtime.emitDaemonPtyTransientFact(PTY_ID, { kind: 'command-finished', exitCode: 0 })
- attach(runtime, launchNote)
- await new Promise((resolve) => setTimeout(resolve, 0))
- expect(runtime.getLaunchStatementForPaneKey(PANE_KEY, 'claude')).toBeNull()
- })
-
- it('lets a replacement process prove its own launch through a reattach', async () => {
- const { runtime } = makeRuntime()
- vi.spyOn(runtime, 'readLaunchedAgentForeground').mockResolvedValue('agent')
- attach(runtime, undefined)
- attach(runtime, NOTE, 'next-incarnation')
- await new Promise((resolve) => setTimeout(resolve, 0))
- expect(runtime.getLaunchStatementForPaneKey(PANE_KEY, 'claude')).toEqual(LAUNCH_CONFIG)
- })
-
- // Learning the process's first incarnation is no replacement: what main knew still holds.
- it.each([
- ['keeps no notes', undefined],
- ['still has the note', NOTE]
- ] as const)(
- 'keeps a launch that finished before its first incarnation gone when a host that %s attaches',
- async (_, launchNote) => {
- const runtime = await launchedBeforeItsIncarnation('agent')
- runtime.emitDaemonPtyTransientFact(PTY_ID, { kind: 'command-finished', exitCode: 0 })
- attach(runtime, launchNote)
- await new Promise((resolve) => setTimeout(resolve, 0))
- expect(runtime.getLaunchStatementForPaneKey(PANE_KEY, 'claude')).toBeNull()
- }
- )
-
- it.each([
- ['keeps no notes', undefined],
- ['sends the note late', NOTE]
- ] as const)(
- 'keeps a running launch when its first incarnation arrives from a host that %s',
- async (_, launchNote) => {
- const runtime = await launchedBeforeItsIncarnation('unknown')
- attach(runtime, launchNote)
- await new Promise((resolve) => setTimeout(resolve, 0))
- expect(runtime.getLaunchStatementForPaneKey(PANE_KEY, 'claude')).toEqual(LAUNCH_CONFIG)
- }
- )
-
- // The renderer attaches a pane the CLI launched before its agent has started.
- it('leaves a launch main already holds when the attach still sees its shell', async () => {
- expect(await reattach('shell', true)).toEqual({ config: LAUNCH_CONFIG, retired: false })
- })
})
diff --git a/src/renderer/src/lib/browser/documents/doc-preview-grants.test.ts b/src/renderer/src/lib/browser/documents/doc-preview-grants.test.ts
index ffbaa7b5e41..be8603ba0b7 100644
--- a/src/renderer/src/lib/browser/documents/doc-preview-grants.test.ts
+++ b/src/renderer/src/lib/browser/documents/doc-preview-grants.test.ts
@@ -15,13 +15,7 @@ vi.mock('@/lib/workspace/ownership/worktree-runtime-owner', () => ({
runtimeEnvironmentIdOrLocalUnlessTwin: () => (mocks.ambiguous ? null : mocks.environmentId)
}))
-import {
- buildDocPreviewGrantRequest,
- ensureDocPreviewGrant,
- releaseDocPreviewGrant
-} from './doc-preview-grants'
-import { createTestStore } from '@/store/testing/app-store-test-fixture'
-import { makeWorktree } from '@/store/slices/worktrees/worktree.test-fixture'
+import { ensureDocPreviewGrant, releaseDocPreviewGrant } from './doc-preview-grants'
beforeEach(() => {
vi.clearAllMocks()
@@ -35,38 +29,6 @@ beforeEach(() => {
})
describe('doc preview grant lifetime', () => {
- // Why: Share reads and keys from the handle's location, so a later host change must not move it.
- it('keeps the minted location on the handle until the grant is released', async () => {
- const minted = {
- owner: {
- kind: 'runtime' as const,
- environmentId: 'server-1',
- worktreeSelector: 'id:wt-1',
- worktreeRoot: '/srv/repo'
- },
- requestBase: '/srv/repo',
- root: '/srv/repo/docs',
- entryRelativePath: 'docs/a.html'
- }
- const movedHost = { ...minted, owner: { ...minted.owner, environmentId: 'server-2' } }
-
- await expect(ensureDocPreviewGrant('preview-5', minted)).resolves.toMatchObject({
- location: minted
- })
- await expect(ensureDocPreviewGrant('preview-5', movedHost)).resolves.toMatchObject({
- location: minted
- })
- expect(mocks.mintGrant).toHaveBeenCalledExactlyOnceWith({
- ...minted,
- browserPageId: 'preview-5'
- })
-
- releaseDocPreviewGrant('preview-5')
- await expect(ensureDocPreviewGrant('preview-5', movedHost)).resolves.toMatchObject({
- location: movedHost
- })
- })
-
// Late rejection from a released tab must not evict its reopened tab’s new, otherwise unrevokable grant.
it('leaves the entry of a later mint alone when an earlier one rejects', async () => {
const request = {
@@ -96,30 +58,3 @@ describe('doc preview grant lifetime', () => {
await vi.waitFor(() => expect(mocks.revokeGrant).toHaveBeenCalledWith('grant-2'))
})
})
-
-describe('outside-workspace document grants', () => {
- it.each([
- ['/srv/repo', '/tmp/reports/proposal.html', '/tmp/reports'],
- ['C:/repo', 'C:/reports/proposal.html', 'C:/reports']
- ])(
- 'keeps %s as the source workspace while granting only the opened document',
- (workspaceRoot, filePath, root) => {
- mocks.environmentId = 'env-1'
- const state = createTestStore().getState()
- state.getKnownWorktreeById = () =>
- makeWorktree({ id: 'wt-1', repoId: 'repo-1', path: workspaceRoot })
- expect(buildDocPreviewGrantRequest(state, 'wt-1', filePath)).toEqual({
- owner: {
- kind: 'runtime',
- environmentId: 'env-1',
- worktreeSelector: 'id:wt-1',
- worktreeRoot: workspaceRoot,
- fileAccess: 'terminal-artifact'
- },
- requestBase: root,
- root,
- entryRelativePath: 'proposal.html'
- })
- }
- )
-})
diff --git a/src/renderer/src/lib/browser/documents/file-preview-link-open.test.ts b/src/renderer/src/lib/browser/documents/file-preview-link-open.test.ts
deleted file mode 100644
index ce90e028e61..00000000000
--- a/src/renderer/src/lib/browser/documents/file-preview-link-open.test.ts
+++ /dev/null
@@ -1,363 +0,0 @@
-import type * as BrowserFocusModule from '@/components/browser-pane/host-guest/browser-focus'
-import { afterEach, beforeEach, expect, it, vi } from 'vitest'
-import { createStoreCascadesMockApi } from '@/store/testing/app-store-cascade-api.test-fixture'
-import { TEST_REPO } from '@/store/repos/repo.test-fixture'
-import { makeTabGroup, makeUnifiedTab } from '@/store/slices/tabs/tab-group.test-fixture'
-import { makeWorktree } from '@/store/slices/worktrees/worktree.test-fixture'
-import {
- createBrowserLinkTestStore,
- WORKSPACE,
- type BrowserLinkTestStore
-} from '../navigation/browser-link-open.test-fixture'
-import { openFileInBrowserTab } from './file-preview'
-import { captureLinkOpenIntent } from '../../link-open-intent'
-import {
- buildDocPreviewGrantRequest,
- ensureDocPreviewGrant,
- releaseDocPreviewGrant
-} from './doc-preview-grants'
-import type { BrowserOpenOutcome } from '../navigation/browser-link-destination'
-import { openResolvedHtmlFileInBrowser } from '@/components/terminal-pane/links/files/terminal-file-link-browser-open'
-import {
- detectedListingFixture,
- terminalTabFixture
-} from '@/components/native-chat/surfaces/integration/native-chat-workspace-test-fixtures'
-import { openPlannedFileBrowserLink } from './file-preview-link-open'
-
-const mocks = vi.hoisted(() => ({ getState: vi.fn(), mint: vi.fn(), revoke: vi.fn() }))
-vi.mock('@/store/index', () => ({ useAppStore: { getState: () => mocks.getState() } }))
-vi.mock('@/components/browser-pane/host-guest/browser-focus', async (importOriginal) => ({
- ...(await importOriginal()),
- requestBrowserFocus: vi.fn()
-}))
-vi.mock('sonner', () => ({
- toast: { error: vi.fn(), info: vi.fn(), success: vi.fn(), warning: vi.fn() }
-}))
-let store: BrowserLinkTestStore
-const grants: string[] = []
-beforeEach(() => {
- createStoreCascadesMockApi()
- Object.defineProperty(window.api, 'docPreview', {
- value: { mintGrant: mocks.mint, revokeGrant: mocks.revoke },
- configurable: true
- })
- mocks.mint.mockReset().mockImplementation(async (request: { browserPageId: string }) => ({
- grantId: `grant-${request.browserPageId}`,
- url: `orca-preview://grant-${request.browserPageId}/`
- }))
- mocks.revoke.mockReset().mockResolvedValue(undefined)
- store = createBrowserLinkTestStore()
- mocks.getState.mockImplementation(() => store.getState())
-})
-afterEach(() => {
- for (const id of grants.splice(0)) {
- releaseDocPreviewGrant(id)
- }
-})
-
-it('refuses a detected preview whose owner changed despite a retained active host selection', async () => {
- store.setState((state) => ({
- worktreesByRepo: {},
- detectedWorktreesByRepo: {
- repo1: detectedListingFixture(state.worktreesByRepo.repo1!)
- }
- }))
- const initial = store.getState()
- const linkIntent = captureLinkOpenIntent(initial, WORKSPACE, 'source')
- store.setState({
- detectedWorktreesByRepo: {
- repo1: detectedListingFixture([
- makeWorktree({
- id: WORKSPACE,
- repoId: 'repo1',
- path: '/repo',
- hostId: 'ssh:changed-owner'
- })
- ])
- }
- })
- const outcome = await openPlannedFileBrowserLink(
- initial,
- { worktreeId: WORKSPACE, filePath: '/repo/report.html', fileExecutionHostId: 'local' },
- { status: 'browser-tab', url: 'file:///repo/report.html', title: 'report.html' },
- { linkIntent },
- () => true
- )
- expect(outcome).toEqual({ status: 'refused' })
- expect(store.getState().browserPagesByWorkspace).toEqual({})
- expect(store.getState().activeGroupIdByWorktree[WORKSPACE]).toBe('c')
-})
-
-it('SSH document links reuse the source page and its grant without a website-browser capability', async () => {
- const host = 'ssh:ssh-test'
- store.setState((state) => ({
- repos: state.repos.map((repo) => ({
- ...repo,
- connectionId: 'ssh-test',
- executionHostId: host
- })),
- worktreesByRepo: {
- repo1: state.worktreesByRepo.repo1!.map((worktree) => ({ ...worktree, hostId: host }))
- },
- activeWorkspaceExecutionHostId: host,
- unifiedTabsByWorktree: {
- [WORKSPACE]: state.unifiedTabsByWorktree[WORKSPACE]!.map((tab) => ({
- ...tab,
- executionHostId: host
- }))
- },
- runtimeStatusByEnvironmentId: new Map()
- }))
- const docLocation = {
- kind: 'workspace-doc' as const,
- worktreeId: WORKSPACE,
- filePath: '/repo/doc.html'
- }
- const original = store.getState().createBrowserTab(WORKSPACE, '', {
- targetGroupId: 'a',
- executionHostId: host,
- browserRuntimeEnvironmentId: null,
- docLocation,
- activate: false
- })
- let outcome: BrowserOpenOutcome | undefined
- let plan: ReturnType | undefined
- await new Promise((resolve) => {
- plan = openFileInBrowserTab({
- filePath: docLocation.filePath,
- worktreeId: WORKSPACE,
- linkContext: { linkIntent: captureLinkOpenIntent(store.getState(), WORKSPACE, 'source') },
- onLinkOutcome: (value) => {
- outcome = value
- resolve()
- }
- })
- })
- expect(plan?.status).toBe('doc-preview')
- expect(outcome).toMatchObject({
- status: 'opened',
- result: { groupId: 'a', executionHostId: host }
- })
- if (outcome?.status !== 'opened' || !original.activePageId) {
- throw new Error('Expected preview pages')
- }
- expect(outcome.result.browserPageId).toBe(original.activePageId)
- const location = buildDocPreviewGrantRequest(store.getState(), WORKSPACE, docLocation.filePath)
- if (!location) {
- throw new Error('Expected grant owner')
- }
- grants.push(original.activePageId)
- const first = await ensureDocPreviewGrant(original.activePageId, location)
- expect(await ensureDocPreviewGrant(outcome.result.browserPageId, location)).toBe(first)
- expect(mocks.mint).toHaveBeenCalledTimes(1)
- store.getState().closeBrowserTab(original.id)
- await Promise.resolve()
- await Promise.resolve()
- expect(mocks.revoke).toHaveBeenCalledExactlyOnceWith(first.grantId)
-})
-
-it('a folder workspace uses its own layout and activates its browser without Git metadata', async () => {
- const folder = 'folder:folder-1'
- store.setState({
- folderWorkspaces: [
- {
- id: 'folder-1',
- projectGroupId: 'group',
- name: 'Folder',
- folderPath: '/folder',
- executionHostId: 'local',
- linkedTask: null,
- comment: '',
- isArchived: false,
- isUnread: false,
- isPinned: false,
- sortOrder: 0,
- lastActivityAt: 0,
- createdAt: 0,
- updatedAt: 0
- }
- ],
- groupsByWorktree: {
- [folder]: ['left', 'right'].map((id) =>
- makeTabGroup({
- id,
- worktreeId: folder,
- activeTabId: id === 'left' ? 'chat' : 'terminal',
- tabOrder: [id === 'left' ? 'chat' : 'terminal']
- })
- )
- },
- unifiedTabsByWorktree: {
- [folder]: [
- makeUnifiedTab({
- id: 'chat',
- contentType: 'terminal',
- entityId: 'chat-terminal',
- worktreeId: folder,
- groupId: 'left',
- executionHostId: 'local'
- }),
- makeUnifiedTab({
- id: 'terminal',
- entityId: 'other-terminal',
- worktreeId: folder,
- groupId: 'right',
- executionHostId: 'local'
- })
- ]
- },
- tabsByWorktree: {
- [folder]: [
- terminalTabFixture('chat-terminal', folder),
- terminalTabFixture('other-terminal', folder)
- ]
- },
- activeGroupIdByWorktree: { [folder]: 'left' },
- layoutByWorktree: {
- [folder]: {
- type: 'split',
- direction: 'horizontal',
- first: { type: 'leaf', groupId: 'left' },
- second: { type: 'leaf', groupId: 'right' }
- }
- },
- worktreesByRepo: {}
- })
- const outcome = vi.fn()
- await new Promise((resolve) =>
- openFileInBrowserTab({
- filePath: '/folder/report.html',
- worktreeId: folder,
- linkContext: { linkIntent: captureLinkOpenIntent(store.getState(), folder, 'chat') },
- onLinkOutcome: (result) => {
- outcome(result)
- resolve(result)
- }
- })
- )
- expect(outcome).toHaveBeenCalledWith(
- expect.objectContaining({
- status: 'opened',
- result: expect.objectContaining({ worktreeId: folder })
- })
- )
- expect(store.getState().activeGroupIdByWorktree[folder]).toBe('right')
- expect(store.getState().groupsByWorktree[folder]).toHaveLength(2)
-})
-
-it.each([false, true])(
- 'refuses a replaced file owner for a captured preview (explicit: %s)',
- async (explicit) => {
- const linkIntent = captureLinkOpenIntent(store.getState(), WORKSPACE, 'source', {
- explicitSourceGroup: explicit
- })
- const host = 'ssh:changed-owner'
- store.setState((state) => ({
- repos: state.repos.map((repo) => ({
- ...repo,
- connectionId: 'changed-owner',
- executionHostId: host
- })),
- worktreesByRepo: {
- repo1: state.worktreesByRepo.repo1!.map((worktree) => ({ ...worktree, hostId: host }))
- },
- activeWorkspaceExecutionHostId: host
- }))
- const outcome = vi.fn()
- await new Promise((resolve) =>
- openFileInBrowserTab({
- filePath: '/repo/index.html',
- worktreeId: WORKSPACE,
- linkContext: { linkIntent },
- onLinkOutcome: (result) => {
- outcome(result)
- resolve(result)
- }
- })
- )
- expect(outcome).toHaveBeenCalledExactlyOnceWith({ status: 'refused' })
- expect(store.getState().browserPagesByWorkspace).toEqual({})
- expect(store.getState().activeGroupIdByWorktree[WORKSPACE]).toBe('c')
- }
-)
-
-it.each([true, false])(
- 'validates the resolved file owner independently of a different source workspace (owner matches: %s)',
- async (ownerMatches) => {
- const destination = 'repo2::/other'
- const host = 'ssh:file-owner'
- const linkIntent = captureLinkOpenIntent(store.getState(), WORKSPACE, 'source')
- store.setState((state) => ({
- repos: [
- ...state.repos,
- { ...TEST_REPO, id: 'repo2', connectionId: 'file-owner', executionHostId: host }
- ],
- worktreesByRepo: {
- ...state.worktreesByRepo,
- repo2: [makeWorktree({ id: destination, repoId: 'repo2', path: '/other', hostId: host })]
- }
- }))
- const outcome = vi.fn()
- await new Promise((resolve) =>
- openFileInBrowserTab({
- filePath: '/other/report.html',
- worktreeId: destination,
- fileExecutionHostId: ownerMatches ? host : 'local',
- linkContext: { linkIntent },
- onLinkOutcome: (result) => {
- outcome(result)
- resolve(result)
- }
- })
- )
- if (!ownerMatches) {
- expect(outcome).toHaveBeenCalledExactlyOnceWith({ status: 'refused' })
- expect(store.getState().browserPagesByWorkspace).toEqual({})
- expect(store.getState().activeWorktreeId).toBe(WORKSPACE)
- return
- }
- expect(outcome).toHaveBeenCalledWith(
- expect.objectContaining({
- status: 'opened',
- result: expect.objectContaining({ worktreeId: destination, executionHostId: host })
- })
- )
- }
-)
-
-it('keeps deliberate client-local HTML discovery from a remote source available', async () => {
- const host = 'ssh:remote-source'
- store.setState((state) => ({
- repos: state.repos.map((repo) => ({
- ...repo,
- connectionId: 'remote-source',
- executionHostId: host
- })),
- worktreesByRepo: {
- repo1: state.worktreesByRepo.repo1!.map((worktree) => ({ ...worktree, hostId: host }))
- },
- activeWorkspaceExecutionHostId: host,
- unifiedTabsByWorktree: {
- [WORKSPACE]: state.unifiedTabsByWorktree[WORKSPACE]!.map((tab) => ({
- ...tab,
- executionHostId: host
- }))
- }
- }))
- const outcome = await openResolvedHtmlFileInBrowser({
- filePath: '/tmp/client-report.html',
- worktreeId: WORKSPACE,
- clientLocal: true,
- linkContext: { linkIntent: captureLinkOpenIntent(store.getState(), WORKSPACE, 'source') }
- })
- expect(outcome).toMatchObject({ status: 'opened', result: { worktreeId: WORKSPACE } })
- if (outcome?.status !== 'opened') {
- throw new Error('Expected client-local preview')
- }
- expect(
- store.getState().browserPagesByWorkspace[outcome.result.browserWorkspaceId]?.[0]
- ).toMatchObject({
- url: 'file:///tmp/client-report.html',
- browserRuntimeEnvironmentId: null
- })
-})
diff --git a/src/renderer/src/store/slices/editor/markdown/editor-markdown-link-activation.test.ts b/src/renderer/src/store/slices/editor/markdown/editor-markdown-link-activation.test.ts
index aaaaa4df85c..8062fddcbcf 100644
--- a/src/renderer/src/store/slices/editor/markdown/editor-markdown-link-activation.test.ts
+++ b/src/renderer/src/store/slices/editor/markdown/editor-markdown-link-activation.test.ts
@@ -1,8 +1,5 @@
import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest'
-import {
- FLOATING_TERMINAL_WORKTREE_ID,
- getDefaultSettings
-} from '../../../../../../shared/constants'
+import { getDefaultSettings } from '../../../../../../shared/constants'
import { createEditorStore } from '../editor-slice-test-harness'
import { buildOwnedEditorFileId as ownedEditorFileId } from '../file-ids/editor-file-ids'
import type { AppState } from '../../../types'
@@ -140,134 +137,6 @@ describe('createEditorSlice activateMarkdownLink', () => {
])
})
- it('stats SSH markdown links through the source worktree connection before opening', async () => {
- const store = createEditorStore()
- pathExistsMock.mockResolvedValue(true)
- store.setState({
- repos: [
- {
- id: 'repo1',
- path: '/repo',
- displayName: 'Repo',
- badgeColor: '#000',
- addedAt: 0,
- connectionId: 'ssh-1'
- }
- ],
- worktreesByRepo: {
- repo1: [
- {
- id: 'wt-1',
- repoId: 'repo1',
- path: '/repo',
- branch: 'refs/heads/main',
- head: 'abc',
- isBare: false,
- isMainWorktree: true,
- displayName: 'main',
- comment: '',
- linkedIssue: null,
- linkedPR: null,
- linkedLinearIssue: null,
- isArchived: false,
- isUnread: false,
- isPinned: false,
- sortOrder: 0,
- lastActivityAt: 0
- }
- ]
- }
- } as Partial)
-
- await store.getState().activateMarkdownLink('./guide.md', {
- sourceFilePath: '/repo/docs/note.md',
- worktreeId: 'wt-1',
- worktreeRoot: '/repo'
- })
-
- expect(fsStatMock).toHaveBeenCalledWith({
- filePath: '/repo/docs/guide.md',
- connectionId: 'ssh-1'
- })
- expect(store.getState().openFiles).toEqual([
- expect.objectContaining({
- filePath: '/repo/docs/guide.md',
- mode: 'edit',
- isPreview: true
- })
- ])
- })
-
- it('does not open linked markdown directories as files', async () => {
- const store = createEditorStore()
- fsStatMock.mockResolvedValueOnce({ size: 1, isDirectory: true, mtime: 1 })
-
- await store.getState().activateMarkdownLink('./guide.md', {
- sourceFilePath: '/repo/docs/note.md',
- worktreeId: 'wt-1',
- worktreeRoot: '/repo'
- })
-
- expect(store.getState().openFiles).toEqual([])
- })
-
- it('toasts when the markdown target is missing', async () => {
- const store = createEditorStore()
- pathExistsMock.mockResolvedValue(false)
-
- await store.getState().activateMarkdownLink('./missing.md', {
- sourceFilePath: '/repo/docs/note.md',
- worktreeId: 'wt-1',
- worktreeRoot: '/repo'
- })
-
- expect(store.getState().openFiles).toEqual([])
- expect(openFileUriMock).not.toHaveBeenCalled()
- })
-
- it('cancels superseded line-anchor reveal frames', async () => {
- const store = createEditorStore()
- pathExistsMock.mockResolvedValue(true)
- let nextFrameId = 1
- const pendingFrames = new Map()
- vi.stubGlobal('requestAnimationFrame', (callback: FrameRequestCallback) => {
- const frameId = nextFrameId++
- pendingFrames.set(frameId, callback)
- return frameId
- })
- vi.stubGlobal('cancelAnimationFrame', (frameId: number) => {
- pendingFrames.delete(frameId)
- })
-
- await store.getState().activateMarkdownLink('./first.md#L3', {
- sourceFilePath: '/repo/docs/note.md',
- worktreeId: 'wt-1',
- worktreeRoot: '/repo'
- })
- await store.getState().activateMarkdownLink('./second.md#L9', {
- sourceFilePath: '/repo/docs/note.md',
- worktreeId: 'wt-1',
- worktreeRoot: '/repo'
- })
-
- while (pendingFrames.size > 0) {
- const nextPendingFrame = pendingFrames.entries().next()
- if (nextPendingFrame.done) {
- break
- }
- const [frameId, callback] = nextPendingFrame.value
- pendingFrames.delete(frameId)
- callback(0)
- }
- expect(store.getState().pendingEditorReveal).toEqual({
- filePath: '/repo/docs/second.md',
- fileId: '/repo/docs/second.md',
- line: 9,
- column: 1,
- matchLength: 0
- })
- })
-
it('reveals active-runtime markdown line anchors on the owner-qualified tab id', async () => {
const store = createEditorStore()
pathExistsMock.mockResolvedValue(true)
@@ -316,162 +185,4 @@ describe('createEditorSlice activateMarkdownLink', () => {
matchLength: 0
})
})
-
- it('sets line-anchor source mode on the owner-qualified target id', async () => {
- const store = createEditorStore()
- pathExistsMock.mockResolvedValue(true)
- store.getState().openFile({
- filePath: '/repo/docs/note.md',
- relativePath: 'docs/note.md',
- worktreeId: 'wt-1',
- language: 'markdown',
- mode: 'edit'
- })
- store.getState().openFile(
- {
- filePath: '/repo/docs/note.md',
- relativePath: 'docs/note.md',
- worktreeId: FLOATING_TERMINAL_WORKTREE_ID,
- runtimeEnvironmentId: null,
- language: 'markdown',
- mode: 'edit'
- },
- { suppressActiveRuntimeFallback: true }
- )
- const floatingFileId = ownedEditorFileId(
- '/repo/docs/note.md',
- FLOATING_TERMINAL_WORKTREE_ID,
- null
- )
-
- await store.getState().activateMarkdownLink('./note.md#L3', {
- sourceFilePath: '/repo/docs/note.md',
- worktreeId: FLOATING_TERMINAL_WORKTREE_ID,
- worktreeRoot: '/repo',
- runtimeEnvironmentId: null
- })
-
- expect(store.getState().markdownViewMode[floatingFileId]).toBe('source')
- expect(store.getState().markdownViewMode['/repo/docs/note.md']).toBeUndefined()
- expect(store.getState().pendingEditorReveal).toEqual({
- filePath: '/repo/docs/note.md',
- fileId: 'editor:global-floating-terminal:local:%2Frepo%2Fdocs%2Fnote.md',
- line: 3,
- column: 1,
- matchLength: 0
- })
- })
-
- it('reveals line targets for non-markdown file links', async () => {
- const store = createEditorStore()
- await store.getState().activateMarkdownLink('../src/PdfViewer.tsx:142:7', {
- sourceFilePath: '/repo/docs/note.md',
- worktreeId: 'wt-1',
- worktreeRoot: '/repo'
- })
-
- expect(store.getState().openFiles).toEqual([
- expect.objectContaining({
- filePath: '/repo/src/PdfViewer.tsx',
- relativePath: 'src/PdfViewer.tsx',
- mode: 'edit',
- isPreview: true
- })
- ])
- expect(store.getState().pendingEditorReveal).toEqual({
- filePath: '/repo/src/PdfViewer.tsx',
- fileId: '/repo/src/PdfViewer.tsx',
- line: 142,
- column: 7,
- matchLength: 0
- })
- })
-
- it('opens explicit file URLs outside the worktree in Orca as user-named tabs', async () => {
- const store = createEditorStore()
- await store.getState().activateMarkdownLink('file:///tmp/image.png', {
- sourceFilePath: '/repo/docs/note.md',
- worktreeId: 'wt-1',
- worktreeRoot: '/repo'
- })
- expect(store.getState().openFiles).toEqual([
- expect.objectContaining({
- filePath: '/tmp/image.png',
- relativePath: '/tmp/image.png',
- mode: 'edit',
- isPreview: true
- })
- ])
- expect(openFileUriMock).not.toHaveBeenCalled()
- })
-
- it('blocks external file URLs from SSH markdown sources', async () => {
- const store = createEditorStore()
- store.setState({
- repos: [
- {
- id: 'repo1',
- path: '/repo',
- displayName: 'Repo',
- badgeColor: '#000',
- addedAt: 0,
- connectionId: 'ssh-1'
- }
- ],
- worktreesByRepo: {
- repo1: [
- {
- id: 'wt-1',
- repoId: 'repo1',
- path: '/repo',
- branch: 'refs/heads/main',
- head: 'abc',
- isBare: false,
- isMainWorktree: true,
- displayName: 'main',
- comment: '',
- linkedIssue: null,
- linkedPR: null,
- linkedLinearIssue: null,
- isArchived: false,
- isUnread: false,
- isPinned: false,
- sortOrder: 0,
- lastActivityAt: 0
- }
- ]
- }
- } as Partial)
-
- await store.getState().activateMarkdownLink('file:///tmp/image.png', {
- sourceFilePath: '/repo/docs/note.md',
- worktreeId: 'wt-1',
- worktreeRoot: '/repo'
- })
-
- expect(store.getState().openFiles).toEqual([])
- })
-
- it('activates same-file line anchors via setActiveFile without opening a new tab', async () => {
- const store = createEditorStore()
- pathExistsMock.mockResolvedValue(true)
- store.getState().openFile({
- filePath: '/repo/docs/note.md',
- relativePath: 'docs/note.md',
- worktreeId: 'wt-1',
- language: 'markdown',
- mode: 'edit'
- })
- const openCountBefore = store.getState().openFiles.length
-
- await store.getState().activateMarkdownLink('./note.md#L3', {
- sourceFilePath: '/repo/docs/note.md',
- worktreeId: 'wt-1',
- worktreeRoot: '/repo'
- })
-
- expect(store.getState().openFiles).toHaveLength(openCountBefore)
- expect(store.getState().markdownViewMode['/repo/docs/note.md']).toBe('source')
- expect(store.getState().pendingEditorReveal?.line).toBe(3)
- })
})
diff --git a/src/renderer/src/store/slices/editor/markdown/editor-markdown-view-state.test.ts b/src/renderer/src/store/slices/editor/markdown/editor-markdown-view-state.test.ts
deleted file mode 100644
index bca8a660b32..00000000000
--- a/src/renderer/src/store/slices/editor/markdown/editor-markdown-view-state.test.ts
+++ /dev/null
@@ -1,191 +0,0 @@
-import { describe, expect, it, vi } from 'vitest'
-import { createEditorTabsStore as createEditorStore } from '../editor-slice-test-harness'
-
-import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants'
-
-const { toastErrorMock } = vi.hoisted(() => ({
- toastErrorMock: vi.fn()
-}))
-
-vi.mock('sonner', () => ({
- toast: { error: toastErrorMock }
-}))
-
-const { notifyHostOfMirroredEditorCloseMock } = vi.hoisted(() => ({
- notifyHostOfMirroredEditorCloseMock: vi.fn()
-}))
-vi.mock('@/runtime/web-session-tabs-sync/closing/close-mirrored-editor-tab', () => ({
- notifyHostOfMirroredEditorClose: (...args: unknown[]) =>
- notifyHostOfMirroredEditorCloseMock(...args)
-}))
-
-describe('createEditorSlice markdown view state', () => {
- it('drops markdown visibility for a preview replaced by a diff', () => {
- const store = createEditorStore()
-
- store.getState().openFile(
- {
- filePath: '/repo/docs/README.md',
- relativePath: 'docs/README.md',
- worktreeId: 'wt-1',
- language: 'markdown',
- mode: 'edit'
- },
- { preview: true }
- )
- store.getState().setMarkdownFrontmatterVisible('/repo/docs/README.md', false)
- store.getState().setMarkdownTableOfContentsVisible('/repo/docs/README.md', true)
-
- store.getState().openDiff('wt-1', '/repo/docs/guide.md', 'docs/guide.md', 'markdown', false, {
- preview: true
- })
-
- expect(store.getState().markdownFrontmatterVisible).toEqual({})
- expect(store.getState().markdownTableOfContentsVisible).toEqual({})
- })
-
- it('keeps markdown visibility when another preview still references a replaced source', () => {
- const store = createEditorStore()
-
- store.getState().openFile(
- {
- filePath: '/repo/docs/README.md',
- relativePath: 'docs/README.md',
- worktreeId: 'wt-1',
- language: 'markdown',
- mode: 'edit'
- },
- { preview: true }
- )
- store.getState().openMarkdownPreview({
- filePath: '/repo/docs/README.md',
- relativePath: 'docs/README.md',
- worktreeId: 'wt-1',
- language: 'markdown'
- })
- store.getState().setMarkdownFrontmatterVisible('/repo/docs/README.md', false)
- store.getState().setMarkdownTableOfContentsVisible('/repo/docs/README.md', true)
-
- store.getState().openDiff('wt-1', '/repo/docs/guide.md', 'docs/guide.md', 'markdown', false, {
- preview: true
- })
-
- expect(store.getState().markdownFrontmatterVisible).toEqual({
- '/repo/docs/README.md': false
- })
- expect(store.getState().markdownTableOfContentsVisible).toEqual({
- '/repo/docs/README.md': true
- })
- })
-})
-
-describe('createEditorSlice markdown frontmatter visibility (#4468)', () => {
- it('keeps the visibility flag while a preview tab still references the source file', () => {
- const store = createEditorStore()
- store.getState().openFile({
- filePath: '/repo/notes.md',
- relativePath: 'notes.md',
- worktreeId: 'wt-1',
- language: 'markdown',
- mode: 'edit'
- })
- store.getState().openMarkdownPreview({
- filePath: '/repo/notes.md',
- relativePath: 'notes.md',
- worktreeId: 'wt-1',
- language: 'markdown'
- })
- store.getState().setMarkdownFrontmatterVisible('/repo/notes.md', false)
-
- store.getState().closeFile('/repo/notes.md')
-
- expect(store.getState().markdownFrontmatterVisible).toEqual({ '/repo/notes.md': false })
-
- store.getState().closeFile('markdown-preview::/repo/notes.md')
-
- expect(store.getState().markdownFrontmatterVisible).toEqual({})
- })
-})
-
-describe('createEditorSlice openMarkdownPreview', () => {
- it('keeps preview-only same-path markdown previews separate by owner', () => {
- const store = createEditorStore()
-
- store.getState().openMarkdownPreview({
- filePath: '/repo/docs/README.md',
- relativePath: 'docs/README.md',
- worktreeId: 'wt-1',
- language: 'markdown'
- })
- store.getState().openMarkdownPreview({
- filePath: '/repo/docs/README.md',
- relativePath: 'README.md',
- worktreeId: FLOATING_TERMINAL_WORKTREE_ID,
- runtimeEnvironmentId: null,
- language: 'markdown'
- })
-
- const previews = store.getState().openFiles.filter((file) => file.mode === 'markdown-preview')
- expect(previews).toEqual([
- expect.objectContaining({
- id: 'markdown-preview::/repo/docs/README.md',
- markdownPreviewSourceFileId: '/repo/docs/README.md',
- worktreeId: 'wt-1'
- }),
- expect.objectContaining({
- worktreeId: FLOATING_TERMINAL_WORKTREE_ID
- })
- ])
- })
-
- it('keeps same-path markdown previews separate by source owner', () => {
- const store = createEditorStore()
-
- store.getState().openFile({
- filePath: '/repo/docs/README.md',
- relativePath: 'docs/README.md',
- worktreeId: 'wt-1',
- language: 'markdown',
- mode: 'edit'
- })
- store.getState().openFile(
- {
- filePath: '/repo/docs/README.md',
- relativePath: 'README.md',
- worktreeId: FLOATING_TERMINAL_WORKTREE_ID,
- runtimeEnvironmentId: null,
- language: 'markdown',
- mode: 'edit'
- },
- { suppressActiveRuntimeFallback: true }
- )
- const floatingFile = store
- .getState()
- .openFiles.find((file) => file.worktreeId === FLOATING_TERMINAL_WORKTREE_ID)
- expect(floatingFile).toBeDefined()
-
- store.getState().openMarkdownPreview({
- filePath: '/repo/docs/README.md',
- relativePath: 'docs/README.md',
- worktreeId: 'wt-1',
- language: 'markdown'
- })
- store.getState().openMarkdownPreview(
- {
- filePath: '/repo/docs/README.md',
- relativePath: 'README.md',
- worktreeId: FLOATING_TERMINAL_WORKTREE_ID,
- runtimeEnvironmentId: null,
- language: 'markdown'
- },
- { sourceFileId: floatingFile?.id }
- )
-
- const previews = store.getState().openFiles.filter((file) => file.mode === 'markdown-preview')
- expect(previews).toHaveLength(2)
- expect(previews.map((file) => file.markdownPreviewSourceFileId)).toEqual([
- '/repo/docs/README.md',
- floatingFile?.id
- ])
- })
-})
From 894dbbd0eccf40a566728d3da01f7f26fe3d44fd Mon Sep 17 00:00:00 2001
From: OrcaWin
Date: Mon, 9 Nov 2026 17:30:34 -0800
Subject: [PATCH 03/50] test: remove low-value mobile generation and cache
cases (#40571)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
---
.../mobile-web-shell/generation-store.test.ts | 380 +-----------------
.../removed-host-shell-cache.test.ts | 56 ---
2 files changed, 1 insertion(+), 435 deletions(-)
delete mode 100644 mobile/src/mobile-web-shell/removed-host-shell-cache.test.ts
diff --git a/mobile/src/mobile-web-shell/generation-store.test.ts b/mobile/src/mobile-web-shell/generation-store.test.ts
index 2a5c4fc70a4..b14db27039d 100644
--- a/mobile/src/mobile-web-shell/generation-store.test.ts
+++ b/mobile/src/mobile-web-shell/generation-store.test.ts
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest'
-import { createGenerationStore, MAX_CACHED_HOSTS } from './generation-store'
+import { createGenerationStore } from './generation-store'
import { deriveHostCacheKey } from './host-cache-key'
import type { MobileWebBundleFetchResult } from '../transport/web-bundle/mobile-web-bundle-fetch'
import { computeMobileWebBundleId } from '../../../src/shared/mobile-web-bundle/manifest-contract'
@@ -59,343 +59,6 @@ async function activate(
await store.commitGeneration(await store.stageGeneration(hostKey, result))
}
-function hostKeys(count: number): string[] {
- return Array.from({ length: count }, (_, index) => deriveHostCacheKey(`host-${index}`))
-}
-
-describe('generation store', () => {
- it('refuses an asset that is missing or the wrong length, leaving no generation', async () => {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- const missing = buildResult({ bytes: new Map([['index.html', new Uint8Array(4)]]) })
- const short = buildResult({
- bytes: new Map([
- ['index.html', new Uint8Array(4)],
- ['assets/app.js', new Uint8Array(1)]
- ])
- })
-
- await expect(store.stageGeneration(HOST, missing)).rejects.toThrow('assets/app.js is absent')
- await expect(store.stageGeneration(HOST, short)).rejects.toThrow("not the manifest's 2")
- expect(fs.paths()).toEqual([])
- expect(await store.readActiveGeneration(HOST)).toBeNull()
- })
-
- it('drops the staged tree when a write fails', async () => {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- fs.failWritesAt(`${HOST}/tmp/${BUILD}/assets/app.js`)
-
- await expect(store.stageGeneration(HOST, buildResult({}))).rejects.toThrow('disk-full')
-
- expect(fs.paths().some((path) => path.includes(`tmp/${BUILD}`))).toBe(false)
- expect(await store.readActiveGeneration(HOST)).toBeNull()
- })
-
- it('leaves no generation and no tmp for any host when a download is interrupted', async () => {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- const other = deriveHostCacheKey('host-b')
- // The manifest is written last, so a download cut off mid-stage leaves assets without one.
- fs.seed(`${HOST}/tmp/${BUILD}/index.html`, { kind: 'file', bytes: new Uint8Array(4) })
- fs.seed(`${other}/tmp/${BUILD}/index.html`, { kind: 'file', bytes: new Uint8Array(4) })
-
- expect(await store.readActiveGeneration(HOST)).toBeNull()
- expect(await store.readActiveGeneration(other)).toBeNull()
- expect(fs.paths().some((path) => path.includes('/tmp'))).toBe(false)
- })
-
- it('reads two generations as no activation and drops the host tree', async () => {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- await activate(store, HOST)
- fs.seed(`${HOST}/generations/${'c'.repeat(64)}/manifest.json`, {
- kind: 'file',
- bytes: new TextEncoder().encode('{}')
- })
-
- expect(await store.readActiveGeneration(HOST)).toBeNull()
- expect(fs.paths().some((path) => path.startsWith(HOST))).toBe(false)
- })
-
- it('reads an unparseable or mismatched manifest as no activation and drops the host tree', async () => {
- for (const body of [
- 'not json',
- JSON.stringify({ ...buildResult({}).manifest, buildId: 'd'.repeat(64) })
- ]) {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- await activate(store, HOST)
- fs.seed(`${HOST}/generations/${BUILD}/manifest.json`, {
- kind: 'file',
- bytes: new TextEncoder().encode(body)
- })
-
- expect(await store.readActiveGeneration(HOST)).toBeNull()
- expect(fs.paths().some((path) => path.startsWith(HOST))).toBe(false)
- }
- })
-
- it('evicts the least recently activated host past the ceiling', async () => {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- const hosts = hostKeys(MAX_CACHED_HOSTS + 1)
-
- for (const host of hosts) {
- await activate(store, host)
- }
-
- expect(await store.readActiveGeneration(hosts[0])).toBeNull()
- expect(fs.paths().some((path) => path.startsWith(hosts[0]))).toBe(false)
- for (const host of hosts.slice(1)) {
- expect((await store.readActiveGeneration(host))?.buildId).toBe(BUILD)
- }
- expect(fs.text('hosts.json')).toBe(JSON.stringify(hosts.slice(1)))
- })
-
- it('evicts a host with no index entry before the least recently activated one', async () => {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- const [oldest, ...rest] = hostKeys(MAX_CACHED_HOSTS - 1)
- const orphan = deriveHostCacheKey('orphan')
- for (const host of [oldest, ...rest]) {
- await activate(store, host)
- }
- await activate(store, orphan)
- const order = [oldest, ...rest]
- fs.seed('hosts.json', { kind: 'file', bytes: new TextEncoder().encode(JSON.stringify(order)) })
-
- await activate(store, deriveHostCacheKey('one-too-many'))
-
- expect(fs.paths().some((path) => path.startsWith(orphan))).toBe(false)
- expect((await store.readActiveGeneration(oldest))?.buildId).toBe(BUILD)
- })
-
- it('never counts or evicts a host that is only mid-download', async () => {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- const hosts = hostKeys(MAX_CACHED_HOSTS)
- const oldest = hosts[0]
- const downloading = deriveHostCacheKey('downloading')
- for (const host of hosts) {
- await activate(store, host)
- }
- const staged = await store.stageGeneration(downloading, buildResult({}))
-
- await activate(store, deriveHostCacheKey('one-too-many'))
-
- // Count activations only; eviction must leave staged downloads intact.
- expect(fs.paths().some((path) => path.startsWith(oldest))).toBe(false)
- expect(fs.text(`${staged.directory.slice(ROOT.length + 1)}/manifest.json`)).not.toBeNull()
- await store.commitGeneration(staged)
- expect((await store.readActiveGeneration(downloading))?.buildId).toBe(BUILD)
- })
-
- it('serializes two stage calls for one host and build', async () => {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- // Give one build id conflicting asset lists to expose interleaved writes into the same staging directory.
- const staging = `${HOST}/tmp/${BUILD}`
- const earlier = buildResult({
- buildId: BUILD,
- assets: [{ path: 'assets/earlier.js', byteLength: 2 }]
- })
- const later = buildResult({
- buildId: BUILD,
- assets: [{ path: 'assets/later.js', byteLength: 3 }]
- })
-
- const [first, second] = await Promise.all([
- store.stageGeneration(HOST, earlier),
- store.stageGeneration(HOST, later)
- ])
-
- expect(first.directory).toBe(second.directory)
- expect(fs.writes).toEqual([
- `${staging}/assets/earlier.js`,
- `${staging}/manifest.json`,
- `${staging}/assets/later.js`,
- `${staging}/manifest.json`
- ])
- expect(fs.paths().filter((path) => path.startsWith(`${staging}/assets/`))).toEqual([
- `${staging}/assets/later.js`
- ])
- })
-
- it('refuses a path that escapes the staged tree, and a host key that is not one', async () => {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- const escapes = [
- '../outside.js',
- 'assets/../../outside.js',
- '/etc/passwd',
- 'assets//app.js',
- 'manifest.json',
- 'Manifest.JSON'
- ]
-
- for (const path of escapes) {
- const result = buildResult({ assets: [{ path, byteLength: 1 }] })
- await expect(store.stageGeneration(HOST, result)).rejects.toThrow('refuses to stage')
- }
- await expect(store.stageGeneration('host-a', buildResult({}))).rejects.toThrow(
- 'not a host cache key'
- )
- expect(fs.paths()).toEqual([])
- })
-
- it('refuses a rename that did not carry the tree, as Android below API 26 can', async () => {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- fs.loseContentsOnMove()
-
- const staged = await store.stageGeneration(HOST, buildResult({}))
- await expect(store.commitGeneration(staged)).rejects.toThrow('did not carry its manifest')
-
- expect(await store.readActiveGeneration(HOST)).toBeNull()
- expect(fs.paths().some((path) => path.includes('generations/'))).toBe(false)
- })
-
- it('keeps the host tree when the manifest read fails, and drops it when it is missing', async () => {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- const manifest = `${HOST}/generations/${BUILD}/manifest.json`
- await activate(store, HOST)
- const before = fs.paths().filter((path) => !path.endsWith('/tmp'))
-
- fs.failReadsAt(manifest)
- expect(await store.readActiveGeneration(HOST)).toBeNull()
- expect(fs.paths()).toEqual(before)
-
- fs.failReadsAt(null)
- await fs.delete(`${ROOT}/${manifest}`)
- expect(await store.readActiveGeneration(HOST)).toBeNull()
- expect(fs.paths().some((path) => path.startsWith(HOST))).toBe(false)
- })
-
- it('replaces an entry named for the build id that is not a readable generation', async () => {
- const build = BUILD
- // Model a crash between rename and the post-rename manifest check.
- for (const seeded of [
- { kind: 'directory' },
- { kind: 'file', bytes: new Uint8Array(1) }
- ] as const) {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- fs.seed(`${HOST}/generations/${build}`, seeded)
-
- await activate(store, HOST)
-
- expect((await store.readActiveGeneration(HOST))?.buildId).toBe(build)
- expect(fs.text(`${HOST}/generations/${build}/index.html`)).not.toBeNull()
- }
- })
-
- it('refuses a handle whose staged tree is gone without touching the activation', async () => {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- await activate(store, HOST)
-
- const staged = await store.stageGeneration(HOST, buildResult(SECOND))
- await store.abortStagedGeneration(staged)
-
- await expect(store.commitGeneration(staged)).rejects.toThrow('no longer on disk')
- expect((await store.readActiveGeneration(HOST))?.buildId).toBe(BUILD)
- })
-
- it('refuses a staged handle it did not issue', async () => {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- await activate(store, HOST)
- const before = fs.paths()
- const forged = {
- hostKey: HOST,
- buildId: SECOND_BUILD,
- directory: `${ROOT}/${HOST}/generations/${BUILD}`,
- manifest: buildResult({}).manifest
- }
-
- await expect(store.commitGeneration(forged)).rejects.toThrow('did not issue')
- await expect(store.abortStagedGeneration(forged)).rejects.toThrow('did not issue')
- expect(fs.paths()).toEqual(before)
- expect((await store.readActiveGeneration(HOST))?.buildId).toBe(BUILD)
- })
-
- it('opens builds kept under the old root without a download once the root moves', async () => {
- const fs = createFakeFileSystem()
- const legacyRootUri = 'file:///caches/mobile-web'
- await activate(createGenerationStore({ fileSystem: { ...fs, rootUri: legacyRootUri } }), HOST)
-
- const store = createGenerationStore({ fileSystem: fs, legacyRootUri })
-
- expect((await store.readActiveGeneration(HOST))?.buildId).toBe(BUILD)
- expect(await fs.list(legacyRootUri)).toEqual([])
- })
-})
-
-describe('reusable assets for the next download', () => {
- const NEXT = buildResult({
- assets: [
- { path: 'index.html', byteLength: 8 },
- { path: 'assets/app-2.js', byteLength: 2 }
- ]
- })
- const NEXT_BUILD = NEXT.manifest.buildId
- const [PAGE, SCRIPT] = NEXT.manifest.assets
- const DOWNLOADED = new Map([['index.html', new Uint8Array(8).fill(9)]])
- const LEFT_TO_STAGE = { ...NEXT, assets: DOWNLOADED, reused: ['assets/app-2.js'] }
-
- it.each([HOST, deriveHostCacheKey('second-host')])(
- 'matches cached assets by content for %s',
- async (opened) => {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- expect((await store.openReusableAssets(HOST)).has(SCRIPT!)).toBe(false)
- await activate(store, HOST)
-
- const reusable = await store.openReusableAssets(opened)
-
- expect(reusable.has(SCRIPT!)).toBe(true)
- expect(reusable.has(PAGE!)).toBe(false)
- expect(reusable.has({ ...SCRIPT!, sha256: 'f'.repeat(64) })).toBe(false)
- expect(await reusable.check(SCRIPT!)).toBe(true)
- fs.seed(`${HOST}/generations/${BUILD}/assets/app.js`, {
- kind: 'file',
- bytes: new Uint8Array(1)
- })
- expect(await reusable.check(SCRIPT!)).toBe(false)
- }
- )
-
- it('copies the reused assets beside the downloaded ones and commits the whole build', async () => {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- await activate(store, HOST)
-
- await activate(store, HOST, LEFT_TO_STAGE)
-
- const generation = `${HOST}/generations/${NEXT_BUILD}`
- expect(fs.bytes(`${generation}/index.html`)).toEqual(new Uint8Array(8).fill(9))
- expect(fs.bytes(`${generation}/assets/app-2.js`)).toEqual(new Uint8Array(2).fill(7))
- expect((await store.readActiveGeneration(HOST))?.buildId).toBe(NEXT_BUILD)
- })
-
- it('refuses to stage a reused asset the active generation no longer holds', async () => {
- const fs = createFakeFileSystem()
- const store = createGenerationStore({ fileSystem: fs })
- await activate(store, HOST)
- fs.failReadsAt(`${HOST}/generations/${BUILD}/assets/app.js`)
-
- await expect(store.stageGeneration(HOST, LEFT_TO_STAGE)).rejects.toThrow('unreadable')
- await store.deleteHostCache(HOST)
- fs.failReadsAt(null)
- await expect(store.stageGeneration(HOST, LEFT_TO_STAGE)).rejects.toThrow(
- 'no longer holds the reused asset assets/app-2.js'
- )
- expect(fs.paths().some((path) => path.includes(`tmp/${NEXT_BUILD}`))).toBe(false)
- })
-})
-
// Commit deletes the old build first, so it must not run under a page still loading that build's chunks.
describe('an update staged behind a live page', () => {
it('stays staged while a page reads the old build, and the next read after it commits', async () => {
@@ -412,45 +75,4 @@ describe('an update staged behind a live page', () => {
expect((await store.readActiveGeneration(HOST))?.buildId).toBe(SECOND_BUILD)
expect(await fs.fileExists(`${ROOT}/${HOST}/generations/${BUILD}/index.html`)).toBe(false)
})
-
- it('lets a page that waited on another page fetch the build itself when that page gives up', async () => {
- const store = createGenerationStore({ fileSystem: createFakeFileSystem() })
- const first = await store.claimUpdate(HOST, SECOND_BUILD)
- const second = store.claimUpdate(HOST, SECOND_BUILD)
-
- first?.()
-
- expect(await second).not.toBeNull()
- })
-
- it('commits at the next launch when the app ends while the page still reads the old build', async () => {
- const fs = createFakeFileSystem()
- const first = createGenerationStore({ fileSystem: fs })
- await activate(first, HOST)
- first.holdGeneration(HOST)
- first.deferCommit(await first.stageGeneration(HOST, buildResult(SECOND)))
-
- const relaunched = createGenerationStore({ fileSystem: fs })
-
- expect((await relaunched.readActiveGeneration(HOST))?.buildId).toBe(SECOND_BUILD)
- expect(await fs.fileExists(`${ROOT}/${HOST}/generations/${SECOND_BUILD}/index.html`)).toBe(true)
- })
-
- it('lets a reader of a host’s build go before a commit or a removal deletes it', async () => {
- const fs = createFakeFileSystem()
- const onDisk: boolean[] = []
- let reading = BUILD
- const store = createGenerationStore({
- fileSystem: fs,
- beforeHostFilesDeleted: async (hostKey) => {
- onDisk.push(await fs.fileExists(`${ROOT}/${hostKey}/generations/${reading}/manifest.json`))
- }
- })
- await activate(store, HOST)
- onDisk.length = 0
- await activate(store, HOST, buildResult(SECOND))
- reading = SECOND_BUILD
- await store.deleteHostCache(HOST)
- expect(onDisk).toEqual([true, true])
- })
})
diff --git a/mobile/src/mobile-web-shell/removed-host-shell-cache.test.ts b/mobile/src/mobile-web-shell/removed-host-shell-cache.test.ts
deleted file mode 100644
index 564fd33101f..00000000000
--- a/mobile/src/mobile-web-shell/removed-host-shell-cache.test.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-import { beforeEach, describe, expect, it, vi } from 'vitest'
-
-vi.mock('expo-file-system', () => ({ Directory: class {}, File: class {}, Paths: { cache: '' } }))
-vi.mock('./generation-store-file-system', async () => {
- const { createFakeGenerationFileSystem } = await import('./generation-file-system-fake')
- const fileSystem = createFakeGenerationFileSystem()
- return { createExpoGenerationFileSystem: () => fileSystem }
-})
-
-import { createGenerationStore } from './generation-store'
-import { createExpoGenerationFileSystem } from './generation-store-file-system'
-import { forgetHostUpdateFailures } from './removed-host-shell-cache'
-
-function store() {
- return createGenerationStore({ fileSystem: createExpoGenerationFileSystem('') })
-}
-
-async function seed(hostId: string): Promise {
- await store().recordUpdateFailure({
- hostId,
- at: 1,
- reason: 'connection-lost',
- hostCode: null,
- offeredBuildId: null,
- cachedBuildId: null,
- outcome: 'opened-cached',
- wall: null
- })
-}
-
-describe('forgetHostUpdateFailures', () => {
- beforeEach(async () => {
- await store().forgetHostUpdateFailures('host-1')
- await store().forgetHostUpdateFailures('host-2')
- })
-
- it("drops the removed host's records and keeps the rest", async () => {
- await seed('host-1')
- await seed('host-2')
- await forgetHostUpdateFailures('host-1')
- expect((await store().readUpdateFailures()).map((entry) => entry.hostId)).toEqual(['host-2'])
- })
-
- it('writes nothing when nothing was recorded', async () => {
- const fileSystem = createExpoGenerationFileSystem('')
- expect(await fileSystem.readText(`${fileSystem.rootUri}/update-failures.json`)).toBeNull()
- const write = vi.spyOn(fileSystem, 'writeText')
- try {
- await forgetHostUpdateFailures('host-1')
- expect(write).not.toHaveBeenCalled()
- expect(await fileSystem.readText(`${fileSystem.rootUri}/update-failures.json`)).toBeNull()
- } finally {
- write.mockRestore()
- }
- })
-})
From 4d1c130e177ee3cdb2fb9a62f9150d7a2cb9f65a Mon Sep 17 00:00:00 2001
From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
Date: Mon, 9 Nov 2026 17:35:37 -0800
Subject: [PATCH 04/50] fix(source-control): stop the Change Base Ref dialog
from clipping the search field's focus ring (#40521)
The dialog body is an overflow-y-auto scroll area with no padding, so the
focused search field's 3px ring was cut off at its edges. Give it 4px of
room with -m-1 p-1, as the Workspace Details dialog already does.
Tracked in #39381
---
.../right-sidebar/source-control/panel/dialog-layer.tsx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/renderer/src/components/right-sidebar/source-control/panel/dialog-layer.tsx b/src/renderer/src/components/right-sidebar/source-control/panel/dialog-layer.tsx
index 653d75ee888..2bf68abe1ed 100644
--- a/src/renderer/src/components/right-sidebar/source-control/panel/dialog-layer.tsx
+++ b/src/renderer/src/components/right-sidebar/source-control/panel/dialog-layer.tsx
@@ -171,7 +171,8 @@ export function SourceControlDialogLayer({
)}
-