Merge main and focus server deletion repair on native background ownership

This commit is contained in:
Brennan Benson
2026-11-13 16:14:02 -08:00
1012 changed files with 16301 additions and 92660 deletions
@@ -0,0 +1,75 @@
name: Windows browser agent focus E2E
on:
workflow_dispatch:
inputs:
ref:
description: Ref to check out
required: false
type: string
permissions:
contents: read
# Candidate source must not write caches in the dispatch branch's scope.
cache-mode: read
concurrency:
group: windows-browser-focus-e2e-${{ inputs.ref || github.ref }}
cancel-in-progress: true
jobs:
windows-browser-focus:
name: Agent browser input leaves Orca behind the user's app
runs-on: windows-2022
timeout-minutes: 30
env:
NODE_OPTIONS: --max-old-space-size=4096
ORCA_BACKGROUND_LAUNCH: '1'
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ inputs.ref || github.ref }}
persist-credentials: false
# Why: pnpm must exist before setup-node resolves its dependency cache.
- name: Setup pnpm
uses: pnpm/setup@v2
with:
install: false
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: package.json
check-latest: true
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build Electron app for Windows E2E
run: pnpm exec electron-vite build --mode e2e
# Why: the hosted Windows desktop has a real foreground, so it can see an agent press activate Orca.
- name: Run agent focus checks on the Windows desktop
env:
SKIP_BUILD: '1'
ORCA_E2E_FORWARD_APP_LOGS: '1'
run: >-
pnpm exec playwright test
tests/e2e/browser-agent-input-focus-isolation-native.spec.ts
--config tests/playwright.config.ts
--project=electron-headful
--workers=1
- name: Upload Playwright traces
if: failure()
uses: actions/upload-artifact@v7
with:
name: windows-browser-focus-playwright-traces
path: test-results/
retention-days: 7
if-no-files-found: ignore
@@ -53,23 +53,6 @@ describe('admin routes under a database that is briefly out of reach', () => {
expect(response.headers.get('Retry-After')).toBe('7')
expect(await response.json()).toEqual({ error: 'database_temporarily_unavailable' })
})
it('answers admission-selector/status with a retryable 503 instead of a conflict', async () => {
const inspectCellAdmissionSelector = vi.fn(async () => {
throw poolTimeout()
})
const app = appWith({ inspectCellAdmissionSelector })
const response = await app.request(
'/v1/admin/admission-selector/status',
adminRequest({ v: 1, attemptId: '22222222-2222-4222-8222-222222222222' })
)
expect(response.status).toBe(503)
expect(response.headers.get('Retry-After')).toBe('5')
expect(await response.json()).toEqual({ error: 'database_temporarily_unavailable' })
})
})
function config(overrides: Partial<RelayConfig> = {}): RelayConfig {
@@ -1,5 +1,5 @@
import { afterEach, describe, expect, it } from 'vitest'
import { RelayAssignmentStore, RelayHomeCellUnavailableError } from './assignment-store.js'
import { RelayAssignmentStore } from './assignment-store.js'
import type { RelayCellConfig } from '../config.js'
import { openInMemoryRelayDatabase, type RelayDatabase } from '../database/database.js'
@@ -7,16 +7,6 @@ const HEARTBEAT_TTL_MS = 45_000
const START_MS = 100
const IDENTITY = { userId: 'user-1', relayHostId: 'host000000000001' }
// A connection-limited cell is what makes the committed fence mandatory, and
// that is the branch which used to answer "capacity exhausted".
const FENCED_CELL: RelayCellConfig = {
id: 'home',
url: 'https://home.example.com',
capacityRequests: 1_000,
connectionHardCap: 600,
connectionUnobservedBound: 50
}
const databases: RelayDatabase[] = []
afterEach(async () => {
@@ -29,7 +19,7 @@ interface Harness {
setNow: (value: number) => void
}
async function setup(cells: RelayCellConfig[] = [FENCED_CELL]): Promise<Harness> {
async function setup(cells: RelayCellConfig[]): Promise<Harness> {
const database = await openInMemoryRelayDatabase()
databases.push(database)
let now = START_MS
@@ -45,67 +35,14 @@ async function setup(cells: RelayCellConfig[] = [FENCED_CELL]): Promise<Harness>
cellIncarnation: `1111111${cells.indexOf(cell)}-1111-4111-8111-111111111111`,
startedAt: 50,
ready,
observedRequests: 0,
...(cell.connectionHardCap === undefined
? {}
: {
totalConnections: 0,
inFlightConnections: 0,
reservedConnectionUnits: 0,
enforcedConnectionUnits: 0,
connectionHardCap: cell.connectionHardCap,
connectionUnobservedBound: cell.connectionUnobservedBound
})
observedRequests: 0
})
}
for (const cell of cells) await heartbeat(cell, true)
return { store, heartbeat, setNow: (value: number) => (now = value) }
}
async function assignFailure(store: RelayAssignmentStore): Promise<unknown> {
return await store.assign(IDENTITY).then(
() => new Error('assign unexpectedly succeeded'),
(error: unknown) => error
)
}
function homeCellError(error: unknown): RelayHomeCellUnavailableError {
expect(error).toBeInstanceOf(RelayHomeCellUnavailableError)
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the assertion above.
return error as RelayHomeCellUnavailableError
}
describe('home cell unavailable', () => {
it('names a readiness failure rather than reporting fleet capacity', async () => {
const { store, heartbeat, setNow } = await setup()
await store.assign(IDENTITY)
setNow(START_MS + 1_000)
await heartbeat(FENCED_CELL, false)
const error = homeCellError(await assignFailure(store))
expect(error.message).toBe('relay_home_cell_unavailable')
expect(error.unavailableCause).toBe('not_ready')
expect(error.cellId).toBe(FENCED_CELL.id)
})
it('names a heartbeat gap as unheard even though the cell last reported ready', async () => {
const { store, setNow } = await setup()
await store.assign(IDENTITY)
setNow(START_MS + HEARTBEAT_TTL_MS + 1)
expect(homeCellError(await assignFailure(store)).unavailableCause).toBe('unheard')
})
it('names a drained cell as draining ahead of its heartbeat gap', async () => {
const { store, setNow } = await setup()
await store.assign(IDENTITY)
await store.configureCell(FENCED_CELL, false)
setNow(START_MS + HEARTBEAT_TTL_MS + 1)
expect(homeCellError(await assignFailure(store)).unavailableCause).toBe('draining')
})
it('rehomes instead of rejecting when the unavailable cell needs no fence', async () => {
const home: RelayCellConfig = {
id: 'home',
@@ -1,62 +0,0 @@
import { describe, expect, it } from 'vitest'
import { AssignmentRejectionLogWindow } from './assignment-rejection-log-window.js'
describe('assignment rejection log window', () => {
it('emits once per key per window and closes it with its own suppressed count', () => {
const timers = manualTimers()
const closed: { key: string; suppressed: number; sample: string }[] = []
const window = new AssignmentRejectionLogWindow<string>({
windowMs: 10_000,
schedule: timers.schedule,
onWindowClosed: (input) => closed.push(input)
})
const key = 'assign:placement:host-rate-limited'
expect(window.admit(key, 'host-a')).toBe(true)
expect(window.admit(key, 'host-b')).toBe(false)
expect(window.admit(key, 'host-c')).toBe(false)
expect(closed).toEqual([])
timers.runPending()
expect(closed).toEqual([{ key, suppressed: 2, sample: 'host-c' }])
// The next window starts clean instead of inheriting the closed window's count.
expect(window.admit(key, 'host-d')).toBe(true)
timers.runPending()
expect(closed).toHaveLength(1)
})
it('keeps distinct keys on independent windows', () => {
const timers = manualTimers()
const window = new AssignmentRejectionLogWindow<string>({
windowMs: 10_000,
schedule: timers.schedule,
onWindowClosed: () => undefined
})
expect(window.admit('assign:placement:host-rate-limited', 'host-a')).toBe(true)
expect(window.admit('assign:placement:queue-full', 'host-a')).toBe(true)
expect(window.admit('assign:placement:queue-full', 'host-a')).toBe(false)
})
})
function manualTimers(): {
schedule: (callback: () => void) => () => void
runPending: () => void
} {
const pending = new Map<number, () => void>()
let nextId = 0
return {
schedule: (callback) => {
const id = nextId++
pending.set(id, callback)
return () => pending.delete(id)
},
runPending: () => {
for (const [id, callback] of [...pending]) {
pending.delete(id)
callback()
}
}
}
}
@@ -1,107 +0,0 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
import type { RelayAssignment } from './assignment-store.js'
import type { RelayConfig } from '../config.js'
const fakes = vi.hoisted(() => ({
verifyRelayToken: vi.fn(async (token: string) => ({
sub: 'user-1',
relayHostId: token
}))
}))
vi.mock('../authentication/relay-token-verifier.js', () => ({
createRelayTokenVerifier: () => fakes.verifyRelayToken,
readBearer: (value: string | undefined) => value?.replace(/^Bearer /, '') ?? null
}))
import { createRelayApp } from '../app.js'
describe('assignment rejection logging', () => {
afterEach(() => {
vi.restoreAllMocks()
})
it('logs the store reason and host digest when assign() rejects on capacity', async () => {
const host = 'hhhhhhhhhhhhhhhh'
const warn = vi.spyOn(console, 'warn').mockImplementation(() => undefined)
const app = createRelayApp(config(), {
store: {} as never,
assignments: {
assign: vi.fn(async () => {
throw new Error('relay_capacity_exhausted')
}),
resolve: vi.fn(async () => assignment('cell-r', host))
} as never,
drain: vi.fn(),
ready: vi.fn(async () => true)
})
const hinted = await app.request('/v1/assign', assignmentRequest(host, { reconnect: true }))
expect(hinted.status).toBe(503)
expect(await hinted.json()).toEqual({ error: 'relay_capacity_exhausted' })
const line = warn.mock.calls
.map((call) => String(call[0]))
.find((entry) => entry.includes('assignment rejected'))
expect(line).toContain('route=assign')
expect(line).toContain('lane=sticky')
expect(line).toContain('hinted=true')
expect(line).toContain('reason=relay_capacity_exhausted')
expect(line).toContain('host=af342ad00ee4')
expect(line).not.toContain(host)
})
})
function assignmentRequest(
relayHostId: string,
extra: Record<string, unknown> = {}
): RequestInit & { headers: Record<string, string> } {
return {
method: 'POST',
headers: {
authorization: `Bearer ${relayHostId}`,
'content-type': 'application/json'
},
body: JSON.stringify({ v: 1, relayHostId, ...extra })
}
}
function assignment(cellId: string, relayHostId: string): RelayAssignment {
return {
userId: 'user-1',
relayHostId,
cellId,
cellUrl: `https://${cellId}.relay.example.test`,
assignmentEpoch: 1,
leaseExpiresAt: Date.now() + 300_000
}
}
function config(overrides: Partial<RelayConfig> = {}): RelayConfig {
return {
port: 8080,
publicUrl: 'https://relay.example.test',
cellUrl: 'https://relay.example.test',
authIssuer: 'https://auth.example.test',
authAudience: 'orca-relay',
jwksUrl: 'https://auth.example.test/jwks',
assignmentSigningKey: new TextEncoder().encode('assignment-key-with-at-least-32-bytes'),
role: 'director',
cellId: 'director',
cells: [],
adminAudience: 'https://relay.example.test/v1/admin/drain',
deployServiceAccount: 'deploy@example.test',
runtimeServiceAccount: 'runtime@example.test',
adminJwksUrl: 'https://auth.example.test/jwks',
databasePoolMax: 3,
publicAssignmentsEnabled: true,
publicAssignmentConcurrency: 2,
publicAssignmentQueueMax: 128,
publicAssignmentWaitMs: 4_000,
publicResolveConcurrency: 1,
publicResolveWaitMs: 5_000,
publicAssignmentRetryAfterSeconds: 5,
dataDir: './data',
...overrides
}
}
@@ -62,15 +62,4 @@ describe('evacuation from reserve-mode cells', () => {
await store.setCellAdmitMode('cell-a', 'db')
expect(await store.completeReadyEvacuations()).toBe(1)
})
it('refuses evacuation status for a reserve cell, where activeCellMigrations would count no units', async () => {
const store = await setup(() => 1_000)
await store.setCellAdmitMode('cell-a', 'reserve')
await expect(store.cellEvacuationStatus('cell-a', 'cell-b', true)).rejects.toThrow(
'cell_in_reserve_mode'
)
await expect(store.cellEvacuationStatus('cell-b', 'cell-a', false)).rejects.toThrow(
'cell_in_reserve_mode'
)
})
})
@@ -64,24 +64,6 @@ describe('assignment reserve-mode behavior', () => {
expect(await store.releaseExpiredActivityLeases()).toBeGreaterThan(0)
})
it('keeps an idle host sticky on a reserve-mode cell where today it would be re-placed', async () => {
let now = 1_000
const store = await setup(() => now)
const identity = { userId: 'user-a', relayHostId: 'host000000000001' }
const first = await store.assign(identity)
await store.changeActivity(identity, 'control', -1)
now += ASSIGNMENT_LIMITS.activityLeaseMs + ASSIGNMENT_LIMITS.dormantTtlMs + 1
await setReserve(store, [first.cellId])
expect(await store.assign(identity)).toMatchObject({
cellId: first.cellId,
assignmentEpoch: first.assignmentEpoch
})
// Not knowing which cells are switched on is treated the same way.
const { unknown, restore } = await unknownSet(() => now)
expect((await unknown.assign(identity)).assignmentEpoch).toBe(first.assignmentEpoch)
await restore()
})
it('keeps a connected host pinned when its reserve cell goes existing-only after a ledger write', async () => {
let now = 1_000
const store = await setup(() => now)
@@ -192,12 +174,6 @@ describe('assignment reserve-mode behavior', () => {
}
})
it('never places a fresh host on a reserve-mode cell through the database', async () => {
const store = await setup(() => 1_000, ['cell-a'])
const placed = await store.assign({ userId: 'user-0', relayHostId: 'host000000000000' })
expect(placed.cellId).toBe('cell-b')
})
it('refuses drains, evacuations and status reads that would treat a reserve-mode cell as empty', async () => {
const store = await setup(() => 1_000, ['cell-a'])
await expect(store.cellDeploymentStatus('cell-a')).rejects.toBeInstanceOf(
@@ -224,25 +200,4 @@ describe('assignment reserve-mode behavior', () => {
await expect(unknown.cellDeploymentStatus('cell-b')).rejects.toThrow('reserve_mode_unknown')
await restore()
})
it('refuses the flip to reserve while a migration names the cell', async () => {
const store = await setup(() => 1_000)
await database!.query(
`INSERT INTO relay_assignment_migrations
(user_id, relay_host_id, source_cell_id, target_cell_id, previous_epoch, assignment_epoch,
source_request_units, target_reserved_units, expires_at, created_at, updated_at)
VALUES ('user-a', 'host000000000001', 'cell-b', 'cell-a', 1, 2, 0, 1, 9999, 1000, 1000)`
)
await expect(store.setCellAdmitMode('cell-a', 'reserve')).rejects.toThrow(
'cell_has_open_migration'
)
expect(await store.cellAdmitMode('cell-a')).toMatchObject({ admitMode: 'db' })
await store.setCellAdmitMode('cell-a', 'db')
await database!.query(`UPDATE relay_assignment_migrations SET aborted_at = 1001`)
await store.setCellAdmitMode('cell-a', 'reserve')
expect(await store.cellAdmitMode('cell-a')).toMatchObject({
admitMode: 'reserve',
updatedAt: 1_000
})
})
})
@@ -140,9 +140,6 @@ async function setup(cells: RelayCellConfig[] = [SOURCE, TARGET]) {
}
}
// The old process stopped heartbeating at START_MS, so it is unheard from here.
const OLD_UNHEARD_AT = START_MS + HEARTBEAT_TTL_MS + 1_000
async function hintedAssign(store: RelayAssignmentStore) {
return await store.assign(IDENTITY, 'us-central1', 'us-central1', undefined, {
hostRequested: true
@@ -204,14 +201,6 @@ describe('a host offline through a roll redials via hinted assign', () => {
await expectRefused(hintedAssign(store), 'unheard')
})
it('is refused on an ordinary readiness dip with no roll stamp', async () => {
const { store, heartbeat, at } = await setup()
await at(20_000)
await heartbeat(SOURCE, { incarnation: NEW_INCARNATION, startedAt: 15_000, ready: false })
await expectRefused(hintedAssign(store), 'not_ready')
})
it('is refused on a migration-only cell parked without a roll stamp', async () => {
const { store, heartbeat, at, park } = await setup()
await park('migration-only')
@@ -222,16 +211,6 @@ describe('a host offline through a roll redials via hinted assign', () => {
})
})
// Residual: the old process is past its TTL and the new one has not heartbeated yet, so
// nothing proves the drained sockets gone. The client's retry lands once the new one is heard.
it('is still refused between the old process going unheard and the new one heartbeating', async () => {
const { store, at, isolateForRoll } = await setup()
await isolateForRoll()
await at(OLD_UNHEARD_AT)
await expectRefused(hintedAssign(store), 'unheard')
})
it('is refused when the roll stamp is stale, even with a new process', async () => {
const { store, heartbeat, at, isolateForRoll } = await setup()
await isolateForRoll()
@@ -1,53 +1,14 @@
import pg from 'pg'
import { afterAll, afterEach, describe, expect, it } from 'vitest'
import { afterEach, describe, expect, it } from 'vitest'
import { RelayAssignmentStore } from '../assignment-store.js'
import type { RelayCellConfig } from '../../config.js'
import {
openInMemoryRelayDatabase,
openRelayDatabase,
type RelayDatabase
} from '../../database/database.js'
import { openInMemoryRelayDatabase, type RelayDatabase } from '../../database/database.js'
const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL
const schema = 'relay_dead_cell_precheck_test'
const CELLS: RelayCellConfig[] = [
{ id: 'cell-a', url: 'https://relay-a.example.com', capacityRequests: 10 },
{ id: 'cell-b', url: 'https://relay-b.example.com', capacityRequests: 10 }
]
function scopedUrl(): string {
const url = new URL(databaseUrl!)
url.searchParams.set('options', `-c search_path=${schema}`)
return url.toString()
}
async function onAdmin(sql: string): Promise<void> {
const client = new pg.Client({ connectionString: databaseUrl })
await client.connect()
try {
await client.query(sql)
} finally {
await client.end()
}
}
const dialects: [string, () => Promise<RelayDatabase>][] = [
['sqlite', openInMemoryRelayDatabase],
...(databaseUrl
? [
[
'postgres',
async () => {
await onAdmin(`DROP SCHEMA IF EXISTS ${schema} CASCADE`)
await onAdmin(`CREATE SCHEMA ${schema}`)
return await openRelayDatabase({ databaseUrl: scopedUrl(), dataDir: '' })
}
] as [string, () => Promise<RelayDatabase>]
]
: [])
]
describe.each(dialects)('dead-cell evacuation pre-check (%s)', (_dialect, open) => {
describe('dead-cell evacuation pre-check', () => {
let database: RelayDatabase | undefined
afterEach(async () => {
@@ -55,12 +16,8 @@ describe.each(dialects)('dead-cell evacuation pre-check (%s)', (_dialect, open)
database = undefined
})
afterAll(async () => {
if (databaseUrl) await onAdmin(`DROP SCHEMA IF EXISTS ${schema} CASCADE`)
})
async function setup(now: () => number) {
database = await open()
database = await openInMemoryRelayDatabase()
const store = new RelayAssignmentStore(database, now, {
requireLiveCells: true,
heartbeatTtlMs: 45_000
@@ -39,31 +39,10 @@ function admitted(result: DrainReturnGrant | DrainReturnDeferral): DrainReturnGr
return result
}
function deferred(result: DrainReturnGrant | DrainReturnDeferral): DrainReturnDeferral {
if (result.kind !== 'deferred') throw new Error('expected a deferral')
return result
}
const host = (index: number): string => `host${String(index).padStart(12, '0')}`
describe('drain-return admission', () => {
it('answers a host’s own early retry with its interval, not a place behind the cohort', async () => {
const { lane } = harness()
admitted(await lane.acquire(host(0))).lease.release()
// A row-busy refusal says "retry in 1 s"; that redial is the host's own.
const repeat = deferred(await lane.acquire(host(0)))
expect(repeat).toMatchObject({
reason: 'host-rate-limited',
retryAfterSeconds: 2
})
// And it booked nothing: the next overflow still gets the first slot.
admitted(await lane.acquire(host(1)))
expect(deferred(await lane.acquire(host(2))).retryAfterSeconds).toBe(2)
})
it('lets a queued placement go before a queued drain return', async () => {
const { lane, placement } = harness({ maxQueued: 1 })
const drain = admitted(await lane.acquire(host(0)))
@@ -64,25 +64,6 @@ describe('public assignment reconnect lane', () => {
expect((await second).status).toBe(200)
})
it('rejects on the fast lane when the verification probe fails transiently', async () => {
const host = 'tttttttttttttttt'
const assign = vi.fn()
const resolve = vi.fn(async () => {
throw Object.assign(new Error('deadlock detected'), { code: '40P01' })
})
const app = createRelayApp(config(), {
store: {} as never,
assignments: { assign, resolve } as never,
drain: vi.fn(),
ready: vi.fn(async () => true)
})
const response = await app.request('/v1/assign', assignmentRequest(host, { reconnect: true }))
expect(response.status).toBe(503)
expect(response.headers.get('retry-after')).toBe('2')
})
it('refuses a dial whose assignment row is busy at once, and frees the fast lane', async () => {
const busy = 'bbbbbbbbbbbbbbbb'
const next = 'nnnnnnnnnnnnnnnn'
@@ -113,38 +94,6 @@ describe('public assignment reconnect lane', () => {
warn.mockRestore()
})
it('asks a busy resume to retry in a second', async () => {
const host = 'rrrrrrrrrrrrrrrr'
const app = createRelayApp(config(), {
store: {
resolveResume: vi.fn(async () => ({ userId: 'user-1', relayDeviceId: 'device-1' }))
} as never,
assignments: {
assign: vi.fn(async () => {
throw new RelayAssignmentRowBusyError()
}),
resolve: vi.fn(async () => null)
} as never,
drain: vi.fn(),
ready: vi.fn(async () => true)
})
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
const response = await app.request('/v1/resolve', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({
v: 1,
relayHostId: host,
resumeToken: Buffer.alloc(32, 1).toString('base64url')
})
})
expect(response.status).toBe(503)
expect(response.headers.get('retry-after')).toBe('1')
expect(await response.json()).toEqual({ error: 'relay_assignment_row_busy' })
warn.mockRestore()
})
})
function assignmentRequest(relayHostId: string, extra: { reconnect?: boolean } = {}): RequestInit {
@@ -39,23 +39,6 @@ async function setup() {
}
describe('idle cutover durable reconciliation', () => {
it('only permits reopening when the exact source still owns the assignment', async () => {
const { store } = await setup()
expect(await store.reconcileIdleRegionalRehome(request)).toBe('not-committed')
await store.activateControl(request, {
cellId: request.sourceCellId,
assignmentEpoch: request.sourceAssignmentEpoch,
generation: request.sourceGeneration + 1,
cellIncarnation: request.sourceCellIncarnation
})
expect(await store.reconcileIdleRegionalRehome(request)).toBe('stale')
})
it('does not reopen an obsolete source after an assignment change', async () => {
const { store } = await setup()
await store.startEvacuation(request, request.targetCellId)
expect(await store.reconcileIdleRegionalRehome(request)).toBe('stale')
})
it('waits for an outstanding assignment transaction before deciding authority', async () => {
const { database, store } = await setup()
@@ -111,15 +111,6 @@ async function setup() {
}
describe('constrained idle regional assignment transaction', () => {
it('sees durable control changes between candidate polls', async () => {
const { store, database, safety } = await setup()
await database.query("UPDATE relay_region_rehome_control SET enabled = 0 WHERE control_id = 'global'")
expect(await store.selectIdleRegionalRehomeCandidates(safety)).toEqual([])
await database.query("UPDATE relay_region_rehome_control SET enabled = 1 WHERE control_id = 'global'")
expect(await store.selectIdleRegionalRehomeCandidates(safety)).toHaveLength(1)
await database.query("UPDATE relay_region_rehome_control SET enabled = 0 WHERE control_id = 'global'")
expect(await store.selectIdleRegionalRehomeCandidates(safety)).toEqual([])
})
it.each([10, 11])('reserves source activity plus assignment at target capacity %i', async (capacity) => {
const { store, database, safety, request } = await setup()
@@ -321,7 +312,6 @@ describe('constrained idle regional assignment transaction', () => {
})
expect(await database.query('SELECT * FROM relay_region_rehome_attempts')).toEqual([])
})
})
function holdStatement(database: RelayDatabase, fragment: string) {
@@ -220,23 +220,4 @@ describe('idle regional rehome candidate window', () => {
expect(seen.size).toBe(363)
expect(wrapped).toBe(true)
})
it('excludes a host inside its rehome cooldown and takes it back after', async () => {
const { store, database, safety, now } = await setup()
await seedHost(store, identity)
await database.query(
`INSERT INTO relay_region_rehome_attempts
(attempt_id, user_id, relay_host_id, preferred_region, source_cell_id, source_cell_incarnation,
target_cell_id, target_cell_incarnation, previous_epoch, assignment_epoch, drain_grace_ms,
send_attempts, created_at, updated_at)
VALUES ('cooled', ?, ?, 'asia-east2', 'us', ?, 'asia-idle', ?, 0, 9, 0, 0, ?, ?)`,
[identity.userId, identity.relayHostId, incarnations[0], incarnations[2], now - 1_000, now]
)
expect(await store.selectIdleRegionalRehomeCandidates(safety)).toEqual([])
await database.query('UPDATE relay_region_rehome_attempts SET created_at = ?', [
now - 604_800_000 - 1
])
expect(await store.selectIdleRegionalRehomeCandidates(safety)).toHaveLength(3)
})
})
@@ -85,15 +85,6 @@ describe('persisted region decisions across director restart', () => {
.toMatchObject({ reportStatus: 'stale' })
})
it('uses server expiry after a restart regardless of an old client report', async () => {
const context = await setup()
context.setNow(context.window.expiresAt)
const restarted = await context.restart()
expect(await restarted.store.exchangeRegionCorrection(identity, context.report, context.window.assignmentEpoch))
.toMatchObject({ reportStatus: 'expired' })
expect(await restarted.store.previewRegionCorrection()).toEqual({ expired: 1 })
})
it('does not interpret a persisted future-policy window using the old policy after rollback', async () => {
const context = await setup()
await context.database.query('UPDATE relay_region_decisions SET policy_version = 2')
@@ -105,15 +96,4 @@ describe('persisted region decisions across director restart', () => {
expect(row.preferred_region).toBeNull()
expect(row.report_json).toBeNull()
})
it('keeps generation ordering when the server clock moves backwards across restart', async () => {
const context = await setup()
context.setNow(1_000_000_000 - 60_000)
const restarted = await context.restart()
const successor = (await context.issue(restarted.store)).window!
expect(successor.generation).toBe(2)
expect(successor.expiresAt).toBe(context.window.expiresAt - 60_000)
expect(await restarted.store.exchangeRegionCorrection(identity, context.report, context.window.assignmentEpoch))
.toMatchObject({ reportStatus: 'stale' })
})
})
@@ -147,53 +147,6 @@ describe('ordered region decisions and migration outcomes', () => {
).toMatchObject({ reportStatus: 'stale' })
})
it('compares with assigned region, preserves hints, and never extends a window on report', async () => {
const context = await setup()
await context.store.assign(identity, 'asia-east2')
const issued = await window(context)
expect(issued.incumbentRegion).toBe('us-central1')
context.advance(50)
await context.store.exchangeRegionCorrection(
identity,
{
v: 1,
action: 'report',
generation: issued.generation,
assignmentEpoch: issued.assignmentEpoch,
policyVersion: 1,
outcome: 'conclusive',
measurements: { 'us-central1': 110, 'asia-east2': 90 }
},
issued.assignmentEpoch
)
expect(await context.store.previewRegionCorrection()).toEqual({ ineligible: 1 })
const row = (await context.database.query(`SELECT * FROM relay_region_decisions`))[0]!
expect(Number(row.expires_at)).toBe(issued.expiresAt)
const hint = (
await context.database.query(
`SELECT preferred_region FROM relay_assignment_region_preferences WHERE user_id = ?`,
[identity.userId]
)
)[0]
expect(hint?.preferred_region).toBe('asia-east2')
context.advance(24 * 60 * 60_000)
expect(
await context.store.exchangeRegionCorrection(
identity,
{
v: 1,
action: 'report',
generation: issued.generation,
assignmentEpoch: issued.assignmentEpoch,
policyVersion: 1,
outcome: 'inconclusive',
reason: 'late'
},
issued.assignmentEpoch
)
).toMatchObject({ reportStatus: 'expired' })
})
it('rejects stale assignment basis and requires both thresholds', async () => {
const context = await setup()
for (const measurements of [
@@ -30,68 +30,6 @@ const targetIncarnation = '22222222-2222-4222-8222-222222222222'
describe('regional rehome assignment state', () => {
it('moves one live preferred host and completes without disabling its source cell', async () => {
const context = await setup()
const identity = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' }
const neighbor = { userId: 'user-2', relayHostId: 'ponmlkjihgfedcba' }
const sourceControl = await activatePreferredSource(context, identity)
await activateSource(context, neighbor)
const attempt = await context.store.tryIdleRehome()
expect(attempt).toMatchObject({
userId: identity.userId,
relayHostId: identity.relayHostId,
sourceCellId: source.id,
sourceCellIncarnation: sourceIncarnation,
targetCellId: target.id,
targetCellIncarnation: targetIncarnation,
previousEpoch: 1,
assignmentEpoch: 2,
sendAttempts: 1
})
expect(await context.store.resolve(neighbor)).toMatchObject({ cellId: source.id })
expect(await context.store.completeReadyRegionalRehomes()).toBe(0)
expect(
await context.database.query(
'SELECT drain_outcome FROM relay_region_rehome_attempts WHERE attempt_id = ?',
[attempt!.attemptId]
)
).toEqual([{ drain_outcome: 'accepted' }])
const targetControl = await context.store.activateControl(identity, {
cellId: target.id,
assignmentEpoch: 2,
generation: 1
})
await context.store.markMigrationTargetRegistered(identity, {
cellId: target.id,
assignmentEpoch: 2
})
expect(await context.store.completeReadyRegionalRehomes()).toBe(0)
await context.store.releaseActivity(identity, sourceControl)
expect(await context.store.completeReadyRegionalRehomes()).toBe(1)
expect(await context.store.resolve(identity)).toMatchObject({
cellId: target.id,
assignmentEpoch: 2
})
expect(await context.store.resolve(neighbor)).toMatchObject({ cellId: source.id })
expect(
await context.database.query(
`SELECT completed_at, aborted_at FROM relay_assignment_migrations
WHERE user_id = ? AND relay_host_id = ?`,
[identity.userId, identity.relayHostId]
)
).toEqual([{ completed_at: context.now(), aborted_at: null }])
expect(
await context.database.query(
`SELECT drain_receipt_at, completed_at, aborted_at FROM relay_region_rehome_attempts`
)
).toEqual([{ drain_receipt_at: context.now(), completed_at: context.now(), aborted_at: null }])
expect(targetControl).toMatch(/^control:/)
await context.database.close()
})
it('completes healthy candidates past a poisoned attempt and logs it', async () => {
const context = await setup()
const poisoned = { userId: 'user-1', relayHostId: 'abcdefghijklmnop' }
@@ -146,8 +84,6 @@ describe('regional rehome assignment state', () => {
).toEqual([{ completed_at: context.now() }])
await context.database.close()
})
})
type Context = Awaited<ReturnType<typeof setup>>
@@ -251,18 +187,6 @@ async function activatePreferredSource(
return control
}
async function activateSource(
context: Context,
identity: { userId: string; relayHostId: string }
): Promise<string> {
const assignment = await context.store.assign(identity, undefined, 'us-central1')
return await context.store.activateControl(identity, {
cellId: source.id,
assignmentEpoch: assignment.assignmentEpoch,
generation: 1
})
}
async function heartbeat(
store: IdleRehomeTestStore,
cell: typeof source | typeof target,
@@ -45,16 +45,6 @@ describe('Relay regional placement', () => {
afterEach(async () => await database.close())
it('falls back globally only when the target region has no safe general cell', async () => {
await store.configureCell(CELLS[1]!, 'migration-only')
await store.configureCell(CELLS[2]!, 'migration-only')
await store.configureCell(CELLS[3]!, 'migration-only')
await expect(
store.assign({ userId: 'fallback-user', relayHostId: 'fallbackhost0001' }, 'asia-east2')
).resolves.toMatchObject({ cellId: 'us-c1', region: 'us-central1' })
})
it('preserves sticky assignments while updating only explicit preferences', async () => {
const identity = { userId: 'sticky-user', relayHostId: 'stickyhost000001' }
await expect(store.assign(identity)).resolves.toMatchObject({ cellId: 'us-c1' })
@@ -219,20 +209,4 @@ describe('Relay regional placement', () => {
})
})
it('expires identity-linked region preferences after 30 days', async () => {
const identity = { userId: 'expiry-user', relayHostId: 'expiryhost000001' }
await store.assign(identity, 'asia-east2')
now += 30 * 24 * 60 * 60_000
await expect(store.releaseExpiredRegionPreferences()).resolves.toBe(0)
now += 1
await expect(store.releaseExpiredRegionPreferences()).resolves.toBe(1)
await expect(
database.query(
`SELECT preferred_region FROM relay_assignment_region_preferences
WHERE user_id = ? AND relay_host_id = ?`,
[identity.userId, identity.relayHostId]
)
).resolves.toEqual([])
})
})
@@ -26,20 +26,6 @@ describe('reserve ledger writer', () => {
)
)[0]
it('writes a booked join, and only a higher epoch replaces it', async () => {
const { database: db, writer } = await setup()
writer.enqueue({ ...HOST, cellId: 'c1', epoch: 5 })
await writer.flush()
expect(await row(db)).toMatchObject({ cell_id: 'c1', assignment_epoch: 5 })
writer.enqueue({ ...HOST, cellId: 'c2', epoch: 4 })
writer.enqueue({ ...HOST, cellId: 'c3', epoch: 5 })
await writer.flush()
expect(await row(db)).toMatchObject({ cell_id: 'c1', assignment_epoch: 5 })
writer.enqueue({ ...HOST, cellId: 'c2', epoch: 6 })
await writer.flush()
expect(await row(db)).toMatchObject({ cell_id: 'c2', assignment_epoch: 6 })
})
it('drops a moved row’s counters but keeps a same-cell row’s', async () => {
const { database: db, writer } = await setup()
await db.query(
@@ -1,314 +0,0 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
import type { RelayConfig } from './config.js'
vi.mock('./authentication/admin-token-verifier.js', () => ({
createAdminTokenVerifier: () => async (token: string) => token === 'deploy-token',
createReadOnlyAdminTokenVerifier: () => async () => false,
createRegionalRehomeControlApplyTokenVerifier: () => async () => false,
createRegionalRehomeRuntimeTokenVerifier: () => async () => false,
createRegionalRehomeTokenVerifier: () => async () => false,
createRuntimeTokenVerifier: () => async () => false
}))
vi.mock('./authentication/relay-token-verifier.js', () => ({
createRelayTokenVerifier: () => async () => null,
readBearer: (value: string | undefined) => value?.replace(/^Bearer /, '') ?? null
}))
import { createRelayApp } from './app.js'
import { RelayAssignmentStore } from './assignment/assignment-store.js'
import type { CellReserveClient } from './cell/reservations/cell-reserve-client.js'
import { openInMemoryRelayDatabase, type RelayDatabase } from './database/database.js'
import { ReserveAssignment, type ReservePlacementMode } from './assignment/reserve-placement/reserve-assignment.js'
import { ReservePlacer } from './assignment/reserve-placement/reserve-placement.js'
import {
ShadowSeatDirectory,
type SeatFeedCell,
type SeatFeedResponse
} from './cell/seats/shadow-seat-directory.js'
const INCARNATION = '11111111-1111-4111-8111-111111111111'
const CELLS = [
{ id: 'cell-a', url: 'https://relay-a.example.com', capacityRequests: 10 },
{ id: 'cell-b', url: 'https://relay-b.example.com', capacityRequests: 10 }
]
const PER_HOST_FIELDS = [
'reservedRequests',
'assignments',
'activityLeases',
'activityRequestUnits',
'restartBlockingActivityLeases',
'restartBlockingActivityRequestUnits',
'restartBlockingReservedRequests',
'outgoingMigrations',
'incomingMigrations'
]
function feed(cellId: string, overrides: Partial<SeatFeedResponse> = {}): SeatFeedResponse {
return {
v: 1,
cellId,
incarnation: INCARNATION,
seq: 1,
at: 0,
draining: false,
counts: { seats: 40, controls: 42, bookings: 3, units: 45, ceiling: 500 },
intake: { perSec: 5, burst: 20, tokens: 20 },
flagsApplied: { generation: 3, flags: { admitMode: 'reserve' } },
admitModeEffective: 'reserve',
admitModeRaw: 'reserve',
full: [],
...overrides
}
}
describe('reserve-aware cell status', () => {
let database: RelayDatabase | undefined
afterEach(async () => {
await database?.close()
database = undefined
})
async function setup(
options: { mode?: ReservePlacementMode; startedAt?: number; placement?: boolean } = {}
) {
const now = { value: 100_000 }
database = await openInMemoryRelayDatabase()
const store = new RelayAssignmentStore(database, () => now.value, { heartbeatTtlMs: 45_000 })
await store.reconcileCells(CELLS)
for (const cell of CELLS) {
await store.recordCellHeartbeat({
cellId: cell.id,
cellUrl: cell.url,
cellIncarnation: INCARNATION,
startedAt: 50,
ready: true,
observedRequests: 0
})
}
await store.assign({ userId: 'user-a', relayHostId: 'host000000000001' })
await store.setCellAdmitMode('cell-a', 'reserve')
const cells: SeatFeedCell[] = CELLS.map((cell) => ({
cellId: cell.id,
cellUrl: cell.url,
region: 'us-central1',
heartbeatExpiresAt: Number.MAX_SAFE_INTEGER,
requiredForComplete: true,
general: true
}))
const directory = new ShadowSeatDirectory()
directory.setCells(cells.map((cell) => cell.cellId))
const reservePlacement = new ReserveAssignment({
mode: options.mode ?? 'on',
directory,
cells: () => cells,
startedAt: options.startedAt ?? 0,
placer: new ReservePlacer(
() => now.value,
() => 0.25
),
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the status route never books or demotes.
client: {} as CellReserveClient,
readRow: async () => null,
now: () => now.value
})
const app = createRelayApp(config(), {
store: {} as never,
assignments: store,
...(options.placement === false ? {} : { reservePlacement }),
drain: vi.fn(),
ready: vi.fn(async () => true)
})
const status = async (body: Record<string, unknown>) =>
await app.request('/v1/admin/cell-status', {
method: 'POST',
headers: { authorization: 'Bearer deploy-token', 'content-type': 'application/json' },
body: JSON.stringify({ v: 1, ...body })
})
return { store, directory, now, status }
}
it('reads a database cell exactly as today, and leaves a reserve cell without per-host counts', async () => {
const { store } = await setup()
expect(await store.reserveAwareCellDeploymentStatus('cell-b')).toEqual({
admitMode: 'db',
status: await store.cellDeploymentStatus('cell-b')
})
await expect(store.cellDeploymentStatus('cell-a')).rejects.toThrow('cell_in_reserve_mode')
const reserve = await store.reserveAwareCellDeploymentStatus('cell-a')
expect(reserve).toMatchObject({
admitMode: 'reserve',
status: {
cellId: 'cell-a',
runtime: { cellIncarnation: INCARNATION, ready: true, heartbeatFresh: true }
}
})
expect(Object.keys(reserve.status).filter((key) => PER_HOST_FIELDS.includes(key))).toEqual([])
await database!.query(
'ALTER TABLE relay_cell_admit_modes RENAME TO relay_cell_admit_modes_gone'
)
const unknown = new RelayAssignmentStore(database!, () => 100_000)
await expect(unknown.reserveAwareCellDeploymentStatus('cell-b')).rejects.toThrow(
'reserve_mode_unknown'
)
})
it('keeps the 404 for a reserve cell without the opt-in, and 400s an unknown view', async () => {
const { status } = await setup()
const refused = await status({ cellId: 'cell-a' })
expect(refused.status).toBe(404)
expect(await refused.json()).toEqual({ error: 'cell_in_reserve_mode' })
expect((await status({ cellId: 'cell-a', view: 'all' })).status).toBe(400)
})
it('answers a reserve cell from the map, with perHost null and never zeros', async () => {
const { directory, now, status } = await setup()
directory.apply('cell-a', feed('cell-a', { draining: true }), now.value, now.value - 1_500)
directory.apply(
'cell-b',
feed('cell-b', { admitModeEffective: 'db', admitModeRaw: 'db' }),
now.value,
now.value
)
now.value += 20_000
const response = await status({ cellId: 'cell-a', view: 'reserve-aware' })
expect(response.status).toBe(200)
const body = await statusBody(response)
expect(body.status).toMatchObject({
cellId: 'cell-a',
admissionState: 'general',
runtime: { cellIncarnation: INCARNATION },
perHost: null,
reserve: {
admitMode: 'reserve',
feedStatus: 'live',
// Reported, not enforced: the caller rejects a stale map.
polledAgeMs: 21_500,
incarnation: INCARNATION,
draining: true,
controls: 42,
seats: 40,
bookings: 3,
units: 45,
ceiling: 500,
intakePerSec: 5,
free: 500 - (45 - 3) - 3
}
})
expect(Object.keys(body.status).filter((key) => PER_HOST_FIELDS.includes(key))).toEqual([])
})
it('reports nulls, not zeros, for a restarted cell that has not applied its reserve switch', async () => {
const { directory, now, status } = await setup()
directory.apply(
'cell-a',
feed('cell-a', {
counts: { seats: 0, controls: 0 },
intake: undefined,
flagsApplied: { generation: 0, flags: {} },
admitModeEffective: 'db',
admitModeRaw: 'db'
}),
now.value,
now.value
)
const body = await statusBody(await status({ cellId: 'cell-a', view: 'reserve-aware' }))
expect(body.status.reserve).toMatchObject({
admitMode: 'db',
bookings: null,
units: null,
ceiling: null,
intakePerSec: null,
free: null
})
})
it('answers a retryable 503 while this director cannot vouch for the cell', async () => {
const unavailable = async (response: Response) => ({
status: response.status,
retryAfter: response.headers.get('Retry-After'),
body: await response.json()
})
const expected = (reason: string) => ({
status: 503,
retryAfter: '5',
body: { error: 'reserve_status_unavailable', reason }
})
for (const options of [{ mode: 'dry-run' as const }, { placement: false }]) {
const { directory, now, status } = await setup(options)
directory.apply('cell-a', feed('cell-a'), now.value, now.value)
expect(await unavailable(await status({ cellId: 'cell-a', view: 'reserve-aware' }))).toEqual(
expected('placement-off')
)
await database?.close()
}
// A starting director with one cell unheard.
const starting = await setup({ startedAt: 99_000 })
starting.directory.apply('cell-a', feed('cell-a'), starting.now.value, starting.now.value)
expect(
await unavailable(await starting.status({ cellId: 'cell-a', view: 'reserve-aware' }))
).toEqual(expected('map-incomplete'))
await database?.close()
const { directory, now, status } = await setup()
directory.apply('cell-b', feed('cell-b'), now.value, now.value)
directory.markNoFeed('cell-a', now.value)
expect(await unavailable(await status({ cellId: 'cell-a', view: 'reserve-aware' }))).toEqual(
expected('no-feed')
)
// A feed without the drain flag or counts is an older image: no feed, never an empty cell.
directory.apply('cell-a', feed('cell-a', { draining: undefined }), now.value, now.value)
expect(await unavailable(await status({ cellId: 'cell-a', view: 'reserve-aware' }))).toEqual(
expected('no-feed')
)
directory.apply('cell-a', feed('cell-a', { counts: undefined }), now.value, now.value)
expect(await unavailable(await status({ cellId: 'cell-a', view: 'reserve-aware' }))).toEqual(
expected('no-feed')
)
// The process that answered the feed is not the one heartbeating the runtime row.
directory.apply(
'cell-a',
feed('cell-a', { incarnation: '22222222-2222-4222-8222-222222222222' }),
now.value,
now.value
)
expect(await unavailable(await status({ cellId: 'cell-a', view: 'reserve-aware' }))).toEqual(
expected('incarnation-mismatch')
)
})
})
async function statusBody(response: Response) {
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the route answers { v, status } on 200.
return (await response.json()) as { v: number; status: Record<string, unknown> }
}
function config(overrides: Partial<RelayConfig> = {}): RelayConfig {
return {
port: 8080,
publicUrl: 'https://relay.example.test',
cellUrl: 'https://relay.example.test',
region: 'us-central1',
authIssuer: 'https://auth.example.test',
authAudience: 'orca-relay',
jwksUrl: 'https://auth.example.test/jwks',
assignmentSigningKey: new Uint8Array(32),
role: 'director',
cellId: 'director',
cells: [],
adminAudience: 'https://relay.example.test/v1/admin/drain',
deployServiceAccount: 'deploy@example.test',
runtimeServiceAccount: 'relay-cell@example.test',
adminJwksUrl: 'https://auth.example.test/jwks',
databasePoolMax: 10,
publicAssignmentsEnabled: true,
publicAssignmentConcurrency: 2,
publicAssignmentQueueMax: 128,
publicAssignmentWaitMs: 4_000,
publicResolveConcurrency: 1,
publicResolveWaitMs: 5_000,
publicAssignmentRetryAfterSeconds: 5,
dataDir: './data',
...overrides
}
}
@@ -1,4 +1,3 @@
import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract/assignment-invariants'
import { createHash } from 'node:crypto'
import { afterEach, describe, expect, it } from 'vitest'
import { RelayAssignmentStore } from '../../assignment/assignment-store.js'
@@ -27,41 +26,6 @@ const BASE_MEMBERSHIP = {
general: ['c1', 'c2', 'c3']
}
class FailAfterIntentDatabase implements RelayDatabase {
private transactionsUntilFailure = Number.POSITIVE_INFINITY
constructor(private readonly delegate: RelayDatabase) {}
failSecondTransaction(): void {
this.transactionsUntilFailure = 2
}
async query(sql: string, params?: unknown[]): Promise<SqlRow[]> {
return await this.delegate.query(sql, params)
}
async queryLocked(
sql: string,
params?: unknown[],
options?: RelayLockOptions
): Promise<SqlRow[]> {
return await this.delegate.queryLocked(sql, params, options)
}
async transaction<T>(operation: (transaction: RelayDatabase) => Promise<T>): Promise<T> {
this.transactionsUntilFailure--
if (this.transactionsUntilFailure === 0) {
this.transactionsUntilFailure = Number.POSITIVE_INFINITY
throw new Error('injected_commit_ambiguity')
}
return await this.delegate.transaction(operation)
}
async close(): Promise<void> {
await this.delegate.close()
}
}
class AfterTransactionDatabase implements RelayDatabase {
private afterTransaction: (() => Promise<void>) | undefined
@@ -154,34 +118,6 @@ describe('relay cell admission selector', () => {
})
})
it('excludes existing-only and migration-only cells from dormant placement', async () => {
let now = 100
const store = await setup(() => now)
const identity = { userId: 'dormant', relayHostId: 'host000000000001' }
const assignment = await store.assign(identity)
const control = await store.activateControl(identity, {
cellId: assignment.cellId,
assignmentEpoch: assignment.assignmentEpoch,
generation: 1
})
await store.releaseActivity(identity, control)
now += ASSIGNMENT_LIMITS.dormantTtlMs + 1
await store.applyCellAdmissionSelector({
attemptId: 'cutover_002',
expectedGeneration: 0,
expectedMembershipSha256: BASE_MEMBERSHIP_SHA256,
membership: INITIAL_MEMBERSHIP
})
await expect(store.rebalanceDormant(identity, 'c2')).rejects.toThrow(
'target_cell_unavailable'
)
await expect(store.rebalanceDormant(identity, 'c3')).resolves.toMatchObject({
cellId: 'c3'
})
})
it('does not recover an unfenced dead existing-only assignment', async () => {
let now = 100
const store = await setup(() => now, true)
@@ -283,94 +219,6 @@ describe('relay cell admission selector', () => {
])
})
it('persists failed CAS intent without mutating current membership', async () => {
const store = await setup(() => 100)
await store.applyCellAdmissionSelector({
attemptId: 'cutover_005',
expectedGeneration: 0,
expectedMembershipSha256: BASE_MEMBERSHIP_SHA256,
membership: INITIAL_MEMBERSHIP
})
await expect(
store.applyCellAdmissionSelector({
attemptId: 'stale_attempt',
expectedGeneration: 5,
membership: {
existingOnly: ['c1'],
migrationOnly: [],
general: ['c2', 'c3']
}
})
).rejects.toThrow('admission_selector_generation_mismatch')
await expect(store.inspectCellAdmissionSelector('stale_attempt')).resolves.toMatchObject({
selector: { generation: 1, membership: INITIAL_MEMBERSHIP },
intent: { state: 'diverged' }
})
})
it('rejects duplicate or incomplete selector membership before mutation', async () => {
const store = await setup(() => 100)
await expect(
store.applyCellAdmissionSelector({
attemptId: 'duplicate_001',
expectedGeneration: 0,
expectedMembershipSha256: BASE_MEMBERSHIP_SHA256,
membership: {
existingOnly: ['c1', 'c1'],
migrationOnly: ['c2'],
general: ['c3']
}
})
).rejects.toThrow('admission_selector_duplicate_cell')
await expect(
store.applyCellAdmissionSelector({
attemptId: 'incomplete_001',
expectedGeneration: 0,
expectedMembershipSha256: BASE_MEMBERSHIP_SHA256,
membership: {
existingOnly: ['c1'],
migrationOnly: ['c2'],
general: []
}
})
).rejects.toThrow('admission_selector_incomplete_membership')
await expect(store.inspectCellAdmissionSelector()).resolves.toMatchObject({
selector: {
generation: 0,
membership: { existingOnly: [], migrationOnly: [], general: ['c1', 'c2', 'c3'] }
}
})
})
it('inspects an unchanged durable intent after an ambiguous apply failure', async () => {
const underlying = await openInMemoryRelayDatabase()
const failingDatabase = new FailAfterIntentDatabase(underlying)
database = failingDatabase
const store = new RelayAssignmentStore(failingDatabase, () => 100)
await store.reconcileCells(CELLS)
failingDatabase.failSecondTransaction()
const input = {
attemptId: 'ambiguous_001',
expectedGeneration: 0,
expectedMembershipSha256: BASE_MEMBERSHIP_SHA256,
membership: INITIAL_MEMBERSHIP
}
await expect(store.applyCellAdmissionSelector(input)).rejects.toThrow(
'injected_commit_ambiguity'
)
await expect(store.inspectCellAdmissionSelector(input.attemptId)).resolves.toMatchObject({
selector: { generation: 0 },
intent: { state: 'unchanged' }
})
await expect(store.applyCellAdmissionSelector(input)).resolves.toMatchObject({
changed: true,
selector: { generation: 1, membership: INITIAL_MEMBERSHIP }
})
})
it('allows only one concurrent CAS and never re-enables legacy cells', async () => {
const store = await setup(() => 100)
await store.applyCellAdmissionSelector({
@@ -416,24 +264,6 @@ describe('relay cell admission selector', () => {
).rejects.toThrow('admission_selector_legacy_reenable')
})
it('preserves the selector boundary across compatible reconciliation', async () => {
const store = await setup(() => 100)
await store.applyCellAdmissionSelector({
attemptId: 'cutover_007',
expectedGeneration: 0,
expectedMembershipSha256: BASE_MEMBERSHIP_SHA256,
membership: INITIAL_MEMBERSHIP
})
await expect(store.reconcileCells(CELLS, false)).resolves.toBeUndefined()
await expect(store.reconcileCells([CELLS[0]!, CELLS[2]!])).rejects.toThrow(
'admission_selector_boundary_active'
)
await expect(store.inspectCellAdmissionSelector()).resolves.toMatchObject({
selector: { generation: 1, membership: INITIAL_MEMBERSHIP }
})
})
it('atomically adds exact migration-only cells after the selector boundary', async () => {
const store = await setup(() => 100)
await store.applyCellAdmissionSelector({
@@ -1,14 +1,11 @@
import { createHash } from 'node:crypto'
import { afterEach, describe, expect, it, vi } from 'vitest'
import { RelayAssignmentStore } from '../../assignment/assignment-store.js'
import { encodeMembership, type CellAdmissionMembership } from './cell-admission-selector.js'
import type { RelayCellConfig } from '../../config.js'
import { openInMemoryRelayDatabase, type RelayDatabase } from '../../database/database.js'
const HEARTBEAT_TTL_MS = 45_000
const BOUND = 60
const OLD_INCARNATION = '11111111-1111-4111-8111-111111111111'
const NEW_INCARNATION = '22222222-2222-4222-8222-222222222222'
function cell(index: number, connectionHardCap: 1_000 | 3_000): RelayCellConfig {
const id = `us-c${String(index).padStart(2, '0')}`
@@ -40,7 +37,7 @@ type Report = {
async function setup(cells: RelayCellConfig[]) {
const database = await openInMemoryRelayDatabase()
databases.push(database)
let now = 100
const now = 100
const store = new RelayAssignmentStore(database, () => now, {
requireLiveCells: true,
heartbeatTtlMs: HEARTBEAT_TTL_MS
@@ -81,32 +78,13 @@ async function setup(cells: RelayCellConfig[]) {
}
return rows
}
const isolateForRoll = async (cellId: string): Promise<void> => {
const current = await store.inspectCellAdmissionSelector()
const membership: CellAdmissionMembership = {
existingOnly: [],
migrationOnly: [cellId],
general: cells.map(({ id }) => id).filter((id) => id !== cellId)
}
await store.applyCellAdmissionSelector({
attemptId: `isolate-${cellId}`,
expectedGeneration: current.selector.generation,
expectedMembershipSha256: createHash('sha256')
.update(encodeMembership(current.selector.membership))
.digest('hex'),
membership,
rollIsolatedCells: [cellId]
})
}
return {
database,
store,
heartbeat,
capacity,
reportedHardCap,
telemetryRows,
isolateForRoll,
setNow: (value: number) => (now = value)
telemetryRows
}
}
@@ -215,63 +193,4 @@ describe('effective connection cap = min(configured, reported)', () => {
harness.store.assign({ userId: 'user-a', relayHostId: 'host000000000001' })
).rejects.toThrow('relay_capacity_exhausted')
})
it('places a mixed fleet against each cell’s own reported cap', async () => {
const small = cell(1, 3_000)
const large = cell(2, 3_000)
const harness = await setup([small, large])
await harness.heartbeat(small, { connectionHardCap: 1_000, units: 840 })
await harness.heartbeat(large, { connectionHardCap: 3_000, units: 840 })
expect(await harness.capacity(small.id)).toMatchObject({ normalAdmissionPause: 840 })
expect(await harness.capacity(large.id)).toMatchObject({ normalAdmissionPause: 2_840 })
for (let index = 0; index < 4; index++) {
await expect(
harness.store.assign({ userId: `user-${index}`, relayHostId: `host00000000000${index}` })
).resolves.toMatchObject({ cellId: large.id })
}
})
it('has no unavailable window while a cell rolls 1,000 -> 3,000', async () => {
const cells = [cell(1, 1_000), cell(2, 1_000)]
const [rolled, neighbour] = cells
const harness = await setup(cells)
const identity = { userId: 'user-a', relayHostId: 'host000000000001' }
await harness.heartbeat(rolled!, { connectionHardCap: 1_000 })
await harness.heartbeat(neighbour!, { connectionHardCap: 1_000, units: 500 })
const home = await harness.store.assign(identity)
expect(home.cellId).toBe(rolled!.id)
await harness.store.reconcileCells(
cells.map((_, index) => cell(index + 1, 3_000)),
true
)
// The old process keeps heartbeating its 1,000 well past the TTL; the host stays sticky.
for (const at of [30_000, 60_000, 90_000]) {
harness.setNow(at)
await harness.heartbeat(rolled!, { connectionHardCap: 1_000 })
await harness.heartbeat(neighbour!, { connectionHardCap: 1_000, units: 500 })
await expect(harness.store.assign(identity)).resolves.toMatchObject({
cellId: rolled!.id,
assignmentEpoch: home.assignmentEpoch
})
}
// The roll isolates the live old process: the isolated-incumbent lane re-places the host.
await harness.isolateForRoll(rolled!.id)
const moved = await harness.store.assign(identity)
expect(moved).toMatchObject({ cellId: neighbour!.id, placed: true })
// The replacement boots and reports the new cap.
harness.setNow(120_000)
await harness.heartbeat(rolled!, {
connectionHardCap: 3_000,
incarnation: NEW_INCARNATION,
startedAt: 110_000
})
expect(await harness.capacity(rolled!.id)).toMatchObject({
effectiveHardCap: 3_000,
heartbeatFresh: true
})
})
})
@@ -77,25 +77,6 @@ describe('control flag channel', () => {
.filter((line) => line.includes(`"event":"${CELL_FLAGS_APPLIED_EVENT}"`))
.map((line): unknown => JSON.parse(line))
it('flips a flag on and back off, logging each applied generation once', async () => {
const google = fakeGoogle(cellObject(5, { readinessLocal: true, ticketCheck: 'shadow' }))
const channel = cellChannel(google.fetchImpl)
await channel.poll()
await channel.poll()
expect(google.state.storageRequests[1]?.searchParams.get('ifGenerationNotMatch')).toBe('5')
google.state.object = cellObject(7, { readinessLocal: false, ticketCheck: 'off' })
await channel.poll()
expect(channel.applied()).toEqual({ generation: 7, flags: CELL_FLAG_DEFAULTS })
expect(appliedLines()).toEqual([
{
event: CELL_FLAGS_APPLIED_EVENT,
generation: 5,
flags: { ...CELL_FLAG_DEFAULTS, readinessLocal: true, ticketCheck: 'shadow' }
},
{ event: CELL_FLAGS_APPLIED_EVENT, generation: 7, flags: CELL_FLAG_DEFAULTS }
])
})
it('keeps the applied values through every kind of lost contact, logging once per cause', async () => {
const google = fakeGoogle(cellObject(5, { readinessLocal: true }))
const channel = cellChannel(google.fetchImpl)
@@ -128,13 +128,4 @@ describe('dead-man trip slots', () => {
expect(seated.socket.readyState).toBe(WebSocket.OPEN)
}, 30_000)
it('without the flag, trips with every slot taken, as before', async () => {
let now = Date.now()
const { database, reserve } = await cell(() => now)
await trippedPeer(database, 'production-gce-c90', now)
await reserve.bookedHost(3)
expect(reserve.relay.sessions.inReserveMode()).toBe(true)
now += reserveDeadManWindowMs(reserve.config.cellId) + 1_000
expect(reserve.relay.sessions.inReserveMode()).toBe(false)
}, 30_000)
})
@@ -55,15 +55,6 @@ describe('ReserveDeadMan', () => {
])
})
it('keeps the plain window for a later reserve write once a director has been in touch', () => {
const { clock, deadMan } = setup(3 * WINDOW_MS)
deadMan.mode(reserve(1))
deadMan.contact()
expect(deadMan.mode(reserve(2))).toBe('reserve')
clock.value += WINDOW_MS + 1
expect(deadMan.mode(reserve(2))).toBe('db')
})
// A claim answered after the director came back must not trip the cell later without a slot.
it('drops a permit for a silence that contact has ended', () => {
const { clock, deadMan, events } = setup()
@@ -50,7 +50,7 @@ const answer = (status: number) => new Response('{}', { status })
// Every cell serves a feed page on the first round; `respond` answers every round after it.
function poller(
respond: (cellId: string) => Response | Promise<Response>,
options: { identityFails?: boolean; cells?: SeatFeedCell[]; neverServed?: ReadonlySet<string> } = {}
options: { cells?: SeatFeedCell[]; neverServed?: ReadonlySet<string> } = {}
) {
let now = 1_000
let round = 0
@@ -66,7 +66,6 @@ function poller(
return round === 0 ? page(cellId) : await respond(cellId)
}),
identityToken: vi.fn(async () => {
if (options.identityFails && round > 0) throw new Error('metadata_unavailable')
return 'token-1'
}),
now: () => now,
@@ -107,13 +106,6 @@ describe('seat-feed poller reachability', () => {
}
})
it('does not blame a cell for a token this director cannot mint', async () => {
const cells = poller((cellId) => page(cellId), { identityFails: true })
const at = await cells.run(CELL_POLL_DEAD_STREAK_MS)
cells.stop()
expect(cells.deadCellVerdict('c2', at)).toBeNull()
})
it('counts only cells that served a feed: legacy 404 rows neither fill the sample nor dilute it', async () => {
// Staging's shape: a few real cells and 16 legacy rows. Every real cell fails.
const cells = poller(() => answer(502), { cells: [...CELLS.slice(0, 3), ...LEGACY] })
@@ -351,17 +351,6 @@ describe('startShadowSeatPoller', () => {
expect(directory.cellState('cell-b')?.flagsApplied).toBeUndefined()
})
it('completes without a cell that is dead, empty or isolated', async () => {
const cell = poller({ 'cell-a': () => json(feed({ seq: 1, full: [] })) }, 'all', async () => [
CELLS[0]!,
{ ...CELLS[1]!, requiredForComplete: false }
])
await cell.tick()
cell.stop()
expect(cell.directory.cellState('cell-b')).toMatchObject({ status: 'pending' })
expect(cell.directory.isComplete()).toBe(true)
})
it('treats a malformed or mislabelled body as unverifiable', async () => {
const cell = poller({
'cell-a': () => json({ v: 2 }),
@@ -2,11 +2,9 @@ import { mkdtempSync, rmSync } from 'node:fs'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { afterEach, describe, expect, it, vi } from 'vitest'
import { reserveDeadManWindowMs } from '../cell/reservations/cell-reserve-dead-man.js'
import { openRelayDatabase } from '../database/database.js'
import {
nextFrame,
RESERVE_MODE_CELL_ID,
startReserveModeCell
} from '../test-fixtures/reserve-mode-cell.js'
import { StatementRecordingDatabase } from '../test-fixtures/statement-recording-database.js'
@@ -22,14 +20,6 @@ const OTHER_CELL = {
capacityRequests: 900
}
async function until(check: () => Promise<boolean>, timeoutMs = 10_000): Promise<void> {
const deadline = Date.now() + timeoutMs
while (!(await check())) {
if (Date.now() > deadline) throw new Error('condition not reached')
await new Promise((resolve) => setTimeout(resolve, 50))
}
}
describe('the memory phone path', () => {
const cleanup: Array<() => Promise<void> | void> = []
@@ -67,14 +57,12 @@ describe('the memory phone path', () => {
// A phone resumed and spliced to its desktop, waiting to confirm.
async function splicedPhone(
phonePath: 'db' | 'memory',
device: { expiresAt?: number } = {},
clock: { now?: () => number; beforeDial?: () => void } = {}
device: { expiresAt?: number } = {}
) {
const reserve = await cell(clock.now)
const reserve = await cell()
reserve.setAdmitMode('reserve', { phonePath })
const seated = await reserve.bookedHost(3)
await reserve.installDevice(seated.identity.hostId, TOKEN, device)
clock.beforeDial?.()
const connOpen = nextFrame(seated.socket, 'conn-open')
const phone = await reserve.dialPhone(seated.identity.hostId, TOKEN)
const basisConnId = String((await connOpen).connId)
@@ -97,44 +85,6 @@ describe('the memory phone path', () => {
const deviceRow = async (reserve: Awaited<ReturnType<typeof cell>>) =>
(await reserve.raw.query(`SELECT current_expires_at FROM relay_devices`))[0]
it('admits a seated phone resume without an activity lease', async () => {
const { reserve, seated } = await seatedPhoneHost('memory')
const connOpen = nextFrame(seated.socket, 'conn-open')
const phone = await reserve.dialPhone(seated.identity.hostId, TOKEN)
expect(await connOpen).toMatchObject({ kind: 'resume', relayDeviceId: 'device-1' })
await reserve.attachData(await connOpen, seated.ack.generation)
expect(await phone.hello).toMatchObject({
type: 'relay-hello',
ok: true,
credentialKind: 'resume'
})
expect(await reserve.activityLeases()).toEqual([])
})
it('persists the connection basis and activity leases while phonePath is db', async () => {
const { reserve, seated } = await seatedPhoneHost('db')
const connOpen = nextFrame(seated.socket, 'conn-open')
const phone = await reserve.dialPhone(seated.identity.hostId, TOKEN)
await reserve.attachData(await connOpen, seated.ack.generation)
expect(await phone.hello).toMatchObject({ type: 'relay-hello', ok: true })
expect((await reserve.activityLeases()).map((lease) => lease.activity_kind).sort()).toEqual([
'confirmation',
'splice'
])
expect(
await reserve.raw.query(
`SELECT basis_conn_id, relay_device_id, credential_kind, active FROM relay_connection_bases`
)
).toEqual([
{
basis_conn_id: String((await connOpen).connId),
relay_device_id: 'device-1',
credential_kind: 'resume',
active: 1
}
])
})
it('closes a revoked or expired device 4401', async () => {
const reserve = await cell()
reserve.setAdmitMode('reserve', { phonePath: 'memory' })
@@ -275,24 +225,6 @@ describe('the memory phone path', () => {
expect(await confirm('confirm-2')).toMatchObject({ code: 'confirmation_not_active' })
})
it('answers a grace-version confirm renewed:false with its expiry unchanged, as today', async () => {
const { reserve, confirm } = await splicedPhone('memory')
const stored = Number((await deviceRow(reserve))?.current_expires_at)
// An install rotated the credential after the accept read, so the accepted version is grace.
await reserve.raw.query(
`UPDATE relay_devices SET grace_hash = current_hash, grace_version = 1, grace_expires_at = ?,
current_hash = 'rotated', current_version = 2`,
[Date.now() + 60_000]
)
expect(await confirm('confirm-1')).toMatchObject({
type: 'device-resume-confirmed',
currentVersion: 2,
acceptedAs: 'current',
renewed: false,
resumeExpiresAt: stored
})
})
it('durably confirms and renews a database-path resume, releasing only its confirmation lease', async () => {
const { reserve, confirm, basisConnId } = await splicedPhone('db')
const before = Number((await deviceRow(reserve))?.current_expires_at)
@@ -314,70 +246,6 @@ describe('the memory phone path', () => {
expect(await confirm('confirm-1')).toEqual(answer)
})
describe('rolling a memory cell back', () => {
// Flip back by the switch, or by the dead-man; either way the confirm finishes from memory.
type Cell = Awaited<ReturnType<typeof cell>>
type Advance = (ms: number) => void
type Rollback = {
beforeDial?: (advance: Advance) => void
roll: (reserve: Cell, advance: Advance) => void
}
// The dead-man trips just after the phone's accept: its window ran from the host's booking.
const window = reserveDeadManWindowMs(RESERVE_MODE_CELL_ID)
const rollbacks: Record<string, Rollback> = {
'admitMode=db': { roll: (reserve) => reserve.setAdmitMode('db', { phonePath: 'memory' }) },
'phonePath=db': { roll: (reserve) => reserve.setAdmitMode('reserve', { phonePath: 'db' }) },
'a dead-man trip': {
beforeDial: (advance) => advance(window - 5_000),
roll: (_reserve, advance) => advance(6_000)
}
}
for (const [name, rollback] of Object.entries(rollbacks)) {
it(`finishes an in-flight confirm on its memory basis after ${name}, writing and leaking no lease`, async () => {
let now = Date.now()
const advance: Advance = (ms) => {
now += ms
}
const spliced = await splicedPhone(
'memory',
{},
{
now: () => now,
beforeDial: () => rollback.beforeDial?.(advance)
}
)
const { reserve, seated } = spliced
// The flag tool records reserve in Postgres before the cell admits from memory.
await reserve.relay.assignments.reconcileCells([...reserve.config.cells, OTHER_CELL])
await reserve.relay.assignments.setCellAdmitMode(reserve.config.cellId, 'reserve')
rollback.roll(reserve, advance)
expect(reserve.relay.sessions.phonePathEffective()).toBe('db')
expect(await spliced.confirm('confirm-1')).toMatchObject({
type: 'device-resume-confirmed',
renewed: true
})
// Only the control lease a flip back re-registers; nothing for the phone.
const leases = async () =>
(await reserve.activityLeases()).map((lease) => lease.activity_kind)
expect((await leases()).filter((kind) => kind !== 'control')).toEqual([])
// Postgres still records reserve, so evacuation leaves the cell alone.
await expect(
reserve.relay.assignments.startEvacuation(
{ userId: 'user-1', relayHostId: seated.identity.hostId },
OTHER_CELL.id
)
).rejects.toThrow('cell_in_reserve_mode')
// The splice still runs, and closing it releases nothing it never took.
expect(spliced.phone.socket.readyState).toBe(spliced.phone.socket.OPEN)
await until(async () => reserve.relay.sessions.reregistrationPending() === 0)
spliced.phone.socket.close()
await spliced.phone.closed
expect((await leases()).filter((kind) => kind !== 'control')).toEqual([])
})
}
})
// E-dep-6 in miniature: the staging drill blocks one memory cell's database for 10 minutes.
it('rides out a database outage: splices keep forwarding, new work fails cleanly and recovers', async () => {
let now = Date.now()
@@ -1,329 +0,0 @@
import { EventEmitter } from 'node:events'
import { CONTROL_CONTINUITY_LIMITS } from '@orca-cloud/relay-contract/control-continuity'
import { RELAY_CLOSE_CODE } from '@orca-cloud/relay-contract/close-codes'
import { RELAY_HOST_CAPABILITY_IDLE_REGIONAL_REHOME } from '@orca-cloud/relay-contract/control-messages'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import type WebSocket from 'ws'
import type { RelayAssignmentStore } from '../assignment/assignment-store.js'
import type { RelayConfig } from '../config.js'
import type { RelayCredentialStore } from '../credentials/credential-store.js'
import { CONTROL_RENEWAL_BATCH_INTERVAL_MS } from '../control-leases/control-renewal-batch.js'
import type {
ControlRenewalOutcome
} from '../control-leases/control-renewal-statement.js'
import {
HostSessionRegistry,
IDLE_REHOME_MIN_CONTROL_AGE_MS,
type HostSession
} from './host-session-registry.js'
import type { RelayRuntimeObserver } from '../observability/relay-observability.js'
import type { RelayTokenClaims } from '../authentication/relay-token-verifier.js'
import { ProcessQueuedByteBudget } from './splice-forwarder.js'
// A due renewal leaves the heartbeat as a batch enqueue, so the store only sees
// the tick once the batch window closes.
async function closeRenewalWindow(): Promise<void> {
await vi.advanceTimersByTimeAsync(CONTROL_RENEWAL_BATCH_INTERVAL_MS)
}
class FakeSocket extends EventEmitter {
readonly OPEN = 1
readonly CLOSING = 2
readonly CLOSED = 3
readyState = this.OPEN
readonly send = vi.fn()
readonly close = vi.fn((code?: number, reason?: string) => {
this.readyState = this.CLOSED
this.emit('close', code, Buffer.from(reason ?? ''))
})
readonly terminate = vi.fn(() => {
this.readyState = this.CLOSED
this.emit('close')
})
}
type ActivateSession = (
socket: WebSocket,
identity: RelayTokenClaims,
existing: HostSession | null,
generation: number,
rebind: boolean,
assignmentEpoch: number,
appVersion?: string
) => Promise<void>
const config = {
port: 8080,
publicUrl: 'https://relay-c3.example.com',
cellUrl: 'https://relay-c3.example.com',
authIssuer: 'https://auth.example.com',
authAudience: 'orca-relay',
jwksUrl: 'https://auth.example.com/jwks',
assignmentSigningKey: new Uint8Array(32),
role: 'cell',
cellId: 'production-gce-c3',
cells: [
{
id: 'production-gce-c3',
url: 'https://relay-c3.example.com',
capacityRequests: 4_000
}
],
adminAudience: 'https://relay-c3.example.com/v1/admin/drain',
deployServiceAccount: 'deploy@example.com',
runtimeServiceAccount: 'runtime@example.com',
adminJwksUrl: 'https://auth.example.com/admin-jwks',
databasePoolMax: 10,
publicAssignmentsEnabled: true,
publicAssignmentConcurrency: 2,
publicAssignmentQueueMax: 128,
publicAssignmentWaitMs: 4_000,
publicResolveConcurrency: 1,
publicResolveWaitMs: 5_000,
publicAssignmentRetryAfterSeconds: 5,
dataDir: './test-data'
} satisfies RelayConfig
const identity = {
sub: 'user-1',
prof: 'profile-1',
relayHostId: 'abcdefghijklmnop',
purpose: 'host-control',
exp: 4_102_444_800
} satisfies RelayTokenClaims
function deferred<T>(): {
promise: Promise<T>
resolve(value: T): void
} {
let resolve!: (value: T) => void
const promise = new Promise<T>((complete) => {
resolve = complete
})
return { promise, resolve }
}
function createRegistry(
activateControl: RelayAssignmentStore['activateControl'],
store: Partial<RelayCredentialStore> = {},
verifyRelayToken: (token: string) => Promise<RelayTokenClaims | null> = vi.fn()
): {
registry: HostSessionRegistry
activate: ActivateSession
acquireActivity: ReturnType<typeof vi.fn>
renewControlActivities: ReturnType<typeof vi.fn<RelayAssignmentStore['renewControlActivities']>>
releaseActivity: ReturnType<typeof vi.fn>
observer: {
recordAuth: ReturnType<typeof vi.fn>
recordControlClose: ReturnType<typeof vi.fn>
recordPostProofClose: ReturnType<typeof vi.fn>
recordSpliceClose: ReturnType<typeof vi.fn>
}
} {
const acquireActivity = vi.fn().mockResolvedValue(undefined)
const releaseActivity = vi.fn().mockResolvedValue(true)
const renewControlActivities = vi
.fn<RelayAssignmentStore['renewControlActivities']>()
.mockImplementation(async (rows) => rows.map(() => 'renewed'))
const assignments = {
activateControl,
markMigrationTargetRegistered: vi.fn().mockResolvedValue(undefined),
resolve: vi.fn().mockResolvedValue({ cellId: config.cellId }),
acquireActivity,
renewControlActivities,
releaseActivity
} as unknown as RelayAssignmentStore
const observer = {
recordAuth: vi.fn(),
recordForwardedBytes: vi.fn(),
recordHttp: vi.fn(),
recordReconnect: vi.fn(),
recordSql: vi.fn(),
recordControlClose: vi.fn(),
recordPostProofClose: vi.fn(),
recordSpliceClose: vi.fn()
} satisfies RelayRuntimeObserver
const registry = new HostSessionRegistry(
config,
verifyRelayToken,
store as RelayCredentialStore,
assignments,
new ProcessQueuedByteBudget(),
observer,
Date.now,
Math.random,
'incarnation-1'
)
// Mirrors the production signature exactly so a future positional shift fails to compile.
const bound = (
registry as unknown as {
activate: (
socket: WebSocket,
identity: RelayTokenClaims,
existing: HostSession | null,
generation: number,
rebind: boolean,
assignmentEpoch: number,
appVersion: string,
connectionInclusionWatermark?: number
) => Promise<void>
}
).activate.bind(registry)
const activate: ActivateSession = (
socket,
identity,
existing,
generation,
rebind,
assignmentEpoch,
appVersion = '1.4.173'
) => bound(socket, identity, existing, generation, rebind, assignmentEpoch, appVersion)
return {
registry,
activate,
acquireActivity,
renewControlActivities,
releaseActivity,
observer
}
}
describe('host session cleanup races', () => {
beforeEach(() => vi.useFakeTimers())
afterEach(() => {
vi.clearAllTimers()
vi.useRealTimers()
})
// c34 ghost seat came from activation outliving orphan grace and reviving a removed session outside the map.
it('refuses a rebind whose session left the map while its activation was in flight', async () => {
const blocked = deferred<string>()
const activateControl = vi
.fn<RelayAssignmentStore['activateControl']>()
.mockResolvedValueOnce('control:production-gce-c3:1')
.mockReturnValueOnce(blocked.promise)
const { registry, activate, releaseActivity } = createRegistry(activateControl)
const key = { userId: identity.sub, relayHostId: identity.relayHostId }
const originalSocket = new FakeSocket()
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: FakeSocket implements the registry's WebSocket event and lifecycle surface.
await activate(originalSocket as unknown as WebSocket, identity, null, 1, false, 1)
const original = registry.get(key)
originalSocket.close(1006, 'network reset')
expect(original?.state).toBe('orphaned')
const rebindSocket = new FakeSocket()
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: FakeSocket implements the registry's WebSocket event and lifecycle surface.
const rebinding = activate(rebindSocket as unknown as WebSocket, identity, original, 1, true, 1)
await vi.advanceTimersByTimeAsync(0)
// The grace runs out while the database answers slowly.
await vi.advanceTimersByTimeAsync(CONTROL_CONTINUITY_LIMITS.orphanGraceMs)
expect(registry.get(key)).toBeNull()
blocked.resolve('control:production-gce-c3:1')
await rebinding
expect(rebindSocket.close).toHaveBeenCalledWith(
RELAY_CLOSE_CODE.PEER_DROPPED,
'control activation superseded'
)
expect(registry.get(key)).toBeNull()
expect(original?.state).toBe('closed')
const page = registry.seatFeed(null)
expect('full' in page && page.full).toEqual([])
expect(releaseActivity).toHaveBeenCalledWith(key, 'control:production-gce-c3:1')
})
it('ignores a denial belonging to the socket before a same-generation rebind', async () => {
const h = createRegistry(vi.fn().mockResolvedValue('control:production-gce-c3:1'))
const oldSocket = new FakeSocket()
await h.activate(oldSocket as unknown as WebSocket, identity, null, 1, false, 1)
const session = h.registry.get({ userId: identity.sub, relayHostId: identity.relayHostId })!
let finish!: (outcomes: ControlRenewalOutcome[]) => void
h.renewControlActivities.mockReturnValueOnce(
new Promise<ControlRenewalOutcome[]>((resolve) => {
finish = resolve
})
)
await vi.advanceTimersByTimeAsync(15_000)
await closeRenewalWindow()
const replacement = new FakeSocket()
await h.activate(replacement as unknown as WebSocket, identity, session, 1, true, 1)
finish(['activity_cell_not_authoritative'])
await vi.advanceTimersByTimeAsync(0)
expect(replacement.close).not.toHaveBeenCalled()
expect(session.socket).toBe(replacement)
expect(session.generation).toBe(1)
})
})
describe('source-owned idle cutover', () => {
beforeEach(() => vi.useFakeTimers())
afterEach(() => {
vi.clearAllTimers()
vi.useRealTimers()
})
const request = {
attemptId: 'idle-1',
userId: identity.sub,
relayHostId: identity.relayHostId,
sourceAssignmentEpoch: 1,
sourceGeneration: 1,
sourceCellIncarnation: 'incarnation-1',
targetCellId: 'target'
}
async function source() {
const h = createRegistry(vi.fn().mockResolvedValue('control:1'))
const socket = new FakeSocket()
h.registry.acceptControl(
socket as unknown as WebSocket,
identity,
undefined,
new Set([RELAY_HOST_CAPABILITY_IDLE_REGIONAL_REHOME])
)
socket.removeAllListeners('message')
await h.activate(socket as unknown as WebSocket, identity, null, 1, false, 1)
// Moves the clock without firing the heartbeat timers that would close the session.
vi.setSystemTime(Date.now() + IDLE_REHOME_MIN_CONTROL_AGE_MS)
return { ...h, socket, session: h.registry.get(request)! }
}
it('rejects new accepts and replacements synchronously while a commit awaits', async () => {
const h = await source()
const result = deferred<{ outcome: 'deferred' }>()
const commit = vi.fn().mockReturnValue(result.promise)
const moving = h.registry.idleRehome(
request,
commit,
vi.fn().mockResolvedValue('not-committed')
)
const duplicate = h.registry.idleRehome(
request,
commit,
vi.fn().mockResolvedValue('not-committed')
)
const client = new FakeSocket()
const release = vi.fn()
await h.registry.acceptClient(
client as unknown as WebSocket,
identity.relayHostId,
'credential',
{ release } as never
)
expect(client.close).toHaveBeenCalledWith(RELAY_CLOSE_CODE.WRONG_CELL, expect.any(String))
expect(release).toHaveBeenCalledOnce()
const replacement = new FakeSocket()
await h.activate(replacement as unknown as WebSocket, identity, h.session, 2, false, 1)
expect(replacement.close).toHaveBeenCalledWith(RELAY_CLOSE_CODE.WRONG_CELL, expect.any(String))
result.resolve({ outcome: 'deferred' })
await moving
await duplicate
expect(commit).toHaveBeenCalledOnce()
expect(h.socket.close).not.toHaveBeenCalled()
expect(
await h.registry.idleRehome(
{ ...request, attemptId: 'next' },
vi.fn().mockResolvedValue({ outcome: 'committed' }),
vi.fn().mockResolvedValue('not-committed')
)
).toEqual({ outcome: 'committed' })
})
})
@@ -1,11 +1,7 @@
import { afterEach, describe, expect, it } from 'vitest'
import { RelayAssignmentStore } from '../assignment/assignment-store.js'
import type { RelayCellConfig } from '../config.js'
import {
openInMemoryRelayDatabase,
openRelayDatabase,
type RelayDatabase
} from '../database/database.js'
import { openInMemoryRelayDatabase, type RelayDatabase } from '../database/database.js'
const KEY_PREFIX = 'reconnect-claim'
const USER_ID = `${KEY_PREFIX}-user-1`
@@ -21,54 +17,19 @@ const CELL_INCARNATION = '11111111-1111-4111-8111-111111111111'
const IDENTITY = { userId: USER_ID, relayHostId: RELAY_HOST_ID }
const CONTROL_ACTIVITY_ID = `control:${CELL.id}:1`
const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL
const backends: { name: string; open: () => Promise<RelayDatabase> }[] = [
{ name: 'sqlite', open: openInMemoryRelayDatabase },
...(databaseUrl
? [
{
name: 'postgres',
open: () => openRelayDatabase({ databaseUrl, dataDir: '' })
}
]
: [])
]
const databases: RelayDatabase[] = []
async function removeScopedRows(database: RelayDatabase): Promise<void> {
await database.query(
`DELETE FROM relay_control_connection_reservations WHERE user_id LIKE '${KEY_PREFIX}-%'`
)
await database.query(
`DELETE FROM relay_assignment_activity_leases WHERE user_id LIKE '${KEY_PREFIX}-%'`
)
await database.query(`DELETE FROM relay_assignments WHERE user_id LIKE '${KEY_PREFIX}-%'`)
for (const table of [
'relay_cell_connection_snapshots',
'relay_cell_connection_runtime',
'relay_cell_connection_limits',
'relay_cell_runtime',
'relay_cells'
]) {
await database.query(`DELETE FROM ${table} WHERE cell_id = ?`, [CELL.id])
}
}
afterEach(async () => {
for (const database of databases.splice(0)) {
await removeScopedRows(database)
await database.close()
}
})
async function setup(
open: () => Promise<RelayDatabase>,
now: () => number
): Promise<{ database: RelayDatabase; store: RelayAssignmentStore }> {
const database = await open()
const database = await openInMemoryRelayDatabase()
databases.push(database)
await removeScopedRows(database)
const store = new RelayAssignmentStore(database, now, {
requireLiveCells: true,
heartbeatTtlMs: 45_000
@@ -113,10 +74,10 @@ async function reservations(
}))
}
describe.each(backends)('control reservation claim on reconnect ($name)', ({ open }) => {
describe('control reservation claim on reconnect', () => {
it('claims the fresh reservation when the same generation reconnects', async () => {
let now = 100_000_000
const { database, store } = await setup(open, () => now)
const { database, store } = await setup(() => now)
const assignment = await store.assign(IDENTITY)
await store.activateControl(IDENTITY, {
@@ -158,7 +119,7 @@ describe.each(backends)('control reservation claim on reconnect ($name)', ({ ope
it('still refuses to claim a second reservation while the first is outstanding', async () => {
let now = 100_000_000
const { database, store } = await setup(open, () => now)
const { database, store } = await setup(() => now)
const assignment = await store.assign(IDENTITY)
await store.activateControl(IDENTITY, {
@@ -63,12 +63,7 @@ async function remainingIds(database: RelayDatabase): Promise<string[]> {
return rows.map((row) => String(row.reservation_id))
}
const dialects: [string, () => Promise<RelayDatabase>][] = [
['sqlite', openInMemoryRelayDatabase],
...(databaseUrl ? [['postgres', openPostgres] as [string, () => Promise<RelayDatabase>]] : [])
]
describe.each(dialects)('released reservation prune (%s)', (_dialect, open) => {
describe('released reservation prune', () => {
let database: RelayDatabase | undefined
afterEach(async () => {
@@ -76,12 +71,8 @@ describe.each(dialects)('released reservation prune (%s)', (_dialect, open) => {
database = undefined
})
afterAll(async () => {
if (databaseUrl) await onAdmin(`DROP SCHEMA IF EXISTS ${schema} CASCADE`)
})
it('deletes only released rows older than the retention window', async () => {
database = await open()
database = await openInMemoryRelayDatabase()
await insertReservation(database, 'a-old-released', 'released', STALE - 1)
await insertReservation(database, 'b-edge-released', 'released', STALE)
await insertReservation(database, 'c-fresh-released', 'released', STALE + 1)
@@ -1,7 +1,6 @@
import { describe, expect, it } from 'vitest'
import {
AUDIT_EVENT_RETENTION_MS,
hashCredential,
CONFIRM_RESULT_RETENTION_MS,
RelayCredentialStore,
type RelayIdentity
@@ -292,54 +291,4 @@ describe('credential cleanup invite reaper', () => {
expect(await remainingIds(database, 'relay_audit_events', 'id')).toEqual(['audit-recent'])
await database.close()
})
it('still replays a confirm result inside retention', async () => {
const database = await openInMemoryRelayDatabase()
let now = NOW - DAY_MS
const store = new RelayCredentialStore(database, () => now)
try {
const invite = await store.createInvite(identity, 'device-1')
const reservation = await store.reserveCredential(identity.relayHostId, invite.inviteToken)
if (!reservation) {
throw new Error('invite did not reserve')
}
await store.recordConnectionBasis({
...reservation,
basisConnId: 'invite-basis',
owningControlGeneration: 1,
deadline: reservation.leaseExpiresAt
})
await store.installCredential({
...identity,
relayDeviceId: 'device-1',
reqId: 'install-1',
newResumeTokenHash: hashCredential('resume-token'),
owningControlGeneration: 1,
authorization: { mode: 'relay-basis', basisConnId: 'invite-basis' }
})
const resume = await store.reserveCredential(identity.relayHostId, 'resume-token')
if (!resume) {
throw new Error('resume did not reserve')
}
await store.recordConnectionBasis({
...resume,
basisConnId: 'resume-basis',
owningControlGeneration: 1,
deadline: resume.leaseExpiresAt
})
const request = {
...identity,
reqId: 'confirm-1',
basisConnId: 'resume-basis',
owningControlGeneration: 1
}
const confirmed = await store.confirmResume(request)
expect(confirmed).toMatchObject({ renewed: true, acceptedAs: 'current' })
now = NOW
await store.cleanup()
expect(await store.confirmResume(request)).toEqual(confirmed)
} finally {
await database.close()
}
})
})
@@ -1,52 +0,0 @@
import { afterEach, describe, expect, it } from 'vitest'
import { openInMemoryRelayDatabase, type RelayDatabase, type SqlRow } from '../database/database.js'
import { ResumeConfirmedAuditBuffer } from './resume-confirmed-audit-buffer.js'
const event = (reqId: string) => ({
userId: 'user-1',
relayHostId: 'host000000000001',
relayDeviceId: 'device-1',
detail: { reqId, basisConnId: `basis-${reqId}`, renewed: true }
})
describe('the batched resume-confirmed audit', () => {
let inner: RelayDatabase | undefined
afterEach(async () => {
await inner?.close()
inner = undefined
})
async function setup() {
inner = await openInMemoryRelayDatabase()
const database = inner
const buffer = new ResumeConfirmedAuditBuffer(database, Date.now, () => undefined)
const rows = async (): Promise<SqlRow[]> =>
await inner!.query(
`SELECT type, relay_device_id, detail_json FROM relay_audit_events ORDER BY at, id`
)
return { database, buffer, rows }
}
it('retries a flush whose commit outcome was lost without writing any row twice', async () => {
const { database, buffer, rows } = await setup()
buffer.add(event('a'))
buffer.add(event('b'))
// The insert commits, then the reply is lost.
const query = database.query.bind(database)
let lost = true
database.query = async (sql, params) => {
const result = await query(sql, params)
if (lost) {
lost = false
throw new Error('Connection terminated unexpectedly')
}
return result
}
await buffer.flush()
await buffer.flush()
expect(await rows()).toHaveLength(2)
buffer.stop()
})
})
@@ -1,79 +0,0 @@
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
import { RelayAssignmentStore } from '../assignment/assignment-store.js'
import { openRelayDatabase, type RelayDatabase } from './database.js'
import { readPostgresLockWaitSample } from './postgres-lock-wait-sample.js'
const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL
const describePostgres = databaseUrl ? describe : describe.skip
const cell = {
id: 'lock-wait-sample-cell',
url: 'https://lock-wait-sample.example.com',
capacityRequests: 10
}
// The split rests on application_name surviving into pg_stat_activity for both
// the waiter and its blocker, which only a real server shows.
describePostgres('PostgreSQL lock-wait sample', () => {
let cellDatabase: RelayDatabase
let directorDatabase: RelayDatabase
beforeAll(async () => {
cellDatabase = await openRelayDatabase({
databaseUrl,
dataDir: '',
applicationName: `orca-relay/cell/${cell.id}`
})
directorDatabase = await openRelayDatabase({
databaseUrl,
dataDir: '',
applicationName: 'orca-relay/director/director'
})
await new RelayAssignmentStore(directorDatabase).reconcileCells([cell])
})
afterAll(async () => {
for (const table of ['relay_cell_regions', 'relay_cell_admission']) {
await directorDatabase?.query(`DELETE FROM ${table} WHERE cell_id = ?`, [cell.id])
}
await directorDatabase?.query(`DELETE FROM relay_cells WHERE cell_id = ?`, [cell.id])
await cellDatabase?.close()
await directorDatabase?.close()
})
// Every waiter after the first is blocked by the first waiter's tuple lock, so
// only the root of the chain names the cell transaction that holds the row.
it('attributes a convoy of directors to the cell holding the relay_cells row', async () => {
expect(await readPostgresLockWaitSample(directorDatabase)).toEqual([])
let release!: () => void
const released = new Promise<void>((resolve) => (release = resolve))
let held!: () => void
const holding = new Promise<void>((resolve) => (held = resolve))
const holder = cellDatabase.transaction(async (transaction) => {
await transaction.query(
`UPDATE relay_cells SET reserved_requests = reserved_requests WHERE cell_id = ?`,
[cell.id]
)
held()
await released
})
await holding
const waiters = Array.from({ length: 3 }, () =>
directorDatabase.transaction(async (transaction) => {
await transaction.queryLocked(`SELECT * FROM relay_cells WHERE cell_id = ?`, [cell.id])
})
)
try {
await expect
.poll(async () => await readPostgresLockWaitSample(directorDatabase), { timeout: 900 })
.toEqual([
{ waiterRole: 'director', table: 'relay_cells', holderRole: 'cell', waiters: 3 }
])
} finally {
release()
await Promise.all([holder, ...waiters])
}
})
})
@@ -1,7 +1,6 @@
import { randomUUID } from 'node:crypto'
import pg from 'pg'
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
import { openRelayDatabase } from './database.js'
import { POSTGRES_STATEMENT_STATS_MIGRATION } from './postgres-statement-stats.js'
const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL
@@ -52,28 +51,6 @@ describePostgres('optional PostgreSQL statement statistics', () => {
return result.rows[0]!.present
}
it('exposes an existing collector idempotently, and skips servers without one', async () => {
const url = await freshDatabase()
const database = await openRelayDatabase({ databaseUrl: url, dataDir: '' })
await database.close()
const client = await connect(url)
try {
expect(await installed(client)).toBe(preloaded)
if (preloaded) {
const before = await client.query('SELECT stats_reset FROM public.pg_stat_statements_info')
await client.query(POSTGRES_STATEMENT_STATS_MIGRATION)
const after = await client.query('SELECT stats_reset FROM public.pg_stat_statements_info')
expect(after.rows).toEqual(before.rows)
await client.query('SELECT calls, wal_bytes, shared_blks_dirtied FROM public.pg_stat_statements LIMIT 1')
} else {
await client.query(POSTGRES_STATEMENT_STATS_MIGRATION)
expect(await installed(client)).toBe(false)
}
} finally {
await client.end()
}
})
it('tolerates missing extension privileges', async () => {
const client = await connect(await freshDatabase())
const role = `relay_stats_role_${randomUUID().replaceAll('-', '')}`
@@ -100,43 +100,16 @@ describePostgres('PostgreSQL transaction recovery', () => {
'relay_assignment_migration_incarnations',
'relay_control_connection_reservations'
]) {
await database.query(`DELETE FROM ${table} WHERE user_id IN (?, ?)`, [
'completion-race-user',
'completion-contention-user'
await database.query(`DELETE FROM ${table} WHERE user_id = ?`, [
'completion-race-user'
])
}
for (const table of ['relay_cell_admission', 'relay_cell_regions']) {
await database.query(`DELETE FROM ${table} WHERE cell_id IN (?, ?, ?, ?)`, [
await database.query(`DELETE FROM ${table} WHERE cell_id IN (?, ?)`, [
'completion-race-source',
'completion-race-target',
'completion-contention-source',
'completion-contention-target'
'completion-race-target'
])
}
for (const identity of [
{ userId: 'released-order-user', relayHostId: 'releasedorder001' },
{ userId: 'normalized-order-user', relayHostId: 'normalizedorder1' },
{ userId: 'atomic-final-user-a', relayHostId: 'atomicfinalhosta' },
{ userId: 'atomic-final-user-b', relayHostId: 'atomicfinalhostb' },
{ userId: 'lease-assignment-contention-user', relayHostId: 'leaseassignment1' }
]) {
await database.query(
`DELETE FROM relay_assignment_activity_leases WHERE user_id = ? AND relay_host_id = ?`,
[identity.userId, identity.relayHostId]
)
await database.query(
`DELETE FROM relay_assignments WHERE user_id = ? AND relay_host_id = ?`,
[identity.userId, identity.relayHostId]
)
}
await database.query(`DELETE FROM relay_cells WHERE cell_id IN (?, ?)`, [
'released-order-cell',
'normalized-order-cell'
])
await database.query(`DELETE FROM relay_cells WHERE cell_id = ?`, ['atomic-final-cell'])
await database.query(`DELETE FROM relay_cells WHERE cell_id = ?`, [
'lease-assignment-contention-cell'
])
await database.query(
`DELETE FROM relay_assignment_activity_leases WHERE user_id LIKE 'reconcile-user-%'`
)
@@ -159,110 +132,6 @@ describePostgres('PostgreSQL transaction recovery', () => {
'completion-race-source',
'completion-race-target'
])
await database.query(
`DELETE FROM relay_assignment_activity_leases WHERE user_id = ?`,
['completion-contention-user']
)
await database.query(`DELETE FROM relay_assignment_migrations WHERE user_id = ?`, [
'completion-contention-user'
])
await database.query(`DELETE FROM relay_assignments WHERE user_id = ?`, [
'completion-contention-user'
])
await database.query(`DELETE FROM relay_cell_runtime WHERE cell_id IN (?, ?)`, [
'completion-contention-source',
'completion-contention-target'
])
await database.query(`DELETE FROM relay_cells WHERE cell_id IN (?, ?)`, [
'completion-contention-source',
'completion-contention-target'
])
await database.query(`DELETE FROM relay_cell_fences WHERE cell_id = ?`, [
'dead-source-contention-source'
])
await database.query(
`DELETE FROM relay_control_connection_reservations WHERE user_id = ?`,
['dead-source-contention-user']
)
await database.query(
`DELETE FROM relay_assignment_activity_leases WHERE user_id = ?`,
['dead-source-contention-user']
)
await database.query(
`DELETE FROM relay_assignment_migration_incarnations WHERE user_id = ?`,
['dead-source-contention-user']
)
await database.query(`DELETE FROM relay_assignment_migrations WHERE user_id = ?`, [
'dead-source-contention-user'
])
await database.query(`DELETE FROM relay_assignments WHERE user_id = ?`, [
'dead-source-contention-user'
])
await database.query(`DELETE FROM relay_cell_runtime WHERE cell_id IN (?, ?)`, [
'dead-source-contention-source',
'dead-source-contention-target'
])
await database.query(`DELETE FROM relay_cell_admission WHERE cell_id IN (?, ?)`, [
'dead-source-contention-source',
'dead-source-contention-target'
])
await database.query(`DELETE FROM relay_cells WHERE cell_id IN (?, ?)`, [
'dead-source-contention-source',
'dead-source-contention-target'
])
await database.query(
`DELETE FROM relay_assignment_activity_leases
WHERE user_id IN (?, ?)`,
['lease-contention-user', 'aggregate-contention-user']
)
await database.query(
`DELETE FROM relay_assignments
WHERE user_id IN (?, ?)`,
['lease-contention-user', 'aggregate-contention-user']
)
await database.query(`DELETE FROM relay_cells WHERE cell_id IN (?, ?)`, [
'lease-contention-cell',
'aggregate-contention-cell'
])
await database.query(
`DELETE FROM relay_assignment_activity_leases WHERE user_id = ?`,
['sustained-lock-user']
)
await database.query(`DELETE FROM relay_assignments WHERE user_id = ?`, [
'sustained-lock-user'
])
await database.query(`DELETE FROM relay_cells WHERE cell_id = ?`, [
'sustained-lock-cell'
])
await database.query(
`DELETE FROM relay_assignment_activity_leases WHERE user_id = ?`,
['sticky-cell-contention-user']
)
await database.query(
`DELETE FROM relay_assignments WHERE user_id = ?`,
['sticky-cell-contention-user']
)
await database.query(`DELETE FROM relay_cells WHERE cell_id = ?`, [
'sticky-cell-contention-cell'
])
await database.query(
`DELETE FROM relay_assignment_activity_leases WHERE user_id LIKE 'postgres-user-%'`
)
await database.query(`DELETE FROM relay_assignments WHERE user_id LIKE 'postgres-user-%'`)
await database.query(`DELETE FROM relay_cells WHERE cell_id IN (?, ?, ?)`, [
'cell-a',
'cell-b',
'cell-c'
])
await database.query(
`DELETE FROM relay_assignment_activity_leases WHERE user_id LIKE 'sticky-fast-user-%'`
)
await database.query(
`DELETE FROM relay_assignments WHERE user_id LIKE 'sticky-fast-user-%'`
)
await database.query(`DELETE FROM relay_cells WHERE cell_id = ?`, [
'sticky-fast-cell'
])
})
it('retries an entire deadlock victim transaction on a fresh attempt', async () => {
-11
View File
@@ -129,15 +129,4 @@ describe('edge move', () => {
expect(moved.assignmentEpoch).toBe(placed.assignmentEpoch + 4)
})
it('rolls back: with the cohort off, the host is re-placed on GCE above the edge epoch', async () => {
const { database, store, edge } = await setup({ requireLiveCells: true })
await edge.ensureEdgeCell()
await store.assign(IDENTITY)
await settle(database)
const moved = await edge.moveToEdge(IDENTITY, 0)
const back = await store.assign(IDENTITY)
expect(back.cellId).toBe(GCE_CELL.id)
expect(back.assignmentEpoch).toBeGreaterThan(moved.assignmentEpoch)
expect(await edge.edgeAssignment(IDENTITY)).toBeNull()
})
})
@@ -1,211 +0,0 @@
import { describe, expect, it, vi } from 'vitest'
import type * as AdminTokenVerifier from './authentication/admin-token-verifier.js'
import type { HostWhereaboutsRow } from './assignment/assignment-store.js'
import { RelayAssignmentStore } from './assignment/assignment-store.js'
import type { RelayConfig } from './config.js'
import { openInMemoryRelayDatabase } from './database/database.js'
import { ShadowSeatDirectory } from './cell/seats/shadow-seat-directory.js'
vi.mock('./authentication/admin-token-verifier.js', async (importOriginal) => {
const actual = await importOriginal<typeof AdminTokenVerifier>()
const identities = new Map<string, Parameters<typeof actual.relayAdminIdentityMayAccess>[0]>([
['deploy-token', 'deploy'],
['capacity-token', 'capacity']
])
return {
...actual,
// The real route allow-list behind a token-to-identity stub.
createAdminTokenVerifier: () => async (token: string, route?: string) => {
const identity = identities.get(token)
if (identity === undefined) return false
return !route || actual.relayAdminIdentityMayAccess(identity, route)
},
createReadOnlyAdminTokenVerifier: () => async () => false,
createRegionalRehomeControlApplyTokenVerifier: () => async () => false,
createRegionalRehomeRuntimeTokenVerifier: () => async () => false,
createRegionalRehomeTokenVerifier: () => async () => false,
createRuntimeTokenVerifier: () => async () => false
}
})
vi.mock('./authentication/relay-token-verifier.js', () => ({
createRelayTokenVerifier: () => async () => null,
readBearer: (value: string | undefined) => value?.replace(/^Bearer /, '') ?? null
}))
import { createRelayApp } from './app.js'
const HOST = 'hhhhhhhhhhhhhhhh'
const ROW: HostWhereaboutsRow = {
cellId: 'cell-a',
assignmentEpoch: 3,
leaseExpiresAt: 5_000,
openMigration: null
}
function request(body: unknown, token = 'deploy-token'): RequestInit {
return {
method: 'POST',
headers: { authorization: `Bearer ${token}`, 'content-type': 'application/json' },
body: JSON.stringify(body)
}
}
function directory(): ShadowSeatDirectory {
const shadow = new ShadowSeatDirectory()
shadow.setCells(['cell-a', 'cell-b'])
shadow.apply(
'cell-a',
{
v: 1,
cellId: 'cell-a',
incarnation: 'inc-a',
seq: 1,
at: 1,
flagsApplied: { generation: '7', flags: { readinessLocal: false } },
full: [
{
userId: 'user-a',
relayHostId: HOST,
epoch: 3,
generation: 1,
state: 'active',
joinedAt: 1
}
]
},
Date.now()
)
shadow.markNoFeed('cell-b', Date.now())
return shadow
}
function appWith(
hostWhereabouts: (identity: { userId: string; relayHostId: string }) => Promise<unknown>,
options: { shadowSeats?: ShadowSeatDirectory; role?: RelayConfig['role'] } = {}
) {
return createRelayApp(config(options.role), {
store: {} as never,
// SAFETY: the whereabouts route reads only hostWhereabouts.
assignments: { hostWhereabouts } as never,
drain: vi.fn(),
ready: vi.fn(async () => true),
cellIncarnation: 'director-incarnation',
shadowSeats: options.shadowSeats
})
}
describe('POST /v1/admin/host-whereabouts', () => {
it('requires admin auth and a director', async () => {
const lookup = vi.fn(async () => ROW)
const app = appWith(lookup)
const body = { v: 1, relayHostId: HOST, userId: 'user-a' }
expect((await app.request('/v1/admin/host-whereabouts', request(body, 'other'))).status).toBe(
401
)
const cell = appWith(lookup, { role: 'cell' })
expect((await cell.request('/v1/admin/host-whereabouts', request(body))).status).toBe(404)
expect(
(await app.request('/v1/admin/host-whereabouts', request({ ...body, extra: 1 }))).status
).toBe(400)
})
it('names the user from the map when the request has only a host id', async () => {
const lookup = vi.fn(async () => ROW)
const app = appWith(lookup, { shadowSeats: directory() })
const response = await app.request(
'/v1/admin/host-whereabouts',
request({ v: 1, relayHostId: HOST })
)
expect(await response.json()).toMatchObject({ users: [{ userId: 'user-a', database: ROW }] })
})
it('judges the verdict as /v1/resolve would when the row names a dead cell', async () => {
const shadow = directory()
// cell-a's heartbeat had already run out when the cell list was read.
shadow.setCells(['cell-a', 'cell-b'], ['cell-a', 'cell-b'], {
readAt: Date.now(),
expiresAt: new Map([
['cell-a', Date.now() - 1],
['cell-b', Date.now() + 60_000]
])
})
const app = appWith(async () => ROW, { shadowSeats: shadow })
const response = await app.request(
'/v1/admin/host-whereabouts',
request({ v: 1, relayHostId: HOST, userId: 'user-a' })
)
expect(await response.json()).toMatchObject({
users: [{ database: ROW, verdict: { class: 'map-only-cell-unlive', explained: true } }]
})
})
})
describe('RelayAssignmentStore.hostWhereabouts', () => {
it('reads the assignment row and its open migration by primary key', async () => {
const database = await openInMemoryRelayDatabase()
try {
const store = new RelayAssignmentStore(database, () => 100)
await store.reconcileCells([
{ id: 'cell-a', url: 'https://cell-a.example.test', capacityRequests: 10 },
{ id: 'cell-b', url: 'https://cell-b.example.test', capacityRequests: 10 }
])
const identity = { userId: 'user-a', relayHostId: HOST }
expect(await store.hostWhereabouts(identity)).toBeNull()
await store.assign(identity)
await database.query(
`INSERT INTO relay_assignment_migrations
(user_id, relay_host_id, source_cell_id, target_cell_id, previous_epoch, assignment_epoch,
source_request_units, target_reserved_units, expires_at, created_at, updated_at)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
['user-a', HOST, 'cell-a', 'cell-b', 1, 2, 1, 1, 900, 100, 100]
)
expect((await store.hostWhereabouts(identity))?.openMigration).toEqual({
sourceCellId: 'cell-a',
targetCellId: 'cell-b',
previousEpoch: 1,
assignmentEpoch: 2,
expiresAt: 900,
targetRegisteredAt: null
})
} finally {
await database.close()
}
})
})
function config(role: RelayConfig['role'] = 'director'): RelayConfig {
return {
port: 8080,
publicUrl: 'https://relay.example.test',
cellUrl: 'https://relay.example.test',
authIssuer: 'https://auth.example.test',
authAudience: 'orca-relay',
jwksUrl: 'https://auth.example.test/jwks',
assignmentSigningKey: new TextEncoder().encode('assignment-key-with-at-least-32-bytes'),
role,
cellId: role === 'cell' ? 'cell-a' : 'director',
cells: [],
adminAudience: 'https://relay.example.test/v1/admin/drain',
deployServiceAccount: 'deploy@example.test',
runtimeServiceAccount: 'runtime@example.test',
adminJwksUrl: 'https://auth.example.test/jwks',
databasePoolMax: 3,
publicAssignmentsEnabled: true,
publicAssignmentConcurrency: 2,
publicAssignmentQueueMax: 128,
publicAssignmentWaitMs: 4_000,
publicResolveConcurrency: 1,
publicResolveWaitMs: 5_000,
publicAssignmentRetryAfterSeconds: 5,
dataDir: './data'
}
}
@@ -87,7 +87,6 @@ describe('idle regional cutover endpoint', () => {
})
describe('regional host drain endpoint', () => {
it('accepts only the dedicated identity and exact cell generation', async () => {
const drainHost = vi.fn(() => 'accepted' as const)
const app = createRelayApp(config(), {
@@ -116,22 +115,6 @@ describe('regional host drain endpoint', () => {
expect(drainHost).toHaveBeenCalledOnce()
})
it('rejects a failed asynchronous drain instead of acknowledging it', async () => {
const app = createRelayApp(config(), {
store: {} as never,
assignments: {} as never,
drain: vi.fn(),
drainHost: async () => {
throw new Error('activity_cell_not_authoritative')
},
cellIncarnation,
ready: vi.fn(async () => true)
})
const response = await post(app, 'rehome-token', request)
expect(response.status).toBe(409)
expect(await response.json()).toEqual({ error: 'activity_cell_not_authoritative' })
})
it('rechecks synthetic host absence after asynchronous identity proof', async () => {
let hostExists = false
const drainHost = vi.fn(() => 'host-not-connected' as const)
@@ -160,81 +143,6 @@ describe('regional host drain endpoint', () => {
expect(response.status).toBe(409)
expect(drainHost).not.toHaveBeenCalled()
})
})
describe('regional rehome director controls', () => {
it('applies the durable switch only with matching confirmation', async () => {
const inspectRegionalRehomeControl = vi.fn().mockResolvedValue({
generation: 0,
enabled: false
})
const applyRegionalRehomeControl = vi.fn(async (input) => ({
...input,
generation: input.expectedGeneration + 1
}))
const app = createRelayApp(config({ role: 'director', cellId: 'director' }), {
store: {} as never,
assignments: {
inspectRegionalRehomeControl,
applyRegionalRehomeControl
} as never,
drain: vi.fn(),
ready: vi.fn(async () => true)
})
expect(
(
await postPath(app, '/v1/admin/regional-rehome-control', 'deploy-token', {
v: 1,
action: 'inspect'
})
).status
).toBe(200)
const apply = {
v: 1,
action: 'apply',
expectedGeneration: 0,
enabled: true,
notBefore: 100,
ratePerMinute: 10,
preferenceMaxAgeMs: 24 * 60 * 60_000,
hostCooldownMs: 7 * 24 * 60 * 60_000,
drainGraceMs: 60_000,
confirmation: 'ENABLE_REGIONAL_REHOMING'
}
expect(
(await postPath(app, '/v1/admin/regional-rehome-control', 'deploy-token', apply)).status
).toBe(200)
expect(applyRegionalRehomeControl).toHaveBeenCalledOnce()
expect(
(
await postPath(app, '/v1/admin/regional-rehome-control', 'monitor-token', {
v: 1,
action: 'inspect'
})
).status
).toBe(200)
expect(
(await postPath(app, '/v1/admin/regional-rehome-control', 'monitor-token', apply)).status
).toBe(403)
expect(
(
await postPath(app, '/v1/admin/regional-rehome-control', 'deploy-token', {
...apply,
confirmation: 'DISABLE_REGIONAL_REHOMING'
})
).status
).toBe(400)
// The per-host cooldown is part of the durable shape an operator must state.
const { hostCooldownMs: _omitted, ...withoutCooldown } = apply
expect(
(await postPath(app, '/v1/admin/regional-rehome-control', 'deploy-token', withoutCooldown))
.status
).toBe(400)
expect(applyRegionalRehomeControl).toHaveBeenCalledExactlyOnceWith(apply)
})
})
async function post(
@@ -1,181 +0,0 @@
import { describe, expect, it, vi } from 'vitest'
import type { RelayConfig } from './config.js'
const fakes = vi.hoisted(() => ({
verifyRelayToken: vi.fn(async (token: string) => ({ sub: 'user-1', relayHostId: token }))
}))
vi.mock('./authentication/relay-token-verifier.js', () => ({
createRelayTokenVerifier: () => fakes.verifyRelayToken,
readBearer: (value: string | undefined) => value?.replace(/^Bearer /, '') ?? null
}))
import { createRelayApp } from './app.js'
describe('Relay region API', () => {
it('returns successful placement when optional window storage is unavailable', async () => {
const app = createRelayApp(config(), {
store: {} as never,
assignments: {
assign: async () => ({
cellId: 'asia-c1',
region: 'asia-east2',
cellUrl: 'https://asia-c1.relay.example.test',
assignmentEpoch: 7
}),
exchangeRegionCorrection: async () => {
throw new Error('database unavailable')
}
} as never,
drain: vi.fn(),
ready: async () => true
})
const response = await app.request(
'/v1/assign',
assignmentRequest('abcdefghijklmnop', {
preferredRegion: 'asia-east2',
regionCorrection: { v: 1, action: 'issue-window' }
})
)
expect(response.status).toBe(200)
expect(await response.json()).toMatchObject({
cellUrl: 'https://asia-c1.relay.example.test',
assignmentEpoch: 7
})
})
it('does not place or write a legacy hint when reporting migration evidence', async () => {
const current = {
userId: 'user-1',
relayHostId: 'abcdefghijklmnop',
cellId: 'asia-c1',
cellUrl: 'https://asia-c1.relay.example.test',
region: 'asia-east2',
assignmentEpoch: 7,
leaseExpiresAt: Date.now() + 300_000
}
const assign = vi.fn()
const resolve = vi.fn(async () => current)
const exchangeRegionCorrection = vi.fn(async () => ({ v: 1, reportStatus: 'accepted' }))
const app = createRelayApp(config(), {
store: {} as never,
assignments: { assign, resolve, exchangeRegionCorrection } as never,
drain: vi.fn(),
ready: async () => true
})
const regionCorrection = {
v: 1,
action: 'report',
generation: 2,
assignmentEpoch: 7,
policyVersion: 1,
outcome: 'conclusive',
measurements: { 'us-central1': 40, 'asia-east2': 180 }
}
const response = await app.request(
'/v1/assign',
assignmentRequest('abcdefghijklmnop', {
preferredRegion: 'us-central1',
regionCorrection
})
)
expect(response.status).toBe(200)
expect(assign).not.toHaveBeenCalled()
expect(exchangeRegionCorrection).toHaveBeenCalledWith(
{ userId: 'user-1', relayHostId: 'abcdefghijklmnop' },
regionCorrection,
7
)
expect(((await response.json()) as { assignmentEpoch: number }).assignmentEpoch).toBe(7)
})
it('does not manufacture an assignment for a report whose assignment disappeared', async () => {
const assign = vi.fn()
const exchangeRegionCorrection = vi.fn()
const app = createRelayApp(config(), {
store: {} as never,
assignments: { assign, resolve: async () => null, exchangeRegionCorrection } as never,
drain: vi.fn(),
ready: async () => true
})
const response = await app.request(
'/v1/assign',
assignmentRequest('abcdefghijklmnop', {
regionCorrection: {
v: 1,
action: 'report',
generation: 2,
assignmentEpoch: 7,
policyVersion: 1,
outcome: 'inconclusive',
reason: 'timeout'
}
})
)
expect(response.status).toBe(409)
expect(assign).not.toHaveBeenCalled()
expect(exchangeRegionCorrection).not.toHaveBeenCalled()
})
it('answers a pool that cannot hand out a client with a retryable 503', async () => {
const regionCatalog = vi.fn(async () => {
throw new Error('Connection terminated due to connection timeout')
})
const app = createRelayApp(config({ publicAssignmentRetryAfterSeconds: 7 }), {
store: {} as never,
assignments: { regionCatalog } as never,
drain: vi.fn(),
ready: vi.fn(async () => true)
})
const response = await app.request('/v1/regions')
expect(response.status).toBe(503)
expect(response.headers.get('Retry-After')).toBe('7')
expect(await response.json()).toEqual({ error: 'region_catalog_temporarily_unavailable' })
})
})
function assignmentRequest(relayHostId: string, extra: Record<string, unknown>): RequestInit {
return {
method: 'POST',
headers: {
authorization: `Bearer ${relayHostId}`,
'content-type': 'application/json'
},
body: JSON.stringify({ v: 1, relayHostId, ...extra })
}
}
function config(overrides: Partial<RelayConfig> = {}): RelayConfig {
return {
port: 8080,
publicUrl: 'https://relay.example.test',
cellUrl: 'https://relay.example.test',
region: 'us-central1',
authIssuer: 'https://auth.example.test',
authAudience: 'orca-relay',
jwksUrl: 'https://auth.example.test/jwks',
assignmentSigningKey: new TextEncoder().encode('assignment-key-with-at-least-32-bytes'),
role: 'director',
cellId: 'director',
cells: [],
adminAudience: 'https://relay.example.test/v1/admin/drain',
deployServiceAccount: 'deploy@example.test',
runtimeServiceAccount: 'runtime@example.test',
adminJwksUrl: 'https://auth.example.test/jwks',
databasePoolMax: 3,
publicAssignmentsEnabled: true,
regionalPlacementEnabled: true,
publicAssignmentConcurrency: 2,
publicAssignmentQueueMax: 128,
publicAssignmentWaitMs: 4_000,
publicResolveConcurrency: 1,
publicResolveWaitMs: 5_000,
publicAssignmentRetryAfterSeconds: 5,
dataDir: './data',
...overrides
}
}
@@ -1,127 +0,0 @@
import type { ChildProcess } from 'node:child_process'
import { spawnProcess } from '@orca/process-host'
import { mkdtempSync, rmSync } from 'node:fs'
import { connect, createServer, type Socket } from 'node:net'
import { tmpdir } from 'node:os'
import { resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { afterEach, expect, it } from 'vitest'
import WebSocket from 'ws'
const appDirectory = fileURLToPath(new URL('..', import.meta.url))
const cleanups: (() => void)[] = []
afterEach(() => {
for (const cleanup of cleanups.splice(0).toReversed()) {
cleanup()
}
})
async function unusedPort(): Promise<number> {
const server = createServer()
await new Promise<void>((resolveListen) => server.listen(0, '127.0.0.1', resolveListen))
const address = server.address()
if (!address || typeof address === 'string') {
throw new Error('missing test port')
}
await new Promise<void>((resolveClose) => server.close(() => resolveClose()))
return address.port
}
async function startRelay(port: number): Promise<ChildProcess> {
const dataDirectory = mkdtempSync(resolve(tmpdir(), 'orca-relay-sigterm-exit-'))
const url = `http://127.0.0.1:${port}`
const child = spawnProcess({
program: process.execPath,
args: ['--import', 'tsx', 'src/index.ts'],
cwd: appDirectory,
// Explicit so an inherited DATABASE_URL cannot point the relay at a shared database.
env: {
PATH: process.env.PATH ?? '',
...(process.env.SystemRoot ? { SystemRoot: process.env.SystemRoot } : {}),
PORT: String(port),
ORCA_RELAY_PUBLIC_URL: url,
ORCA_RELAY_CELL_URL: url,
ORCA_RELAY_AUTH_ISSUER: 'http://127.0.0.1:9',
ORCA_RELAY_JWKS_URL: 'http://127.0.0.1:9/jwks',
ORCA_RELAY_ASSIGNMENT_SIGNING_KEY: 'test-assignment-key-with-at-least-32-bytes',
ORCA_RELAY_DATA_DIR: dataDirectory,
ORCA_RELAY_ADMIN_AUDIENCE: `${url}/v1/admin/drain`,
ORCA_RELAY_DEPLOY_SERVICE_ACCOUNT: 'deploy@example.com',
ORCA_RELAY_ADMIN_JWKS_URL: 'http://127.0.0.1:9/jwks'
},
stdio: ['ignore', 'pipe', 'pipe']
})
cleanups.push(() => {
if (child.exitCode === null && child.signalCode === null) {
child.kill('SIGKILL')
}
rmSync(dataDirectory, { recursive: true, force: true })
})
await new Promise<void>((resolveReady, reject) => {
let stderr = ''
child.stderr?.on('data', (chunk: Buffer) => (stderr += chunk.toString()))
child.stdout?.on('data', (chunk: Buffer) => {
if (chunk.toString().includes('[orca-relay] listening')) {
resolveReady()
}
})
child.once('exit', (code) => reject(new Error(`relay exited before ready: ${code}\n${stderr}`)))
})
return child
}
// Pauses reading so the peer never answers the relay's close frame.
async function unresponsiveWebSocketPeer(port: number): Promise<Socket> {
const socket = new WebSocket(`ws://127.0.0.1:${port}/v1/connect/abcdefghijklmnop`)
socket.on('error', () => undefined)
await new Promise<void>((resolveOpen) => socket.once('open', () => resolveOpen()))
const raw = (socket as unknown as { _socket: Socket })._socket
raw.pause()
return raw
}
// Resolves once the listener refuses new connections, i.e. the relay has begun shutting down.
async function waitUntilListenerClosed(port: number): Promise<void> {
const deadline = Date.now() + 4_000
while (Date.now() < deadline) {
const accepted = await new Promise<boolean>((resolveProbe) => {
const probe = connect(port, '127.0.0.1')
probe.once('connect', () => {
probe.destroy()
resolveProbe(true)
})
probe.once('error', () => resolveProbe(false))
})
if (!accepted) {
return
}
await new Promise<void>((resolveDelay) => setTimeout(resolveDelay, 50))
}
throw new Error('relay kept accepting connections after SIGTERM')
}
// Peers that are not idle to server.close(); unbounded, a silent one held exit until SIGKILL.
it('exits within the shutdown bound on SIGTERM with an unresponsive upgraded WebSocket peer', async () => {
const port = await unusedPort()
const relay = await startRelay(port)
const peer = await unresponsiveWebSocketPeer(port)
cleanups.push(() => peer.destroy())
const peerClosed = new Promise<void>((resolveClose) => peer.once('close', () => resolveClose()))
const startedAt = Date.now()
const exited = new Promise<number | null>((resolveExit) =>
relay.once('exit', (code) => resolveExit(code))
)
relay.kill('SIGTERM')
// A second signal must not restart or extend shutdown. Send it only once the first has been
// handled, so the two cannot coalesce into one delivery.
await waitUntilListenerClosed(port)
relay.kill('SIGTERM')
expect(await exited).toBe(0)
// Under the 10 s backstop: the socket grace, not the backstop, released it.
expect(Date.now() - startedAt).toBeLessThan(9_000)
// A paused peer only observes the relay's FIN once it reads again.
peer.resume()
await peerClosed
}, 15_000)
-2
View File
@@ -130,7 +130,6 @@
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
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
@@ -555,7 +554,6 @@
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/wire-probes/browser-session-ua-wire-identity-cross-context.electron.test.ts
1 test-timeout-needs-reason:src/main/browser/identity/wire-probes/browser-session-ua-wire-identity.electron.test.ts
2 test-timeout-needs-reason:src/main/codex/app-server/codex-app-server-teardown.integration.test.ts
1 test-timeout-needs-reason:src/main/codex/hooks/installation/hook-service-legacy-cleanup.test.ts
+4 -4
View File
@@ -317,10 +317,10 @@
1 src/renderer/src/store/slices/worktrees/metadata/worktree-lineage-actions.ts
3 src/renderer/src/store/slices/worktrees/metadata/worktree-lineage-host-merge.ts
3 src/renderer/src/store/slices/worktrees/session/worktree-terminal-reference.ts
1 src/renderer/src/store/terminals/terminal-active-workspace-creation.ts
1 src/renderer/src/store/terminals/terminal-tab-appearance.ts
1 src/renderer/src/store/terminals/terminal-tab-close-providers.ts
1 src/renderer/src/store/terminals/terminal-tab-retirement.ts
1 src/renderer/src/store/terminals/tabs/creation/terminal-active-workspace-creation.ts
1 src/renderer/src/store/terminals/tabs/presentation/terminal-tab-appearance.ts
1 src/renderer/src/store/terminals/retirement/terminal-tab-close-providers.ts
1 src/renderer/src/store/terminals/retirement/terminal-tab-retirement.ts
1 src/renderer/src/web/preload-api/web-app-api.ts
3 src/renderer/src/web/preload-api/web-preference-normalization.ts
20 src/renderer/src/web/preload-api/web-preferences-store.ts
+1 -1
View File
@@ -23,7 +23,7 @@ src/renderer/src/components/terminal-pane/pty-transport/legacy-relay/legacy-rela
src/renderer/src/components/terminal-pane/pty-connection/output/foreground-output-refresh.ts
src/renderer/src/components/terminal-pane/pty-connection/host-ownership/unserved-ssh-pane-connect.ts
src/renderer/src/hooks/ipc-events/ssh-managed-server-state-effects.ts
src/renderer/src/store/terminals/legacy-relay-bridged-tab-close.ts
src/renderer/src/store/terminals/retirement/legacy-relay-bridged-tab-close.ts
src/shared/legacy-relay-bridge-contract.ts
src/shared/ssh-types.ts
src/shared/telemetry-ssh-host-server-event-schemas.ts
+1
View File
@@ -182,6 +182,7 @@
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/daemon-process-name.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
@@ -28,8 +28,6 @@ src/main/emulator/simctl-simulator-devices.ts
src/main/emulator/simulator-app-visibility.ts
src/main/external-editors/external-editor-launch.ts
src/main/git/command-runner/process-capture/exec-file-capture.ts
src/main/git/command-runner/git-exec-file-sync.ts
src/main/git/command-runner/git-spawn.ts
src/main/git/command-runner/git-stream-stdout.ts
src/main/git/command-runner/process-capture/spawn-command-capture.ts
src/main/git/command-runner/process-capture/spawned-command-tree-kill.ts
File diff suppressed because one or more lines are too long
+17 -17
View File
@@ -101,23 +101,23 @@
5 src/renderer/src/store/slices/worktrees/session/set-active-worktree.ts
2 src/renderer/src/store/slices/worktrees/session/worktree-slice-lookups.ts
6 src/renderer/src/store/terminals/create-terminal-slice.ts
5 src/renderer/src/store/terminals/terminal-layout-state.ts
6 src/renderer/src/store/terminals/terminal-orphan-cleanup.ts
2 src/renderer/src/store/terminals/terminal-pane-hibernation.ts
3 src/renderer/src/store/terminals/terminal-pty-bindings.ts
2 src/renderer/src/store/terminals/terminal-pty-release.ts
1 src/renderer/src/store/terminals/terminal-shutdown-guards.ts
3 src/renderer/src/store/terminals/terminal-shutdown-state.ts
1 src/renderer/src/store/terminals/terminal-tab-agent-launch-pane.ts
2 src/renderer/src/store/terminals/terminal-tab-appearance.ts
6 src/renderer/src/store/terminals/terminal-tab-close.ts
10 src/renderer/src/store/terminals/terminal-tab-creation.ts
7 src/renderer/src/store/terminals/terminal-tab-navigation.ts
3 src/renderer/src/store/terminals/terminal-tab-presentation.ts
2 src/renderer/src/store/terminals/terminal-tab-title-batch.ts
5 src/renderer/src/store/terminals/workspace-terminal-hydration-patch.ts
2 src/renderer/src/store/terminals/workspace-terminal-hydration.ts
2 src/renderer/src/store/terminals/workspace-terminal-reconnect.ts
5 src/renderer/src/store/terminals/layout/terminal-layout-state.ts
6 src/renderer/src/store/terminals/retirement/terminal-orphan-cleanup.ts
2 src/renderer/src/store/terminals/sleep/terminal-pane-hibernation.ts
3 src/renderer/src/store/terminals/pty/terminal-pty-bindings.ts
2 src/renderer/src/store/terminals/pty/terminal-pty-release.ts
1 src/renderer/src/store/terminals/sleep/terminal-shutdown-guards.ts
3 src/renderer/src/store/terminals/sleep/terminal-shutdown-state.ts
1 src/renderer/src/store/terminals/tabs/creation/terminal-tab-agent-launch-pane.ts
2 src/renderer/src/store/terminals/tabs/presentation/terminal-tab-appearance.ts
6 src/renderer/src/store/terminals/retirement/terminal-tab-close.ts
10 src/renderer/src/store/terminals/tabs/creation/terminal-tab-creation.ts
7 src/renderer/src/store/terminals/tabs/terminal-tab-navigation.ts
3 src/renderer/src/store/terminals/tabs/presentation/terminal-tab-presentation.ts
2 src/renderer/src/store/terminals/tabs/presentation/terminal-tab-title-batch.ts
5 src/renderer/src/store/terminals/hydration/workspace-terminal-hydration-patch.ts
2 src/renderer/src/store/terminals/hydration/workspace-terminal-hydration.ts
2 src/renderer/src/store/terminals/hydration/workspace-terminal-reconnect.ts
7 src/renderer/src/store/workspace-layout/frames/workspace-layout-frame-held-tabs.ts
4 src/renderer/src/store/workspace-layout/frames/workspace-layout-frame-slices.ts
12 src/renderer/src/store/workspace-layout/frames/workspace-layout-frame-store-patch.ts
@@ -3,7 +3,7 @@ const { spawn, spawnSync } = require('node:child_process')
const { randomUUID } = require('node:crypto')
const { connect } = require('node:net')
const { tmpdir } = require('node:os')
const { join, relative } = require('node:path')
const { basename, join, relative } = require('node:path')
const { setTimeout: delay } = require('node:timers/promises')
const {
macTerminalHostPaths
@@ -267,7 +267,7 @@ async function verifyPackagedMacTerminalHostBoots(appPath, { arch, required }) {
const stderr = []
// Boot clone outside build tree so ancestor node_modules cannot satisfy missing packaged dependency.
const isolated = mkdtempSync(join(tmpdir(), 'orca-terminal-host-boot-'))
const clone = join(isolated, 'Orca Terminal Host.app')
const clone = join(isolated, basename(paths.bundle))
try {
const cloned = spawnSync('/bin/cp', ['-cR', paths.bundle, clone], { encoding: 'utf8' })
if (cloned.status !== 0) {
@@ -93,6 +93,10 @@ function pickSeededDomains(domains) {
picked[domain] = domains[domain]
}
}
if (picked.settings) {
picked.settings = { ...picked.settings }
delete picked.settings.aiVaultSearch
}
return picked
}
@@ -49,7 +49,10 @@ function createSourceProfile() {
)
const insert = db.prepare("INSERT INTO profile_state_documents VALUES (?, ?, 1, 1, 0, 'hash')")
insert.run('repos', JSON.stringify([{ id: 'repo-1', path: '/src/app' }]))
insert.run('settings', JSON.stringify({ theme: 'dark' }))
insert.run(
'settings',
JSON.stringify({ theme: 'dark', aiVaultSearch: { enabled: true, historyDays: null } })
)
insert.run('sshTargets', JSON.stringify([{ id: 'ssh-1' }]))
insert.run('workspaceSession', JSON.stringify({ tabsByWorktree: { a: [] } }))
insert.run('sshRemotePtyLeases', JSON.stringify([{ ptyId: 'p' }]))
@@ -15,8 +15,8 @@ const { builtinModules } = require('node:module')
const { basename, dirname, join, relative, resolve, sep } = require('node:path')
const { pathToFileURL } = require('node:url')
const MAC_TERMINAL_HOST_NAME = 'Orca Terminal Host'
const MAC_TERMINAL_HOST_EXECUTABLE = 'orca-terminal-host'
const MAC_TERMINAL_HOST_NAME = 'Orca Agents'
const MAC_TERMINAL_HOST_EXECUTABLE = 'Orca Agents'
const macTerminalHostSignIgnore = [`/Contents/Helpers/${MAC_TERMINAL_HOST_NAME}\\.app(/|$)`]
const NODE_PTY_FILES = [
'package.json',
@@ -194,8 +194,8 @@ function buildMacTerminalHostInfo({ appInfo, usageDescriptions, minimumOs }) {
return {
...usageDescriptions,
CFBundleIdentifier: appInfo.CFBundleIdentifier,
CFBundleName: 'Orca',
CFBundleDisplayName: 'Orca',
CFBundleName: MAC_TERMINAL_HOST_NAME,
CFBundleDisplayName: MAC_TERMINAL_HOST_NAME,
CFBundleExecutable: MAC_TERMINAL_HOST_EXECUTABLE,
CFBundlePackageType: 'APPL',
CFBundleInfoDictionaryVersion: '6.0',
@@ -210,6 +210,15 @@ function buildMacTerminalHostInfo({ appInfo, usageDescriptions, minimumOs }) {
function findMacTerminalHostInfoProblems(info, { appId, usageDescriptions, minimumOs }) {
const problems = []
for (const [key, expected] of Object.entries({
CFBundleName: MAC_TERMINAL_HOST_NAME,
CFBundleDisplayName: MAC_TERMINAL_HOST_NAME,
CFBundleExecutable: MAC_TERMINAL_HOST_EXECUTABLE
})) {
if (info[key] !== expected) {
problems.push(`${key} is ${info[key]}, expected ${expected}`)
}
}
if (info.CFBundleIdentifier !== appId) {
problems.push(`CFBundleIdentifier is ${info.CFBundleIdentifier}, expected ${appId}`)
}
@@ -1,94 +0,0 @@
import assert from 'node:assert/strict'
import { execFileSync } from 'node:child_process'
import { readFileSync } from 'node:fs'
import { dirname, resolve } from 'node:path'
import { performance } from 'node:perf_hooks'
import { build } from 'esbuild'
import { buildCounterbalancedSchedule } from '../measurement/counterbalanced-benchmark-schedule.mjs'
const baseline = process.argv[2] ?? '20ab9950654'
const file =
'src/renderer/src/components/right-sidebar/checks-panel/comments/pr-comment-fixing-reply-body.ts'
async function load(contents) {
const result = await build({
stdin: { contents, loader: 'ts', resolveDir: dirname(resolve(file)) },
bundle: true,
platform: 'node',
format: 'esm',
write: false
})
return import(
`data:text/javascript;base64,${Buffer.from(result.outputFiles[0].text).toString('base64')}`
)
}
const before = await load(
execFileSync(
'git',
[
'show',
`${baseline}:src/renderer/src/components/right-sidebar/pr-comment-fixing-reply-body.ts`
],
{ encoding: 'utf8' }
)
)
const after = await load(readFileSync(file, 'utf8'))
const results = []
for (const [name, body] of [
['short', 'Please rename this variable.'],
[
'100-lines',
`<!-- metadata -->\n## Review findings\n${'Code sample with details\n'.repeat(100)}`
],
[
'10000-lines',
`<!-- metadata -->\n## Review findings\n${'Code sample with details\n'.repeat(10000)}`
],
['blank-10000-lines', '# > * - _ `\n'.repeat(10000)]
]) {
const comments = Array.from({ length: 10 }, (_, id) => ({
id,
author: 'reviewer',
authorAvatarUrl: '',
createdAt: '',
url: '',
body
}))
const arms = { before, after }
assert.equal(
after.buildPRCommentBatchConversationReplyBody(comments),
before.buildPRCommentBatchConversationReplyBody(comments)
)
const run = (arm) => {
global.gc?.()
const start = performance.now()
const cpuStart = process.cpuUsage()
for (let i = 0; i < 10; i++) {
arms[arm].buildPRCommentBatchConversationReplyBody(comments)
}
const cpu = process.cpuUsage(cpuStart)
return { ms: (performance.now() - start) / 10, cpuMs: (cpu.user + cpu.system) / 10000 }
}
run('before')
run('after')
const samples = { before: [], after: [] }
for (const pair of buildCounterbalancedSchedule(10, 'before', 'after')) {
for (const arm of pair) {
samples[arm].push(run(arm))
}
}
const median = (values) => {
const sorted = [...values].sort((a, b) => a - b)
return (sorted[4] + sorted[5]) / 2
}
results.push({
name,
beforeCpuMs: median(samples.before.map((s) => s.cpuMs)),
afterCpuMs: median(samples.after.map((s) => s.cpuMs)),
beforeMs: median(samples.before.map((s) => s.ms)),
afterMs: median(samples.after.map((s) => s.ms)),
samples
})
}
console.log(
JSON.stringify({ baseline, node: process.version, platform: process.platform, results }, null, 2)
)
@@ -27,6 +27,10 @@ const GATED_FAMILIES = [
advice: { execFileSync: PROCESS_ADVICE, spawnSync: PROCESS_ADVICE, execSync: PROCESS_ADVICE }
},
{ modules: ['@orca/process-host'], advice: { runProcessSync: PROCESS_ADVICE } },
{
modules: ['@orca/process-host/native-process-spawn'],
advice: { execNativeFileSync: PROCESS_ADVICE, spawnNativeProcessSync: PROCESS_ADVICE }
},
{
modules: ['src/shared/secure-storage/secure-path-windows-acl'],
advice: { restrictWindowsPathSync: SECURE_ADVICE }
@@ -96,13 +96,13 @@ export const WRITERS = [
'src/renderer/src/store/slices/worktrees/session/worktree-identity-rename-state.ts',
'src/renderer/src/store/slices/worktrees/session/worktree-slice-lookups.ts',
'src/renderer/src/store/slices/worktrees/teardown/record-key-omission.ts',
'src/renderer/src/store/terminals/terminal-tab-close.ts',
'src/renderer/src/store/terminals/terminal-tab-creation.ts',
'src/renderer/src/store/terminals/terminal-tab-navigation.ts',
'src/renderer/src/store/terminals/terminal-tab-title-batch.ts',
'src/renderer/src/store/terminals/workspace-terminal-hydration-patch.ts',
'src/renderer/src/store/terminals/workspace-terminal-hydration.ts',
'src/renderer/src/store/terminals/workspace-terminal-reconnect.ts',
'src/renderer/src/store/terminals/retirement/terminal-tab-close.ts',
'src/renderer/src/store/terminals/tabs/creation/terminal-tab-creation.ts',
'src/renderer/src/store/terminals/tabs/terminal-tab-navigation.ts',
'src/renderer/src/store/terminals/tabs/presentation/terminal-tab-title-batch.ts',
'src/renderer/src/store/terminals/hydration/workspace-terminal-hydration-patch.ts',
'src/renderer/src/store/terminals/hydration/workspace-terminal-hydration.ts',
'src/renderer/src/store/terminals/hydration/workspace-terminal-reconnect.ts',
'src/renderer/src/store/workspace-layout/frames/workspace-layout-frame-store-patch.ts'
]
export const SEAM_FIELDS = new Set([
@@ -41,28 +41,32 @@ const HOT_MAPS = new Set([
])
const OWNER_ROOTS = [
{
rel: 'store/terminals/terminal-parking-input-owner.ts',
rel: 'store/terminals/parking/terminal-parking-input-owner.ts',
name: 'acceptTerminalParkingInputs',
inputs: []
},
{
rel: 'store/terminals/terminal-parking-input-owner.ts',
rel: 'store/terminals/parking/terminal-parking-input-owner.ts',
name: 'publishAcceptedTerminalParkingInputs',
inputs: []
},
{
rel: 'store/terminals/terminal-parking-input-owner.ts',
rel: 'store/terminals/parking/terminal-parking-input-owner.ts',
name: 'invalidateTerminalParkingPtyInputs',
inputs: []
},
{
rel: 'store/terminals/terminal-tab-owner-index.ts',
rel: 'store/terminals/ownership/terminal-tab-owner-index.ts',
name: 'update',
inputs: ['tabsByWorktree']
},
{ rel: 'store/terminals/sleeping-agent-record-index.ts', name: 'update', inputs: ['records'] },
{
rel: 'store/terminals/sleeping-agent-record-index.ts',
rel: 'store/terminals/sleep/sleeping-agent-record-index.ts',
name: 'update',
inputs: ['records']
},
{
rel: 'store/terminals/sleep/sleeping-agent-record-index.ts',
name: 'acceptTransition',
inputs: ['previous', 'next']
},
@@ -73,14 +77,14 @@ const OWNER_ROOTS = [
}
]
const KEY_DIFFS = new Set([
`${RENDERER}store/terminals/terminal-parking-input-owner.ts#diffUnknownParkingRecordKeys`,
`${RENDERER}store/terminals/terminal-tab-owner-index.ts#diffUnknownTabOwnerKeys`,
`${RENDERER}store/terminals/sleeping-agent-record-index.ts#diffUnknownSleepingRecordKeys`,
`${RENDERER}store/terminals/parking/terminal-parking-input-owner.ts#diffUnknownParkingRecordKeys`,
`${RENDERER}store/terminals/ownership/terminal-tab-owner-index.ts#diffUnknownTabOwnerKeys`,
`${RENDERER}store/terminals/sleep/sleeping-agent-record-index.ts#diffUnknownSleepingRecordKeys`,
`${RENDERER}lib/workspace/tabs/worktree-tab-bucket-projection.ts#diffUnknownProjectionKeys`
])
const COLD_RESYNCS = new Set([
`${RENDERER}store/terminals/terminal-parking-input-owner.ts#resyncTerminalParkingWorkspaceIds`,
`${RENDERER}store/terminals/sleeping-agent-record-index.ts#resyncSleepingAgentRecordKeys`
`${RENDERER}store/terminals/parking/terminal-parking-input-owner.ts#resyncTerminalParkingWorkspaceIds`,
`${RENDERER}store/terminals/sleep/sleeping-agent-record-index.ts#resyncSleepingAgentRecordKeys`
])
function isColdResyncCall(node, source) {
@@ -139,15 +143,15 @@ const ADDRESSED_FIELDS = new Set([
'sleepingAgentSessionsByPaneKey'
])
const ORDINARY_WRITERS = [
'store/terminals/terminal-layout-state.ts',
'store/terminals/terminal-pane-hibernation.ts',
'store/terminals/terminal-pty-bindings.ts',
'store/terminals/terminal-pty-release.ts',
'store/terminals/terminal-orphan-cleanup.ts',
'store/terminals/terminal-startup-queues.ts',
'store/terminals/terminal-tab-presentation.ts',
'store/terminals/terminal-shutdown-state.ts',
'store/terminals/window-tab-start-in-main.ts',
'store/terminals/layout/terminal-layout-state.ts',
'store/terminals/sleep/terminal-pane-hibernation.ts',
'store/terminals/pty/terminal-pty-bindings.ts',
'store/terminals/pty/terminal-pty-release.ts',
'store/terminals/retirement/terminal-orphan-cleanup.ts',
'store/terminals/tabs/creation/terminal-startup-queues.ts',
'store/terminals/tabs/presentation/terminal-tab-presentation.ts',
'store/terminals/sleep/terminal-shutdown-state.ts',
'store/terminals/tabs/creation/window-tab-start-in-main.ts',
'store/slices/agent-status/agent-status-live-reducer.ts',
'store/slices/agent-status/agent-status-launch-actions.ts',
'store/slices/agent-status/agent-status-provider-session-actions.ts',
@@ -447,7 +447,7 @@ export const PR_E2E_SOURCE_ROUTES = [
],
matches: (file) =>
isProductSource(file) &&
/^(?:src\/renderer\/src\/components\/terminal-pane\/(?:layout\/close\/retire-unbound-(?:ipc|runtime)-terminal-pane|terminal-pane-(?:close-admission|close-identity|lifecycle-close|pane-closed|retirement-ownership)|use-terminal-pane-close-actions)|src\/renderer\/src\/store\/(?:terminals\/terminal-tab-close(?:-providers)?|slices\/(?:terminal-tab-retirement|terminal-retirement-teardown-reservation|retired-terminal-tab-state-sweep)))\.ts$/.test(
/^(?:src\/renderer\/src\/components\/terminal-pane\/(?:layout\/close\/retire-unbound-(?:ipc|runtime)-terminal-pane|terminal-pane-(?:close-admission|close-identity|lifecycle-close|pane-closed|retirement-ownership)|use-terminal-pane-close-actions)|src\/renderer\/src\/store\/(?:terminals\/retirement\/(?:terminal-tab-close(?:-providers)?|terminal-tab-retirement|terminal-retirement-teardown-reservation|retired-terminal-tab-state-sweep)))\.ts$/.test(
file
)
},
@@ -22,6 +22,7 @@ const LAYOUT_ORACLE_PREFIXES = [
// Window-side layout writers the layout-holder stack replaces; widened while it is open.
'src/renderer/src/store/slices/tabs',
'src/renderer/src/store/terminals/',
'src/renderer/src/components/sidebar/workspace-card/activity/worktree-terminal-record-selector.ts',
'src/renderer/src/store/workspace-layout/workspace-layout-cache',
'src/renderer/src/components/terminal-pane/',
'src/renderer/src/components/agent-session-continuation/AgentSessionContinuationMenuItem.tsx',
+1
View File
@@ -1,6 +1,7 @@
{
"extends": "./tsconfig.web.json",
"exclude": [
"../src/renderer/src/components/sidebar/workspace-creation/folder/folder-workspace-composer-submit-host-platform.test.ts",
"../src/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.test.tsx",
"../src/renderer/src/runtime/provider-accounts/observations/provider-account-observation.test-fixture.ts",
"../src/shared/**/*.test.ts",
+1
View File
@@ -1,6 +1,7 @@
{
"extends": "./tsconfig.web.json",
"include": [
"../src/renderer/src/components/sidebar/workspace-creation/folder/folder-workspace-composer-submit-host-platform.test.ts",
"../src/main/runtime/orchestration/terminal-authority/structured-sessions/structured-chat-coordinator-mail.test.ts",
"../src/renderer/src/runtime/observed-provider-accounts.test.tsx",
"../src/renderer/src/components/status-bar/ClaudeSwitcherMenu.observation.test.tsx",
+1
View File
@@ -11,6 +11,7 @@
"../src/shared/**/*"
],
"exclude": [
"../src/renderer/src/components/sidebar/workspace-creation/folder/folder-workspace-composer-submit-host-platform.test.ts",
"../src/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.test.tsx",
"../src/renderer/src/runtime/provider-accounts/observations/provider-account-observation.test-fixture.ts"
],
+2 -2
View File
@@ -50,7 +50,7 @@
2 src/renderer/src/runtime/sync-runtime-graph/sync-key.ts # reads a passed-in copy
3 src/renderer/src/store/folder-workspaces/folder-workspace-catalog-actions.ts # store writer
7 src/renderer/src/store/folder-workspaces/folder-workspace-catalog.ts # store writer
5 src/renderer/src/store/folder-workspaces/folder-workspace-mutations.ts # store writer
4 src/renderer/src/store/folder-workspaces/folder-workspace-mutations.ts # store writer
1 src/renderer/src/store/project-groups/project-group-removal-state.ts # store writer
4 src/renderer/src/store/repos/converted-ssh-host-rows.ts # store writer
5 src/renderer/src/store/repos/repo-catalog-merge.ts # store writer
@@ -70,4 +70,4 @@
6 src/renderer/src/store/slices/worktrees/teardown/host-qualified-worktree-row-removal.ts # store writer
8 src/renderer/src/store/slices/worktrees/teardown/purge-stale-runtime-host-state.ts # store writer
1 src/renderer/src/store/slices/worktrees/teardown/remove-worktree-store-cleanup.ts # store writer
8 src/renderer/src/store/terminals/workspace-terminal-hydration.ts # store writer
8 src/renderer/src/store/terminals/hydration/workspace-terminal-hydration.ts # store writer
@@ -14,13 +14,14 @@ protected files keeps working after its old executable is deleted.
So a packaged macOS GUI app starts its daemon from a private copy that the updater never touches:
- Each packaged macOS app ships a signed helper, `Contents/Helpers/Orca Terminal Host.app` (about
- Each packaged macOS app ships a signed helper, `Contents/Helpers/Orca Agents.app` (about
124 MiB): the pinned Node from `src/shared/node-runtime-pin.ts` as its main executable, the
daemon's `out/main` JS and that slice's node-pty. `config/scripts/macos-terminal-host-bundle.cjs`
daemon's `out/main` JS and that slice's node-pty.
`config/scripts/macos/terminal-host-bundle/macos-terminal-host-bundle.cjs`
builds and signs it in `afterPack`, boots it through one PTY round trip, and fails the build on any
layout, Info.plist, OS floor, architecture or signature drift.
- `macos-daemon-bundle.ts` keeps one copy per helper build, named by the helper's CDHash, at
`userData/daemon-host/macos/terminal-host-<cdhash>/app.noindex/Orca Terminal Host.app`. The helper
`userData/daemon-host/macos/terminal-host-<cdhash>/app.noindex/Orca Agents.app`. The helper
is read from the bundle the running main process executes from, never the whole app. A present
copy is reused as is. Otherwise the helper is cloned (APFS clone, regular copy otherwise) into a
`.staging-<pid>-*` sibling, verified once with
@@ -55,6 +56,12 @@ Signing the helper with the app's own identifier lets it inherit every existing
Disk Access, which a user can only add by hand. A distinct identifier would be a new client: new
folder prompts naming it, and a new Full Disk Access row for every user.
The helper's bundle, executable and display name are `Orca Agents`; its identifier, signing team
and designated requirement still match Orca.app. This names the existing terminal-agent process
without changing its privacy client. Native chat providers still run under the GUI process. An
adopted older daemon keeps its original name until it exits; the fork fallback and Windows names
are unchanged.
## macOS floor
The helper's Node declares `LC_BUILD_VERSION minos 13.5`, which is also the helper's
@@ -108,6 +115,8 @@ The helper declares no links, documents or types, has a lower `CFBundleVersion`
`.noindex` folder, which Spotlight skips, and Orca never registers them. Starting the daemon through
launchd leaves no record, but another process running the copy's executable directly can make
macOS register it, so retirement runs `lsregister -u` on the bundle before deleting it.
Retirement recognizes both `Orca Agents.app` and the legacy `Orca Terminal Host.app` inside unused
copies, so changing the current bundle name does not leave old LaunchServices registrations behind.
The helper's main-executable UUID is Node's, shared by every official Node 24.21.0 binary of that
architecture, so it is not unique to Orca. Local Network access still passed in the signed spike:
+2 -2
View File
@@ -92,7 +92,7 @@ Prefer semantic actions (`click`, `set-value`, `perform-secondary-action`) over
`type-text --element-index <i>` inserts the text at that field's caret without focusing it or bringing its window forward. It works on macOS and Linux; on Windows, click the field, confirm it is the focused text receiver, and run `type-text` without the index.
On macOS, actions run in the background: the target app isn't brought forward, your frontmost app and key window stay put, and the pointer doesn't move, so you can keep working while an agent drives another window. Each action result reports `action.delivery` (`background` or `foreground`). Pass `--restore-window` only when an app ignores background input, such as drags in Chromium or Electron apps or games; it brings the app forward and uses the real pointer and keyboard. Popup menus and web `<select>` controls are set with `set-value` instead of a click. On Linux, clicks, scrolling, drags and keyboard input still bring the window forward. On Windows, element clicks, `set-value` (including sliders), element scrolls and secondary actions (`Invoke`, `Toggle`, `Select`, `Expand`, `Collapse`, `ScrollToVisible`) go through UI Automation when the control supports them, without moving the pointer or sending keys. Some apps still bring their own window forward when driven this way (WPF apps do for most of these), so `action.delivery` reports `foreground` whenever the target window came forward. Anything else brings the window forward.
On macOS, actions run in the background: the target app isn't brought forward, your frontmost app and key window stay put, and the pointer doesn't move, so you can keep working while an agent drives another window. Each action result reports `action.delivery` (`background` or `foreground`). Pass `--restore-window` only when an app ignores background input, such as drags in Chromium or Electron apps or games; it brings the app forward and uses the real pointer and keyboard. The bundled skill tells agents never to add it on their own: they ask you first, and error messages say the same. Popup menus and web `<select>` controls are set with `set-value` instead of a click. On Linux, element clicks through accessibility actions, `set-value`, `type-text --element-index` and secondary actions run in the background; actions that need the real pointer or the focused window are refused unless you pass `--restore-window`. On Wayland they are refused even with it, because synthetic input never reaches native windows. On Windows, element clicks, `set-value` (including sliders), scrolls and secondary actions (`Invoke`, `Toggle`, `Select`, `Expand`, `Collapse`, `ScrollToVisible`) go through UI Automation when the control supports them, without moving the pointer or sending keys. Some apps still bring their own window forward when driven this way (WPF apps do for most of these), so `action.delivery` reports `foreground` whenever the target window came forward. Actions that need the real mouse, such as coordinate clicks, right-clicks and drags, are refused unless you pass `--restore-window`; then only the target window comes forward and the pointer goes back where it was.
When accessibility targeting fails, fall back carefully to coordinates:
@@ -116,7 +116,7 @@ On Linux and Windows, action payloads also pass briefly through a local operatio
## Screenshots
`get-app-state` returns an accessibility tree and, by default, a screenshot. With `--json`, the image bytes are written to disk and the path is returned in `screenshot.path` rather than embedded in the response. Pass `--no-screenshot` when pixels aren't needed (faster, smaller payload). Pass `--restore-window` to bring a hidden or minimized window into view before capture.
`get-app-state` returns an accessibility tree and, by default, a screenshot. With `--json`, the image bytes are written to disk and the path is returned in `screenshot.path` rather than embedded in the response. Pass `--no-screenshot` when pixels aren't needed (faster, smaller payload). On macOS, a window that is minimized, hidden or on another Space can't be read; bring it on screen, or pass `--restore-window` to have Orca bring it forward.
On Wayland, screenshots work on KDE Plasma, Hyprland and Sway. On Hyprland and Sway they need `grim`, GdkPixbuf, and `hyprctl` or `swaymsg`; Orca finds the target window by process ID and title and captures its region, so overlapping windows can show in the image.
+1 -1
View File
@@ -26,7 +26,7 @@ Variants in priority order:
Sizes are defined in `button.tsx` (`default`, `sm`, `xs`, `lg`, plus `icon`, `icon-xs`, `icon-sm`, `icon-lg`). Match the size to the surrounding row height — don't drop a `default` button into a 28px toolbar.
Buttons, toggles and select triggers use `control-interaction`: a thin outline on hover, a solid `ring` outline on focus (including the initially focused dialog action), and a closer outline while pressed. These cues do not change layout. Preserve them in every variant, including destructive and split buttons; use the same utility for custom button controls.
Buttons inside `DialogFooter` get an outline on hover, a solid `ring` outline on focus (including the initially focused dialog action), and a closer outline while pressed (see `main.css`). Keep these cues scoped to dialog actions; elsewhere buttons use the default `focus-visible` ring only — toolbar and icon buttons should not get hover outlines.
## Picking the right primitive
@@ -1,165 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "aiVault.history-scan",
"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\"}"
},
"758b3fde1948": {
"name": "streams-registered-at-teardown",
"ordinal": 6,
"value": [
{
"cancelled": false,
"method": "agentSession.subscribeStatus",
"payload": "agentSession.subscribeStatus#1"
}
]
},
"9aa0df31dc4d": {
"activeWorktreePath": "/repo/feature",
"refreshing": false,
"scope": "workspace",
"screenState": {
"issues": [],
"kind": "ready",
"sessions": [
{
"agent": "claude",
"cwd": "/repo/feature",
"id": "s1"
}
]
}
},
"daf52dc85a58": {
"name": "status.get#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "status.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-2",
"ok": true,
"result": {
"capabilities": ["aiVault.v1"]
}
}
}
},
"e28c488ce6b2": {
"name": "agentSession.subscribeStatus#1",
"ordinal": 1,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"agentSession.subscribeStatus\",\"params\":{}}"
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "aivault-history-scan-fulfilled",
"checkpoints": [
{
"id": "ready",
"observation": {
"sender": ["daf52dc85a58", "03fd6edde488"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "9aa0df31dc4d",
"effects": []
}
},
{
"id": "cleanup",
"observation": {
"sender": ["daf52dc85a58", "03fd6edde488"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "9aa0df31dc4d",
"effects": ["758b3fde1948"]
}
}
]
}
}
@@ -1,108 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "aiVault.history-scan",
"family": "aiVault.history",
"namedDeltas": [],
"values": {
"111e9a5009ba": {
"name": "streams-registered-at-teardown",
"ordinal": 4,
"value": [
{
"cancelled": false,
"method": "agentSession.subscribeStatus",
"payload": "agentSession.subscribeStatus#1"
}
]
},
"213a998b248c": {
"activeWorktreePath": "/repo/feature",
"refreshing": false,
"scope": "workspace",
"screenState": {
"kind": "unsupported"
}
},
"44a27dbf05e2": {
"name": "status.get#1",
"ordinal": 3,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"status.get\"}"
},
"c2c3c4a599ef": {
"name": "status.get#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "status.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-2",
"ok": true,
"result": {
"capabilities": ["mobile.tasks.v1"]
}
}
}
},
"e28c488ce6b2": {
"name": "agentSession.subscribeStatus#1",
"ordinal": 1,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"agentSession.subscribeStatus\",\"params\":{}}"
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "aivault-history-scan-unsupported",
"checkpoints": [
{
"id": "unsupported",
"observation": {
"sender": ["c2c3c4a599ef"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "213a998b248c",
"effects": []
}
},
{
"id": "cleanup",
"observation": {
"sender": ["c2c3c4a599ef"],
"payloads": ["e28c488ce6b2", "44a27dbf05e2"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "213a998b248c",
"effects": ["111e9a5009ba"]
}
}
]
}
}
@@ -1,345 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "aiVault.history-screen",
"family": "aiVault.history-screen",
"namedDeltas": [],
"values": {
"0562fd9175d5": {
"name": "worktree.ps#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "worktree.ps"
},
{
"name": "params",
"value": {
"limit": 10000
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"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
}
},
"7623e8b568b1": {
"crash": {
"$rpc": "null"
},
"elements": {
"ActivityIndicator": 1,
"ChevronLeft": 1,
"Pressable": 2,
"RefreshCw": 1,
"SafeAreaView": 1,
"Text": 3,
"View": 8
},
"labels": ["Back", "Refresh agent sessions"],
"text": ["Agent Session History", "orca-history", "Loading agent sessions…"]
},
"7c48e0564605": {
"name": "status.get#1",
"ordinal": 5,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"status.get\"}"
},
"7e8b2964ad63": {
"name": "streams-registered-at-teardown",
"ordinal": 8,
"value": [
{
"cancelled": false,
"method": "agentSession.subscribeStatus",
"payload": "agentSession.subscribeStatus#1"
}
]
},
"a03eeea51ba8": {
"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": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-4",
"ok": true,
"result": {
"issues": [],
"sessions": [
{
"agent": "claude",
"branch": "feature",
"codexHome": {
"$rpc": "null"
},
"createdAt": "2025-12-31T23:00:00.000Z",
"cwd": "/repo/feature",
"executionHostId": "local",
"filePath": "/repo/feature/.claude/sess-1.jsonl",
"id": "s1",
"messageCount": 4,
"model": "opus",
"modifiedAt": "2025-12-31T23:30:00.000Z",
"previewMessages": [
{
"role": "user",
"text": "fix it",
"timestamp": "2025-12-31T23:00:00.000Z"
}
],
"sessionId": "sess-1",
"title": "Fix the explorer",
"totalTokens": 1200,
"updatedAt": "2025-12-31T23:30:00.000Z"
}
]
}
}
}
},
"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,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"agentSession.subscribeStatus\",\"params\":{}}"
},
"e881d7dabb25": {
"name": "status.get#1",
"ordinal": 4,
"args": [
{
"name": "method",
"value": "status.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": {
"capabilities": ["aiVault.v1"]
}
}
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
},
"ebc8d9683b5e": {
"name": "worktree.ps#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "worktree.ps"
},
{
"name": "params",
"value": {
"limit": 10000
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-2",
"ok": true,
"result": {
"worktrees": [
{
"path": "/repo/feature",
"repoId": "repo-1",
"worktreeId": "wt-history"
},
{
"path": "/repo/sibling",
"repoId": "repo-1",
"worktreeId": "wt-2"
}
]
}
}
}
}
},
"recording": {
"scenario": "aivault-history-screen-listed",
"checkpoints": [
{
"id": "worktrees-pending",
"observation": {
"sender": ["0562fd9175d5"],
"payloads": ["e28c488ce6b2", "d126597611a2"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "7623e8b568b1",
"effects": []
}
},
{
"id": "worktrees-listed",
"observation": {
"sender": ["ebc8d9683b5e", "e881d7dabb25", "27ef7c5c6263"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "7623e8b568b1",
"effects": []
}
},
{
"id": "ready",
"observation": {
"sender": ["ebc8d9683b5e", "e881d7dabb25", "a03eeea51ba8"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "b7a7af14c8a5",
"effects": []
}
},
{
"id": "cleanup",
"observation": {
"sender": ["ebc8d9683b5e", "e881d7dabb25", "a03eeea51ba8"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "b7a7af14c8a5",
"effects": ["7e8b2964ad63"]
}
}
]
}
}
@@ -1,273 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "aiVault.history-screen",
"family": "aiVault.history-screen",
"namedDeltas": [],
"values": {
"0562fd9175d5": {
"name": "worktree.ps#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "worktree.ps"
},
{
"name": "params",
"value": {
"limit": 10000
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"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
}
},
"7623e8b568b1": {
"crash": {
"$rpc": "null"
},
"elements": {
"ActivityIndicator": 1,
"ChevronLeft": 1,
"Pressable": 2,
"RefreshCw": 1,
"SafeAreaView": 1,
"Text": 3,
"View": 8
},
"labels": ["Back", "Refresh agent sessions"],
"text": ["Agent Session History", "orca-history", "Loading agent sessions…"]
},
"7c48e0564605": {
"name": "status.get#1",
"ordinal": 5,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"status.get\"}"
},
"7e8b2964ad63": {
"name": "streams-registered-at-teardown",
"ordinal": 8,
"value": [
{
"cancelled": false,
"method": "agentSession.subscribeStatus",
"payload": "agentSession.subscribeStatus#1"
}
]
},
"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,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"agentSession.subscribeStatus\",\"params\":{}}"
},
"e881d7dabb25": {
"name": "status.get#1",
"ordinal": 4,
"args": [
{
"name": "method",
"value": "status.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": {
"capabilities": ["aiVault.v1"]
}
}
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
},
"ebc8d9683b5e": {
"name": "worktree.ps#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "worktree.ps"
},
{
"name": "params",
"value": {
"limit": 10000
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-2",
"ok": true,
"result": {
"worktrees": [
{
"path": "/repo/feature",
"repoId": "repo-1",
"worktreeId": "wt-history"
},
{
"path": "/repo/sibling",
"repoId": "repo-1",
"worktreeId": "wt-2"
}
]
}
}
}
}
},
"recording": {
"scenario": "aivault-history-screen-worktrees",
"checkpoints": [
{
"id": "worktrees-pending",
"observation": {
"sender": ["0562fd9175d5"],
"payloads": ["e28c488ce6b2", "d126597611a2"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "7623e8b568b1",
"effects": []
}
},
{
"id": "worktrees-listed",
"observation": {
"sender": ["ebc8d9683b5e", "e881d7dabb25", "27ef7c5c6263"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "7623e8b568b1",
"effects": []
}
},
{
"id": "cleanup",
"observation": {
"sender": ["ebc8d9683b5e", "e881d7dabb25", "a0b80301d553"],
"payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "7623e8b568b1",
"effects": ["7e8b2964ad63"]
}
}
]
}
}
@@ -1,82 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "aiVault.resume-launch",
"family": "aiVault.resume-launch",
"namedDeltas": [],
"values": {
"3e6273f4fe55": {
"name": "session.tabs.createTerminal#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "session.tabs.createTerminal"
},
{
"name": "params",
"value": {
"activate": false,
"navigation": "caller",
"select": true,
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"timeoutMs": 30000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"error": {
"code": "worktree_busy",
"message": "Workspace is busy"
},
"id": "frame-1",
"ok": false
}
}
},
"62643ed38326": {
"failure": "Workspace is busy",
"launched": "unlaunched"
},
"6e913cd7b306": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Workspace is busy",
"isRpcDeliveryUnknown": false
}
},
"88cd0d2b1302": {
"name": "session.tabs.createTerminal#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"session.tabs.createTerminal\",\"params\":{\"worktree\":\"id:workspace-1\",\"activate\":false,\"select\":true,\"navigation\":\"caller\"}}"
}
},
"recording": {
"scenario": "aivault-resume-launch-create-refused",
"checkpoints": [
{
"id": "create-refused",
"observation": {
"sender": ["3e6273f4fe55"],
"payloads": ["88cd0d2b1302"],
"settlements": {
"bare": "6e913cd7b306"
},
"state": "62643ed38326",
"effects": []
}
}
]
}
}
@@ -1,82 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "aiVault.resume-preparation",
"family": "aiVault.resume-preparation",
"namedDeltas": [],
"values": {
"1c21b98bedb1": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "codex home is locked",
"isRpcDeliveryUnknown": false
}
},
"6f601b6d009a": {
"name": "aiVault.prepareSessionResume#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "aiVault.prepareSessionResume"
},
{
"name": "params",
"value": {
"agent": "codex",
"codexHome": "/hosts/codex-runtime-home/home",
"executionHostId": "local",
"filePath": "/sessions/rollout.jsonl"
}
},
{
"name": "options",
"value": {
"timeoutMs": 30000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"error": {
"code": "internal",
"message": "codex home is locked"
},
"id": "frame-1",
"ok": false
}
}
},
"7e4864f4412b": {
"failure": "codex home is locked",
"prepared": "unprepared"
},
"88c8bb20eb6f": {
"name": "aiVault.prepareSessionResume#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.prepareSessionResume\",\"params\":{\"agent\":\"codex\",\"filePath\":\"/sessions/rollout.jsonl\",\"codexHome\":\"/hosts/codex-runtime-home/home\",\"executionHostId\":\"local\"}}"
}
},
"recording": {
"scenario": "aivault-resume-prepare-refused",
"checkpoints": [
{
"id": "refused",
"observation": {
"sender": ["6f601b6d009a"],
"payloads": ["88c8bb20eb6f"],
"settlements": {
"prepare": "1c21b98bedb1"
},
"state": "7e4864f4412b",
"effects": []
}
}
]
}
}
@@ -1,47 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "aiVault.resume-preparation",
"family": "aiVault.resume-preparation",
"namedDeltas": [],
"values": {
"5d9b438a0a47": {
"failure": {
"$rpc": "null"
},
"prepared": {
"agent": "claude",
"codexHome": "/hosts/codex-runtime-home/home",
"executionHostId": "local",
"filePath": "/sessions/rollout.jsonl"
}
},
"fd5226716450": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"agent": "claude",
"codexHome": "/hosts/codex-runtime-home/home",
"executionHostId": "local",
"filePath": "/sessions/rollout.jsonl"
}
}
},
"recording": {
"scenario": "aivault-resume-prepare-skipped",
"checkpoints": [
{
"id": "no-wire",
"observation": {
"sender": [],
"payloads": [],
"settlements": {
"claude": "fd5226716450"
},
"state": "5d9b438a0a47",
"effects": []
}
}
]
}
}
-171
View File
@@ -1,171 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "project.update-metadata",
"family": "project-explicit-false",
"namedDeltas": [],
"values": {
"0c4dced3e005": {
"error": "",
"mutating": true,
"row": {
"content": {
"assignees": [],
"labels": [],
"number": 1,
"repository": "owner/repo"
},
"id": "item-1",
"itemType": "ISSUE"
}
},
"1158580f696d": {
"name": "github.project.updateIssueBySlug#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "github.project.updateIssueBySlug"
},
{
"name": "params",
"value": {
"host": "github.enterprise.test",
"number": 1,
"owner": "owner",
"repo": "repo",
"updates": {
"addLabels": ["recorded"]
}
}
},
{
"name": "options",
"value": {
"timeoutMs": 30000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"$rpc": "null"
}
}
}
},
"5d32aa29303c": {
"name": "projectMutating",
"ordinal": 1,
"value": true
},
"7ecf3a14081d": {
"name": "github.project.updateIssueBySlug#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "github.project.updateIssueBySlug"
},
{
"name": "params",
"value": {
"host": "github.enterprise.test",
"number": 1,
"owner": "owner",
"repo": "repo",
"updates": {
"addLabels": ["recorded"]
}
}
},
{
"name": "options",
"value": {
"timeoutMs": 30000
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"87a06aebc58e": {
"error": "The host sent a reply this app could not read (github.project.updateIssueBySlug)",
"mutating": false,
"row": {
"content": {
"assignees": [],
"labels": [],
"number": 1,
"repository": "owner/repo"
},
"id": "item-1",
"itemType": "ISSUE"
}
},
"9270aeb7d9c6": {
"status": "pending",
"startedAt": 0
},
"c4a308482e58": {
"name": "github.project.updateIssueBySlug#1",
"ordinal": 3,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.updateIssueBySlug\",\"params\":{\"owner\":\"owner\",\"repo\":\"repo\",\"host\":\"github.enterprise.test\",\"number\":1,\"updates\":{\"addLabels\":[\"recorded\"]}}}"
},
"cee96a551fcd": {
"name": "projectRowDetailError",
"ordinal": 4,
"value": "The host sent a reply this app could not read (github.project.updateIssueBySlug)"
},
"e9296dde8e41": {
"name": "projectMutating",
"ordinal": 5,
"value": false
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "b2",
"checkpoints": [
{
"id": "pending",
"observation": {
"sender": ["7ecf3a14081d"],
"payloads": ["c4a308482e58"],
"settlements": {
"mount": "eb79a9b3682a",
"submit": "9270aeb7d9c6"
},
"state": "0c4dced3e005",
"effects": ["5d32aa29303c"]
}
},
{
"id": "settled",
"observation": {
"sender": ["1158580f696d"],
"payloads": ["c4a308482e58"],
"settlements": {
"mount": "eb79a9b3682a",
"submit": "eb79a9b3682a"
},
"state": "87a06aebc58e",
"effects": ["5d32aa29303c", "cee96a551fcd", "e9296dde8e41"]
}
}
]
}
}
@@ -1,135 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "browser.page-commands",
"family": "browser.keyboard",
"namedDeltas": [],
"values": {
"6104536ec606": {
"name": "browser.keypress#1",
"ordinal": 5,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"browser.keypress\",\"params\":{\"worktree\":\"id:worktree-1\",\"page\":\"page-1\",\"key\":\"Enter\"}}"
},
"8160e8872519": {
"busy": false,
"dialog": {
"$rpc": "null"
},
"error": {
"$rpc": "null"
},
"keyboardValue": "",
"pointerModifiers": []
},
"86b725378b3b": {
"name": "browser.keyboardInsertText#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"browser.keyboardInsertText\",\"params\":{\"worktree\":\"id:worktree-1\",\"page\":\"page-1\",\"text\":\"hello\"}}"
},
"a5e12fd12d8a": {
"name": "toast",
"ordinal": 3,
"value": {
"message": "Sent"
}
},
"d1075b8afeb6": {
"name": "browser.keyboardInsertText#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "browser.keyboardInsertText"
},
{
"name": "params",
"value": {
"page": "page-1",
"text": "hello",
"worktree": "id:worktree-1"
}
},
{
"name": "options",
"value": {
"timeoutMs": 15000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"inserted": true
}
}
}
},
"e6c97e728698": {
"name": "browser.keypress#1",
"ordinal": 4,
"args": [
{
"name": "method",
"value": "browser.keypress"
},
{
"name": "params",
"value": {
"key": "Enter",
"page": "page-1",
"worktree": "id:worktree-1"
}
},
{
"name": "options",
"value": {
"timeoutMs": 15000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-2",
"ok": true,
"result": {
"pressed": true
}
}
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "browser-keyboard-input",
"checkpoints": [
{
"id": "typed",
"observation": {
"sender": ["d1075b8afeb6", "e6c97e728698"],
"payloads": ["86b725378b3b", "6104536ec606"],
"settlements": {
"mount": "eb79a9b3682a",
"text": "eb79a9b3682a",
"keypress": "eb79a9b3682a"
},
"state": "8160e8872519",
"effects": ["a5e12fd12d8a"]
}
}
]
}
}
@@ -1,90 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "browser.page-commands",
"family": "browser.pointer-click",
"namedDeltas": [],
"values": {
"002a5bcbde42": {
"name": "browser.mouseClick#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"browser.mouseClick\",\"params\":{\"worktree\":\"id:worktree-1\",\"page\":\"page-1\",\"x\":40,\"y\":80,\"button\":\"left\",\"modifiers\":[],\"radius\":14}}"
},
"9855d4ec3415": {
"busy": false,
"dialog": {
"$rpc": "null"
},
"error": {
"$rpc": "null"
},
"keyboardValue": "hello",
"pointerModifiers": []
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
},
"f14b569391f9": {
"name": "browser.mouseClick#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "browser.mouseClick"
},
{
"name": "params",
"value": {
"button": "left",
"modifiers": [],
"page": "page-1",
"radius": 14,
"worktree": "id:worktree-1",
"x": 40,
"y": 80
}
},
{
"name": "options",
"value": {
"timeoutMs": 5000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"clicked": true
}
}
}
}
},
"recording": {
"scenario": "browser-pointer-click-accepted",
"checkpoints": [
{
"id": "clicked",
"observation": {
"sender": ["f14b569391f9"],
"payloads": ["002a5bcbde42"],
"settlements": {
"mount": "eb79a9b3682a",
"click": "eb79a9b3682a"
},
"state": "9855d4ec3415",
"effects": []
}
}
]
}
}
@@ -1,129 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "browser.page-commands",
"family": "browser.wheel",
"namedDeltas": [],
"values": {
"0ea51271b822": {
"name": "browser.mouseWheel#1",
"ordinal": 4,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"browser.mouseWheel\",\"params\":{\"worktree\":\"id:worktree-1\",\"page\":\"page-1\",\"dx\":0,\"dy\":-120}}"
},
"4ee27ce5e118": {
"name": "browser.mouseWheel#1",
"ordinal": 3,
"args": [
{
"name": "method",
"value": "browser.mouseWheel"
},
{
"name": "params",
"value": {
"dx": 0,
"dy": -120,
"page": "page-1",
"worktree": "id:worktree-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-2",
"ok": true,
"result": {
"scrolled": true
}
}
}
},
"5099a516ef10": {
"name": "browser.mouseMove#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"browser.mouseMove\",\"params\":{\"worktree\":\"id:worktree-1\",\"page\":\"page-1\",\"x\":40,\"y\":80}}"
},
"5972986e0d80": {
"name": "browser.mouseMove#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "browser.mouseMove"
},
{
"name": "params",
"value": {
"page": "page-1",
"worktree": "id:worktree-1",
"x": 40,
"y": 80
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"moved": true
}
}
}
},
"9855d4ec3415": {
"busy": false,
"dialog": {
"$rpc": "null"
},
"error": {
"$rpc": "null"
},
"keyboardValue": "hello",
"pointerModifiers": []
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "browser-wheel-scrolled",
"checkpoints": [
{
"id": "scrolled",
"observation": {
"sender": ["5972986e0d80", "4ee27ce5e118"],
"payloads": ["5099a516ef10", "0ea51271b822"],
"settlements": {
"mount": "eb79a9b3682a",
"wheel": "eb79a9b3682a"
},
"state": "9855d4ec3415",
"effects": []
}
}
]
}
}
@@ -1,167 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "clipboard.image-terminal-attachment",
"family": "clipboard.image-attachment",
"namedDeltas": [],
"values": {
"08a3a6323626": {
"name": "before-terminal-send",
"ordinal": 8,
"value": {
"terminal": "terminal-1"
}
},
"6696a47819e1": {
"name": "clipboard.startImageUpload#1",
"ordinal": 3,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"clipboard.startImageUpload\",\"params\":{\"expectedBase64Length\":32,\"connectionId\":\"connection-1\"}}"
},
"7c2e3ea286aa": {
"name": "clipboard.startImageUpload#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "clipboard.startImageUpload"
},
{
"name": "params",
"value": {
"connectionId": "connection-1",
"expectedBase64Length": 32
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"uploadId": "upload-1"
}
}
}
},
"7ed3d39f0607": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": false
},
"814ccd56a769": {
"name": "clipboard.appendImageUploadChunk#1",
"ordinal": 5,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"clipboard.appendImageUploadChunk\",\"params\":{\"uploadId\":\"upload-1\",\"offset\":0,\"contentBase64\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"}}"
},
"8452698ac11a": {
"name": "clipboard.commitImageUpload#1",
"ordinal": 7,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"clipboard.commitImageUpload\",\"params\":{\"uploadId\":\"upload-1\"}}"
},
"8aa742456efd": {
"attached": false,
"failure": {
"$rpc": "null"
}
},
"994fccf9b305": {
"name": "upload-start",
"ordinal": 1,
"value": {}
},
"b50d2ec23283": {
"name": "clipboard.commitImageUpload#1",
"ordinal": 6,
"args": [
{
"name": "method",
"value": "clipboard.commitImageUpload"
},
{
"name": "params",
"value": {
"uploadId": "upload-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": "/tmp/img.png"
}
}
},
"f05e4695ffa3": {
"name": "clipboard.appendImageUploadChunk#1",
"ordinal": 4,
"args": [
{
"name": "method",
"value": "clipboard.appendImageUploadChunk"
},
{
"name": "params",
"value": {
"contentBase64": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"offset": 0,
"uploadId": "upload-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-2",
"ok": true,
"result": {
"received": 32
}
}
}
}
},
"recording": {
"scenario": "clipboard-image-attachment-blocked-before-send",
"checkpoints": [
{
"id": "blocked",
"observation": {
"sender": ["7c2e3ea286aa", "f05e4695ffa3", "b50d2ec23283"],
"payloads": ["6696a47819e1", "814ccd56a769", "8452698ac11a"],
"settlements": {
"blocked": "7ed3d39f0607"
},
"state": "8aa742456efd",
"effects": ["994fccf9b305", "08a3a6323626"]
}
}
]
}
}
@@ -1,85 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "clipboard.image-terminal-attachment",
"family": "clipboard.image-attachment",
"namedDeltas": [],
"values": {
"3c402c915494": {
"name": "clipboard.startImageUpload#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "clipboard.startImageUpload"
},
{
"name": "params",
"value": {
"connectionId": "connection-1",
"expectedBase64Length": 32
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"error": {
"code": "too_large",
"message": "Image is too large"
},
"id": "frame-1",
"ok": false
}
}
},
"6696a47819e1": {
"name": "clipboard.startImageUpload#1",
"ordinal": 3,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"clipboard.startImageUpload\",\"params\":{\"expectedBase64Length\":32,\"connectionId\":\"connection-1\"}}"
},
"765ab192e1a5": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Image is too large",
"isRpcDeliveryUnknown": false
}
},
"994fccf9b305": {
"name": "upload-start",
"ordinal": 1,
"value": {}
},
"cc325ad637ea": {
"attached": "unattached",
"failure": "Image is too large"
}
},
"recording": {
"scenario": "clipboard-image-attachment-upload-refused",
"checkpoints": [
{
"id": "upload-refused",
"observation": {
"sender": ["3c402c915494"],
"payloads": ["6696a47819e1"],
"settlements": {
"normal": "765ab192e1a5"
},
"state": "cc325ad637ea",
"effects": ["994fccf9b305"]
}
}
]
}
}
@@ -1,155 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "clipboard.image-upload",
"family": "clipboard.image-upload",
"namedDeltas": [],
"values": {
"261840506035": {
"name": "clipboard.appendImageUploadChunk#1",
"ordinal": 3,
"args": [
{
"name": "method",
"value": "clipboard.appendImageUploadChunk"
},
{
"name": "params",
"value": {
"contentBase64": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"offset": 0,
"uploadId": "upload-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-2",
"ok": true,
"result": {
"received": 32
}
}
}
},
"28e38d6e1608": {
"name": "clipboard.appendImageUploadChunk#1",
"ordinal": 4,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"clipboard.appendImageUploadChunk\",\"params\":{\"uploadId\":\"upload-1\",\"offset\":0,\"contentBase64\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"}}"
},
"7442a814fa13": {
"name": "clipboard.commitImageUpload#1",
"ordinal": 5,
"args": [
{
"name": "method",
"value": "clipboard.commitImageUpload"
},
{
"name": "params",
"value": {
"uploadId": "upload-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": "/tmp/img.png"
}
}
},
"7ab518750e0f": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": "/tmp/img.png"
},
"7bc2e4227914": {
"name": "clipboard.startImageUpload#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"clipboard.startImageUpload\",\"params\":{\"expectedBase64Length\":32,\"connectionId\":\"connection-1\"}}"
},
"a13ad28e242d": {
"name": "clipboard.commitImageUpload#1",
"ordinal": 6,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"clipboard.commitImageUpload\",\"params\":{\"uploadId\":\"upload-1\"}}"
},
"a77b999a5f7c": {
"failure": {
"$rpc": "null"
},
"path": "/tmp/img.png"
},
"d2a1a0e3d100": {
"name": "clipboard.startImageUpload#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "clipboard.startImageUpload"
},
{
"name": "params",
"value": {
"connectionId": "connection-1",
"expectedBase64Length": 32
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"uploadId": "upload-1"
}
}
}
}
},
"recording": {
"scenario": "clipboard-image-upload-chunked",
"checkpoints": [
{
"id": "uploaded",
"observation": {
"sender": ["d2a1a0e3d100", "261840506035", "7442a814fa13"],
"payloads": ["7bc2e4227914", "28e38d6e1608", "a13ad28e242d"],
"settlements": {
"remote": "7ab518750e0f"
},
"state": "a77b999a5f7c",
"effects": []
}
}
]
}
}
@@ -1,272 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "accounts.codex-reset-credit",
"family": "components.codex-reset-credit",
"namedDeltas": [],
"values": {
"055241a84f48": {
"settled": {
"outcome": "reset"
}
},
"0a07efb53f1e": {
"settled": {
"$rpc": "null"
}
},
"52d5e56d067b": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"outcome": "reset",
"scope": {
"accountId": "codex-1",
"accountRevision": 1700000000000,
"offerRevision": "v1:[1,null,null,[],null,null,1700000000000]",
"target": {
"runtime": "host",
"wslDistro": {
"$rpc": "null"
}
}
},
"snapshot": {
"claude": {
"accounts": [],
"activeAccountId": {
"$rpc": "null"
}
},
"codex": {
"accounts": [
{
"email": "codex@example.test",
"id": "codex-1",
"updatedAt": 1700000000000
}
],
"activeAccountId": "codex-1",
"activeAccountIdsByRuntime": {
"host": "codex-1",
"wsl": {}
}
},
"rateLimits": {
"claude": {
"$rpc": "null"
},
"claudeTarget": {
"runtime": "host",
"wslDistro": {
"$rpc": "null"
}
},
"codex": {
"error": {
"$rpc": "null"
},
"provider": "codex",
"rateLimitResetCredits": {
"availableCount": 1
},
"session": {
"$rpc": "null"
},
"status": "ok",
"updatedAt": 1700000000000,
"weekly": {
"$rpc": "null"
}
},
"codexTarget": {
"runtime": "host",
"wslDistro": {
"$rpc": "null"
}
},
"inactiveClaudeAccounts": [],
"inactiveCodexAccounts": []
}
}
}
},
"9270aeb7d9c6": {
"status": "pending",
"startedAt": 0
},
"944a34b7acd6": {
"name": "accounts.consumeCodexResetCredit#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"accounts.consumeCodexResetCredit\",\"params\":{\"idempotencyKey\":\"00000000-0000-4000-8000-000000000001\",\"expectedScope\":{\"target\":{\"runtime\":\"host\",\"wslDistro\":null},\"accountId\":\"codex-1\",\"accountRevision\":1700000000000,\"offerRevision\":\"v1:[1,null,null,[],null,null,1700000000000]\"}}}"
},
"b88c06607a7c": {
"name": "accounts.consumeCodexResetCredit#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "accounts.consumeCodexResetCredit"
},
{
"name": "params",
"value": {
"expectedScope": {
"accountId": "codex-1",
"accountRevision": 1700000000000,
"offerRevision": "v1:[1,null,null,[],null,null,1700000000000]",
"target": {
"runtime": "host",
"wslDistro": {
"$rpc": "null"
}
}
},
"idempotencyKey": "00000000-0000-4000-8000-000000000001"
}
},
{
"name": "options",
"value": {
"timeoutMs": 90000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"outcome": "reset",
"scope": {
"accountId": "codex-1",
"accountRevision": 1700000000000,
"offerRevision": "v1:[1,null,null,[],null,null,1700000000000]",
"target": {
"runtime": "host",
"wslDistro": {
"$rpc": "null"
}
}
},
"snapshot": {
"claude": {
"accounts": [],
"activeAccountId": {
"$rpc": "null"
}
},
"codex": {
"accounts": [
{
"email": "codex@example.test",
"id": "codex-1",
"updatedAt": 1700000000000
}
],
"activeAccountId": "codex-1",
"activeAccountIdsByRuntime": {
"host": "codex-1",
"wsl": {}
}
},
"rateLimits": {
"claude": {
"$rpc": "null"
},
"codex": {
"error": {
"$rpc": "null"
},
"provider": "codex",
"rateLimitResetCredits": {
"availableCount": 1
},
"session": {
"$rpc": "null"
},
"status": "ok",
"updatedAt": 1700000000000,
"weekly": {
"$rpc": "null"
}
},
"inactiveClaudeAccounts": [],
"inactiveCodexAccounts": []
}
}
}
}
}
},
"de0c9a811224": {
"name": "accounts.consumeCodexResetCredit#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "accounts.consumeCodexResetCredit"
},
{
"name": "params",
"value": {
"expectedScope": {
"accountId": "codex-1",
"accountRevision": 1700000000000,
"offerRevision": "v1:[1,null,null,[],null,null,1700000000000]",
"target": {
"runtime": "host",
"wslDistro": {
"$rpc": "null"
}
}
},
"idempotencyKey": "00000000-0000-4000-8000-000000000001"
}
},
{
"name": "options",
"value": {
"timeoutMs": 90000
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
}
},
"recording": {
"scenario": "codex-reset-credit-consumed",
"checkpoints": [
{
"id": "requested",
"observation": {
"sender": ["de0c9a811224"],
"payloads": ["944a34b7acd6"],
"settlements": {
"confirm": "9270aeb7d9c6"
},
"state": "0a07efb53f1e",
"effects": []
}
},
{
"id": "consumed",
"observation": {
"sender": ["b88c06607a7c"],
"payloads": ["944a34b7acd6"],
"settlements": {
"confirm": "52d5e56d067b"
},
"state": "055241a84f48",
"effects": []
}
}
]
}
}
@@ -1,143 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "components.setup-script",
"family": "components.setup-script",
"namedDeltas": [],
"values": {
"2bf6d40fe6a5": {
"name": "repo.hooks#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "repo.hooks"
},
{
"name": "params",
"value": {
"repo": "id:repo-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"5d1cf72f4e12": {
"advanced": true,
"command": "pnpm install",
"run": true,
"runPolicy": "ask",
"source": "repo",
"trust": {
"$rpc": "null"
}
},
"79deedc9f2ed": {
"name": "repo.hooks#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"repo.hooks\",\"params\":{\"repo\":\"id:repo-1\"}}"
},
"80cf8444e458": {
"advanced": false,
"command": {
"$rpc": "null"
},
"run": true,
"runPolicy": "run-by-default",
"source": {
"$rpc": "null"
},
"trust": {
"$rpc": "null"
}
},
"a4e4636264db": {
"name": "repo.hooks#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "repo.hooks"
},
{
"name": "params",
"value": {
"repo": "id:repo-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"hooks": {
"scripts": {
"setup": "pnpm install"
}
},
"setupRunPolicy": "ask",
"setupTrust": {
"$rpc": "null"
},
"source": "repo"
}
}
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "components-setup-ask",
"checkpoints": [
{
"id": "hooks-pending",
"observation": {
"sender": ["2bf6d40fe6a5"],
"payloads": ["79deedc9f2ed"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "80cf8444e458",
"effects": []
}
},
{
"id": "settled",
"observation": {
"sender": ["a4e4636264db"],
"payloads": ["79deedc9f2ed"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "5d1cf72f4e12",
"effects": []
}
}
]
}
}
@@ -1,138 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "components.execution-target-local",
"family": "components.execution-target-local",
"namedDeltas": [],
"values": {
"5779e5e854f7": {
"detected": {
"$rpc": "null"
},
"gate": {
"connectInProgress": true,
"error": {
"$rpc": "null"
},
"needsDesktopServerRecovery": false,
"requiresConnection": false,
"status": {
"$rpc": "null"
}
}
},
"9b8ae0c8eec5": {
"name": "preflight.detectAgents#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"preflight.detectAgents\"}"
},
"a4fe12488bc4": {
"name": "preflight.detectAgents#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "preflight.detectAgents"
},
{
"name": "params",
"value": {
"$rpc": "absent"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"d3a709c13f9d": {
"detected": ["claude"],
"gate": {
"connectInProgress": true,
"error": {
"$rpc": "null"
},
"needsDesktopServerRecovery": false,
"requiresConnection": false,
"status": {
"$rpc": "null"
}
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
},
"f15d8f54be02": {
"name": "preflight.detectAgents#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "preflight.detectAgents"
},
{
"name": "params",
"value": {
"$rpc": "absent"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": ["claude"]
}
}
}
},
"recording": {
"scenario": "components-target-local",
"checkpoints": [
{
"id": "detect-pending",
"observation": {
"sender": ["a4fe12488bc4"],
"payloads": ["9b8ae0c8eec5"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "5779e5e854f7",
"effects": []
}
},
{
"id": "settled",
"observation": {
"sender": ["f15d8f54be02"],
"payloads": ["9b8ae0c8eec5"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "d3a709c13f9d",
"effects": []
}
}
]
}
}
@@ -1,260 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "components.execution-target",
"family": "components.execution-target",
"namedDeltas": [],
"values": {
"0355054e5e71": {
"name": "ssh.connect#1",
"ordinal": 5,
"args": [
{
"name": "method",
"value": "ssh.connect"
},
{
"name": "params",
"value": {
"targetId": "ssh-1"
}
},
{
"name": "options",
"value": {
"timeoutMs": 120000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": {
"state": {
"error": {
"$rpc": "null"
},
"reconnectAttempt": 0,
"status": "connected",
"targetId": "ssh-1"
}
}
}
}
},
"10b5ec5ae537": {
"name": "preflight.detectRemoteAgents#2",
"ordinal": 7,
"args": [
{
"name": "method",
"value": "preflight.detectRemoteAgents"
},
{
"name": "params",
"value": {
"connectionId": "ssh-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"12098dde49de": {
"name": "ssh.connect#1",
"ordinal": 6,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"ssh.connect\",\"params\":{\"targetId\":\"ssh-1\"}}"
},
"1212a28487d8": {
"detected": ["codex"],
"gate": {
"connectInProgress": false,
"error": {
"$rpc": "null"
},
"needsDesktopServerRecovery": false,
"requiresConnection": false,
"status": "connected"
}
},
"4aa26501c485": {
"name": "preflight.detectRemoteAgents#2",
"ordinal": 8,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"preflight.detectRemoteAgents\",\"params\":{\"connectionId\":\"ssh-1\"}}"
},
"70b1e8fb528a": {
"name": "preflight.detectRemoteAgents#1",
"ordinal": 3,
"args": [
{
"name": "method",
"value": "preflight.detectRemoteAgents"
},
{
"name": "params",
"value": {
"connectionId": "ssh-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-2",
"ok": true,
"result": ["codex"]
}
}
},
"8265ec539d5a": {
"name": "preflight.detectRemoteAgents#1",
"ordinal": 4,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"preflight.detectRemoteAgents\",\"params\":{\"connectionId\":\"ssh-1\"}}"
},
"a11809a84754": {
"name": "ssh.getState#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"ssh.getState\",\"params\":{\"targetId\":\"ssh-1\"}}"
},
"b53739a58194": {
"name": "ssh.getState#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "ssh.getState"
},
{
"name": "params",
"value": {
"targetId": "ssh-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"state": {
"error": {
"$rpc": "null"
},
"reconnectAttempt": 0,
"status": "connected",
"targetId": "ssh-1"
}
}
}
}
},
"b6835adccf60": {
"name": "ssh.getState#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "ssh.getState"
},
{
"name": "params",
"value": {
"targetId": "ssh-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
},
"fe6c500525e6": {
"detected": {
"$rpc": "null"
},
"gate": {
"connectInProgress": false,
"error": {
"$rpc": "null"
},
"needsDesktopServerRecovery": false,
"requiresConnection": true,
"status": {
"$rpc": "null"
}
}
}
},
"recording": {
"scenario": "components-target-ssh",
"checkpoints": [
{
"id": "state-pending",
"observation": {
"sender": ["b6835adccf60"],
"payloads": ["a11809a84754"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "fe6c500525e6",
"effects": []
}
},
{
"id": "settled",
"observation": {
"sender": ["b53739a58194", "70b1e8fb528a", "0355054e5e71", "10b5ec5ae537"],
"payloads": ["a11809a84754", "8265ec539d5a", "12098dde49de", "4aa26501c485"],
"settlements": {
"mount": "eb79a9b3682a",
"connect": "eb79a9b3682a"
},
"state": "1212a28487d8",
"effects": []
}
}
]
}
}
@@ -1,346 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.diff-review-load",
"family": "session.diff-review",
"namedDeltas": [],
"values": {
"284ce622e74a": {
"name": "worktree.show#2",
"ordinal": 7,
"args": [
{
"name": "method",
"value": "worktree.show"
},
{
"name": "params",
"value": {
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-4",
"ok": true,
"result": {
"worktree": {
"baseRef": "origin/main",
"linkedPR": 12
}
}
}
}
},
"347ad3543d28": {
"branchCompare": {
"error": "The host sent a reply this app could not read (git.branchCompare)",
"result": {
"$rpc": "null"
}
},
"diff": "unloaded",
"snapshot": "unloaded"
},
"412402e093cc": {
"name": "git.branchCompare#2",
"ordinal": 12,
"json": "{\"id\":\"frame-6\",\"deviceToken\":\"recording-device\",\"method\":\"git.branchCompare\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"baseRef\":\"origin/main\"}}"
},
"4b4f2d7405b8": {
"name": "repo.list#2",
"ordinal": 8,
"args": [
{
"name": "method",
"value": "repo.list"
},
{
"name": "params",
"value": {
"$rpc": "absent"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-5",
"ok": true,
"result": {
"repos": [
{
"id": "repo-9",
"worktreeBaseRef": "origin/main"
}
]
}
}
}
},
"4e6543b26313": {
"name": "git.branchCompare#2",
"ordinal": 11,
"args": [
{
"name": "method",
"value": "git.branchCompare"
},
{
"name": "params",
"value": {
"baseRef": "origin/main",
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-6",
"ok": true,
"result": {
"entries": [],
"summary": {}
}
}
}
},
"5b296b205440": {
"name": "repo.list#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "repo.list"
},
{
"name": "params",
"value": {
"$rpc": "absent"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-2",
"ok": true,
"result": {
"repos": [
{
"id": "repo-9",
"worktreeBaseRef": "origin/main"
}
]
}
}
}
},
"75328af2b182": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"error": "The host sent a reply this app could not read (git.branchCompare)",
"result": {
"$rpc": "null"
}
}
},
"80d0ff3c81e8": {
"name": "worktree.show#1",
"ordinal": 3,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.show\",\"params\":{\"worktree\":\"id:repo-9::/w\"}}"
},
"94cc9c5a329b": {
"name": "worktree.show#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "worktree.show"
},
{
"name": "params",
"value": {
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"worktree": {
"baseRef": "origin/main",
"linkedPR": 12
}
}
}
}
},
"9f5d0ac26269": {
"branchCompare": {
"result": {
"$rpc": "null"
}
},
"diff": "unloaded",
"snapshot": "unloaded"
},
"ca8f7f7c9891": {
"name": "repo.list#2",
"ordinal": 10,
"json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"repo.list\"}"
},
"cf9290001484": {
"name": "git.branchCompare#1",
"ordinal": 5,
"args": [
{
"name": "method",
"value": "git.branchCompare"
},
{
"name": "params",
"value": {
"baseRef": "origin/main",
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"error": {
"code": "forbidden",
"message": "git is not available"
},
"id": "frame-3",
"ok": false
}
}
},
"d64700b9de3b": {
"name": "repo.list#1",
"ordinal": 4,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"repo.list\"}"
},
"ee6fc162c326": {
"name": "worktree.show#2",
"ordinal": 9,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.show\",\"params\":{\"worktree\":\"id:repo-9::/w\"}}"
},
"ef9013648cfb": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"result": {
"$rpc": "null"
}
}
},
"fb450de97b86": {
"name": "git.branchCompare#1",
"ordinal": 6,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"git.branchCompare\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"baseRef\":\"origin/main\"}}"
}
},
"recording": {
"scenario": "diff-review-branch-compare",
"checkpoints": [
{
"id": "unavailable",
"observation": {
"sender": ["94cc9c5a329b", "5b296b205440", "cf9290001484"],
"payloads": ["80d0ff3c81e8", "d64700b9de3b", "fb450de97b86"],
"settlements": {
"unavailable": "ef9013648cfb"
},
"state": "9f5d0ac26269",
"effects": []
}
},
{
"id": "invalid",
"observation": {
"sender": [
"94cc9c5a329b",
"5b296b205440",
"cf9290001484",
"284ce622e74a",
"4b4f2d7405b8",
"4e6543b26313"
],
"payloads": [
"80d0ff3c81e8",
"d64700b9de3b",
"fb450de97b86",
"ee6fc162c326",
"ca8f7f7c9891",
"412402e093cc"
],
"settlements": {
"unavailable": "ef9013648cfb",
"invalid": "75328af2b182"
},
"state": "347ad3543d28",
"effects": []
}
}
]
}
}
@@ -1,111 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.diff-review-load",
"family": "session.diff-review",
"namedDeltas": [],
"values": {
"365c17523d76": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"itemKey": "branch:src/app.ts",
"kind": "binary"
}
},
"38fb361f406c": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Committed diff is unavailable",
"isRpcDeliveryUnknown": false
}
},
"534cf7badcbc": {
"branchCompare": "unloaded",
"diff": {
"itemKey": "branch:src/app.ts",
"kind": "binary"
},
"snapshot": "unloaded"
},
"ce804facf021": {
"name": "git.branchDiff#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"git.branchDiff\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"filePath\":\"src/app.ts\",\"compare\":{\"baseRef\":\"origin/main\",\"baseOid\":\"a1b2c3d4e5f60718293a4b5c6d7e8f9012345678\",\"headOid\":\"f0e1d2c3b4a5968778695a4b3c2d1e0f98765432\",\"mergeBase\":\"0123456789abcdef0123456789abcdef01234567\"}}}"
},
"d24ea9d9187c": {
"name": "git.branchDiff#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "git.branchDiff"
},
{
"name": "params",
"value": {
"compare": {
"baseOid": "a1b2c3d4e5f60718293a4b5c6d7e8f9012345678",
"baseRef": "origin/main",
"headOid": "f0e1d2c3b4a5968778695a4b3c2d1e0f98765432",
"mergeBase": "0123456789abcdef0123456789abcdef01234567"
},
"filePath": "src/app.ts",
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"kind": "binary"
}
}
}
}
},
"recording": {
"scenario": "diff-review-branch-file-diff",
"checkpoints": [
{
"id": "branch",
"observation": {
"sender": ["d24ea9d9187c"],
"payloads": ["ce804facf021"],
"settlements": {
"branch": "365c17523d76"
},
"state": "534cf7badcbc",
"effects": []
}
},
{
"id": "no-compare",
"observation": {
"sender": ["d24ea9d9187c"],
"payloads": ["ce804facf021"],
"settlements": {
"branch": "365c17523d76",
"no-compare": "38fb361f406c"
},
"state": "534cf7badcbc",
"effects": []
}
}
]
}
}
@@ -1,301 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.diff-review-load",
"family": "session.diff-review",
"namedDeltas": [],
"values": {
"5dc9494ad121": {
"name": "git.commitDiff#1",
"ordinal": 4,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"git.commitDiff\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"filePath\":\"src/app.ts\",\"commitOid\":\"c0ffee0123456789abcdef0123456789abcdef01\",\"parentOid\":\"beef0123456789abcdef0123456789abcdef0123\"}}"
},
"61b51593919d": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"branchCompare": {
"$rpc": "null"
},
"comments": [],
"commit": {
"commitOid": "c0ffee0123456789abcdef0123456789abcdef01",
"entries": [
{
"added": 2,
"path": "src/app.ts",
"removed": 1,
"status": "modified"
}
],
"parentOid": "beef0123456789abcdef0123456789abcdef0123"
},
"kind": "ready",
"reviewState": {
"files": {},
"version": 1
},
"status": {
"conflictOperation": "unknown",
"entries": []
}
}
},
"731c50dc5312": {
"branchCompare": "unloaded",
"diff": {
"itemKey": "commit:src/app.ts",
"kind": "ready",
"lines": [
{
"highlighted": true,
"kind": "context",
"newLineNumber": 1,
"oldLineNumber": 1,
"segments": [
{
"kind": "plain",
"text": "a"
}
],
"text": "a"
},
{
"highlighted": true,
"kind": "add",
"newLineNumber": 2,
"segments": [
{
"kind": "plain",
"text": "b"
}
],
"text": "b"
}
],
"truncated": false
},
"snapshot": {
"branchCompare": {
"$rpc": "null"
},
"comments": [],
"commit": {
"commitOid": "c0ffee0123456789abcdef0123456789abcdef01",
"entries": [
{
"added": 2,
"path": "src/app.ts",
"removed": 1,
"status": "modified"
}
],
"parentOid": "beef0123456789abcdef0123456789abcdef0123"
},
"kind": "ready",
"reviewState": {
"files": {},
"version": 1
},
"status": {
"conflictOperation": "unknown",
"entries": []
}
}
},
"73a10d522a32": {
"branchCompare": "unloaded",
"diff": "unloaded",
"snapshot": {
"branchCompare": {
"$rpc": "null"
},
"comments": [],
"commit": {
"commitOid": "c0ffee0123456789abcdef0123456789abcdef01",
"entries": [
{
"added": 2,
"path": "src/app.ts",
"removed": 1,
"status": "modified"
}
],
"parentOid": "beef0123456789abcdef0123456789abcdef0123"
},
"kind": "ready",
"reviewState": {
"files": {},
"version": 1
},
"status": {
"conflictOperation": "unknown",
"entries": []
}
}
},
"78129084c077": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"itemKey": "commit:src/app.ts",
"kind": "ready",
"lines": [
{
"highlighted": true,
"kind": "context",
"newLineNumber": 1,
"oldLineNumber": 1,
"segments": [
{
"kind": "plain",
"text": "a"
}
],
"text": "a"
},
{
"highlighted": true,
"kind": "add",
"newLineNumber": 2,
"segments": [
{
"kind": "plain",
"text": "b"
}
],
"text": "b"
}
],
"truncated": false
}
},
"8c562385dc94": {
"name": "git.commitDiff#1",
"ordinal": 3,
"args": [
{
"name": "method",
"value": "git.commitDiff"
},
{
"name": "params",
"value": {
"commitOid": "c0ffee0123456789abcdef0123456789abcdef01",
"filePath": "src/app.ts",
"parentOid": "beef0123456789abcdef0123456789abcdef0123",
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-2",
"ok": true,
"result": {
"kind": "text",
"modifiedContent": "a\nb\n",
"modifiedIsBinary": false,
"originalContent": "a\n",
"originalIsBinary": false
}
}
}
},
"9d48143d94db": {
"name": "git.commitCompare#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"git.commitCompare\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"commitId\":\"c0ffee0123456789abcdef0123456789abcdef01\"}}"
},
"f9d60d9b8a69": {
"name": "git.commitCompare#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "git.commitCompare"
},
{
"name": "params",
"value": {
"commitId": "c0ffee0123456789abcdef0123456789abcdef01",
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"entries": [
{
"added": 2,
"path": "src/app.ts",
"removed": 1,
"status": "modified"
}
],
"summary": {
"baseRef": "beef012",
"changedFiles": 1,
"commitOid": "c0ffee0123456789abcdef0123456789abcdef01",
"compareRef": "c0ffee0",
"parentOid": "beef0123456789abcdef0123456789abcdef0123",
"status": "ready"
}
}
}
}
}
},
"recording": {
"scenario": "diff-review-commit-file-diff",
"checkpoints": [
{
"id": "commit",
"observation": {
"sender": ["f9d60d9b8a69"],
"payloads": ["9d48143d94db"],
"settlements": {
"commit": "61b51593919d"
},
"state": "73a10d522a32",
"effects": []
}
},
{
"id": "commit-file",
"observation": {
"sender": ["f9d60d9b8a69", "8c562385dc94"],
"payloads": ["9d48143d94db", "5dc9494ad121"],
"settlements": {
"commit": "61b51593919d",
"commit-file": "78129084c077"
},
"state": "731c50dc5312",
"effects": []
}
}
]
}
}
@@ -1,222 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.diff-review-load",
"family": "session.diff-review",
"namedDeltas": [],
"values": {
"0698901154de": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"itemKey": "unstaged:src/app.ts",
"kind": "too-large"
}
},
"18072d796980": {
"name": "git.diff#3",
"ordinal": 6,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"git.diff\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"filePath\":\"src/app.ts\",\"staged\":false}}"
},
"2ecd0366533c": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"itemKey": "unstaged:src/app.ts",
"kind": "deleted"
}
},
"33908d1938b7": {
"name": "git.diff#2",
"ordinal": 4,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"git.diff\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"filePath\":\"src/app.ts\",\"staged\":false}}"
},
"481bd3924019": {
"name": "git.diff#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"git.diff\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"filePath\":\"src/app.ts\",\"staged\":false}}"
},
"5768cc374e1d": {
"branchCompare": "unloaded",
"diff": {
"itemKey": "unstaged:src/app.ts",
"kind": "too-large"
},
"snapshot": "unloaded"
},
"67daf7391fee": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Unable to load diff",
"isRpcDeliveryUnknown": false
}
},
"a71fa2bf76b8": {
"name": "git.diff#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "git.diff"
},
{
"name": "params",
"value": {
"filePath": "src/app.ts",
"staged": false,
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"error": {
"code": "diff_too_large",
"message": "Diff exceeds the limit"
},
"id": "frame-1",
"ok": false
}
}
},
"abf08f796be3": {
"name": "git.diff#2",
"ordinal": 3,
"args": [
{
"name": "method",
"value": "git.diff"
},
{
"name": "params",
"value": {
"filePath": "src/app.ts",
"staged": false,
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"error": {
"code": "internal",
"message": "boom"
},
"id": "frame-2",
"ok": false
}
}
},
"b9d9c7cacbea": {
"name": "git.diff#3",
"ordinal": 5,
"args": [
{
"name": "method",
"value": "git.diff"
},
{
"name": "params",
"value": {
"filePath": "src/app.ts",
"staged": false,
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"error": {
"code": "internal",
"message": ""
},
"id": "frame-3",
"ok": false
}
}
},
"f10ae0495f82": {
"branchCompare": "unloaded",
"diff": {
"itemKey": "unstaged:src/app.ts",
"kind": "deleted"
},
"snapshot": "unloaded"
}
},
"recording": {
"scenario": "diff-review-refused-file-diff",
"checkpoints": [
{
"id": "diff-too-large",
"observation": {
"sender": ["a71fa2bf76b8"],
"payloads": ["481bd3924019"],
"settlements": {
"diff-too-large": "0698901154de"
},
"state": "5768cc374e1d",
"effects": []
}
},
{
"id": "deleted",
"observation": {
"sender": ["a71fa2bf76b8", "abf08f796be3"],
"payloads": ["481bd3924019", "33908d1938b7"],
"settlements": {
"diff-too-large": "0698901154de",
"deleted": "2ecd0366533c"
},
"state": "f10ae0495f82",
"effects": []
}
},
{
"id": "refused",
"observation": {
"sender": ["a71fa2bf76b8", "abf08f796be3", "b9d9c7cacbea"],
"payloads": ["481bd3924019", "33908d1938b7", "18072d796980"],
"settlements": {
"diff-too-large": "0698901154de",
"deleted": "2ecd0366533c",
"refused": "67daf7391fee"
},
"state": "f10ae0495f82",
"effects": []
}
}
]
}
}
@@ -1,537 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.diff-review-load",
"family": "session.diff-review",
"namedDeltas": [],
"values": {
"11e9ea6be860": {
"name": "git.status#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "git.status"
},
{
"name": "params",
"value": {
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"1f10fad6906c": {
"name": "worktree.show#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "worktree.show"
},
{
"name": "params",
"value": {
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"3374ccf2bc9a": {
"name": "repo.list#1",
"ordinal": 5,
"args": [
{
"name": "method",
"value": "repo.list"
},
{
"name": "params",
"value": {
"$rpc": "absent"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"411c662db736": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"branchCompare": {
"entries": [
{
"added": 1,
"oldPath": {
"$rpc": "undefined"
},
"path": "src/old.ts",
"removed": 0,
"status": "modified"
}
],
"summary": {
"baseOid": "a1b2c3d4e5f60718293a4b5c6d7e8f9012345678",
"baseRef": "origin/main",
"changedFiles": 1,
"commitsAhead": {
"$rpc": "undefined"
},
"compareRef": "feature",
"errorMessage": {
"$rpc": "undefined"
},
"headOid": "f0e1d2c3b4a5968778695a4b3c2d1e0f98765432",
"mergeBase": "0123456789abcdef0123456789abcdef01234567",
"status": "ready"
}
},
"branchError": {
"$rpc": "undefined"
},
"comments": [],
"kind": "ready",
"reviewState": {
"completedAt": {
"$rpc": "undefined"
},
"files": {
"branch\u0000branch\u0000\u0000src/old.ts": {
"filePath": "src/old.ts",
"key": "branch\u0000branch\u0000\u0000src/old.ts",
"lastOpenedAt": {
"$rpc": "undefined"
},
"lastSeenDiffIdentity": {
"$rpc": "undefined"
},
"oldPath": {
"$rpc": "undefined"
},
"reviewDiffIdentity": {
"$rpc": "undefined"
},
"reviewedAt": {
"$rpc": "undefined"
},
"scope": "branch"
},
"unstaged\u0000unstaged\u0000\u0000src/app.ts": {
"filePath": "src/app.ts",
"key": "unstaged\u0000unstaged\u0000\u0000src/app.ts",
"lastOpenedAt": {
"$rpc": "undefined"
},
"lastSeenDiffIdentity": {
"$rpc": "undefined"
},
"oldPath": {
"$rpc": "undefined"
},
"reviewDiffIdentity": {
"$rpc": "undefined"
},
"reviewedAt": {
"$rpc": "undefined"
},
"scope": "unstaged"
}
},
"updatedAt": 1767225600000,
"version": 1
},
"status": {
"branch": "feature",
"entries": [
{
"added": 3,
"area": "unstaged",
"path": "src/app.ts",
"removed": 1,
"status": "modified"
}
],
"head": "head-sha-1",
"upstreamStatus": {
"ahead": 1,
"behind": 0,
"hasUpstream": true
}
}
}
},
"5abf3b2ba503": {
"branchCompare": "unloaded",
"diff": "unloaded",
"snapshot": {
"branchCompare": {
"entries": [
{
"added": 1,
"oldPath": {
"$rpc": "undefined"
},
"path": "src/old.ts",
"removed": 0,
"status": "modified"
}
],
"summary": {
"baseOid": "a1b2c3d4e5f60718293a4b5c6d7e8f9012345678",
"baseRef": "origin/main",
"changedFiles": 1,
"commitsAhead": {
"$rpc": "undefined"
},
"compareRef": "feature",
"errorMessage": {
"$rpc": "undefined"
},
"headOid": "f0e1d2c3b4a5968778695a4b3c2d1e0f98765432",
"mergeBase": "0123456789abcdef0123456789abcdef01234567",
"status": "ready"
}
},
"branchError": {
"$rpc": "undefined"
},
"comments": [],
"kind": "ready",
"reviewState": {
"completedAt": {
"$rpc": "undefined"
},
"files": {
"branch\u0000branch\u0000\u0000src/old.ts": {
"filePath": "src/old.ts",
"key": "branch\u0000branch\u0000\u0000src/old.ts",
"lastOpenedAt": {
"$rpc": "undefined"
},
"lastSeenDiffIdentity": {
"$rpc": "undefined"
},
"oldPath": {
"$rpc": "undefined"
},
"reviewDiffIdentity": {
"$rpc": "undefined"
},
"reviewedAt": {
"$rpc": "undefined"
},
"scope": "branch"
},
"unstaged\u0000unstaged\u0000\u0000src/app.ts": {
"filePath": "src/app.ts",
"key": "unstaged\u0000unstaged\u0000\u0000src/app.ts",
"lastOpenedAt": {
"$rpc": "undefined"
},
"lastSeenDiffIdentity": {
"$rpc": "undefined"
},
"oldPath": {
"$rpc": "undefined"
},
"reviewDiffIdentity": {
"$rpc": "undefined"
},
"reviewedAt": {
"$rpc": "undefined"
},
"scope": "unstaged"
}
},
"updatedAt": 1767225600000,
"version": 1
},
"status": {
"branch": "feature",
"entries": [
{
"added": 3,
"area": "unstaged",
"path": "src/app.ts",
"removed": 1,
"status": "modified"
}
],
"head": "head-sha-1",
"upstreamStatus": {
"ahead": 1,
"behind": 0,
"hasUpstream": true
}
}
}
},
"5dbd52d6a1c7": {
"name": "worktree.show#1",
"ordinal": 4,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.show\",\"params\":{\"worktree\":\"id:repo-9::/w\"}}"
},
"5dd74fdeb001": {
"name": "worktree.show#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "worktree.show"
},
{
"name": "params",
"value": {
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-2",
"ok": true,
"result": {
"worktree": {
"baseRef": "origin/main",
"diffComments": [],
"linkedPR": 12,
"mobileDiffReview": {
"files": []
}
}
}
}
}
},
"622e5aadb43d": {
"name": "git.branchCompare#1",
"ordinal": 8,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"git.branchCompare\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"baseRef\":\"origin/main\"}}"
},
"648638103acb": {
"name": "repo.list#1",
"ordinal": 6,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"repo.list\"}"
},
"8db27b0778a5": {
"name": "git.status#1",
"ordinal": 3,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"git.status\",\"params\":{\"worktree\":\"id:repo-9::/w\"}}"
},
"9270aeb7d9c6": {
"status": "pending",
"startedAt": 0
},
"9affac551982": {
"name": "repo.list#1",
"ordinal": 5,
"args": [
{
"name": "method",
"value": "repo.list"
},
{
"name": "params",
"value": {
"$rpc": "absent"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": {
"repos": [
{
"id": "repo-9",
"worktreeBaseRef": "origin/main"
}
]
}
}
}
},
"c0f7fd87f4a5": {
"name": "git.branchCompare#1",
"ordinal": 7,
"args": [
{
"name": "method",
"value": "git.branchCompare"
},
{
"name": "params",
"value": {
"baseRef": "origin/main",
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-4",
"ok": true,
"result": {
"entries": [
{
"added": 1,
"path": "src/old.ts",
"removed": 0,
"status": "modified"
}
],
"summary": {
"baseOid": "a1b2c3d4e5f60718293a4b5c6d7e8f9012345678",
"baseRef": "origin/main",
"changedFiles": 1,
"compareRef": "feature",
"headOid": "f0e1d2c3b4a5968778695a4b3c2d1e0f98765432",
"mergeBase": "0123456789abcdef0123456789abcdef01234567",
"status": "ready"
}
}
}
}
},
"d0e28a73dae6": {
"name": "git.status#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "git.status"
},
{
"name": "params",
"value": {
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"branch": "feature",
"entries": [
{
"added": 3,
"area": "unstaged",
"path": "src/app.ts",
"removed": 1,
"status": "modified"
}
],
"head": "head-sha-1",
"upstreamStatus": {
"ahead": 1,
"behind": 0,
"hasUpstream": true
}
}
}
}
},
"e39817462870": {
"branchCompare": "unloaded",
"diff": "unloaded",
"snapshot": "unloaded"
}
},
"recording": {
"scenario": "diff-review-snapshot",
"checkpoints": [
{
"id": "pending",
"observation": {
"sender": ["11e9ea6be860", "1f10fad6906c", "3374ccf2bc9a"],
"payloads": ["8db27b0778a5", "5dbd52d6a1c7", "648638103acb"],
"settlements": {
"snapshot": "9270aeb7d9c6"
},
"state": "e39817462870",
"effects": []
}
},
{
"id": "snapshot",
"observation": {
"sender": ["d0e28a73dae6", "5dd74fdeb001", "9affac551982", "c0f7fd87f4a5"],
"payloads": ["8db27b0778a5", "5dbd52d6a1c7", "648638103acb", "622e5aadb43d"],
"settlements": {
"snapshot": "411c662db736"
},
"state": "5abf3b2ba503",
"effects": []
}
}
]
}
}
@@ -1,136 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.diff-review-load",
"family": "session.diff-review",
"namedDeltas": [],
"values": {
"1f10fad6906c": {
"name": "worktree.show#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "worktree.show"
},
{
"name": "params",
"value": {
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"3374ccf2bc9a": {
"name": "repo.list#1",
"ordinal": 5,
"args": [
{
"name": "method",
"value": "repo.list"
},
{
"name": "params",
"value": {
"$rpc": "absent"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"45d1ea7c0b42": {
"name": "git.status#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "git.status"
},
{
"name": "params",
"value": {
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"error": {
"code": "method_not_found",
"message": "Unknown method"
},
"id": "frame-1",
"ok": false
}
}
},
"5dbd52d6a1c7": {
"name": "worktree.show#1",
"ordinal": 4,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.show\",\"params\":{\"worktree\":\"id:repo-9::/w\"}}"
},
"648638103acb": {
"name": "repo.list#1",
"ordinal": 6,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"repo.list\"}"
},
"8db27b0778a5": {
"name": "git.status#1",
"ordinal": 3,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"git.status\",\"params\":{\"worktree\":\"id:repo-9::/w\"}}"
},
"9270aeb7d9c6": {
"status": "pending",
"startedAt": 0
},
"e39817462870": {
"branchCompare": "unloaded",
"diff": "unloaded",
"snapshot": "unloaded"
}
},
"recording": {
"scenario": "diff-review-status-unavailable",
"checkpoints": [
{
"id": "unavailable",
"observation": {
"sender": ["45d1ea7c0b42", "1f10fad6906c", "3374ccf2bc9a"],
"payloads": ["8db27b0778a5", "5dbd52d6a1c7", "648638103acb"],
"settlements": {
"unavailable": "9270aeb7d9c6"
},
"state": "e39817462870",
"effects": []
}
}
]
}
}
@@ -1,222 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.diff-review-load",
"family": "session.diff-review",
"namedDeltas": [],
"values": {
"168eeea61142": {
"name": "git.diff#3",
"ordinal": 5,
"args": [
{
"name": "method",
"value": "git.diff"
},
{
"name": "params",
"value": {
"filePath": "src/app.ts",
"staged": false,
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": {
"kind": "unknown"
}
}
}
},
"18072d796980": {
"name": "git.diff#3",
"ordinal": 6,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"git.diff\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"filePath\":\"src/app.ts\",\"staged\":false}}"
},
"481bd3924019": {
"name": "git.diff#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"git.diff\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"filePath\":\"src/app.ts\",\"staged\":false}}"
},
"50bd7426ef76": {
"name": "git.diff#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "git.diff"
},
{
"name": "params",
"value": {
"filePath": "src/app.ts",
"staged": false,
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"kind": "binary"
}
}
}
},
"5135c435b058": {
"name": "git.diff#2",
"ordinal": 3,
"args": [
{
"name": "method",
"value": "git.diff"
},
{
"name": "params",
"value": {
"filePath": "src/app.ts",
"staged": true,
"worktree": "id:repo-9::/w"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-2",
"ok": true,
"result": {
"byteLength": 2048,
"kind": "too-large"
}
}
}
},
"717bd1fbc163": {
"branchCompare": "unloaded",
"diff": {
"byteLength": 2048,
"itemKey": "staged:src/app.ts",
"kind": "too-large"
},
"snapshot": "unloaded"
},
"7753343578da": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "The host sent a reply this app could not read (git.diff)",
"isRpcDeliveryUnknown": false
}
},
"84090dfad90d": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"itemKey": "unstaged:src/app.ts",
"kind": "binary"
}
},
"8675e0f40158": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"byteLength": 2048,
"itemKey": "staged:src/app.ts",
"kind": "too-large"
}
},
"ea98fa53e2cc": {
"name": "git.diff#2",
"ordinal": 4,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"git.diff\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"filePath\":\"src/app.ts\",\"staged\":true}}"
},
"f68945ffc2ea": {
"branchCompare": "unloaded",
"diff": {
"itemKey": "unstaged:src/app.ts",
"kind": "binary"
},
"snapshot": "unloaded"
}
},
"recording": {
"scenario": "diff-review-worktree-file-diff",
"checkpoints": [
{
"id": "binary",
"observation": {
"sender": ["50bd7426ef76"],
"payloads": ["481bd3924019"],
"settlements": {
"binary": "84090dfad90d"
},
"state": "f68945ffc2ea",
"effects": []
}
},
{
"id": "too-large",
"observation": {
"sender": ["50bd7426ef76", "5135c435b058"],
"payloads": ["481bd3924019", "ea98fa53e2cc"],
"settlements": {
"binary": "84090dfad90d",
"too-large": "8675e0f40158"
},
"state": "717bd1fbc163",
"effects": []
}
},
{
"id": "invalid",
"observation": {
"sender": ["50bd7426ef76", "5135c435b058", "168eeea61142"],
"payloads": ["481bd3924019", "ea98fa53e2cc", "18072d796980"],
"settlements": {
"binary": "84090dfad90d",
"too-large": "8675e0f40158",
"invalid": "7753343578da"
},
"state": "717bd1fbc163",
"effects": []
}
}
]
}
}
@@ -1,137 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "files.terminal-path-tap",
"family": "files.terminal-path-tap",
"namedDeltas": [],
"values": {
"0358eb8770a0": {
"name": "files.resolveTerminalPath#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "files.resolveTerminalPath"
},
{
"name": "params",
"value": {
"crossWorkspace": true,
"cwd": "/repo",
"pathText": "src/app.ts",
"terminal": "terminal-1",
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"timeoutMs": 10000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"exists": true,
"isDirectory": false,
"openTarget": {
"absolutePath": "/repo/src/app.ts",
"kind": "worktree-file",
"provider": "ssh",
"relativePath": "src/app.ts"
},
"relativePath": "src/app.ts"
}
}
}
},
"47a3b40d1640": {
"name": "files.open#1",
"ordinal": 5,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"files.open\",\"params\":{\"worktree\":\"id:workspace-1\",\"relativePath\":\"src/app.ts\"}}"
},
"561f3fedeb78": {
"name": "files.resolveTerminalPath#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"files.resolveTerminalPath\",\"params\":{\"worktree\":\"id:workspace-1\",\"pathText\":\"src/app.ts\",\"crossWorkspace\":true,\"terminal\":\"terminal-1\",\"cwd\":\"/repo\"}}"
},
"591c78d805ec": {
"name": "files.open#1",
"ordinal": 4,
"args": [
{
"name": "method",
"value": "files.open"
},
{
"name": "params",
"value": {
"relativePath": "src/app.ts",
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"timeoutMs": 15000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"error": {
"code": "file_locked",
"message": "File is locked"
},
"id": "frame-2",
"ok": false
}
}
},
"c0978ed13409": {
"name": "open-feedback",
"ordinal": 3,
"value": {}
},
"c7ce9c8dc60e": {
"activeSessionTabId": "tab-source",
"failed": 1,
"switched": {
"$rpc": "null"
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "file-tap-open-refused",
"checkpoints": [
{
"id": "open-refused",
"observation": {
"sender": ["0358eb8770a0", "591c78d805ec"],
"payloads": ["561f3fedeb78", "47a3b40d1640"],
"settlements": {
"tap": "eb79a9b3682a"
},
"state": "c7ce9c8dc60e",
"effects": ["c0978ed13409"]
}
}
]
}
}
@@ -1,113 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "files.terminal-path-tap",
"family": "files.terminal-path-tap",
"namedDeltas": [],
"values": {
"220e44211af6": {
"name": "files.resolveTerminalPath#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "files.resolveTerminalPath"
},
{
"name": "params",
"value": {
"crossWorkspace": true,
"cwd": "/repo",
"pathText": "src/app.ts",
"terminal": "terminal-1",
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"timeoutMs": 10000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"exists": true,
"isDirectory": false,
"openTarget": {
"absolutePath": "/logs/run.txt",
"grantId": "grant-1",
"kind": "absolute-file"
}
}
}
}
},
"53fb9b1f36f9": {
"activeSessionTabId": "tab-source",
"failed": 0,
"switched": {
"$rpc": "null"
}
},
"561f3fedeb78": {
"name": "files.resolveTerminalPath#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"files.resolveTerminalPath\",\"params\":{\"worktree\":\"id:workspace-1\",\"pathText\":\"src/app.ts\",\"crossWorkspace\":true,\"terminal\":\"terminal-1\",\"cwd\":\"/repo\"}}"
},
"a4f3b56d5a81": {
"name": "push-preview-route",
"ordinal": 4,
"value": {
"params": {
"absolutePath": "/logs/run.txt",
"cwd": "/repo",
"grantId": "grant-1",
"hostId": "host-1",
"name": "run.txt",
"pathText": "src/app.ts",
"source": "terminalArtifact",
"terminal": "terminal-1",
"worktreeId": "workspace-1",
"worktreeName": "workspace"
},
"pathname": "/h/[hostId]/files/preview/[worktreeId]"
}
},
"c0978ed13409": {
"name": "open-feedback",
"ordinal": 3,
"value": {}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "file-tap-previews-absolute-artifact",
"checkpoints": [
{
"id": "previewed",
"observation": {
"sender": ["220e44211af6"],
"payloads": ["561f3fedeb78"],
"settlements": {
"tap": "eb79a9b3682a"
},
"state": "53fb9b1f36f9",
"effects": ["c0978ed13409", "a4f3b56d5a81"]
}
}
]
}
}
@@ -1,84 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "files.terminal-path-tap",
"family": "files.terminal-path-tap",
"namedDeltas": [],
"values": {
"3445711170ff": {
"name": "files.resolveTerminalPath#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "files.resolveTerminalPath"
},
{
"name": "params",
"value": {
"crossWorkspace": true,
"cwd": "/repo",
"pathText": "src/app.ts",
"terminal": "terminal-1",
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"timeoutMs": 10000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"exists": false,
"isDirectory": false
}
}
}
},
"561f3fedeb78": {
"name": "files.resolveTerminalPath#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"files.resolveTerminalPath\",\"params\":{\"worktree\":\"id:workspace-1\",\"pathText\":\"src/app.ts\",\"crossWorkspace\":true,\"terminal\":\"terminal-1\",\"cwd\":\"/repo\"}}"
},
"c7ce9c8dc60e": {
"activeSessionTabId": "tab-source",
"failed": 1,
"switched": {
"$rpc": "null"
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "file-tap-resolve-miss",
"checkpoints": [
{
"id": "missed",
"observation": {
"sender": ["3445711170ff"],
"payloads": ["561f3fedeb78"],
"settlements": {
"tap": "eb79a9b3682a"
},
"state": "c7ce9c8dc60e",
"effects": []
}
}
]
}
}
@@ -1,84 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "files.terminal-path-tap",
"family": "files.terminal-path-tap",
"namedDeltas": [],
"values": {
"279749a84cb2": {
"name": "files.resolveTerminalPath#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "files.resolveTerminalPath"
},
{
"name": "params",
"value": {
"crossWorkspace": true,
"cwd": "/repo",
"pathText": "src/app.ts",
"terminal": "terminal-1",
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"timeoutMs": 10000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"error": {
"code": "worktree_not_found",
"message": "No such workspace"
},
"id": "frame-1",
"ok": false
}
}
},
"561f3fedeb78": {
"name": "files.resolveTerminalPath#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"files.resolveTerminalPath\",\"params\":{\"worktree\":\"id:workspace-1\",\"pathText\":\"src/app.ts\",\"crossWorkspace\":true,\"terminal\":\"terminal-1\",\"cwd\":\"/repo\"}}"
},
"c7ce9c8dc60e": {
"activeSessionTabId": "tab-source",
"failed": 1,
"switched": {
"$rpc": "null"
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "file-tap-resolve-refused",
"checkpoints": [
{
"id": "refused",
"observation": {
"sender": ["279749a84cb2"],
"payloads": ["561f3fedeb78"],
"settlements": {
"tap": "eb79a9b3682a"
},
"state": "c7ce9c8dc60e",
"effects": []
}
}
]
}
}
@@ -1,160 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "files.explorer-screen",
"family": "files.explorer-screen",
"namedDeltas": [],
"values": {
"34bd55d6f194": {
"name": "files.readDir#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"files.readDir\",\"params\":{\"worktree\":\"id:wt-files\",\"relativePath\":\"\",\"limit\":500}}"
},
"9f1a5ca359ab": {
"crash": {
"$rpc": "null"
},
"elements": {
"ChevronLeft": 1,
"Defs": 1,
"FlatList": 1,
"LinearGradient": 1,
"Pressable": 1,
"Rect": 1,
"SafeAreaView": 1,
"Search": 1,
"Stop": 2,
"Svg": 1,
"Text": 2,
"TextInput": 1,
"View": 11
},
"labels": ["Back to session", "Filter files"],
"rows": ["dir:src", "file:README.md"],
"text": ["Files", "orca-files"]
},
"c60ce6016166": {
"name": "files.readDir#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "files.readDir"
},
{
"name": "params",
"value": {
"limit": 500,
"relativePath": "",
"worktree": "id:wt-files"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": [
{
"isDirectory": true,
"name": "src"
},
{
"isDirectory": false,
"name": "README.md"
}
]
}
}
},
"c721e7f4a5c5": {
"crash": {
"$rpc": "null"
},
"elements": {
"ActivityIndicator": 1,
"ChevronLeft": 1,
"Pressable": 1,
"SafeAreaView": 1,
"Text": 3,
"View": 7
},
"labels": ["Back to session"],
"rows": [],
"text": ["Files", "orca-files", "Loading files…"]
},
"ca13345ac236": {
"name": "files.readDir#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "files.readDir"
},
{
"name": "params",
"value": {
"limit": 500,
"relativePath": "",
"worktree": "id:wt-files"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "files-explorer-readdir",
"checkpoints": [
{
"id": "loading",
"observation": {
"sender": ["ca13345ac236"],
"payloads": ["34bd55d6f194"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "c721e7f4a5c5",
"effects": []
}
},
{
"id": "listed",
"observation": {
"sender": ["c60ce6016166"],
"payloads": ["34bd55d6f194"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "9f1a5ca359ab",
"effects": []
}
}
]
}
}
@@ -1,118 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "files.mutation-ownership",
"family": "files.mutation-ownership",
"namedDeltas": [],
"values": {
"4e53935c13ac": {
"name": "worktree.show#1",
"ordinal": 3,
"args": [
{
"name": "method",
"value": "worktree.show"
},
{
"name": "params",
"value": {
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"timeoutMs": 15000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-2",
"ok": true,
"result": {
"worktree": {
"hostId": "local"
}
}
}
}
},
"548f05412e41": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"expectedExecutionHostId": "local"
}
},
"bab8756fa040": {
"ownership": {
"expectedExecutionHostId": "local"
}
},
"c924e7a5a7da": {
"name": "worktree.show#1",
"ordinal": 4,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.show\",\"params\":{\"worktree\":\"id:workspace-1\"}}"
},
"d08f74d65ee6": {
"name": "status.get#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"status.get\"}"
},
"e81d3a627ac2": {
"name": "status.get#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "status.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"timeoutMs": 15000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"capabilities": ["files.mutation-ownership.v1"]
}
}
}
}
},
"recording": {
"scenario": "files-ownership-local",
"checkpoints": [
{
"id": "settled",
"observation": {
"sender": ["e81d3a627ac2", "4e53935c13ac"],
"payloads": ["d08f74d65ee6", "c924e7a5a7da"],
"settlements": {
"capture": "548f05412e41"
},
"state": "bab8756fa040",
"effects": []
}
}
]
}
}
@@ -1,214 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "files.mutation-ownership",
"family": "files.mutation-ownership",
"namedDeltas": [],
"values": {
"088efd8ff3f7": {
"name": "ssh.getState#1",
"ordinal": 6,
"json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"ssh.getState\",\"params\":{\"targetId\":\"target-1\"}}"
},
"29bfbe94cca9": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"expectedExecutionHostId": "ssh:target-1",
"expectedSshConnectionGeneration": 3,
"expectedSshTargetId": "target-1"
}
},
"3cf4416a7928": {
"name": "worktree.show#1",
"ordinal": 3,
"args": [
{
"name": "method",
"value": "worktree.show"
},
{
"name": "params",
"value": {
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"timeoutMs": 15000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-2",
"ok": true,
"result": {
"worktree": {
"hostId": "ssh:target-1"
}
}
}
}
},
"518ec57c381a": {
"ownership": "uncaptured"
},
"83e4ac78046a": {
"name": "status.get#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "status.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"timeoutMs": 15000
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"9270aeb7d9c6": {
"status": "pending",
"startedAt": 0
},
"b6e8ae2b152e": {
"name": "ssh.getState#1",
"ordinal": 5,
"args": [
{
"name": "method",
"value": "ssh.getState"
},
{
"name": "params",
"value": {
"targetId": "target-1"
}
},
{
"name": "options",
"value": {
"timeoutMs": 15000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-3",
"ok": true,
"result": {
"state": {
"connectionGeneration": 3,
"error": {
"$rpc": "null"
},
"reconnectAttempt": 0,
"status": "connected",
"targetId": "target-1"
}
}
}
}
},
"bd84dadd27c7": {
"ownership": {
"expectedExecutionHostId": "ssh:target-1",
"expectedSshConnectionGeneration": 3,
"expectedSshTargetId": "target-1"
}
},
"c924e7a5a7da": {
"name": "worktree.show#1",
"ordinal": 4,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.show\",\"params\":{\"worktree\":\"id:workspace-1\"}}"
},
"d08f74d65ee6": {
"name": "status.get#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"status.get\"}"
},
"e81d3a627ac2": {
"name": "status.get#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "status.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"timeoutMs": 15000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"capabilities": ["files.mutation-ownership.v1"]
}
}
}
}
},
"recording": {
"scenario": "files-ownership-ssh",
"checkpoints": [
{
"id": "status-pending",
"observation": {
"sender": ["83e4ac78046a"],
"payloads": ["d08f74d65ee6"],
"settlements": {
"capture": "9270aeb7d9c6"
},
"state": "518ec57c381a",
"effects": []
}
},
{
"id": "settled",
"observation": {
"sender": ["e81d3a627ac2", "3cf4416a7928", "b6e8ae2b152e"],
"payloads": ["d08f74d65ee6", "c924e7a5a7da", "088efd8ff3f7"],
"settlements": {
"capture": "29bfbe94cca9"
},
"state": "bd84dadd27c7",
"effects": []
}
}
]
}
}
@@ -1,89 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "files.preview-load",
"family": "files.preview-load",
"namedDeltas": [],
"values": {
"500d95d47092": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"byteLength": 5,
"content": "hello",
"kind": "text",
"status": "ready",
"truncated": false
}
},
"5beb3ae90517": {
"name": "files.readTerminalArtifact#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"files.readTerminalArtifact\",\"params\":{\"worktree\":\"id:workspace-1\",\"absolutePath\":\"/logs/run.txt\",\"grantId\":\"grant-1\"}}"
},
"784ea351e5b2": {
"preview": {
"byteLength": 5,
"content": "hello",
"kind": "text",
"status": "ready",
"truncated": false
}
},
"b3fa0f7828ce": {
"name": "files.readTerminalArtifact#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "files.readTerminalArtifact"
},
{
"name": "params",
"value": {
"absolutePath": "/logs/run.txt",
"grantId": "grant-1",
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"byteLength": 5,
"content": "hello",
"truncated": false
}
}
}
}
},
"recording": {
"scenario": "files-preview-artifact-direct",
"checkpoints": [
{
"id": "settled",
"observation": {
"sender": ["b3fa0f7828ce"],
"payloads": ["5beb3ae90517"],
"settlements": {
"load": "500d95d47092"
},
"state": "784ea351e5b2",
"effects": []
}
}
]
}
}
@@ -1,86 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "files.preview-load",
"family": "files.preview-artifact-image",
"namedDeltas": [],
"values": {
"7659b8b575da": {
"preview": {
"dataUri": "data:image/png;base64,aGk=",
"kind": "image",
"status": "ready"
}
},
"b5608d3d00c8": {
"name": "files.readTerminalArtifactPreview#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"files.readTerminalArtifactPreview\",\"params\":{\"worktree\":\"id:workspace-1\",\"absolutePath\":\"/logs/shot.png\",\"grantId\":\"grant-1\"}}"
},
"ce511c0ab8ac": {
"name": "files.readTerminalArtifactPreview#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "files.readTerminalArtifactPreview"
},
{
"name": "params",
"value": {
"absolutePath": "/logs/shot.png",
"grantId": "grant-1",
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"content": "aGk=",
"isBinary": true,
"isImage": true,
"mimeType": "image/png"
}
}
}
},
"eee847a9d90d": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"dataUri": "data:image/png;base64,aGk=",
"kind": "image",
"status": "ready"
}
}
},
"recording": {
"scenario": "files-preview-artifact-image-read",
"checkpoints": [
{
"id": "settled",
"observation": {
"sender": ["ce511c0ab8ac"],
"payloads": ["b5608d3d00c8"],
"settlements": {
"load": "eee847a9d90d"
},
"state": "7659b8b575da",
"effects": []
}
}
]
}
}
@@ -1,86 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "files.preview-load",
"family": "files.preview-load",
"namedDeltas": [],
"values": {
"7659b8b575da": {
"preview": {
"dataUri": "data:image/png;base64,aGk=",
"kind": "image",
"status": "ready"
}
},
"b5608d3d00c8": {
"name": "files.readTerminalArtifactPreview#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"files.readTerminalArtifactPreview\",\"params\":{\"worktree\":\"id:workspace-1\",\"absolutePath\":\"/logs/shot.png\",\"grantId\":\"grant-1\"}}"
},
"ce511c0ab8ac": {
"name": "files.readTerminalArtifactPreview#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "files.readTerminalArtifactPreview"
},
{
"name": "params",
"value": {
"absolutePath": "/logs/shot.png",
"grantId": "grant-1",
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"content": "aGk=",
"isBinary": true,
"isImage": true,
"mimeType": "image/png"
}
}
}
},
"eee847a9d90d": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"dataUri": "data:image/png;base64,aGk=",
"kind": "image",
"status": "ready"
}
}
},
"recording": {
"scenario": "files-preview-artifact-image",
"checkpoints": [
{
"id": "settled",
"observation": {
"sender": ["ce511c0ab8ac"],
"payloads": ["b5608d3d00c8"],
"settlements": {
"load": "eee847a9d90d"
},
"state": "7659b8b575da",
"effects": []
}
}
]
}
}

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