Merge remote-tracking branch 'origin/main' into brennanb2025/codex-error-codes

# Conflicts:
#	mobile/src/i18n/en-runtime-required.json
This commit is contained in:
Brennan Benson
2026-11-08 17:05:24 -08:00
1662 changed files with 31861 additions and 18771 deletions
+12 -5
View File
@@ -12,22 +12,29 @@ on:
- 'config/oxlint-performance-audit.json'
- 'config/oxlint-plugins/*performance.mjs'
- 'config/oxlint-plugins/quadratic-buffer-concat.mjs'
- 'config/scripts/*-plugin.test.mjs'
- '!config/scripts/static-analysis/oxlint-contracts/renderer-scrollbar-style-plugin.test.mjs'
# Keep in sync with the contract list in config/vitest.performance.config.ts;
- 'config/scripts/static-analysis/oxlint-contracts/app-store-performance-plugin.test.mjs'
- 'config/scripts/static-analysis/oxlint-contracts/quadratic-buffer-concat-plugin.test.mjs'
- '**/*.performance.test.ts'
- '**/*.performance.test.tsx'
# Contracts without the .performance suffix. Keep in sync with config/vitest.performance.config.ts;
# without these a rename lands green and only breaks the next nightly.
- 'src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-terminal-writer-acquire.test.ts'
- 'src/main/runtime/session-tabs/session-tabs-phone-layout-moves.test.ts'
- 'src/renderer/src/components/terminal-pane/pty-connection/startup/saved-resume-cancellation.test.ts'
- 'src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-terminal-writer-acquire.test.ts'
- 'src/shared/agent-launch/permissions/tui-agent-permission-choice.test.ts'
- 'src/main/runtime/rpc/methods/projects/repo.test.ts'
- 'src/renderer/src/components/tab-bar/use-new-tab-agent-menu-host-preferences.test.tsx'
- 'src/main/sqlite/sync-database.test.ts'
- 'src/main/runtime/orchestration/db/row-column-lists.test.ts'
- 'src/shared/native-chat/tools/native-chat-tool-pairing.performance.test.ts'
- 'src/main/codex-usage/codex-rollout-file-lifetime.test.ts'
- 'src/main/codex-usage/scanner-incremental-append.test.ts'
- 'src/main/usage/jsonl-file-reader.test.ts'
- 'src/main/usage/jsonl-file-snapshot.test.ts'
- 'src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler-queue-retention.test.ts'
- 'src/renderer/src/store/diagnostics/store-identity-churn-probe.test.ts'
- 'src/main/claude-usage/scanner-incremental-append.test.ts'
- 'src/main/claude-usage/store-checkpoint-persistence.test.ts'
- 'src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.streaming-input.test.tsx'
permissions:
contents: read
+5 -5
View File
@@ -1115,12 +1115,12 @@ jobs:
src/main/browser/client-pages/renderer/browser-client-page-renderer-lifecycle.electron.test.ts
src/main/persistence/profile-state/profile-state-writer-stall.electron.test.ts
src/main/browser/cookies/browser-google-cookie-clear.electron.test.ts
src/main/browser/guest-lifecycle/popups/popup-origin-chrome.electron.test.ts
src/main/browser/guest-lifecycle/popups/presentation/popup-origin-chrome.electron.test.ts
src/main/browser/guest-lifecycle/navigation/browser-link-materialization.electron.test.ts
src/main/browser/guest-lifecycle/popups/browser-popup-compatibility.electron.test.ts
src/main/browser/guest-lifecycle/popups/browser-popup-adapter-compatibility.electron.test.ts
src/main/browser/guest-lifecycle/popups/browser-popup-native-compatibility.electron.test.ts
src/main/browser/guest-lifecycle/popups/browser-popup-background-compatibility.electron.test.ts
src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-compatibility.electron.test.ts
src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-adapter-compatibility.electron.test.ts
src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-native-compatibility.electron.test.ts
src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-background-compatibility.electron.test.ts
src/main/browser/extensions/api-runtime/browser-extension-api.electron.test.ts
src/main/browser/extensions/profile-storage/browser-extension-persistence.electron.test.ts
src/main/browser/extensions/profile-sessions/browser-extension-lifecycle.electron.test.ts
-56
View File
@@ -1,56 +0,0 @@
import { generateKeyPairSync } from 'node:crypto'
import { describe, expect, it } from 'vitest'
import { loadPushConfig } from './config.js'
function apnsKeyPem(): string {
return generateKeyPairSync('ec', {
namedCurve: 'P-256',
privateKeyEncoding: { type: 'pkcs8', format: 'pem' },
publicKeyEncoding: { type: 'spki', format: 'pem' }
}).privateKey
}
const MINIMAL = {
ORCA_PUSH_PUBLIC_URL: 'https://push.onorca.dev',
ORCA_PUSH_FCM_PROJECT_ID: 'onorca-cloud'
}
describe('push gateway config', () => {
it('requires an explicit FCM project instead of silently targeting production', () => {
expect(() => loadPushConfig({ ...MINIMAL, ORCA_PUSH_FCM_PROJECT_ID: undefined })).toThrow()
expect(() => loadPushConfig({ ...MINIMAL, ORCA_PUSH_FCM_PROJECT_ID: ' ' })).toThrow()
})
it('refuses a partial APNs credential', () => {
expect(() => loadPushConfig({ ...MINIMAL, ORCA_PUSH_APNS_KEY: apnsKeyPem() })).toThrow(
'configured together'
)
expect(() =>
loadPushConfig({
...MINIMAL,
ORCA_PUSH_APNS_KEY: 'not-a-pem',
ORCA_PUSH_APNS_KEY_ID: 'ABCDE12345',
ORCA_PUSH_APPLE_TEAM_ID: 'TEAM123456'
})
).toThrow('PEM text')
})
it('requires a canonical HTTPS origin outside loopback', () => {
expect(() =>
loadPushConfig({ ...MINIMAL, ORCA_PUSH_PUBLIC_URL: 'https://push.onorca.dev/v1' })
).toThrow('must be an origin')
expect(() =>
loadPushConfig({ ...MINIMAL, ORCA_PUSH_PUBLIC_URL: 'http://push.onorca.dev' })
).toThrow('must use HTTPS')
expect(
loadPushConfig({ ...MINIMAL, ORCA_PUSH_PUBLIC_URL: 'http://localhost:8080' }).publicUrl
).toBe('http://localhost:8080')
})
})
@@ -148,24 +148,4 @@ describe('push device registry store', () => {
(await devices.upsert({ ...androidDevice('device-0'), hostFingerprint: OTHER })).ok
).toBe(true)
})
it('separates the same device id registered against two hosts', async () => {
const first = await upsertOk({
hostFingerprint: OWNER,
deviceId: 'shared-device',
platform: 'ios',
token: 'a'.repeat(64),
apnsEnvironment: 'sandbox'
})
const second = await upsertOk({
hostFingerprint: OTHER,
deviceId: 'shared-device',
platform: 'ios',
token: 'c'.repeat(64),
apnsEnvironment: 'sandbox'
})
expect(first).not.toBe(second)
})
})
@@ -1,170 +0,0 @@
import { afterEach, expect, it, vi } from 'vitest'
import { DurablePushStore } from './durable-push-store.js'
import type { PushDatabase } from './push-database.js'
import {
cleanupDurablePushFixtures,
fixture,
notification
} from './durable-push-store.test-fixture.js'
afterEach(async () => {
vi.restoreAllMocks()
await cleanupDurablePushFixtures()
})
function captureDatabaseErrors(database: PushDatabase, errors: unknown[]): PushDatabase {
return {
dialect: database.dialect,
query: async (sql, params) => {
try {
return await database.query(sql, params)
} catch (error) {
errors.push(error)
throw error
}
},
transaction: (run) => database.transaction((tx) => run(captureDatabaseErrors(tx, errors))),
lockQuotaScope: (key) => database.lockQuotaScope(key),
tryLockScope: (key) => database.tryLockScope(key),
tryLockSharedScope: (key) => database.tryLockSharedScope(key),
close: () => database.close()
}
}
it('parses each leased row once and preserves its complete serialized payload', async () => {
const { db, store } = await fixture()
const input = {
...notification(1),
body: 'Unicode: 🐋\ud800',
extra: { first: [null, false, 3], next: { z: 'last', a: 'first' } }
}
await store.accept('host', 'phone', input)
const [row] = await db.query('SELECT * FROM push_delivery_batches')
if (!row) {
throw new Error('Missing delivery row')
}
const payload = String(row.payload_json)
const parse = vi.spyOn(JSON, 'parse')
const delivery = await store.claim()
expect(delivery).toEqual({
id: row.batch_id,
registrationId: 'phone',
hostFingerprint: 'host',
notification: input,
expiresAt: 1_300_000,
lease: expect.any(String),
attempts: 1
})
expect(JSON.stringify(delivery?.notification)).toBe(payload)
expect(parse.mock.calls.filter(([value]) => value === payload)).toHaveLength(1)
})
it('reads changed retry bytes and a later writer update without carrying a parsed result across calls', async () => {
const { db, store, advance } = await fixture()
await store.accept('host', 'phone', notification(1))
const first = await store.claim()
if (!first) {
throw new Error('Missing first delivery')
}
first.notification.body = 'provider changed this retry'
await store.finish(first, 1000)
advance(1000)
const retriedPayload = JSON.stringify(first.notification)
const parse = vi.spyOn(JSON, 'parse')
const retry = await store.claim()
expect(retry).toEqual({ ...first, lease: expect.any(String), attempts: 2 })
expect(retry?.lease).not.toBe(first.lease)
expect(retry?.notification).not.toBe(first.notification)
expect(JSON.stringify(retry?.notification)).toBe(retriedPayload)
const retryParses = parse.mock.calls.filter(([value]) => value === retriedPayload).length
if (!retry) {
throw new Error('Missing retry delivery')
}
await store.finish(retry, 1000)
const changed = { ...notification(1), body: 'fresh database row', title: 'Changed' }
const changedPayload = JSON.stringify(changed)
await db.query('UPDATE push_delivery_batches SET payload_json = ? WHERE batch_id = ?', [
changedPayload,
first.id
])
advance(1000)
const fresh = await store.claim()
expect(fresh).toEqual({ ...retry, notification: changed, lease: expect.any(String), attempts: 3 })
expect(JSON.stringify(fresh?.notification)).toBe(changedPayload)
expect(retry.notification.body).toBe('provider changed this retry')
expect(retryParses).toBe(1)
expect(parse.mock.calls.filter(([value]) => value === changedPayload)).toHaveLength(1)
})
it.each(['not JSON', 'undefined', 'null', '[]'])(
'preserves invalid payload rejection and rolls back the lease for %s',
async (payload) => {
const { db, store } = await fixture()
await store.accept('host', 'phone', notification(1))
await db.query('UPDATE push_delivery_batches SET payload_json = ?', [payload])
const [before] = await db.query('SELECT * FROM push_delivery_batches')
const parse = vi.spyOn(JSON, 'parse')
let caught: unknown
try {
await store.claim()
} catch (error) {
caught = error
}
expect(caught).toBeInstanceOf(Error)
const index = parse.mock.calls.findIndex(([value]) => value === payload)
expect(index).toBeGreaterThanOrEqual(0)
if (payload === 'not JSON' || payload === 'undefined') {
expect(caught).toBe(parse.mock.results[index]?.value)
expect(caught).toBeInstanceOf(SyntaxError)
} else {
expect(caught).toMatchObject({ message: 'invalid_push_delivery_payload' })
}
expect(await db.query('SELECT * FROM push_delivery_batches')).toEqual([before])
expect(parse.mock.calls.filter(([value]) => value === payload)).toHaveLength(1)
}
)
it('preserves the exact database UPDATE error and retries with a fresh payload after rollback', async () => {
const { db, store, clock } = await fixture()
await store.accept('host', 'phone', notification(1))
const [before] = await db.query('SELECT * FROM push_delivery_batches')
if (!before) {
throw new Error('Missing delivery row')
}
const originalQuery = db.query.bind(db)
const errors: unknown[] = []
// SQLite raises a native error in the real transaction; PostgreSQL uses its real constraint.
await originalQuery(
db.dialect === 'sqlite'
? "CREATE TRIGGER deny_lease BEFORE UPDATE ON push_delivery_batches BEGIN SELECT RAISE(FAIL, 'deny_lease'); END"
: 'ALTER TABLE push_delivery_batches ADD CONSTRAINT deny_lease CHECK (lease_until = 0)'
)
const owner = new DurablePushStore(captureDatabaseErrors(db, errors), clock)
const parse = vi.spyOn(JSON, 'parse')
let caught: unknown
try {
await owner.claim()
} catch (error) {
caught = error
}
expect(errors).toHaveLength(1)
expect(caught).toBe(errors[0])
expect(await originalQuery('SELECT * FROM push_delivery_batches')).toEqual([before])
expect(parse.mock.calls.filter(([value]) => value === String(before.payload_json))).toHaveLength(
1
)
await originalQuery(
db.dialect === 'sqlite'
? 'DROP TRIGGER deny_lease'
: 'ALTER TABLE push_delivery_batches DROP CONSTRAINT deny_lease'
)
const fresh = await owner.claim()
expect(fresh?.notification).toEqual(notification(1))
expect(fresh?.attempts).toBe(1)
})
@@ -163,23 +163,6 @@ it('does not resurrect an in-flight alert after a dismissal and transient provid
expect(await store.pendingCount('phone')).toBe(0)
})
it.each([false, true])(
'normalizes default alert kind (explicit first: %s)',
async (explicitFirst) => {
const { db, store } = await fixture()
const { kind: _kind, ...implicit } = notification(1)
const explicit = { kind: 'alert' as const, ...implicit }
for (const event of explicitFirst ? [explicit, implicit] : [implicit, explicit]) {
expect(await store.accept('host', 'phone', event)).toBe('queued')
}
expect(await store.pendingCount('phone')).toBe(1)
expect(await db.query('SELECT event_id FROM push_events')).toHaveLength(1)
expect(await store.accept('host', 'phone', { ...explicit, body: 'changed' })).toBe('error')
expect(await store.accept('host', 'phone', { ...implicit, kind: 'dismiss' })).toBe('queued')
expect(await db.query('SELECT event_id FROM push_events')).toHaveLength(2)
}
)
it('fences late renew and finish after an expired claim is dismissed', async () => {
const { db, store, advance } = await fixture()
const alert = notification(1)
+1 -113
View File
@@ -8,7 +8,7 @@ import { PushDeviceRegistryStore } from './device-registry-store.js'
import { openInMemoryPushDatabase } from './push-database.js'
import type { PushDelivery } from './push-delivery-message.js'
import type { PushProviderOutcome } from './push-provider-outcome.js'
import { WORKER_DRAINS } from './push-worker-concurrency.js'
import { pauseAfter, within } from './durable-push-store.test-fixture.js'
const cleanups: (() => Promise<void>)[] = []
@@ -69,59 +69,6 @@ async function fixture() {
}
}
it('sends every burst event immediately with its original content and identity', async () => {
const h = await fixture()
await h.accept(note(1))
await h.accept(
note(2, { agentState: 'needs-input', title: 'Answer needed', body: 'Please respond' })
)
await h.worker.runDue()
expect(h.send).toHaveBeenCalledTimes(2)
const first = h.send.mock.calls.find(([delivery]) => delivery.orca.notificationSeq === 1)![0]
const second = h.send.mock.calls.find(([delivery]) => delivery.orca.notificationSeq === 2)![0]
expect(first).toMatchObject({
title: 'Done',
body: 'Finished task',
orca: {
notificationId: 'note-1',
notificationSeq: 1
}
})
expect(second).toMatchObject({
title: 'Answer needed',
body: 'Please respond',
orca: { notificationId: 'note-2', notificationSeq: 2 }
})
expect(first.collapseId).not.toBe(second.collapseId)
expect(h.send.mock.calls.every(([delivery]) => !('coalescedCount' in delivery.orca))).toBe(true)
expect(h.send.mock.calls.every(([delivery]) => !('summaryMembers' in delivery.orca))).toBe(true)
expect(h.onRetry).not.toHaveBeenCalled()
})
it('keeps untrackable bells and per-phone deliveries individually replaceable', async () => {
const h = await fixture()
const other = await h.devices.upsert({
hostFingerprint: 'host',
deviceId: 'phone2',
platform: 'android',
token: 'other-token'
})
if (!other.ok) throw new Error('registration failed')
await h.accept(note(1, { notificationId: undefined, source: 'terminal-bell', agentState: null }))
await h.accept(note(2))
await h.accept(note(3))
await h.store.accept('host', other.registrationId, note(2))
await h.worker.runDue()
expect(h.send).toHaveBeenCalledTimes(4)
const deliveries = h.send.mock.calls.map(([delivery]) => delivery)
const primary = deliveries.filter((delivery) => delivery.registrationId === h.registrationId)
expect(primary).toHaveLength(3)
expect(new Set(primary.map((delivery) => delivery.collapseId)).size).toBe(3)
expect(
deliveries.find((delivery) => delivery.registrationId === other.registrationId)
).toMatchObject({ orca: { notificationId: 'note-2', notificationSeq: 2 } })
})
it('preserves provider retry delay when waking a restarted worker', async () => {
const h = await fixture()
vi.useFakeTimers()
@@ -302,62 +249,3 @@ it('claims new devices while an earlier provider response is still pending', asy
await h.worker.stop()
}
})
it('coalesces wakes arriving after every active drain found an empty queue', async () => {
const h = await fixture()
vi.useFakeTimers()
const entered = Promise.withResolvers<void>()
const release = Promise.withResolvers<void>()
const claim = h.store.claim.bind(h.store)
let empty = 0
let holding = true
vi.spyOn(h.store, 'claim').mockImplementation(async () => {
const delivery = await claim()
if (!delivery && holding) {
if (++empty === WORKER_DRAINS) entered.resolve()
await release.promise
}
return delivery
})
h.worker.start()
const startedAt = Date.now()
const pending = h.worker.runDue()
try {
await entered.promise
await h.accept(note(1))
for (let count = 0; count < 10; count++) h.worker.wake()
expect(h.store.claim).toHaveBeenCalledTimes(WORKER_DRAINS)
holding = false
release.resolve()
await pending
await vi.waitFor(() => expect(h.send).toHaveBeenCalledOnce())
await vi.waitFor(() => expect(h.store.claim).toHaveBeenCalledTimes(WORKER_DRAINS + 2))
expect(Date.now() - startedAt).toBeLessThan(1000)
expect(h.send.mock.calls[0]?.[0].orca.notificationSeq).toBe(1)
} finally {
holding = false
release.resolve()
}
})
it('recovers from a failed automatic wake without leaving another timer', async () => {
const h = await fixture()
vi.useFakeTimers()
vi.spyOn(h.store, 'claim').mockRejectedValueOnce(new Error('database unavailable'))
h.worker.start()
h.worker.wake()
await vi.waitFor(() =>
expect(console.warn).toHaveBeenCalledWith(JSON.stringify({ event: 'orca_push_worker_failed' }))
)
await h.accept(note(1))
h.worker.wake()
await vi.waitFor(() => expect(h.send).toHaveBeenCalledOnce())
await h.worker.stop()
expect(vi.getTimerCount()).toBe(0)
})
+1 -25
View File
@@ -1,4 +1,4 @@
import { createHash } from 'node:crypto'
import { describe, expect, it } from 'vitest'
import { FcmClient, type FcmRequest, type FcmResponse } from './fcm-client.js'
import { buildPushDelivery } from './push-delivery-message.js'
@@ -53,30 +53,6 @@ function client(response: FcmResponse) {
describe('fcm client', () => {
it('carries every data value as a string and omits a null agent state', async () => {
const { fake, client: fcm } = client({ status: 200, body: '{}' })
await fcm.send(delivery(null), { token: TOKEN })
const message = JSON.parse(fake.requests[0]!.body) as {
message: {
android: Record<string, unknown>
data: Record<string, string>
}
}
expect(Object.values(message.message.data).every((value) => typeof value === 'string')).toBe(
true
)
expect(message.message.data.agentState).toBeUndefined()
const tag = createHash('sha256')
.update(JSON.stringify([HOST, 'note-1']))
.digest('hex')
expect(message.message.data.coalescedCount).toBeUndefined()
expect(message.message.data.tag).toBe(tag)
expect(message.message.android).not.toHaveProperty('collapse_key')
expect(message.message).not.toHaveProperty('notification')
expect(message.message.data).not.toHaveProperty('body')
})
it('marks an invalid-argument that names the token dead, and others an error', async () => {
const named = client({
@@ -75,14 +75,5 @@ describe('push host challenge store', () => {
})
})
it('rejects an unknown challenge id and a malformed public key', async () => {
await expect(store.verify('missing', Buffer.alloc(32, 9).toString('base64'))).resolves.toEqual({
ok: false,
reason: 'unknown_challenge'
})
await expect(store.issue('not-base64!!')).resolves.toBeNull()
await expect(store.issue(Buffer.alloc(31, 1).toString('base64'))).resolves.toBeNull()
})
})
@@ -1,26 +0,0 @@
import { expect, it, vi } from 'vitest'
import { createPushReadiness } from './push-readiness.js'
import type { PushDatabase } from './push-database.js'
it('shares a slow check and caches failures before retrying', async () => {
let clock = 0
let reject!: (error: Error) => void
const query = vi.fn(
() =>
new Promise<never>((_, fail) => {
reject = fail
})
)
const ready = createPushReadiness({ query } as unknown as PushDatabase, { now: () => clock })
const checks = Array.from({ length: 100 }, () => ready())
expect(query).toHaveBeenCalledTimes(1)
reject(new Error('offline'))
expect(await Promise.all(checks)).toEqual(Array(100).fill(false))
expect(await ready()).toBe(false)
expect(query).toHaveBeenCalledTimes(1)
clock = 10_000
const retry = ready()
expect(query).toHaveBeenCalledTimes(2)
reject(new Error('offline'))
expect(await retry).toBe(false)
})
+8 -1
View File
@@ -21,6 +21,9 @@ export type Env = {
PING_INTERVAL_MS: string
SILENCE_TIMEOUT_MS: string
ORPHAN_GRACE_MS: string
// '0' stops offering the host-sent keepalive (host-relay-control.ts) and pings every control from
// the alarm again, including controls that took the offer earlier. Default: offered.
CLIENT_KEEPALIVE?: string
// Object backend: store cleanup cadence (default 24 h) and how long an object keeps the data of
// a host that moved away before wiping it (default 30 days). Tests shorten both.
SWEEP_INTERVAL_MS?: string
@@ -69,6 +72,7 @@ export type EdgeConfig = {
orphanGraceMs: number
sweepIntervalMs: number
leftRetentionMs: number
clientKeepalive: boolean
}
const configs = new WeakMap<object, EdgeConfig>()
@@ -109,8 +113,11 @@ export function edgeConfig(env: Env): EdgeConfig {
silenceTimeoutMs: positiveInt('silence_timeout', env.SILENCE_TIMEOUT_MS),
orphanGraceMs: positiveInt('orphan_grace', env.ORPHAN_GRACE_MS),
sweepIntervalMs: positiveInt('sweep_interval', env.SWEEP_INTERVAL_MS ?? String(24 * 60 * 60 * 1000)),
leftRetentionMs: positiveInt('left_retention', env.LEFT_RETENTION_MS ?? String(30 * 24 * 60 * 60 * 1000))
leftRetentionMs: positiveInt('left_retention', env.LEFT_RETENTION_MS ?? String(30 * 24 * 60 * 60 * 1000)),
clientKeepalive: env.CLIENT_KEEPALIVE !== '0'
}
// The offer carries the ping interval, which the contract bounds to 1..60 s.
config.clientKeepalive &&= config.pingIntervalMs >= 1_000 && config.pingIntervalMs <= 60_000
// Shipped desktops close a control that is silent for 75 s; a ping must arrive well inside it.
if (config.pingIntervalMs >= config.silenceTimeoutMs) { throw new Error('relay_edge_config_ping_interval') }
configs.set(env, config)
+49 -9
View File
@@ -7,6 +7,7 @@ import { RELAY_CLOSE_CODE } from '../../../packages/relay-contract/src/close-cod
import { CONTROL_CONTINUITY_LIMITS } from '../../../packages/relay-contract/src/control-continuity'
import { ASSIGNMENT_LIMITS } from '../../../packages/relay-contract/src/assignment-invariants'
import { relayHostCloseReasonFrom } from '../../../packages/relay-contract/src/host-close-reason'
import { RELAY_CLIENT_KEEPALIVE_ACK_FRAME, RELAY_CLIENT_KEEPALIVE_FRAME } from '../../../packages/relay-contract/src/control-messages'
import { parseConnId } from './splice-slot'
import { metric } from './metrics'
import { ObjectStore } from './object-store'
@@ -39,6 +40,11 @@ export type ControlAttachment = {
lastRefreshAt?: number
// Client ingress '<continent>/<colo>', for metrics.
place?: string
// The host took the keepalive offer: it sends the keepalive frame, which the runtime answers
// without waking this object, so the alarm sends it no pings (keepalive() below).
clientKeepalive?: boolean
// A keepalive control found silent: one relay ping sent at this time (see probeSilentControls).
probeAt?: number
}
export type Attachment = ControlAttachment
export type Conn = {
@@ -65,6 +71,8 @@ export type AuthorizeResult =
export type ConfirmResult = { ok: true; hello: RelayHello } | { ok: false; code: number }
export const NO_DEADLINE = Number.MAX_SAFE_INTEGER
// How long a silent keepalive control has to answer the relay ping before it is closed.
export const KEEPALIVE_PROBE_MS = 10_000
export const SWEEP_AT_KEY = 'sweepAt'
// 6 h ± 30 min, as the cells: desktops re-ask the director at least this often.
export const LEASE_BASE_MS = 6 * 60 * 60 * 1000
@@ -80,6 +88,12 @@ export abstract class HostRelayBase extends DurableObject<Env> {
protected recentPicks: { slot: number; at: number }[] = []
protected backendCache: EdgeBackend | null = null
constructor(ctx: DurableObjectState, env: Env) {
super(ctx, env)
// Answered by the runtime while the object sleeps: no wake, no alarm, no duration.
ctx.setWebSocketAutoResponse(new WebSocketRequestResponsePair(RELAY_CLIENT_KEEPALIVE_FRAME, RELAY_CLIENT_KEEPALIVE_ACK_FRAME))
}
protected get config(): EdgeConfig {
return edgeConfig(this.env)
}
@@ -101,6 +115,17 @@ export abstract class HostRelayBase extends DurableObject<Env> {
return a.phase === 'active' && now <= a.claims.exp
}
// Host-sent keepalive in use for this control (and not switched off since it was offered).
protected keepalive(a: ControlAttachment): boolean {
return a.clientKeepalive === true && this.config.clientKeepalive
}
// Last sign of life: any frame that woke the object, or a keepalive the runtime answered.
protected lastSeen(ws: WebSocket, a: ControlAttachment): number {
const answered = this.ctx.getWebSocketAutoResponseTimestamp(ws)?.getTime() ?? 0
return Math.max(a.lastPongAt ?? 0, answered)
}
protected otherActiveControls(ws: WebSocket): WebSocket[] {
return this.ctx.getWebSockets('control').filter((s) => s !== ws && this.attachment(s)?.phase === 'active')
}
@@ -144,7 +169,9 @@ export abstract class HostRelayBase extends DurableObject<Env> {
// ---------------- lifecycle ----------------
protected async onSocketGone(ws: WebSocket, code: number, reason: string): Promise<void> {
// `goneAt`: when the control was last known alive plus the silence timeout, for a control found
// dead later than the alarm would have found it; the orphan grace counts from then.
protected async onSocketGone(ws: WebSocket, code: number, reason: string, goneAt = Date.now()): Promise<void> {
const a = this.attachment(ws)
if (!a) { return }
// During webSocketClose the closing socket is still listed; clear it first so it can't count as live.
@@ -156,7 +183,7 @@ export abstract class HostRelayBase extends DurableObject<Env> {
const hostReason = relayHostCloseReasonFrom(reason)
await this.ctx.storage.put<Session>('session', {
...session,
orphanedAt: Date.now(),
orphanedAt: goneAt,
...(hostReason ? { closeReason: { reason: hostReason, expiresAt: Date.now() + ASSIGNMENT_LIMITS.dormantTtlMs } } : {})
})
}
@@ -168,19 +195,32 @@ export abstract class HostRelayBase extends DurableObject<Env> {
protected async reschedule(): Promise<void> {
let next = NO_DEADLINE
let conns: Record<string, Conn> | null = null
for (const ws of this.ctx.getWebSockets()) {
const a = this.attachment(ws)
if (!a) { continue }
if (a.k !== 'control' || a.phase !== 'active') {
next = Math.min(next, a.deadline)
continue
}
next = Math.min(
next,
...(a.k === 'control' && a.phase === 'active'
? [
(a.lastPingAt ?? 0) + this.config.pingIntervalMs,
a.claims.exp + CONTROL_CONTINUITY_LIMITS.expiredAuthExistingSpliceGraceMs + 1,
(a.leaseExpiresAt ?? NO_DEADLINE - 1) + 1
]
: [a.deadline])
a.claims.exp + CONTROL_CONTINUITY_LIMITS.expiredAuthExistingSpliceGraceMs + 1,
(a.leaseExpiresAt ?? NO_DEADLINE - 1) + 1
)
if (!this.keepalive(a)) {
next = Math.min(next, (a.lastPingAt ?? 0) + this.config.pingIntervalMs)
continue
}
const seen = this.lastSeen(ws, a)
if (a.probeAt !== undefined && a.probeAt >= seen) {
next = Math.min(next, a.probeAt + KEEPALIVE_PROBE_MS)
continue
}
// Phones attached or waiting: their splices must close on time if the host dies, so check
// its silence when it would run out. Otherwise no alarm for liveness at all.
conns ??= await this.conns()
if (Object.keys(conns).length > 0) { next = Math.min(next, seen + this.config.silenceTimeoutMs + 1) }
}
const session = await this.ctx.storage.get<Session>('session')
if (session?.orphanedAt != null) { next = Math.min(next, session.orphanedAt + this.config.orphanGraceMs) }
@@ -1,6 +1,6 @@
// HostRelay control frames once a host is past the handshake: liveness, pongs, auth refresh and
// HostRelay control frames once a host is past the handshake: liveness, pongs, keepalives, auth refresh and
// the host's credential commands.
import { AuthRefreshSchema, DeviceRevokeSchema, InviteCreateSchema } from '../../../packages/relay-contract/src/control-messages'
import { AuthRefreshSchema, DeviceRevokeSchema, InviteCreateSchema, RELAY_CLIENT_KEEPALIVE_ACK_FRAME } from '../../../packages/relay-contract/src/control-messages'
import { DeviceCredentialInstallSchema, DeviceCredentialInstallStatusSchema, DeviceResumeConfirmSchema } from '../../../packages/relay-contract/src/credential-messages'
import { RELAY_CLOSE_CODE } from '../../../packages/relay-contract/src/close-codes'
import { RELAY_PROTOCOL_LIMITS } from '../../../packages/relay-contract/src/protocol-limits'
@@ -12,6 +12,45 @@ import { HostRelayHandshake } from './host-relay-handshake'
import type { ControlAttachment } from './host-relay-base'
export abstract class HostRelayControl extends HostRelayHandshake {
// ---------------- silent keepalive controls ----------------
// Active controls silent past the timeout. No liveness field (attachments older than it): the
// alarm judges those, as before.
protected silentControls(now: number): { ws: WebSocket; a: ControlAttachment; seen: number }[] {
return this.ctx.getWebSockets('control').flatMap((ws) => {
const a = this.attachment(ws)
if (a?.k !== 'control' || a.phase !== 'active' || a.lastPongAt === undefined) { return [] }
const seen = this.lastSeen(ws, a)
return now - seen > this.config.silenceTimeoutMs ? [{ ws, a, seen }] : []
})
}
// Where the host is going away anyway (export, erase, drain, a new control of the same host): a
// silent control is closed now. Its orphan time is the latest the ping alarm would have found it,
// so rebind and the orphan grace are never shorter than before.
protected async closeSilentControls(now = Date.now()): Promise<void> {
for (const { ws, seen } of this.silentControls(now)) {
this.close(ws, RELAY_CLOSE_CODE.PEER_DROPPED, 'control silence timeout')
await this.onSocketGone(ws, RELAY_CLOSE_CODE.PEER_DROPPED, '', Math.min(now, seen + this.config.silenceTimeoutMs + this.config.pingIntervalMs))
}
}
// Where a phone needs the host: a silent keepalive control may be alive with its own timer held
// back (a sleeping app), so it is sent one relay ping, answered from socket I/O, and closed only if
// nothing arrives within KEEPALIVE_PROBE_MS (alarm). Meanwhile it counts as live, as a control
// inside the silence timeout always did.
protected async probeSilentControls(now = Date.now()): Promise<void> {
let probed = false
for (const { ws, a, seen } of this.silentControls(now)) {
if (!this.keepalive(a) || (a.probeAt !== undefined && a.probeAt >= seen)) { continue }
this.send(ws, { type: 'ping', t: now })
a.probeAt = now
this.attach(ws, a)
probed = true
}
if (probed) { await this.reschedule() }
}
// ---------------- control ----------------
protected async onControl(ws: WebSocket, a: ControlAttachment, message: string | ArrayBuffer): Promise<void> {
@@ -47,6 +86,12 @@ export abstract class HostRelayControl extends HostRelayHandshake {
if (typeof body.t === 'number') { metric(this.env, 'pong_rtt_ms', now - body.t, '', [], '', a.place) }
return
}
// Normally answered by the runtime (host-relay-base.ts); a frame that differs only in spacing
// still gets its answer here.
if (type === 'keepalive') {
ws.send(RELAY_CLIENT_KEEPALIVE_ACK_FRAME)
return
}
if (type === 'auth-refresh') { return this.onAuthRefresh(ws, body) }
return this.onCommand(ws, a, type, body)
}
@@ -2,7 +2,7 @@
// eligibility, and the proof that activates a control (generation, resume secret, pending conns).
import nacl from 'tweetnacl'
import { buildHostChallengePlaintext, buildHostProofMacInput, buildHostProofTranscript } from '../../../packages/relay-contract/src/host-proof-transcript'
import { HostChallengeAckSchema, HostHelloSchema, RELAY_HOST_CAPABILITY_PENDING_CONN_DETAILS } from '../../../packages/relay-contract/src/control-messages'
import { HostChallengeAckSchema, HostHelloSchema, RELAY_HOST_CAPABILITY_CLIENT_KEEPALIVE, RELAY_HOST_CAPABILITY_PENDING_CONN_DETAILS } from '../../../packages/relay-contract/src/control-messages'
import { RELAY_CLOSE_CODE } from '../../../packages/relay-contract/src/close-codes'
import { metric } from './metrics'
import type { EdgeClaims } from './env'
@@ -162,6 +162,7 @@ export abstract class HostRelayHandshake extends HostRelayBase {
a.lastPingAt = now
a.leaseExpiresAt = leaseExpiresAt
a.deadline = NO_DEADLINE
a.clientKeepalive = this.config.clientKeepalive && a.caps.includes(RELAY_HOST_CAPABILITY_CLIENT_KEEPALIVE)
delete a.expectedProof
delete a.hello
delete a.rebind
@@ -188,6 +189,8 @@ export abstract class HostRelayHandshake extends HostRelayBase {
activeConnIds: activeConnIds.slice(0, 8),
pendingConns: pendingConns.slice(0, 8)
})
// After the ack, which strict shipped parsers must see unchanged; only hosts that asked get it.
if (a.clientKeepalive) { this.send(ws, { type: 'keepalive-offer', v: 1, intervalMs: this.config.pingIntervalMs }) }
metric(this.env, 'control_active', 1, rebind ? 'rebind' : 'new', [], '', a.place)
await this.reschedule()
}
@@ -61,6 +61,8 @@ export abstract class HostRelayPhones extends HostRelayControl {
return { ok: false, code: RELAY_CLOSE_CODE.DRAINING }
}
if (!reservation) { return { ok: false, code: RELAY_CLOSE_CODE.BAD_OUTER_CREDENTIAL } }
// A keepalive host may have died unnoticed (no alarm watches an idle one): probe it first.
await this.probeSilentControls()
const control = this.activeControl()
const seated =
control !== null &&
@@ -95,6 +97,8 @@ export abstract class HostRelayPhones extends HostRelayControl {
relayDeviceId: reservation.relayDeviceId,
attachDeadlineMs: RELAY_PROTOCOL_LIMITS.hostAttachDeadlineMs
})
// The first phone of a keepalive host arms its silence check (reschedule).
if (this.keepalive(control.a)) { await this.reschedule() }
return { ok: true, connTicket, generation }
}
+17 -4
View File
@@ -16,7 +16,7 @@ import type { AssignBody, DeviceRow } from './admin'
import { ADMIN_JTI_KEY, admitJti, type AdminReplayGuard, type ReplayRefusal, type SeenJtis } from './admin-jti'
import type { AssignResult, StoredAssignment } from './object-store'
import type { EdgeClaims } from './env'
import { SWEEP_AT_KEY, type Session } from './host-relay-base'
import { KEEPALIVE_PROBE_MS, SWEEP_AT_KEY, type Session } from './host-relay-base'
import { HostRelayPhones } from './host-relay-phones'
export type { AuthorizeResult, ConfirmResult } from './host-relay-base'
@@ -48,6 +48,7 @@ export class HostRelay extends HostRelayPhones {
> {
const refused = await this.claimAdminJti(replay)
if (refused) { return refused }
await this.closeSilentControls()
if (this.liveControls().length > 0) { return { outcome: 'busy' } }
const devices = this.store.freezeForExport()
await this.closeSplices(() => true, RELAY_CLOSE_CODE.WRONG_CELL, 'host moving')
@@ -64,7 +65,8 @@ export class HostRelay extends HostRelayPhones {
const assignment = this.store.assignment()
// Another account now holds this machine's object; its move on wiped the earlier account's data.
if (assignment && assignment.userId !== userId) { return { outcome: 'mismatch' } }
if (this.ctx.getWebSockets('control').length > 0 || this.store.activeBases() > 0) { return { outcome: 'busy' } }
await this.closeSilentControls()
if (this.liveControls().length > 0 || this.store.activeBases() > 0) { return { outcome: 'busy' } }
await this.ctx.storage.deleteAlarm()
await this.ctx.storage.deleteAll()
this.storeCache = null
@@ -76,6 +78,7 @@ export class HostRelay extends HostRelayPhones {
// desktop re-asks the director), and goes through the same path as that expiry. The assignment,
// devices and splices are left as they are.
async adminDrain(replay?: AdminReplayGuard | null): Promise<ReplayRefusal | { outcome: 'idle' } | { outcome: 'drained'; controls: number }> {
await this.closeSilentControls()
const controls = this.liveControls()
// An idle drain of a host nobody pushed changes nothing and must not give the object storage,
// so its jti is not recorded; a copy of that token can at most drain a control that arrived
@@ -128,6 +131,8 @@ export class HostRelay extends HostRelayPhones {
})
}
if (kind !== 'control') { return new Response(null, { status: 404 }) }
// A new control's hello decides rebind against the controls still listed.
await this.closeSilentControls()
const origin = request.headers.get('x-edge-origin') ?? ''
const claims = JSON.parse(request.headers.get('x-edge-claims') ?? 'null') as EdgeClaims
const pair = new WebSocketPair()
@@ -166,7 +171,15 @@ export class HostRelay extends HostRelayPhones {
const a = this.attachment(ws)
if (!a) { continue }
if (a.k === 'control' && a.phase === 'active') {
if (now - (a.lastPongAt ?? now) > this.config.silenceTimeoutMs) {
const seen = a.lastPongAt === undefined ? now : this.lastSeen(ws, a)
// A keepalive control gets one relay ping first (probeSilentControls); closed if it stays silent.
if (this.keepalive(a) && now - seen > this.config.silenceTimeoutMs && (a.probeAt === undefined || a.probeAt < seen)) {
this.send(ws, { type: 'ping', t: now })
a.probeAt = now
this.attach(ws, a)
continue
}
if (now - seen > this.config.silenceTimeoutMs && (!this.keepalive(a) || now - a.probeAt! >= KEEPALIVE_PROBE_MS - 50)) {
this.close(ws, RELAY_CLOSE_CODE.PEER_DROPPED, 'control silence timeout')
await this.onSocketGone(ws, RELAY_CLOSE_CODE.PEER_DROPPED, '')
continue
@@ -185,7 +198,7 @@ export class HostRelay extends HostRelayPhones {
await this.onSocketGone(ws, RELAY_CLOSE_CODE.DRAINING, '')
continue
}
if (now - (a.lastPingAt ?? 0) >= this.config.pingIntervalMs - 50) {
if (!this.keepalive(a) && now - (a.lastPingAt ?? 0) >= this.config.pingIntervalMs - 50) {
if (a.lastPingAt) { metric(this.env, 'alarm_lag_ms', Math.max(0, now - (a.lastPingAt + this.config.pingIntervalMs)), '', [], '', a.place) }
this.send(ws, { type: 'ping', t: now })
a.lastPingAt = now
@@ -59,8 +59,10 @@ export async function mint(key: KeyLike, relayHostId: string, issuer = ISSUER):
}
// `drop` returns true for an outbound frame the test wants lost (a host that stops answering pings).
export function control(host: Host, jwt: string, epoch = EPOCH, opts: { drop?: (frame: string) => boolean } = {}) {
const events = { closes: [] as number[], opens: [] as { connId: string }[], drains: [] as Record<string, unknown>[], dropped: 0 }
// `caps` replaces the shipped desktop's capability header (default: as shipped today).
export const SHIPPED_CAPS = 'pending-conn-details,idle-regional-rehome-v1'
export function control(host: Host, jwt: string, epoch = EPOCH, opts: { drop?: (frame: string) => boolean; caps?: string } = {}) {
const events = { closes: [] as number[], opens: [] as { connId: string }[], drains: [] as Record<string, unknown>[], dropped: 0, pings: 0, offers: 0, acks: 0 }
let transport: CloudRelayTransport | null = null
const client = new RelayControlClient({
cellUrl: ORIGIN,
@@ -78,10 +80,16 @@ export function control(host: Host, jwt: string, epoch = EPOCH, opts: { drop?: (
onClose: (code) => events.closes.push(code),
createSocket: (url, token) => {
const ws = new WebSocket(url, {
headers: { authorization: `Bearer ${token}`, 'x-orca-host-capabilities': 'pending-conn-details,idle-regional-rehome-v1' },
headers: { authorization: `Bearer ${token}`, 'x-orca-host-capabilities': opts.caps ?? process.env.MVP_HOST_CAPS ?? SHIPPED_CAPS },
perMessageDeflate: false,
maxPayload: 64 * 1024
})
ws.on('message', (raw) => {
const type = (JSON.parse(raw.toString()) as { type?: unknown }).type
if (type === 'ping') { events.pings++ }
if (type === 'keepalive-offer') { events.offers++ }
if (type === 'keepalive-ack') { events.acks++ }
})
const send = ws.send.bind(ws)
ws.send = ((data: string, ...rest: never[]) => {
if (opts.drop?.(String(data))) {
@@ -5,7 +5,7 @@ import { readdirSync } from 'node:fs'
import { join } from 'node:path'
import { DatabaseSync } from 'node:sqlite'
import type { KeyLike } from 'jose'
import { EPOCH, ORIGIN, adminCall, assign, control, mint, newHost, record, sleep, waitFor } from './harness-mvp-object'
import { EPOCH, ORIGIN, SHIPPED_CAPS, adminCall, assign, control, mint, newHost, record, sleep, waitFor } from './harness-mvp-object'
// Local timing (mvp-object.ts): ping every 3 s, silence timeout 9 s.
const SILENCE_MS = 9_000
@@ -47,6 +47,87 @@ export async function heartbeatCheck(key: KeyLike): Promise<void> {
}
}
// K1: host-sent keepalive. A host advertising client-keepalive-v1 gets the offer, then sends the
// keepalive, which the runtime answers: the edge sends it no pings and it stays up. One that goes
// silent is not watched by any alarm while idle, but is closed 4408 the moment the director needs
// the host (export), and a live one is not. A host without the capability is pinged as before.
export async function keepaliveCheck(key: KeyLike): Promise<void> {
const caps = `${SHIPPED_CAPS},client-keepalive-v1`
const liveHost = newHost()
const silentHost = newHost()
const legacyHost = newHost()
await Promise.all([liveHost, silentHost, legacyHost].map((h) => assign(h.relayHostId, 'edge', EPOCH, [])))
let muted = false
const live = control(liveHost, await mint(key, liveHost.relayHostId), EPOCH, { caps })
const silent = control(silentHost, await mint(key, silentHost.relayHostId), EPOCH, { caps, drop: () => muted })
const legacy = control(legacyHost, await mint(key, legacyHost.relayHostId))
// Its keepalive timer stalls (a throttled app) but it still answers relay pings from socket I/O.
const nappingHost = newHost()
await assign(nappingHost.relayHostId, 'edge', EPOCH, [])
const napping = control(nappingHost, await mint(key, nappingHost.relayHostId), EPOCH, { caps, drop: (f) => muted && f === '{"type":"keepalive"}' })
await Promise.all([live.client.connect(), silent.client.connect(), legacy.client.connect(), napping.client.connect()])
try {
await sleep(1_000)
muted = true
await sleep(SILENCE_MS + 4_000)
record(
'K1 keepalive host: offered, answered, no edge pings, up past the silence timeout',
live.events.offers === 1 && live.events.acks >= 3 && live.events.pings === 0 && live.client.isLive() && live.events.closes.length === 0,
`offers=${live.events.offers} acks=${live.events.acks} pings=${live.events.pings} closes=${live.events.closes}`
)
record(
'K1 host without the capability: no offer, pinged as before',
legacy.events.offers === 0 && legacy.events.pings >= 3 && legacy.client.isLive(),
`offers=${legacy.events.offers} pings=${legacy.events.pings}`
)
// Local sweep alarm every 3 s: it finds the napping host silent and probes it with a relay ping.
record(
'K2 keepalive host with a stalled timer: probed with a relay ping, answers, stays up',
napping.events.pings >= 1 && napping.client.isLive() && napping.events.closes.length === 0,
`pings=${napping.events.pings} dropped=${napping.events.dropped} closes=${napping.events.closes}`
)
const nappingExport = await adminCall('export', { relayHostId: nappingHost.relayHostId })
record('K2 export of the probed, answering host: busy', nappingExport.json?.outcome === 'busy', JSON.stringify(nappingExport.json?.outcome))
const liveExport = await adminCall('export', { relayHostId: liveHost.relayHostId })
const silentExport = await adminCall('export', { relayHostId: silentHost.relayHostId })
await waitFor(() => silent.events.closes.length > 0, 3_000)
record(
'K1 export: live keepalive host busy; silent one closed 4408 and exported',
liveExport.json?.outcome === 'busy' && silentExport.json?.outcome === 'exported' && silent.events.closes.includes(4408) && live.events.closes.length === 0,
`live=${JSON.stringify(liveExport.json?.outcome)} silent=${JSON.stringify(silentExport.json?.outcome)} closes=${silent.events.closes}`
)
} finally {
live.client.closeNow()
silent.client.closeNow()
legacy.client.closeNow()
napping.client.closeNow()
}
}
// K3: a keepalive host that goes fully silent is probed when an alarm runs (here the local 3 s
// sweep; in production the silence check armed while phones are attached), and closed 4408 when
// the probe goes unanswered: silence timeout plus the 10 s probe.
export async function keepaliveProbeCheck(key: KeyLike): Promise<void> {
const host = newHost()
await assign(host.relayHostId, 'edge', EPOCH, [])
let muted = false
const c = control(host, await mint(key, host.relayHostId), EPOCH, { caps: `${SHIPPED_CAPS},client-keepalive-v1`, drop: () => muted })
await c.client.connect()
muted = true
const started = Date.now()
try {
const closed = await waitFor(() => c.events.closes.length > 0, SILENCE_MS + 10_000 + 8_000)
const after = Date.now() - started
record(
'K3 silent keepalive host: probed, then closed 4408 after the silence timeout plus the probe',
closed && c.events.closes.includes(4408) && c.events.pings >= 1 && after >= SILENCE_MS + 10_000 - 500,
`closedAfter=${after}ms pings=${c.events.pings} closes=${c.events.closes}`
)
} finally {
c.client.closeNow()
}
}
// F5: POST /__admin/drain sends the host's controls back to the director (drain frame, 4503).
export async function drainCheck(key: KeyLike): Promise<void> {
const host = newHost()
+2 -2
View File
@@ -41,7 +41,7 @@ import {
waitFor,
type Host
} from './harness-mvp-object'
import { drainCheck, heartbeatCheck, objectHealthCheck } from './mvp-object-hardening'
import { drainCheck, heartbeatCheck, keepaliveCheck, keepaliveProbeCheck, objectHealthCheck } from './mvp-object-hardening'
import { replayCheck, rotationCheck } from './mvp-object-replay'
async function mainRemote(): Promise<void> {
@@ -107,7 +107,7 @@ async function main(): Promise<void> {
await sleep(500)
}
await run(host, privateKey, () => jwksHits)
await Promise.all([heartbeatCheck(privateKey), drainCheck(privateKey), replayCheck(), rotationCheck()])
await Promise.all([heartbeatCheck(privateKey), keepaliveCheck(privateKey), keepaliveProbeCheck(privateKey), drainCheck(privateKey), replayCheck(), rotationCheck()])
await sweepCheck()
await preAuthCheck(stateDir)
await objectHealthCheck(stateDir)
@@ -51,6 +51,20 @@ export const RELAY_ASSIGNMENT_LEASE_HEADER = 'x-orca-relay-assignment-lease'
// Advertise before sending pendingConns details: legacy strict parsers would reject the entire ack.
export const RELAY_HOST_CAPABILITY_PENDING_CONN_DETAILS = 'pending-conn-details'
export const RELAY_HOST_CAPABILITY_IDLE_REGIONAL_REHOME = 'idle-regional-rehome-v1'
// The host can send the keepalive below. A relay that supports it says so with a keepalive-offer
// after the hello-ack; only then does the host send it. Relays that never offer keep pinging.
export const RELAY_HOST_CAPABILITY_CLIENT_KEEPALIVE = 'client-keepalive-v1'
// Exact frames: the edge answers the request without waking the host's object, so they never vary.
export const RELAY_CLIENT_KEEPALIVE_FRAME = '{"type":"keepalive"}'
export const RELAY_CLIENT_KEEPALIVE_ACK_FRAME = '{"type":"keepalive-ack"}'
export const KeepaliveOfferSchema = z
.object({
type: z.literal('keepalive-offer'),
v: z.literal(1),
intervalMs: z.number().int().min(1_000).max(60_000)
})
.strict()
export function parseRelayHostCapabilities(
header: string | string[] | undefined
+4 -1
View File
@@ -1,13 +1,16 @@
// The CLI loads these paths after electron-vite replaces out/main.
export const CLI_MAIN_ENTRY_NAMES = [
'agent-hooks/managed-agent-hook-controls',
'agent-hooks/installation/managed-agent-hook-controls',
'gitlab/project-ref-parser',
'orca-profiles/profile-index-store',
'claude-accounts/keychain',
// The CLI checks a relocated runtime socket dir before it sends the auth token.
'daemon/endpoint/publication/daemon-socket-endpoint-path',
'skills/bundled-skill-install/bundled-skill-local-host',
'skills/bundled-skill-install/bundled-skill-installation',
'filesystem/macos-tree-clone',
'orcad/orcad-stale-lock-reclaim',
'orcad/orcad-host-identity-reset',
'plugins/plugin-authoring-checks',
...[
'access',
+3
View File
@@ -345,6 +345,8 @@ module.exports = {
'out/main/antigravity/**',
'out/main/claude/**',
'out/main/codex/**',
// The CLI loads the socket-dir check; tsc-emitted output also needs its mode constants beside it.
'out/main/daemon/endpoint/publication/daemon-{socket-endpoint-path,private-file-modes}.js',
'out/main/copilot/**',
'out/main/cursor/**',
'out/main/droid/**',
@@ -372,6 +374,7 @@ module.exports = {
'out/main/parcel-watcher-process-entry.js',
'out/main/orcad/orcad-local-serve-selection-entry.js',
'out/main/orcad/orcad-stale-lock-reclaim.js',
'out/main/orcad/orcad-host-identity-reset.js',
'out/main/chunks/**',
'out/renderer/**',
'out/mobile-web/**',
+25 -32
View File
@@ -2,7 +2,6 @@
# This is a RATCHET: counts may only go DOWN. Run `pnpm lint:ast-grep:flaky-tests` to list them.
# Prune after a fix: pnpm check:flaky-test-pattern-ratchet --prune
1 test-no-in-test-import-actual:src/cli/runtime/launch-serve-replaced-app-restart.test.ts
1 test-no-in-test-import-actual:src/main/agent-hooks/server-status-persist-nonblocking.test.ts
1 test-no-in-test-import-actual:src/main/bitbucket/credential-connection.test.ts
4 test-no-in-test-import-actual:src/main/bitbucket/credential-store.test.ts
1 test-no-in-test-import-actual:src/main/bitbucket/status-no-decrypt.test.ts
@@ -148,22 +147,21 @@
1 test-no-polling-loop:tests/e2e/workspace-sleep-in-main.spec.ts
2 test-no-polling-loop:tests/e2e/worktree-card-downward-drag.spec.ts
1 test-no-real-time-wait:mobile/src/terminal/terminal-webview-tap-routing.test.ts
1 test-no-real-time-wait:src/main/agent-hooks/posix-hook-json-stdin-reader.test.ts
3 test-no-real-time-wait:src/main/agent-hooks/server-copilot-normalization.test.ts
2 test-no-real-time-wait:src/main/agent-hooks/server-transport-interference.test.ts
1 test-no-real-time-wait:src/main/agent-hooks/server-turn-ended-at.test.ts
1 test-no-real-time-wait:src/main/agent-hooks/server-turn-started-at.test.ts
5 test-no-real-time-wait:src/main/agent-hooks/wsl-hook-relay-manager.test.ts
1 test-no-real-time-wait:src/main/agent-hooks/installation/scripts/posix-hook-json-stdin-reader.test.ts
2 test-no-real-time-wait:src/main/agent-hooks/server/testing/http/server-transport-interference.test.ts
1 test-no-real-time-wait:src/main/agent-hooks/server/testing/main-agent/server-turn-ended-at.test.ts
1 test-no-real-time-wait:src/main/agent-hooks/server/testing/main-agent/server-turn-started-at.test.ts
5 test-no-real-time-wait:src/main/agent-hooks/wsl-relay/wsl-hook-relay-manager.test.ts
1 test-no-real-time-wait:src/main/ai-vault/scanners/opencode/reader-transport/session-scanner-opencode-sqlite-process.test.ts
2 test-no-real-time-wait:src/main/ai-vault/scanners/opencode/sqlite/session-scanner-opencode-sqlite-scan-scope.test.ts
1 test-no-real-time-wait:src/main/antigravity/windows-hook-json-post.test.ts
1 test-no-real-time-wait:src/main/antigravity/windows-hook-payload-delivery.test.ts
1 test-no-real-time-wait:src/main/browser/cdp/input/guest-focused-frame-route.test.ts
3 test-no-real-time-wait:src/main/browser/cookies/browser-cookie-import-concurrency.test.ts
2 test-no-real-time-wait:src/main/browser/guest-lifecycle/popups/browser-popup-compatibility.electron.test.ts
1 test-no-real-time-wait:src/main/browser/guest-lifecycle/popups/browser-popup-native-compatibility.electron.test.ts
1 test-no-real-time-wait:src/main/browser/identity/browser-session-ua-wire-identity-cross-context.electron.test.ts
1 test-no-real-time-wait:src/main/browser/identity/browser-session-ua-wire-identity.electron.test.ts
2 test-no-real-time-wait:src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-compatibility.electron.test.ts
1 test-no-real-time-wait:src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-native-compatibility.electron.test.ts
1 test-no-real-time-wait:src/main/browser/identity/wire-probes/browser-session-ua-wire-identity-cross-context.electron.test.ts
1 test-no-real-time-wait:src/main/browser/identity/wire-probes/browser-session-ua-wire-identity.electron.test.ts
1 test-no-real-time-wait:src/main/browser/network/tunnels/execution-route-socket-duplex.test.ts
1 test-no-real-time-wait:src/main/browser/network/tunnels/remote-browser-socks-server.test.ts
1 test-no-real-time-wait:src/main/claude-accounts/claude-login-session.test.ts
@@ -224,7 +222,6 @@
1 test-no-real-time-wait:src/main/managed-server/lifecycle/orcad-managed-tunnel-local-port.test.ts
1 test-no-real-time-wait:src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-claude-echo-working.test.ts
1 test-no-real-time-wait:src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-queued-quit.test.ts
1 test-no-real-time-wait:src/main/native-chat/agent-session-wire/recovery/testing/structured-agent-session-restart-cap.test.ts
1 test-no-real-time-wait:src/main/native-chat/agent-session-wire/recovery/testing/structured-agent-session-target-reconcile.test.ts
1 test-no-real-time-wait:src/main/provider-process/provider-group-orphan-guard.integration.test.ts
2 test-no-real-time-wait:src/main/provider-process/provider-process-supervisor.integration.test.ts
@@ -253,7 +250,7 @@
3 test-no-real-time-wait:src/main/skills/install/skill-bundle-process-termination.integration.test.ts
1 test-no-real-time-wait:src/main/skills/cloud/skill-cloud-direct-upload.test.ts
2 test-no-real-time-wait:src/main/skills/runtime-upload/skill-upload-process-restart.integration.test.ts
4 test-no-real-time-wait:src/main/ssh/connection/ssh-connection-host-key-store-wiring.test.ts
1 test-no-real-time-wait:src/main/ssh/connection/ssh-connection-host-key-store-wiring.test.ts
1 test-no-real-time-wait:src/main/ssh/legacy-relay/endpoints/ssh-relay-endpoint-incumbent-shell.integration.test.ts
2 test-no-real-time-wait:src/main/startup/gpu-lifecycle-install-dir-acl-guard.test.ts
3 test-no-real-time-wait:src/main/startup/run-electron-vite-dev.test.ts
@@ -464,20 +461,18 @@
1 test-no-wall-clock:config/scripts/worktree-storage/reclaim-release-test-caches.test.ts
1 test-no-wall-clock:mobile/scripts/native-build-cache.test.ts
1 test-no-wall-clock:mobile/src/pairing/mobile-relay-invite-director.test.ts
1 test-no-wall-clock:mobile/src/transport/relay/mobile-relay-resume-director.test.ts
1 test-no-wall-clock:src/cli/format.test.ts
2 test-no-wall-clock:src/cli/runtime/serve-appimage-update.test.ts
4 test-no-wall-clock:src/cli/runtime/serve-bundle-park.test.ts
5 test-no-wall-clock:src/cli/runtime/serve-pid1-init-reaper.test.ts
1 test-no-wall-clock:src/cli/runtime/status-caller.test.ts
2 test-no-wall-clock:src/main/agent-hooks/managed-hook-timeout.test.ts
2 test-no-wall-clock:src/main/agent-hooks/posix-hook-json-stdin-reader.test.ts
1 test-no-wall-clock:src/main/agent-hooks/server-codex-capacity.test.ts
1 test-no-wall-clock:src/main/agent-hooks/server-endpoint-file-lifecycle.test.ts
3 test-no-wall-clock:src/main/agent-hooks/server-ingest-structured-status.test.ts
4 test-no-wall-clock:src/main/agent-hooks/server-launch-resume-identity.test.ts
5 test-no-wall-clock:src/main/agent-hooks/spool.test.ts
2 test-no-wall-clock:src/main/agent-hooks/windows-native-hook-exe-hosts.test.ts
2 test-no-wall-clock:src/main/agent-hooks/installation/scripts/managed-hook-timeout.test.ts
2 test-no-wall-clock:src/main/agent-hooks/installation/scripts/posix-hook-json-stdin-reader.test.ts
1 test-no-wall-clock:src/main/agent-hooks/server/testing/providers/codex/server-codex-capacity.test.ts
1 test-no-wall-clock:src/main/agent-hooks/server/testing/http/server-endpoint-file-lifecycle.test.ts
3 test-no-wall-clock:src/main/agent-hooks/server/testing/structured-ingress/server-ingest-structured-status.test.ts
4 test-no-wall-clock:src/main/agent-hooks/server/testing/identity/server-launch-resume-identity.test.ts
5 test-no-wall-clock:src/main/agent-hooks/server/testing/replay/spool.test.ts
2 test-no-wall-clock:src/main/agent-hooks/installation/commands/windows-native-hook-exe-hosts.test.ts
2 test-no-wall-clock:src/main/ai-vault-search/session-search-indexer.test.ts
1 test-no-wall-clock:src/main/ai-vault/parse-cache/session-parse-cache-preview-upgrade.test.ts
1 test-no-wall-clock:src/main/ai-vault/scanners/copilot/session-scanner-copilot-cache-upgrade.test.ts
@@ -623,7 +618,7 @@
4 test-no-wall-clock:src/main/skills/runtime-upload/skill-upload-process-restart.integration.test.ts
4 test-no-wall-clock:src/main/sqlite/sync-database.test.ts
4 test-no-wall-clock:src/main/managed-server/activation/orcad-exited-own-fence-mutation-race.test.ts
8 test-no-wall-clock:src/main/managed-server/activation/orcad-exited-own-fence.test.ts
6 test-no-wall-clock:src/main/managed-server/activation/orcad-exited-own-fence.test.ts
4 test-no-wall-clock:src/main/managed-server/activation/orcad-exited-own-install-lock.test.ts
2 test-no-wall-clock:src/main/managed-server/activation/orcad-exited-own-lock-windows.test.ts
4 test-no-wall-clock:src/main/ssh/remote-exec/ssh-remote-commands.test.ts
@@ -706,15 +701,15 @@
1 test-timeout-needs-reason:src/cli/runtime/serve-pid1-init-reaper.test.ts
1 test-timeout-needs-reason:src/cli/skills-install.test.ts
2 test-timeout-needs-reason:src/main/acp/journal/acp-structured-broken-stream.test.ts
4 test-timeout-needs-reason:src/main/agent-hooks/server-transport-interference.test.ts
1 test-timeout-needs-reason:src/main/agent-hooks/wsl-hook-relay-live.integration.test.ts
1 test-timeout-needs-reason:src/main/agent-hooks/wsl-hook-relay-manager.test.ts
4 test-timeout-needs-reason:src/main/agent-hooks/server/testing/http/server-transport-interference.test.ts
1 test-timeout-needs-reason:src/main/agent-hooks/wsl-relay/testing/wsl-hook-relay-live.integration.test.ts
1 test-timeout-needs-reason:src/main/agent-hooks/wsl-relay/wsl-hook-relay-manager.test.ts
1 test-timeout-needs-reason:src/main/ai-vault/parse-cache/session-parse-cache-large-scan.test.ts
1 test-timeout-needs-reason:src/main/antigravity/native-macos-credentials.real.test.ts
1 test-timeout-needs-reason:src/main/antigravity/posix-hook-invocation.test.ts
2 test-timeout-needs-reason:src/main/antigravity/windows-hook-json-post.test.ts
3 test-timeout-needs-reason:src/main/antigravity/windows-hook-payload-delivery.test.ts
1 test-timeout-needs-reason:src/main/browser/agent-browser/agent-browser-bridge-raw-process.test.ts
1 test-timeout-needs-reason:src/main/browser/agent-browser/helper-process/agent-browser-bridge-raw-process.test.ts
1 test-timeout-needs-reason:src/main/browser/client-pages/renderer/browser-client-page-renderer-lifecycle.electron.test.ts
2 test-timeout-needs-reason:src/main/browser/cookies/browser-cookie-import-partition-reland.electron.test.ts
1 test-timeout-needs-reason:src/main/browser/cookies/browser-cookie-import-partition-rollback.electron.test.ts
@@ -722,8 +717,8 @@
1 test-timeout-needs-reason:src/main/browser/cookies/browser-cookie-import-partition.electron.test.ts
1 test-timeout-needs-reason:src/main/browser/cookies/browser-cookie-import-validated-partition.electron.test.ts
1 test-timeout-needs-reason:src/main/browser/guest-lifecycle/find/browser-find-frame-traversal.electron.test.ts
1 test-timeout-needs-reason:src/main/browser/identity/browser-session-ua-wire-identity-cross-context.electron.test.ts
2 test-timeout-needs-reason:src/main/browser/identity/browser-session-ua-wire-identity.electron.test.ts
1 test-timeout-needs-reason:src/main/browser/identity/wire-probes/browser-session-ua-wire-identity-cross-context.electron.test.ts
2 test-timeout-needs-reason:src/main/browser/identity/wire-probes/browser-session-ua-wire-identity.electron.test.ts
3 test-timeout-needs-reason:src/main/claude-usage/scanner-incremental-reader.test.ts
1 test-timeout-needs-reason:src/main/claude/claude-agent-sdk-exit-proof.test.ts
1 test-timeout-needs-reason:src/main/claude/claude-background-run-isolation-real-cli.test.ts
@@ -786,8 +781,6 @@
1 test-timeout-needs-reason:src/main/skills/install/skill-bundle-process-termination.integration.test.ts
1 test-timeout-needs-reason:src/main/sqlite/sync-database-concurrent-backup.test.ts
2 test-timeout-needs-reason:src/main/ssh/connection/ssh-connection-sftp-wire.test.ts
1 test-timeout-needs-reason:src/main/managed-server/activation/orcad-exited-own-fence.test.ts
1 test-timeout-needs-reason:src/main/ssh/file-transfer/ssh-exec-stdin-file-transfer.test.ts
2 test-timeout-needs-reason:src/main/ssh/system-transport/forwarding/system-ssh-forward-process-real-openssh.test.ts
2 test-timeout-needs-reason:src/main/startup/single-instance-lock-exit.electron.test.ts
1 test-timeout-needs-reason:src/main/window/renderer-publication-throttle.electron.test.ts
+1 -1
View File
@@ -88,7 +88,7 @@
4 src/renderer/src/components/settings/runtime-environments/catalog/RuntimeEnvironmentsPane.tsx
1 src/renderer/src/components/settings/runtime-environments/catalog/use-runtime-environment-mutation-actions.ts
1 src/renderer/src/components/settings/setup-guide/SettingsSetupGuidePane.tsx
2 src/renderer/src/components/settings/setup-guide/settings-setup-guide-progress.ts
1 src/renderer/src/components/settings/setup-guide/settings-setup-guide-progress.ts
1 src/renderer/src/components/settings/shortcuts/ShortcutsPane.tsx
3 src/renderer/src/components/settings/skills/linear/LinearAgentSkillPane.tsx
2 src/renderer/src/components/settings/tasks/TasksPane.tsx
+1 -1
View File
@@ -15,7 +15,7 @@
"src/main/worker-thread-child-process/worker-thread-child-process-entry.ts",
"src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.ts",
"src/main/hang-watchdog/main-thread-hang-watchdog-entry.ts",
"src/main/agent-hooks/managed-agent-hook-controls.ts",
"src/main/agent-hooks/installation/managed-agent-hook-controls.ts",
"src/main/claude-accounts/keychain.ts",
"src/renderer/src/main.tsx",
"src/renderer/src/popout.tsx",
+1 -1
View File
@@ -29,7 +29,6 @@
3 src/main/persistence/loading-store/state-serialization-secret-handling.ts
4 src/main/persistence/loading-store/workspace-session-snapshot-publication.ts
4 src/main/persistence/loading-store/workspace-session-terminal-binding-replay.ts
2 src/main/persistence/loading-store/workspace-session-write-listeners.ts
2 src/main/persistence/migrating-orcad-catalog/orcad-destination-client-state.ts
1 src/main/persistence/migrating-orcad-catalog/orcad-destination-workspace-session.ts
3 src/main/persistence/migrating-orcad-catalog/orcad-dormant-state-records.ts
@@ -50,6 +49,7 @@
1 src/main/persistence/tracking-repos/project-group-operations.ts
4 src/main/persistence/tracking-repos/repo-worktree-pruning.ts
3 src/main/persistence/tracking-repos/worktree-identity-migration.ts
2 src/main/persistence/workspace-session-domains.ts
2 src/main/pty/scrollback/terminal-scrollback-snapshots.ts
1 src/main/runtime/browser/client-pages/client-hosted-browser-page-persistence.ts
1 src/main/runtime/client/runtime-client-state.ts
+618
View File
@@ -0,0 +1,618 @@
# Synchronous node:fs calls (every *Sync export) in production src/main and src/shared, per file.
# Startup-only or one-shot uses are fine to keep; per-RPC, per-spawn, per-focus or per-poll uses are the target.
# This is a RATCHET: counts may only go DOWN.
# Prune after removing calls: pnpm check:main-sync-fs-ratchet --prune
1 src/main/agent-hooks/first-work/first-work-rename-runtime.ts
2 src/main/agent-hooks/installation/configuration/hook-config-write-path.ts
1 src/main/agent-hooks/installation/configuration/hooks-json-read.ts
11 src/main/agent-hooks/installation/configuration/hooks-json-write.ts
6 src/main/agent-hooks/installation/scripts/locked-executable-rename.ts
9 src/main/agent-hooks/installation/scripts/managed-hook-script-write.ts
1 src/main/agent-hooks/wsl-relay/wsl-hook-relay-deps.ts
3 src/main/agent-hooks/wsl-relay/wsl-hook-relay-launch.ts
1 src/main/agent-launch/trust/agent-trust-ownership-ledger.ts
14 src/main/agent-launch/trust/agent-trust-presets.ts
2 src/main/agent-launch/trust/antigravity-workspace-trust-ownership.ts
1 src/main/agent-launch/trust/execution-host-workspace-trust.ts
4 src/main/ai-vault/parse-cache/session-parse-cache-legacy-json.ts
2 src/main/ai-vault/scan-service/session-scanner-service-entry-path.ts
1 src/main/ai-vault/scan-service/session-scanner-service-spawn.ts
1 src/main/ai-vault/scanners/omp/omp-session-root.ts
1 src/main/ai-vault/scanners/opencode/reader-transport/opencode-wsl-runtime-preparation.ts
2 src/main/ai-vault/scanners/opencode/reader-transport/session-scanner-opencode-sqlite-worker-spawn.ts
8 src/main/amp/hook-service.ts
2 src/main/amp/managed-plugin-install-status.ts
1 src/main/antigravity/antigravity-host-acp.ts
1 src/main/antigravity/native-account-launch.ts
5 src/main/antigravity/native-account-store.ts
2 src/main/antigravity/native-credential-backend.ts
7 src/main/antigravity/native-file-credentials.ts
12 src/main/artifacts/artifact-create-intent-store.ts
2 src/main/artifacts/artifact-share-record-store.ts
1 src/main/automations/external-manager-discovery.ts
7 src/main/bitbucket/credential-store.ts
1 src/main/browser-passwords/browser-password-chromium-import.ts
2 src/main/browser-passwords/browser-password-vault-file.ts
2 src/main/browser/agent-browser/helper-process/agent-browser-binary.ts
2 src/main/browser/agent-browser/helper-process/agent-browser-dependency-binary.ts
2 src/main/browser/agent-browser/helper-process/agent-browser-process-environment.ts
1 src/main/browser/agent-browser/session-lifecycle/agent-browser-session-reset.ts
2 src/main/browser/client-hosts/file-transfers/browser-client-download-relay.ts
1 src/main/browser/client-hosts/file-transfers/browser-client-upload-staging.ts
2 src/main/browser/client-hosts/leases/browser-host-client-identity.ts
1 src/main/browser/cookies/browser-cookie-import-diagnostics.ts
2 src/main/browser/cookies/chromium/chromium-cookie-path.ts
4 src/main/browser/cookies/chromium/chromium-cookie-snapshot.ts
1 src/main/browser/cookies/chromium/import-cookies.ts
3 src/main/browser/cookies/client-route/client-route-cookie-import-source-store.ts
2 src/main/browser/cookies/sources/browser-cookie-detection.ts
8 src/main/browser/cookies/sources/browser-cookie-firefox-import.ts
2 src/main/browser/cookies/sources/browser-cookie-key.ts
1 src/main/browser/cookies/sources/browser-cookie-safari-import.ts
5 src/main/browser/cookies/sources/browser-cookie-source-profiles.ts
11 src/main/browser/cookies/staging/browser-session-cookie-staging.ts
1 src/main/browser/downloads/browser-download-destination.ts
2 src/main/browser/extensions/api-runtime/browser-extension-worker-shim-source.ts
8 src/main/browser/extensions/installation/browser-extension-install-store.ts
1 src/main/browser/extensions/installation/browser-extension-load-directory.ts
1 src/main/browser/extensions/profile-sessions/browser-extension-session-loader.ts
2 src/main/browser/extensions/profile-storage/browser-extension-data-removal.ts
8 src/main/browser/extensions/profile-storage/browser-extension-profile-document-store.ts
4 src/main/browser/extensions/profile-storage/browser-extension-profile-state-store.ts
3 src/main/browser/extensions/profile-storage/browser-extension-retired-profile-storage.ts
1 src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-background-cdp-probe.ts
2 src/main/browser/electron-fixtures/popup-identity-electron-probe.ts
1 src/main/browser/identity/mode/browser-identity-mode-record.ts
2 src/main/browser/identity/mode/browser-identity-mode-store.ts
2 src/main/browser/network/egress/browser-route-egress-electron-launch.ts
4 src/main/browser/network/execution-routes/wsl-browser-network-relay-launch.ts
5 src/main/browser/routing/partitions/browser-route-partition-binding-file.ts
3 src/main/browser/routing/partitions/browser-route-partition-binding-store.ts
4 src/main/browser/routing/partitions/browser-route-partition-pending-deletes.ts
4 src/main/browser/sessions/profiles/browser-session-meta-store.ts
2 src/main/browser/site-settings/browser-profile-site-store.ts
7 src/main/claude-accounts/claude-account-folder.ts
1 src/main/claude-accounts/claude-observed-config-dirs.ts
14 src/main/claude-accounts/claude-profile-history.ts
2 src/main/claude-accounts/claude-profile-homes.ts
1 src/main/claude-accounts/claude-profile-launch-preparation.ts
7 src/main/claude-accounts/claude-profile-paths.ts
26 src/main/claude-accounts/claude-profile-prompt-history.ts
5 src/main/claude-accounts/claude-profile-provisioning.ts
5 src/main/claude-accounts/claude-profile-router.ts
1 src/main/claude-accounts/claude-profile-settings.ts
1 src/main/claude-accounts/claude-profile-setup-worker.ts
1 src/main/claude-accounts/claude-profile-setup.ts
12 src/main/claude-accounts/claude-profile-sharing.ts
1 src/main/claude-accounts/claude-profile-wsl-router.ts
2 src/main/claude-accounts/keychain.ts
1 src/main/claude-accounts/runtime-paths.ts
3 src/main/claude/agent-view/agent-view-install.ts
1 src/main/claude/claude-diff-panel-auto-open.ts
14 src/main/claude/claude-folder-trust-file.ts
2 src/main/claude/claude-profile-hook-target.ts
1 src/main/claude/claude-rejected-api-key.ts
1 src/main/claude/claude-rewind-transcript.ts
1 src/main/claude/hook-service.ts
3 src/main/claude/statusline-install.ts
6 src/main/claude/windows-hook-files.ts
1 src/main/cli/appimage-copy-pre-extraction.ts
3 src/main/cli/appimage-extracted-root.ts
1 src/main/cli/appimage-extraction-pruning.ts
2 src/main/cli/appimage-generation-lease.ts
4 src/main/cli/appimage-generation-residency.ts
16 src/main/cli/appimage-stable-launcher.ts
1 src/main/cli/cli-command-inspection.ts
1 src/main/cli/cli-dev-launcher.ts
3 src/main/cli/cli-install-location.ts
2 src/main/cli/linux-bare-orca-dispatcher.ts
7 src/main/cli/linux-terminal-orca-cli-shim.ts
2 src/main/cli/wsl-managed-cli.ts
2 src/main/codex-accounts/codex-account-identity.ts
3 src/main/codex-accounts/codex-account-registration.ts
4 src/main/codex-accounts/codex-config-mirror.ts
1 src/main/codex-accounts/codex-credential-absence-grace.ts
1 src/main/codex-accounts/codex-login-auth-snapshot.ts
5 src/main/codex-accounts/codex-managed-home-lifecycle.ts
6 src/main/codex-accounts/codex-managed-home-path.ts
17 src/main/codex-accounts/fs-utils.ts
1 src/main/codex-accounts/guest-codex-account-homes.ts
6 src/main/codex-accounts/host-codex-managed-home-ownership.ts
2 src/main/codex-accounts/legacy-shared-auth-migration.ts
21 src/main/codex-accounts/legacy-wsl-runtime-auth-drain-recovery-script-harness.ts
36 src/main/codex-accounts/legacy-wsl-runtime-auth-drain-script-harness.ts
6 src/main/codex-accounts/legacy-wsl-runtime-auth-drain-script-interference-shims.ts
1 src/main/codex-accounts/managed-codex-auth-readiness.ts
7 src/main/codex-accounts/runtime-home-service-auth-core.ts
5 src/main/codex-accounts/runtime-home-service-auth-provenance.ts
23 src/main/codex-accounts/runtime-home-service-auth-sync.ts
19 src/main/codex-accounts/runtime-home-service-legacy-migration.ts
1 src/main/codex-accounts/runtime-home-service-managed-home.ts
14 src/main/codex-accounts/runtime-home-service-paths.ts
1 src/main/codex-accounts/runtime-home-service-sync.ts
2 src/main/codex-accounts/runtime-home-service-wsl-core.ts
1 src/main/codex-usage/codex-session-file-discovery.ts
1 src/main/codex/configuration/codex-path-observation.ts
21 src/main/codex/configuration/homes/codex-home-paths.ts
6 src/main/codex/configuration/homes/codex-managed-home-resource-copy-marker.ts
8 src/main/codex/configuration/homes/codex-managed-home-rules.ts
5 src/main/codex/configuration/homes/codex-pane-account-registry.ts
5 src/main/codex/configuration/homes/codex-windows-sandbox-read-grant.ts
1 src/main/codex/configuration/settings/codex-config-path-reference-rewrite.ts
1 src/main/codex/configuration/settings/config-settings-baseline.ts
5 src/main/codex/configuration/settings/config-settings-promotion-write-target.ts
3 src/main/codex/configuration/settings/config-settings-promotion.ts
1 src/main/codex/configuration/shared-server/codex-daemon-socket-path-guard.ts
8 src/main/codex/configuration/toml/config-toml-atomic-write.ts
4 src/main/codex/history/backfill/codex-session-backfill-marker.ts
17 src/main/codex/history/bridges/codex-session-bridge.ts
5 src/main/codex/history/index/codex-session-index-heal-state.ts
2 src/main/codex/history/index/codex-state-db.ts
2 src/main/codex/history/resume/codex-session-resume-home.ts
2 src/main/codex/history/rollouts/codex-account-home-discovery.ts
1 src/main/codex/history/rollouts/codex-session-file-listing.ts
2 src/main/codex/history/rollouts/codex-session-link.ts
1 src/main/codex/hooks/installation/codex-hook-local-install.ts
2 src/main/codex/hooks/installation/codex-hook-local-maintenance.ts
4 src/main/codex/hooks/reconciliation/codex-hook-legacy-cleanup.ts
2 src/main/codex/hooks/reconciliation/codex-hook-status.ts
4 src/main/codex/hooks/reconciliation/codex-real-home-hooks-json.ts
3 src/main/codex/trust/grants/codex-trust-grant-ledger.ts
2 src/main/codex/trust/hooks/codex-hook-trust-derivation.ts
1 src/main/codex/trust/hooks/codex-hook-trust-memo.ts
2 src/main/codex/trust/hooks/codex-hook-user-mirroring.ts
4 src/main/codex/trust/hooks/hook-trust-promotion.ts
1 src/main/codex/trust/identity/codex-trust-identity.ts
1 src/main/codex/trust/toml/config-toml-project-trust.ts
7 src/main/codex/trust/toml/config-toml-trust.ts
2 src/main/computer/desktop-script-provider-paths.ts
1 src/main/computer/macos-native-provider-client.ts
3 src/main/computer/macos-native-provider-paths.ts
5 src/main/computer/macos-native-provider-transport.ts
1 src/main/computer/sidecar-client.ts
3 src/main/connector-cloud/connector-turn-events.ts
1 src/main/copilot/hook-service.ts
4 src/main/crash-reporting/appimage-crashpad-handler-exit.ts
2 src/main/credentials/credential-file-protection.ts
6 src/main/credentials/encrypted-api-key-file-store.ts
10 src/main/credentials/integration-credential-file.ts
1 src/main/credentials/integration-state-file-cache.ts
1 src/main/credentials/integration-token-file-cache.ts
2 src/main/credentials/saved-credential-readability.ts
2 src/main/daemon/admission/automatic-work-run-marker-store.ts
5 src/main/daemon/admission/host-terminal-ledger.ts
1 src/main/daemon/admission/legacy-restore-records.ts
1 src/main/daemon/daemon-entry.ts
1 src/main/daemon/endpoint/identity/daemon-endpoint-incarnation.ts
3 src/main/daemon/endpoint/identity/daemon-pid-identity.ts
2 src/main/daemon/endpoint/identity/daemon-pid-record-quarantine.ts
2 src/main/daemon/endpoint/identity/daemon-process-start-time.ts
2 src/main/daemon/endpoint/identity/daemon-ready-identity.ts
3 src/main/daemon/endpoint/publication/daemon-endpoint-lifecycle.ts
7 src/main/daemon/endpoint/publication/daemon-endpoint-ownership.ts
1 src/main/daemon/endpoint/publication/daemon-endpoint-probe.ts
3 src/main/daemon/endpoint/publication/daemon-private-file-modes.ts
2 src/main/daemon/endpoint/publication/daemon-socket-endpoint-path.ts
3 src/main/daemon/executable-host/linux/daemon-appimage-generation-launch.ts
1 src/main/daemon/executable-host/linux/daemon-appimage-launch.ts
3 src/main/daemon/executable-host/linux/daemon-host-image.ts
2 src/main/daemon/executable-host/macos/macos-daemon-bundle.ts
9 src/main/daemon/executable-host/windows/daemon-host-build-inventory.ts
2 src/main/daemon/executable-host/windows/daemon-host-file-hash-cache.ts
3 src/main/daemon/executable-host/windows/daemon-host-manifest.ts
2 src/main/daemon/executable-host/windows/daemon-host-reclaim.ts
12 src/main/daemon/executable-host/windows/daemon-host-relocation.ts
4 src/main/daemon/health/daemon-health.ts
4 src/main/daemon/history/restoration/history-reader.ts
1 src/main/daemon/history/restoration/terminal-history-checkpoint-reader.ts
1 src/main/daemon/history/restoration/terminal-history-legacy-scrollback-restore.ts
1 src/main/daemon/history/storage/history-manager.ts
3 src/main/daemon/history/storage/terminal-history-metadata.ts
2 src/main/daemon/history/storage/terminal-history-permission-repair.ts
8 src/main/daemon/history/storage/terminal-history-recovery-quarantine.ts
1 src/main/daemon/history/storage/terminal-history-session-files.ts
3 src/main/daemon/history/storage/terminal-history-session-tombstone.ts
6 src/main/daemon/history/storage/terminal-history-session-writer.ts
1 src/main/daemon/launch/daemon-bundle-staleness.ts
1 src/main/daemon/launch/daemon-endpoint-adoption.ts
3 src/main/daemon/launch/daemon-generation-liveness.ts
2 src/main/daemon/launch/daemon-launch-paths.ts
1 src/main/daemon/launch/daemon-legacy-process-liveness.ts
2 src/main/daemon/launch/daemon-protocol-cleanup.ts
11 src/main/daemon/launch/daemon-spawner.ts
1 src/main/daemon/launch/daemon-stale-kill.ts
1 src/main/daemon/observability/daemon-adoption-telemetry-event.ts
1 src/main/daemon/observability/daemon-file-log.ts
3 src/main/daemon/permissions/daemon-tcc-attribution.ts
5 src/main/daemon/process-scopes/daemon-cgroup-scope.ts
1 src/main/daemon/process-scopes/daemon-user-manager-lifetime.ts
1 src/main/daemon/process-scopes/terminal-scopes-runtime.ts
2 src/main/daemon/process-scopes/terminal-scopes.ts
1 src/main/daemon/providers/adapter/daemon-pty-daemon-recovery.ts
1 src/main/daemon/providers/adapter/daemon-pty-session-inventory.ts
1 src/main/daemon/providers/routing/daemon-legacy-adapters.ts
2 src/main/daemon/pty-subprocess/spawn-preflight.ts
1 src/main/daemon/shell-readiness/shell-ready.ts
1 src/main/daemon/transport/client/daemon-client-token.ts
2 src/main/daemon/transport/stream/daemon-stream-backlog-probe.ts
4 src/main/devin/hook-config-json.ts
3 src/main/dsh/dsh-hook-packages.ts
3 src/main/dsh/hook-service.ts
1 src/main/emulator/android/android-sdk-host-discovery.ts
7 src/main/emulator/android/scrcpy-server-download.ts
1 src/main/emulator/emulator-probe.ts
2 src/main/emulator/serve-sim-detached-session.ts
7 src/main/emulator/serve-sim-execution.ts
17 src/main/emulator/serve-sim-runtime-materializer.ts
12 src/main/external-editors/external-editor-launch.ts
9 src/main/filesystem/durable-file-write.ts
2 src/main/filesystem/rolling-file-backup.ts
2 src/main/foreign-sqlite-readers/foreign-sqlite-reader-entry-path.ts
1 src/main/foreign-sqlite-readers/foreign-sqlite-reader-spawn.ts
1 src/main/foreign-sqlite-readers/readers/cursor-profile.ts
1 src/main/foreign-sqlite-readers/readers/opencode-binder-sessions.ts
1 src/main/git/huge-folder-ignore.ts
5 src/main/git/repo-detection.ts
13 src/main/git/repo-git-marker-scan.ts
3 src/main/git/worktrees/catalog/worktree-git-path.ts
1 src/main/github/client/check/check-job-log-cache-retention-child.mjs
3 src/main/grok/grok-hook-backup-cleanup.ts
3 src/main/grok/grok-hook-owners.ts
4 src/main/grok/grok-hook-symlink-cleanup-marker.ts
4 src/main/grok/hook-service.ts
4 src/main/hang-watchdog/hang-detection-marker.ts
1 src/main/hang-watchdog/hang-watchdog-worker-path.ts
1 src/main/hang-watchdog/previous-hang-detection.ts
1 src/main/hermes/hermes-default-home.ts
10 src/main/hermes/hermes-home-filesystem.ts
2 src/main/hermes/hook-service.ts
2 src/main/host/secret-protection-report.ts
1 src/main/ipc/app.ts
1 src/main/ipc/command-path/command-path-directory-worker-client.ts
1 src/main/ipc/command-path/command-path-resolver.ts
4 src/main/ipc/diagnostics.ts
2 src/main/ipc/filesystem/access/filesystem-path-containment.ts
2 src/main/ipc/filesystem/watcher-process/parcel-watcher-canary-directory.ts
1 src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.ts
4 src/main/ipc/filesystem/watcher-process/parcel-watcher-delivery-canary.ts
3 src/main/ipc/filesystem/watcher-process/parcel-watcher-entry-path.ts
1 src/main/ipc/filesystem/watcher-process/parcel-watcher-shallow-file-subscription.ts
1 src/main/ipc/filesystem/watcher-process/parcel-watcher-shallow-subscription.ts
1 src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-subscribe.ts
1 src/main/ipc/filesystem/watcher-process/rebinding-file-watch.ts
1 src/main/ipc/filesystem/watcher-process/watcher-event-root-path-rewrite.ts
1 src/main/ipc/macos-keyboard-layout-snapshot.ts
1 src/main/ipc/notification-authorization-status.ts
1 src/main/ipc/pty/spawn-pane-env.ts
1 src/main/ipc/ssh/ssh-connect-flow.ts
2 src/main/ipc/worktree-remote.ts
2 src/main/ipc/wsl-guest-windows-drive-path.ts
7 src/main/jcode/hook-service.ts
8 src/main/jira/site-credential-store.ts
7 src/main/keybindings/keybinding-file-parser.ts
1 src/main/keybindings/keybinding-file.ts
13 src/main/kimi/hook-service.ts
3 src/main/kiro/hook-service.ts
1 src/main/kiro/standalone-hooks.ts
4 src/main/linear/linear-credential-paths.ts
3 src/main/linear/linear-legacy-viewer-store.ts
1 src/main/linear/linear-token-store.ts
3 src/main/linear/linear-workspace-registry.ts
1 src/main/macos-permissions/macos-tcc-prompt-notice.ts
3 src/main/managed-data-accounts/credential-capture.ts
18 src/main/managed-data-accounts/profile-removal.ts
10 src/main/managed-data-accounts/service.ts
1 src/main/managed-server/activation/orcad-held-fence-tokens.ts
1 src/main/managed-server/install/orcad-deployment-target.ts
2 src/main/managed-server/install/remote-versioned-install.ts
1 src/main/memory/darwin-process-footprint.ts
13 src/main/mimo/hook-service.ts
6 src/main/minimax/minimax-cookie-store.ts
1 src/main/muse/hook-config-json.ts
4 src/main/muse/hook-service.ts
2 src/main/native-chat/agent-session-attachments/agent-session-attachment-claims.ts
1 src/main/native-chat/agent-session-journal/database/journal-host-database.ts
1 src/main/native-chat/host-readable-transcript-path.ts
2 src/main/native-chat/wsl-transcript-fs-process-spawn.ts
1 src/main/node-runtime/appimage-bundled-node-runtime.ts
2 src/main/node-runtime/managed-runtime-release-install.ts
7 src/main/node-runtime/managed-runtime-release.ts
11 src/main/notebook/python-environments.ts
1 src/main/observability/bounded-log-file-writer.ts
2 src/main/observability/bundle.ts
6 src/main/observability/local-file-sink.ts
14 src/main/opencode/hook-service.ts
1 src/main/opencode/legacy-plugin-acl-retry.ts
2 src/main/opencode/opencode-overlay-manifest.ts
1 src/main/opencode/opencode-plugin-config-writer.ts
1 src/main/opencode/opencode-private-server.ts
1 src/main/opencode/opencode-wsl-text-task.ts
2 src/main/orca-profiles/new-profile-state.ts
3 src/main/orca-profiles/other-profile-workspace-catalog.ts
3 src/main/orca-profiles/profile-artifact-cloud-cleanup.ts
1 src/main/orca-profiles/profile-cloud-index.ts
4 src/main/orca-profiles/profile-cloud-session-store.ts
12 src/main/orca-profiles/profile-index-store.ts
5 src/main/orca-profiles/profile-legacy-state-import.ts
4 src/main/orca-profiles/profile-project-move-intent.ts
3 src/main/orca-profiles/profile-project-move-record.ts
4 src/main/orca-profiles/profile-project-state-file.ts
2 src/main/orcad/launcher.ts
7 src/main/orcad/node-pty-prebuilt-slot.ts
2 src/main/orcad/node-pty-precondition.ts
2 src/main/orcad/orcad-agent-browser-binary.ts
1 src/main/orcad/orcad-app-paths.ts
1 src/main/orcad/orcad-artifact-identity.ts
2 src/main/orcad/orcad-artifact-materializer.ts
12 src/main/orcad/orcad-bundled-runtime.ts
2 src/main/orcad/orcad-cli-launcher.ts
1 src/main/orcad/orcad-command-arguments.ts
1 src/main/orcad/orcad-completed-stop-receipt.ts
2 src/main/orcad/orcad-daemon-slot-pins.ts
2 src/main/orcad/orcad-data-root-locality.ts
3 src/main/orcad/orcad-data-root-privacy.ts
4 src/main/orcad/orcad-host-account-launch-env-store.ts
1 src/main/orcad/orcad-host-adapters.ts
1 src/main/orcad/orcad-host-identity-reset.ts
2 src/main/orcad/orcad-idle-stop-record.ts
3 src/main/orcad/orcad-instance-lock-hold.ts
16 src/main/orcad/orcad-instance-lock-reclaim.ts
4 src/main/orcad/orcad-instance-lock.ts
7 src/main/orcad/orcad-local-serve-selection.ts
1 src/main/orcad/orcad-lock-clone-machine.ts
1 src/main/orcad/orcad-managed-stop-cancellation.ts
3 src/main/orcad/orcad-managed-stop-decision.ts
2 src/main/orcad/orcad-managed-stop-request.ts
4 src/main/orcad/orcad-plaintext-credential-migration.ts
5 src/main/orcad/orcad-process-start-time.ts
11 src/main/orcad/orcad-secret-key-record.ts
3 src/main/orcad/orcad-stale-lock-reclaim.ts
1 src/main/orcad/orcad-stop-request-listener.ts
1 src/main/orcad/orcad-wsl-holder-release.ts
2 src/main/orcad/orcad-wsl-host-claude-profile-refresh.ts
1 src/main/orcad/serve-profile-ssh-targets.ts
6 src/main/persistence/atomic-snapshot-writer.ts
5 src/main/persistence/loading-store/user-data-path.ts
9 src/main/persistence/migrating-orcad-catalog/migration-journal-directory.ts
4 src/main/persistence/migrating-orcad-catalog/orcad-migration-blob-installers.ts
3 src/main/persistence/migrating-orcad-catalog/orcad-migration-blob-staging.ts
17 src/main/persistence/migrating-orcad-catalog/orcad-migration-staged-file.ts
1 src/main/persistence/migrating-orcad-catalog/orcad-scrollback-snapshot-transfer.ts
11 src/main/persistence/migrating-orcad-catalog/orcad-shell-history-installer.ts
7 src/main/persistence/migrating-orcad-catalog/orcad-terminal-history-installer.ts
1 src/main/persistence/migrating-orcad-catalog/orcad-terminal-restore-hint-store.ts
1 src/main/persistence/moving-wsl-projects/wsl-move-orchestration-history-rewrite.ts
1 src/main/persistence/moving-wsl-projects/wsl-move-orchestrator-store.ts
6 src/main/persistence/moving-wsl-projects/wsl-move-slept-scrollback.ts
2 src/main/persistence/moving-wsl-projects/wsl-move-slept-spool-sweep.ts
5 src/main/persistence/preferences/active-view-preference.ts
4 src/main/persistence/profile-state/legacy-json/profile-state-authority-exports.ts
2 src/main/persistence/profile-state/legacy-json/profile-state-export-path.ts
1 src/main/persistence/profile-state/legacy-json/profile-state-legacy-backup-path.ts
2 src/main/persistence/profile-state/legacy-json/profile-state-legacy-import.ts
8 src/main/persistence/profile-state/legacy-json/profile-state-recovery.ts
6 src/main/persistence/profile-state/legacy-json/profile-state-versioned-export.ts
5 src/main/persistence/profile-state/profile-state-access-identity.ts
12 src/main/persistence/profile-state/profile-state-access-owner.ts
3 src/main/persistence/profile-state/profile-state-access.ts
2 src/main/persistence/profile-state/profile-state-active-location.ts
5 src/main/persistence/profile-state/profile-state-authority-bootstrap.ts
1 src/main/persistence/profile-state/profile-state-authority-marker.ts
2 src/main/persistence/profile-state/profile-state-backup-path.ts
2 src/main/persistence/profile-state/profile-state-backup-worker.ts
5 src/main/persistence/profile-state/profile-state-database-quarantine.ts
9 src/main/persistence/profile-state/profile-state-database-recovery.ts
2 src/main/persistence/profile-state/profile-state-database.ts
4 src/main/persistence/profile-state/profile-state-migration.ts
6 src/main/persistence/profile-state/profile-state-offline-settings.ts
6 src/main/persistence/profile-state/profile-state-recovery-command.ts
8 src/main/persistence/profile-state/profile-state-recovery-copy.ts
2 src/main/persistence/profile-state/profile-state-recovery-crash-process.ts
1 src/main/persistence/profile-state/profile-state-recovery-required.ts
2 src/main/persistence/profile-state/profile-state-section-repair.ts
2 src/main/persistence/profile-state/profile-state-sqlite-authority.ts
1 src/main/persistence/profile-state/profile-state-startup-recovery-dialog.ts
2 src/main/persistence/profile-state/profile-state-storage-classification.ts
1 src/main/persistence/profile-state/profile-state-writer-worker-path.ts
2 src/main/persistence/restoring-sessions/floating-workspace-normalization.ts
1 src/main/persistence/tracking-repos/worktree-metadata-normalization.ts
1 src/main/persistence/window-save-divergence.ts
8 src/main/pi/legacy-omp-overlay-migration.ts
5 src/main/pi/titlebar-extension-service.ts
3 src/main/plugins/appearance/plugin-appearance-service.ts
2 src/main/plugins/installation/plugin-install-staging.ts
1 src/main/plugins/installation/plugin-install.ts
1 src/main/plugins/panels/plugin-frame-guest-sessions.ts
1 src/main/plugins/panels/plugin-source-transpile-client.ts
2 src/main/plugins/plugin-dev-watcher.ts
3 src/main/plugins/plugin-secrets-store.ts
3 src/main/plugins/plugin-storage-store.ts
1 src/main/plugins/testing/plugin-editor-static-check.ts
1 src/main/plugins/workers/plugin-host-process.ts
3 src/main/plugins/workers/plugin-worker-source-hooks.ts
8 src/main/ports/darwin-port-scan-lock.ts
1 src/main/ports/port-scan-command-client.ts
1 src/main/ports/port-scan-command-execution.ts
2 src/main/provider-process/provider-executable-missing.ts
5 src/main/providers/local-pty/local-pty-executable-spawn.ts
1 src/main/providers/local-pty/local-pty-session-operations.ts
1 src/main/providers/local-pty/local-pty-shell-ready-wrapper-root.ts
1 src/main/providers/macos-login-session-pty-probe.ts
3 src/main/providers/macos-tcc-login-shell.ts
3 src/main/providers/windows-powershell-executable.ts
2 src/main/providers/working-directory-validation.ts
4 src/main/pty/history/fish-history-session.ts
4 src/main/pty/history/terminal-history-deletion.ts
2 src/main/pty/history/terminal-history-paths.ts
5 src/main/pty/history/terminal-history.ts
1 src/main/pty/process-retirement/posix-pty-process-table.ts
12 src/main/pty/scrollback/overlay-mirror.ts
1 src/main/pty/scrollback/terminal-scrollback-snapshot-nonblocking-reads.ts
11 src/main/pty/scrollback/terminal-scrollback-snapshots.ts
2 src/main/pty/shell-startup/codex-shell-launch-preflight.ts
7 src/main/pty/shell-startup/git-bash.ts
3 src/main/pty/shell-startup/legacy-terminal-posix-tombstone.ts
9 src/main/pty/shell-startup/legacy-terminal-shim-dir.ts
1 src/main/pty/shell-startup/managed-ssh-host-login-shell.ts
1 src/main/pty/shell-startup/powershell-profile-env.ts
3 src/main/pty/shell-startup/shell-startup-env.ts
5 src/main/pty/shell-startup/shell-wrapper-file-writer.ts
6 src/main/pty/shell-startup/zsh-startup-hook-pty-harness.ts
2 src/main/pty/shell-startup/zsh-wrapper-dir-ownership.ts
1 src/main/qoder/workspace-trust.ts
4 src/main/rate-limits/cursor-auth.ts
2 src/main/rate-limits/grok-auth.ts
3 src/main/rate-limits/hidden-probe-cwd.ts
2 src/main/rate-limits/opencode-go-api-key-source.ts
1 src/main/rate-limits/zcode-usage-credentials.ts
3 src/main/ripgrep/bundled-ripgrep-path.ts
8 src/main/runtime/agent-session/ownership/agent-session-claim-identity.ts
1 src/main/runtime/agent-session/records/agent-session-record-store-slot.ts
7 src/main/runtime/agent-session/records/agent-session-runtime-end-record.ts
1 src/main/runtime/agent-session/structured-agent-session-attachment-wiring.ts
1 src/main/runtime/client/navigation/desktop-chat-creation-history.ts
9 src/main/runtime/host-instance-identity.ts
4 src/main/runtime/hosts/platform-probe/host-descriptor.ts
5 src/main/runtime/mobile-cloud-relay/relay-region-preference.ts
2 src/main/runtime/mobile-cloud-relay/relay-revoke-outbox.ts
1 src/main/runtime/orchestration/db/runtime-orchestration-database-access.ts
2 src/main/runtime/push/push-unregister-outbox.ts
2 src/main/runtime/rpc/methods/mobile-delivery/bundled-mobile-web-bundle.ts
1 src/main/runtime/rpc/server/network-source-policy-store.ts
2 src/main/runtime/rpc/server/pairing/device-registry-corruption.ts
2 src/main/runtime/rpc/server/pairing/device-registry-disk-merge.ts
1 src/main/runtime/rpc/server/pairing/device-registry-file-read.ts
3 src/main/runtime/rpc/server/pairing/e2ee-keypair.ts
3 src/main/runtime/rpc/server/runtime-metadata.ts
2 src/main/runtime/rpc/server/runtime-rpc-socket-metadata.ts
5 src/main/runtime/rpc/unix-socket-transport.ts
3 src/main/runtime/rpc/ws-fallback-port-store.ts
2 src/main/runtime/terminal/launch/claude-agent-teams-shim-env.ts
1 src/main/runtime/workspaces/persisted-surfaces/crew-operations.ts
1 src/main/server/serve-pairing-output.ts
2 src/main/speech/model-cache-path.ts
9 src/main/speech/model-manager.ts
10 src/main/speech/openai-api-key-store.ts
2 src/main/speech/speech-model-download-cleanup.ts
1 src/main/speech/speech-model-download-transport.ts
2 src/main/speech/speech-model-http-download.ts
1 src/main/speech/stt-worker-model-config.ts
2 src/main/speech/stt-worker-paths.ts
2 src/main/sqlite/harden-database-files.ts
1 src/main/sqlite/row-cache/keyed-json-row-cache.ts
2 src/main/sqlite/row-cache/legacy-json-source.ts
1 src/main/sqlite/sync-database.ts
2 src/main/sqlite/versioned-cache-database.ts
1 src/main/ssh/authentication/ssh-auth-resolution.ts
2 src/main/ssh/config/ssh-config-alias-claim.ts
5 src/main/ssh/config/ssh-config-include-expander.ts
1 src/main/ssh/config/ssh-config-parser.ts
1 src/main/ssh/config/ssh-g-config-resolution.ts
3 src/main/ssh/system-transport/file-transfer/system-ssh-sftp-transfer.ts
3 src/main/ssh/system-transport/ssh-control-socket.ts
3 src/main/ssh/system-transport/system-ssh-binary.ts
3 src/main/startup/cli-launch-redirect.ts
2 src/main/startup/configure-process.ts
4 src/main/startup/gpu-fallback-marker.ts
2 src/main/startup/http1-compatibility-marker.ts
5 src/main/startup/http1-compatibility-profile-state.ts
1 src/main/startup/linux-dev-shm-policy.ts
4 src/main/startup/linux-realtime-scheduling-guard.ts
1 src/main/startup/linux-rttime-limit.ts
2 src/main/startup/profile-state-recovery-preflight.ts
1 src/main/startup/startup-diagnostics.ts
1 src/main/startup/windows-app-data-path.ts
5 src/main/startup/windows-install-dir-acl-poison-marker.ts
1 src/main/startup/windows-install-dir-acl-probe.ts
1 src/main/startup/windows-install-dir-package-acl-grant.ts
4 src/main/startup/windows-install-dir-package-acl-repair.ts
3 src/main/startup/windows-renderer-runtime-files.ts
3 src/main/startup/windows-user-data-acl.ts
6 src/main/startup/x-display-artifacts.ts
2 src/main/stats/stats-file-loader.ts
2 src/main/text-generation/source-control-prompt-files.ts
1 src/main/updater/lifecycle/windows-update-install-directory.ts
9 src/main/updater/linux-package/appimage-runtime-identity.ts
1 src/main/updater/linux-package/linux-package-install-command.ts
1 src/main/updater/linux-package/linux-update-package-type.ts
6 src/main/updater/serve-update-handoff.ts
2 src/main/usage/usage-provider-store-lifecycle.ts
1 src/main/usage/usage-scan-worker-spawn.ts
1 src/main/warp-themes/discovery.ts
1 src/main/window/desktop-integration/custom-app-icon.ts
3 src/main/window/desktop-integration/macos-press-and-hold-default.ts
1 src/main/windows/windows-administrator-restart.ts
1 src/main/windows/windows-command-paths.ts
1 src/main/windows/windows-process-table.ts
1 src/main/worker-thread-child-process/worker-thread-child-process.ts
2 src/main/worker-threads/forked-child-entry-path.ts
4 src/main/workspace-hooks/hooks.ts
10 src/main/workspace-hooks/issue-command-file.ts
4 src/main/workspace-hooks/worktree-runner-script.ts
1 src/main/workspaces/catalog/folder-repo-git-conversion.ts
2 src/main/workspaces/catalog/folder-upgrade-worktree-path.ts
3 src/main/workspaces/execution-host/project-runtime-git-router.ts
1 src/main/workspaces/space-analysis/workspace-space-scan-worker-client.ts
1 src/main/wsl/execution/wsl-executable-path.ts
1 src/main/wsl/execution/wsl-interop-spawn-directory.ts
1 src/main/wsl/execution/wsl-node-runtime-prefetch.ts
3 src/main/wsl/filesystem/wsl-drive-project-new-default.ts
10 src/main/wsl/filesystem/wsl-drive-unc-conversion-stores.ts
2 src/main/wsl/host-lifecycle/wsl-host-automation-wake-store.ts
4 src/main/wsl/host-lifecycle/wsl-host-e2e-fake-connector.ts
1 src/main/wsl/host-lifecycle/wsl-host-early-wake.ts
1 src/main/wsl/host-lifecycle/wsl-orphan-holder-release.ts
1 src/main/zcode/hook-config-json.ts
12 src/main/zcode/zcode-plan-api-key-store.ts
6 src/shared/agent-hook-listener/claude-session-continuation.ts
4 src/shared/agent-hook-listener/reverse-file-region-scan.ts
3 src/shared/agent-hook-listener/transcript-reader.ts
3 src/shared/agent-hook-listener/transport/agent-hook-endpoint-temp-cleanup.ts
13 src/shared/agent-hook-listener/transport/agent-hook-spool.ts
5 src/shared/agent-hook-listener/transport/endpoint-publication.ts
4 src/shared/agent-launch/startup/omp-fresh-config.ts
2 src/shared/appimage-cache-identity.ts
2 src/shared/bundled-web-client-manifest.ts
3 src/shared/bundled-web-client-root.ts
5 src/shared/cli-fs-reads.ts
3 src/shared/cli-runtime-pairing-inputs.ts
9 src/shared/codex-rollout-jsonl-cursor.ts
1 src/shared/codex-subagent-roster.ts
4 src/shared/ephemeral-vm-recipe-doctor.ts
1 src/shared/ephemeral-vm-recipe-runner.ts
1 src/shared/ephemeral-vm-runtime-feature-store.ts
1 src/shared/ephemeral-vm-runtime-store.ts
6 src/shared/file-content/node-bounded-file-reader.ts
5 src/shared/file-content/node-file-content-equality.ts
6 src/shared/file-content/node-source-copy-content-equality.ts
3 src/shared/grok-session-paths.ts
2 src/shared/jcode-session-files.ts
1 src/shared/muse-session-log.ts
1 src/shared/opencode-installed-plugin.ts
10 src/shared/opencode-plugin-atomic-write.ts
5 src/shared/opencode-tui-config-registration.ts
1 src/shared/opencode-tui-plugin-install.ts
2 src/shared/orcad-build-identity.ts
1 src/shared/plugins/declarative/testing/orca-testing.ts
2 src/shared/real-path-sync.ts
1 src/shared/remote-runtime/e2ee/node/remote-runtime-e2ee-v2-host-latch.ts
1 src/shared/remote-runtime/host-store/runtime-e2ee-keypair-file.ts
1 src/shared/remote-runtime/host-store/runtime-environment-sidecar.ts
2 src/shared/remote-runtime/host-store/runtime-environment-store-read-cache.ts
2 src/shared/remote-runtime/host-store/runtime-environment-store-records.ts
1 src/shared/remote-runtime/host-store/wsl-host-deployment-store.ts
13 src/shared/secure-storage/secure-file.ts
1 src/shared/secure-storage/secure-path-metadata-snapshot.ts
1 src/shared/secure-storage/secure-path-windows-acl.ts
3 src/shared/serve-abort-park.ts
7 src/shared/serve-bundle-park.ts
1 src/shared/serve-user-data-path.ts
3 src/shared/source-scan/source-tree-scan.ts
5 src/shared/startup-command-staging.ts
1 src/shared/terminal/pty/native-process/pty-process-ceiling-state.ts
8 src/shared/windows-breakaway-launcher.ts
3 src/shared/windows-console-input.ts
2 src/shared/windows-interactive-login-spawn.ts
2 src/shared/windows-retry-file-operations.ts
2 src/shared/windows-security-addon.ts
1 src/shared/windows-transient-lock-removal.ts
+1 -1
View File
@@ -5,7 +5,7 @@
# Some entries run in the daemon or orcad process, or are test harnesses outside the test-path
# conventions. This is a RATCHET: counts may only go DOWN.
# Prune after removing launches: pnpm check:main-sync-spawn-ratchet --prune
1 src/main/agent-hooks/installer-utils.ts
1 src/main/agent-hooks/installation/scripts/managed-hook-script-write.ts
1 src/main/browser/network/egress/browser-route-egress-electron-launch.ts
1 src/main/browser/routing/partitions/browser-route-partition-binding-store.ts
1 src/main/claude-accounts/runtime-auth-service.ts
+1 -1
View File
@@ -76,7 +76,7 @@ const ELECTRON_ARCHITECTURE_BY_ENUM = {
const PACKAGED_NATIVE_ARCHITECTURES = new Set(['ia32', 'x64', 'arm', 'arm64'])
const PACKAGED_MAIN_REQUIRED_FILES = [
'out/main/index.js',
'out/main/agent-hooks/managed-agent-hook-controls.js'
'out/main/agent-hooks/installation/managed-agent-hook-controls.js'
]
const PACKAGED_MAIN_SOURCE_RE = /^out\/main\/.+\.js$/
const TYPE_DECLARATION_ARTIFACT_RE = /\.d\.(?:c|m)?ts(?:\.map)?$/
+1
View File
@@ -23,5 +23,6 @@ tests/e2e/capture-opencode-tui-repro.mjs src/cli/cmd/tui/ui/spinner
tests/e2e/cross-version-wire/released-chat-writers.ts src/main/native-chat/agent-session-wire/structured-agent-session-event-sink.ts
# Released source trees retain this actual registry; the current registry is checked first.
tests/e2e/cross-version-wire/release-module-locations.ts src/main/runtime/rpc/methods/index.ts
tests/e2e/cross-version-wire/release-module-locations.ts src/renderer/src/runtime/remote-runtime-terminal-multiplexer.ts
# Release tags with flat skill owners need the restored harness beside that actual source.
.github/workflows/release-cut.yml src/main/skills/skill-provider-runtime-roots.test.ts
+8
View File
@@ -54,3 +54,11 @@ identity, queue-admission or retained-memory oracle. Confirm it fails with the
old behavior. Use controlled, counterbalanced benchmark samples for timings;
avoid new machine-dependent millisecond gates in the normal unit suite. A green
source scan and these contracts cannot establish that the whole app is fast.
Two count ratchets (counts per file may only fall) cover classes the audit only warns about:
`pnpm check:main-sync-fs-ratchet` counts synchronous `node:fs` calls (every `*Sync` export) in production `src/main` and `src/shared`
(`config/main-sync-fs-baseline.txt`), and `pnpm check:recurring-timer-ratchet` counts `setInterval`
calls in production `src/main`, `src/renderer`, `src/shared` and `src/cli`
(`config/recurring-timer-baseline.txt`). Both run in `check:ratchets` on every non-draft PR that runs static analysis. A new use either
moves off the hot path (async fs or a stat-fingerprint cache; a push signal, a visibility-gated or
backing-off timer) or raises its file's count with reviewer sign-off.
@@ -4,19 +4,19 @@
src/cli/handlers/core.ts
src/cli/handlers/interactive-login-interruption.ts
src/cli/runtime/launch.ts
src/main/agent-hooks/managed-hook-owner-identity.ts
src/main/agent-hooks/wsl-hook-relay-link.ts
src/main/agent-hooks/wsl-hook-relay-manager.ts
src/main/agent-hooks/wsl-hook-relay-sentinel.ts
src/main/agent-hooks/installation/locking/managed-hook-owner-identity.ts
src/main/agent-hooks/wsl-relay/wsl-hook-relay-link.ts
src/main/agent-hooks/wsl-relay/wsl-hook-relay-manager.ts
src/main/agent-hooks/wsl-relay/wsl-hook-relay-sentinel.ts
src/main/ai-vault/scan-service/session-scanner-service-client-state.ts
src/main/ai-vault/scan-service/session-scanner-service-client.ts
src/main/ai-vault/scan-service/session-scanner-service-spawn.ts
src/main/window/desktop-integration/app-icon.ts
src/main/automations/precheck-runner.ts
src/main/browser/agent-browser/agent-browser-bridge-execution.ts
src/main/browser/agent-browser/agent-browser-bridge-raw-process.ts
src/main/browser/agent-browser/agent-browser-bridge-state.ts
src/main/browser/agent-browser/agent-browser-bridge-types.ts
src/main/browser/agent-browser/helper-process/agent-browser-bridge-execution.ts
src/main/browser/agent-browser/helper-process/agent-browser-bridge-raw-process.ts
src/main/browser/agent-browser/session-routing/agent-browser-bridge-state.ts
src/main/browser/agent-browser/session-lifecycle/agent-browser-session-state.ts
src/main/browser/network/egress/browser-route-egress-electron-launch.ts
src/main/codex-accounts/legacy-wsl-runtime-auth-drain-recovery-script-harness.ts
src/main/codex-accounts/legacy-wsl-runtime-auth-drain-script-harness.ts
+1 -1
View File
@@ -309,7 +309,7 @@
1 src/renderer/src/components/right-sidebar/ai-vault/panel/AiVaultPanel.tsx
2 src/renderer/src/components/right-sidebar/ai-vault/scanning/AiVaultScanProgressStrip.tsx
1 src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-association-observation.ts
9 src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.ts
8 src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.ts
1 src/renderer/src/components/right-sidebar/ai-vault/search/AiVaultPanelSearch.tsx
1 src/renderer/src/components/right-sidebar/ai-vault/search/use-ai-vault-search.ts
2 src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-delete-action.ts
+92
View File
@@ -0,0 +1,92 @@
# setInterval calls (global, or imported from node:timers / node:timers/promises) in production src/main,
# src/renderer, src/shared and src/cli, per file. Bare calls are resolved per scope; imported bindings follow the shared
# collector (file-wide). Not counted: destructuring off a global object, a self-rescheduling setTimeout (it must back off or pause while hidden).
# This is a RATCHET: counts may only go DOWN.
# Prune after removing intervals: pnpm check:recurring-timer-ratchet --prune
1 src/cli/handlers/orchestration/check-keepalive.ts
1 src/cli/runtime/mac-app-update-bundle.ts
1 src/cli/runtime/serve-supervised-service.ts
1 src/main/agent-hooks/server/server-opencode-binder.ts
1 src/main/automations/retained-run-reconciliation.ts
1 src/main/automations/service.ts
1 src/main/browser/extensions/native-messaging/browser-extension-native-ports.ts
1 src/main/browser/extensions/web-store/browser-extension-webstore-updater.ts
1 src/main/claude/agent-view/agent-view-bridge.ts
1 src/main/cli/appimage-serve-preparation.ts
1 src/main/codex-accounts/codex-login-session.ts
1 src/main/codex/configuration/homes/codex-windows-sandbox-read-grant.ts
1 src/main/crash-reporting/pre-gone-host-memory.ts
1 src/main/crash-reporting/process-gone-diagnostics.ts
1 src/main/crash-reporting/renderer-heap-allocation-profile.ts
1 src/main/daemon/admission/host-terminal-ledger.ts
1 src/main/daemon/admission/host-terminal-policy.ts
1 src/main/daemon/endpoint/publication/daemon-endpoint-lifecycle.ts
1 src/main/daemon/transport/stream/daemon-stream-backlog-probe.ts
1 src/main/diagnostics/event-loop-delay-probe.ts
1 src/main/diagnostics/main-thread-churn-probe.ts
1 src/main/git/refs/maintenance/pack-refs-lock-ownership.ts
1 src/main/hang-watchdog/main-thread-hang-watchdog-entry.ts
1 src/main/hang-watchdog/main-thread-hang-watchdog.ts
2 src/main/ipc/filesystem/watcher-process/parcel-watcher-shallow-file-subscription.ts
1 src/main/ipc/filesystem/watcher-process/parcel-watcher-shallow-subscription.ts
1 src/main/ipc/runtime-environments/runtime-environment-preference.ts
1 src/main/ipc/worktrees/git/worktree-git-common-narrow-watch.ts
1 src/main/ipc/worktrees/git/worktree-git-common-native-upgrade-poll.ts
1 src/main/ipc/wsl/wsl-host-automation-wake-wiring.ts
1 src/main/native-chat/agent-session-attachments/agent-session-attachment-sweep.ts
1 src/main/native-chat/agent-session-wire/host/structured-agent-session-lease-renewer.ts
1 src/main/native-chat/agent-session-wire/recovery/structured-agent-session-usage-limit-continue.ts
1 src/main/native-chat/agent-session-wire/termination/structured-agent-session-idle-sweep.ts
1 src/main/notifications/desktop-presence-reporter.ts
1 src/main/orcad/orcad-browser-install-park.ts
1 src/main/orcad/orcad-lock-clone-machine.ts
1 src/main/orcad/orcad-stop-request-listener.ts
1 src/main/plugins/catalog/plugin-auto-updater.ts
1 src/main/plugins/catalog/plugin-kill-list-service.ts
1 src/main/plugins/installation/plugin-git-repository.ts
1 src/main/plugins/plugin-service-housekeeping.ts
1 src/main/rate-limits/service/service-polling.ts
1 src/main/runtime/agent-state-rules/agent-state-rules-live-update.ts
1 src/main/runtime/mobile-cloud-relay/desktop-relay-service.ts
3 src/main/runtime/mobile-cloud-relay/relay-control-liveness.ts
1 src/main/runtime/rpc/methods/orchestration/messaging/check-run.ts
1 src/main/runtime/rpc/mobile-socket-wiring.ts
1 src/main/runtime/rpc/remote-runtime-server-heartbeat.ts
1 src/main/runtime/rpc/server/runtime-metadata-ownership-watch.ts
1 src/main/runtime/rpc/unix-socket-transport.ts
1 src/main/runtime/sidebar-inputs/paired-server-rows-producer.ts
1 src/main/runtime/terminal/input/agent-prompt-permission-hold.ts
1 src/main/runtime/terminal/output/terminal-derived-agent-facts.ts
1 src/main/runtime/terminal/wait/terminal-idle-polls.ts
1 src/main/ssh/legacy-relay/bridge/legacy-relay-daily-activity.ts
1 src/main/ssh/legacy-relay/cli/legacy-relay-cli-call-limits.ts
1 src/main/ssh/port-forwarding/ssh-tcp-forwarding-probe.ts
1 src/main/ssh/protocol/ssh-channel-multiplexer.ts
1 src/main/startup/configure-process.ts
1 src/main/startup/event-loop-stall-probe.ts
1 src/main/startup/synthetic-title-runtime.ts
1 src/main/telemetry/wsl-usage-reporter.ts
1 src/main/wsl/host-lifecycle/wsl-hosts-policy-live-update.ts
1 src/main/wsl/orcad/wsl-orcad-connect-stop-fence.ts
1 src/renderer/src/app-shell/use-app-session-persistence.ts
1 src/renderer/src/components/browser-pane/browser-client-page-position-driver.ts
1 src/renderer/src/components/contextual-tours/use-contextual-tour.ts
1 src/renderer/src/components/editor/setup-contextual-copy.ts
1 src/renderer/src/components/right-sidebar/plugin-panels/health/plugin-panel-watchdog.ts
1 src/renderer/src/components/sidebar/SeveredTerminalDaemonBanner.tsx
1 src/renderer/src/components/sidebar/StalledTerminalDaemonBanner.tsx
1 src/renderer/src/components/sidebar/workspace-card/activity/prompt-cache-countdown-clock.ts
1 src/renderer/src/components/status-bar/use-resource-memory-snapshot.ts
1 src/renderer/src/components/status-bar/use-runtime-host-resources.ts
1 src/renderer/src/components/tab-bar/tab-strip-drag-scroll.ts
1 src/renderer/src/components/terminal-pane/pty-transport/delivery/terminal-delivery-watchdog.ts
1 src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/RemoteRuntimeRecoveryCard.tsx
1 src/renderer/src/components/terminal-pane/render-health/terminal-render-desync-sentinel.ts
1 src/renderer/src/hooks/use-now.ts
1 src/renderer/src/lib/agent-session/hibernation/agent-hibernation-coordinator.ts
1 src/renderer/src/lib/crash-diagnostics.ts
1 src/renderer/src/lib/window-visibility-interval.ts
1 src/renderer/src/lib/worker-auto-close.ts
1 src/renderer/src/runtime/hosts/wsl/wsl-refused-read-watch.ts
1 src/shared/remote-runtime/remote-runtime-socket-liveness.ts
1 src/shared/tmux-agent-hook-owner.ts
+12 -12
View File
@@ -4449,18 +4449,18 @@
"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/doc-preview-grants.test.ts src/renderer/src/components/browser-pane/workspace-doc/doc-preview-external-link-confirmation.test.ts",
"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/sessions/browser-session-partition-policies.test.ts",
"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/sessions/browser-session-partition-policies.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts",
"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/sessions/partition-policies/browser-session-partition-policies.test.ts",
"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/sessions/partition-policies/browser-session-partition-policies.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts",
"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts",
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/store/slices/browser/pages/browser-workspace-doc-location.test.ts",
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/store/slices/browser/pages/browser-workspace-doc-location.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx src/shared/document-preview/doc-preview-scheme.test.ts",
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/store/slices/browser/pages/browser-workspace-doc-location.test.ts src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-editor-diff-tabs.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx",
"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts",
"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/main/ipc/browser/browser.test.ts",
"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/guest-lifecycle/manager/browser-manager-annotation-bridge.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/components/browser-pane/workspace-doc/doc-preview-document-actions.test.ts src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx",
"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/guest-lifecycle/manager/browser-manager-annotation-bridge.test.ts src/main/browser/backends/offscreen-browser-backend-lifecycle.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/components/browser-pane/workspace-doc/doc-preview-document-actions.test.ts src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx",
"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/guest-lifecycle/manager/viewport/browser-manager-annotation-bridge.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/components/browser-pane/workspace-doc/doc-preview-document-actions.test.ts src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx",
"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/guest-lifecycle/manager/viewport/browser-manager-annotation-bridge.test.ts src/main/browser/backends/offscreen-browser-backend-lifecycle.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/components/browser-pane/workspace-doc/doc-preview-document-actions.test.ts src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx",
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/link-actions/LinkActionPopover.test.tsx src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-editor-diff-tabs.test.ts",
"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/guest-lifecycle/manager/browser-manager-annotation-bridge.test.ts src/main/browser/backends/offscreen-browser-backend-lifecycle.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx",
"pnpm exec vitest run --config config/vitest.config.ts src/main/browser/guest-lifecycle/manager/viewport/browser-manager-annotation-bridge.test.ts src/main/browser/backends/offscreen-browser-backend-lifecycle.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx",
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/store/slices/browser/pages/browser-page-conversion.test.ts src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-conversion-publish.test.ts src/renderer/src/lib/workspace-doc-address-input.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx",
"SKIP_BUILD=1 ORCA_E2E_WEB_CLIENT=1 ORCA_E2E_FORCE_HEADFUL=1 pnpm exec playwright test tests/e2e/paired-preview-address-bar-convergence.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1 --reporter=list",
"SKIP_BUILD=1 ORCA_E2E_WEB_CLIENT=1 ORCA_E2E_FORCE_HEADFUL=1 pnpm exec playwright test tests/e2e/paired-remote-html-preview-local-render.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1 --reporter=line",
@@ -4478,11 +4478,11 @@
"src/renderer/src/store/slices/browser/browser.test.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/sessions/browser-session-partition-policies.test.ts",
"src/main/browser/sessions/partition-policies/browser-session-partition-policies.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/renderer/src/store/slices/browser/pages/browser-workspace-doc-location.test.ts",
"src/main/browser/guest-lifecycle/manager/browser-manager-annotation-bridge.test.ts",
"src/main/browser/guest-lifecycle/manager/viewport/browser-manager-annotation-bridge.test.ts",
"src/main/browser/backends/offscreen-browser-backend-lifecycle.test.ts",
"src/renderer/src/components/browser-pane/workspace-doc/doc-preview-document-actions.test.ts",
"src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts",
@@ -6389,7 +6389,7 @@
"commands": [
"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/terminal/surface/orca-runtime-terminal-close-continuity.test.ts",
"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts",
"pnpm dlx node@24 ./node_modules/vitest/vitest.mjs run --config config/vitest.config.ts src/main/agent-hooks/server-pane-authority.test.ts src/main/ipc/agent-hooks.test.ts src/main/ipc/agent-pane-authority-ownership.test.ts src/main/persistence/terminal-topology/persistence-pane-identity-migration.test.ts src/main/persistence/terminal-topology/persistence-pty-binding-reconciliation.test.ts src/renderer/src/store/slices/agent-status/agent-pane-authority.test.ts src/renderer/src/store/terminals/terminal-pane-detach-agent-identity.test.ts src/renderer/src/store/terminals/terminal-tab-retirement-store.test.ts tests/e2e/completed-worker-retirement-resume.unit.test.ts src/renderer/src/components/shared/kill-all-terminal-surfaces.test.ts",
"pnpm dlx node@24 ./node_modules/vitest/vitest.mjs run --config config/vitest.config.ts src/main/agent-hooks/server/testing/authority/server-pane-authority.test.ts src/main/ipc/agent-hooks.test.ts src/main/ipc/agent-pane-authority-ownership.test.ts src/main/persistence/terminal-topology/persistence-pane-identity-migration.test.ts src/main/persistence/terminal-topology/persistence-pty-binding-reconciliation.test.ts src/renderer/src/store/slices/agent-status/agent-pane-authority.test.ts src/renderer/src/store/terminals/terminal-pane-detach-agent-identity.test.ts src/renderer/src/store/terminals/terminal-tab-retirement-store.test.ts tests/e2e/completed-worker-retirement-resume.unit.test.ts src/renderer/src/components/shared/kill-all-terminal-surfaces.test.ts",
"pnpm exec vitest run --config config/vitest.config.ts src/main/pty/process-retirement/pty-descendant-termination.test.ts src/main/daemon/sessions/testing/session.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts",
"pnpm run test:e2e -- tests/e2e/terminal-tab-close-restart-persistence.spec.ts --workers=1",
"pnpm run test:e2e -- tests/e2e/terminal-parked-close-retirement.spec.ts --workers=1",
@@ -6400,7 +6400,7 @@
"testFiles": [
"src/main/runtime/terminal/surface/orca-runtime-terminal-close-continuity.test.ts",
"src/main/runtime/construction/orca-runtime.test.ts",
"src/main/agent-hooks/server-pane-authority.test.ts",
"src/main/agent-hooks/server/testing/authority/server-pane-authority.test.ts",
"src/main/ipc/agent-hooks.test.ts",
"src/main/ipc/agent-pane-authority-ownership.test.ts",
"src/main/persistence/terminal-topology/persistence-pane-identity-migration.test.ts",
@@ -9253,7 +9253,7 @@
"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.test.ts src/wsl-guest/dispatcher-client-writer.test.ts --reporter=dot",
"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.test.ts src/main/ssh/protocol/ssh-channel-multiplexer-backpressure.test.ts src/wsl-guest/dispatcher-client-writer.test.ts --reporter=dot",
"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",
"pnpm exec vitest run --config config/vitest.config.ts src/main/agent-hooks/wsl-hook-relay-sentinel.test.ts --reporter=dot"
"pnpm exec vitest run --config config/vitest.config.ts src/main/agent-hooks/wsl-relay/wsl-hook-relay-sentinel.test.ts --reporter=dot"
],
"testFiles": [
"src/main/runtime/construction/orca-runtime.test.ts",
@@ -9263,7 +9263,7 @@
"src/main/ssh/protocol/ssh-channel-multiplexer.test.ts",
"src/main/ssh/protocol/ssh-channel-multiplexer-backpressure.test.ts",
"src/wsl-guest/dispatcher-client-writer.test.ts",
"src/main/agent-hooks/wsl-hook-relay-sentinel.test.ts"
"src/main/agent-hooks/wsl-relay/wsl-hook-relay-sentinel.test.ts"
],
"assertionRefs": [
{
@@ -9304,7 +9304,7 @@
]
},
{
"file": "src/main/agent-hooks/wsl-hook-relay-sentinel.test.ts",
"file": "src/main/agent-hooks/wsl-relay/wsl-hook-relay-sentinel.test.ts",
"assertions": [
"WSL stdin forwards write(false), callback settlement, and drain without claiming a live WSL topology"
]
+173 -173
View File
@@ -529,131 +529,131 @@
"src/main/persistence/preferences/active-view-preference.test.ts": 61,
"src/main/providers/accounts/agent-auth-restart-preservation.test.ts": 55,
"src/main/agent-launch/preflight/agent-cli-version-probe.test.ts": 72,
"src/main/agent-hooks/agent-tool-plugin-hooks.test.ts": 202,
"src/main/agent-hooks/agent-transition-detector.test.ts": 666,
"src/main/agent-hooks/cursor-replay-guard.test.ts": 403,
"src/main/agent-hooks/ended-process-reconciliation.test.ts": 775,
"src/main/agent-hooks/first-work-branch-rename-wsl-move.test.ts": 831,
"src/main/agent-hooks/first-work-branch-rename.test.ts": 857,
"src/main/agent-hooks/grok-replay-guard.test.ts": 533,
"src/main/agent-hooks/hook-process-capture.test.ts": 118,
"src/main/agent-hooks/hook-script-outside-orca.test.ts": 171,
"src/main/agent-hooks/installer-utils.test.ts": 264,
"src/main/agent-hooks/local-agent-cli-presence.test.ts": 153,
"src/main/agent-hooks/local-tmux-managed-pty.test.ts": 50,
"src/main/agent-hooks/locked-executable-rename.test.ts": 69,
"src/main/agent-hooks/managed-agent-hook-controls.test.ts": 250,
"src/main/agent-hooks/managed-hook-install-lock.test.ts": 226,
"src/main/agent-hooks/managed-hook-script-refresh-main-thread.test.ts": 567,
"src/main/agent-hooks/managed-hook-script-refresh.test.ts": 1637,
"src/main/agent-hooks/managed-hook-stdin-lifecycle.test.ts": 1989,
"src/main/agent-hooks/managed-hook-timeout.test.ts": 2987,
"src/main/agent-hooks/managed-toml-ownership.test.ts": 52,
"src/main/agent-hooks/posix-hook-json-stdin-reader.test.ts": 3479,
"src/main/agent-hooks/server-agent-presence.test.ts": 1257,
"src/main/agent-hooks/server-agent-tool-plugin-hooks.test.ts": 717,
"src/main/agent-hooks/server-ai-vault-liveness.test.ts": 643,
"src/main/agent-hooks/server-amp-normalization.test.ts": 607,
"src/main/agent-hooks/server-antigravity-resume-identity.test.ts": 820,
"src/main/agent-hooks/server-claude-blocked-prompt.test.ts": 681,
"src/main/agent-hooks/server-claude-child-permission-lifecycle.test.ts": 681,
"src/main/agent-hooks/server-claude-config-dir-observation.test.ts": 696,
"src/main/agent-hooks/server-claude-helper-kill.test.ts": 10279,
"src/main/agent-hooks/server-claude-helper-recovery.test.ts": 34523,
"src/main/agent-hooks/server-claude-normalization.test.ts": 683,
"src/main/agent-hooks/server-claude-owed-notification-expiry.test.ts": 877,
"src/main/agent-hooks/server-claude-permission-tool-failure.test.ts": 674,
"src/main/agent-hooks/server-claude-permission-visibility.test.ts": 765,
"src/main/agent-hooks/server-claude-session-continuation.test.ts": 675,
"src/main/agent-hooks/server-claude-statusline.test.ts": 679,
"src/main/agent-hooks/server-claude-task-wakeup-lifecycle.test.ts": 5451,
"src/main/agent-hooks/server-claude-terminal-interrupt.test.ts": 802,
"src/main/agent-hooks/server-closed-tab-suppression.test.ts": 895,
"src/main/agent-hooks/server-codex-capacity.test.ts": 671,
"src/main/agent-hooks/server-codex-interrupt-hook.test.ts": 679,
"src/main/agent-hooks/server-codex-normalization.test.ts": 741,
"src/main/agent-hooks/server-codex-review-turn-end.test.ts": 860,
"src/main/agent-hooks/server-codex-side-thread.test.ts": 847,
"src/main/agent-hooks/server-codex-subagent-transcript.test.ts": 706,
"src/main/agent-hooks/server-codex-turn-interruption.test.ts": 716,
"src/main/agent-hooks/server-copilot-normalization.test.ts": 1125,
"src/main/agent-hooks/server-copilot-resume-identity.test.ts": 729,
"src/main/agent-hooks/server-cursor-normalization.test.ts": 645,
"src/main/agent-hooks/server-endpoint-file-lifecycle.test.ts": 801,
"src/main/agent-hooks/server-grok-background-status.test.ts": 723,
"src/main/agent-hooks/server-grok-cancel.test.ts": 692,
"src/main/agent-hooks/server-grok-discovery.test.ts": 723,
"src/main/agent-hooks/server-hermes-resume-identity.test.ts": 941,
"src/main/agent-hooks/server-hook-http-ingest.test.ts": 719,
"src/main/agent-hooks/server-hook-session-binding.test.ts": 2674,
"src/main/agent-hooks/server-http-owner-probe-lifecycle.test.ts": 1088,
"src/main/agent-hooks/server-idle-process-owner.test.ts": 1014,
"src/main/agent-hooks/server-ingest-remote-codex-question.test.ts": 656,
"src/main/agent-hooks/server-ingest-remote-codex-transcript.test.ts": 647,
"src/main/agent-hooks/server-ingest-remote.test.ts": 653,
"src/main/agent-hooks/server-ingest-structured-state-clock.test.ts": 723,
"src/main/agent-hooks/server-ingest-structured-status.test.ts": 697,
"src/main/agent-hooks/server-ingest-terminal-status.test.ts": 673,
"src/main/agent-hooks/server-interrupt-inference-guards.test.ts": 685,
"src/main/agent-hooks/server-interrupt-inference-resurrection.test.ts": 759,
"src/main/agent-hooks/server-last-status-child-held-main-agent.test.ts": 937,
"src/main/agent-hooks/server-last-status-hydrate-confirmation.test.ts": 713,
"src/main/agent-hooks/server-last-status-hydrate-validation.test.ts": 737,
"src/main/agent-hooks/server-last-status-lead-boundary.test.ts": 768,
"src/main/agent-hooks/server-last-status-main-agent-fact.test.ts": 813,
"src/main/agent-hooks/server-last-status-restored-children.test.ts": 818,
"src/main/agent-hooks/server-last-status-write.test.ts": 745,
"src/main/agent-hooks/server-launch-resume-identity.test.ts": 735,
"src/main/agent-hooks/server-main-agent-turn-verdicts.test.ts": 1716,
"src/main/agent-hooks/server-muse-session-log-poll.test.ts": 2772,
"src/main/agent-hooks/server-nested-agent-boundaries.test.ts": 657,
"src/main/agent-hooks/server-nested-agent-consumers.test.ts": 660,
"src/main/agent-hooks/server-nested-agent-model.test.ts": 665,
"src/main/agent-hooks/server-nested-same-provider-owner.test.ts": 708,
"src/main/agent-hooks/server-observation-provenance.test.ts": 672,
"src/main/agent-hooks/server-omp-retired-ingress.test.ts": 641,
"src/main/agent-hooks/server-omp-retirement-ack.test.ts": 676,
"src/main/agent-hooks/server-opencode-tui-identity.test.ts": 843,
"src/main/agent-hooks/server-opencode-writer-observation.test.ts": 681,
"src/main/agent-hooks/server-pane-authority.test.ts": 762,
"src/main/agent-hooks/server-process-lifetime-status.test.ts": 852,
"src/main/agent-hooks/server-prompt-sent-telemetry.test.ts": 701,
"src/main/agent-hooks/server-relayed-claude-cancel.test.ts": 901,
"src/main/agent-hooks/server-relayed-claude-permission-replay.test.ts": 758,
"src/main/agent-hooks/server-reminted-pane-key.test.ts": 688,
"src/main/agent-hooks/server-removed-worktree-foreign-authority.test.ts": 764,
"src/main/agent-hooks/server-removed-worktree-status.test.ts": 687,
"src/main/agent-hooks/server-replay-evidence-clock.test.ts": 643,
"src/main/agent-hooks/server-restored-agent-status.test.ts": 694,
"src/main/agent-hooks/server-retired-pane-new-turn.test.ts": 666,
"src/main/agent-hooks/server-startup-lifecycle.test.ts": 718,
"src/main/agent-hooks/server-startup-prompt-control.test.ts": 697,
"src/main/agent-hooks/server-status-listener-fanout.test.ts": 783,
"src/main/agent-hooks/server-status-persist-nonblocking.test.ts": 697,
"src/main/agent-hooks/server-status-persist-throttle.test.ts": 860,
"src/main/agent-hooks/server-structured-canonical-status.test.ts": 765,
"src/main/agent-hooks/server-tmux-canonical.test.ts": 739,
"src/main/agent-hooks/server-tmux-wire.test.ts": 564,
"src/main/agent-hooks/server-transport-interference.test.ts": 1814,
"src/main/agent-hooks/server-turn-ended-at.test.ts": 990,
"src/main/agent-hooks/server-turn-started-at.test.ts": 898,
"src/main/agent-hooks/tool-events/agent-tool-plugin-hooks.test.ts": 202,
"src/main/agent-hooks/observations/agent-transition-detector.test.ts": 666,
"src/main/agent-hooks/installation/scripts/cursor-replay-guard.test.ts": 403,
"src/main/agent-hooks/server/testing/reconciliation/ended-process-reconciliation.test.ts": 775,
"src/main/agent-hooks/first-work/first-work-branch-rename-wsl-move.test.ts": 831,
"src/main/agent-hooks/first-work/first-work-branch-rename.test.ts": 857,
"src/main/agent-hooks/installation/scripts/grok-replay-guard.test.ts": 533,
"src/main/agent-hooks/installation/scripts/hook-process-capture.test.ts": 118,
"src/main/agent-hooks/installation/scripts/hook-script-outside-orca.test.ts": 171,
"src/main/agent-hooks/installation/testing/installer-contract.test.ts": 264,
"src/main/agent-hooks/installation/local-agent-cli-presence.test.ts": 153,
"src/main/agent-hooks/observations/local-tmux-managed-pty.test.ts": 50,
"src/main/agent-hooks/installation/scripts/locked-executable-rename.test.ts": 69,
"src/main/agent-hooks/installation/managed-agent-hook-controls.test.ts": 250,
"src/main/agent-hooks/installation/locking/managed-hook-install-lock.test.ts": 226,
"src/main/agent-hooks/installation/scripts/managed-hook-script-refresh-main-thread.test.ts": 567,
"src/main/agent-hooks/installation/scripts/managed-hook-script-refresh.test.ts": 1637,
"src/main/agent-hooks/installation/scripts/managed-hook-stdin-lifecycle.test.ts": 1989,
"src/main/agent-hooks/installation/scripts/managed-hook-timeout.test.ts": 2987,
"src/main/agent-hooks/installation/configuration/managed-toml-ownership.test.ts": 52,
"src/main/agent-hooks/installation/scripts/posix-hook-json-stdin-reader.test.ts": 3479,
"src/main/agent-hooks/server/testing/presence/server-agent-presence.test.ts": 1257,
"src/main/agent-hooks/server/testing/tool-events/server-agent-tool-plugin-hooks.test.ts": 717,
"src/main/agent-hooks/server/testing/identity/server-ai-vault-liveness.test.ts": 643,
"src/main/agent-hooks/server/testing/providers/amp/server-amp-normalization.test.ts": 607,
"src/main/agent-hooks/server/testing/providers/antigravity/server-antigravity-resume-identity.test.ts": 820,
"src/main/agent-hooks/server/testing/providers/claude/server-claude-blocked-prompt.test.ts": 681,
"src/main/agent-hooks/server/testing/permissions/server-claude-child-permission-lifecycle.test.ts": 681,
"src/main/agent-hooks/server/testing/providers/claude/server-claude-config-dir-observation.test.ts": 696,
"src/main/agent-hooks/server/testing/interruptions/server-claude-helper-kill.test.ts": 10279,
"src/main/agent-hooks/server/testing/interruptions/server-claude-helper-recovery.test.ts": 34523,
"src/main/agent-hooks/server/testing/providers/claude/server-claude-normalization.test.ts": 683,
"src/main/agent-hooks/server/testing/task-wakeup/server-claude-owed-notification-expiry.test.ts": 877,
"src/main/agent-hooks/server/testing/permissions/server-claude-permission-tool-failure.test.ts": 674,
"src/main/agent-hooks/server/testing/permissions/server-claude-permission-visibility.test.ts": 765,
"src/main/agent-hooks/server/testing/identity/server-claude-session-continuation.test.ts": 675,
"src/main/agent-hooks/server/testing/http/server-claude-statusline.test.ts": 679,
"src/main/agent-hooks/server/testing/task-wakeup/server-claude-task-wakeup-lifecycle.test.ts": 5451,
"src/main/agent-hooks/server/testing/interruptions/server-claude-terminal-interrupt.test.ts": 802,
"src/main/agent-hooks/server/testing/authority/server-closed-tab-suppression.test.ts": 895,
"src/main/agent-hooks/server/testing/providers/codex/server-codex-capacity.test.ts": 671,
"src/main/agent-hooks/server/testing/providers/codex/server-codex-interrupt-hook.test.ts": 679,
"src/main/agent-hooks/server/testing/normalization/server-provider-normalization.test.ts": 741,
"src/main/agent-hooks/server/testing/providers/codex/server-codex-review-turn-end.test.ts": 860,
"src/main/agent-hooks/server/testing/providers/codex/server-codex-side-thread.test.ts": 847,
"src/main/agent-hooks/server/testing/providers/codex/server-codex-subagent-transcript.test.ts": 706,
"src/main/agent-hooks/server/testing/providers/codex/server-codex-turn-interruption.test.ts": 716,
"src/main/agent-hooks/server/testing/transcripts/server-transcript-result-retry.test.ts": 1125,
"src/main/agent-hooks/server/testing/identity/server-copilot-resume-identity.test.ts": 729,
"src/main/agent-hooks/server/testing/providers/cursor/server-cursor-normalization.test.ts": 645,
"src/main/agent-hooks/server/testing/http/server-endpoint-file-lifecycle.test.ts": 801,
"src/main/agent-hooks/server/testing/providers/grok/server-grok-background-status.test.ts": 723,
"src/main/agent-hooks/server/testing/providers/grok/server-grok-cancel.test.ts": 692,
"src/main/agent-hooks/server/testing/providers/grok/server-grok-discovery.test.ts": 723,
"src/main/agent-hooks/server/testing/identity/server-hermes-resume-identity.test.ts": 941,
"src/main/agent-hooks/server/testing/http/server-hook-http-ingest.test.ts": 719,
"src/main/agent-hooks/server/testing/identity/server-hook-session-binding.test.ts": 2674,
"src/main/agent-hooks/server/testing/presence/server-http-owner-probe-lifecycle.test.ts": 1088,
"src/main/agent-hooks/server/testing/presence/server-idle-process-owner.test.ts": 1014,
"src/main/agent-hooks/server/testing/remote-ingress/server-ingest-remote-codex-question.test.ts": 656,
"src/main/agent-hooks/server/testing/remote-ingress/server-ingest-remote-codex-transcript.test.ts": 647,
"src/main/agent-hooks/server/testing/remote-ingress/server-ingest-remote.test.ts": 653,
"src/main/agent-hooks/server/testing/structured-ingress/server-ingest-structured-state-clock.test.ts": 723,
"src/main/agent-hooks/server/testing/structured-ingress/server-ingest-structured-status.test.ts": 697,
"src/main/agent-hooks/server/testing/terminal-ingress/server-ingest-terminal-status.test.ts": 673,
"src/main/agent-hooks/server/testing/interruptions/server-interrupt-inference-guards.test.ts": 685,
"src/main/agent-hooks/server/testing/interruptions/server-interrupt-inference-resurrection.test.ts": 759,
"src/main/agent-hooks/server/testing/persistence/server-last-status-child-held-main-agent.test.ts": 937,
"src/main/agent-hooks/server/testing/persistence/server-last-status-hydrate-confirmation.test.ts": 713,
"src/main/agent-hooks/server/testing/persistence/server-last-status-hydrate-validation.test.ts": 737,
"src/main/agent-hooks/server/testing/persistence/server-last-status-lead-boundary.test.ts": 768,
"src/main/agent-hooks/server/testing/persistence/server-last-status-main-agent-fact.test.ts": 813,
"src/main/agent-hooks/server/testing/persistence/server-last-status-restored-children.test.ts": 818,
"src/main/agent-hooks/server/testing/persistence/server-last-status-write.test.ts": 745,
"src/main/agent-hooks/server/testing/identity/server-launch-resume-identity.test.ts": 735,
"src/main/agent-hooks/server/testing/main-agent/server-main-agent-turn-verdicts.test.ts": 1716,
"src/main/agent-hooks/server/testing/providers/muse/server-muse-session-log-poll.test.ts": 2772,
"src/main/agent-hooks/server/testing/identity/server-nested-agent-boundaries.test.ts": 657,
"src/main/agent-hooks/server/testing/identity/server-nested-agent-consumers.test.ts": 660,
"src/main/agent-hooks/server/testing/identity/server-nested-agent-model.test.ts": 665,
"src/main/agent-hooks/server/testing/identity/server-nested-same-provider-owner.test.ts": 708,
"src/main/agent-hooks/server/testing/persistence/server-observation-provenance.test.ts": 672,
"src/main/agent-hooks/server/testing/authority/server-omp-retired-ingress.test.ts": 641,
"src/main/agent-hooks/server/testing/authority/server-omp-retirement-ack.test.ts": 676,
"src/main/agent-hooks/server/testing/providers/opencode/server-opencode-tui-identity.test.ts": 843,
"src/main/agent-hooks/server/testing/identity/server-opencode-writer-observation.test.ts": 681,
"src/main/agent-hooks/server/testing/authority/server-pane-authority.test.ts": 762,
"src/main/agent-hooks/server/testing/terminal-ingress/server-process-lifetime-status.test.ts": 852,
"src/main/agent-hooks/server/testing/telemetry/server-prompt-sent-telemetry.test.ts": 701,
"src/main/agent-hooks/server/testing/interruptions/server-relayed-claude-cancel.test.ts": 901,
"src/main/agent-hooks/server/testing/replay/server-relayed-claude-permission-replay.test.ts": 758,
"src/main/agent-hooks/server/testing/authority/server-reminted-pane-key.test.ts": 688,
"src/main/agent-hooks/server/testing/authority/server-removed-worktree-foreign-authority.test.ts": 764,
"src/main/agent-hooks/server/testing/authority/server-removed-worktree-status.test.ts": 687,
"src/main/agent-hooks/server/testing/replay/server-replay-evidence-clock.test.ts": 643,
"src/main/agent-hooks/server/testing/persistence/server-restored-agent-status.test.ts": 694,
"src/main/agent-hooks/server/testing/authority/server-retired-pane-new-turn.test.ts": 666,
"src/main/agent-hooks/server/testing/http/server-startup-lifecycle.test.ts": 718,
"src/main/agent-hooks/server/testing/http/server-startup-prompt-control.test.ts": 697,
"src/main/agent-hooks/server/testing/publication/server-status-listener-fanout.test.ts": 783,
"src/main/agent-hooks/server/testing/persistence/server-status-persist-nonblocking.test.ts": 697,
"src/main/agent-hooks/server/testing/persistence/server-status-persist-throttle.test.ts": 860,
"src/main/agent-hooks/server/testing/structured-ingress/server-structured-canonical-status.test.ts": 765,
"src/main/agent-hooks/server/testing/tmux/server-tmux-canonical.test.ts": 739,
"src/main/agent-hooks/server/testing/tmux/server-tmux-wire.test.ts": 564,
"src/main/agent-hooks/server/testing/http/server-transport-interference.test.ts": 1814,
"src/main/agent-hooks/server/testing/main-agent/server-turn-ended-at.test.ts": 990,
"src/main/agent-hooks/server/testing/main-agent/server-turn-started-at.test.ts": 898,
"src/main/agent-hooks/server/program-status/hook-precedence.test.ts": 45,
"src/main/agent-hooks/spool.test.ts": 999,
"src/main/agent-hooks/terminal-handle-row-identity.test.ts": 669,
"src/main/agent-hooks/windows-batch-hook-launcher.test.ts": 108,
"src/main/agent-hooks/windows-cmd-hook-command-unicode.test.ts": 141,
"src/main/agent-hooks/windows-hook-payload-delivery.test.ts": 345,
"src/main/agent-hooks/windows-native-hook-exe-hosts.test.ts": 262,
"src/main/agent-hooks/windows-powershell-hook-launcher.test.ts": 44,
"src/main/agent-hooks/wsl-guest-plugin-install.test.ts": 64,
"src/main/agent-hooks/wsl-hook-relay-idle-stop.test.ts": 1235,
"src/main/agent-hooks/wsl-hook-relay-live.integration.test.ts": 2231,
"src/main/agent-hooks/wsl-hook-relay-manager.test.ts": 3176,
"src/main/agent-hooks/wsl-hook-relay-reattach.test.ts": 1280,
"src/main/agent-hooks/wsl-hook-relay-recovery.test.ts": 1529,
"src/main/agent-hooks/wsl-hook-relay-sentinel.test.ts": 62,
"src/main/agent-hooks/wsl-opencode-settings-lifetime.test.ts": 1951,
"src/main/agent-hooks/wsl-opencode-settings.test.ts": 1364,
"src/main/agent-hooks/server/testing/replay/spool.test.ts": 999,
"src/main/agent-hooks/server/testing/identity/terminal-handle-row-identity.test.ts": 669,
"src/main/agent-hooks/installation/commands/windows-batch-hook-launcher.test.ts": 108,
"src/main/agent-hooks/installation/commands/windows-cmd-hook-command-unicode.test.ts": 141,
"src/main/agent-hooks/installation/commands/windows-hook-payload-delivery.test.ts": 345,
"src/main/agent-hooks/installation/commands/windows-native-hook-exe-hosts.test.ts": 262,
"src/main/agent-hooks/installation/commands/windows-powershell-hook-launcher.test.ts": 44,
"src/main/agent-hooks/wsl-relay/wsl-guest-plugin-install.test.ts": 64,
"src/main/agent-hooks/wsl-relay/wsl-hook-relay-idle-stop.test.ts": 1235,
"src/main/agent-hooks/wsl-relay/testing/wsl-hook-relay-live.integration.test.ts": 2231,
"src/main/agent-hooks/wsl-relay/wsl-hook-relay-manager.test.ts": 3176,
"src/main/agent-hooks/wsl-relay/wsl-hook-relay-reattach.test.ts": 1280,
"src/main/agent-hooks/wsl-relay/wsl-hook-relay-recovery.test.ts": 1529,
"src/main/agent-hooks/wsl-relay/wsl-hook-relay-sentinel.test.ts": 62,
"src/main/agent-hooks/wsl-relay/wsl-opencode-settings-lifetime.test.ts": 1951,
"src/main/agent-hooks/wsl-relay/wsl-opencode-settings.test.ts": 1364,
"src/main/agent-launch/agent-launch-account-env.test.ts": 958,
"src/main/agent-launch/agent-launch-executor-cancel.test.ts": 1455,
"src/main/agent-launch/agent-launch-mode-settings.test.ts": 4041,
@@ -899,18 +899,18 @@
"src/main/bitbucket/repository-ref.test.ts": 426,
"src/main/bitbucket/status-no-decrypt.test.ts": 256,
"src/main/updater/browser-sidecar-owner.test.ts": 53,
"src/main/browser/agent-browser/agent-browser-action-effects.test.ts": 487,
"src/main/browser/agent-browser/agent-browser-bridge-host-revocation.test.ts": 1017,
"src/main/browser/agent-browser/agent-browser-bridge-javascript-dialog.test.ts": 358,
"src/main/browser/agent-browser/agent-browser-bridge-keypress-input.test.ts": 752,
"src/main/browser/agent-browser/agent-browser-bridge-navigation.test.ts": 588,
"src/main/browser/agent-browser/agent-browser-bridge-raw-process-retention.test.ts": 1027,
"src/main/browser/agent-browser/agent-browser-bridge-raw-process.test.ts": 1179,
"src/main/browser/agent-browser/agent-browser-bridge-tab-routing.test.ts": 441,
"src/main/browser/agent-browser/agent-browser-orphan-sweep.test.ts": 59,
"src/main/browser/agent-browser/observation/agent-browser-action-effects.test.ts": 487,
"src/main/browser/agent-browser/command-queue/agent-browser-bridge-host-revocation.test.ts": 1017,
"src/main/browser/agent-browser/command-queue/agent-browser-bridge-javascript-dialog.test.ts": 358,
"src/main/browser/agent-browser/commands/agent-browser-bridge-keypress-input.test.ts": 752,
"src/main/browser/agent-browser/commands/agent-browser-bridge-navigation.test.ts": 588,
"src/main/browser/agent-browser/helper-process/agent-browser-bridge-raw-process-retention.test.ts": 1027,
"src/main/browser/agent-browser/helper-process/agent-browser-bridge-raw-process.test.ts": 1179,
"src/main/browser/agent-browser/session-routing/agent-browser-bridge-tab-routing.test.ts": 441,
"src/main/browser/agent-browser/session-lifecycle/agent-browser-orphan-sweep.test.ts": 59,
"src/main/browser/cdp/input/agent-input-focus-guard.test.ts": 54,
"src/main/browser/cdp/input/agent-input-injection.test.ts": 299,
"src/main/browser/guest-lifecycle/browser-agent-activity.test.ts": 128,
"src/main/browser/guest-lifecycle/page-activity/browser-agent-activity.test.ts": 128,
"src/main/browser/certificate-trust/browser-certificate-trust-controller.test.ts": 496,
"src/main/browser/client-hosts/file-transfers/browser-client-download-relay.test.ts": 124,
"src/main/browser/client-hosts/file-transfers/browser-client-download-routing.test.ts": 124,
@@ -940,34 +940,34 @@
"src/main/browser/guest-lifecycle/find/browser-find-frame-traversal.electron.test.ts": 1807,
"src/main/browser/cookies/browser-google-cookie-clear-target.test.ts": 6235,
"src/main/browser/element-grab/browser-grab-payload.test.ts": 55,
"src/main/browser/guest-lifecycle/browser-guest-devtools-dock.test.ts": 57,
"src/main/browser/guest-lifecycle/input/browser-guest-shortcut-plugin-frame.test.ts": 280,
"src/main/browser/guest-lifecycle/input/browser-guest-shortcut-precedence.test.ts": 411,
"src/main/browser/guest-lifecycle/devtools/browser-guest-devtools-dock.test.ts": 57,
"src/main/browser/guest-lifecycle/input/shortcuts/browser-guest-shortcut-plugin-frame.test.ts": 280,
"src/main/browser/guest-lifecycle/input/shortcuts/browser-guest-shortcut-precedence.test.ts": 411,
"src/main/browser/guest-lifecycle/input/browser-guest-target-url.test.ts": 50,
"src/main/browser/guest-lifecycle/input/browser-guest-wheel-zoom-scroll.test.ts": 45,
"src/main/browser/client-hosts/leases/browser-host-client-identity.test.ts": 97,
"src/main/browser/guest-lifecycle/prompts/browser-http-auth-prompt.test.ts": 74,
"src/main/browser/identity/browser-identity-mode-store.test.ts": 95,
"src/main/browser/identity/mode/browser-identity-mode-store.test.ts": 95,
"src/main/browser/guest-lifecycle/prompts/browser-javascript-dialogs.test.ts": 54,
"src/main/browser/guest-lifecycle/manager/browser-manager-annotation-bridge.test.ts": 603,
"src/main/browser/guest-lifecycle/manager/browser-manager-auth-user-agent.test.ts": 555,
"src/main/browser/guest-lifecycle/manager/browser-manager-client-hosted-downloads.test.ts": 670,
"src/main/browser/guest-lifecycle/manager/browser-manager-destroyed-guest-downloads.test.ts": 589,
"src/main/browser/guest-lifecycle/manager/browser-manager-destroyed-guest.test.ts": 633,
"src/main/browser/guest-lifecycle/manager/browser-manager-devtools-retirement.test.ts": 551,
"src/main/browser/guest-lifecycle/manager/browser-manager-downloads.test.ts": 592,
"src/main/browser/guest-lifecycle/manager/browser-manager-grab-capture.test.ts": 516,
"src/main/browser/guest-lifecycle/manager/browser-manager-grab-mode.test.ts": 567,
"src/main/browser/guest-lifecycle/manager/browser-manager-grab-selection.test.ts": 584,
"src/main/browser/guest-lifecycle/manager/browser-manager-guest-unload.test.ts": 534,
"src/main/browser/guest-lifecycle/manager/viewport/browser-manager-annotation-bridge.test.ts": 603,
"src/main/browser/guest-lifecycle/manager/navigation/browser-manager-auth-user-agent.test.ts": 555,
"src/main/browser/guest-lifecycle/manager/downloads/browser-manager-client-hosted-downloads.test.ts": 670,
"src/main/browser/guest-lifecycle/manager/downloads/browser-manager-destroyed-guest-downloads.test.ts": 589,
"src/main/browser/guest-lifecycle/manager/registration/browser-manager-destroyed-guest.test.ts": 633,
"src/main/browser/guest-lifecycle/manager/devtools/browser-manager-devtools-retirement.test.ts": 551,
"src/main/browser/guest-lifecycle/manager/downloads/browser-manager-downloads.test.ts": 592,
"src/main/browser/guest-lifecycle/manager/grab/browser-manager-grab-capture.test.ts": 516,
"src/main/browser/guest-lifecycle/manager/grab/browser-manager-grab-mode.test.ts": 567,
"src/main/browser/guest-lifecycle/manager/grab/browser-manager-grab-selection.test.ts": 584,
"src/main/browser/guest-lifecycle/manager/registration/browser-manager-guest-unload.test.ts": 534,
"src/main/browser/guest-lifecycle/manager/browser-manager-guest-visibility.test.ts": 543,
"src/main/browser/guest-lifecycle/manager/browser-manager-load-failure-replay.test.ts": 549,
"src/main/browser/guest-lifecycle/manager/browser-manager-page-prompt-routing.test.ts": 560,
"src/main/browser/guest-lifecycle/manager/browser-manager-popup-child.test.ts": 503,
"src/main/browser/guest-lifecycle/manager/browser-manager-popup-routing.test.ts": 575,
"src/main/browser/guest-lifecycle/manager/browser-manager-tab-identity.test.ts": 619,
"src/main/browser/guest-lifecycle/manager/browser-manager-viewport-override.test.ts": 597,
"src/main/browser/guest-lifecycle/manager/browser-manager-viewport-ownership.test.ts": 550,
"src/main/browser/guest-lifecycle/manager/navigation/browser-manager-load-failure-replay.test.ts": 549,
"src/main/browser/guest-lifecycle/manager/registration/browser-manager-page-prompt-routing.test.ts": 560,
"src/main/browser/guest-lifecycle/manager/popups/browser-manager-popup-child.test.ts": 503,
"src/main/browser/guest-lifecycle/manager/popups/browser-manager-popup-routing.test.ts": 575,
"src/main/browser/guest-lifecycle/manager/viewport/browser-manager-tab-identity.test.ts": 619,
"src/main/browser/guest-lifecycle/manager/viewport/browser-manager-viewport-override.test.ts": 597,
"src/main/browser/guest-lifecycle/manager/viewport/browser-manager-viewport-ownership.test.ts": 550,
"src/main/browser/network/execution-routes/browser-network-deferred-socket.test.ts": 101,
"src/main/browser/network/execution-routes/browser-network-execution-route.test.ts": 272,
"src/main/browser/network/tunnels/browser-network-tunnel-client.test.ts": 127,
@@ -981,7 +981,7 @@
"src/main/browser/guest-lifecycle/popups/browser-page-initiated-tab-budget.test.ts": 43,
"src/main/browser/routing/input-ownership/browser-page-input-credit.test.ts": 50,
"src/main/browser/guest-lifecycle/prompts/browser-page-prompts.test.ts": 74,
"src/main/browser/guest-lifecycle/popups/browser-popup-native-window.test.ts": 109,
"src/main/browser/guest-lifecycle/popups/presentation/browser-popup-native-window.test.ts": 109,
"src/main/browser/identity/browser-process-user-agent.test.ts": 45,
"src/main/browser/routing/guest-authority/browser-route-guest-popups.test.ts": 306,
"src/main/browser/routing/partitions/browser-route-identity.test.ts": 47,
@@ -1003,18 +1003,18 @@
"src/main/browser/cdp/screencast/browser-screencast-stream.test.ts": 223,
"src/main/browser/cookies/staging/browser-session-cookie-staging.scoped.test.ts": 3741,
"src/main/browser/cookies/staging/browser-session-cookie-staging.test.ts": 308,
"src/main/browser/sessions/browser-session-meta-store.test.ts": 43,
"src/main/browser/sessions/browser-session-partition-policies.test.ts": 979,
"src/main/browser/sessions/browser-session-partition-proxy-install.test.ts": 477,
"src/main/browser/sessions/browser-session-proxy.test.ts": 857,
"src/main/browser/sessions/browser-session-registry-identity.persistence.test.ts": 603,
"src/main/browser/sessions/browser-session-registry-startup-metadata.test.ts": 478,
"src/main/browser/sessions/browser-session-registry.test.ts": 883,
"src/main/browser/identity/browser-session-ua-wire-identity-cross-context.electron.test.ts": 7167,
"src/main/browser/identity/browser-session-ua-wire-identity.electron.test.ts": 8280,
"src/main/browser/sessions/browser-session-user-agent-migration-inspection.test.ts": 229,
"src/main/browser/site-settings/browser-site-display-controller.test.ts": 95,
"src/main/browser/site-settings/browser-site-permission-prompt.test.ts": 338,
"src/main/browser/sessions/profiles/browser-session-meta-store.test.ts": 43,
"src/main/browser/sessions/partition-policies/browser-session-partition-policies.test.ts": 979,
"src/main/browser/sessions/partition-policies/browser-session-partition-proxy-install.test.ts": 477,
"src/main/browser/sessions/proxy/browser-session-proxy.test.ts": 857,
"src/main/browser/sessions/profiles/browser-session-registry-identity.persistence.test.ts": 603,
"src/main/browser/sessions/profiles/browser-session-registry-startup-metadata.test.ts": 478,
"src/main/browser/sessions/profiles/browser-session-registry.test.ts": 883,
"src/main/browser/identity/wire-probes/browser-session-ua-wire-identity-cross-context.electron.test.ts": 7167,
"src/main/browser/identity/wire-probes/browser-session-ua-wire-identity.electron.test.ts": 8280,
"src/main/browser/identity/mode/browser-retired-profile-identity-inspection.test.ts": 229,
"src/main/browser/site-settings/display/browser-site-display-controller.test.ts": 95,
"src/main/browser/site-settings/permissions/browser-site-permission-prompt.test.ts": 338,
"src/main/browser/cdp/input/browser-text-insertion.test.ts": 51,
"src/main/browser/webauthn/browser-webauthn-account-picker.test.ts": 78,
"src/main/browser/webauthn/browser-webauthn-profile-delete.test.ts": 358,
@@ -1115,9 +1115,9 @@
"src/main/browser/extensions/api-runtime/browser-extension-worker-api-host.test.ts": 237,
"src/main/browser/extensions/declarative-net-request/engine-stages.test.ts": 112,
"src/main/browser/extensions/declarative-net-request/engine.test.ts": 145,
"src/main/browser/extensions/declarative-net-request/redirect-url.test.ts": 66,
"src/main/browser/extensions/declarative-net-request/regex-filter.test.ts": 116,
"src/main/browser/extensions/declarative-net-request/url-pattern.test.ts": 84,
"src/main/browser/extensions/declarative-net-request/redirect-actions/redirect-url.test.ts": 66,
"src/main/browser/extensions/declarative-net-request/regex/regex-filter.test.ts": 116,
"src/main/browser/extensions/declarative-net-request/matching/url-pattern.test.ts": 84,
"src/main/browser/element-grab/grab-guest-overlay-follow.test.ts": 332,
"src/main/browser/element-grab/grab-guest-script.test.ts": 107,
"src/main/browser/cdp/debugger/guest-cdp-command.test.ts": 105,
@@ -1134,7 +1134,7 @@
"src/main/browser/client-hosts/lifecycle/paired-runtime-browser-host-command-admission.test.ts": 213,
"src/main/browser/client-hosts/leases/paired-runtime-browser-host-lease.test.ts": 973,
"src/main/browser/network/execution-routes/paired-runtime-browser-network-route.test.ts": 1150,
"src/main/browser/guest-lifecycle/popups/popup-identity-electron-probe.test.ts": 144,
"src/main/browser/electron-fixtures/popup-identity-electron-probe.test.ts": 144,
"src/main/browser/network/tunnels/remote-browser-socks-buffering.test.ts": 384,
"src/main/browser/network/tunnels/remote-browser-socks-server.test.ts": 309,
"src/main/browser/cdp/snapshots/snapshot-engine.test.ts": 48,
@@ -49,14 +49,14 @@ export const UNIT_EXCLUDE = [
'tests/e2e/relay-region-correction.unit.test.ts',
'src/main/browser/cookies/browser-google-cookie-clear.electron.test.ts',
// Electron probes with in-process deadlines; the package job runs them serially.
'src/main/browser/guest-lifecycle/popups/popup-origin-chrome.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/presentation/popup-origin-chrome.electron.test.ts',
'src/main/browser/guest-lifecycle/navigation/browser-link-materialization.electron.test.ts',
'src/main/browser/client-pages/renderer/browser-client-page-renderer-lifecycle.electron.test.ts',
'src/main/persistence/profile-state/profile-state-writer-stall.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/browser-popup-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/browser-popup-adapter-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/browser-popup-native-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/browser-popup-background-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-adapter-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-native-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-background-compatibility.electron.test.ts',
'src/main/browser/extensions/api-runtime/browser-extension-api.electron.test.ts',
'src/main/browser/extensions/profile-storage/browser-extension-persistence.electron.test.ts',
'src/main/browser/extensions/profile-sessions/browser-extension-lifecycle.electron.test.ts',
@@ -23,7 +23,10 @@ describe('packaged runtime resources', () => {
const sources = new Map([
['out\\main\\index.js', 'const z = require("zod")'],
['out\\main\\agent-hooks\\managed-agent-hook-controls.js', 'const YAML = require("yaml")']
[
'out\\main\\agent-hooks\\installation\\managed-agent-hook-controls.js',
'const YAML = require("yaml")'
]
])
const asar = {
listPackage: () => [...sources.keys()].map((entry) => `\\${entry}`),
@@ -48,7 +51,7 @@ describe('packaged runtime resources', () => {
'let p=null;function q(){return p??=import(`@anthropic-ai/claude-agent-sdk`),p}'
],
[
'out/main/agent-hooks/managed-agent-hook-controls.js',
'out/main/agent-hooks/installation/managed-agent-hook-controls.js',
'import (`@anthropic-ai/claude-agent-sdk`)'
]
])
@@ -96,7 +99,7 @@ describe('packaged runtime resources', () => {
// The entry points themselves carry no specifier; only the shared chunk does.
const sources = new Map([
['out/main/index.js', ''],
['out/main/agent-hooks/managed-agent-hook-controls.js', ''],
['out/main/agent-hooks/installation/managed-agent-hook-controls.js', ''],
['out/main/chunks/managed-agent-hook-controls-CWf8D-KR.js', 'require(`jsonc-parser`)']
])
// listPackage includes directories that extractFile rejects; mock them to enforce the .js anchor.
@@ -128,7 +131,7 @@ describe('packaged runtime resources', () => {
const sources = new Map([
['out/main/index.js', 'const all=[...require("jsonc-parser")]'],
['out/main/agent-hooks/managed-agent-hook-controls.js', '']
['out/main/agent-hooks/installation/managed-agent-hook-controls.js', '']
])
const asar = {
listPackage: () => [...sources.keys()].map((entry) => `/${entry}`),
@@ -149,7 +152,10 @@ describe('packaged runtime resources', () => {
// Registry require(key) members are not packaged bare-module imports, even with literal keys.
const sources = new Map([
['out/main/index.js', 'registry.require("public-a");grants.require(`host-key`)'],
['out/main/agent-hooks/managed-agent-hook-controls.js', 'state.import("android-sdk")']
[
'out/main/agent-hooks/installation/managed-agent-hook-controls.js',
'state.import("android-sdk")'
]
])
const asar = {
listPackage: () => [...sources.keys()].map((entry) => `/${entry}`),
@@ -9,23 +9,17 @@ import type { AppState } from '@/store/types'
import type { AgentStatusBatchUpdate } from '@/store/slices/agent-status/agent-status-contract'
import '@/store/slices/agent-status/agent-status'
import { MAX_LIVE_AGENT_STATUSES } from '@/store/slices/agent-status/agent-status-capacity-eviction'
import { createTestStore } from '@/store/testing/app-store-test-fixture'
import { makeTab } from '@/store/terminals/terminal-tab.test-fixture'
import { makeUnifiedTab } from '@/store/slices/tabs/tab-group.test-fixture'
import { makeWorktree } from '@/store/slices/worktrees/worktree.test-fixture'
import { TEST_REPO } from '@/store/repos/repo.test-fixture'
import { makePaneKey } from '../../../../src/shared/workspace-layout/stable-pane-id'
import { getDefaultSettings } from '../../../../src/shared/constants'
import type { createTestStore } from '@/store/testing/app-store-test-fixture'
import {
createAgentStatusPaneRoutingIndex,
resolvePaneKeyFromRoutingIndex
} from '@/hooks/ipc-events/agent-status-pane-routing-index'
import { buildAgentStatusScaleFixture } from '@/store/slices/agent-status/agent-status-scale.test-fixture'
import { resolvePaneKey } from '@/hooks/ipc-events/agent-status-routing'
const WORKTREES = 423
const EVENTS = 1_000
const BATCH_SIZE = 8
const LEAF_ID = '11111111-1111-4111-8111-111111111111'
const BASE_TIME = 2_000_000_000
const counters = { maps: 0, sets: 0, tabComparisons: 0 }
@@ -58,62 +52,16 @@ function withAllocationCounting<T>(run: () => T): T {
}
}
/** Tab list whose iteration is observable, so the nested-loop resolver's comparisons are countable. */
class CountingTabList<T> extends Array<T> {
[Symbol.iterator](): ArrayIterator<T> {
const iterator = super[Symbol.iterator]()
const next = iterator.next.bind(iterator)
iterator.next = (...args) => {
const result = next(...args)
if (!result.done) {
counters.tabComparisons += 1
}
return result
}
return iterator
}
}
function buildFixture(countTabIteration: boolean) {
const store = createTestStore()
const settings = store.getState().settings ?? getDefaultSettings(tmpdir())
const tabsByWorktree: AppState['tabsByWorktree'] = {}
const unifiedTabsByWorktree: AppState['unifiedTabsByWorktree'] = {}
const worktrees: ReturnType<typeof makeWorktree>[] = []
const paneKeys: string[] = []
const owners: { tabId: string; worktreeId: string }[] = []
for (let index = 0; index < WORKTREES; index += 1) {
const worktreeId = `wt-${index}`
worktrees.push(makeWorktree({ id: worktreeId, repoId: TEST_REPO.id }))
const tabs: ReturnType<typeof makeTab>[] = []
const unified: ReturnType<typeof makeUnifiedTab>[] = []
for (let tab = 0; tab < (index % 2 === 0 ? 1 : 2); tab += 1) {
const tabId = `tab-${index}-${tab}`
tabs.push(makeTab({ id: tabId, worktreeId, title: `Terminal ${index}-${tab}` }))
unified.push(
makeUnifiedTab({
id: tabId,
worktreeId,
groupId: `group-${index}`,
label: `Label ${index}`
})
)
paneKeys.push(makePaneKey(tabId, LEAF_ID))
owners.push({ tabId, worktreeId })
}
tabsByWorktree[worktreeId] = countTabIteration ? CountingTabList.from(tabs) : tabs
unifiedTabsByWorktree[worktreeId] = unified
}
store.setState({
repos: [TEST_REPO],
worktreesByRepo: { [TEST_REPO.id]: worktrees },
tabsByWorktree,
unifiedTabsByWorktree,
terminalLayoutsByTabId: {},
setGeneratedTabTitlesFromAgentPrompts: () => {},
settings: { ...settings, tabAutoGenerateTitle: false }
})
return { store, paneKeys, owners }
const fixture = buildAgentStatusScaleFixture(
countTabIteration
? () => {
counters.tabComparisons += 1
}
: undefined
)
fixture.store.setState({ setGeneratedTabTitlesFromAgentPrompts: () => {} })
return fixture
}
function measure(run: () => void): number {
@@ -3,7 +3,7 @@ import { execFileSync } from 'node:child_process'
import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
import { createRequire } from 'node:module'
import { tmpdir } from 'node:os'
import { dirname, join, resolve } from 'node:path'
import { dirname, join, posix, relative as relativePath, resolve } from 'node:path'
import { performance } from 'node:perf_hooks'
const root = resolve(import.meta.dirname, '../../../..')
@@ -12,7 +12,7 @@ const require = createRequire(join(root, 'package.json'))
const { build } = require('esbuild')
const relative = 'src/main/browser/browser-session-registry.ts'
const historicalTarget = join(root, relative)
const currentRelative = 'src/main/browser/sessions/browser-session-registry.ts'
const currentRelative = 'src/main/browser/sessions/profiles/browser-session-registry.ts'
const target = join(root, currentRelative)
const scratch = mkdtempSync(join(tmpdir(), 'orca-browser-meta-bench-'))
const previousSource = execFileSync('git', ['show', `${baseline}:${relative}`], {
@@ -56,23 +56,56 @@ const stubs = new Map([
'export function attachBrowserExtensionsToProfileSession(profile,ids){globalThis.__metaBench.assignments.push([profile.id,ids])}'
]
])
const baselineFiles = new Set(
execFileSync('git', ['ls-tree', '-r', '--name-only', baseline], {
cwd: root,
encoding: 'utf8',
maxBuffer: 32 * 1024 * 1024
})
.trim()
.split('\n')
)
function baselineDependency(importer, specifier) {
const owner =
importer === historicalTarget ? relative : relativePath(root, importer).split('\\').join('/')
const candidate = posix.normalize(posix.join(posix.dirname(owner), specifier))
const found = [
candidate,
`${candidate}.ts`,
`${candidate}.tsx`,
`${candidate}.js`,
`${candidate}/index.ts`
].find((file) => baselineFiles.has(file))
if (!found) {
throw new Error(`Missing actual baseline dependency: ${baseline}:${owner} -> ${specifier}`)
}
return join(root, found)
}
const registryByVersion = {}
try {
for (const [version, source] of Object.entries(sources)) {
const sourceTarget = version === 'before' ? historicalTarget : target
const currentStubSpecifiers = new Map([
['./browser-session-cookie-staging', '../cookies/staging/browser-session-cookie-staging'],
['./browser-session-route-policies', '../routing/sessions/browser-session-route-policies'],
['./browser-session-cookie-staging', '../../cookies/staging/browser-session-cookie-staging'],
[
'./browser-session-partition-policies',
'../partition-policies/browser-session-partition-policies'
],
['./browser-session-route-policies', '../../routing/sessions/browser-session-route-policies'],
['./browser-session-profile-retirement', './browser-session-profile-retirement'],
[
'../persistence/loading-store/user-data-path',
'../../persistence/loading-store/user-data-path'
'../../../persistence/loading-store/user-data-path'
],
['./browser-identity-mode-store', '../identity/browser-identity-mode-store'],
['./browser-site-permission-store', '../site-settings/browser-site-permission-store'],
['./browser-site-display-store', '../site-settings/browser-site-display-store'],
['./browser-identity-mode-store', '../../identity/mode/browser-identity-mode-store'],
[
'./browser-site-permission-store',
'../../site-settings/permissions/browser-site-permission-store'
],
['./browser-site-display-store', '../../site-settings/display/browser-site-display-store'],
[
'./extensions/browser-extension-session-loader',
'../extensions/profile-sessions/browser-extension-session-loader'
'../../extensions/profile-sessions/browser-extension-session-loader'
]
])
const versionStubs = new Map(
@@ -81,16 +114,12 @@ try {
body
])
)
const historicalDependencies = new Map([
[
'./browser-session-meta-store',
join(root, 'src/main/browser/sessions/browser-session-meta-store.ts')
],
[
'./browser-session-persisted-profile-validation',
join(root, 'src/main/browser/sessions/browser-session-persisted-profile-validation.ts')
]
])
if (version === 'after') {
versionStubs.set(
'./browser-profile-owned-stores',
'export function forgetBrowserProfileOwnedStores(){return true}'
)
}
const output = join(scratch, `${version}.cjs`)
await build({
stdin: {
@@ -111,20 +140,35 @@ try {
if (args.importer === sourceTarget && versionStubs.has(args.path)) {
return { path: args.path, namespace: 'startup-stub' }
}
if (
version === 'before' &&
args.importer === sourceTarget &&
historicalDependencies.has(args.path)
) {
return { path: historicalDependencies.get(args.path) }
}
if (
args.path === 'node:fs' &&
args.importer.endsWith('/browser-session-meta-store.ts')
) {
return { path: 'fs-probe', namespace: 'startup-stub' }
}
if (
version === 'before' &&
args.path.startsWith('.') &&
(args.importer === sourceTarget || args.namespace === 'startup-baseline')
) {
return {
path: baselineDependency(args.importer, args.path),
namespace: 'startup-baseline'
}
}
})
builder.onLoad({ filter: /.*/, namespace: 'startup-baseline' }, (args) => ({
contents: execFileSync(
'git',
['show', `${baseline}:${relativePath(root, args.path).split('\\').join('/')}`],
{
cwd: root,
encoding: 'utf8'
}
),
loader: args.path.endsWith('.tsx') ? 'tsx' : 'ts',
resolveDir: dirname(args.path)
}))
builder.onLoad({ filter: /.*/, namespace: 'startup-stub' }, (args) => ({
contents:
args.path === 'fs-probe'
@@ -310,10 +310,10 @@ async function main() {
))
;({ killAllPty } = await jiti.import('../../../../src/main/ipc/pty/kill-all.ts'))
const { WslHookRelayManager, wslHookRelayManager } = await jiti.import(
'../../../../src/main/agent-hooks/wsl-hook-relay-manager.ts'
'../../../../src/main/agent-hooks/wsl-relay/wsl-hook-relay-manager.ts'
)
const { ensureWslHookRelayForReattach } = await jiti.import(
'../../../../src/main/agent-hooks/wsl-hook-relay-reattach.ts'
'../../../../src/main/agent-hooks/wsl-relay/wsl-hook-relay-reattach.ts'
)
const { codexHookService } = await jiti.import(
'../../../../src/main/codex/hooks/installation/hook-service.ts'
@@ -35,8 +35,15 @@ const RATCHET_INPUTS = {
'check-host-list-render-ratchet.mjs': ['src/renderer/src/'],
'check-id-only-store-write-ratchet.mjs': ['src/main/persistence/'],
'check-layout-writer-ratchets.mjs': ['src/main/', 'src/renderer/src/'],
'check-main-sync-fs-ratchet.mjs': ['src/main/', 'src/shared/'],
'check-main-sync-spawn-ratchet.mjs': ['src/main/'],
'check-react-compiler-compat-ratchet.mjs': ['src/renderer/src/'],
'check-recurring-timer-ratchet.mjs': [
'src/main/',
'src/renderer/src/',
'src/shared/',
'src/cli/'
],
'check-render-path-translate-ratchet.mjs': ['src/renderer/src/'],
'check-repo-host-read-ratchet.mjs': ['src/cli/', 'src/main/', 'src/shared/'],
'check-runtime-electron-ratchet.mjs': ['src/main/', 'src/cli/', 'src/shared/'],
@@ -258,7 +265,9 @@ export function selectTypecheckProjects(files) {
const RATCHET_SHARED_MODULES = {
'config/scripts/static-analysis/process-boundaries/gated-call-use-collector.mjs': [
'check-daemon-blocking-call-ratchet.mjs',
'check-main-sync-spawn-ratchet.mjs'
'check-main-sync-fs-ratchet.mjs',
'check-main-sync-spawn-ratchet.mjs',
'check-recurring-timer-ratchet.mjs'
],
'config/scripts/static-analysis/ratchets/react-compiler/react-compiler-hazards.mjs': [
'check-react-compiler-compat-ratchet.mjs'
@@ -41,6 +41,8 @@ export const LINT_STEPS = [
'check:workspace-record-read-ratchet',
'check:unproven-pty-retirement-ratchet',
'check:daemon-blocking-call-ratchet',
'check:main-sync-fs-ratchet',
'check:recurring-timer-ratchet',
'check:node-runtime-pin',
'check:path-literal-ratchet',
'check:host-list-render-ratchet',
@@ -77,12 +77,12 @@ describe('main sync-spawn ratchet', () => {
],
[
"const { execSync } = require('child_process')\nconst run = execSync\nrun('a')",
2,
1,
['execSync']
],
[
"function f() { const run = cp.execSync; run('a') }\nconst cp = require('child_process')",
2,
1,
['execSync']
],
[
@@ -91,10 +91,18 @@ describe('main sync-spawn ratchet', () => {
['execFileSync']
],
[
"import { runProcessSync } from '@orca/process-host'\nconst run = runProcessSync<string>",
"import { runProcessSync } from '@orca/process-host'\nconst run = runProcessSync<string>\nrun(a)",
1,
['runProcessSync']
]
],
// Binding an alias is setup; each call through it is a use, so an alias refactor keeps the count.
[
"import { execSync } from 'child_process'\nconst run = execSync\nrun('a')\nrun('b')",
2,
['execSync']
],
["import { execSync } from 'child_process'\nexport const run = execSync", 1, ['execSync']],
["import { execSync } from 'child_process'\nconst out = execSync('a')", 1, ['execSync']]
])('counts %s', (source, count, symbols) => {
expect(uses(source)).toEqual({ count, symbols })
})
@@ -38,6 +38,15 @@ function isValueReference(node) {
)
}
function isExportedDeclaration(declaration) {
const statement = declaration.parent?.parent
return (
!!statement &&
ts.isVariableStatement(statement) &&
!!statement.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword)
)
}
/**
* Each family lists module specifiers (packages, or repo paths without extension) and the gated
* exports to count, each with advice for the failure message.
@@ -72,7 +81,7 @@ export function createGatedCallCollector(families, ratchetName) {
)
}
// Count each gated value reference, alias use and re-export; imports alone do not count.
// Count each gated value reference, alias use and re-export; imports and plain alias bindings alone do not count.
// File-wide, not scope-aware: computed specifiers/members and non-const holder flows are unresolved; local wrappers are not traced.
function collectUses(file, contents) {
// Escaped spellings and relative imports inside gated modules still need the full analysis.
@@ -197,7 +206,7 @@ export function createGatedCallCollector(families, ratchetName) {
identifiers.push(node)
} else if (ts.isVariableDeclaration(node) && node.initializer) {
if (ts.isIdentifier(node.name)) {
aliases.push({ name: node.name.text, initializer: node.initializer })
aliases.push({ name: node.name.text, initializer: node.initializer, declaration: node })
} else if (ts.isObjectBindingPattern(node.name)) {
destructures.push(node)
}
@@ -236,14 +245,30 @@ export function createGatedCallCollector(families, ratchetName) {
}
}
}
// Binding a tracked alias is setup, not a use: its calls are charged instead, so an alias refactor
// keeps the count. Conditional/fallback aliases and exported bindings stay charged (conservative).
const aliasSetup = new Set()
for (const { name, initializer, declaration } of aliases) {
const target = unwrap(initializer)
if (
functions.has(name) &&
(ts.isIdentifier(target) ||
ts.isPropertyAccessExpression(target) ||
ts.isElementAccessExpression(target)) &&
gatedFunction(target) &&
!isExportedDeclaration(declaration)
) {
aliasSetup.add(target)
}
}
for (const node of members) {
const name = propertyName(node)
if (moduleSymbols(node.expression)?.has(name)) {
if (!aliasSetup.has(node) && moduleSymbols(node.expression)?.has(name)) {
recordUse(name)
}
}
for (const node of identifiers) {
const name = functions.get(node.text)
const name = aliasSetup.has(node) ? null : functions.get(node.text)
if (name) {
recordUse(name)
}
@@ -0,0 +1,115 @@
import process from 'node:process'
import { pathToFileURL } from 'node:url'
import { createGatedCallCollector } from '../../process-boundaries/gated-call-use-collector.mjs'
import { readTrackedSources, runCountRatchet } from '../../ratchet-baseline/ratchet-baseline.mjs'
import { isTestOnlySourcePath } from '../../process-boundaries/test-only-source-path.mjs'
// Sync fs on Electron main stalls every window (and in the daemon/orcad, every terminal); per-spawn/RPC/focus stat and read sweeps were a recurring lag source (#39805, #35967, #38481).
const BASELINE_PATH = 'config/main-sync-fs-baseline.txt'
// src/shared runs on main too; leaving it out would let a helper move bypass the gate.
const SCAN_ROOTS = ['src/main', 'src/shared']
const ADVICE =
'use node:fs/promises, or cache the result on a stat fingerprint outside the hot path'
// Every *Sync export of node:fs (descriptor and copy APIs included), listed so the baseline doesn't depend on the runtime.
const SYNC_FS = [
'accessSync',
'appendFileSync',
'chmodSync',
'chownSync',
'closeSync',
'copyFileSync',
'cpSync',
'existsSync',
'fchmodSync',
'fchownSync',
'fdatasyncSync',
'fstatSync',
'fsyncSync',
'ftruncateSync',
'futimesSync',
'globSync',
'lchmodSync',
'lchownSync',
'linkSync',
'lstatSync',
'lutimesSync',
'mkdirSync',
'mkdtempDisposableSync',
'mkdtempSync',
'openSync',
'opendirSync',
'readFileSync',
'readSync',
'readdirSync',
'readlinkSync',
'readvSync',
'realpathSync',
'renameSync',
'rmSync',
'rmdirSync',
'statSync',
'statfsSync',
'symlinkSync',
'truncateSync',
'unlinkSync',
'utimesSync',
'writeFileSync',
'writeSync',
'writevSync'
]
const collector = createGatedCallCollector(
[
{
modules: ['fs', 'node:fs', 'original-fs', 'graceful-fs'],
advice: Object.fromEntries(SYNC_FS.map((name) => [name, ADVICE]))
}
],
'main sync-fs'
)
function isScannedPath(rel) {
return /\.[cm]?[jt]sx?$/.test(rel) && !rel.endsWith('.d.ts') && !isTestOnlySourcePath(rel)
}
export function countSyncFsCalls(rel, source) {
return collector.collectUses(rel, source).count
}
export function collectMainSyncFsCounts(root = process.cwd()) {
const counts = new Map()
for (const [rel, source] of readTrackedSources(root, SCAN_ROOTS, isScannedPath)) {
const count = countSyncFsCalls(rel, source)
if (count > 0) {
counts.set(rel, count)
}
}
return counts
}
export function main(root = process.cwd(), arg = undefined) {
return runCountRatchet(
{
name: 'main-sync-fs',
baselinePath: BASELINE_PATH,
header: [
'# Synchronous node:fs calls (every *Sync export) in production src/main and src/shared, per file.',
'# Startup-only or one-shot uses are fine to keep; per-RPC, per-spawn, per-focus or per-poll uses are the target.',
'# This is a RATCHET: counts may only go DOWN.',
'# Prune after removing calls: pnpm check:main-sync-fs-ratchet --prune'
],
collect: collectMainSyncFsCounts,
unit: 'sync fs call(s)',
fix: [
`Sync fs blocks the thread it runs on: Electron main (every window) or the daemon/orcad loop (every terminal). ${ADVICE}.`,
`A one-shot startup or shutdown use may raise the file's count in ${BASELINE_PATH} with reviewer sign-off.`
]
},
root,
arg
)
}
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
process.exit(main(process.cwd(), process.argv[2]))
}
@@ -0,0 +1,168 @@
import process from 'node:process'
import { pathToFileURL } from 'node:url'
import ts from 'typescript-api'
import { createGatedCallCollector } from '../../process-boundaries/gated-call-use-collector.mjs'
import { readTrackedSources, runCountRatchet } from '../../ratchet-baseline/ratchet-baseline.mjs'
import { isTestOnlySourcePath } from '../../process-boundaries/test-only-source-path.mjs'
// Fixed-cadence polls that never back off, settle or pause while hidden were the most common perf fix class (#39734, #38902, #33829, #39650).
const BASELINE_PATH = 'config/recurring-timer-baseline.txt'
const SCAN_ROOTS = ['src/main', 'src/renderer/src', 'src/shared', 'src/cli']
const TIMER_HOSTS = new Set(['window', 'globalThis', 'self', 'global'])
const TIMER_MODULES = ['timers', 'node:timers', 'timers/promises', 'node:timers/promises']
const timerImports = createGatedCallCollector(
[
{
modules: TIMER_MODULES,
advice: { setInterval: 'prefer a push signal or a backing-off timer' }
}
],
'recurring-timer'
)
function isScannedPath(rel) {
return /\.[cm]?[jt]sx?$/.test(rel) && !rel.endsWith('.d.ts') && !isTestOnlySourcePath(rel)
}
function isHostInterval(node) {
if (!ts.isIdentifier(node.expression) || !TIMER_HOSTS.has(node.expression.text)) {
return false
}
if (ts.isPropertyAccessExpression(node)) {
return node.name.text === 'setInterval'
}
return (
ts.isElementAccessExpression(node) &&
ts.isStringLiteralLike(node.argumentExpression) &&
node.argumentExpression.text === 'setInterval'
)
}
// Skips transparent wrappers so `typeof (setInterval)` and `(setInterval) = x` read like the bare forms.
function outerExpression(node) {
let current = node
while (ts.isParenthesizedExpression(current.parent)) {
current = current.parent
}
return current
}
// Reads the timer value: not a plain `=` target (compound assignments read it), a `typeof` probe or a JSX tag name.
function isRuntimeRead(node) {
const outer = outerExpression(node)
const parent = outer.parent
return !(
ts.isTypeOfExpression(parent) ||
(ts.isBinaryExpression(parent) &&
parent.left === outer &&
parent.operatorToken.kind === ts.SyntaxKind.EqualsToken) ||
((ts.isJsxOpeningElement(parent) ||
ts.isJsxSelfClosingElement(parent) ||
ts.isJsxClosingElement(parent)) &&
parent.tagName === node)
)
}
// A value reference to the identifier, not a declaration, member name or key.
function isBareValueReference(node) {
const parent = node.parent
return (
isRuntimeRead(node) &&
!(
(ts.isPropertyAccessExpression(parent) && parent.name === node) ||
(ts.isPropertyAssignment(parent) && parent.name === node) ||
ts.isImportSpecifier(parent) ||
ts.isExportSpecifier(parent) ||
(ts.isBindingElement(parent) && (parent.name === node || parent.propertyName === node)) ||
(ts.isVariableDeclaration(parent) && parent.name === node) ||
(ts.isParameter(parent) && parent.name === node) ||
((ts.isFunctionDeclaration(parent) || ts.isMethodDeclaration(parent)) && parent.name === node)
)
)
}
const SCOPE_OPTIONS = { noLib: true, noResolve: true, allowJs: true, types: [] }
// Counts references, not calls, to the global timer, so `const every = setInterval; every(f)` and
// `window['setInterval']` are charged once. A bare name is the global when it binds to nothing
// declared in this file (resolved per scope); module bindings and their aliases are the collector's.
function countGlobalTimerReferences(source) {
const host = ts.createCompilerHost(SCOPE_OPTIONS)
host.getSourceFile = (name) => (name === source.fileName ? source : undefined)
const checker = ts.createProgram([source.fileName], SCOPE_OPTIONS, host).getTypeChecker()
let count = 0
const visit = (node) => {
if (ts.isTypeNode(node) && !ts.isExpressionWithTypeArguments(node)) {
return
}
if (
(ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) &&
isHostInterval(node) &&
isRuntimeRead(node)
) {
count += 1
} else if (ts.isIdentifier(node) && node.text === 'setInterval' && isBareValueReference(node)) {
// A shorthand `{ setInterval }` names the property; its value is the binding being read.
const symbol = ts.isShorthandPropertyAssignment(node.parent)
? checker.getShorthandAssignmentValueSymbol(node.parent)
: checker.getSymbolAtLocation(node)
const declarations = symbol?.declarations ?? []
if (!declarations.some((declaration) => declaration.getSourceFile() === source)) {
count += 1
}
}
ts.forEachChild(node, visit)
}
visit(source)
return count
}
export function countRecurringTimers(rel, source) {
if (!source.includes('setInterval')) {
return 0
}
const file = ts.createSourceFile(rel, source, ts.ScriptTarget.Latest, true)
return countGlobalTimerReferences(file) + timerImports.collectUses(rel, source).count
}
export function collectRecurringTimerCounts(root = process.cwd()) {
const counts = new Map()
for (const [rel, source] of readTrackedSources(root, SCAN_ROOTS, isScannedPath)) {
const count = countRecurringTimers(rel, source)
if (count > 0) {
counts.set(rel, count)
}
}
return counts
}
export function main(root = process.cwd(), arg = undefined) {
return runCountRatchet(
{
name: 'recurring-timer',
baselinePath: BASELINE_PATH,
header: [
'# setInterval calls (global, or imported from node:timers / node:timers/promises) in production src/main,',
'# src/renderer, src/shared and src/cli, per file. Bare calls are resolved per scope; imported bindings follow the shared',
'# collector (file-wide). Not counted: destructuring off a global object, a self-rescheduling setTimeout (it must back off or pause while hidden).',
'# This is a RATCHET: counts may only go DOWN.',
'# Prune after removing intervals: pnpm check:recurring-timer-ratchet --prune'
],
collect: collectRecurringTimerCounts,
unit: 'setInterval call(s)',
fix: [
'A fixed-cadence interval keeps working when nothing changes, the window is hidden or its dependency keeps failing.',
'Prefer a push signal; otherwise use installWindowVisibilityInterval (renderer) or a timer that backs off and stops when idle.',
'Rewriting it as a self-rescheduling setTimeout at the same fixed cadence is the same bug; review will treat it so.',
`An interval whose cadence is the feature (a clock, a heartbeat with a stop) may raise the file's count in ${BASELINE_PATH} with reviewer sign-off.`
]
},
root,
arg
)
}
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
process.exit(main(process.cwd(), process.argv[2]))
}
@@ -0,0 +1,40 @@
import { describe, expect, it } from 'vitest'
import { countRecurringTimers } from './check-recurring-timer-ratchet.mjs'
describe('recurring-timer ratchet', () => {
it.each([
['setInterval(poll, 1000)', 1],
['window.setInterval(poll, 1)\nglobalThis.setInterval(poll, 1)\nobj.setInterval(1)', 2],
[
"import { setInterval } from 'node:timers'\nsetInterval(poll, 1)\nwindow.setInterval(poll, 1)",
2
],
["const { setInterval } = require('node:timers')\nsetInterval(poll, 1)", 1],
["import { setInterval as every } from 'node:timers/promises'\nevery(5000)", 1],
// Alias and destructure forms of an imported timer count once, like the direct call.
[
"import * as timers from 'node:timers'\nconst setInterval = timers.setInterval\nsetInterval(poll, 1)",
1
],
[
"const timers = require('node:timers')\nconst { setInterval } = timers\nsetInterval(poll, 1)",
1
],
["const { setInterval } = await import('node:timers')\nsetInterval(poll, 1)", 1],
// An unrelated local binding must not hide a global poll elsewhere in the file.
['function configure(setInterval) {\n return setInterval\n}\nsetInterval(poll, 1000)', 1],
['type Configure = (setInterval: number) => void\nsetInterval(poll, 1000)', 1],
['function a(setInterval) { setInterval(f) }\nfunction b() { setInterval(g, 1) }', 1],
['function setInterval(f) {}\nsetInterval(poll)', 0],
// Aliases and bracket access of the global timer are charged at the reference.
['const schedule = setInterval\nschedule(poll, 1000)', 1],
["window['setInterval'](poll, 1000)", 1],
['const every = window.setInterval\nevery(poll, 1)', 1],
["if (typeof setInterval === 'function') {}\ntype T = typeof setInterval", 0],
['const deps = { setInterval, clearInterval }\ndeps.setInterval(poll, 1)', 1],
["setInterval = replacement\nwindow['setInterval'] = replacement\ntypeof (setInterval)", 0],
['(window.setInterval ||= fallback)(poll, 1000)', 1]
])('counts %s', (source, count) => {
expect(countRecurringTimers('src/main/example.ts', source)).toBe(count)
})
})
@@ -92,7 +92,7 @@ const NODE_RUNTIME_INCLUDE = [
'src/**/*allocation*.test.ts',
'src/**/*expiry*.test.ts',
'src/shared/own-retained-string.test.ts',
'src/main/agent-hooks/server-transport-interference.test.ts',
'src/main/agent-hooks/server/testing/http/server-transport-interference.test.ts',
'src/main/plugins/workers/plugin-worker-supervision.integration.test.ts',
'src/main/plugins/workers/plugin-worker-dev-restart-storage.integration.test.ts',
// Worker TypeScript loads through node:module registerHooks, which Bun lacks.
@@ -123,12 +123,12 @@ const NODE_RUNTIME_INCLUDE = [
'src/main/browser/cookies/sources/browser-cookie-import-undecryptable.test.ts',
'src/main/browser/cookies/sources/browser-cookie-source-partition.test.ts',
// Playwright's CDP transport needs Node's WebSocket implementation.
'src/main/browser/guest-lifecycle/popups/browser-popup-adapter-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/popup-origin-chrome.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-adapter-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/presentation/popup-origin-chrome.electron.test.ts',
'src/main/browser/guest-lifecycle/navigation/browser-link-materialization.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/browser-popup-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/browser-popup-native-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/browser-popup-background-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-native-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-background-compatibility.electron.test.ts',
'src/main/ai-vault/scanners/devin/session-scanner-devin-db.test.ts',
'src/shared/workspace-session/workspace-session-salvage.test.ts',
'src/main/git/repo-detection.test.ts',
@@ -102,8 +102,8 @@ const CODEX_INDEX_HEAL_CONTRACT_PREFIXES = [
'src/main/codex/trust/identity/codex-trust-identity',
'src/main/codex/trust/toml/config-toml-hook-trust-',
'src/main/codex/configuration/toml/config-toml-key-path',
'src/main/agent-hooks/posix-hook-command',
'src/main/agent-hooks/hook-post-command',
'src/main/agent-hooks/installation/commands/posix-hook-command',
'src/main/agent-hooks/installation/scripts/hook-post-command',
'src/main/codex-cli/codex-read-only-app-server-args',
'src/main/agent-launch/trust/agent-trust-presets',
'src/main/codex/trust/toml/config-toml-trust',
@@ -126,14 +126,14 @@ export const WINDOWS_PACKAGE_PREFIXES = [
export const LINUX_PACKAGE_TESTS = [
'src/main/browser/cookies/browser-google-cookie-clear.electron.test.ts',
'config/scripts/desktop-distribution/runtime-verification/packaged-repository-input-exclusion.test.mjs',
'src/main/browser/guest-lifecycle/popups/popup-origin-chrome.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/presentation/popup-origin-chrome.electron.test.ts',
'src/main/browser/guest-lifecycle/navigation/browser-link-materialization.electron.test.ts',
'src/main/browser/client-pages/renderer/browser-client-page-renderer-lifecycle.electron.test.ts',
'src/main/persistence/profile-state/profile-state-writer-stall.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/browser-popup-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/browser-popup-adapter-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/browser-popup-native-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/browser-popup-background-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-adapter-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-native-compatibility.electron.test.ts',
'src/main/browser/guest-lifecycle/popups/compatibility/browser-popup-background-compatibility.electron.test.ts',
'src/main/browser/extensions/api-runtime/browser-extension-api.electron.test.ts',
'src/main/browser/extensions/profile-storage/browser-extension-persistence.electron.test.ts',
'src/main/browser/extensions/profile-sessions/browser-extension-lifecycle.electron.test.ts',
@@ -173,14 +173,14 @@ export const WINDOWS_BOUNDARY_TESTS = [
'src/shared/__tests__/process-host/windows-tree-kill-late-taskkill.win32.test.ts',
'src/shared/agent-launch/startup/omp-fresh-launch-cmd.win32.test.ts',
'src/shared/windows-batch-spawn.win32.test.ts',
'src/main/agent-hooks/windows-hook-payload-delivery.test.ts',
'src/main/agent-hooks/managed-hook-stdin-lifecycle.test.ts',
'src/main/agent-hooks/installation/commands/windows-hook-payload-delivery.test.ts',
'src/main/agent-hooks/installation/scripts/managed-hook-stdin-lifecycle.test.ts',
'src/main/jcode/hook-gate-script.test.ts',
'src/main/agent-hooks/windows-native-hook-exe-hosts.test.ts',
'src/main/agent-hooks/installation/commands/windows-native-hook-exe-hosts.test.ts',
'src/main/claude/windows-native-hook-registration.test.ts',
'src/main/agent-hooks/windows-cmd-hook-command-unicode.test.ts',
'src/main/agent-hooks/windows-batch-hook-launcher.test.ts',
'src/main/agent-hooks/windows-powershell-hook-launcher.test.ts',
'src/main/agent-hooks/installation/commands/windows-cmd-hook-command-unicode.test.ts',
'src/main/agent-hooks/installation/commands/windows-batch-hook-launcher.test.ts',
'src/main/agent-hooks/installation/commands/windows-powershell-hook-launcher.test.ts',
'src/main/claude/claude-status-line-windows.test.ts',
'src/main/codex/hooks/installation/windows-hook-command.test.ts',
'src/main/codex/hooks/installation/hook-service-managed-install.test.ts',
+2 -1
View File
@@ -23,7 +23,8 @@ const contracts = [
'config/scripts/static-analysis/oxlint-contracts/app-store-performance-plugin.test.mjs',
'config/scripts/static-analysis/oxlint-contracts/quadratic-buffer-concat-plugin.test.mjs',
'src/main/claude-usage/scanner-incremental-append.test.ts',
'src/main/claude-usage/store-checkpoint-persistence.test.ts'
'src/main/claude-usage/store-checkpoint-persistence.test.ts',
'src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.streaming-input.test.tsx'
]
for (const contract of contracts) {
if (!existsSync(resolve(contract))) {
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,101 @@
WITH
supporting_versions AS (
SELECT DISTINCT toString(properties.app_version) AS v
FROM events
WHERE event IN ('first_agent_interaction', 'meaningful_activity_day')
AND timestamp >= toDateTime('2026-11-08 00:00:00')
AND properties.install_id IS NOT NULL AND properties.orca_channel IS NOT NULL
),
opted_out AS (
SELECT distinct_id AS uid
FROM events
WHERE event = 'telemetry_opted_out'
AND timestamp >= toDateTime('2026-10-09 00:00:00')
AND properties.install_id IS NOT NULL AND properties.orca_channel IS NOT NULL
GROUP BY uid
),
anchors AS (
SELECT
distinct_id AS uid,
min(timestamp) AS anchor_at,
formatDateTime(min(timestamp), '%Y-%m-%d') AS cohort_day,
argMin(coalesce(toString(properties.platform), 'unknown'), timestamp) AS platform,
argMin(toString(properties.app_version), timestamp) AS anchor_version
FROM events
WHERE event = 'onboarding_started'
AND properties.cohort = 'fresh_install'
AND timestamp >= toDateTime('2026-10-09 00:00:00')
AND properties.install_id IS NOT NULL AND properties.orca_channel IS NOT NULL
GROUP BY uid
),
cohort AS (
SELECT uid, anchor_at, cohort_day, platform
FROM anchors
WHERE anchor_at >= toDateTime('2026-11-08 00:00:00')
AND anchor_version IN (SELECT v FROM supporting_versions)
AND uid NOT IN (SELECT uid FROM opted_out)
),
mature AS (
SELECT uid, anchor_at, platform FROM cohort
WHERE anchor_at <= now() - INTERVAL 1455 MINUTE
),
surface AS (
SELECT m.uid AS uid, 1 AS has_surface, min(e.timestamp) AS surface_at
FROM events e
INNER JOIN mature m ON m.uid = e.distinct_id
WHERE e.timestamp >= toDateTime('2026-11-08 00:00:00')
AND e.timestamp >= m.anchor_at
AND e.timestamp < m.anchor_at + INTERVAL 24 HOUR
AND e.properties.orca_channel IS NOT NULL
AND (
e.event = 'workspace_created'
OR (e.event = 'add_repo_setup_step_action'
AND toString(e.properties.action) IN ('open_existing', 'open_primary', 'create_worktree'))
OR (e.event = 'add_repo_default_checkout_handoff'
AND toString(e.properties.result) = 'opened_default_checkout')
OR (e.event = 'repo_added' AND toString(e.properties.is_git_repo) = 'false')
)
GROUP BY m.uid
),
interaction AS (
SELECT
distinct_id AS uid,
1 AS has_interaction,
min(timestamp) AS fai_at,
argMin(coalesce(toString(properties.install_cohort), 'unknown'), timestamp) AS fai_cohort,
argMin(coalesce(toString(properties.source), 'unknown'), timestamp) AS fai_source
FROM events
WHERE event = 'first_agent_interaction'
AND timestamp >= toDateTime('2026-11-08 00:00:00')
AND properties.install_id IS NOT NULL AND properties.orca_channel IS NOT NULL
GROUP BY uid
),
per_install AS (
SELECT
m.platform AS platform,
s.has_surface = 1 AS surface_24h,
i.has_interaction = 1 AND i.fai_cohort = 'fresh'
AND i.fai_at >= m.anchor_at AND i.fai_at < m.anchor_at + INTERVAL 24 HOUR AS interaction_24h,
i.has_interaction = 1 AND i.fai_cohort = 'fresh' AND s.has_surface = 1
AND i.fai_at >= s.surface_at AND i.fai_at < m.anchor_at + INTERVAL 24 HOUR AS interaction_after_surface_24h,
i.has_interaction = 1 AND i.fai_cohort != 'fresh' AS install_cohort_mismatch,
if(interaction_24h, i.fai_source, 'none') AS first_source
FROM mature m
LEFT JOIN surface s ON s.uid = m.uid
LEFT JOIN interaction i ON i.uid = m.uid
)
SELECT
if(grouping(platform) = 1, 'all', platform) AS platform_group,
count() AS fresh_starters_complete_24h,
countIf(surface_24h) AS workspace_available_24h,
round(100.0 * workspace_available_24h / nullIf(fresh_starters_complete_24h, 0), 1) AS workspace_available_pct,
countIf(interaction_24h) AS first_interaction_24h,
round(100.0 * first_interaction_24h / nullIf(fresh_starters_complete_24h, 0), 1) AS first_interaction_pct,
countIf(interaction_24h AND first_source IN ('orca_send', 'native_chat', 'mobile_chat')) AS first_interaction_attributed_24h,
countIf(interaction_24h AND first_source = 'unattributed_prompt') AS first_interaction_unattributed_24h,
countIf(interaction_24h AND first_source NOT IN ('orca_send', 'native_chat', 'mobile_chat', 'unattributed_prompt')) AS first_interaction_unknown_source_24h,
countIf(interaction_after_surface_24h) AS interaction_after_workspace_24h,
countIf(install_cohort_mismatch) AS install_cohort_mismatch
FROM per_install
GROUP BY ROLLUP(platform)
ORDER BY platform_group
@@ -0,0 +1,101 @@
WITH
supporting_versions AS (
SELECT DISTINCT toString(properties.app_version) AS v
FROM events
WHERE event IN ('first_agent_interaction', 'meaningful_activity_day')
AND timestamp >= toDateTime('2026-11-08 00:00:00')
AND properties.install_id IS NOT NULL AND properties.orca_channel IS NOT NULL
),
opted_out AS (
SELECT distinct_id AS uid
FROM events
WHERE event = 'telemetry_opted_out'
AND timestamp >= toDateTime('2026-10-09 00:00:00')
AND properties.install_id IS NOT NULL AND properties.orca_channel IS NOT NULL
GROUP BY uid
),
anchors AS (
SELECT
distinct_id AS uid,
min(timestamp) AS anchor_at,
formatDateTime(min(timestamp), '%Y-%m-%d') AS cohort_day,
argMin(coalesce(toString(properties.platform), 'unknown'), timestamp) AS platform,
argMin(toString(properties.app_version), timestamp) AS anchor_version
FROM events
WHERE event = 'onboarding_started'
AND properties.cohort = 'fresh_install'
AND timestamp >= toDateTime('2026-10-09 00:00:00')
AND properties.install_id IS NOT NULL AND properties.orca_channel IS NOT NULL
GROUP BY uid
),
cohort AS (
SELECT uid, anchor_at, cohort_day, platform
FROM anchors
WHERE anchor_at >= toDateTime('2026-11-08 00:00:00')
AND anchor_version IN (SELECT v FROM supporting_versions)
AND uid NOT IN (SELECT uid FROM opted_out)
),
mature AS (
SELECT uid, anchor_at, platform FROM cohort
WHERE anchor_at <= now() - INTERVAL 10095 MINUTE
),
surface AS (
SELECT m.uid AS uid, 1 AS has_surface, min(e.timestamp) AS surface_at
FROM events e
INNER JOIN mature m ON m.uid = e.distinct_id
WHERE e.timestamp >= toDateTime('2026-11-08 00:00:00')
AND e.timestamp >= m.anchor_at
AND e.timestamp < m.anchor_at + INTERVAL 168 HOUR
AND e.properties.orca_channel IS NOT NULL
AND (
e.event = 'workspace_created'
OR (e.event = 'add_repo_setup_step_action'
AND toString(e.properties.action) IN ('open_existing', 'open_primary', 'create_worktree'))
OR (e.event = 'add_repo_default_checkout_handoff'
AND toString(e.properties.result) = 'opened_default_checkout')
OR (e.event = 'repo_added' AND toString(e.properties.is_git_repo) = 'false')
)
GROUP BY m.uid
),
interaction AS (
SELECT
distinct_id AS uid,
1 AS has_interaction,
min(timestamp) AS fai_at,
argMin(coalesce(toString(properties.install_cohort), 'unknown'), timestamp) AS fai_cohort,
argMin(coalesce(toString(properties.source), 'unknown'), timestamp) AS fai_source
FROM events
WHERE event = 'first_agent_interaction'
AND timestamp >= toDateTime('2026-11-08 00:00:00')
AND properties.install_id IS NOT NULL AND properties.orca_channel IS NOT NULL
GROUP BY uid
),
per_install AS (
SELECT
m.platform AS platform,
s.has_surface = 1 AS surface_7d,
i.has_interaction = 1 AND i.fai_cohort = 'fresh'
AND i.fai_at >= m.anchor_at AND i.fai_at < m.anchor_at + INTERVAL 168 HOUR AS interaction_7d,
i.has_interaction = 1 AND i.fai_cohort = 'fresh' AND s.has_surface = 1
AND i.fai_at >= s.surface_at AND i.fai_at < m.anchor_at + INTERVAL 168 HOUR AS interaction_after_surface_7d,
i.has_interaction = 1 AND i.fai_cohort != 'fresh' AS install_cohort_mismatch,
if(interaction_7d, i.fai_source, 'none') AS first_source
FROM mature m
LEFT JOIN surface s ON s.uid = m.uid
LEFT JOIN interaction i ON i.uid = m.uid
)
SELECT
if(grouping(platform) = 1, 'all', platform) AS platform_group,
count() AS fresh_starters_complete_7d,
countIf(surface_7d) AS workspace_available_7d,
round(100.0 * workspace_available_7d / nullIf(fresh_starters_complete_7d, 0), 1) AS workspace_available_pct,
countIf(interaction_7d) AS first_interaction_7d,
round(100.0 * first_interaction_7d / nullIf(fresh_starters_complete_7d, 0), 1) AS first_interaction_pct,
countIf(interaction_7d AND first_source IN ('orca_send', 'native_chat', 'mobile_chat')) AS first_interaction_attributed_7d,
countIf(interaction_7d AND first_source = 'unattributed_prompt') AS first_interaction_unattributed_7d,
countIf(interaction_7d AND first_source NOT IN ('orca_send', 'native_chat', 'mobile_chat', 'unattributed_prompt')) AS first_interaction_unknown_source_7d,
countIf(interaction_after_surface_7d) AS interaction_after_workspace_7d,
countIf(install_cohort_mismatch) AS install_cohort_mismatch
FROM per_install
GROUP BY ROLLUP(platform)
ORDER BY platform_group
@@ -0,0 +1,21 @@
SELECT
event,
min(timestamp) AS first_seen_utc,
argMin(toString(properties.app_version), timestamp) AS first_seen_version,
argMin(toString(properties.orca_channel), timestamp) AS first_seen_channel,
uniq(toString(properties.app_version)) AS versions,
count() AS events,
uniq(distinct_id) AS installs,
count() - uniq(tuple(distinct_id, if(event = 'meaningful_activity_day', formatDateTime(timestamp, '%Y-%m-%d'), ''))) AS duplicate_events,
countIf(properties.sample_rate IS NOT NULL) AS events_with_sample_rate,
countIf(if(event = 'first_agent_interaction', properties.source, properties.trigger) IS NULL) AS missing_source_or_trigger,
countIf(properties.install_cohort IS NULL) AS missing_install_cohort,
groupUniqArray(toString(if(event = 'first_agent_interaction', properties.source, properties.trigger))) AS source_or_trigger_values,
groupUniqArray(toString(properties.agent_kind)) AS agent_kind_values,
groupUniqArray(toString(properties.install_cohort)) AS install_cohort_values,
groupUniqArray(coalesce(toString(properties.platform), 'unknown')) AS platforms
FROM events
WHERE event IN ('first_agent_interaction', 'meaningful_activity_day')
AND timestamp >= toDateTime('2026-11-08 00:00:00')
AND properties.install_id IS NOT NULL AND properties.orca_channel IS NOT NULL
GROUP BY event
@@ -0,0 +1,15 @@
SELECT
formatDateTime(timestamp, '%Y-%m-%d') AS day,
uniqIf(distinct_id, event = 'meaningful_activity_day') AS meaningful_installs,
uniqIf(distinct_id, event = 'meaningful_activity_day' AND toString(properties.install_cohort) = 'fresh') AS meaningful_fresh_installs,
uniqIf(distinct_id, event = 'app_opened' AND toString(properties.app_version) IN (
SELECT DISTINCT toString(properties.app_version) FROM events
WHERE event = 'meaningful_activity_day' AND timestamp >= toDateTime('2026-11-08 00:00:00')
)) AS launched_installs_on_supporting_builds
FROM events
WHERE event IN ('meaningful_activity_day', 'app_opened')
AND timestamp >= toDateTime('2026-11-08 00:00:00')
AND timestamp < toDateTime(formatDateTime(now(), '%Y-%m-%d 00:00:00'))
AND properties.install_id IS NOT NULL AND properties.orca_channel IS NOT NULL
GROUP BY day
ORDER BY day
@@ -0,0 +1,32 @@
WITH
supporting_versions AS (
SELECT DISTINCT toString(properties.app_version) AS v
FROM events
WHERE event IN ('first_agent_interaction', 'meaningful_activity_day')
AND timestamp >= toDateTime('2026-11-08 00:00:00')
AND properties.install_id IS NOT NULL AND properties.orca_channel IS NOT NULL
),
anchors AS (
SELECT
distinct_id AS uid,
min(timestamp) AS anchor_at,
formatDateTime(min(timestamp), '%Y-%m-%d') AS cohort_day,
argMin(coalesce(toString(properties.platform), 'unknown'), timestamp) AS platform,
argMin(toString(properties.app_version), timestamp) AS anchor_version
FROM events
WHERE event = 'onboarding_started'
AND properties.cohort = 'fresh_install'
AND timestamp >= toDateTime('2026-10-09 00:00:00')
AND properties.install_id IS NOT NULL AND properties.orca_channel IS NOT NULL
GROUP BY uid
)
SELECT
cohort_day,
platform,
count() AS fresh_anchors,
countIf(anchor_version IN (SELECT v FROM supporting_versions)) AS on_supporting_build,
round(100.0 * on_supporting_build / nullIf(fresh_anchors, 0), 1) AS supporting_pct
FROM anchors
WHERE anchor_at >= toDateTime('2026-11-01 00:00:00')
GROUP BY cohort_day, platform
ORDER BY cohort_day, platform
@@ -0,0 +1,93 @@
WITH
supporting_versions AS (
SELECT DISTINCT toString(properties.app_version) AS v
FROM events
WHERE event IN ('first_agent_interaction', 'meaningful_activity_day')
AND timestamp >= toDateTime('2026-11-08 00:00:00')
AND properties.install_id IS NOT NULL AND properties.orca_channel IS NOT NULL
),
opted_out AS (
SELECT distinct_id AS uid
FROM events
WHERE event = 'telemetry_opted_out'
AND timestamp >= toDateTime('2026-10-09 00:00:00')
AND properties.install_id IS NOT NULL AND properties.orca_channel IS NOT NULL
GROUP BY uid
),
anchors AS (
SELECT
distinct_id AS uid,
min(timestamp) AS anchor_at,
formatDateTime(min(timestamp), '%Y-%m-%d') AS cohort_day,
argMin(coalesce(toString(properties.platform), 'unknown'), timestamp) AS platform,
argMin(toString(properties.app_version), timestamp) AS anchor_version
FROM events
WHERE event = 'onboarding_started'
AND properties.cohort = 'fresh_install'
AND timestamp >= toDateTime('2026-10-09 00:00:00')
AND properties.install_id IS NOT NULL AND properties.orca_channel IS NOT NULL
GROUP BY uid
),
cohort AS (
SELECT uid, anchor_at, cohort_day, platform
FROM anchors
WHERE anchor_at >= toDateTime('2026-11-08 00:00:00')
AND anchor_version IN (SELECT v FROM supporting_versions)
AND uid NOT IN (SELECT uid FROM opted_out)
),
last_complete AS (
SELECT formatDateTime(now() - INTERVAL 1455 MINUTE, '%Y-%m-%d') AS day
),
activity_days AS (
SELECT
c.uid AS uid,
dateDiff('day', toDate(c.cohort_day), toDate(formatDateTime(e.timestamp, '%Y-%m-%d'))) AS day_n,
countIf(e.event = 'meaningful_activity_day') > 0 AS meaningful,
countIf(e.event = 'app_opened') > 0 AS launched
FROM events e
INNER JOIN cohort c ON c.uid = e.distinct_id
WHERE e.event IN ('meaningful_activity_day', 'app_opened')
AND e.timestamp >= toDateTime('2026-11-08 00:00:00')
AND e.timestamp > c.anchor_at
AND e.properties.orca_channel IS NOT NULL
GROUP BY uid, day_n
),
per_install AS (
SELECT
c.uid AS uid,
c.platform AS platform,
dateDiff('day', toDate(c.cohort_day), toDate((SELECT day FROM last_complete))) AS mature_days,
countIf(d.day_n = 1 AND d.meaningful) > 0 AS m_d1,
countIf(d.day_n BETWEEN 1 AND 3 AND d.meaningful) > 0 AS m_d3,
countIf(d.day_n BETWEEN 1 AND 7 AND d.meaningful) > 0 AS m_d7,
countIf(d.day_n BETWEEN 8 AND 14 AND d.meaningful) > 0 AS m_w2,
countIf(d.day_n BETWEEN 24 AND 30 AND d.meaningful) > 0 AS m_d30w,
countIf(d.day_n = 1 AND d.launched) > 0 AS l_d1,
countIf(d.day_n BETWEEN 1 AND 3 AND d.launched) > 0 AS l_d3,
countIf(d.day_n BETWEEN 1 AND 7 AND d.launched) > 0 AS l_d7,
countIf(d.day_n BETWEEN 8 AND 14 AND d.launched) > 0 AS l_w2,
countIf(d.day_n BETWEEN 24 AND 30 AND d.launched) > 0 AS l_d30w
FROM cohort c
LEFT JOIN activity_days d ON d.uid = c.uid
GROUP BY c.uid, c.cohort_day, c.platform
)
SELECT
platform_group,
['D1 (day 1)', 'D3 (days 1-3)', 'D7 (days 1-7)', '2-week (days 8-14)', '30-day (days 24-30)'][wi] AS window_label,
[1, 3, 7, 14, 30][wi] AS window_end_day,
countIf(mature_days >= [1, 3, 7, 14, 30][wi]) AS eligible_installs,
countIf(mature_days >= [1, 3, 7, 14, 30][wi] AND meaningful_flags[wi]) AS meaningful_returned,
round(100.0 * meaningful_returned / nullIf(eligible_installs, 0), 1) AS meaningful_pct,
countIf(mature_days >= [1, 3, 7, 14, 30][wi] AND launch_flags[wi]) AS launch_returned,
round(100.0 * launch_returned / nullIf(eligible_installs, 0), 1) AS launch_pct
FROM (
SELECT
arrayJoin([platform, 'all']) AS platform_group,
arrayJoin([1, 2, 3, 4, 5]) AS wi,
mature_days,
[m_d1, m_d3, m_d7, m_w2, m_d30w] AS meaningful_flags,
[l_d1, l_d3, l_d7, l_w2, l_d30w] AS launch_flags
FROM per_install
)
GROUP BY platform_group, wi
ORDER BY wi, platform_group
@@ -0,0 +1,17 @@
# Remote accepted prompt observations
The committed journal acceptance observer in `native-chat-prompt-submissions.ts` owns the evidence. A fresh personal send from a transport-proven desktop or phone retains its device class and consent-owning desktop in memory until provider acceptance. Queue conversion keeps the original draft's provenance. Reservation, handover, rejected sends, withdrawn drafts, conversation commands, unattended sends and operation replay do not emit an accepted prompt observation.
A paired desktop owner always receives its observation through the existing live structured-chat relay on `runtime.clientEvents.subscribe`, even when the execution host also has initialized desktop telemetry. That host's installation and consent do not own the paired desktop's activity. Only sends without a paired desktop owner, such as the local desktop or its directly paired phone, use the host's initialized telemetry client; disabled consent drops them without a relay fallback. The additive `structured-chat-prompt-telemetry-v1` capability isolates the new event from older readers; older hosts simply omit it. Prompt delivery and journal storage are unchanged.
The event contains only `type`, a fresh observation UUID, `agent_kind` and `client` (`desktop` or `mobile`). No prompt text, session/message/request identifiers, paths, fingerprints, timestamps or device identifiers cross this observation channel. The owner routing key stays on the host: a paired desktop uses its authenticated device ID, and a delegated phone uses its authenticated parent desktop ID. Only an authenticated runtime desktop stream with that owner and the new capability receives the event. Another desktop, a phone stream, the CLI or a declared client without proven identity cannot receive it. A phone paired directly to the local desktop follows the existing local telemetry path.
Both shared-control and one-shot subscription transports use the same desktop-main subscription decoder. The decoder checks the current transport generation, strictly validates the event and deduplicates its UUID before calling the consent-owning telemetry client with `runtime: remote`. It never forwards accepted observations to the renderer. The UUID is not an analytics property. The existing protected milestone admission preserves first-interaction/day ordering, installation attribution, consent and sampling behavior. UUID deduplication retains the newest 1,024 observations across desktop subscriptions; the existing per-install milestone cursor provides additional milestone deduplication.
## Deliberate undercount limits
- The relay is live and best effort, matching the existing agent-start observation channel. Provider acceptance while the desktop is disconnected or before its event stream opens is missed. Reconnect registers a new listener and does not backfill historical acceptance, retry prompt delivery or infer success from send receipts. Desktop restart also clears received UUIDs, but the host does not replay observations.
- Pending prompt provenance is keyed by the live journal object and capped at 256 entries per journal. Host restart or journal replacement loses it. A queued draft or an unaccepted submission persisted before restart may later be accepted without earning a milestone; operation replay and history reads cannot restore its provenance. Older pending entries evicted at the cap also undercount.
- Persisting provenance or recovering disconnected acceptance would require a separate design for durable owner identity, acceptance ordering, retention, consent changes and reader compatibility. This change deliberately adds no outbox, journal annotation or history-derived inference. A later fresh, proven send can still earn the missing milestone.
These limits prefer missing an observation over attributing automation, replay or an unproven user action to an installation.
+4 -4
View File
@@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="113" height="20" role="img" aria-label="downloads: 159m">
<title>downloads: 159m</title>
<svg xmlns="http://www.w3.org/2000/svg" width="113" height="20" role="img" aria-label="downloads: 160m">
<title>downloads: 160m</title>
<linearGradient id="s" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
@@ -15,7 +15,7 @@
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="11">
<text x="37" y="15" fill="#010101" fill-opacity=".3">downloads</text>
<text x="37" y="14">downloads</text>
<text x="93.5" y="15" fill="#010101" fill-opacity=".3">159m</text>
<text x="93.5" y="14">159m</text>
<text x="93.5" y="15" fill="#010101" fill-opacity=".3">160m</text>
<text x="93.5" y="14">160m</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 943 B

After

Width:  |  Height:  |  Size: 943 B

+11
View File
@@ -217,6 +217,17 @@ orca-ide serve --pairing-address 100.64.1.20
This only stops Orca from turning the GPU off. Chromium may still render in software on Orca's own Xvfb, which has no GPU of its own; open `chrome://gpu` in a browser pane to check, and point `DISPLAY` at a GPU-backed X server if it reports software rendering. If you installed the server with `orca serve service install`, add the variable to the service unit yourself. If the server stops starting or browser panes crash with it set, unset it to go back to software rendering.
### Copies of a machine image
Copies of a machine image share the server identity: the pairing key, the paired devices, and the installation id. Revoking a device on one copy leaves it working on the others, and the desktop app treats all copies as one server. Set `ORCA_INSTANCE_ID` per instance (for example the cloud-init instance id) in the environment that starts `orca serve`, or run `orca serve reset-identity` on each copy.
- With `ORCA_INSTANCE_ID` set, Orca records the value with the server identity. If a later start sees a different value, Orca creates a new identity and removes all paired devices on that copy, so clients pair with it again.
- The first value Orca sees on an existing server is only recorded, so setting the variable later keeps existing pairings. Use a value that stays the same across restarts of one instance; a value that changes on every boot forces a new pairing each time.
- When `ORCA_INSTANCE_ID` is not set, Orca never changes the identity on its own.
- If Orca cannot write the new identity (for example on a full or read-only disk), it keeps serving the current one unchanged, logs an error, and tries again on the next start.
- `orca serve reset-identity` does the same reset on demand. Stop Orca on that machine first; the command asks for confirmation, or pass `--yes`.
- Each reset moves the replaced files into a new folder under `orca-identity-backups` in the Orca data directory (the five most recent are kept). To undo an unwanted reset, stop Orca and copy the files from that folder back into the data directory.
### Mobile from a headless server
For the Orca mobile app, request a mobile-scoped QR code and link:
+1
View File
@@ -23,6 +23,7 @@ The categories of behavior we observe:
- **Agent Dashboard** — when the board opens and whether it is visible during a UTC day, labeled as in-window or pop-out. Visible-use observations are limited to one per day per surface across app restarts, so a board left visible across days is counted each day. Hidden or minimized windows pause these observations. This measures visible-use days, not time spent or human attention; no card or agent contents are included.
- **Repos and workspaces** — when you add a repo or create a workspace. We record _how_ you did it (e.g. folder picker vs. clone URL; command palette vs. drag-and-drop), never the repo name, URL, path, branch name, or any free-form text. For a workspace create we also record how long it took and how that time split across its steps, whether a checkout Orca had prepared in advance was reused (and if so, what reset it needed, what prepared it, how long it took to prepare and how long it waited unused; if not, a fixed reason code), for a failed create which step it stopped in, plus coarse context: whether it came from the Orca window or from the CLI, phone or agent interface, whether Git ran locally, in WSL or over SSH, a bucketed worktree count, a bucketed count of the files the repo tracks, how many other creates and prepared-checkout jobs were running, and whether the repo has a post-checkout hook (never its contents).
- **Agents** — which agents you use and their token counts. Never prompts or agent output.
- **Activation and active days** — once per install profile, that a first prompt or message to an agent was observed (which agent kind and which surface: an Orca send, chat, the phone, or a prompt seen by agent hooks), and at most once per UTC day, that you took an explicit action such as launching an agent, sending a message, creating a workspace, or typing in a terminal (only which kind of action came first). Whether the profile was new when this was first recorded is included. Never the prompt, message, or anything typed.
- **Agent errors** — a coarse error category and which agent kind was involved. We never see raw error messages or stack traces; per-incident detail stays in a local diagnostic trace file on your machine and only reaches Orca if you explicitly share a diagnostic bundle.
- **Settings** — when you toggle one of a small whitelisted set of feature-flag or UX preferences. We record which preference changed and whether it's a boolean or an enum, never the raw value of any free-form setting.
- **Tab actions** — for a consistent 10% sample of anonymous installs, the first time per app session you choose “Close Tabs To The Left” or “Close Tabs To The Right,” limited to two events per session across all windows. For that first request in each direction, we record the selected tab's type, whether it is in a workspace or floating panel, how many unpinned tabs are eligible to close, and the sampling rate. The app-open event includes sample membership so we can measure the share of sampled sessions that use each command. Repeat requests are not recorded, so these events do not measure click frequency, overall usage by tab type or panel, or total tabs closed. This counts the request, including when you cancel a save prompt; never tab titles, file paths, or workspace identifiers.
@@ -4,6 +4,11 @@
"family": "aiVault.history",
"namedDeltas": [],
"values": {
"2182656920b3": {
"name": "aiVault.listSessions#1",
"ordinal": 5,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}"
},
"44a27dbf05e2": {
"name": "status.get#1",
"ordinal": 3,
@@ -30,39 +35,7 @@
]
}
},
"7e8b2964ad63": {
"name": "streams-registered-at-teardown",
"ordinal": 8,
"value": [
{
"cancelled": false,
"method": "agentSession.subscribeStatus",
"payload": "agentSession.subscribeStatus#1"
}
]
},
"7f300f2af8fd": {
"name": "aiVault.listSessions#2",
"ordinal": 7,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}"
},
"98ac9d409279": {
"activeWorktreePath": "/repo/feature",
"refreshing": false,
"scope": "workspace",
"screenState": {
"issues": [],
"kind": "ready",
"sessions": [
{
"agent": "pi",
"cwd": "/repo/feature",
"id": "s1"
}
]
}
},
"ad5b1230fc26": {
"69310cf221d2": {
"name": "aiVault.listSessions#2",
"ordinal": 6,
"args": [
@@ -75,6 +48,7 @@
"value": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
@@ -109,10 +83,81 @@
}
}
},
"b6a16cc83e18": {
"7a3238411452": {
"name": "aiVault.listSessions#2",
"ordinal": 7,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}"
},
"7bdbee10feca": {
"name": "aiVault.listSessions#1",
"ordinal": 5,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}"
"ordinal": 4,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": {
"issues": [],
"sessions": [
{
"agent": "pi",
"cwd": "/repo/feature",
"id": "s1"
}
]
}
}
}
},
"7e8b2964ad63": {
"name": "streams-registered-at-teardown",
"ordinal": 8,
"value": [
{
"cancelled": false,
"method": "agentSession.subscribeStatus",
"payload": "agentSession.subscribeStatus#1"
}
]
},
"98ac9d409279": {
"activeWorktreePath": "/repo/feature",
"refreshing": false,
"scope": "workspace",
"screenState": {
"issues": [],
"kind": "ready",
"sessions": [
{
"agent": "pi",
"cwd": "/repo/feature",
"id": "s1"
}
]
}
},
"daf52dc85a58": {
"name": "status.get#1",
@@ -160,49 +205,6 @@
"value": {
"$rpc": "undefined"
}
},
"f562eb25b111": {
"name": "aiVault.listSessions#1",
"ordinal": 4,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": {
"issues": [],
"sessions": [
{
"agent": "pi",
"cwd": "/repo/feature",
"id": "s1"
}
]
}
}
}
}
},
"recording": {
@@ -211,8 +213,8 @@
{
"id": "ready",
"observation": {
"sender": ["daf52dc85a58", "f562eb25b111"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"],
"sender": ["daf52dc85a58", "7bdbee10feca"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -223,8 +225,8 @@
{
"id": "associated",
"observation": {
"sender": ["daf52dc85a58", "f562eb25b111", "ad5b1230fc26"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "7f300f2af8fd"],
"sender": ["daf52dc85a58", "7bdbee10feca", "69310cf221d2"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "7a3238411452"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -235,8 +237,8 @@
{
"id": "cleanup",
"observation": {
"sender": ["daf52dc85a58", "f562eb25b111", "ad5b1230fc26"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "7f300f2af8fd"],
"sender": ["daf52dc85a58", "7bdbee10feca", "69310cf221d2"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "7a3238411452"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -4,6 +4,55 @@
"family": "aiVault.history",
"namedDeltas": [],
"values": {
"03fd6edde488": {
"name": "aiVault.listSessions#1",
"ordinal": 4,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": {
"issues": [],
"sessions": [
{
"agent": "claude",
"cwd": "/repo/feature",
"id": "s1"
}
]
}
}
}
},
"2182656920b3": {
"name": "aiVault.listSessions#1",
"ordinal": 5,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}"
},
"44a27dbf05e2": {
"name": "status.get#1",
"ordinal": 3,
@@ -36,54 +85,6 @@
]
}
},
"b6a16cc83e18": {
"name": "aiVault.listSessions#1",
"ordinal": 5,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}"
},
"cb5715e0f275": {
"name": "aiVault.listSessions#1",
"ordinal": 4,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": {
"issues": [],
"sessions": [
{
"agent": "claude",
"cwd": "/repo/feature",
"id": "s1"
}
]
}
}
}
},
"daf52dc85a58": {
"name": "status.get#1",
"ordinal": 2,
@@ -138,8 +139,8 @@
{
"id": "ready",
"observation": {
"sender": ["daf52dc85a58", "cb5715e0f275"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"],
"sender": ["daf52dc85a58", "03fd6edde488"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -150,8 +151,8 @@
{
"id": "cleanup",
"observation": {
"sender": ["daf52dc85a58", "cb5715e0f275"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"],
"sender": ["daf52dc85a58", "03fd6edde488"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -4,14 +4,9 @@
"family": "aiVault.history",
"namedDeltas": [],
"values": {
"33f381559396": {
"name": "aiVault.listSessions#2",
"ordinal": 7,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":true,\"scopePaths\":[\"/repo/feature\"]}}"
},
"3f412a6bee67": {
"name": "aiVault.listSessions#2",
"ordinal": 6,
"03fd6edde488": {
"name": "aiVault.listSessions#1",
"ordinal": 4,
"args": [
{
"name": "method",
@@ -20,8 +15,9 @@
{
"name": "params",
"value": {
"force": true,
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
@@ -37,7 +33,7 @@
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-4",
"id": "frame-3",
"ok": true,
"result": {
"issues": [],
@@ -45,13 +41,23 @@
{
"agent": "claude",
"cwd": "/repo/feature",
"id": "s2"
"id": "s1"
}
]
}
}
}
},
"2182656920b3": {
"name": "aiVault.listSessions#1",
"ordinal": 5,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}"
},
"422563aac194": {
"name": "aiVault.listSessions#2",
"ordinal": 7,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":true,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}"
},
"44a27dbf05e2": {
"name": "status.get#1",
"ordinal": 3,
@@ -84,14 +90,9 @@
]
}
},
"b6a16cc83e18": {
"name": "aiVault.listSessions#1",
"ordinal": 5,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}"
},
"cb5715e0f275": {
"name": "aiVault.listSessions#1",
"ordinal": 4,
"c23f94d5e35f": {
"name": "aiVault.listSessions#2",
"ordinal": 6,
"args": [
{
"name": "method",
@@ -100,8 +101,9 @@
{
"name": "params",
"value": {
"force": false,
"force": true,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
@@ -117,7 +119,7 @@
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"id": "frame-4",
"ok": true,
"result": {
"issues": [],
@@ -125,7 +127,7 @@
{
"agent": "claude",
"cwd": "/repo/feature",
"id": "s1"
"id": "s2"
}
]
}
@@ -202,8 +204,8 @@
{
"id": "ready",
"observation": {
"sender": ["daf52dc85a58", "cb5715e0f275"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"],
"sender": ["daf52dc85a58", "03fd6edde488"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -214,8 +216,8 @@
{
"id": "refreshed",
"observation": {
"sender": ["daf52dc85a58", "cb5715e0f275", "3f412a6bee67"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "33f381559396"],
"sender": ["daf52dc85a58", "03fd6edde488", "c23f94d5e35f"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "422563aac194"],
"settlements": {
"mount": "eb79a9b3682a",
"refresh": "eb79a9b3682a"
@@ -227,8 +229,8 @@
{
"id": "cleanup",
"observation": {
"sender": ["daf52dc85a58", "cb5715e0f275", "3f412a6bee67"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "33f381559396"],
"sender": ["daf52dc85a58", "03fd6edde488", "c23f94d5e35f"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "422563aac194"],
"settlements": {
"mount": "eb79a9b3682a",
"refresh": "eb79a9b3682a"
@@ -4,11 +4,94 @@
"family": "aiVault.history",
"namedDeltas": [],
"values": {
"03fd6edde488": {
"name": "aiVault.listSessions#1",
"ordinal": 4,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": {
"issues": [],
"sessions": [
{
"agent": "claude",
"cwd": "/repo/feature",
"id": "s1"
}
]
}
}
}
},
"2182656920b3": {
"name": "aiVault.listSessions#1",
"ordinal": 5,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}"
},
"44a27dbf05e2": {
"name": "status.get#1",
"ordinal": 3,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"status.get\"}"
},
"74067e8858fa": {
"name": "aiVault.listSessions#2",
"ordinal": 6,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 31000
}
},
"7a3238411452": {
"name": "aiVault.listSessions#2",
"ordinal": 7,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}"
},
"7e8b2964ad63": {
"name": "streams-registered-at-teardown",
"ordinal": 8,
@@ -20,11 +103,6 @@
}
]
},
"7f300f2af8fd": {
"name": "aiVault.listSessions#2",
"ordinal": 7,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}"
},
"9aa0df31dc4d": {
"activeWorktreePath": "/repo/feature",
"refreshing": false,
@@ -62,11 +140,6 @@
]
}
},
"b6a16cc83e18": {
"name": "aiVault.listSessions#1",
"ordinal": 5,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}"
},
"c61a146bd377": {
"status": "fulfilled",
"startedAt": 31000,
@@ -75,50 +148,7 @@
"$rpc": "undefined"
}
},
"cb5715e0f275": {
"name": "aiVault.listSessions#1",
"ordinal": 4,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": {
"issues": [],
"sessions": [
{
"agent": "claude",
"cwd": "/repo/feature",
"id": "s1"
}
]
}
}
}
},
"d3637311be53": {
"c6add689704f": {
"name": "aiVault.listSessions#2",
"ordinal": 6,
"args": [
@@ -131,6 +161,7 @@
"value": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
@@ -205,34 +236,6 @@
"ordinal": 1,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"agentSession.subscribeStatus\",\"params\":{}}"
},
"e702c32cb3d5": {
"name": "aiVault.listSessions#2",
"ordinal": 6,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 31000
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
@@ -248,8 +251,8 @@
{
"id": "ready",
"observation": {
"sender": ["daf52dc85a58", "cb5715e0f275"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"],
"sender": ["daf52dc85a58", "03fd6edde488"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -260,8 +263,8 @@
{
"id": "cached",
"observation": {
"sender": ["daf52dc85a58", "cb5715e0f275", "e702c32cb3d5"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "7f300f2af8fd"],
"sender": ["daf52dc85a58", "03fd6edde488", "74067e8858fa"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "7a3238411452"],
"settlements": {
"mount": "eb79a9b3682a",
"leave": "eb79a9b3682a",
@@ -274,8 +277,8 @@
{
"id": "revalidated",
"observation": {
"sender": ["daf52dc85a58", "cb5715e0f275", "d3637311be53"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "7f300f2af8fd"],
"sender": ["daf52dc85a58", "03fd6edde488", "c6add689704f"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "7a3238411452"],
"settlements": {
"mount": "eb79a9b3682a",
"leave": "eb79a9b3682a",
@@ -288,8 +291,8 @@
{
"id": "cleanup",
"observation": {
"sender": ["daf52dc85a58", "cb5715e0f275", "d3637311be53"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "7f300f2af8fd"],
"sender": ["daf52dc85a58", "03fd6edde488", "c6add689704f"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "7a3238411452"],
"settlements": {
"mount": "eb79a9b3682a",
"leave": "eb79a9b3682a",
@@ -4,6 +4,55 @@
"family": "aiVault.history",
"namedDeltas": [],
"values": {
"03fd6edde488": {
"name": "aiVault.listSessions#1",
"ordinal": 4,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": {
"issues": [],
"sessions": [
{
"agent": "claude",
"cwd": "/repo/feature",
"id": "s1"
}
]
}
}
}
},
"2182656920b3": {
"name": "aiVault.listSessions#1",
"ordinal": 5,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}"
},
"44a27dbf05e2": {
"name": "status.get#1",
"ordinal": 3,
@@ -36,54 +85,6 @@
]
}
},
"b6a16cc83e18": {
"name": "aiVault.listSessions#1",
"ordinal": 5,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}"
},
"cb5715e0f275": {
"name": "aiVault.listSessions#1",
"ordinal": 4,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": {
"issues": [],
"sessions": [
{
"agent": "claude",
"cwd": "/repo/feature",
"id": "s1"
}
]
}
}
}
},
"daf52dc85a58": {
"name": "status.get#1",
"ordinal": 2,
@@ -160,8 +161,8 @@
{
"id": "ready",
"observation": {
"sender": ["daf52dc85a58", "cb5715e0f275"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"],
"sender": ["daf52dc85a58", "03fd6edde488"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"],
"settlements": {
"mount": "eb79a9b3682a",
"worktrees-loaded": "eb79a9b3682a"
@@ -173,8 +174,8 @@
{
"id": "cleanup",
"observation": {
"sender": ["daf52dc85a58", "cb5715e0f275"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"],
"sender": ["daf52dc85a58", "03fd6edde488"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"],
"settlements": {
"mount": "eb79a9b3682a",
"worktrees-loaded": "eb79a9b3682a"
@@ -30,7 +30,7 @@
"startedAt": 0
}
},
"07299f73583f": {
"27ef7c5c6263": {
"name": "aiVault.listSessions#1",
"ordinal": 6,
"args": [
@@ -43,6 +43,7 @@
"value": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
@@ -58,11 +59,6 @@
"startedAt": 0
}
},
"595e6c3bbfed": {
"name": "aiVault.listSessions#1",
"ordinal": 7,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}"
},
"7623e8b568b1": {
"crash": {
"$rpc": "null"
@@ -95,42 +91,7 @@
}
]
},
"b7a7af14c8a5": {
"crash": {
"$rpc": "null"
},
"elements": {
"ChevronLeft": 1,
"Defs": 1,
"LinearGradient": 1,
"Pressable": 5,
"Rect": 1,
"RefreshCw": 1,
"SafeAreaView": 1,
"Search": 1,
"SectionList": 1,
"Stop": 2,
"Svg": 1,
"Text": 5,
"TextInput": 1,
"View": 14
},
"labels": [
"Back",
"Refresh agent sessions",
"Workspace",
"Project",
"All",
"Search sessions, repo:, path:"
],
"text": ["Agent Session History", "orca-history", "Workspace", "Project", "All"]
},
"d126597611a2": {
"name": "worktree.ps#1",
"ordinal": 3,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.ps\",\"params\":{\"limit\":10000,\"supportsWorktreeVisibilitySourceDefaults\":true}}"
},
"df6890cb4985": {
"a03eeea51ba8": {
"name": "aiVault.listSessions#1",
"ordinal": 6,
"args": [
@@ -143,6 +104,7 @@
"value": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
@@ -194,6 +156,46 @@
}
}
},
"b7a7af14c8a5": {
"crash": {
"$rpc": "null"
},
"elements": {
"ChevronLeft": 1,
"Defs": 1,
"LinearGradient": 1,
"Pressable": 5,
"Rect": 1,
"RefreshCw": 1,
"SafeAreaView": 1,
"Search": 1,
"SectionList": 1,
"Stop": 2,
"Svg": 1,
"Text": 5,
"TextInput": 1,
"View": 14
},
"labels": [
"Back",
"Refresh agent sessions",
"Workspace",
"Project",
"All",
"Search sessions, repo:, path:"
],
"text": ["Agent Session History", "orca-history", "Workspace", "Project", "All"]
},
"d126597611a2": {
"name": "worktree.ps#1",
"ordinal": 3,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.ps\",\"params\":{\"limit\":10000,\"supportsWorktreeVisibilitySourceDefaults\":true}}"
},
"dffc0668b556": {
"name": "aiVault.listSessions#1",
"ordinal": 7,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}"
},
"e28c488ce6b2": {
"name": "agentSession.subscribeStatus#1",
"ordinal": 1,
@@ -305,8 +307,8 @@
{
"id": "worktrees-listed",
"observation": {
"sender": ["ebc8d9683b5e", "e881d7dabb25", "07299f73583f"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"],
"sender": ["ebc8d9683b5e", "e881d7dabb25", "27ef7c5c6263"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -317,8 +319,8 @@
{
"id": "ready",
"observation": {
"sender": ["ebc8d9683b5e", "e881d7dabb25", "df6890cb4985"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"],
"sender": ["ebc8d9683b5e", "e881d7dabb25", "a03eeea51ba8"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -329,8 +331,8 @@
{
"id": "cleanup",
"observation": {
"sender": ["ebc8d9683b5e", "e881d7dabb25", "df6890cb4985"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"],
"sender": ["ebc8d9683b5e", "e881d7dabb25", "a03eeea51ba8"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -30,7 +30,7 @@
"startedAt": 0
}
},
"07299f73583f": {
"27ef7c5c6263": {
"name": "aiVault.listSessions#1",
"ordinal": 6,
"args": [
@@ -43,6 +43,7 @@
"value": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
@@ -58,11 +59,6 @@
"startedAt": 0
}
},
"595e6c3bbfed": {
"name": "aiVault.listSessions#1",
"ordinal": 7,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}"
},
"7623e8b568b1": {
"crash": {
"$rpc": "null"
@@ -95,11 +91,51 @@
}
]
},
"a0b80301d553": {
"name": "aiVault.listSessions#1",
"ordinal": 6,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"d126597611a2": {
"name": "worktree.ps#1",
"ordinal": 3,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.ps\",\"params\":{\"limit\":10000,\"supportsWorktreeVisibilitySourceDefaults\":true}}"
},
"dffc0668b556": {
"name": "aiVault.listSessions#1",
"ordinal": 7,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}"
},
"e28c488ce6b2": {
"name": "agentSession.subscribeStatus#1",
"ordinal": 1,
@@ -191,40 +227,6 @@
}
}
}
},
"f13239f2c039": {
"name": "aiVault.listSessions#1",
"ordinal": 6,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
}
},
"recording": {
@@ -245,8 +247,8 @@
{
"id": "worktrees-listed",
"observation": {
"sender": ["ebc8d9683b5e", "e881d7dabb25", "07299f73583f"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"],
"sender": ["ebc8d9683b5e", "e881d7dabb25", "27ef7c5c6263"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -257,8 +259,8 @@
{
"id": "cleanup",
"observation": {
"sender": ["ebc8d9683b5e", "e881d7dabb25", "f13239f2c039"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"],
"sender": ["ebc8d9683b5e", "e881d7dabb25", "a0b80301d553"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"],
"settlements": {
"mount": "eb79a9b3682a"
},
File diff suppressed because it is too large Load Diff
@@ -30,34 +30,6 @@
"startedAt": 0
}
},
"07299f73583f": {
"name": "aiVault.listSessions#1",
"ordinal": 6,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"0cf3d278751b": {
"name": "status.get#1",
"ordinal": 4,
@@ -192,6 +164,35 @@
}
}
},
"27ef7c5c6263": {
"name": "aiVault.listSessions#1",
"ordinal": 6,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"2ce0b0bdae00": {
"name": "status.get#2",
"ordinal": 6,
@@ -259,11 +260,6 @@
}
}
},
"595e6c3bbfed": {
"name": "aiVault.listSessions#1",
"ordinal": 7,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}"
},
"68435dd07fce": {
"name": "status.get#2",
"ordinal": 6,
@@ -472,6 +468,41 @@
"Retry"
]
},
"a0b80301d553": {
"name": "aiVault.listSessions#1",
"ordinal": 6,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"a24196eaf702": {
"name": "status.get#1",
"ordinal": 4,
@@ -584,6 +615,11 @@
"Update Orca on this host to browse agent session history."
]
},
"dffc0668b556": {
"name": "aiVault.listSessions#1",
"ordinal": 7,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}"
},
"e28c488ce6b2": {
"name": "agentSession.subscribeStatus#1",
"ordinal": 1,
@@ -676,40 +712,6 @@
}
}
},
"f13239f2c039": {
"name": "aiVault.listSessions#1",
"ordinal": 6,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"f975325adbf9": {
"crash": {
"$rpc": "null"
@@ -800,8 +802,8 @@
{
"id": "aivault-history-screen-worktrees.normal:worktrees-listed",
"observation": {
"sender": ["ebc8d9683b5e", "e881d7dabb25", "07299f73583f"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"],
"sender": ["ebc8d9683b5e", "e881d7dabb25", "27ef7c5c6263"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -812,8 +814,8 @@
{
"id": "aivault-history-screen-worktrees.normal:cleanup",
"observation": {
"sender": ["ebc8d9683b5e", "e881d7dabb25", "f13239f2c039"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"],
"sender": ["ebc8d9683b5e", "e881d7dabb25", "a0b80301d553"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -30,34 +30,6 @@
"startedAt": 0
}
},
"07299f73583f": {
"name": "aiVault.listSessions#1",
"ordinal": 6,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"111e9a5009ba": {
"name": "streams-registered-at-teardown",
"ordinal": 4,
@@ -103,6 +75,35 @@
}
}
},
"27ef7c5c6263": {
"name": "aiVault.listSessions#1",
"ordinal": 6,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"519ce9879c6f": {
"name": "worktree.ps#1",
"ordinal": 2,
@@ -138,11 +139,6 @@
}
}
},
"595e6c3bbfed": {
"name": "aiVault.listSessions#1",
"ordinal": 7,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}"
},
"5a2900554f7f": {
"name": "worktree.ps#1",
"ordinal": 2,
@@ -351,6 +347,41 @@
}
}
},
"a0b80301d553": {
"name": "aiVault.listSessions#1",
"ordinal": 6,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"bdd2f2097a96": {
"name": "worktree.ps#1",
"ordinal": 2,
@@ -455,6 +486,11 @@
"ordinal": 3,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.ps\",\"params\":{\"limit\":10000,\"supportsWorktreeVisibilitySourceDefaults\":true}}"
},
"dffc0668b556": {
"name": "aiVault.listSessions#1",
"ordinal": 7,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}"
},
"e28c488ce6b2": {
"name": "agentSession.subscribeStatus#1",
"ordinal": 1,
@@ -579,40 +615,6 @@
}
}
},
"f13239f2c039": {
"name": "aiVault.listSessions#1",
"ordinal": 6,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"fe3fd26f3355": {
"name": "aiVault.listSessions#1",
"ordinal": 6,
@@ -707,8 +709,8 @@
{
"id": "aivault-history-screen-worktrees.normal:worktrees-listed",
"observation": {
"sender": ["ebc8d9683b5e", "e881d7dabb25", "07299f73583f"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"],
"sender": ["ebc8d9683b5e", "e881d7dabb25", "27ef7c5c6263"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -719,8 +721,8 @@
{
"id": "aivault-history-screen-worktrees.normal:cleanup",
"observation": {
"sender": ["ebc8d9683b5e", "e881d7dabb25", "f13239f2c039"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"],
"sender": ["ebc8d9683b5e", "e881d7dabb25", "a0b80301d553"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -4,6 +4,50 @@
"family": "aiVault.history",
"namedDeltas": [],
"values": {
"03fd6edde488": {
"name": "aiVault.listSessions#1",
"ordinal": 4,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": {
"issues": [],
"sessions": [
{
"agent": "claude",
"cwd": "/repo/feature",
"id": "s1"
}
]
}
}
}
},
"0753498763d5": {
"name": "status.get#1",
"ordinal": 2,
@@ -58,6 +102,11 @@
"kind": "unsupported"
}
},
"2182656920b3": {
"name": "aiVault.listSessions#1",
"ordinal": 5,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}"
},
"2289d07f6bea": {
"name": "status.get#1",
"ordinal": 2,
@@ -316,11 +365,6 @@
}
}
},
"b6a16cc83e18": {
"name": "aiVault.listSessions#1",
"ordinal": 5,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}"
},
"b838b12acde6": {
"activeWorktreePath": "/repo/feature",
"refreshing": false,
@@ -374,49 +418,6 @@
}
}
},
"cb5715e0f275": {
"name": "aiVault.listSessions#1",
"ordinal": 4,
"args": [
{
"name": "method",
"value": "aiVault.listSessions"
},
{
"name": "params",
"value": {
"force": false,
"limit": 500,
"scopePaths": ["/repo/feature"]
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": {
"issues": [],
"sessions": [
{
"agent": "claude",
"cwd": "/repo/feature",
"id": "s1"
}
]
}
}
}
},
"d0831ff38203": {
"name": "status.get#1",
"ordinal": 2,
@@ -604,8 +605,8 @@
{
"id": "aivault-history-scan-fulfilled.normal:ready",
"observation": {
"sender": ["daf52dc85a58", "cb5715e0f275"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"],
"sender": ["daf52dc85a58", "03fd6edde488"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -616,8 +617,8 @@
{
"id": "aivault-history-scan-fulfilled.normal:cleanup",
"observation": {
"sender": ["daf52dc85a58", "cb5715e0f275"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"],
"sender": ["daf52dc85a58", "03fd6edde488"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -15597,6 +15597,7 @@
"params": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
},
"reply": {
@@ -15684,6 +15685,7 @@
"params": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
},
"reply": {
@@ -15733,6 +15735,7 @@
"params": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
},
"reply": {
@@ -15771,6 +15774,7 @@
"params": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
},
"reply": {
@@ -15825,6 +15829,7 @@
"params": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
},
"reply": {
@@ -15853,6 +15858,7 @@
"params": {
"force": true,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
},
"reply": {
@@ -15902,6 +15908,7 @@
"params": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
},
"reply": {
@@ -15952,6 +15959,7 @@
"params": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
},
"reply": {
@@ -21336,6 +21344,7 @@
"params": {
"force": false,
"limit": 500,
"scopeOnly": true,
"scopePaths": ["/repo/feature"]
},
"reply": {
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest'
import {
deriveMobileAiVaultScopePaths,
mobileAiVaultScanScopePaths
mobileAiVaultScanScopeArgs
} from './agent-history-scope-paths'
const worktree = (worktreeId: string, path: string) => ({ worktreeId, path, repoId: 'repo-1' })
@@ -14,11 +14,13 @@ describe('mobile AI Vault scope paths', () => {
it('caps only the scan hints, so an older host accepts them and Project still shows every sibling', () => {
const scopePaths = deriveMobileAiVaultScopePaths('project', active, [active, ...siblings])
const scanPaths = mobileAiVaultScanScopePaths(scopePaths)
const scan = mobileAiVaultScanScopeArgs('project', scopePaths)
expect(scopePaths).toHaveLength(201)
expect(scanPaths).toHaveLength(64)
expect(scan.scopePaths).toHaveLength(64)
// Active worktree is seeded first, so it survives truncation.
expect(scanPaths[0]).toBe('/Users/ada/repo/app')
expect(scan.scopePaths?.[0]).toBe('/Users/ada/repo/app')
// A capped scope can't answer alone, so the host keeps its recency scan.
expect(scan.scopeOnly).toBeUndefined()
})
})
@@ -1,6 +1,7 @@
import { deriveAiVaultScopeSessionPaths } from '../../../src/shared/ai-vault/scanning/ai-vault-scope-paths'
import {
AI_VAULT_SCOPE_PATHS_MAX_COUNT,
boundedAiVaultScopeArgs,
type AiVaultListArgs,
type AiVaultScope
} from '../../../src/shared/ai-vault/contracts/ai-vault-types'
import type { Worktree } from '../worktree/workspace-list-types'
@@ -23,9 +24,12 @@ export function deriveMobileAiVaultScopePaths(
)
}
/** The scan hints sent to the host; older hosts reject oversized scopePaths, and hints only widen discovery. */
export function mobileAiVaultScanScopePaths(scopePaths: readonly string[]): string[] {
return scopePaths.slice(0, AI_VAULT_SCOPE_PATHS_MAX_COUNT)
/** The scope sent to the host: capped because older hosts reject oversized scopePaths; All keeps the recency scan. */
export function mobileAiVaultScanScopeArgs(
scope: AiVaultScope,
scopePaths: readonly string[]
): Pick<AiVaultListArgs, 'scopePaths' | 'scopeOnly'> {
return boundedAiVaultScopeArgs(scopePaths, scope !== 'all')
}
function toScopePathWorktree(worktree: ScopeWorktree) {
@@ -17,7 +17,7 @@ import { defineHostQuery, readHostQueryLive, useHostQuery } from '../query/host-
import { hostScreenState } from '../query/host-query-screen-state'
import {
deriveMobileAiVaultScopePaths,
mobileAiVaultScanScopePaths
mobileAiVaultScanScopeArgs
} from './agent-history-scope-paths'
import {
agentHistoryCapabilityRead,
@@ -65,6 +65,7 @@ type ScanScope = { scopeFilterPaths: string[]; activeWorktreePath: string | null
async function readAgentHistory(
client: RpcClient,
scope: AiVaultScope,
scan: ScanScope,
force: boolean,
associationRevision: number
@@ -81,7 +82,8 @@ async function readAgentHistory(
const reply = await agentHistorySessionScan.request(client, {
limit: MOBILE_AI_VAULT_SESSION_LIMIT,
force,
scopePaths: mobileAiVaultScanScopePaths(scan.scopeFilterPaths)
// From the query's own scope key, so rows cached under Workspace are always Workspace-only ones.
...mobileAiVaultScanScopeArgs(scope, scan.scopeFilterPaths)
})
const result = interpretOrThrowRefusalMessage(
() => agentHistorySessionScan.interpret(reply),
@@ -111,7 +113,7 @@ function agentHistoryQuery(
// No desktop signal for new transcripts, so foreground revalidates once older than 30 s.
refetchOnWindowFocus: true,
fetch: (client, _target, input: { scope: AiVaultScope }) =>
readAgentHistory(client, scan, force, startRevision(input.scope))
readAgentHistory(client, input.scope, scan, force, startRevision(input.scope))
})
}
@@ -29,7 +29,9 @@ const WORKTREE_CHANGE_EVENTS: ReadonlySet<string> = new Set([
'worktreesChanged',
'reposChanged',
// The desktop Agents list changed; worktree.ps carries its verdicts.
'agentListChanged'
'agentListChanged',
// Agent status changes on hosts without the sidebar feed (worktree.rows-changed-event.v1).
'worktreeRowsChanged'
])
export type HomeAccountsSetter = (
+7 -1
View File
@@ -95,6 +95,12 @@ function stopTimer(clock: SharedClock): void {
* (one timer, one timestamp). It runs only in the foreground and catches up on return.
*/
export function useSharedNow(intervalMs = 30_000): number {
return useSharedNowSnapshot(intervalMs, readNow)
}
const readNow = (now: number): number => now
export function useSharedNowSnapshot<T>(intervalMs: number, select: (now: number) => T): T {
const clock = sharedClock(intervalMs)
const subscribe = useCallback(
(listener: () => void) => {
@@ -128,6 +134,6 @@ export function useSharedNow(intervalMs = 30_000): number {
},
[clock, intervalMs]
)
const read = useCallback(() => clock.now, [clock])
const read = useCallback(() => select(clock.now), [clock, select])
return useSyncExternalStore(subscribe, read, read)
}
+6
View File
@@ -303,6 +303,12 @@
"uncommittedFiles_other": "{{count}} uncommitted"
},
"failure": {
"forkOriginalMissing": "{{agent}} could not find this response in the original chat. Open it and fork from there.",
"forkOriginalUnavailable": "{{agent}} cannot fork this response in the original chat. Open it and fork from there.",
"forkOriginalMissingNamed": "{{agent}} could not find this response in \"{{detail}}\". Open that chat and fork from there.",
"forkOriginalUnavailableNamed": "{{agent}} cannot fork this response in \"{{detail}}\". Open that chat and fork from there.",
"forkOriginalLatestOnly": "{{agent}} can only fork the latest response in the original chat. Open that chat and fork its latest response once it has finished.",
"forkOriginalLatestOnlyNamed": "{{agent}} can only fork the latest response in \"{{detail}}\". Open that chat and fork its latest response once it has finished.",
"pluginInputRequired": "{{agent}} stopped because the \"{{plugin}}\" plugin is waiting for input in a terminal pane. Disable the plugin for chat sessions, or run the task in a {{agent}} terminal.",
"providerResponseFailed": "{{agent}} couldn't finish this response. Open Details for more information.",
"providerSafetyStopped": "{{agent}} stopped this response after a safety check. Review your request and send again.",
+6
View File
@@ -2543,6 +2543,12 @@
"fallback": "Worktree"
},
"failure": {
"forkOriginalMissing": "{{agent}} could not find this response in the original chat. Open it and fork from there.",
"forkOriginalUnavailable": "{{agent}} cannot fork this response in the original chat. Open it and fork from there.",
"forkOriginalMissingNamed": "{{agent}} could not find this response in \"{{detail}}\". Open that chat and fork from there.",
"forkOriginalUnavailableNamed": "{{agent}} cannot fork this response in \"{{detail}}\". Open that chat and fork from there.",
"forkOriginalLatestOnly": "{{agent}} can only fork the latest response in the original chat. Open that chat and fork its latest response once it has finished.",
"forkOriginalLatestOnlyNamed": "{{agent}} can only fork the latest response in \"{{detail}}\". Open that chat and fork its latest response once it has finished.",
"backgroundTasksRunning": "Background tasks are still running.",
"waitForBackgroundTasks": "Wait for the background tasks to finish.",
"agentStarting": "The agent is still starting.",
@@ -10,6 +10,7 @@ import { hostViewFamily, hostViewKey } from '../host-screen/host-view-memory'
import { hostProjectSectionsQuery } from '../host-screen/use-host-project-sections'
import { sessionTabsFamily, sessionTabsKey } from '../session/tabs/mobile-session-last-tabs'
import { gitStatusQuery } from '../source-control/mobile-git-status-query'
import { firstPaintTaskKeys } from '../tasks/task-query-storage'
import { hostQueryKey } from './host-query-key'
import { persistedHostQueryKey, type PersistedHostQueryKey } from './host-query-persistence'
@@ -33,6 +34,9 @@ export function firstPaintQueryKeys(hostId: string, route: URL): PersistedHostQu
if (root !== 'h' || routeSegment(routeHost) !== hostId) {
return []
}
if (screen === 'tasks') {
return firstPaintTaskKeys(hostId)
}
const keys =
screen === undefined
? [
+35 -9
View File
@@ -48,6 +48,8 @@ function hostQueryPersistOf(query: Query): HostQueryPersist<unknown> | undefined
// Per world, the keys whose data came from the store and no read has replaced yet.
const restoredKeys = new WeakMap<QueryClient, Set<string>>()
// Per world, its store; absent in a document that keeps queries in memory only.
const persistences = new WeakMap<QueryClient, HostQueryPersistence>()
/**
* Whether a key still holds what an earlier launch stored: shown, but possibly days old and unconfirmed by
@@ -65,6 +67,17 @@ function familyPrefix(family: string, persist: HostQueryPersist<unknown>): strin
// Stored data of any age paints (silently while online); this only bounds what a forgotten host leaves.
const STORED_FOR_MS = 14 * 24 * 60 * 60 * 1000
/**
* Restores stored keys a screen reads without observing them (its inputs come from its own state).
* Resolves once each is applied or missed; at once where nothing is stored.
*/
export function restoreStoredHostQueries(
queryClient: QueryClient,
keys: readonly PersistedHostQueryKey[]
): Promise<void> {
return persistences.get(queryClient)?.restore(keys) ?? Promise.resolve()
}
export type HostQueryPersistence = {
// Restores keys that hold no data yet, from one store read; resolves once each is applied or missed.
restore(keys: readonly PersistedHostQueryKey[]): Promise<void>
@@ -117,8 +130,9 @@ export function createHostQueryPersistence(
const settledAt = new Map<string, number>()
// The last data written per key and what it was stored as, so unchanged data keeps one stored object.
const lastStored = new Map<string, { readonly source: unknown; readonly stored: unknown }>()
const restoring = new Set<string>()
// Keys the boot read just found empty: the screen's first observer doesn't read them again.
// One store read per key at a time; a second caller waits on the first.
const restoring = new Map<string, Promise<void>>()
// Keys a restore found empty: neither the screen's first observer nor a later restore reads them again.
const missedAtBoot = new Set<string>()
const triedOnMiss = new WeakSet<Query>()
const restored = new Set<string>()
@@ -177,11 +191,14 @@ export function createHostQueryPersistence(
function restoreOne(queryKey: readonly unknown[], persist: HostQueryPersist<unknown>) {
const family = familyOf(queryKey)
const queryHash = hashKey(queryKey)
if (family === null || restoring.has(queryHash)) {
if (family === null) {
return Promise.resolve()
}
restoring.add(queryHash)
return new Promise<void>((settle) => {
const pending = restoring.get(queryHash)
if (pending) {
return pending
}
const restore = new Promise<void>((settle) => {
void persisterFor(family, persist)
.retrieveQuery(queryHash, (record) => {
if (queryClient.getQueryData(queryKey) === undefined) {
@@ -202,6 +219,8 @@ export function createHostQueryPersistence(
() => settle()
)
}).finally(() => restoring.delete(queryHash))
restoring.set(queryHash, restore)
return restore
}
queryClient.getQueryCache().subscribe((event) => {
@@ -243,17 +262,22 @@ export function createHostQueryPersistence(
void persisterFor(family, persist).persistQuery(query)
})
return {
const persistence: HostQueryPersistence = {
async restore(keys) {
const empty = keys.flatMap((key) => {
const family = familyOf(key.queryKey)
return family !== null && queryClient.getQueryData(key.queryKey) === undefined
return family !== null &&
queryClient.getQueryData(key.queryKey) === undefined &&
!missedAtBoot.has(hashKey(key.queryKey))
? [{ ...key, family }]
: []
})
// A key already being read joins that read below instead of reading again.
await primer.prime(
empty.map(({ queryKey, persist, family }) =>
orcaQueryStoreKey(`${familyPrefix(family, persist)}-${hashKey(queryKey)}`)
empty.flatMap(({ queryKey, persist, family }) =>
restoring.has(hashKey(queryKey))
? []
: [orcaQueryStoreKey(`${familyPrefix(family, persist)}-${hashKey(queryKey)}`)]
)
)
await Promise.all(
@@ -267,4 +291,6 @@ export function createHostQueryPersistence(
},
flush: () => storage.flush()
}
persistences.set(queryClient, persistence)
return persistence
}
@@ -1,5 +1,6 @@
import { useCallback, useLayoutEffect, useMemo, useRef } from 'react'
import type { AgentSessionHandleProvider } from '../../../src/shared/agent-session/lifecycle/agent-session-provider-handle'
import { useHostProtocolGates } from '../components/host-protocol-gates-context'
import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent'
import type { StructuredAgentSessionForkSource } from '../../../src/shared/agent-session/structured-agent-session-create'
import { MobileNativeChatForkedFromContext } from './mobile-native-chat-notice-context'
import { forkMobileStructuredChat } from './mobile-structured-chat-fork'
@@ -19,19 +20,21 @@ export function MobileNativeChatForkProvider({
children: React.ReactNode
}): React.JSX.Element {
const { client, nativeChatController: chat, openNativeSession, worktreeId } = controller
const { statusPending } = useHostProtocolGates()
// The controller is rebuilt each render; a fork reads its session state at the press.
const latestController = useRef(controller)
useLayoutEffect(() => {
latestController.current = controller
})
const createFork = useCallback(
(agent: AgentSessionHandleProvider, forkFrom: StructuredAgentSessionForkSource) =>
(agent: TuiAgent, forkFrom: StructuredAgentSessionForkSource) =>
forkMobileStructuredChat(latestController.current, agent, forkFrom),
[]
)
const fork = useMobileNativeChatFork({
client,
hostCapabilities: controller.hostCapabilities,
hostStatusPending: statusPending || controller.connState !== 'connected',
agent: chat.nativeChatAgent,
sessionId: resolveMobileNativeChatSessionId(controller.activeSessionTab),
messages: chat.nativeChatSession.messages,
@@ -10,6 +10,42 @@ import { SEND_FAILURE_COPY } from './agent-session-send-failure-copy'
const COPY: Record<AgentSessionFailureCopyId, (values: AgentSessionFailureCopyValues) => string> = {
...START_FAILURE_COPY,
forkOriginalMissing: (values) =>
translate(
'session.failure.forkOriginalMissing',
AGENT_SESSION_FAILURE_COPY.forkOriginalMissing,
values
),
forkOriginalUnavailable: (values) =>
translate(
'session.failure.forkOriginalUnavailable',
AGENT_SESSION_FAILURE_COPY.forkOriginalUnavailable,
values
),
forkOriginalMissingNamed: (values) =>
translate(
'session.failure.forkOriginalMissingNamed',
AGENT_SESSION_FAILURE_COPY.forkOriginalMissingNamed,
values
),
forkOriginalUnavailableNamed: (values) =>
translate(
'session.failure.forkOriginalUnavailableNamed',
AGENT_SESSION_FAILURE_COPY.forkOriginalUnavailableNamed,
values
),
forkOriginalLatestOnly: (values) =>
translate(
'session.failure.forkOriginalLatestOnly',
AGENT_SESSION_FAILURE_COPY.forkOriginalLatestOnly,
values
),
forkOriginalLatestOnlyNamed: (values) =>
translate(
'session.failure.forkOriginalLatestOnlyNamed',
AGENT_SESSION_FAILURE_COPY.forkOriginalLatestOnlyNamed,
values
),
pluginInputRequired: (values) =>
translate(
'session.failure.pluginInputRequired',
@@ -122,3 +122,31 @@ describe('mobile structured agent-session launch', () => {
}
)
})
it('settles a proven missing-original fork refusal but keeps a lost earlier attempt unknown', async () => {
const refusal = {
ok: true,
result: {
ok: false,
refusal: {
code: 'agent_session_identity_required',
details: { reason: 'recordMissing' },
createAttemptRefusedBeforeCommit: true,
message: 'Source chat unavailable'
}
}
}
const client = clientReturning({ ok: true, result: { supported: true } }, refusal)
const forkFrom = { sessionId: 'copied-chat', throughItemId: 'legacy:opencode:source:reply-1' }
expect(
(await createMobileStructuredAgentSession(client, 'workspace-1', 'opencode', forkFrom)).kind
).toBe('failed')
const lost = clientReturning({ ok: true, result: { supported: true } }, refusal)
lost.sendRequest
.mockImplementationOnce(async () => ({ ok: true, result: { supported: true } }))
.mockRejectedValueOnce(markRpcDeliveryUnknown(new Error('reply lost')))
.mockResolvedValueOnce(refusal)
expect(
(await createMobileStructuredAgentSession(lost, 'workspace-1', 'opencode', forkFrom)).kind
).toBe('unknown')
})
@@ -1,9 +1,14 @@
import type { AgentSessionHandleProvider } from '../../../src/shared/agent-session/lifecycle/agent-session-provider-handle'
import { agentSessionForkSourceFailureWords } from '../../../src/shared/agent-session/failures/agent-session-failure-copy'
import { sayMobileAgentSessionFailure } from './agent-session-failure-copy'
import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent'
import type {
AgentSessionAttachResult,
AgentSessionMutationResult
} from '../../../src/shared/agent-session/agent-session-wire'
import { isDefinitiveAgentSessionCreateRefusal } from '../../../src/shared/agent-session/failures/agent-session-definitive-refusal'
import {
isDefinitiveAgentSessionCreateRefusal,
isAgentSessionForkSourceAdmissionRefusal
} from '../../../src/shared/agent-session/failures/agent-session-definitive-refusal'
import {
createStructuredAgentSessionId,
structuredAgentSessionCreateParams,
@@ -38,7 +43,7 @@ export type MobileStructuredAgentLaunchResult =
| { kind: 'unknown'; message: string }
function createParamsFor(
agent: AgentSessionHandleProvider,
agent: TuiAgent,
worktree: string,
forkFrom: StructuredAgentSessionForkSource | undefined,
tabPlacement: StructuredAgentSessionCreateParams['tabPlacement']
@@ -53,25 +58,22 @@ function createParamsFor(
})
}
function unknownCreateResult(
agent: AgentSessionHandleProvider,
error: unknown
): MobileStructuredAgentLaunchResult {
function unknownCreateResult(agent: TuiAgent, error: unknown): MobileStructuredAgentLaunchResult {
const message = error instanceof Error ? error.message.trim() : ''
return { kind: 'unknown', message: message || unconfirmedMessage(agent) }
}
function unconfirmedMessage(agent: AgentSessionHandleProvider): string {
function unconfirmedMessage(agent: TuiAgent): string {
return `The ${TUI_AGENT_DISPLAY_NAMES[agent]} chat result could not be confirmed.`
}
function failedMessage(agent: AgentSessionHandleProvider): string {
function failedMessage(agent: TuiAgent): string {
return `Could not open ${TUI_AGENT_DISPLAY_NAMES[agent]} chat.`
}
// Only definitive refusal permits failure/fallback; uncertain creates may already own a session and must not create a sibling.
function classifyCreateRefusal(
agent: AgentSessionHandleProvider,
agent: TuiAgent,
code: string,
message: string
): MobileStructuredAgentLaunchResult {
@@ -84,7 +86,7 @@ function classifyCreateRefusal(
export async function createMobileStructuredAgentSession(
client: RpcClient,
worktreeId: string,
agent: AgentSessionHandleProvider,
agent: TuiAgent,
/** Sent only to a host advertising forks. */
forkFrom?: StructuredAgentSessionForkSource,
/** Sent only to a host advertising create placement; the replay keeps it. */
@@ -132,12 +134,14 @@ export async function createMobileStructuredAgentSession(
const params = createParamsFor(agent, worktree, forkFrom, tabPlacement)
rememberMobileCreatedStructuredSession(params.envelope.sessionId, worktree)
let response
let priorCreateOutcomeUnknown = false
try {
response = await structuredAgentSessionCreate.request(client, params, {
timeoutMs: 15_000,
budgetSpansConnect: true
})
} catch {
priorCreateOutcomeUnknown = true
// Replay the durable envelope once so a lost acknowledgement cannot create a sibling.
try {
response = await structuredAgentSessionCreate.request(client, params, {
@@ -179,6 +183,22 @@ export async function createMobileStructuredAgentSession(
) {
return unknownCreateResult(agent, new Error(unconfirmedMessage(agent)))
}
if (
forkFrom &&
!priorCreateOutcomeUnknown &&
result.refusal.createAttemptRefusedBeforeCommit === true &&
isAgentSessionForkSourceAdmissionRefusal(result.refusal)
) {
return {
kind: 'failed',
message:
agentSessionForkSourceFailureWords(
result.refusal.message,
TUI_AGENT_DISPLAY_NAMES[agent],
sayMobileAgentSessionFailure
) ?? result.refusal.message
}
}
return classifyCreateRefusal(agent, result.refusal.code, result.refusal.message)
}
if (
@@ -1,7 +1,7 @@
import { translate } from '../i18n/mobile-i18n'
import { triggerError } from '../platform/haptics'
import { TUI_AGENT_DISPLAY_NAMES } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names'
import type { AgentSessionHandleProvider } from '../../../src/shared/agent-session/lifecycle/agent-session-provider-handle'
import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent'
import type {
StructuredAgentSessionCreateParams,
StructuredAgentSessionForkSource
@@ -48,7 +48,7 @@ export function mobileChatForkTabPlacement(
* Resolves once the outcome is known, so the caller's action stays disabled until then. */
export async function forkMobileStructuredChat(
scope: ForkScope,
agent: AgentSessionHandleProvider,
agent: TuiAgent,
forkFrom: StructuredAgentSessionForkSource
): Promise<void> {
const agentName = TUI_AGENT_DISPLAY_NAMES[agent]
@@ -1,16 +1,15 @@
import { memo } from 'react'
import { Text } from 'react-native'
import {
NATIVE_CHAT_MESSAGE_FULL_TIME_FORMAT,
NATIVE_CHAT_MESSAGE_TIME_FORMAT
getNativeChatMessageDay,
getNativeChatMessageTimeFormatter
} from '../../../../../src/shared/native-chat/transcript/native-chat-message-time'
import { useSharedNowSnapshot } from '../../../hooks/use-now'
import { colors, typography } from '../../../theme/mobile-theme'
import { themedStyleSheet } from '../../../theme/themed-styles'
import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme'
import { scaledType } from './mobile-native-chat-message-styles'
let formatters: { time: Intl.DateTimeFormat; full: Intl.DateTimeFormat } | null = null
export const MobileNativeChatMessageTime = memo(function MobileNativeChatMessageTime({
timestamp,
fontScale
@@ -19,20 +18,18 @@ export const MobileNativeChatMessageTime = memo(function MobileNativeChatMessage
fontScale: number
}): React.JSX.Element | null {
useMobileColorScheme()
const today = useSharedNowSnapshot(30_000, getNativeChatMessageDay)
const date = timestamp == null ? null : new Date(timestamp)
if (!date || Number.isNaN(date.getTime())) {
return null
}
formatters ??= {
time: new Intl.DateTimeFormat(undefined, NATIVE_CHAT_MESSAGE_TIME_FORMAT),
full: new Intl.DateTimeFormat(undefined, NATIVE_CHAT_MESSAGE_FULL_TIME_FORMAT)
}
const formatter = getNativeChatMessageTimeFormatter(undefined, today)
return (
<Text
style={[styles.time, scaledType(typography.metaSize, fontScale, 5)]}
accessibilityLabel={formatters.full.format(date)}
accessibilityLabel={formatter.formatFull(date)}
>
{formatters.time.format(date)}
{formatter.format(date, today.date)}
</Text>
)
})
@@ -0,0 +1,217 @@
import { createElement } from 'react'
import { act, create, type ReactTestRenderer } from 'react-test-renderer'
import { afterEach, expect, it, vi } from 'vitest'
import {
AGENT_SESSION_CREATE_FORK_RUNTIME_CAPABILITY,
AGENT_SESSION_CREATE_FORK_ORIGINAL_RUNTIME_CAPABILITY
} from '../../../../src/shared/agent-session/agent-session-create-capabilities'
import type { RpcClient } from '../../transport/rpc/rpc-client-contract'
import type { AgentJournalRenderItem } from '../../../../src/shared/agent-session/journal/agent-session-journal-types'
import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types'
import { useMobileNativeChatFork, type MobileNativeChatFork } from './use-mobile-native-chat-fork'
const renderers: ReactTestRenderer[] = []
afterEach(() => {
act(() => renderers.forEach((renderer) => renderer.unmount()))
renderers.length = 0
})
/** A connection whose agent-list reads fail as scripted (true = fails), as when the socket drops. */
function connection(failures: number | readonly boolean[]) {
const listeners = new Set<(state: 'connected' | 'reconnecting') => void>()
const script =
typeof failures === 'number' ? Array.from({ length: failures }, () => true) : [...failures]
let generation = 1
const sendRequest = vi.fn(async () => {
if (script.shift() === true) {
throw new Error('Connection interrupted')
}
return {
ok: true,
result: { agents: [{ agent: 'claude', capabilities: { fork: 'checkpoint' } }] }
}
})
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the hook reads only sendRequest, onStateChange and getGeneration from its client.
const client = {
sendRequest,
getGeneration: () => generation,
onStateChange: (listener: (state: 'connected' | 'reconnecting') => void) => {
listeners.add(listener)
return () => listeners.delete(listener)
}
} as unknown as RpcClient
const reconnect = () => listeners.forEach((listener) => listener('connected'))
const migrate = () => {
generation++
reconnect()
}
return { client, sendRequest, reconnect, migrate }
}
const reply: AgentJournalRenderItem = {
itemId: 'reply',
sequence: 1,
revision: 1,
observedAt: 1,
body: { kind: 'message', role: 'assistant', blocks: [{ type: 'text', text: 'ok' }] }
}
const message: NativeChatMessage = {
id: 'reply',
role: 'assistant',
blocks: [{ type: 'text', text: 'ok' }],
timestamp: 1,
source: 'transcript',
journalPosition: { sequence: 1, index: 0 }
}
const FORK_HOST = [AGENT_SESSION_CREATE_FORK_RUNTIME_CAPABILITY]
let latest: MobileNativeChatFork | null = null
async function settle(): Promise<void> {
await act(async () => {
await Promise.resolve()
await Promise.resolve()
await Promise.resolve()
})
}
it('offers an inherited OpenCode tip after the child advances and submits its displayed key', async () => {
let renderer!: ReactTestRenderer
const { client, sendRequest } = connection(0)
sendRequest.mockResolvedValue({
ok: true,
result: { agents: [{ agent: 'opencode', capabilities: { fork: 'tip' } }] }
})
const createFork = vi.fn(async () => {})
const copied = {
...message,
id: 'legacy:opencode:source:reply-1',
journalPosition: { sequence: 5, index: 0 }
}
const copiedPrompt: NativeChatMessage = {
...message,
id: 'legacy:opencode:source:user-1',
role: 'user',
journalPosition: { sequence: 4, index: 0 }
}
const ownPrompt: NativeChatMessage = {
...message,
id: 'legacy:opencode:child:user-2',
role: 'user',
journalPosition: { sequence: 7, index: 0 }
}
const own = {
...message,
id: 'legacy:opencode:child:reply-2',
journalPosition: { sequence: 8, index: 0 }
}
const olderPrompt: NativeChatMessage = {
...copiedPrompt,
id: 'legacy:opencode:source:user-0',
journalPosition: { sequence: 1, index: 0 }
}
const older = {
...copied,
id: 'legacy:opencode:source:reply-0',
journalPosition: { sequence: 2, index: 0 }
}
function ForkProbe({
hostCapabilities,
hostStatusPending = false
}: {
hostCapabilities: readonly string[]
hostStatusPending?: boolean
}) {
latest = useMobileNativeChatFork({
client,
hostCapabilities,
hostStatusPending,
agent: 'opencode',
sessionId: 'child',
messages: [olderPrompt, older, copiedPrompt, copied, ownPrompt, own],
turnJournal: {
items: [
{
...reply,
itemId: olderPrompt.id,
sequence: 1,
body: { kind: 'message', role: 'user', blocks: [] }
},
{ ...reply, itemId: older.id, sequence: 2 },
{
...reply,
itemId: copiedPrompt.id,
sequence: 4,
body: { kind: 'message', role: 'user', blocks: copiedPrompt.blocks }
},
{ ...reply, itemId: copied.id, sequence: 5 },
{
...reply,
itemId: 'orca:forked-from',
sequence: 6,
body: { kind: 'status', presentation: 'forked-from', text: 'Forked from source' }
},
{
...reply,
itemId: ownPrompt.id,
sequence: 7,
body: { kind: 'message', role: 'user', blocks: ownPrompt.blocks }
},
{ ...reply, itemId: own.id, sequence: 8 }
],
submissions: []
},
agentWorking: false,
sessionForkSupport: 'supported',
createFork
})
return null
}
await act(async () => {
renderer = create(createElement(ForkProbe, { hostCapabilities: FORK_HOST }))
renderers.push(renderer)
})
await settle()
expect(latest?.offerFor(copied)).toBe('reserved')
expect(latest?.offerFor(older)).toBe('reserved')
expect(latest?.offerFor(own)).toBe('available')
await act(async () => {
renderer.update(
createElement(ForkProbe, {
hostCapabilities: [...FORK_HOST, AGENT_SESSION_CREATE_FORK_ORIGINAL_RUNTIME_CAPABILITY]
})
)
})
expect(latest?.offerFor(copied)).toBe('available')
expect(latest?.offerFor(older)).toBe('available')
await act(async () => {
renderer.update(
createElement(ForkProbe, {
hostCapabilities: [...FORK_HOST, AGENT_SESSION_CREATE_FORK_ORIGINAL_RUNTIME_CAPABILITY],
hostStatusPending: true
})
)
})
expect(latest?.offerFor(copied)).toBe('reserved')
expect(latest?.offerFor(own)).toBe('available')
await act(async () => {
renderer.update(
createElement(ForkProbe, {
hostCapabilities: [...FORK_HOST, AGENT_SESSION_CREATE_FORK_ORIGINAL_RUNTIME_CAPABILITY],
hostStatusPending: false
})
)
})
expect(latest?.offerFor(copied)).toBe('available')
await act(async () => {
latest?.fork(copied)
})
expect(createFork).toHaveBeenCalledWith('opencode', {
sessionId: 'child',
throughItemId: 'legacy:opencode:source:reply-1'
})
await act(async () => {
renderer.update(createElement(ForkProbe, { hostCapabilities: FORK_HOST }))
})
expect(latest?.offerFor(copied)).toBe('reserved')
})
@@ -13,16 +13,17 @@ import {
type AgentSessionRegisteredAgent
} from '../../../../src/shared/agent-session/agent-session-registered-agents'
import type { AgentSessionOptionsResult } from '../../../../src/shared/agent-session/options/agent-session-options-result'
import { AGENT_SESSION_CREATE_FORK_RUNTIME_CAPABILITY } from '../../../../src/shared/agent-session/agent-session-create-capabilities'
import { latestAgentSessionContextClearSequence } from '../../../../src/shared/agent-session/agent-session-context-clear'
import {
isAgentSessionHandleProvider,
type AgentSessionHandleProvider
} from '../../../../src/shared/agent-session/lifecycle/agent-session-provider-handle'
AGENT_SESSION_CREATE_FORK_RUNTIME_CAPABILITY,
AGENT_SESSION_CREATE_FORK_ORIGINAL_RUNTIME_CAPABILITY
} from '../../../../src/shared/agent-session/agent-session-create-capabilities'
import { latestAgentSessionContextClearSequence } from '../../../../src/shared/agent-session/agent-session-context-clear'
import { isTuiAgent } from '../../../../src/shared/agent-launch/catalog/tui-agent-config'
import type { TuiAgent } from '../../../../src/shared/agent-launch/catalog/tui-agent'
import type { StructuredAgentSessionForkSource } from '../../../../src/shared/agent-session/structured-agent-session-create'
import type { StructuredAgentSessionHostCapabilityState } from '../../../../src/shared/agent-session/structured-agent-session-host-capability'
import {
nativeChatForkableItemIds,
nativeChatForkInventory,
nativeChatForkSupport,
nativeChatRowOffersFork
} from '../../../../src/shared/native-chat/native-chat-fork-offer'
@@ -155,6 +156,7 @@ function useRegisteredAgent(
export function useMobileNativeChatFork(input: {
client: RpcClient | null
hostCapabilities: readonly string[] | undefined
hostStatusPending: boolean
agent: string | null
sessionId: string | null
messages: readonly NativeChatMessage[]
@@ -162,20 +164,23 @@ export function useMobileNativeChatFork(input: {
agentWorking: boolean
/** The chat's options read on its installed agent; the host's own discovery owns it. */
sessionForkSupport: AgentSessionOptionsResult['forkSupport']
createFork: (
agent: AgentSessionHandleProvider,
forkFrom: StructuredAgentSessionForkSource
) => Promise<void>
createFork: (agent: TuiAgent, forkFrom: StructuredAgentSessionForkSource) => Promise<void>
}): MobileNativeChatFork {
const host: StructuredAgentSessionHostCapabilityState = !input.hostCapabilities
? 'unknown'
: input.hostCapabilities.includes(AGENT_SESSION_CREATE_FORK_RUNTIME_CAPABILITY)
? 'supported'
: 'unsupported'
const inheritedOriginal: StructuredAgentSessionHostCapabilityState =
!input.hostCapabilities || input.hostStatusPending
? 'unknown'
: input.hostCapabilities.includes(AGENT_SESSION_CREATE_FORK_ORIGINAL_RUNTIME_CAPABILITY)
? 'supported'
: 'unsupported'
const registered = useRegisteredAgent(input.client, host, input.agent)
const support = useMemo(
() => nativeChatForkSupport(host, registered, input.sessionForkSupport),
[host, registered, input.sessionForkSupport]
() => nativeChatForkSupport(host, registered, input.sessionForkSupport, inheritedOriginal),
[host, registered, input.sessionForkSupport, inheritedOriginal]
)
const { messages, turnJournal, agentWorking, sessionId, agent, createFork } = input
const turns = useMemo(() => {
@@ -191,8 +196,8 @@ export function useMobileNativeChatFork(input: {
}, [messages, turnJournal])
const contextFloorSequence = latestAgentSessionContextClearSequence(turnJournal?.items ?? [])
// The sheet's row is a display projection; only one naming the agent's own message forks.
const forkableItemIds = useMemo(
() => nativeChatForkableItemIds(turnJournal?.items ?? []),
const { forkableItemIds, inheritedThroughSequence } = useMemo(
() => nativeChatForkInventory(turnJournal?.items ?? []),
[turnJournal]
)
// Reserved at the press, before any await, so a second press never starts a second fork.
@@ -206,7 +211,7 @@ export function useMobileNativeChatFork(input: {
const turnKey = turns.keyById.get(message.id)
const offered =
!!sessionId &&
isAgentSessionHandleProvider(agent ?? '') &&
isTuiAgent(agent ?? '') &&
nativeChatRowOffersFork(
{
message,
@@ -214,7 +219,7 @@ export function useMobileNativeChatFork(input: {
turnWorking: agentWorking && (turnKey === undefined || turnKey === turns.liveTurnKey),
inLatestTurn: turnKey !== undefined && turnKey === turns.latestTurnKey
},
{ support, contextFloorSequence, forkableItemIds }
{ support, contextFloorSequence, forkableItemIds, inheritedThroughSequence }
)
return !offered
? 'reserved'
@@ -222,7 +227,17 @@ export function useMobileNativeChatFork(input: {
? 'disabled'
: 'available'
},
[agent, agentWorking, contextFloorSequence, forkableItemIds, pending, sessionId, support, turns]
[
agent,
agentWorking,
contextFloorSequence,
forkableItemIds,
inheritedThroughSequence,
pending,
sessionId,
support,
turns
]
)
const fork = useCallback(
(message: NativeChatMessage) => {
@@ -231,7 +246,7 @@ export function useMobileNativeChatFork(input: {
offerFor(message) !== 'available' ||
!sessionId ||
!agent ||
!isAgentSessionHandleProvider(agent)
!isTuiAgent(agent)
) {
return
}
@@ -1,6 +1,6 @@
import { useState } from 'react'
import { describeLoadError } from '../components/load-error-description'
import { mobileTasksListShowsError } from './mobile-tasks-list-state'
import { MobileTasksOfflineBanner, mobileTasksListShowsError } from './mobile-tasks-list-state'
import type { ConnectionPresentationModel } from './use-mobile-tasks-connection-presentation'
import { useMobileTranslation } from '../i18n/use-mobile-translation'
import {
@@ -203,6 +203,8 @@ export function MobileTasksLegacySurface({ model }: { model: ConnectionPresentat
</View>
) : null}
<MobileTasksOfflineBanner model={model} />
{renderMobileTasksListSurface(model, colorScheme, bottomBarHeight)}
{renderMobileTasksSearchControl(model, setSearchBarHeight)}
@@ -12,7 +12,7 @@ import {
TaskProviderLogo,
type MobileColorScheme
} from './mobile-tasks-dependencies'
import { renderMobileTasksListState } from './mobile-tasks-list-state'
import { ignoreKeptRowPress, renderMobileTasksListState } from './mobile-tasks-list-state'
import { styles } from './mobile-tasks-legacy-styles'
import {
createLinearTask,
@@ -37,9 +37,13 @@ export function renderMobileTasksLinearList(
mutatingStatus,
refreshTasks,
refreshing,
setActionItem,
setLinearStatusPickerItem
taskUiReady
} = model
// The last list, kept before Tasks is ready, is read-only.
const setActionItem = taskUiReady ? model.setActionItem : ignoreKeptRowPress
const setLinearStatusPickerItem = taskUiReady
? model.setLinearStatusPickerItem
: ignoreKeptRowPress
const listState = renderMobileTasksListState(model, linearIssuesForView.length, bottomBarHeight)
if (listState) {
return listState
@@ -1,4 +1,6 @@
import { CircleAlert, Inbox } from 'lucide-react-native'
import { StyleSheet, View } from 'react-native'
import { HostOfflineBanner, useHostOfflineBanner } from '../components/HostOfflineBanner'
import {
MobileLoadErrorState,
MobileNoMatchState,
@@ -6,10 +8,16 @@ import {
MobileStateView
} from '../components/MobileStateView'
import { useForceReconnect } from '../transport/connection/host-client-hooks'
import { isConnectionOutage } from '../transport/connection/connection-health'
import { useHostDisplay } from '../transport/hosts/use-host-display'
import { useHostProfile } from '../transport/hosts/use-host-profile'
import { spacing } from '../theme/mobile-theme'
import { translate } from '../i18n/mobile-i18n'
import type { ConnectionPresentationModel } from './use-mobile-tasks-connection-presentation'
import { clearMobileTasksSearch } from './mobile-tasks-search-control'
export function ignoreKeptRowPress(): void {}
/** True when the list body itself shows the load failure, so the banner above must not repeat it. */
export function mobileTasksListShowsError(model: ConnectionPresentationModel): boolean {
if (!model.error) {
@@ -117,3 +125,36 @@ function MobileTasksOfflineState({ hostId, bottomInset }: { hostId: string; bott
/>
)
}
/** Over the last list while the desktop can't be reached, with when those rows were read. */
export function MobileTasksOfflineBanner({ model }: { model: ConnectionPresentationModel }) {
const { hostId } = model
const forceReconnect = useForceReconnect()
const hostName = useHostDisplay(useHostProfile(hostId)).title
const banner = useHostOfflineBanner({
client: model.client,
connState: model.connState,
lastConnectedAt: model.lastConnectedAt,
outage: isConnectionOutage(model.headerVerdict),
forceReconnect: forceReconnect && hostId ? () => void forceReconnect(hostId) : null,
hasData: model.showsKeptRows,
asOf: model.rowsReadAt
})
if (!banner) {
return null
}
return (
<View style={bannerStyles.inset}>
<HostOfflineBanner
hostName={hostName}
offline={banner.offline}
asOf={banner.asOf}
onRetry={banner.retry}
/>
</View>
)
}
const bannerStyles = StyleSheet.create({
inset: { paddingHorizontal: spacing.lg, paddingBottom: spacing.sm }
})
@@ -24,10 +24,14 @@ export function renderMobileTasksListSurface(
setLinearConnectError,
setLinearConnectState,
setShowLinearConnect,
showsKeptRows,
taskUiReady,
tasksSupported
} = model
return !tasksSupported ? (
// Kept rows are drawn as they were, ahead of connection prompts that a dropped connection resets.
return showsKeptRows ? (
renderMobileTasksNonProjectLists(model, colorScheme, bottomBarHeight)
) : !tasksSupported ? (
renderMobileTasksSupportState(model, bottomBarHeight)
) : provider === 'jira' && !jiraConnection.connected ? (
<JiraConnectPrompt
@@ -19,7 +19,7 @@ import {
getHostedMergeLabel,
type MobileColorScheme
} from './mobile-tasks-dependencies'
import { renderMobileTasksListState } from './mobile-tasks-list-state'
import { ignoreKeptRowPress, renderMobileTasksListState } from './mobile-tasks-list-state'
import { styles, getPrSignalToneStyle } from './mobile-tasks-legacy-styles'
import {
taskRepositoryMeta,
@@ -66,11 +66,12 @@ export function renderMobileTasksProviderItemList(
refreshTasks,
refreshing,
reposById,
setActionItem,
setShowGitHubPagePicker,
sortedItems,
taskUiReady
} = model
// The last list, kept before Tasks is ready, is read-only.
const setActionItem = taskUiReady ? model.setActionItem : ignoreKeptRowPress
const listState = renderMobileTasksListState(model, sortedItems.length, bottomBarHeight)
if (listState) {
return listState
+20 -108
View File
@@ -1,14 +1,8 @@
import { useQueryClient, type QueryClient } from '@tanstack/react-query'
import { useCallback, useLayoutEffect, useRef, useState } from 'react'
import { hashKey, type QueryClient } from '@tanstack/react-query'
import type { PersistedTrustedOrcaHooks } from '../../../src/shared/orca-yaml-hook-types'
import { defineHostQuery, readHostQueryLive } from '../query/host-query'
import {
hostQueryKey,
type HostQueryKey,
type HostQueryParams,
type HostQueryTarget,
hostScopeKey
} from '../query/host-query-key'
import { hostQueryKey, type HostQueryParams } from '../query/host-query-key'
import { holdsRestoredHostQueryData } from '../query/host-query-persistence'
import type { RpcClient } from '../transport/rpc/rpc-client-contract'
import { settingsRead } from '../settings/mobile-settings-read-operations'
import { readJiraConnectionProbeReply, type MobileJiraConnection } from './jira-mobile-connection'
@@ -26,10 +20,15 @@ import type {
import type { TaskItem } from './mobile-tasks-project-workspace-types'
import type { GitHubRepoSources } from './mobile-tasks-provider-detail-types'
import type { ProviderLoadActionsModel } from './use-mobile-tasks-provider-load-actions'
import {
NO_TASK_INPUT as NO_INPUT,
TASKS_TARGET,
taskHydrationStorage,
taskJiraStatusStorage,
taskListStorage
} from './task-query-storage'
// Tasks reads span the desktop and the servers it relays to; the routed client sends each repo's read to its owner.
const TASKS_TARGET: HostQueryTarget = { exec: 'local' }
const NO_INPUT = {}
export { taskListKey } from './task-query-storage'
// What the Tasks screen opens on: settings, resume state and provider availability, read in one batch.
export type TaskHydration = {
@@ -40,7 +39,7 @@ export type TaskHydration = {
}
export const taskHydrationQuery = defineHostQuery<typeof NO_INPUT, TaskHydration>({
family: 'tasks.hydration',
...taskHydrationStorage,
// Keep raw Promise.all fail-fast behavior; an all-settled interpretation barrier would wait and could change error precedence.
fetch: async (client) => {
const [settingsReply, uiReply, preflightReply, linearReply] = await Promise.all([
@@ -72,7 +71,7 @@ export const taskHydrationQuery = defineHostQuery<typeof NO_INPUT, TaskHydration
// Jira is advisory: its own read, so it never holds up the other providers.
export const taskJiraStatusQuery = defineHostQuery<typeof NO_INPUT, MobileJiraConnection>({
family: 'tasks.jiraStatus',
...taskJiraStatusStorage,
fetch: (client) =>
jiraConnectionStatusProbe
.request(client)
@@ -82,17 +81,18 @@ export const taskJiraStatusQuery = defineHostQuery<typeof NO_INPUT, MobileJiraCo
retry: false
})
/** The hydration and Jira status last read for the host; `stored` when it is an earlier launch's copy, which only draws the view. */
export function readKeptTaskHydration(
queryClient: QueryClient,
hostId: string
): { hydration?: TaskHydration; jira?: MobileJiraConnection } {
): { hydration?: TaskHydration; jira?: MobileJiraConnection; stored: boolean } {
const hydrationKey = hostQueryKey(hostId, taskHydrationQuery.family, TASKS_TARGET, NO_INPUT)
return {
hydration: queryClient.getQueryData(
hostQueryKey(hostId, taskHydrationQuery.family, TASKS_TARGET, NO_INPUT)
),
hydration: queryClient.getQueryData(hydrationKey),
jira: queryClient.getQueryData(
hostQueryKey(hostId, taskJiraStatusQuery.family, TASKS_TARGET, NO_INPUT)
)
),
stored: holdsRestoredHostQueryData(queryClient, hashKey(hydrationKey))
}
}
@@ -161,7 +161,7 @@ export type TaskListSnapshot = (
// Read by the Tasks loader with its own inputs (repos, routed client); a superseded read stops at the next repo.
export const taskListQuery = defineHostQuery<HostQueryParams, TaskListSnapshot>({
family: 'tasks.list',
...taskListStorage,
gcTime: 10 * 60_000,
retry: false
})
@@ -230,91 +230,3 @@ export function taskListParams(input: TaskListInput, repoKey: string): HostQuery
: null
}
}
export function taskListKey(hostId: string, params: HostQueryParams): HostQueryKey {
return hostQueryKey(hostId, taskListQuery.family, TASKS_TARGET, params)
}
type TaskListView = Pick<
ProviderLoadActionsModel,
| 'hostId'
| 'items'
| 'setError'
| 'setItems'
| 'setGithubPages'
| 'setGithubCurrentPage'
| 'setGithubRepoSources'
| 'setGithubSourceErrors'
| 'setGithubSourceFallbacks'
| 'setGithubCountedTotalPages'
| 'setLoading'
| 'setTaskListSettled'
>
/** The lists each filter read last, and which of them a read in flight is standing on. */
export function useTaskListCache(view: TaskListView) {
const queryClient = useQueryClient()
const { hostId } = view
// Set while kept rows stand in for a read in flight; drives the header's refresh line, not the list spinner.
const [revalidating, setRevalidating] = useState(false)
// The provider whose rows are on screen, so a provider switch never keeps another provider's rows.
const shownProviderRef = useRef<string | null>(null)
const shownRowsRef = useRef(view.items)
useLayoutEffect(() => {
shownRowsRef.current = view.items
}, [view.items])
// Stops a replaced or abandoned read before its next repo; the kept rows stay as they were.
const cancelRead = useCallback((): void => {
void queryClient.cancelQueries(
{ queryKey: [...hostScopeKey(hostId), taskListQuery.family], fetchStatus: 'fetching' },
{ silent: true }
)
}, [hostId, queryClient])
// A read of `key` starts on that filter's kept rows, else on the same provider's rows still shown, else the spinner.
const begin = useCallback(
(key: HostQueryKey | null, provider: string): void => {
cancelRead()
const kept = key ? queryClient.getQueryData<TaskListSnapshot>(key) : undefined
if (kept) {
shownProviderRef.current = provider
view.setItems(kept.items)
view.setError(kept.notice ?? '')
if (kept.github) {
const { sources } = kept.github
view.setGithubRepoSources((current) => ({ ...current, ...sources }))
view.setGithubPages([kept.items])
view.setGithubCurrentPage(0)
view.setGithubSourceErrors(kept.github.sourceErrors)
view.setGithubSourceFallbacks(kept.github.sourceFallbacks)
view.setGithubCountedTotalPages(kept.github.countedTotalPages)
}
view.setTaskListSettled(true)
setRevalidating(true)
} else if (shownRowsRef.current.length > 0 && shownProviderRef.current === provider) {
setRevalidating(true)
} else {
view.setLoading(true)
}
},
[cancelRead, queryClient]
)
const shown = useCallback((provider: string): void => {
shownProviderRef.current = provider
}, [])
// The GitHub page count lands after the rows; keep it with them.
const rememberPageCount = useCallback(
(key: HostQueryKey | null, countedTotalPages: number): void => {
if (key) {
queryClient.setQueryData<TaskListSnapshot>(
key,
(snapshot) =>
snapshot?.github && { ...snapshot, github: { ...snapshot.github, countedTotalPages } }
)
}
},
[queryClient]
)
return { revalidating, setRevalidating, begin, shown, cancelRead, rememberPageCount }
}
@@ -0,0 +1,177 @@
import { createElement, type Dispatch, type SetStateAction } from 'react'
import { QueryClient, QueryClientProvider, notifyManager } from '@tanstack/react-query'
import { act, create } from 'react-test-renderer'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import type { OrcaQueryStoreBackend } from '../device-store/query-storage'
import { hostQueryKey } from '../query/host-query-key'
import { createHostQueryPersistence } from '../query/host-query-persistence'
import type { TaskItem } from './mobile-tasks-project-workspace-types'
import { readKeptTaskHydration } from './task-queries'
import { useTaskListCache } from './use-task-list-cache'
import {
firstPaintTaskKeys,
NO_TASK_INPUT,
TASKS_TARGET,
taskHydrationStorage,
taskLastListKey,
taskLastListStorage,
taskListKey,
taskListStorage
} from './task-query-storage'
vi.mock('react-native', () => ({ AppState: {} }))
notifyManager.setScheduler(queueMicrotask)
const HOST = 'host-a'
const SAVED_AT = 1_794_000_000_000
const params = { provider: 'linear', workspace: 'ws-1', teams: 'team-1', filter: 'assigned' }
const storedRow = {
key: 'linear:STA-12',
provider: 'linear',
title: 'Keep task lists between launches',
subtitle: 'STA-12',
status: 'In Progress',
updatedAt: '2026-11-07T10:00:00.000Z',
source: { id: 'issue-12', identifier: 'STA-12', title: 'Keep task lists between launches' }
}
function memoryStore(hostId: string) {
const rows = new Map<string, string>()
const backend: OrcaQueryStoreBackend = {
hostId,
read: async (keys) => ({
status: 'ok',
values: keys.map((storeKey) => rows.get(storeKey) ?? null)
}),
write: async (ops) => {
for (const op of ops) {
if (op.value === null) {
rows.delete(op.key)
} else {
rows.set(op.key, op.value)
}
}
return { written: true }
}
}
return { backend, rows }
}
// What one document leaves on disk for the next: each value as its read landed, then flushed.
async function storeFromEarlierLaunch(
store: ReturnType<typeof memoryStore>,
records: { queryKey: readonly unknown[]; persist: unknown; data: unknown }[]
) {
const earlier = new QueryClient()
const persistence = createHostQueryPersistence(earlier, store.backend)
for (const { queryKey, persist, data } of records) {
earlier.getQueryCache().build(earlier, { queryKey, meta: { persist } })
earlier.setQueryData(queryKey, data, { updatedAt: SAVED_AT })
}
await vi.runAllTimersAsync()
await persistence.flush()
}
async function relaunch(store: ReturnType<typeof memoryStore>) {
const relaunched = new QueryClient()
const persistence = createHostQueryPersistence(relaunched, store.backend)
const restoring = persistence.restore(firstPaintTaskKeys(HOST))
await vi.runAllTimersAsync()
await restoring
return relaunched
}
describe('Tasks lists kept on the phone', () => {
beforeEach(() => {
vi.useFakeTimers({ now: SAVED_AT + 60_000 })
})
afterEach(() => {
vi.useRealTimers()
})
it('draws the list a provider showed at the last launch before Tasks is ready, rows only', async () => {
const store = memoryStore(HOST)
await storeFromEarlierLaunch(store, [
{
queryKey: taskLastListKey(HOST, 'linear'),
persist: taskLastListStorage.persist,
data: params
},
{
queryKey: taskListKey(HOST, params),
persist: taskListStorage.persist,
data: { items: [storedRow] }
}
])
const relaunched = await relaunch(store)
const setItems = vi.fn<Dispatch<SetStateAction<TaskItem[]>>>()
const setError = vi.fn()
const shown: { rowsReadAt?: number | null } = {}
function Probe() {
shown.rowsReadAt = useTaskListCache({
hostId: HOST,
items: [],
jiraConnection: {
connected: false,
sites: [],
selection: null,
credentialError: null,
unavailableReason: null
},
provider: 'linear',
taskUiReady: false,
setItems,
setError,
setGithubPages: vi.fn(),
setGithubCurrentPage: vi.fn(),
setGithubRepoSources: vi.fn(),
setGithubSourceErrors: vi.fn(),
setGithubSourceFallbacks: vi.fn(),
setGithubCountedTotalPages: vi.fn(),
setLoading: vi.fn(),
setTaskListSettled: vi.fn()
}).rowsReadAt
return null
}
await act(async () => {
create(createElement(QueryClientProvider, { client: relaunched }, createElement(Probe)))
await vi.runAllTimersAsync()
})
expect(setItems).toHaveBeenCalledWith([storedRow])
expect(shown.rowsReadAt).toBe(SAVED_AT)
// A failed first read's error stays up over the stored rows.
expect(setError).not.toHaveBeenCalled()
})
it('keeps agent launch commands and hook trust out of the stored hydration', async () => {
const store = memoryStore(HOST)
await storeFromEarlierLaunch(store, [
{
queryKey: hostQueryKey(HOST, taskHydrationStorage.family, TASKS_TARGET, NO_TASK_INPUT),
persist: taskHydrationStorage.persist,
data: {
settings: {
visibleTaskProviders: ['github', 'linear'],
agentCmdOverrides: { claude: 'ANTHROPIC_API_KEY=sk-ant-secret claude' }
},
ui: {
taskResumeState: { linearPreset: 'assigned' },
trustedOrcaHooks: { 'repo-1': { setup: 'hash-trusted' } }
},
glabInstalled: false,
linearConnected: true
}
}
])
const kept = readKeptTaskHydration(await relaunch(store), HOST)
expect(kept.stored).toBe(true)
expect(kept.hydration).toEqual({
settings: { visibleTaskProviders: ['github', 'linear'] },
ui: { taskResumeState: { linearPreset: 'assigned' } },
glabInstalled: false,
linearConnected: true
})
})
})
+144
View File
@@ -0,0 +1,144 @@
import * as z from 'zod'
import { hostQueryKey, type HostQueryParams, type HostQueryTarget } from '../query/host-query-key'
import {
persistedHostQueryKey,
type PersistedHostFamily,
type PersistedHostQueryKey
} from '../query/host-query-persistence'
import type { MobileJiraConnection } from './jira-mobile-connection'
import type { TaskHydration, TaskListSnapshot } from './task-queries'
// Kept apart from task-queries so the page's first-paint keys don't pull the Tasks reads into boot.
// Tasks reads span the desktop and the servers it relays to; the routed client sends each repo's read to its owner.
export const TASKS_TARGET: HostQueryTarget = { exec: 'local' }
export const NO_TASK_INPUT = {}
const TASK_PROVIDERS = ['github', 'gitlab', 'linear', 'jira'] as const
// Only what draws the screen's view: agent launch settings and hook trust stay off disk, and a
// stored copy is never acted on (the screen waits for a live read before Tasks is ready).
const VIEW_SETTING_KEYS = [
'defaultTaskSource',
'defaultTaskViewPreset',
'visibleTaskProviders',
'defaultRepoSelection',
'defaultLinearTeamSelection',
'githubProjects'
] as const
const storedHydrationSchema = z.object({
settings: z.looseObject({}),
ui: z.object({ taskResumeState: z.looseObject({}).optional() }).nullable(),
glabInstalled: z.boolean(),
linearConnected: z.boolean()
})
export const taskHydrationStorage: PersistedHostFamily<TaskHydration> = {
family: 'tasks.hydration',
persist: {
version: 1,
dataSchema: z.custom<TaskHydration>((data) => storedHydrationSchema.safeParse(data).success),
strip: (hydration) => ({
settings: Object.fromEntries(
VIEW_SETTING_KEYS.flatMap((key) =>
hydration.settings[key] === undefined ? [] : [[key, hydration.settings[key]]]
)
),
ui: hydration.ui && { taskResumeState: hydration.ui.taskResumeState },
glabInstalled: hydration.glabInstalled,
linearConnected: hydration.linearConnected
})
}
}
const storedJiraSchema = z.looseObject({
connected: z.boolean(),
sites: z.array(z.looseObject({})),
selection: z.string().nullable()
})
export const taskJiraStatusStorage: PersistedHostFamily<MobileJiraConnection> = {
family: 'tasks.jiraStatus',
persist: {
version: 1,
dataSchema: z.custom<MobileJiraConnection>((data) => storedJiraSchema.safeParse(data).success)
}
}
const storedTaskItemSchema = z.looseObject({
key: z.string(),
provider: z.enum(['github', 'gitlab', 'gitlabTodo', 'linear', 'jira']),
title: z.string(),
subtitle: z.string(),
status: z.string(),
updatedAt: z.string(),
source: z.looseObject({})
})
const storedTaskListSchema = z.object({
items: z.array(storedTaskItemSchema),
github: z
.object({
sources: z.record(z.string(), z.looseObject({})),
sourceErrors: z.array(z.unknown()),
sourceFallbacks: z.array(z.unknown()),
countedTotalPages: z.number().nullable()
})
.optional()
})
export const taskListStorage: PersistedHostFamily<TaskListSnapshot> = {
family: 'tasks.list',
persist: {
version: 1,
dataSchema: z.custom<TaskListSnapshot>((data) => storedTaskListSchema.safeParse(data).success),
// A read's warnings describe that read; a later launch shows its rows without them.
strip: (snapshot) =>
snapshot.github
? {
items: snapshot.items,
github: { ...snapshot.github, sourceErrors: [], sourceFallbacks: [] }
}
: { items: snapshot.items }
}
}
/** Per provider, the inputs of the list it showed last, so the next launch knows which stored list to draw. */
export const taskLastListStorage: PersistedHostFamily<HostQueryParams> = {
family: 'tasks.lastList',
persist: {
version: 1,
dataSchema: z.custom<HostQueryParams>(
(params) =>
z
.record(z.string(), z.union([z.string(), z.number(), z.boolean(), z.null()]))
.safeParse(params).success
)
}
}
export function taskLastListKey(hostId: string, provider: string) {
return hostQueryKey(hostId, taskLastListStorage.family, TASKS_TARGET, { provider })
}
export function taskListKey(hostId: string, params: HostQueryParams) {
return hostQueryKey(hostId, taskListStorage.family, TASKS_TARGET, params)
}
/** What the Tasks screen draws before its first read: the view, Jira's status and which list each provider showed. */
export function firstPaintTaskKeys(hostId: string): PersistedHostQueryKey[] {
const keys = [
persistedHostQueryKey(
taskHydrationStorage,
hostQueryKey(hostId, taskHydrationStorage.family, TASKS_TARGET, NO_TASK_INPUT)
),
persistedHostQueryKey(
taskJiraStatusStorage,
hostQueryKey(hostId, taskJiraStatusStorage.family, TASKS_TARGET, NO_TASK_INPUT)
),
...TASK_PROVIDERS.map((provider) =>
persistedHostQueryKey(taskLastListStorage, taskLastListKey(hostId, provider))
)
]
return keys.filter((key) => key !== null)
}

Some files were not shown because too many files have changed in this diff Show More