The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Claude Code's and Codex's launch preparation: declared contracts the kit applies in core (#1049)
Dee727d62316274
diff --git a/cli/src/architecture.spec.ts b/cli/src/architecture.spec.tsindex 86ab2181c..070e64a2e 100644--- a/cli/src/architecture.spec.ts+++ b/cli/src/architecture.spec.ts@@ -150,6 +150,8 @@ const EDGE: RegExp[] = [// Their launch specifics are declared data too (launch.ts): Codex's startup probe and retry and its own-login// provider are the kit's, in core, and never a worker's (docs/design/2026-10-08-engine-launch.md)./^engines\/codex\/ownLoginProvider\.ts$/, /^lib\/codexStartupRetry\.ts$/,+ // So is their launch preparation: folder trust and the resume repair are declared, and the kit applies them.+ /^engines\/codex\/portableHistory\.ts$/, /^lib\/claudeTrust\.ts$/,/^lib\/(askQuestion|runtimeProfileController|composerScreen|teamWriteHold|messageHold|terminalActivity|codexTurnRecovery)\.ts$/,/^engines\/(screens|modelControls|questionControls|submissions|nativeControls)\.ts$/,// Claude Code's and Codex's reading of their composer: shared by the two, loaded only by their workers.@@ -250,7 +252,8 @@ describe('the daemon\'s shape', () => {const contracts = new Set(['engines/claude/launch.ts', 'engines/codex/launch.ts'])// The builders: the argv and its script, a relaunch's overrides, a harness's flags.for (const entry of ['lib/engineLaunch.ts', 'lib/launchOverrides.ts', 'engines/launches.ts', 'engines/kit/launchArgs.ts',- 'engines/kit/launchStartup.ts', 'dsh/adapters.ts']) {+ 'engines/kit/launchStartup.ts', 'dsh/adapters.ts', 'engines/launchPrep.ts', 'engines/kit/folderTrust.ts',+ 'engines/kit/resumeRepair.ts', 'dsh/runtime.ts', 'lib/apiInstructions.ts']) {expect([...closureOf(entry).keys()].filter(file => /^engines\/(claude|codex)\//.test(file) && !contracts.has(file)), entry).toEqual([])}expect([...closureOf('lib/engineLaunch.ts').keys()].filter(file => contracts.has(file)).sort()).toEqual([...contracts].sort())@@ -258,7 +261,7 @@ describe('the daemon\'s shape', () => {// load-time repair still reads Codex rollouts (rollout.ts, a later step of the plan). Nothing else of the two.const declared = new Set([...contracts, 'engines/claude/hookContract.ts', 'engines/codex/hookContract.ts', 'engines/codex/rollout.ts'])for (const entry of ['core/agents/create.ts', 'core/agents/fork.ts', 'core/agents/restart.ts', 'core/agents/swap.ts',- 'lib/resumeAgentService.ts']) {+ 'core/agents/launch.ts', 'core/agents/launches.ts', 'lib/resumeAgentService.ts']) {expect([...closureOf(entry).keys()].filter(file => /^engines\/(claude|codex)\//.test(file) && !declared.has(file)), entry).toEqual([])}})diff --git a/cli/src/backendSocket.spec.ts b/cli/src/backendSocket.spec.tsindex d4447ebee..51b6acbc2 100644--- a/cli/src/backendSocket.spec.ts+++ b/cli/src/backendSocket.spec.ts@@ -35,7 +35,6 @@ import * as gitProject from './lib/gitProject.js'import * as scmProjects from './scm/scmProjects.js'import * as machineResources from './lib/machineResources.js'import * as projectFolder from './lib/projectFolder.js'-import * as claudeTrust from './lib/claudeTrust.js'import * as projectPreview from './lib/projectPreview.js'import * as opencodeVersion from './engines/opencode/version.js'import { randomUUID } from 'node:crypto'@@ -635,9 +634,15 @@ vi.mock('./lib/gridAttach.js', async (real) => ({}))// Never the person's real ~/.claude.json or ~/.codex/config.toml: creating an agent records folder trust,// and an unmocked run of these specs used to write test paths into the developer's own config.-vi.mock('./lib/claudeTrust.js', () => ({- claudeTrusts: vi.fn(() => false), codexTrusts: vi.fn(() => false),- preTrustClaudeProject: vi.fn(() => 'trusted'), preTrustCodexProject: vi.fn(() => 'trusted'),+const claudeTrust = vi.hoisted(() => ({+ claudeTrusts: vi.fn((_path: string) => false), codexTrusts: vi.fn((_path: string, _profile?: string | null) => false),+ preTrustClaudeProject: vi.fn((_path: string) => 'trusted' as const), preTrustCodexProject: vi.fn((_path: string, _profile?: string | null) => 'trusted' as const),+}))+vi.mock('./engines/launchPrep.js', async (real) => ({+ ...await real<object>(),+ folderTrust: (engine: string, profile?: string | null) => engine === 'claude'+ ? { trusts: (path: string) => claudeTrust.claudeTrusts(path), record: (path: string) => claudeTrust.preTrustClaudeProject(path) }+ : engine === 'codex' ? { trusts: (path: string) => claudeTrust.codexTrusts(path, profile), record: (path: string) => claudeTrust.preTrustCodexProject(path, profile) } : null,}))function parseSent(ws: InstanceType<typeof wsMock.MockWebSocket>): Array<Record<string, unknown>> {diff --git a/cli/src/core/AGENTS.md b/cli/src/core/AGENTS.mdindex 1cdb134fb..bb5229d41 100644--- a/cli/src/core/AGENTS.md+++ b/cli/src/core/AGENTS.md@@ -37,7 +37,7 @@ questions. Everything else is a service ([../services/AGENTS.md](../services/AGEvalidates bounded replies, retains acknowledged cursors and owns binding/turn state. The explicitinline/older-master compatibility path is the only live parser or runtime profile implementationcomposition in core. Screen reads are bounded and fenced to the worker connection and session binding- ([screen boundary](../../../docs/design/2026-10-08-engine-screen.md)). Core keeps accepted profiles and control authority; native model drivers run in workers through [revocable control grants](../../../docs/design/2026-10-08-engine-model-control.md), and so does question navigation ([question control](../../../docs/design/2026-10-08-engine-question-control.md)). Whether a typed prompt was taken is read there too: core keeps the writer, every Enter and the verdict ([submission](../../../docs/design/2026-10-08-engine-submission.md)). Codex's shared app-server is spoken to from its worker under a stop grant; core keeps the process table, identity and the stop's decisions ([native control](../../../docs/design/2026-10-08-engine-native-control.md)). Their hooks never go to a worker: each engine declares them as data, and core applies the declaration in line with `engines/kit` mechanics (installing settings, refusing a delegated session, correcting a transcript, closing a turn on Stop; [hooks](../../../docs/design/2026-10-08-engine-hooks.md)). Nor does their launch: Codex's startup probe and retry and its own-login provider are declared data too, which core writes into the pane's argv and script ([launch](../../../docs/design/2026-10-08-engine-launch.md)). See [runtime profiles](../../../docs/design/2026-10-08-engine-runtime.md).+ ([screen boundary](../../../docs/design/2026-10-08-engine-screen.md)). Core keeps accepted profiles and control authority; native model drivers run in workers through [revocable control grants](../../../docs/design/2026-10-08-engine-model-control.md), and so does question navigation ([question control](../../../docs/design/2026-10-08-engine-question-control.md)). Whether a typed prompt was taken is read there too: core keeps the writer, every Enter and the verdict ([submission](../../../docs/design/2026-10-08-engine-submission.md)). Codex's shared app-server is spoken to from its worker under a stop grant; core keeps the process table, identity and the stop's decisions ([native control](../../../docs/design/2026-10-08-engine-native-control.md)). Their hooks never go to a worker: each engine declares them as data, and core applies the declaration in line with `engines/kit` mechanics (installing settings, refusing a delegated session, correcting a transcript, closing a turn on Stop; [hooks](../../../docs/design/2026-10-08-engine-hooks.md)). Nor does their launch: Codex's startup probe and retry, its own-login provider, folder trust and the resume repair are declared data too, which core applies in the pane's argv and script and in the engines' files before a spawn ([launch](../../../docs/design/2026-10-08-engine-launch.md)). See [runtime profiles](../../../docs/design/2026-10-08-engine-runtime.md).- `input.ts`, `questions.ts`: messages into a pane; an agent's question and its answer. Core matches an answer to thequestion on screen and holds the lease; Claude Code's and Codex's keys for each approved step come from their engineworker through a revocable grant (`engines/questionControls.ts`).diff --git a/cli/src/core/agents/create.spec.ts b/cli/src/core/agents/create.spec.tsindex f585629f0..804e29ca2 100644--- a/cli/src/core/agents/create.spec.ts+++ b/cli/src/core/agents/create.spec.ts@@ -6,7 +6,6 @@ import { installedDsh } from '../../dsh/installed.js'import { dshPinnedPermissionMode } from '../../dsh/manifest.js'import { materializeWorkspace } from '../../dsh/materialize.js'import { harnessLaunchOrRefusal, incompatibleHarnessEngine } from '../../dsh/runtime.js'-import { preTrustClaudeProject, preTrustCodexProject } from '../../lib/claudeTrust.js'import { createAndRegisterPane } from '../../lib/createAgentPane.js'import { enginePathOverride } from '../../lib/engineBin.js'import { buildEngineLaunchArgv, permissionModeFlags, refusePermissionFlagIfUnsupported, supportsFirstPrompt } from '../../lib/engineLaunch.js'@@ -32,7 +31,15 @@ vi.mock('../../dsh/runtime.js', async (real) => ({}))vi.mock('../../dsh/launch.js', async (real) => ({ ...await real<object>(), harnessEnvToClear: vi.fn(() => ['HARNESS_OLD']) }))vi.mock('../../engines/opencode/version.js', () => ({ opencodeMajorVersion: vi.fn(() => 2) }))-vi.mock('../../lib/claudeTrust.js', () => ({ preTrustClaudeProject: vi.fn(), preTrustCodexProject: vi.fn() }))+// The engines' folder trust (engines/launchPrep.ts), one spy per engine: never the person's own config.+const trust = vi.hoisted(() => ({+ claudeTrusts: vi.fn((_path: string) => false), codexTrusts: vi.fn((_path: string, _profile?: string | null) => false),+ preTrustClaudeProject: vi.fn((_path: string): unknown => undefined), preTrustCodexProject: vi.fn((_path: string, _profile?: string | null): unknown => undefined),+}))+const { preTrustClaudeProject, preTrustCodexProject } = trust+vi.mock('../../engines/launchPrep.js', () => ({ folderTrust: (engine: string, profile?: string | null) => engine === 'claude'+ ? { trusts: (path: string) => trust.claudeTrusts(path), record: (path: string) => trust.preTrustClaudeProject(path) }+ : engine === 'codex' ? { trusts: (path: string) => trust.codexTrusts(path, profile), record: (path: string) => trust.preTrustCodexProject(path, profile) } : null }))vi.mock('../../lib/createAgentPane.js', () => ({ createAndRegisterPane: vi.fn() }))vi.mock('../../lib/engineBin.js', async (real) => ({ ...await real<object>(), enginePathOverride: vi.fn(() => null) }))vi.mock('../../lib/engineInstall.js', async (real) => ({ ...await real<object>(), engineInstallRecipe: vi.fn(() => ({ install: 'recipe' })) }))diff --git a/cli/src/core/agents/create.ts b/cli/src/core/agents/create.tsindex 45a7520ff..026194ff9 100644--- a/cli/src/core/agents/create.ts+++ b/cli/src/core/agents/create.ts@@ -20,7 +20,6 @@ import { harnessLaunchOrRefusal, incompatibleHarnessEngine, prepareHarnessLaunchimport { opencodeMajorVersion } from '../../engines/opencode/version.js'import { isTerminalEngine } from '../../engines/types.js'import { engineLabel } from '../../lib/agentNames.js'-import { preTrustClaudeProject, preTrustCodexProject } from '../../lib/claudeTrust.js'import { createAndRegisterPane } from '../../lib/createAgentPane.js'import { enginePathOverride } from '../../lib/engineBin.js'import { engineInstallRecipe } from '../../lib/engineInstall.js'@@ -34,6 +33,7 @@ import { buildGridEngineLaunch, describeGridLaunch, gridConflictingEnvToClear, timport { DEFAULT_HARNESS_PERMISSION, freshHarnessEnvironment } from '../../lib/harnessDefaults.js'import { buildHarnessSessionLabel } from '../../lib/harnessSessionLabel.js'import { engineHooks } from '../../engines/hooks.js'+import { folderTrust } from '../../engines/launchPrep.js'import { installOpencodePlugin } from '../../lib/hooks.js'import { sid } from '../../lib/log.js'import type { registry, RegisteredSession } from '../../lib/registry.js'@@ -174,12 +174,11 @@ export function createAgentCreator({console.log(`[dsh] ${dsh} materialized ${cwd} · created ${materialized.created.length} · kept ${materialized.kept.length}`)// The template just went into an EMPTY folder: everything in it is the harness's, and Claude Code// need not ask. Laid into a folder that already held something — a clone, the person's own repo —- // it proves nothing about the rest, so trust stays the person's call (lib/claudeTrust.ts).+ // it proves nothing about the rest, so trust stays the person's call (engines/kit/folderTrust.ts).if (emptyBefore && materialized.created.some((item) => item.startsWith('template'))) {try {- if (engine === 'claude') preTrustClaudeProject(cwd)- // In the agent's own profile when it has one: that config.toml is the one it reads.- if (engine === 'codex') preTrustCodexProject(cwd, codexHome)+ // In the agent's own profile when it has one: that config.toml is the one a Codex agent reads.+ folderTrust(engine, codexHome)?.record(cwd)} catch (error) { console.warn(`[dsh] pre-trust ${cwd} · ${error instanceof Error ? error.message : error}`) }}} catch (error) {diff --git a/cli/src/core/agents/launch.spec.ts b/cli/src/core/agents/launch.spec.tsindex f373e0b19..67966556c 100644--- a/cli/src/core/agents/launch.spec.ts+++ b/cli/src/core/agents/launch.spec.ts@@ -1,5 +1,5 @@import { afterEach, describe, expect, it, vi } from 'vitest'-import { prepareCodexResume } from '../../engines/codex/portableHistory.js'+import { prepareResume } from '../../engines/launchPrep.js'import { ApiConnectionError, type ApiConnections } from '../../lib/apiConnections.js'import { refreshApiLaunch } from '../../lib/apiModels.js'import { dropPermissionFlagIfUnsupported } from '../../lib/engineLaunch.js'@@ -7,7 +7,7 @@ import { buildLaunchOverrides, type LaunchOverrides, type LaunchOverridesDeps }import type { RegisteredSession } from '../../lib/registry.js'import { createLaunchHelpers, type LaunchHelperDeps } from './launch.js'-vi.mock('../../engines/codex/portableHistory.js', () => ({ prepareCodexResume: vi.fn(() => ({ repairedItems: 0 })) }))+vi.mock('../../engines/launchPrep.js', async (real) => ({ ...await real<object>(), prepareResume: vi.fn(() => ({ repairedItems: 0 })) }))vi.mock('../../lib/apiModels.js', async (real) => ({ ...await real<object>(), refreshApiLaunch: vi.fn((_apis: unknown, launch: object) => ({ ...launch, refreshed: true })) }))vi.mock('../../lib/engineLaunch.js', async (real) => ({ ...await real<object>(), dropPermissionFlagIfUnsupported: vi.fn() }))vi.mock('../../lib/launchOverrides.js', async (real) => ({ ...await real<object>(), buildLaunchOverrides: vi.fn(async () => ({ ok: true })) }))@@ -83,13 +83,15 @@ describe('relaunch helpers', () => {it('repairs a Codex rollout for resume and moves the tail to its new length', () => {const log = vi.spyOn(console, 'log').mockImplementation(() => {})const { deps, helpers } = setup()- helpers.prepareSessionResume(session())+ // Only Codex declares a repair, and the log line names what it repaired in its words.+ const codex = session({ engine: 'codex' })+ helpers.prepareSessionResume(codex)expect(deps.setTail).not.toHaveBeenCalled()- vi.mocked(prepareCodexResume).mockReturnValueOnce({ repairedItems: 3, repairedBytes: 1_234, backupPath: '/b/rollout.bak' } as never)- helpers.prepareSessionResume(session())+ vi.mocked(prepareResume).mockReturnValueOnce({ repairedItems: 3, repairedBytes: 1_234, backupPath: '/b/rollout.bak' } as never)+ helpers.prepareSessionResume(codex)expect(deps.setTail).toHaveBeenCalledWith('s1', 1_234)- vi.mocked(prepareCodexResume).mockReturnValueOnce({ repairedItems: 1, backupPath: '/b/rollout.bak' } as never)- helpers.prepareSessionResume(session())+ vi.mocked(prepareResume).mockReturnValueOnce({ repairedItems: 1, backupPath: '/b/rollout.bak' } as never)+ helpers.prepareSessionResume(codex)expect(deps.setTail).toHaveBeenCalledTimes(1)expect(log.mock.calls.map(([line]) => String(line))).toEqual(['[resume] repaired 3 Codex reasoning items · backup: /b/rollout.bak',diff --git a/cli/src/core/agents/launch.ts b/cli/src/core/agents/launch.tsindex fe8ea692f..71f8d750d 100644--- a/cli/src/core/agents/launch.ts+++ b/cli/src/core/agents/launch.ts@@ -1,12 +1,12 @@/*** Relaunch helpers: what a restart, a retarget, a restore or a resume needs to bring an agent's pane* back. Its launch overrides, rebuilt from the row (an API's key as saved now); the web-search decision- * refreshed; a permission flag the engine no longer takes dropped, rather than the pane; and a Codex- * rollout repaired for resume, with the tail moved to its new length.+ * refreshed; a permission flag the engine no longer takes dropped, rather than the pane; and the history made+ * resumable (Codex's rollout, engines/launchPrep.ts), with the tail moved to its new length.** Moved verbatim out of `runForeground` (the core boundary, step 10: docs/design/2026-10-03-harnessd.md).*/-import { prepareCodexResume } from '../../engines/codex/portableHistory.js'+import { prepareResume, repairedItemsName } from '../../engines/launchPrep.js'import { ApiConnectionError, type ApiConnections } from '../../lib/apiConnections.js'import { refreshApiLaunch } from '../../lib/apiModels.js'import { dropPermissionFlagIfUnsupported } from '../../lib/engineLaunch.js'@@ -93,13 +93,13 @@ export function createLaunchHelpers({ prepareApiTools, savedApis, launchOverride}const prepareSessionResume = (session: RegisteredSession): void => {- const repair = prepareCodexResume(session)+ const repair = prepareResume(session)if (repair.repairedItems) {// The rollout we tail was just shrunk in place. Move the tail to the repaired length now, before// the resumed engine appends, or the watcher would read the whole repaired history as new lines// and the live normalizer would replay the conversation into web/device. See Watcher.setTail.if (repair.repairedBytes !== undefined) setTail(session.sessionId, repair.repairedBytes)- console.log(`[resume] repaired ${repair.repairedItems} Codex reasoning items · backup: ${repair.backupPath}`)+ console.log(`[resume] repaired ${repair.repairedItems} ${repairedItemsName(session.engine)} · backup: ${repair.backupPath}`)}}return { relaunchOverrides, refreshGridWebSearch, downgradedPermission, prepareSessionResume }diff --git a/cli/src/core/agents/launches.spec.ts b/cli/src/core/agents/launches.spec.tsindex d614779e4..89f97f98f 100644--- a/cli/src/core/agents/launches.spec.ts+++ b/cli/src/core/agents/launches.spec.ts@@ -7,7 +7,6 @@ import { dshSupportedEngines } from '../../dsh/manifest.js'import { opencodeMajorVersion } from '../../engines/opencode/version.js'import { AgentCreationReceiptError, AgentCreationReceipts, type AgentCreationOutcome } from '../../lib/agentCreationReceipt.js'import type { AgentFrame } from '../../lib/agentFrame.js'-import { claudeTrusts, codexTrusts, preTrustClaudeProject, preTrustCodexProject } from '../../lib/claudeTrust.js'import { MAX_FIRST_PROMPT_CHARS, permissionModeApproves, permissionModeFlags, supportsFirstPrompt, supportsNamedAgent } from '../../lib/engineLaunch.js'import { parseGridLaunchOverride } from '../../lib/gridLaunch.js'import { parseNewAgentModel } from '../../lib/newAgentModel.js'@@ -22,10 +21,15 @@ import { createLaunchRequests, type CreateAgent, type ForkAgent, type LaunchRequ* they are tested with their own modules, and a test must never write the person's own engine config.*/const root = vi.hoisted(() => ({ projects: '' }))-vi.mock('../../lib/claudeTrust.js', async (real) => ({- ...await real<object>(),- claudeTrusts: vi.fn(() => false), codexTrusts: vi.fn(() => false), preTrustClaudeProject: vi.fn(), preTrustCodexProject: vi.fn(),+// The engines' folder trust (engines/launchPrep.ts), one spy per engine.+const trust = vi.hoisted(() => ({+ claudeTrusts: vi.fn((_path: string) => false), codexTrusts: vi.fn((_path: string, _profile?: string | null) => false),+ preTrustClaudeProject: vi.fn((_path: string): unknown => undefined), preTrustCodexProject: vi.fn((_path: string, _profile?: string | null): unknown => undefined),}))+const { claudeTrusts, codexTrusts, preTrustClaudeProject, preTrustCodexProject } = trust+vi.mock('../../engines/launchPrep.js', () => ({ folderTrust: (engine: string, profile?: string | null) => engine === 'claude'+ ? { trusts: (path: string) => trust.claudeTrusts(path), record: (path: string) => trust.preTrustClaudeProject(path) }+ : engine === 'codex' ? { trusts: (path: string) => trust.codexTrusts(path, profile), record: (path: string) => trust.preTrustCodexProject(path, profile) } : null }))vi.mock('../../engines/opencode/version.js', async (real) => ({ ...await real<object>(), opencodeMajorVersion: vi.fn(() => 1) }))vi.mock('../../lib/newAgentModel.js', async (real) => ({...await real<object>(), parseNewAgentModel: vi.fn(() => ({ state: 'absent' })),diff --git a/cli/src/core/agents/launches.ts b/cli/src/core/agents/launches.tsindex 35faa6a26..86aa50402 100644--- a/cli/src/core/agents/launches.ts+++ b/cli/src/core/agents/launches.ts@@ -14,12 +14,12 @@ import { dirname, isAbsolute } from 'node:path'import type { BackendSocket } from '../../backendSocket.js'import { installedDsh } from '../../dsh/installed.js'import { DSH_ID_RE, dshSupportedEngines } from '../../dsh/manifest.js'+import { folderTrust } from '../../engines/launchPrep.js'import { opencodeMajorVersion } from '../../engines/opencode/version.js'import { ENGINES, isTerminalEngine, type AgentEngine } from '../../engines/types.js'import { AgentCreationReceiptError, creationFingerprint, validCreationId, type AgentCreationReceipts, type AgentCreationStatus } from '../../lib/agentCreationReceipt.js'import type { AgentFrame } from '../../lib/agentFrame.js'import { engineLabel } from '../../lib/agentNames.js'-import { claudeTrusts, codexTrusts, preTrustClaudeProject, preTrustCodexProject } from '../../lib/claudeTrust.js'import {AGENT_NAME_RE, FirstPromptUnsupportedError, MAX_FIRST_PROMPT_CHARS, NamedAgentUnsupportedError, permissionModeApproves,permissionModeFlags, supportsFirstPrompt, supportsNamedAgent,@@ -261,12 +261,11 @@ export function createLaunchRequests({ receipts, createAgent, forkAgent, resumeAdetail: error instanceof ProjectFolderError ? error.message : 'Could not prepare the project folder.' }}// Only a folder this daemon just made EMPTY is one the engine need not ask about. A clone or- // the person's own repo is theirs to answer for (lib/claudeTrust.ts); a worktree gets only+ // the person's own repo is theirs to answer for (engines/kit/folderTrust.ts); a worktree gets only// the answer its source repo already has. `branch` IS the source folder: nothing to record.try {// A Codex agent on its own profile reads its trust from that profile's config.toml, not ~/.codex.- const engineTrust = input.engine === 'claude' ? { trusts: (path: string) => claudeTrusts(path), record: (path: string) => preTrustClaudeProject(path) }- : input.engine === 'codex' ? { trusts: (path: string) => codexTrusts(path, input.codexHome), record: (path: string) => preTrustCodexProject(path, input.codexHome) } : null+ const engineTrust = folderTrust(input.engine, input.codexHome)if (engineTrust && (projectFolder.source === 'new'|| (projectFolder.source === 'worktree' && engineTrust.trusts(projectFolder.gitSource)))) {engineTrust.record(preparedFolder)@@ -278,21 +277,18 @@ export function createLaunchRequests({ receipts, createAgent, forkAgent, resumeA// `new` project is — but only on evidence, and only where those workspaces live://// · directly inside the projects root, which is the one folder the app and this daemon- // create workspaces in. Trust INHERITS downward (claudeTrusts), so recording it for a+ // create workspaces in. Claude Code's trust INHERITS downward, so recording it for a// folder the person merely browsed to — an empty `~/code`, or a home with nothing in it —// would silently cover every repo cloned under it later: OH-14 again by another door.// · empty as read from disk, never on the client's word. A clone, a worktree or the- // person's own repo has content, so it stays the engine's question (lib/claudeTrust.ts).+ // person's own repo has content, so it stays the engine's question (engines/kit/folderTrust.ts).// · from a LOCAL frame. agent_create is not backend-only, so a relayed peer would otherwise// name an empty path on this host and have it trusted.//// DSH trust is decided in cli.ts, where the template count is known; leave that to it.try {const empty = await readdir(input.cwd).then((names) => names.length === 0, () => false)- if (empty) {- if (input.engine === 'claude') preTrustClaudeProject(input.cwd)- if (input.engine === 'codex') preTrustCodexProject(input.cwd, input.codexHome)- }+ if (empty) folderTrust(input.engine, input.codexHome)?.record(input.cwd)} catch (error) { console.warn(`[agent] pre-trust ${input.cwd} · ${error instanceof Error ? error.message : error}`) }}const result = await create(preparedFolder ? { ...input, cwd: preparedFolder, scmLaunchRecord } : input)diff --git a/cli/src/dsh/runtime.ts b/cli/src/dsh/runtime.tsindex a596af628..3381c838e 100644--- a/cli/src/dsh/runtime.ts+++ b/cli/src/dsh/runtime.ts@@ -7,6 +7,7 @@ import { existsSync, lstatSync, mkdirSync, readFileSync, readlinkSync, realpathSimport { basename, join, resolve } from 'node:path'import { z } from 'zod'import { PROCESS_ENGINES, type AgentEngine } from '../engines/types.js'+import { instructionFileOf, launchContract } from '../engines/launches.js'import { HARNESS_BOOTSTRAP, harnessAdapter } from './adapters.js'import { installedDsh, type InstalledDsh } from './installed.js'import { dshAccountEnv, dshLaunch, type DshAccount, type DshLaunch } from './launch.js'@@ -97,13 +98,15 @@ export function migrateHarnessInstructions(workspace: string, current: Installedfunction installBootstrap(workspace: string, engine: AgentEngine): void {const adapter = harnessAdapter(engine)const file = adapter.instructionFiles.find(name => existsSync(join(workspace, name)))- ?? (engine === 'claude' ? 'CLAUDE.md' : 'AGENTS.md')+ ?? instructionFileOf(engine) ?? 'AGENTS.md'const path = join(workspace, file)const before = existsSync(path) ? readFileSync(path, 'utf8') : ''if (before.includes(HARNESS_BOOTSTRAP)) returnif (before.includes('<!-- harness:runtime')) throw new Error(`The Harness bootstrap in ${path} was edited; restore it before launching.`)- const projectRules = engine === 'claude' && existsSync(join(workspace, 'AGENTS.md')) && !before.split('\n').some(line => line.trim() === '@AGENTS.md')- ? '@AGENTS.md\n' : ''+ // An engine that reads the project's AGENTS.md only through an import line in its own file gets that line.+ const imports = launchContract(engine)?.instructionImport+ const projectRules = imports && existsSync(join(workspace, imports.file)) && !before.split('\n').some(line => line.trim() === imports.line)+ ? `${imports.line}\n` : ''// Preserve all project bytes. Only the generic, env-dispatched bootstrap is shared by sessions.writeManagedFile(path, `${before}${before.endsWith('\n') || !before ? '' : '\n'}\n${projectRules}${HARNESS_BOOTSTRAP}`)}diff --git a/cli/src/engines/README.md b/cli/src/engines/README.mdindex 9b12914c6..4e4cc33c7 100644--- a/cli/src/engines/README.md+++ b/cli/src/engines/README.md@@ -20,8 +20,9 @@ selects those engines; `launches.ts` and `hooks.ts` expose their respective facereaders. Hook transport, process binding and event delivery stay with core. Their hooks are declared data(`claude/hookContract.ts`, `codex/hookContract.ts`) that core applies in line with `kit/` mechanics, never in aworker ([hooks](../../../docs/design/2026-10-08-engine-hooks.md)). So are their launch specifics (`claude/launch.ts`,-`codex/launch.ts`): Codex's pane startup probe and retry, its own-login provider, and the harness context and env-flags, applied by `kit/launchStartup.ts` and `kit/launchArgs.ts` ([launch](../../../docs/design/2026-10-08-engine-launch.md)). Claude Code and Codex history/last-turn reads,+`codex/launch.ts`): Codex's pane startup probe and retry, its own-login provider, the harness context and env+flags, folder trust and the resume repair, applied by `kit/launchStartup.ts`, `kit/launchArgs.ts`,+`kit/folderTrust.ts` and `kit/resumeRepair.ts` ([launch](../../../docs/design/2026-10-08-engine-launch.md)). Claude Code and Codex history/last-turn reads,live transcript parsing, runtime profiles/catalogs, screen interpretation, submission readings, model-control drivers, question navigation and Codex's app-server connection run on demand in supervised workers;the other facets still run in core. Explicit inline mode and older masters retain inline implementations. See[hooks](../../../docs/design/2026-10-08-engine-hooks.md),diff --git a/cli/src/engines/__fixtures__/launch-prep.golden.json b/cli/src/engines/__fixtures__/launch-prep.golden.jsonnew file mode 100644index 000000000..b17a60b1c--- /dev/null+++ b/cli/src/engines/__fixtures__/launch-prep.golden.json@@ -0,0 +1,306 @@+{+"trust": {+ "claude · moved · no file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"}}},+ "claude · default · no file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"}}},+ "claude · moved · no home folder": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"}}},+ "claude · default · no home folder": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"}}},+ "claude · moved · empty file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":""}}},+ "claude · default · empty file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":""}}},+ "claude · moved · whitespace only": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":" \n"}}},+ "claude · default · whitespace only": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":" \n"}}},+ "claude · moved · malformed JSON": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":"{not-json"}}},+ "claude · default · malformed JSON": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":"{not-json"}}},+ "claude · moved · byte order mark": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":"{}"}}},+ "claude · default · byte order mark": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":"{}"}}},+ "claude · moved · JSON null": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":"null"}}},+ "claude · default · JSON null": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":"null"}}},+ "claude · moved · JSON []": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":"[]"}}},+ "claude · default · JSON []": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":"[]"}}},+ "claude · moved · JSON \"text\"": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":"\"text\""}}},+ "claude · default · JSON \"text\"": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":"\"text\""}}},+ "claude · moved · JSON 42": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":"42"}}},+ "claude · default · JSON 42": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":"42"}}},+ "claude · moved · an empty object": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · default · an empty object": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · moved · projects is []": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":"{\"projects\":[],\"keep\":1}"}}},+ "claude · default · projects is []": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":"{\"projects\":[],\"keep\":1}"}}},+ "claude · moved · projects is \"x\"": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":"{\"projects\":\"x\",\"keep\":1}"}}},+ "claude · default · projects is \"x\"": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":"{\"projects\":\"x\",\"keep\":1}"}}},+ "claude · moved · projects is null": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":"{\"projects\":null,\"keep\":1}"}}},+ "claude · default · projects is null": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":"{\"projects\":null,\"keep\":1}"}}},+ "claude · moved · projects is 7": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":"{\"projects\":7,\"keep\":1}"}}},+ "claude · default · projects is 7": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":"{\"projects\":7,\"keep\":1}"}}},+ "claude · moved · projects empty": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · default · projects empty": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · moved · the entry is \"x\"": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":"{\"projects\":{\"/work/new project\":\"x\"}}"}}},+ "claude · default · the entry is \"x\"": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":"{\"projects\":{\"/work/new project\":\"x\"}}"}}},+ "claude · moved · the entry is []": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":"{\"projects\":{\"/work/new project\":[]}}"}}},+ "claude · default · the entry is []": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":"{\"projects\":{\"/work/new project\":[]}}"}}},+ "claude · moved · the entry is null": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":"{\"projects\":{\"/work/new project\":null}}"}}},+ "claude · default · the entry is null": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":"{\"projects\":{\"/work/new project\":null}}"}}},+ "claude · moved · the entry is true": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":"{\"projects\":{\"/work/new project\":true}}"}}},+ "claude · default · the entry is true": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":"{\"projects\":{\"/work/new project\":true}}"}}},+ "claude · moved · the entry is empty": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · default · the entry is empty": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · moved · the entry says no": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [\n \"Bash\"\n ],\n \"hasTrustDialogAccepted\": true,\n \"mcpServers\": {\n \"a\": 1\n }\n }\n }\n}"}}},+ "claude · default · the entry says no": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [\n \"Bash\"\n ],\n \"hasTrustDialogAccepted\": true,\n \"mcpServers\": {\n \"a\": 1\n }\n }\n }\n}"}}},+ "claude · moved · the entry says yes": {"before":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"644","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · default · the entry says yes": {"before":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"644","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · moved · the entry says \"true\"": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · default · the entry says \"true\"": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · moved · a parent says yes": {"before":[{"value":true},{"value":true},{"value":true},{"value":true},{"value":true}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":true},{"value":true},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work\": {\n \"hasTrustDialogAccepted\": true\n },\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · default · a parent says yes": {"before":[{"value":true},{"value":true},{"value":true},{"value":true},{"value":true}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":true},{"value":true},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work\": {\n \"hasTrustDialogAccepted\": true\n },\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · moved · a parent with a trailing slash says yes": {"before":[{"value":true},{"value":true},{"value":true},{"value":true},{"value":true}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":true},{"value":true},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work//\": {\n \"hasTrustDialogAccepted\": true\n },\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · default · a parent with a trailing slash says yes": {"before":[{"value":true},{"value":true},{"value":true},{"value":true},{"value":true}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":true},{"value":true},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work//\": {\n \"hasTrustDialogAccepted\": true\n },\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · moved · a longer sibling says yes": {"before":[{"value":false},{"value":false},{"value":false},{"value":true},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":true},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new proj\": {\n \"hasTrustDialogAccepted\": true\n },\n \"/work/new projectx\": {\n \"hasTrustDialogAccepted\": true\n },\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · default · a longer sibling says yes": {"before":[{"value":false},{"value":false},{"value":false},{"value":true},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":true},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new proj\": {\n \"hasTrustDialogAccepted\": true\n },\n \"/work/new projectx\": {\n \"hasTrustDialogAccepted\": true\n },\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · moved · a parent says no": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work\": {\n \"hasTrustDialogAccepted\": false\n },\n \"/\": \"odd\",\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · default · a parent says no": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work\": {\n \"hasTrustDialogAccepted\": false\n },\n \"/\": \"odd\",\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · moved · other settings": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"600","text":"{\n \"numStartups\": 12,\n \"theme\": \"dark\",\n \"note\": \"café ✓ 🎉\",\n \"nested\": {\n \"list\": [\n 1,\n 2.5,\n null\n ]\n },\n \"projects\": {\n \"/other\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n },\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · default · other settings": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"600","text":"{\n \"numStartups\": 12,\n \"theme\": \"dark\",\n \"note\": \"café ✓ 🎉\",\n \"nested\": {\n \"list\": [\n 1,\n 2.5,\n null\n ]\n },\n \"projects\": {\n \"/other\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n },\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · moved · minified": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"600","text":"{\n \"a\": 1,\n \"projects\": {\n \"/other\": {},\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · default · minified": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"600","text":"{\n \"a\": 1,\n \"projects\": {\n \"/other\": {},\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · moved · duplicate keys": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"x\": 1,\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · default · duplicate keys": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"x\": 1,\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · moved · unicode target": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/café ✓ \\\"q\\\"\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · default · unicode target": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/café ✓ \\\"q\\\"\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · moved · a symlink to dotfiles": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"elsewhere/claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"link":"<root>/case-8dac9fe1df/elsewhere/claude.json"}}},+ "claude · default · a symlink to dotfiles": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"elsewhere/claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"link":"<root>/case-c239d1c781/elsewhere/claude.json"}}},+ "claude · moved · a dangling symlink": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"link":"<root>/case-89d711b232/elsewhere/missing.json"}}},+ "claude · default · a dangling symlink": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"link":"<root>/case-8c75a9383f/elsewhere/missing.json"}}},+ "claude · moved · a private file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · default · a private file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · moved · a read-only file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · moved · an unreadable file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"200","unreadable":"EACCES"}}},+ "claude · moved · a read-only folder": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"threw":"EACCES: permission denied, open '<root>/case-016cb5e009/home/.claude.json.harness-<pid>.tmp'"},"second":{"threw":"EACCES: permission denied, open '<root>/case-016cb5e009/home/.claude.json.harness-<pid>.tmp'"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"555"},"home/.claude.json":{"mode":"644","text":"{}"}}},+ "claude · moved · the file is a folder": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"dir":true,"mode":"755"}}},+ "claude · default · the file is a folder": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"dir":true,"mode":"755"}}},+ "claude · moved · a leftover temporary file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"},"home/.claude.json.harness-1.tmp":{"mode":"644","text":"old"}}},+ "claude · default · a leftover temporary file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":true},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"<home>/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"},"<home>/.claude.json.harness-1.tmp":{"mode":"644","text":"old"}}},+ "codex · profile · no file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"}}},+ "codex · moved · no file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"}}},+ "codex · default · no file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"}}},+ "codex · profile · no home folder": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"}}},+ "codex · moved · no home folder": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"}}},+ "codex · default · no home folder": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"}}},+ "codex · profile · empty file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · moved · empty file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · default · empty file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · profile · settings, no newline at the end": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"gpt-5\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · moved · settings, no newline at the end": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"gpt-5\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · default · settings, no newline at the end": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"gpt-5\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · profile · trailing blank lines and spaces": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"gpt-5\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · moved · trailing blank lines and spaces": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"gpt-5\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · default · trailing blank lines and spaces": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"gpt-5\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · profile · CRLF": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"gpt-5\"\r\n[profiles.work]\r\nmodel = \"o3\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · moved · CRLF": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"gpt-5\"\r\n[profiles.work]\r\nmodel = \"o3\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · default · CRLF": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"gpt-5\"\r\n[profiles.work]\r\nmodel = \"o3\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · profile · trusted already": {"before":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · moved · trusted already": {"before":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · default · trusted already": {"before":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · profile · listed, untrusted": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.\"/work/new project\"]\ntrust_level = \"untrusted\"\n"}}},+ "codex · moved · listed, untrusted": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.\"/work/new project\"]\ntrust_level = \"untrusted\"\n"}}},+ "codex · default · listed, untrusted": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.\"/work/new project\"]\ntrust_level = \"untrusted\"\n"}}},+ "codex · profile · single-quoted key": {"before":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.'/work/new project']\ntrust_level = 'trusted'\n"}}},+ "codex · moved · single-quoted key": {"before":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.'/work/new project']\ntrust_level = 'trusted'\n"}}},+ "codex · default · single-quoted key": {"before":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.'/work/new project']\ntrust_level = 'trusted'\n"}}},+ "codex · profile · spaced header": {"before":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":" [ projects . \"/work/new project\" ] \n trust_level = \"trusted\"\n"}}},+ "codex · moved · spaced header": {"before":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":" [ projects . \"/work/new project\" ] \n trust_level = \"trusted\"\n"}}},+ "codex · default · spaced header": {"before":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":" [ projects . \"/work/new project\" ] \n trust_level = \"trusted\"\n"}}},+ "codex · profile · escaped key": {"before":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.\"/work/new\\u0020project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · moved · escaped key": {"before":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.\"/work/new\\u0020project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · default · escaped key": {"before":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.\"/work/new\\u0020project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · profile · a key JSON cannot read": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.\"/work/\\U0001F600\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · moved · a key JSON cannot read": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.\"/work/\\U0001F600\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · default · a key JSON cannot read": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.\"/work/\\U0001F600\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · profile · an inline table": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"projects = { \"/other\" = { trust_level = \"trusted\" } }\n"}}},+ "codex · moved · an inline table": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"projects = { \"/other\" = { trust_level = \"trusted\" } }\n"}}},+ "codex · default · an inline table": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"projects = { \"/other\" = { trust_level = \"trusted\" } }\n"}}},+ "codex · profile · dotted keys": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"projects.\"/other\".trust_level = \"trusted\"\n"}}},+ "codex · moved · dotted keys": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"projects.\"/other\".trust_level = \"trusted\"\n"}}},+ "codex · default · dotted keys": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"projects.\"/other\".trust_level = \"trusted\"\n"}}},+ "codex · profile · a bare projects table": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects]\n\"/other\" = 1\n"}}},+ "codex · moved · a bare projects table": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects]\n\"/other\" = 1\n"}}},+ "codex · default · a bare projects table": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects]\n\"/other\" = 1\n"}}},+ "codex · profile · other projects": {"before":[{"value":false},{"value":false},{"value":true},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":true},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"x\"\n\n[projects.\"/other\"]\ntrust_level = \"trusted\"\n\n[projects.\"/work\"]\ntrust_level = \"trusted\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · moved · other projects": {"before":[{"value":false},{"value":false},{"value":true},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":true},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"x\"\n\n[projects.\"/other\"]\ntrust_level = \"trusted\"\n\n[projects.\"/work\"]\ntrust_level = \"trusted\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · default · other projects": {"before":[{"value":false},{"value":false},{"value":true},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":true},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"x\"\n\n[projects.\"/other\"]\ntrust_level = \"trusted\"\n\n[projects.\"/work\"]\ntrust_level = \"trusted\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · profile · trust in a sub-table": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"[projects.\"/work/new project\".sub]\ntrust_level = \"trusted\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · moved · trust in a sub-table": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"[projects.\"/work/new project\".sub]\ntrust_level = \"trusted\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · default · trust in a sub-table": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"[projects.\"/work/new project\".sub]\ntrust_level = \"trusted\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · profile · trust only in the next table": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.\"/work/new project\"]\nnote = \"x\"\n[other]\ntrust_level = \"trusted\"\n"}}},+ "codex · moved · trust only in the next table": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.\"/work/new project\"]\nnote = \"x\"\n[other]\ntrust_level = \"trusted\"\n"}}},+ "codex · default · trust only in the next table": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"already"},"second":{"value":"already"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"644","text":"[projects.\"/work/new project\"]\nnote = \"x\"\n[other]\ntrust_level = \"trusted\"\n"}}},+ "codex · profile · a commented header": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"# [projects.\"/work/new project\"]\n# trust_level = \"trusted\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · moved · a commented header": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"# [projects.\"/work/new project\"]\n# trust_level = \"trusted\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · default · a commented header": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"# [projects.\"/work/new project\"]\n# trust_level = \"trusted\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · profile · unicode, a quote, a backslash and DEL": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"x\"\n\n[projects.\"/work/q\\\"uote\\\\back\\u007fdel é\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · moved · unicode, a quote, a backslash and DEL": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"x\"\n\n[projects.\"/work/q\\\"uote\\\\back\\u007fdel é\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · default · unicode, a quote, a backslash and DEL": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false},{"value":true}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"x\"\n\n[projects.\"/work/q\\\"uote\\\\back\\u007fdel é\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · profile · a symlink to dotfiles": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"elsewhere/config.toml":{"mode":"600","text":"model = \"x\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"link":"<root>/case-6e67deef7f/elsewhere/config.toml"}}},+ "codex · moved · a symlink to dotfiles": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"elsewhere/config.toml":{"mode":"600","text":"model = \"x\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"link":"<root>/case-09eed45487/elsewhere/config.toml"}}},+ "codex · default · a symlink to dotfiles": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"elsewhere/config.toml":{"mode":"600","text":"model = \"x\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"link":"<root>/case-d0080d106b/elsewhere/config.toml"}}},+ "codex · profile · a dangling symlink": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"link":"<root>/case-cadbb8cd7c/elsewhere/missing.toml"}}},+ "codex · moved · a dangling symlink": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"link":"<root>/case-4183324c55/elsewhere/missing.toml"}}},+ "codex · default · a dangling symlink": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"skipped"},"second":{"value":"skipped"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"link":"<root>/case-f86d0b612c/elsewhere/missing.toml"}}},+ "codex · profile · a private file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"x\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · moved · a private file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"x\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · default · a private file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"x\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · profile · a read-only file": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"value":"trusted"},"second":{"value":"already"},"after":[{"value":true},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"600","text":"model = \"x\"\n\n[projects.\"/work/new project\"]\ntrust_level = \"trusted\"\n"}}},+ "codex · profile · an unreadable file": {"before":[{"threw":"EACCES: permission denied, open '<root>/case-c04150bed4/home/config.toml'"},{"threw":"EACCES: permission denied, open '<root>/case-c04150bed4/home/config.toml'"},{"threw":"EACCES: permission denied, open '<root>/case-c04150bed4/home/config.toml'"},{"threw":"EACCES: permission denied, open '<root>/case-c04150bed4/home/config.toml'"},{"threw":"EACCES: permission denied, open '<root>/case-c04150bed4/home/config.toml'"}],"first":{"threw":"EACCES: permission denied, open '<root>/case-c04150bed4/home/config.toml'"},"second":{"threw":"EACCES: permission denied, open '<root>/case-c04150bed4/home/config.toml'"},"after":[{"threw":"EACCES: permission denied, open '<root>/case-c04150bed4/home/config.toml'"},{"threw":"EACCES: permission denied, open '<root>/case-c04150bed4/home/config.toml'"},{"threw":"EACCES: permission denied, open '<root>/case-c04150bed4/home/config.toml'"},{"threw":"EACCES: permission denied, open '<root>/case-c04150bed4/home/config.toml'"},{"threw":"EACCES: permission denied, open '<root>/case-c04150bed4/home/config.toml'"}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"mode":"200","unreadable":"EACCES"}}},+ "codex · profile · a read-only folder": {"before":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"first":{"threw":"EACCES: permission denied, open '<root>/case-5537a375ce/home/config.toml.harness-<pid>.tmp'"},"second":{"threw":"EACCES: permission denied, open '<root>/case-5537a375ce/home/config.toml.harness-<pid>.tmp'"},"after":[{"value":false},{"value":false},{"value":false},{"value":false},{"value":false}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"555"},"home/config.toml":{"mode":"644","text":"model = \"x\"\n"}}},+ "codex · profile · the file is a folder": {"before":[{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"}],"first":{"threw":"EISDIR: illegal operation on a directory, read"},"second":{"threw":"EISDIR: illegal operation on a directory, read"},"after":[{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"dir":true,"mode":"755"}}},+ "codex · moved · the file is a folder": {"before":[{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"}],"first":{"threw":"EISDIR: illegal operation on a directory, read"},"second":{"threw":"EISDIR: illegal operation on a directory, read"},"after":[{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"dir":true,"mode":"755"}}},+ "codex · default · the file is a folder": {"before":[{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"}],"first":{"threw":"EISDIR: illegal operation on a directory, read"},"second":{"threw":"EISDIR: illegal operation on a directory, read"},"after":[{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"},{"threw":"EISDIR: illegal operation on a directory, read"}],"files":{"elsewhere":{"dir":true,"mode":"755"},"home":{"dir":true,"mode":"755"},"home/config.toml":{"dir":true,"mode":"755"}}},+ "cursor · no folder trust": null,+ "opencode · no folder trust": null,+ "pi · no folder trust": null,+ "hermes · no folder trust": null,+ "commandcode · no folder trust": null,+ "devin · no folder trust": null,+ "muse · no folder trust": null,+ "amp · no folder trust": null,+ "kilo · no folder trust": null,+ "grok · no folder trust": null,+ "agy · no folder trust": null,+ "copilot · no folder trust": null,+ "claude · moved to relative/claude": {"first":{"value":"trusted"},"files":{"<home>/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}},+ "claude · moved to ~/claude": {"first":{"value":"trusted"},"files":{"<home>/.claude.json":{"mode":"600","text":"{\n \"projects\": {\n \"/work/new project\": {\n \"allowedTools\": [],\n \"hasTrustDialogAccepted\": true\n }\n }\n}"}}}+},+"resume": {+ "profile · another engine": {"result":{"value":{"repairedItems":0}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"}}},+ "profile · no session id": {"result":{"value":{"repairedItems":0}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"}}},+ "profile · a reasoning id": {"result":{"value":{"repairedItems":1,"repairedBytes":512,"backupPath":"<root>/case-8f1c13f53d/profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>"}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"message\",\"id\":\"msg_1\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hello ✓.\"}]}}\n"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"message\",\"id\":\"msg_1\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hello ✓.\"}]}}\n"}}},+ "profile · nothing to repair": {"result":{"value":{"repairedItems":0}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"message\",\"id\":\"msg_1\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hello ✓.\"}]}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"}}},+ "profile · reasoning content becomes the summary": {"result":{"value":{"repairedItems":1,"repairedBytes":325,"backupPath":"<root>/case-6c308ffeee/profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>"}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"one two\"}],\"content\":[]}}\n"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[],\"content\":[{\"text\":\"one \"},{\"type\":\"x\",\"text\":\"two\"},\"odd\",{\"text\":3}]}}\n"}}},+ "profile · content beside a summary": {"result":{"value":{"repairedItems":1,"repairedBytes":332,"backupPath":"<root>/case-6ef6252d08/profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>"}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[{\"text\":\"dup\"}]}}\n"}}},+ "profile · content with no text": {"result":{"value":{"repairedItems":1,"repairedBytes":285,"backupPath":"<root>/case-a05ab63d50/profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>"}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[],\"content\":[]}}\n"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[],\"content\":[{\"type\":\"x\"}]}}\n"}}},+ "profile · encrypted reasoning kept": {"result":{"value":{"repairedItems":0}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[{\"text\":\"v\"}],\"encrypted_content\":\"opaque\"}}\n"}}},+ "profile · compacted history and other records": {"result":{"value":{"repairedItems":1,"repairedBytes":900,"backupPath":"<root>/case-b2ec57dd35/profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>"}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"compacted\",\"payload\":{\"message\":\"sum\",\"replacement_history\":[{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]},{\"type\":\"message\",\"id\":\"msg_1\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hello ✓.\"}]},\"odd\",null]}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"compacted\",\"payload\":{\"message\":\"none\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"event_msg\",\"payload\":{\"type\":\"agent_reasoning\",\"metadata\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"turn_context\",\"payload\":{\"cwd\":\"/w\"}}\n"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"compacted\",\"payload\":{\"message\":\"sum\",\"replacement_history\":[{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]},{\"type\":\"message\",\"id\":\"msg_1\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hello ✓.\"}]},\"odd\",null]}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"compacted\",\"payload\":{\"message\":\"none\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"event_msg\",\"payload\":{\"type\":\"agent_reasoning\",\"metadata\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"turn_context\",\"payload\":{\"cwd\":\"/w\"}}\n"}}},+ "profile · CRLF, blank lines and no newline at the end": {"result":{"value":{"repairedItems":2,"repairedBytes":507,"backupPath":"<root>/case-040540053b/profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>"}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\r\n\r\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\r\n \n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\r\n\r\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\r\n \n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"rs_2\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}"}}},+ "profile · past one read": {"result":{"value":{"repairedItems":1,"repairedBytes":140620,"backupPath":"<root>/case-78d041635f/profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>"}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","size":140620,"sha256":"ca542a5e008d4a3364e3018ec653f6eb1f7e483b622ca9323e70b4853c0674ef"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>":{"mode":"600","size":140671,"sha256":"bae73f55344db943cef2f38095c236282c39e2378f585c0374b2be3339697979"}}},+ "profile · another session's rollout": {"result":{"threw":"Codex rollout does not belong to the session being resumed"},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"}}},+ "profile · no session metadata first": {"result":{"threw":"Codex rollout does not belong to the session being resumed"},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n"}}},+ "profile · session metadata with no payload": {"result":{"threw":"Codex rollout does not belong to the session being resumed"},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":null}\n"}}},+ "profile · invalid JSON": {"result":{"threw":"invalid JSON in Codex rollout at line 3"},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n{\"type\": \"response_item\", \"payload\": {\"text\": \"secret words\"\n"}}},+ "profile · a record that is not an object": {"result":{"threw":"invalid Codex rollout record"},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n[1,2]\n"}}},+ "profile · an empty rollout": {"result":{"threw":"Codex rollout has no session metadata"},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":""}}},+ "profile · blank lines only": {"result":{"threw":"Codex rollout has no session metadata"},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"\n\n"}}},+ "profile · no rollout at all": {"result":{"value":{"repairedItems":0}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"}}},+ "profile · found by id": {"result":{"value":{"repairedItems":1,"repairedBytes":332,"backupPath":"<root>/case-bc6fb69ac0/profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>"}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"}}},+ "profile · a stale path, found by id": {"result":{"value":{"repairedItems":1,"repairedBytes":332,"backupPath":"<root>/case-87b6c6fe62/profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>"}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"}}},+ "profile · a stale path, nothing by id": {"result":{"value":{"repairedItems":0}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"}}},+ "profile · an id too short to look up": {"result":{"value":{"repairedItems":0}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"short\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"}}},+ "profile · outside the profile": {"result":{"threw":"Codex rollout is outside the session profile or is not an owned regular file"},"files":{"elsewhere":{"dir":true,"mode":"755"},"elsewhere/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"644","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"}}},+ "profile · a symlinked rollout": {"result":{"threw":"Codex rollout is outside the session profile or is not an owned regular file"},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"link":"<root>/case-14adff6da7/profile/sessions/real.jsonl"},"profile/sessions/real.jsonl":{"mode":"644","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"}}},+ "profile · a folder where the rollout is": {"result":{"threw":"Codex rollout is outside the session profile or is not an owned regular file"},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"}}},+ "profile · a world-readable rollout": {"result":{"value":{"repairedItems":1,"repairedBytes":332,"backupPath":"<root>/case-eb31e6447c/profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>"}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"}}},+ "profile · a leftover backup and temporary file": {"result":{"value":{"repairedItems":1,"repairedBytes":332,"backupPath":"<root>/case-3d14b698af/profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>"}},"files":{"elsewhere":{"dir":true,"mode":"755"},"profile":{"dir":true,"mode":"755"},"profile/sessions":{"dir":true,"mode":"755"},"profile/sessions/2026":{"dir":true,"mode":"755"},"profile/sessions/2026/10":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08":{"dir":true,"mode":"755"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"},"profile/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-tmp-old":{"mode":"644","text":"x"}}},+ "default · a reasoning id": {"result":{"value":{"repairedItems":1,"repairedBytes":512,"backupPath":"<root>/case-ee741690dd/daemon/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>"}},"files":{"daemon":{"dir":true,"mode":"755"},"daemon/sessions":{"dir":true,"mode":"755"},"daemon/sessions/2026":{"dir":true,"mode":"755"},"daemon/sessions/2026/10":{"dir":true,"mode":"755"},"daemon/sessions/2026/10/08":{"dir":true,"mode":"755"},"daemon/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"message\",\"id\":\"msg_1\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hello ✓.\"}]}}\n"},"daemon/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"message\",\"id\":\"msg_1\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hello ✓.\"}]}}\n"},"elsewhere":{"dir":true,"mode":"755"}}},+ "moved · a reasoning id": {"result":{"value":{"repairedItems":1,"repairedBytes":512,"backupPath":"<root>/case-544339cc61/moved/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>"}},"files":{"elsewhere":{"dir":true,"mode":"755"},"moved":{"dir":true,"mode":"755"},"moved/sessions":{"dir":true,"mode":"755"},"moved/sessions/2026":{"dir":true,"mode":"755"},"moved/sessions/2026/10":{"dir":true,"mode":"755"},"moved/sessions/2026/10/08":{"dir":true,"mode":"755"},"moved/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"message\",\"id\":\"msg_1\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hello ✓.\"}]}}\n"},"moved/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"message\",\"id\":\"msg_1\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hello ✓.\"}]}}\n"}}},+ "default · found by id": {"result":{"value":{"repairedItems":1,"repairedBytes":332,"backupPath":"<root>/case-9845cf2eff/daemon/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>"}},"files":{"daemon":{"dir":true,"mode":"755"},"daemon/sessions":{"dir":true,"mode":"755"},"daemon/sessions/2026":{"dir":true,"mode":"755"},"daemon/sessions/2026/10":{"dir":true,"mode":"755"},"daemon/sessions/2026/10/08":{"dir":true,"mode":"755"},"daemon/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"},"daemon/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"},"elsewhere":{"dir":true,"mode":"755"}}},+ "moved · found by id": {"result":{"value":{"repairedItems":1,"repairedBytes":332,"backupPath":"<root>/case-2f5243b6b3/moved/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>"}},"files":{"elsewhere":{"dir":true,"mode":"755"},"moved":{"dir":true,"mode":"755"},"moved/sessions":{"dir":true,"mode":"755"},"moved/sessions/2026":{"dir":true,"mode":"755"},"moved/sessions/2026/10":{"dir":true,"mode":"755"},"moved/sessions/2026/10/08":{"dir":true,"mode":"755"},"moved/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"},"moved/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl.reasoning-backup-<uuid>":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"id\":\"msg_aY9suLof0GA06VzeKPXLM7rj\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"}}},+ "default · nothing to repair": {"result":{"value":{"repairedItems":0}},"files":{"daemon":{"dir":true,"mode":"755"},"daemon/sessions":{"dir":true,"mode":"755"},"daemon/sessions/2026":{"dir":true,"mode":"755"},"daemon/sessions/2026/10":{"dir":true,"mode":"755"},"daemon/sessions/2026/10/08":{"dir":true,"mode":"755"},"daemon/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"message\",\"id\":\"msg_1\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hello ✓.\"}]}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"},"elsewhere":{"dir":true,"mode":"755"}}},+ "moved · nothing to repair": {"result":{"value":{"repairedItems":0}},"files":{"elsewhere":{"dir":true,"mode":"755"},"moved":{"dir":true,"mode":"755"},"moved/sessions":{"dir":true,"mode":"755"},"moved/sessions/2026":{"dir":true,"mode":"755"},"moved/sessions/2026/10":{"dir":true,"mode":"755"},"moved/sessions/2026/10/08":{"dir":true,"mode":"755"},"moved/sessions/2026/10/08/rollout-2026-10-08T06-43-10-<uuid>.jsonl":{"mode":"600","text":"{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"session_meta\",\"payload\":{\"id\":\"<uuid>\",\"cwd\":\"/workspace\",\"model_provider\":\"openai\"}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"message\",\"id\":\"msg_1\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hello ✓.\"}]}}\n{\"timestamp\":\"2026-10-08T06:43:10.580Z\",\"type\":\"response_item\",\"payload\":{\"type\":\"reasoning\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"Prior summary.\"}],\"content\":[]}}\n"}}},+ "default · no rollout at all": {"result":{"value":{"repairedItems":0}},"files":{"daemon":{"dir":true,"mode":"755"},"daemon/sessions":{"dir":true,"mode":"755"},"elsewhere":{"dir":true,"mode":"755"}}},+ "moved · no rollout at all": {"result":{"value":{"repairedItems":0}},"files":{"elsewhere":{"dir":true,"mode":"755"},"moved":{"dir":true,"mode":"755"},"moved/sessions":{"dir":true,"mode":"755"}}}+},+"instructions": {+ "harness · claude · an empty workspace": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"CLAUDE.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"CLAUDE.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · claude · CLAUDE.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"CLAUDE.md":{"mode":"644","text":"# Claude rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"CLAUDE.md":{"mode":"644","text":"# Claude rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · claude · AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n"},"CLAUDE.md":{"mode":"600","text":"\[email protected]\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n"},"CLAUDE.md":{"mode":"600","text":"\[email protected]\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · claude · CLAUDE.md and AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules\n\[email protected]\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules\n\[email protected]\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · claude · CLAUDE.md importing AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules\n @AGENTS.md \n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules\n @AGENTS.md \n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · claude · AGENTS.override.md and AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules"},"AGENTS.override.md":{"mode":"644","text":"# Override"},"CLAUDE.md":{"mode":"600","text":"\[email protected]\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules"},"AGENTS.override.md":{"mode":"644","text":"# Override"},"CLAUDE.md":{"mode":"600","text":"\[email protected]\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · claude · GEMINI.md and .hermes.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{".hermes.md":{"mode":"644","text":"# Hermes"},"CLAUDE.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"GEMINI.md":{"mode":"644","text":"# Gemini"}},"again":{".hermes.md":{"mode":"644","text":"# Hermes"},"CLAUDE.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"GEMINI.md":{"mode":"644","text":"# Gemini"}}},+ "harness · codex · an empty workspace": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · codex · CLAUDE.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules"}},"again":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules"}}},+ "harness · codex · AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · codex · CLAUDE.md and AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules\n"}}},+ "harness · codex · CLAUDE.md importing AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules\n @AGENTS.md \n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules\n @AGENTS.md \n"}}},+ "harness · codex · AGENTS.override.md and AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules"},"AGENTS.override.md":{"mode":"644","text":"# Override\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules"},"AGENTS.override.md":{"mode":"644","text":"# Override\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · codex · GEMINI.md and .hermes.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{".hermes.md":{"mode":"644","text":"# Hermes"},"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"GEMINI.md":{"mode":"644","text":"# Gemini"}},"again":{".hermes.md":{"mode":"644","text":"# Hermes"},"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"GEMINI.md":{"mode":"644","text":"# Gemini"}}},+ "harness · cursor · an empty workspace": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · cursor · AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · opencode · an empty workspace": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · opencode · CLAUDE.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"CLAUDE.md":{"mode":"644","text":"# Claude rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"CLAUDE.md":{"mode":"644","text":"# Claude rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · opencode · AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · opencode · CLAUDE.md and AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules\n"}}},+ "harness · opencode · CLAUDE.md importing AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules\n @AGENTS.md \n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules\n @AGENTS.md \n"}}},+ "harness · opencode · AGENTS.override.md and AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"AGENTS.override.md":{"mode":"644","text":"# Override"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"AGENTS.override.md":{"mode":"644","text":"# Override"}}},+ "harness · opencode · GEMINI.md and .hermes.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{".hermes.md":{"mode":"644","text":"# Hermes"},"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"GEMINI.md":{"mode":"644","text":"# Gemini"}},"again":{".hermes.md":{"mode":"644","text":"# Hermes"},"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"GEMINI.md":{"mode":"644","text":"# Gemini"}}},+ "harness · pi · an empty workspace": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · pi · AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · hermes · an empty workspace": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · hermes · CLAUDE.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"CLAUDE.md":{"mode":"644","text":"# Claude rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"CLAUDE.md":{"mode":"644","text":"# Claude rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · hermes · AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · hermes · CLAUDE.md and AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules\n"}}},+ "harness · hermes · CLAUDE.md importing AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules\n @AGENTS.md \n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"CLAUDE.md":{"mode":"644","text":"# Claude rules\n @AGENTS.md \n"}}},+ "harness · hermes · AGENTS.override.md and AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"AGENTS.override.md":{"mode":"644","text":"# Override"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"AGENTS.override.md":{"mode":"644","text":"# Override"}}},+ "harness · hermes · GEMINI.md and .hermes.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{".hermes.md":{"mode":"644","text":"# Hermes\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"GEMINI.md":{"mode":"644","text":"# Gemini"}},"again":{".hermes.md":{"mode":"644","text":"# Hermes\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"},"GEMINI.md":{"mode":"644","text":"# Gemini"}}},+ "harness · commandcode · an empty workspace": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · commandcode · AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · devin · an empty workspace": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · devin · AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · muse · an empty workspace": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · muse · AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · amp · an empty workspace": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · amp · AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · kilo · an empty workspace": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · kilo · AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · grok · an empty workspace": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · grok · AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · agy · an empty workspace": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · agy · AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · copilot · an empty workspace": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"600","text":"\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · copilot · AGENTS.md": {"first":{"value":"prepared"},"second":{"value":"prepared"},"after":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}},"again":{"AGENTS.md":{"mode":"644","text":"# Shared rules\n\n<!-- harness:runtime v1 -->\n## Harness session context\n\nIf HARNESS_CONTEXT_FILE is set in your environment, read that file before working:\n\n```sh\nif [ -n \"$HARNESS_CONTEXT_FILE\" ]; then cat \"$HARNESS_CONTEXT_FILE\"; fi\n```\n\nIt contains the instructions and skill index for this session's selected harness.\nIf the variable is absent, this is an ordinary coding session with no selected harness.\n<!-- /harness:runtime -->\n"}}},+ "harness · claude · an edited bootstrap": {"first":{"threw":"The Harness bootstrap in <root>/case-8a6c3d7925/workspace/CLAUDE.md was edited; restore it before launching."},"after":{"CLAUDE.md":{"mode":"644","text":"# Rules\n<!-- harness:runtime v1 -->\nedited\n"}}},+ "harness · claude · a symlinked instruction file": {"first":{"threw":"Refusing to replace a symlink: <root>/case-5e7c292412/workspace/CLAUDE.md"},"after":{"CLAUDE.md":{"link":"<root>/case-5e7c292412/shared.md"}},"shared":{"mode":"644","text":"# Shared\n"}},+ "harness · codex · an edited bootstrap": {"first":{"threw":"The Harness bootstrap in <root>/case-8d8760f24c/workspace/AGENTS.md was edited; restore it before launching."},"after":{"AGENTS.md":{"mode":"644","text":"# Rules\n<!-- harness:runtime v1 -->\nedited\n"}}},+ "harness · codex · a symlinked instruction file": {"first":{"threw":"Refusing to replace a symlink: <root>/case-83cd6abc0c/workspace/AGENTS.md"},"after":{"AGENTS.md":{"link":"<root>/case-83cd6abc0c/shared.md"}},"shared":{"mode":"644","text":"# Shared\n"}},+ "apis · claude · no file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/CLAUDE.md":{"mode":"644","text":"<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · claude · no file · no saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · claude · a file of the person's · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/CLAUDE.md":{"mode":"644","text":"# Mine\n\n<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · claude · a file already noted · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/CLAUDE.md":{"mode":"644","text":"# Mine\n<!-- harness:apis -->\nold note\n"}}},+ "apis · claude · a symlinked file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"target.md":{"mode":"644","text":"# Target\n"},"workspace":{"dir":true,"mode":"755"},"workspace/CLAUDE.md":{"link":"<root>/case-af30f37346/target.md"}}},+ "apis · claude · a folder by that name · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/CLAUDE.md":{"dir":true,"mode":"755"}}},+ "apis · codex · no file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"mode":"644","text":"<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · codex · no file · no saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · codex · a file of the person's · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"mode":"644","text":"# Mine\n\n<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · codex · a file already noted · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"mode":"644","text":"# Mine\n<!-- harness:apis -->\nold note\n"}}},+ "apis · codex · a symlinked file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"target.md":{"mode":"644","text":"# Target\n"},"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"link":"<root>/case-7af638c2e9/target.md"}}},+ "apis · codex · a folder by that name · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"dir":true,"mode":"755"}}},+ "apis · cursor · no file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"mode":"644","text":"<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · cursor · no file · no saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · opencode · no file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"mode":"644","text":"<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · opencode · no file · no saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · pi · no file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"mode":"644","text":"<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · pi · no file · no saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · hermes · no file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"mode":"644","text":"<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · hermes · no file · no saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · commandcode · no file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"mode":"644","text":"<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · commandcode · no file · no saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · devin · no file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"mode":"644","text":"<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · devin · no file · no saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · muse · no file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"mode":"644","text":"<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · muse · no file · no saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · amp · no file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"mode":"644","text":"<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · amp · no file · no saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · kilo · no file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"mode":"644","text":"<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · kilo · no file · no saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · grok · no file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"mode":"644","text":"<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · grok · no file · no saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · agy · no file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"mode":"644","text":"<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · agy · no file · no saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · copilot · no file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/AGENTS.md":{"mode":"644","text":"<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · copilot · no file · no saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · terminal · no file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · terminal · no file · no saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · gemini · no file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/GEMINI.md":{"mode":"644","text":"<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · gemini · no file · no saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"}}},+ "apis · gemini · a file of the person's · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/GEMINI.md":{"mode":"644","text":"# Mine\n\n<!-- harness:apis -->\n## Saved APIs\n\nThe user can save API connections in Harness → Models → APIs on this computer.\nRun `harness api list --json` to discover the current connections; the list contains no keys.\nUse `harness api request <id> <path> --method POST --data @request.json` for JSON APIs,\nor `harness api run <id> -- <command> [args]` for a provider SDK/tool. The latter supplies\nthe connection's documented key variable and HARNESS_API_BASE_URL to that tool only.\nUse these APIs when needed for the user's task. Never print, paste, or save API keys in a project.\nAdding an API does not change this harness's model or subscription.\n"}}},+ "apis · gemini · a file already noted · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/GEMINI.md":{"mode":"644","text":"# Mine\n<!-- harness:apis -->\nold note\n"}}},+ "apis · gemini · a symlinked file · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"target.md":{"mode":"644","text":"# Target\n"},"workspace":{"dir":true,"mode":"755"},"workspace/GEMINI.md":{"link":"<root>/case-4534dc9a35/target.md"}}},+ "apis · gemini · a folder by that name · saved APIs": {"first":{"value":"done"},"second":{"value":"done"},"files":{"workspace":{"dir":true,"mode":"755"},"workspace/GEMINI.md":{"dir":true,"mode":"755"}}}+}+}diff --git a/cli/src/engines/claude/launch.ts b/cli/src/engines/claude/launch.tsindex 3a743b2a0..570148ceb 100644--- a/cli/src/engines/claude/launch.ts+++ b/cli/src/engines/claude/launch.ts@@ -13,4 +13,16 @@ export const launch: EngineLaunch = {firstPromptArgs: [], resumeArgs: ['--resume'], forkArgs: { lead: ['--resume'], after: ['--fork-session'] },instructionFiles: ['CLAUDE.md'],contextArgs: { args: ['--append-system-prompt', 'Read the harness context at {file} before working.'], quote: 'json' },+ // Claude Code reads CLAUDE.md, and AGENTS.md only through an import line in it.+ instructionFile: 'CLAUDE.md',+ instructionImport: { file: 'AGENTS.md', line: '@AGENTS.md' },+ /**+ * Claude Code asks "do you trust this folder?" the first time it opens a project, and keeps the answer as+ * `projects[<path>].hasTrustDialogAccepted` in `.claude.json`: in CLAUDE_CONFIG_DIR, else the home folder+ * itself (its own rule, 2.1.290). A yes covers the folders below. Copied from the former lib/claudeTrust.ts.+ */+ trust: {+ home: { variable: 'CLAUDE_CONFIG_DIR', otherwise: 'home' }, file: '.claude.json',+ format: 'json', projects: 'projects', accepted: 'hasTrustDialogAccepted', entry: { allowedTools: [] },+ },}diff --git a/cli/src/engines/codex/launch.ts b/cli/src/engines/codex/launch.tsindex bf334e976..c1f5d22e3 100644--- a/cli/src/engines/codex/launch.ts+++ b/cli/src/engines/codex/launch.ts@@ -9,9 +9,11 @@ const permissionModes = {/*** Codex's launch, declared: data only, which core applies with the kit (engines/launches.ts,- * lib/engineLaunch.ts). The pane script's startup probe and retry were lib/engineLaunch.ts's and- * lib/codexStartupRetry.ts's, the own-login provider was engines/codex/ownLoginProvider.ts, and the- * environment flags were `codexEnvArgs` in this file (docs/design/2026-10-08-engine-launch.md).+ * engines/launchPrep.ts, lib/engineLaunch.ts). The pane script's startup probe and retry were+ * lib/engineLaunch.ts's and lib/codexStartupRetry.ts's, the own-login provider was+ * engines/codex/ownLoginProvider.ts, the environment flags were `codexEnvArgs` in this file, the folder trust+ * was lib/claudeTrust.ts's and the resume repair was engines/codex/portableHistory.ts+ * (docs/design/2026-10-08-engine-launch.md).*/export const launch: EngineLaunch = {permissionModes, bypassPermission: permissionModes.auto,@@ -51,6 +53,28 @@ export const launch: EngineLaunch = {* every launch, and OpenCode's is a file this daemon writes, so only Codex declares this.*/ownProvider: { home: 'CODEX_HOME', file: 'config.toml', key: 'model_provider', fallback: 'openai', args: ['-c', 'model_provider="{value}"'] },+ /**+ * Codex keeps its folder trust in `<CODEX_HOME>/config.toml` as a `[projects."<path>"]` table with+ * `trust_level = "trusted"`, read from the agent's own profile or a CODEX_HOME the person moved, exact+ * folders only. Copied from the former lib/claudeTrust.ts.+ */+ trust: { home: { setting: 'CODEX_HOME' }, file: 'config.toml', format: 'toml', table: 'projects', key: 'trust_level', value: 'trusted' },+ /**+ * A rollout written on a grid relay keeps reasoning items the relay's portable_reasoning_item contract+ * forbids (a vendor-style id on plaintext reasoning, text in `content`). Back on Codex's own provider,+ * `codex resume` replays them and fails. Retargeting to the native subscription bypasses the grid, so+ * response-side relay cleanup cannot repair items already persisted: they are repaired before the resume.+ * `response_item` records are replayed as they are, and `compacted` ones replay their `replacement_history`.+ * Copied from the former engines/codex/portableHistory.ts and the rollout lookup of engines/codex/rollout.ts.+ */+ resumeRepair: {+ sessions: { home: { setting: 'CODEX_HOME' }, folder: 'sessions', suffix: '.jsonl', id: /^[a-zA-Z0-9-]{8,128}$/, walk: 5_000 },+ first: { type: 'session_meta', id: ['payload', 'id'] },+ items: [{ type: 'response_item', at: ['payload'] }, { type: 'compacted', at: ['payload', 'replacement_history'], list: true }],+ repair: 'portable-reasoning',+ backup: '.reasoning-backup-', temporary: '.reasoning-tmp-',+ names: { file: 'Codex rollout', history: 'Codex history', items: 'Codex reasoning items' },+ },startup: {/*** Codex 0.157+ otherwise puts the writer outside tmux in a shared server. Keep Harness-owned launchesdiff --git a/cli/src/engines/codex/portableHistory.ts b/cli/src/engines/codex/portableHistory.tsdeleted file mode 100644index 4719b7000..000000000--- a/cli/src/engines/codex/portableHistory.ts+++ /dev/null@@ -1,219 +0,0 @@-import { createHash, randomUUID } from 'node:crypto'-import { closeSync, constants, fsyncSync, fstatSync, lstatSync, openSync, readSync, realpathSync, renameSync, rmSync, writeSync, type Stats } from 'node:fs'-import { isAbsolute, join, relative } from 'node:path'-import { env } from '../../config/env.js'-import { codexHomeRoots } from '../../lib/engineHomes.js'-import { resolveCodexRollout } from './rollout.js'--type JsonObject = Record<string, unknown>--function object(value: unknown): value is JsonObject {- return value !== null && typeof value === 'object' && !Array.isArray(value)-}--/** Match the relay's portable_reasoning_item contract. Plaintext engine reasoning has no- * vendor-stored id; encrypted vendor reasoning must keep its original fields. */-function repairReasoning(item: unknown): boolean {- if (!object(item) || item.type !== 'reasoning' || item.encrypted_content) return false- let changed = false- if ('id' in item) {- delete item.id- changed = true- }- if (Array.isArray(item.content) && item.content.length) {- const text = item.content.map((part) => object(part) && typeof part.text === 'string' ? part.text : '').join('')- item.content = []- if (text && (!Array.isArray(item.summary) || !item.summary.length)) {- item.summary = [{ type: 'summary_text', text }]- }- changed = true- }- return changed-}--/** Shared by the string helper and the file reader, which retains only one record at a time. */-function historyRepair(sessionId: string) {- let sawMeta = false- let repairedItems = 0- let lineNumber = 0- const line = (line: string): string => {- lineNumber++- if (!line.trim()) return line- let record: unknown- try { record = JSON.parse(line) } catch {- // JSON.parse's own error can quote conversation text; keep it out of daemon logs.- throw new Error(`invalid JSON in Codex rollout at line ${lineNumber}`)- }- if (!object(record)) throw new Error('invalid Codex rollout record')- if (!sawMeta) {- if (record.type !== 'session_meta' || !object(record.payload) || record.payload.id !== sessionId) {- throw new Error('Codex rollout does not belong to the session being resumed')- }- sawMeta = true- }- const items = record.type === 'response_item' ? [record.payload]- : record.type === 'compacted' && object(record.payload) && Array.isArray(record.payload.replacement_history)- ? record.payload.replacement_history : []- let changed = false- for (const item of items) {- if (repairReasoning(item)) { repairedItems++; changed = true }- }- return changed ? JSON.stringify(record) + (line.endsWith('\r') ? '\r' : '') : line- }- return { line, finish: () => {- if (!sawMeta) throw new Error('Codex rollout has no session metadata')- return repairedItems- } }-}--/** Only replayed API items are repaired. Other records (including readable event history) and- * unchanged lines retain their exact bytes. Invalid JSON aborts the whole repair. */-export function portableCodexHistory(history: string, sessionId: string): { history: string; repairedItems: number } {- const repair = historyRepair(sessionId)- const lines = history.split('\n').map(repair.line)- return { history: lines.join('\n'), repairedItems: repair.finish() }-}--const READ_BYTES = 64 * 1024-const changedDuringPreparation = () => new Error('Codex rollout changed during resume preparation; retry after its writer stops')--function sameFile(a: Stats, b: Stats): boolean {- return b.isFile() && a.ino === b.ino && a.dev === b.dev && a.size === b.size- && a.mtimeMs === b.mtimeMs && a.ctimeMs === b.ctimeMs-}--/** A rollout can exceed V8's single-string limit. Decode complete JSONL records, preserving raw- * bytes for unchanged records and hashing the whole file without holding it in memory. Reads are- * bounded to the captured length so an unexpected writer cannot make preparation run forever. */-function scanHistory(fd: number, size: number, sessionId: string, emit?: (original: Buffer, repaired: Buffer) => void) {- const repair = historyRepair(sessionId)- const hash = createHash('sha256')- const chunk = Buffer.allocUnsafe(READ_BYTES)- let fragments: Buffer[] = []- let position = 0- let repairedBytes = 0- const line = (bytes: Buffer) => {- const newline = bytes.at(-1) === 10- const original = bytes.subarray(0, bytes.length - (newline ? 1 : 0)).toString('utf8')- const repaired = repair.line(original)- const output = repaired === original ? bytes : Buffer.from(repaired + (newline ? '\n' : ''))- repairedBytes += output.length- emit?.(bytes, output)- }- while (position < size) {- const count = readSync(fd, chunk, 0, Math.min(chunk.length, size - position), position)- if (!count) throw changedDuringPreparation()- position += count- hash.update(chunk.subarray(0, count))- let start = 0- let end: number- while ((end = chunk.indexOf(10, start)) >= 0 && end < count) {- const part = chunk.subarray(start, end + 1)- if (fragments.length) {- fragments.push(part)- line(Buffer.concat(fragments))- fragments = []- } else line(part)- start = end + 1- }- // Copy the trailing fragment before the next read reuses the chunk buffer. In particular,- // a multibyte UTF-8 codepoint split across reads is decoded only after its line is complete.- if (start < count) fragments.push(Buffer.from(chunk.subarray(start, count)))- }- if (fragments.length) line(Buffer.concat(fragments))- return { repairedItems: repair.finish(), repairedBytes, digest: hash.digest('hex') }-}--function writeAll(fd: number, bytes: Buffer): void {- let written = 0- while (written < bytes.length) {- const count = writeSync(fd, bytes, written, bytes.length - written)- if (!count) throw new Error('Could not write the prepared Codex history')- written += count- }-}--export interface CodexResumeSource {- engine: string- sessionId: string- transcriptPath?: string | null- codexHome?: string | null-}--/** Call only after the session's engine has stopped, before launching `codex resume`.- * Retargeting to the native subscription bypasses Grid, so response-side relay cleanup cannot- * repair items already persisted here. A private backup precedes an atomic replacement.- *- * `repairedBytes` (set only when items were repaired) is the on-disk length of the rewritten- * rollout. A live tailer of this same file must move its offset there before the engine relaunches:- * the repair shrinks the file mid-history, which an append-only byte tail would otherwise mistake- * for a truncation and replay in full. */-export function prepareCodexResume(source: CodexResumeSource): { repairedItems: number; repairedBytes?: number; backupPath?: string } {- if (source.engine !== 'codex' || !source.sessionId) return { repairedItems: 0 }- // The agent's own profile, else every home the person moved too (lib/engineHomes.ts): a rollout in a moved- // CODEX_HOME was refused as outside the profile, so a restart or reopen failed after Codex had stopped.- const sessionRoots = (source.codexHome ? [source.codexHome] : codexHomeRoots(env.CODEX_HOME)).map((home) => join(home, 'sessions'))- const byId = () => sessionRoots.reduce<string | null>((found, sessions) => found ?? resolveCodexRollout(source.sessionId, sessions), null)- let file = source.transcriptPath || byId()- // A missing history still follows the engine's existing resume/fresh fallback.- if (!file) return { repairedItems: 0 }- let before: ReturnType<typeof lstatSync>- try { before = lstatSync(file) } catch (error) {- if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error- // The registry may still point at a rollout that was moved; Codex resolves the session by id.- file = byId()- if (!file) return { repairedItems: 0 }- before = lstatSync(file)- }- const real = realpathSync(file)- const inside = sessionRoots.some((sessions) => {- let root: string- try { root = realpathSync(sessions) } catch { return false }- const rel = relative(root, real)- return !isAbsolute(rel) && rel !== '..' && !rel.startsWith('../')- })- if (!before.isFile() || before.isSymbolicLink() || !inside- || (typeof process.getuid === 'function' && before.uid !== process.getuid())) {- throw new Error('Codex rollout is outside the session profile or is not an owned regular file')- }- const input = openSync(file, constants.O_RDONLY | constants.O_NOFOLLOW)- try {- const unchanged = () => {- if (!sameFile(before, fstatSync(input)) || !sameFile(before, lstatSync(file!))) throw changedDuringPreparation()- }- unchanged()- const inspected = scanHistory(input, before.size, source.sessionId)- unchanged()- if (!inspected.repairedItems) return { repairedItems: 0 }-- const suffix = randomUUID()- const backupPath = `${file}.reasoning-backup-${suffix}`- const temporary = `${file}.reasoning-tmp-${suffix}`- let backup: number | undefined- let output: number | undefined- let verifiedBackup = false- try {- backup = openSync(backupPath, 'wx', 0o600)- output = openSync(temporary, 'wx', 0o600)- // Re-read into private files only after every record has validated. The digest proves the- // backup and repaired output came from the exact bytes inspected, even across chunk reads.- const copied = scanHistory(input, before.size, source.sessionId, (original, repaired) => {- writeAll(backup!, original)- writeAll(output!, repaired)- })- if (copied.digest !== inspected.digest) throw changedDuringPreparation()- fsyncSync(backup)- fsyncSync(output)- unchanged()- verifiedBackup = true- renameSync(temporary, file)- return { repairedItems: copied.repairedItems, repairedBytes: copied.repairedBytes, backupPath }- } finally {- if (output !== undefined) { closeSync(output); rmSync(temporary, { force: true }) }- if (backup !== undefined) {- closeSync(backup)- if (!verifiedBackup) rmSync(backupPath, { force: true })- }- }- } finally { closeSync(input) }-}diff --git a/cli/src/engines/codex/rollout.ts b/cli/src/engines/codex/rollout.tsindex 66afb46c8..c0ad2497c 100644--- a/cli/src/engines/codex/rollout.ts+++ b/cli/src/engines/codex/rollout.ts@@ -1,13 +1,13 @@-import { closeSync, existsSync, openSync, readSync, readdirSync } from 'fs'+import { closeSync, openSync, readSync } from 'fs'import { join } from 'path'import { env } from '../../config/env.js'import { codexHomeRoots } from '../../lib/engineHomes.js'+import { findSessionFile } from '../kit/resumeRepair.js'+import { launch } from './launch.js'type JsonObject = Record<string, unknown>-const MAX_WALK_ENTRIES = 5_000const MAX_META_BYTES = 128 * 1024-const THREAD_ID_RE = /^[a-zA-Z0-9-]{8,128}$/export interface CodexRolloutMeta {id: string@@ -58,27 +58,11 @@ export function readCodexRolloutMeta(file: string): CodexRolloutMeta | null {/** Find one rollout by thread id without scanning unbounded user history: under `root`, else in every Codex* home the person moved too (lib/engineHomes.ts). The daemon's own alone missed the sub-agents of a Codex- * in a moved home, and its Task cards closed with no tools and no totals. */+ * in a moved home, and its Task cards closed with no tools and no totals. The lookup is the kit's, on the+ * rule Codex's launch contract declares (`resumeRepair.sessions`), which resuming uses too. */export function resolveCodexRollout(threadId: string, root?: string): string | null {if (root === undefined) {return codexHomeRoots(env.CODEX_HOME).reduce<string | null>((found, home) => found ?? resolveCodexRollout(threadId, join(home, 'sessions')), null)}- if (!THREAD_ID_RE.test(threadId) || !existsSync(root)) return null- const stack = [root]- let visited = 0- while (stack.length && visited < MAX_WALK_ENTRIES) {- const dir = stack.pop()!- let names: string[]- try { names = readdirSync(dir) } catch { continue }- for (const name of names) {- if (++visited > MAX_WALK_ENTRIES) break- const full = join(dir, name)- if (name.endsWith('.jsonl')) {- if (name.includes(threadId)) return full- } else if (!name.includes('.')) {- stack.push(full)- }- }- }- return null+ return findSessionFile(threadId, root, launch.resumeRepair!.sessions)}diff --git a/cli/src/engines/facets/launch.ts b/cli/src/engines/facets/launch.tsindex e896d1b0c..fe3226b91 100644--- a/cli/src/engines/facets/launch.ts+++ b/cli/src/engines/facets/launch.ts@@ -88,6 +88,57 @@ export interface StartupContract {retry?: StartupRetry}+/**+ * Where an engine keeps its own settings for a launch made now. `setting`: the folder a daemon setting names,+ * unless the person's shell moves it, unless the agent has a profile of its own (Codex's CODEX_HOME).+ * `variable`: the folder a variable the person's shell sets names, else their home folder (Claude Code's+ * CLAUDE_CONFIG_DIR). Resolved by lib/engineHomes.ts `launchHomeOf`.+ */+export type LaunchHome = { setting: FolderSetting } | { variable: string; otherwise: 'home' }++/**+ * An engine's answer to "do you trust this folder?", which it asks the first time it opens one, kept in `file`+ * in its home. Harness records it only for a folder it made empty itself (the callers decide), never removes+ * anything, and leaves a file it cannot safely extend as it is. Applied by kit/folderTrust.ts.+ */+export type TrustContract = { home: LaunchHome; file: string } & (+ /**+ * A JSON object whose `projects` map a folder to its entry, trusted where `accepted` is true. A trusted+ * folder's trust covers every folder below it. A new entry starts as `entry`.+ */+ | { format: 'json'; projects: string; accepted: string; entry: Readonly<Record<string, unknown>> }+ /** A TOML table per folder, `[<table>."<folder>"]`, trusted where its `key` is `value`. Exact folders only. */+ | { format: 'toml'; table: string; key: string; value: string }+)++/**+ * Making a stopped conversation's history resumable before the engine is launched on it again. Applied by+ * kit/resumeRepair.ts, after the engine has stopped and before the tail moves and the engine starts.+ */+export interface ResumeRepairContract {+ /**+ * Where histories are: `folder` in the engine's home (the agent's profile, else every home the person moved+ * and the daemon's). One is a file ending in `suffix` whose name holds the session's id, at any depth; only+ * names with no `.` are folders worth entering, and at most `walk` entries are looked at. An id `id` refuses+ * is never looked for.+ */+ sessions: { home: { setting: FolderSetting }; folder: string; suffix: string; id: RegExp; walk: number }+ /** The first record names the session: its `type`, and the field that holds the id. */+ first: { type: string; id: readonly string[] }+ /** The records whose items the engine replays: the item at `at`, or each item of the list there. */+ items: ReadonlyArray<{ type: string; at: readonly string[]; list?: boolean }>+ /**+ * What is repaired in each item. `portable-reasoning`: the relay's portable_reasoning_item contract (a+ * plaintext reasoning item keeps no vendor id, and its text is its summary).+ */+ repair: 'portable-reasoning'+ /** The private files beside the history, by suffix: the backup of what it was, and the one being written. */+ backup: string+ temporary: string+ /** How the person, and the daemon's log, name the history file, the history and what was repaired. */+ names: { file: string; history: string; items: string }+}+/** Literal argv contracts copied from the existing launch paths. No engine version behavior changes. */export interface EngineLaunch {permissionModes: Readonly<Record<string, readonly string[]>>@@ -101,4 +152,10 @@ export interface EngineLaunch {sharedServer?: SharedServerContractownProvider?: OwnProviderContractstartup?: StartupContract+ /** The instruction file Harness writes its own notes into (a harness's bootstrap, the saved APIs); else AGENTS.md. */+ instructionFile?: string+ /** The line, in that file, that has the engine read `file` too (Claude Code's `@AGENTS.md` import). */+ instructionImport?: { file: string; line: string }+ trust?: TrustContract+ resumeRepair?: ResumeRepairContract}diff --git a/cli/src/lib/claudeTrust.spec.ts b/cli/src/engines/kit/folderTrust.spec.tssimilarity index 92%rename from cli/src/lib/claudeTrust.spec.tsrename to cli/src/engines/kit/folderTrust.spec.tsindex 3b3ad6857..78482a93e 100644--- a/cli/src/lib/claudeTrust.spec.ts+++ b/cli/src/engines/kit/folderTrust.spec.ts@@ -2,7 +2,17 @@ import { lstatSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, symlinkSyimport { tmpdir } from 'node:os'import { join } from 'node:path'import { afterEach, describe, expect, it, vi } from 'vitest'-import { claudeTrusts, codexTrusts, preTrustClaudeProject, preTrustCodexProject } from './claudeTrust.js'+import { launchClaudeConfigDir, launchCodexHome } from '../../lib/engineHomes.js'+import { launch as claude } from '../claude/launch.js'+import { launch as codex } from '../codex/launch.js'+import { recordTrustIn, trustsIn } from './folderTrust.js'++// The former lib/claudeTrust.spec.ts, its cases unchanged, against the two engines' declared trust (`trust` in+// claude/launch.ts and codex/launch.ts) applied by the kit, in the homes the former functions read.+const preTrustClaudeProject = (cwd: string, home = launchClaudeConfigDir()) => recordTrustIn(claude.trust!, join(home, claude.trust!.file), cwd)+const claudeTrusts = (path: string, home = launchClaudeConfigDir()) => trustsIn(claude.trust!, join(home, claude.trust!.file), path)+const codexTrusts = (path: string, codexHome?: string | null) => trustsIn(codex.trust!, join(launchCodexHome(codexHome), codex.trust!.file), path)+const preTrustCodexProject = (cwd: string, codexHome?: string | null) => recordTrustIn(codex.trust!, join(launchCodexHome(codexHome), codex.trust!.file), cwd)describe('preTrustClaudeProject', () => {it('records trust for a new folder the way Claude Code does, keeping everything else', () => {diff --git a/cli/src/engines/kit/folderTrust.ts b/cli/src/engines/kit/folderTrust.tsnew file mode 100644index 000000000..12d3bf3cd--- /dev/null+++ b/cli/src/engines/kit/folderTrust.ts@@ -0,0 +1,128 @@+/**+ * An engine's folder trust, read and recorded as its launch contract declares it (facets/launch.ts+ * `TrustContract`). For a workspace Harness itself just made EMPTY there is nothing in it to review, so the+ * daemon records the answer the way the engine does, in the file the engine launched there actually reads.+ * Moved from lib/claudeTrust.ts, whose every write it reproduces (engines/launchPrep.golden.spec.ts).+ *+ * ⚠️ Never for a folder with content the person has not been asked about (a clone, their own repo, a worktree+ * of one): that answer is theirs. The callers decide (core/agents/create.ts, launches.ts). A worktree only+ * inherits the answer its source repo already has.+ *+ * Only ever ADDS trust, never removes anything, and does nothing when the engine has never run here (no+ * file), when the file does not parse, or when it already says yes.+ */+import { existsSync, readFileSync, realpathSync, renameSync, writeFileSync } from 'node:fs'+import type { TrustContract } from '../facets/launch.js'++type JsonTrust = Extract<TrustContract, { format: 'json' }>+type TomlTrust = Extract<TrustContract, { format: 'toml' }>++/** Whether the engine already trusts `path`, by the settings in `file`. */+export function trustsIn(trust: TrustContract, file: string, path: string): boolean {+ return trust.format === 'json' ? jsonTrusts(trust, file, path) : tomlTrusts(trust, file, path)+}++/** Record trust in `cwd` in `file`. */+export function recordTrustIn(trust: TrustContract, file: string, cwd: string): 'trusted' | 'already' | 'skipped' {+ return trust.format === 'json' ? recordJson(trust, file, cwd) : recordToml(trust, file, cwd)+}++function isPlainObject(value: unknown): value is Record<string, unknown> {+ return typeof value === 'object' && value !== null && !Array.isArray(value)+}++/**+ * Replace a config file atomically, THROUGH a symlink. Dotfile managers keep `~/.claude.json` and+ * `~/.codex/config.toml` as links into a repo; renaming a temporary file over the link itself would+ * swap it for a plain file and quietly detach the person's dotfiles.+ */+function replaceConfigFile(file: string, text: string): void {+ const target = realpathSync(file)+ const tmp = `${target}.harness-${process.pid}.tmp`+ writeFileSync(tmp, text, { mode: 0o600 })+ renameSync(tmp, target)+}++function recordJson(trust: JsonTrust, file: string, cwd: string): 'trusted' | 'already' | 'skipped' {+ if (!existsSync(file)) return 'skipped'+ let config: unknown+ try {+ config = JSON.parse(readFileSync(file, 'utf8'))+ } catch {+ return 'skipped'+ }+ // Anything but the shape the engine writes is left exactly as it is: writing trust into an array,+ // or spreading a string entry into an object, would rewrite what the person has.+ if (!isPlainObject(config)) return 'skipped'+ if (config[trust.projects] !== undefined && !isPlainObject(config[trust.projects])) return 'skipped'+ const projects = (config[trust.projects] ?? {}) as Record<string, unknown>+ const existing = projects[cwd]+ if (existing !== undefined && !isPlainObject(existing)) return 'skipped'+ if (existing?.[trust.accepted] === true) return 'already'+ projects[cwd] = { ...structuredClone(trust.entry), ...(existing ?? {}), [trust.accepted]: true }+ config[trust.projects] = projects+ replaceConfigFile(file, JSON.stringify(config, null, 2))+ return 'trusted'+}++/** Its own entry, or a folder above it, says yes: the inheritance Claude Code applies. Unreadable or absent+ * settings read as no. */+function jsonTrusts(trust: JsonTrust, file: string, path: string): boolean {+ if (!existsSync(file)) return false+ let config: unknown+ try { config = JSON.parse(readFileSync(file, 'utf8')) } catch { return false }+ if (!isPlainObject(config) || !isPlainObject(config[trust.projects])) return false+ for (const [key, entry] of Object.entries(config[trust.projects] as Record<string, unknown>)) {+ if (!isPlainObject(entry) || entry[trust.accepted] !== true) continue+ const base = key.replace(/\/+$/, '')+ if (path === base || path.startsWith(`${base}/`)) return true+ }+ return false+}++const escape = (text: string): string => text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')++/** A `[<table>.<key>]` header, however it is spaced or quoted. */+const headerPattern = (trust: TomlTrust): RegExp =>+ new RegExp(String.raw`^[ \t]*\[[ \t]*${escape(trust.table)}[ \t]*\.[ \t]*("(?:[^"\\\r\n]|\\.)*"|'[^'\r\n]*')[ \t]*\]`, 'gm')+/** The table defined any other way: an inline table, dotted keys, or a bare `[<table>]`. */+const otherwisePattern = (trust: TomlTrust): RegExp =>+ new RegExp(String.raw`^[ \t]*(?:${escape(trust.table)}[ \t]*[.=]|\[[ \t]*${escape(trust.table)}[ \t]*\])`, 'm')++/** The key a quoted TOML key names; null for an escape JSON does not share (`\U0001F600`). */+function tomlKey(quoted: string): string | null {+ if (quoted.startsWith("'")) return quoted.slice(1, -1)+ try { return JSON.parse(quoted) as string } catch { return null }+}++/** Exactly `path`, by its own table's value, which runs to the next header. */+function tomlTrusts(trust: TomlTrust, file: string, path: string): boolean {+ if (!existsSync(file)) return false+ const text = readFileSync(file, 'utf8')+ for (const match of text.matchAll(headerPattern(trust))) {+ if (tomlKey(match[1]) !== path) continue+ const rest = text.slice((match.index ?? 0) + match[0].length)+ const body = rest.split(/^[ \t]*\[/m)[0]+ return new RegExp(String.raw`^[ \t]*${escape(trust.key)}[ \t]*=[ \t]*["']${escape(trust.value)}["']`, 'm').test(body)+ }+ return false+}++/**+ * The table is appended at the end, never rewriting what is there. Appending is only safe when nothing else+ * defines that table: the same folder under another quoting, or the table written as an inline table or+ * dotted keys, would make the appended table a duplicate definition, a file the engine refuses to load.+ * Those are left alone.+ */+function recordToml(trust: TomlTrust, file: string, cwd: string): 'trusted' | 'already' | 'skipped' {+ if (!existsSync(file)) return 'skipped'+ const text = readFileSync(file, 'utf8')+ const keys = [...text.matchAll(headerPattern(trust))].map((match) => tomlKey(match[1]))+ if (keys.includes(cwd)) return 'already'+ // A key this cannot read might be this folder spelled another way: not safe to append after.+ if (keys.includes(null) || otherwisePattern(trust).test(text)) return 'skipped'+ // A TOML basic string is a JSON string, except that DEL must be escaped too.+ const header = `[${trust.table}.${JSON.stringify(cwd).replace(/\x7f/g, '\\u007f')}]`+ replaceConfigFile(file, `${text.replace(/\s*$/, '')}\n\n${header}\n${trust.key} = ${JSON.stringify(trust.value)}\n`)+ return 'trusted'+}diff --git a/cli/src/engines/codex/portableHistory.real.spec.ts b/cli/src/engines/kit/resumeRepair.real.spec.tssimilarity index 97%rename from cli/src/engines/codex/portableHistory.real.spec.tsrename to cli/src/engines/kit/resumeRepair.real.spec.tsindex 4c8e0545c..d2ea6d337 100644--- a/cli/src/engines/codex/portableHistory.real.spec.ts+++ b/cli/src/engines/kit/resumeRepair.real.spec.ts@@ -1,5 +1,5 @@/** Offline wire regression against the installed Codex CLI (verified with 0.154.0).- * RUN_CODEX_RESUME_E2E=1 npm exec vitest run src/engines/codex/portableHistory.real.spec.ts+ * RUN_CODEX_RESUME_E2E=1 npm exec vitest run src/engines/kit/resumeRepair.real.spec.ts* Only the loopback mock is contacted; no vendor credential or inference is used. */import { execFile } from 'node:child_process'import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'@@ -8,7 +8,7 @@ import { tmpdir } from 'node:os'import { join } from 'node:path'import { promisify } from 'node:util'import { expect, it } from 'vitest'-import { prepareCodexResume } from './portableHistory.js'+import { prepareResume as prepareCodexResume } from '../launchPrep.js'it.skipIf(process.env.RUN_CODEX_RESUME_E2E !== '1')('resumes the same Codex conversation after a rejected reasoning id is repaired', async () => {const profile = mkdtempSync(join(tmpdir(), 'codex-resume-wire-'))diff --git a/cli/src/engines/codex/portableHistory.spec.ts b/cli/src/engines/kit/resumeRepair.spec.tssimilarity index 93%rename from cli/src/engines/codex/portableHistory.spec.tsrename to cli/src/engines/kit/resumeRepair.spec.tsindex 149f62cf3..25579231a 100644--- a/cli/src/engines/codex/portableHistory.spec.ts+++ b/cli/src/engines/kit/resumeRepair.spec.ts@@ -5,7 +5,13 @@ import { closeSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, reimport * as fs from 'node:fs'import { tmpdir } from 'node:os'import { join } from 'node:path'-import { portableCodexHistory, prepareCodexResume } from './portableHistory.js'+import { launch as codex } from '../codex/launch.js'+import { prepareResume as prepareCodexResume } from '../launchPrep.js'+import { repairHistoryText } from './resumeRepair.js'++// The former engines/codex/portableHistory.spec.ts, its cases unchanged, against Codex's declared repair+// (`resumeRepair` in codex/launch.ts) applied by the kit, through the composition the resume calls.+const portableCodexHistory = (history: string, sessionId: string) => repairHistoryText(codex.resumeRepair!, history, sessionId)// Keep the real filesystem, with configurable exports for simulating a concurrent writer.vi.mock('node:fs', async importOriginal => ({ ...await importOriginal<typeof import('node:fs')>() }))@@ -189,15 +195,15 @@ describe('preparing a stopped Codex session for resume', () => {const homes = await import('../../lib/engineHomes.js')homes.adoptEngineHomes({ CODEX_HOME: profile }, { claudeHome: '/nowhere/.claude', codexHome: '/nowhere/.codex' })try {- const fresh = await import('./portableHistory.js')- expect(fresh.prepareCodexResume({ ...source(), codexHome: null }).repairedItems).toBe(1)+ const fresh = await import('../launchPrep.js')+ expect(fresh.prepareResume({ ...source(), codexHome: null }).repairedItems).toBe(1)// Found by its id there too, when the registry has no path for it.writeFileSync(file, history(badReasoning()))- expect(fresh.prepareCodexResume({ ...source(), codexHome: null, transcriptPath: null }).repairedItems).toBe(1)+ expect(fresh.prepareResume({ ...source(), codexHome: null, transcriptPath: null }).repairedItems).toBe(1)// A file in no Codex home at all is still refused.const stray = join(profile, 'stray.jsonl')writeFileSync(stray, history(badReasoning()))- expect(() => fresh.prepareCodexResume({ ...source(), codexHome: null, transcriptPath: stray })).toThrow('outside the session profile')+ expect(() => fresh.prepareResume({ ...source(), codexHome: null, transcriptPath: stray })).toThrow('outside the session profile')} finally {vi.unstubAllEnvs()rmSync(join(process.env.ADAPTER_DATA_DIR!, 'engine-homes.json'), { force: true })diff --git a/cli/src/engines/kit/resumeRepair.ts b/cli/src/engines/kit/resumeRepair.tsnew file mode 100644index 000000000..0aea9fa11--- /dev/null+++ b/cli/src/engines/kit/resumeRepair.ts@@ -0,0 +1,258 @@+/**+ * A stopped conversation's history made resumable, as the engine's launch contract declares it+ * (facets/launch.ts `ResumeRepairContract`), and the lookup of a history by its session's id. Moved from+ * engines/codex/portableHistory.ts and the lookup of engines/codex/rollout.ts, whose every write and refusal+ * this reproduces (engines/launchPrep.golden.spec.ts). A resume is session control: this runs in core, with+ * no worker.+ */+import { createHash, randomUUID } from 'node:crypto'+import { closeSync, constants, existsSync, fsyncSync, fstatSync, lstatSync, openSync, readdirSync, readSync, realpathSync, renameSync, rmSync, writeSync, type Stats } from 'node:fs'+import { isAbsolute, join, relative } from 'node:path'+import type { ResumeRepairContract } from '../facets/launch.js'++type JsonObject = Record<string, unknown>+type Sessions = ResumeRepairContract['sessions']++function object(value: unknown): value is JsonObject {+ return value !== null && typeof value === 'object' && !Array.isArray(value)+}++/**+ * Find one history by its session's id without scanning unbounded history: a file ending in the declared+ * suffix whose name holds the id, under `root`, looking at no more than the declared number of entries.+ */+export function findSessionFile(id: string, root: string, sessions: Pick<Sessions, 'suffix' | 'id' | 'walk'>): string | null {+ if (!sessions.id.test(id) || !existsSync(root)) return null+ const stack = [root]+ let visited = 0+ while (stack.length && visited < sessions.walk) {+ const dir = stack.pop()!+ let names: string[]+ try { names = readdirSync(dir) } catch { continue }+ for (const name of names) {+ if (++visited > sessions.walk) break+ const full = join(dir, name)+ if (name.endsWith(sessions.suffix)) {+ if (name.includes(id)) return full+ } else if (!name.includes('.')) {+ stack.push(full)+ }+ }+ }+ return null+}++/**+ * The relay's portable_reasoning_item contract. Plaintext engine reasoning has no vendor-stored id;+ * encrypted vendor reasoning must keep its original fields.+ */+function portableReasoning(item: unknown): boolean {+ if (!object(item) || item.type !== 'reasoning' || item.encrypted_content) return false+ let changed = false+ if ('id' in item) {+ delete item.id+ changed = true+ }+ if (Array.isArray(item.content) && item.content.length) {+ const text = item.content.map((part) => object(part) && typeof part.text === 'string' ? part.text : '').join('')+ item.content = []+ if (text && (!Array.isArray(item.summary) || !item.summary.length)) {+ item.summary = [{ type: 'summary_text', text }]+ }+ changed = true+ }+ return changed+}++const REPAIRS: Record<ResumeRepairContract['repair'], (item: unknown) => boolean> = { 'portable-reasoning': portableReasoning }++/** The value at `path` in `record`, every step before the last an object; undefined where one is not. */+function valueAt(record: JsonObject, path: readonly string[]): unknown {+ let value: unknown = record+ for (const [index, key] of path.entries()) {+ if (index && !object(value)) return undefined+ value = (value as JsonObject)[key]+ }+ return value+}++/** Shared by the string helper and the file reader, which retains only one record at a time. */+function historyRepair(contract: ResumeRepairContract, sessionId: string) {+ const repair = REPAIRS[contract.repair]+ const { file } = contract.names+ let sawFirst = false+ let repairedItems = 0+ let lineNumber = 0+ const line = (line: string): string => {+ lineNumber+++ if (!line.trim()) return line+ let record: unknown+ try { record = JSON.parse(line) } catch {+ // JSON.parse's own error can quote conversation text; keep it out of daemon logs.+ throw new Error(`invalid JSON in ${file} at line ${lineNumber}`)+ }+ if (!object(record)) throw new Error(`invalid ${file} record`)+ if (!sawFirst) {+ // The id is never empty (the caller returns before), so a record with no such field never matches.+ if (record.type !== contract.first.type || valueAt(record, contract.first.id) !== sessionId) {+ throw new Error(`${file} does not belong to the session being resumed`)+ }+ sawFirst = true+ }+ const rule = contract.items.find((candidate) => candidate.type === record.type)+ const at = rule ? valueAt(record, rule.at) : undefined+ const items = !rule ? [] : rule.list ? (Array.isArray(at) ? at : []) : [at]+ let changed = false+ for (const item of items) {+ if (repair(item)) { repairedItems++; changed = true }+ }+ return changed ? JSON.stringify(record) + (line.endsWith('\r') ? '\r' : '') : line+ }+ return { line, finish: () => {+ if (!sawFirst) throw new Error(`${file} has no session metadata`)+ return repairedItems+ } }+}++/** Only replayed items are repaired. Other records (including readable event history) and unchanged lines+ * retain their exact bytes. Invalid JSON aborts the whole repair. */+export function repairHistoryText(contract: ResumeRepairContract, history: string, sessionId: string): { history: string; repairedItems: number } {+ const repair = historyRepair(contract, sessionId)+ const lines = history.split('\n').map(repair.line)+ return { history: lines.join('\n'), repairedItems: repair.finish() }+}++const READ_BYTES = 64 * 1024+const changedDuring = (contract: ResumeRepairContract) => new Error(`${contract.names.file} changed during resume preparation; retry after its writer stops`)++function sameFile(a: Stats, b: Stats): boolean {+ return b.isFile() && a.ino === b.ino && a.dev === b.dev && a.size === b.size+ && a.mtimeMs === b.mtimeMs && a.ctimeMs === b.ctimeMs+}++/** A history can exceed V8's single-string limit. Decode complete JSONL records, preserving raw bytes for+ * unchanged records and hashing the whole file without holding it in memory. Reads are bounded to the+ * captured length so an unexpected writer cannot make preparation run forever. */+function scanHistory(contract: ResumeRepairContract, fd: number, size: number, sessionId: string, emit?: (original: Buffer, repaired: Buffer) => void) {+ const repair = historyRepair(contract, sessionId)+ const hash = createHash('sha256')+ const chunk = Buffer.allocUnsafe(READ_BYTES)+ let fragments: Buffer[] = []+ let position = 0+ let repairedBytes = 0+ const line = (bytes: Buffer) => {+ const newline = bytes.at(-1) === 10+ const original = bytes.subarray(0, bytes.length - (newline ? 1 : 0)).toString('utf8')+ const repaired = repair.line(original)+ const output = repaired === original ? bytes : Buffer.from(repaired + (newline ? '\n' : ''))+ repairedBytes += output.length+ emit?.(bytes, output)+ }+ while (position < size) {+ const count = readSync(fd, chunk, 0, Math.min(chunk.length, size - position), position)+ if (!count) throw changedDuring(contract)+ position += count+ hash.update(chunk.subarray(0, count))+ let start = 0+ let end: number+ while ((end = chunk.indexOf(10, start)) >= 0 && end < count) {+ const part = chunk.subarray(start, end + 1)+ if (fragments.length) {+ fragments.push(part)+ line(Buffer.concat(fragments))+ fragments = []+ } else line(part)+ start = end + 1+ }+ // Copy the trailing fragment before the next read reuses the chunk buffer. In particular,+ // a multibyte UTF-8 codepoint split across reads is decoded only after its line is complete.+ if (start < count) fragments.push(Buffer.from(chunk.subarray(start, count)))+ }+ if (fragments.length) line(Buffer.concat(fragments))+ return { repairedItems: repair.finish(), repairedBytes, digest: hash.digest('hex') }+}++function writeAll(contract: ResumeRepairContract, fd: number, bytes: Buffer): void {+ let written = 0+ while (written < bytes.length) {+ const count = writeSync(fd, bytes, written, bytes.length - written)+ if (!count) throw new Error(`Could not write the prepared ${contract.names.history}`)+ written += count+ }+}++/**+ * Repair the history of `sessionId`, at `transcriptPath` or found by its id in `sessionRoots`. Call only after+ * the session's engine has stopped, before launching its resume. A private backup precedes an atomic+ * replacement.+ *+ * `repairedBytes` (set only when items were repaired) is the on-disk length of the rewritten history. A live+ * tailer of this same file must move its offset there before the engine relaunches: the repair shrinks the+ * file mid-history, which an append-only byte tail would otherwise mistake for a truncation and replay in full.+ */+export function repairHistory(contract: ResumeRepairContract, sessionId: string, transcriptPath: string | null | undefined, sessionRoots: readonly string[]):+ { repairedItems: number; repairedBytes?: number; backupPath?: string } {+ const byId = () => sessionRoots.reduce<string | null>((found, sessions) => found ?? findSessionFile(sessionId, sessions, contract.sessions), null)+ let file = transcriptPath || byId()+ // A missing history still follows the engine's existing resume/fresh fallback.+ if (!file) return { repairedItems: 0 }+ let before: ReturnType<typeof lstatSync>+ try { before = lstatSync(file) } catch (error) {+ if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error+ // The registry may still point at a history that was moved; the engine resolves the session by id.+ file = byId()+ if (!file) return { repairedItems: 0 }+ before = lstatSync(file)+ }+ const real = realpathSync(file)+ const inside = sessionRoots.some((sessions) => {+ let root: string+ try { root = realpathSync(sessions) } catch { return false }+ const rel = relative(root, real)+ return !isAbsolute(rel) && rel !== '..' && !rel.startsWith('../')+ })+ if (!before.isFile() || before.isSymbolicLink() || !inside+ || (typeof process.getuid === 'function' && before.uid !== process.getuid())) {+ throw new Error(`${contract.names.file} is outside the session profile or is not an owned regular file`)+ }+ const input = openSync(file, constants.O_RDONLY | constants.O_NOFOLLOW)+ try {+ const unchanged = () => {+ if (!sameFile(before, fstatSync(input)) || !sameFile(before, lstatSync(file!))) throw changedDuring(contract)+ }+ unchanged()+ const inspected = scanHistory(contract, input, before.size, sessionId)+ unchanged()+ if (!inspected.repairedItems) return { repairedItems: 0 }++ const suffix = randomUUID()+ const backupPath = `${file}${contract.backup}${suffix}`+ const temporary = `${file}${contract.temporary}${suffix}`+ let backup: number | undefined+ let output: number | undefined+ let verifiedBackup = false+ try {+ backup = openSync(backupPath, 'wx', 0o600)+ output = openSync(temporary, 'wx', 0o600)+ // Re-read into private files only after every record has validated. The digest proves the+ // backup and repaired output came from the exact bytes inspected, even across chunk reads.+ const copied = scanHistory(contract, input, before.size, sessionId, (original, repaired) => {+ writeAll(contract, backup!, original)+ writeAll(contract, output!, repaired)+ })+ if (copied.digest !== inspected.digest) throw changedDuring(contract)+ fsyncSync(backup)+ fsyncSync(output)+ unchanged()+ verifiedBackup = true+ renameSync(temporary, file)+ return { repairedItems: copied.repairedItems, repairedBytes: copied.repairedBytes, backupPath }+ } finally {+ if (output !== undefined) { closeSync(output); rmSync(temporary, { force: true }) }+ if (backup !== undefined) {+ closeSync(backup)+ if (!verifiedBackup) rmSync(backupPath, { force: true })+ }+ }+ } finally { closeSync(input) }+}diff --git a/cli/src/engines/launchPrep.golden.spec.ts b/cli/src/engines/launchPrep.golden.spec.tsnew file mode 100644index 000000000..f5fa6556f--- /dev/null+++ b/cli/src/engines/launchPrep.golden.spec.ts@@ -0,0 +1,520 @@+/**+ * What preparing a launch writes into a person's files, byte for byte, in every state those files are found+ * in. Recorded from the code as it stood before Claude Code's and Codex's launch preparation became declared+ * data applied by the kit (docs/design/2026-10-08-engine-launch.md, (c2)):+ *+ * - folder trust: Claude Code's `.claude.json` (`projects[<path>].hasTrustDialogAccepted`, inherited by+ * folders below) and Codex's `config.toml` (`[projects."<path>"]`, `trust_level = "trusted"`, exact only),+ * read and recorded twice, in the default, a moved and a profile's home;+ * - Codex's rollout made resumable (its reasoning items made portable), with its backup and atomic+ * replacement, and every refusal;+ * - the instruction file a harness's bootstrap goes into, and the one the saved APIs' note goes into.+ *+ * Each case keeps what was returned or thrown, and every file left behind: its bytes (a hash past 4 KiB), its+ * mode, a symlink kept or replaced, a temporary file or backup left over. Paths are placeholders.+ *+ * `RECORD_LAUNCH_PREP_GOLDEN=1` writes the fixture. Record it again only for a change meant to alter what+ * lands in a person's files, and say so in that change.+ */+import { createHash } from 'node:crypto'+import { chmodSync, lstatSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, readlinkSync, realpathSync, rmSync, symlinkSync, writeFileSync } from 'node:fs'+import { homedir, tmpdir } from 'node:os'+import { dirname, join } from 'node:path'+import { fileURLToPath } from 'node:url'+import { afterAll, beforeAll, describe, expect, it } from 'vitest'+import { env } from '../config/env.js'+import type { InstalledDsh } from '../dsh/installed.js'+import { prepareHarnessLaunch } from '../dsh/runtime.js'+import type { ApiConnections } from '../lib/apiConnections.js'+import { prepareApiInstructions } from '../lib/apiInstructions.js'+import { resetEngineHomes } from '../lib/engineHomes.js'+import { folderTrust, prepareResume, type ResumeSource } from './launchPrep.js'+import { PROCESS_ENGINES, type AgentEngine } from './types.js'++const GOLDEN = fileURLToPath(new URL('./__fixtures__/launch-prep.golden.json', import.meta.url))+const RECORD = process.env.RECORD_LAUNCH_PREP_GOLDEN === '1'+/** Permission cases mean nothing to root, which may read and write anywhere. */+const ROOT_USER = process.getuid?.() === 0++type Snapshot = Record<string, unknown>+interface Golden { trust: Record<string, unknown>; resume: Record<string, unknown>; instructions: Record<string, unknown> }++let root = ''+let savedUmask: number | null = null+const savedEnv: Record<string, string | undefined> = {}+const saved: { dataDir?: string; codexHome?: string } = {}++beforeAll(() => {+ // Files the code writes without a mode take the process's umask: the usual one, on every machine.+ try { savedUmask = process.umask(0o022) } catch { savedUmask = null }+ root = realpathSync(mkdtempSync(join(tmpdir(), 'launch-prep-golden-')))+ saved.dataDir = env.ADAPTER_DATA_DIR+ saved.codexHome = env.CODEX_HOME+ env.ADAPTER_DATA_DIR = join(root, 'data')+ mkdirSync(env.ADAPTER_DATA_DIR)+ for (const name of ['CLAUDE_CONFIG_DIR', 'CODEX_HOME']) { savedEnv[name] = process.env[name]; delete process.env[name] }+})++afterAll(() => {+ env.ADAPTER_DATA_DIR = saved.dataDir!+ env.CODEX_HOME = saved.codexHome!+ for (const [name, value] of Object.entries(savedEnv)) {+ if (value === undefined) delete process.env[name]+ else process.env[name] = value+ }+ resetEngineHomes()+ if (savedUmask !== null) process.umask(savedUmask)+ chmodTree(root)+ rmSync(root, { recursive: true, force: true })+})++/** Undo the permission cases, so the folder can be read and removed. */+function chmodTree(path: string): void {+ try {+ const stat = lstatSync(path)+ if (stat.isSymbolicLink()) return+ chmodSync(path, stat.isDirectory() ? 0o755 : 0o644)+ if (stat.isDirectory()) for (const name of readdirSync(path)) chmodTree(join(path, name))+ } catch { /* gone */ }+}++const normalize = (text: string): string => text+ .split(root).join('<root>')+ .split(homedir()).join('<home>')+ .replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g, '<uuid>')+ .split(`.harness-${process.pid}.`).join('.harness-<pid>.')++/** Every entry under `dir`: a file's bytes (or hash), its mode, a link's target, what could not be read. */+function snapshot(dir: string): Snapshot {+ const out: Snapshot = {}+ const walk = (path: string, rel: string): void => {+ let names: string[]+ try { names = readdirSync(path).sort() } catch (error) { out[rel || '.'] = { unreadable: (error as NodeJS.ErrnoException).code }; return }+ for (const name of names) {+ const full = join(path, name)+ const key = normalize(rel ? `${rel}/${name}` : name)+ const stat = lstatSync(full)+ if (stat.isSymbolicLink()) { out[key] = { link: normalize(readlinkSync(full)) }; continue }+ if (stat.isDirectory()) { out[key] = { dir: true, mode: (stat.mode & 0o777).toString(8) }; walk(full, rel ? `${rel}/${name}` : name); continue }+ const mode = (stat.mode & 0o777).toString(8)+ let bytes: Buffer+ try { bytes = readFileSync(full) } catch (error) { out[key] = { mode, unreadable: (error as NodeJS.ErrnoException).code }; continue }+ out[key] = bytes.length > 4096+ ? { mode, size: bytes.length, sha256: createHash('sha256').update(bytes).digest('hex') }+ : { mode, text: normalize(bytes.toString('utf8')) }+ }+ }+ walk(dir, '')+ return out+}++function attempt<T>(run: () => T): { value: T } | { threw: string } {+ try { return { value: run() } } catch (error) { return { threw: normalize(error instanceof Error ? error.message : String(error)) } }+}++const write = (path: string, text: string | Buffer, mode = 0o644): void => {+ mkdirSync(dirname(path), { recursive: true })+ writeFileSync(path, text)+ chmodSync(path, mode)+}++/** A fresh folder for one case, named by the case alone: a case left out (root skips the permission cases)+ * changes no other case's paths. */+const fresh = (name: string): string => {+ const dir = join(root, `case-${createHash('sha256').update(name).digest('hex').slice(0, 10)}`)+ mkdirSync(dir, { recursive: true })+ return dir+}++// ---------------------------------------------------------------------------------------------- folder trust++const TARGET = '/work/new project'+const PROBES = [TARGET, `${TARGET}/sub`, '/work', `${TARGET}x`, `${TARGET}/`]+interface TrustCase { name: string; file?: (home: string, elsewhere: string) => void; noHome?: boolean; permissions?: boolean; target?: string }++const pretty = (value: unknown): string => JSON.stringify(value, null, 2)+const CLAUDE_CASES: TrustCase[] = [+ { name: 'no file' },+ { name: 'no home folder', noHome: true },+ { name: 'empty file', file: (home) => write(join(home, '.claude.json'), '') },+ { name: 'whitespace only', file: (home) => write(join(home, '.claude.json'), ' \n') },+ { name: 'malformed JSON', file: (home) => write(join(home, '.claude.json'), '{not-json') },+ { name: 'byte order mark', file: (home) => write(join(home, '.claude.json'), '{}') },+ ...['null', '[]', '"text"', '42'].map((json) => ({ name: `JSON ${json}`, file: (home: string) => write(join(home, '.claude.json'), json) })),+ { name: 'an empty object', file: (home) => write(join(home, '.claude.json'), '{}') },+ ...['[]', '"x"', 'null', '7'].map((json) => ({ name: `projects is ${json}`, file: (home: string) => write(join(home, '.claude.json'), `{"projects":${json},"keep":1}`) })),+ { name: 'projects empty', file: (home) => write(join(home, '.claude.json'), pretty({ projects: {} })) },+ ...['"x"', '[]', 'null', 'true'].map((json) => ({ name: `the entry is ${json}`, file: (home: string) => write(join(home, '.claude.json'), `{"projects":{${JSON.stringify(TARGET)}:${json}}}`) })),+ { name: 'the entry is empty', file: (home) => write(join(home, '.claude.json'), pretty({ projects: { [TARGET]: {} } })) },+ { name: 'the entry says no', file: (home) => write(join(home, '.claude.json'), pretty({ projects: { [TARGET]: { allowedTools: ['Bash'], hasTrustDialogAccepted: false, mcpServers: { a: 1 } } } })) },+ { name: 'the entry says yes', file: (home) => write(join(home, '.claude.json'), pretty({ projects: { [TARGET]: { hasTrustDialogAccepted: true } } })) },+ { name: 'the entry says "true"', file: (home) => write(join(home, '.claude.json'), pretty({ projects: { [TARGET]: { hasTrustDialogAccepted: 'true' } } })) },+ { name: 'a parent says yes', file: (home) => write(join(home, '.claude.json'), pretty({ projects: { '/work': { hasTrustDialogAccepted: true } } })) },+ { name: 'a parent with a trailing slash says yes', file: (home) => write(join(home, '.claude.json'), pretty({ projects: { '/work//': { hasTrustDialogAccepted: true } } })) },+ { name: 'a longer sibling says yes', file: (home) => write(join(home, '.claude.json'), pretty({ projects: { '/work/new proj': { hasTrustDialogAccepted: true }, [`${TARGET}x`]: { hasTrustDialogAccepted: true } } })) },+ { name: 'a parent says no', file: (home) => write(join(home, '.claude.json'), pretty({ projects: { '/work': { hasTrustDialogAccepted: false }, '/': 'odd' } })) },+ {+ name: 'other settings', file: (home) => write(join(home, '.claude.json'),+ pretty({ numStartups: 12, theme: 'dark', note: 'café ✓ 🎉', nested: { list: [1, 2.5, null] }, projects: { '/other': { allowedTools: [], hasTrustDialogAccepted: true } } })),+ },+ { name: 'minified', file: (home) => write(join(home, '.claude.json'), JSON.stringify({ a: 1, projects: { '/other': {} } })) },+ { name: 'duplicate keys', file: (home) => write(join(home, '.claude.json'), `{"projects":{},"projects":{${JSON.stringify(TARGET)}:{"x":1}}}`) },+ { name: 'unicode target', target: '/work/café ✓ "q"', file: (home) => write(join(home, '.claude.json'), '{}') },+ {+ name: 'a symlink to dotfiles', file: (home, elsewhere) => {+ write(join(elsewhere, 'claude.json'), pretty({ projects: {} }))+ symlinkSync(join(elsewhere, 'claude.json'), join(home, '.claude.json'))+ },+ },+ { name: 'a dangling symlink', file: (home, elsewhere) => symlinkSync(join(elsewhere, 'missing.json'), join(home, '.claude.json')) },+ { name: 'a private file', file: (home) => write(join(home, '.claude.json'), '{}', 0o600) },+ { name: 'a read-only file', permissions: true, file: (home) => write(join(home, '.claude.json'), '{}', 0o444) },+ { name: 'an unreadable file', permissions: true, file: (home) => write(join(home, '.claude.json'), '{}', 0o200) },+ { name: 'a read-only folder', permissions: true, file: (home) => { write(join(home, '.claude.json'), '{}'); chmodSync(home, 0o555) } },+ { name: 'the file is a folder', file: (home) => mkdirSync(join(home, '.claude.json'), { recursive: true }) },+ { name: 'a leftover temporary file', file: (home) => { write(join(home, '.claude.json'), '{}'); write(join(home, '.claude.json.harness-1.tmp'), 'old') } },+]++const toml = (text: string) => (home: string): void => write(join(home, 'config.toml'), text)+const T = JSON.stringify(TARGET)+const CODEX_CASES: TrustCase[] = [+ { name: 'no file' },+ { name: 'no home folder', noHome: true },+ { name: 'empty file', file: toml('') },+ { name: 'settings, no newline at the end', file: toml('model = "gpt-5"') },+ { name: 'trailing blank lines and spaces', file: toml('model = "gpt-5"\n\n\n \t\n') },+ { name: 'CRLF', file: toml('model = "gpt-5"\r\n[profiles.work]\r\nmodel = "o3"\r\n') },+ { name: 'trusted already', file: toml(`[projects.${T}]\ntrust_level = "trusted"\n`) },+ { name: 'listed, untrusted', file: toml(`[projects.${T}]\ntrust_level = "untrusted"\n`) },+ { name: 'single-quoted key', file: toml(`[projects.'${TARGET}']\ntrust_level = 'trusted'\n`) },+ { name: 'spaced header', file: toml(` [ projects . ${T} ] \n trust_level = "trusted"\n`) },+ { name: 'escaped key', file: toml('[projects."/work/new\\u0020project"]\ntrust_level = "trusted"\n') },+ { name: 'a key JSON cannot read', file: toml('[projects."/work/\\U0001F600"]\ntrust_level = "trusted"\n') },+ { name: 'an inline table', file: toml('projects = { "/other" = { trust_level = "trusted" } }\n') },+ { name: 'dotted keys', file: toml('projects."/other".trust_level = "trusted"\n') },+ { name: 'a bare projects table', file: toml('[projects]\n"/other" = 1\n') },+ { name: 'other projects', file: toml(`model = "x"\n\n[projects."/other"]\ntrust_level = "trusted"\n\n[projects."/work"]\ntrust_level = "trusted"\n`) },+ { name: 'trust in a sub-table', file: toml(`[projects.${T}.sub]\ntrust_level = "trusted"\n`) },+ { name: 'trust only in the next table', file: toml(`[projects.${T}]\nnote = "x"\n[other]\ntrust_level = "trusted"\n`) },+ { name: 'a commented header', file: toml(`# [projects.${T}]\n# trust_level = "trusted"\n`) },+ { name: 'unicode, a quote, a backslash and DEL', target: '/work/q"uote\\back\x7fdel é', file: toml('model = "x"\n') },+ {+ name: 'a symlink to dotfiles', file: (home, elsewhere) => {+ write(join(elsewhere, 'config.toml'), 'model = "x"\n')+ symlinkSync(join(elsewhere, 'config.toml'), join(home, 'config.toml'))+ },+ },+ { name: 'a dangling symlink', file: (home, elsewhere) => symlinkSync(join(elsewhere, 'missing.toml'), join(home, 'config.toml')) },+ { name: 'a private file', file: (home) => write(join(home, 'config.toml'), 'model = "x"\n', 0o600) },+ { name: 'a read-only file', permissions: true, file: (home) => write(join(home, 'config.toml'), 'model = "x"\n', 0o444) },+ { name: 'an unreadable file', permissions: true, file: (home) => write(join(home, 'config.toml'), 'model = "x"\n', 0o200) },+ { name: 'a read-only folder', permissions: true, file: (home) => { write(join(home, 'config.toml'), 'model = "x"\n'); chmodSync(home, 0o555) } },+ { name: 'the file is a folder', file: (home) => mkdirSync(join(home, 'config.toml'), { recursive: true }) },+]++/** How the engine's home is found: the daemon's default, the one the person's shell moves, an agent's profile. */+type Where = 'moved' | 'default' | 'profile'++/** Claude Code's files in the (throwaway) home folder, where its `.claude.json` is by default. */+const homeFolderFiles = (): Snapshot => Object.fromEntries(Object.entries(snapshot(homedir()))+ .filter(([name]) => name.startsWith('.claude.json')).map(([name, value]) => [`<home>/${name}`, value]))+const clearHomeFolder = (): void => {+ for (const name of readdirSync(homedir())) if (name.startsWith('.claude.json')) rmSync(join(homedir(), name), { recursive: true, force: true })+}++function trustCase(engine: AgentEngine, scenario: TrustCase, where: Where): unknown {+ const dir = fresh(`${engine}-${where}-${scenario.name}`)+ const home = join(dir, 'home')+ const elsewhere = join(dir, 'elsewhere')+ mkdirSync(elsewhere)+ if (!scenario.noHome) mkdirSync(home)+ const before = { CLAUDE_CONFIG_DIR: process.env.CLAUDE_CONFIG_DIR, CODEX_HOME: process.env.CODEX_HOME, config: env.CODEX_HOME }+ try {+ if (engine === 'claude') {+ // Claude Code's `.claude.json` is in CLAUDE_CONFIG_DIR, else the home folder itself.+ if (where === 'moved') process.env.CLAUDE_CONFIG_DIR = home+ } else if (where === 'moved') process.env.CODEX_HOME = home+ else if (where === 'default') env.CODEX_HOME = home+ const inHomeFolder = engine === 'claude' && where === 'default'+ const atHome = inHomeFolder ? homedir() : home+ if (inHomeFolder) clearHomeFolder()+ scenario.file?.(atHome, elsewhere)+ const trust = folderTrust(engine, where === 'profile' ? home : null)+ const target = scenario.target ?? TARGET+ const probes = [...PROBES, target].filter((path, index, all) => all.indexOf(path) === index)+ const result = {+ before: probes.map((path) => attempt(() => trust!.trusts(path))),+ first: attempt(() => trust!.record(target)),+ second: attempt(() => trust!.record(target)),+ after: probes.map((path) => attempt(() => trust!.trusts(path))),+ files: inHomeFolder ? { ...snapshot(dir), ...homeFolderFiles() } : snapshot(dir),+ }+ if (inHomeFolder) clearHomeFolder()+ return result+ } finally {+ if (before.CLAUDE_CONFIG_DIR === undefined) delete process.env.CLAUDE_CONFIG_DIR+ else process.env.CLAUDE_CONFIG_DIR = before.CLAUDE_CONFIG_DIR+ if (before.CODEX_HOME === undefined) delete process.env.CODEX_HOME+ else process.env.CODEX_HOME = before.CODEX_HOME+ env.CODEX_HOME = before.config+ }+}++function trustCases(): Record<string, unknown> {+ const cases: Record<string, unknown> = {}+ for (const [engine, scenarios, wheres] of [+ ['claude', CLAUDE_CASES, ['moved', 'default']],+ ['codex', CODEX_CASES, ['profile', 'moved', 'default']],+ ] as const) {+ for (const scenario of scenarios) {+ for (const where of wheres) {+ // The default and moved homes need only the common states: the file's handling is the profile's.+ if (where !== wheres[0] && scenario.permissions) continue+ if (scenario.permissions && ROOT_USER) continue+ cases[`${engine} · ${where} · ${scenario.name}`] = trustCase(engine, scenario, where)+ }+ }+ }+ // An engine that asks no such question.+ for (const engine of PROCESS_ENGINES.filter((name) => name !== 'claude' && name !== 'codex')) cases[`${engine} · no folder trust`] = folderTrust(engine, '/profile')+ // A relative or `~` CLAUDE_CONFIG_DIR is not the one Claude Code would read from every folder: the home folder is.+ for (const moved of ['relative/claude', '~/claude']) {+ const dir = fresh(`claude-moved-${moved}`)+ process.env.CLAUDE_CONFIG_DIR = moved+ try {+ clearHomeFolder()+ write(join(homedir(), '.claude.json'), '{}')+ const trust = folderTrust('claude')!+ cases[`claude · moved to ${moved}`] = { first: attempt(() => trust.record(TARGET)), files: { ...snapshot(dir), ...homeFolderFiles() } }+ } finally {+ delete process.env.CLAUDE_CONFIG_DIR+ clearHomeFolder()+ }+ }+ return cases+}++// ---------------------------------------------------------------------------------------- resumable history++const SESSION = '01a0a3cd-a374-71f2-a11a-1fc1cc41b36d'+const record = (type: string, payload: unknown): string => JSON.stringify({ timestamp: '2026-10-08T06:43:10.580Z', type, payload })+const meta = (id = SESSION) => record('session_meta', { id, cwd: '/workspace', model_provider: 'openai' })+const summary = [{ type: 'summary_text', text: 'Prior summary.' }]+const reasoning = (extra: Record<string, unknown> = {}) => ({ type: 'reasoning', id: 'msg_aY9suLof0GA06VzeKPXLM7rj', summary, content: [], ...extra })+const message = { type: 'message', id: 'msg_1', role: 'assistant', content: [{ type: 'output_text', text: 'Hello ✓.' }] }+const item = (payload: unknown): string => record('response_item', payload)+const rolloutName = (id = SESSION) => `rollout-2026-10-08T06-43-10-${id}.jsonl`++interface ResumeCase {+ name: string+ /** The rollout's text; null for none. */+ text?: string | Buffer | null+ /** Where the rollout is, under the case folder. */+ at?: string+ /** What the source says. */+ source?: (dir: string) => Partial<ResumeSource>+ setup?: (dir: string) => void+}++const LONG = (() => {+ // Past one 64 KiB read, with a three-byte character across the boundary and a repair after it.+ const head = `${meta()}\n${item(message)}\n`+ const filler = 'é'.repeat(70_000)+ return `${head}${record('event_msg', { type: 'agent_message', message: filler })}\n${item(reasoning({ content: [{ text: 'late' }] }))}\n`+})()++const RESUME_CASES: ResumeCase[] = [+ { name: 'another engine', source: () => ({ engine: 'claude' }), text: `${meta()}\n${item(reasoning())}\n` },+ { name: 'no session id', source: () => ({ sessionId: '' }), text: `${meta()}\n${item(reasoning())}\n` },+ { name: 'a reasoning id', text: `${meta()}\n${item(reasoning())}\n${item(message)}\n` },+ { name: 'nothing to repair', text: `${meta()}\n${item(message)}\n${item({ type: 'reasoning', summary, content: [] })}\n` },+ { name: 'reasoning content becomes the summary', text: `${meta()}\n${item(reasoning({ summary: [], content: [{ text: 'one ' }, { type: 'x', text: 'two' }, 'odd', { text: 3 }] }))}\n` },+ { name: 'content beside a summary', text: `${meta()}\n${item(reasoning({ content: [{ text: 'dup' }] }))}\n` },+ { name: 'content with no text', text: `${meta()}\n${item(reasoning({ id: undefined, summary: [], content: [{ type: 'x' }] }))}\n` },+ { name: 'encrypted reasoning kept', text: `${meta()}\n${item(reasoning({ encrypted_content: 'opaque', content: [{ text: 'v' }] }))}\n` },+ {+ name: 'compacted history and other records',+ text: `${meta()}\n${record('compacted', { message: 'sum', replacement_history: [reasoning(), message, 'odd', null] })}\n`+ + `${record('compacted', { message: 'none' })}\n${record('event_msg', { type: 'agent_reasoning', metadata: reasoning() })}\n${record('turn_context', { cwd: '/w' })}\n`,+ },+ { name: 'CRLF, blank lines and no newline at the end', text: `${meta()}\r\n\r\n${item(reasoning())}\r\n \n${item(reasoning({ id: 'rs_2' }))}` },+ { name: 'past one read', text: LONG },+ { name: 'another session\'s rollout', text: `${meta('ffffffff-0000-0000-0000-000000000000')}\n${item(reasoning())}\n` },+ { name: 'no session metadata first', text: `${item(reasoning())}\n${meta()}\n` },+ { name: 'session metadata with no payload', text: `${record('session_meta', null)}\n` },+ { name: 'invalid JSON', text: `${meta()}\n${item(reasoning())}\n{"type": "response_item", "payload": {"text": "secret words"\n` },+ { name: 'a record that is not an object', text: `${meta()}\n[1,2]\n` },+ { name: 'an empty rollout', text: '' },+ { name: 'blank lines only', text: '\n\n' },+ { name: 'no rollout at all', text: null, source: () => ({ transcriptPath: null }) },+ { name: 'found by id', source: () => ({ transcriptPath: null }), text: `${meta()}\n${item(reasoning())}\n` },+ { name: 'a stale path, found by id', source: (dir) => ({ transcriptPath: join(dir, 'profile/sessions/old/gone.jsonl') }), text: `${meta()}\n${item(reasoning())}\n` },+ { name: 'a stale path, nothing by id', source: (dir) => ({ transcriptPath: join(dir, 'profile/sessions/old/gone.jsonl'), sessionId: 'abcdefab-0000-0000-0000-00000000dead' }), text: `${meta()}\n${item(reasoning())}\n` },+ { name: 'an id too short to look up', source: () => ({ transcriptPath: null, sessionId: 'short' }), text: `${meta('short')}\n${item(reasoning())}\n` },+ {+ name: 'outside the profile', source: (dir) => ({ transcriptPath: join(dir, 'elsewhere', rolloutName()) }),+ setup: (dir) => write(join(dir, 'elsewhere', rolloutName()), `${meta()}\n${item(reasoning())}\n`), text: null,+ },+ {+ name: 'a symlinked rollout', text: null, source: (dir) => ({ transcriptPath: join(dir, 'profile/sessions/2026/10/08', rolloutName()) }),+ setup: (dir) => {+ write(join(dir, 'profile/sessions/real.jsonl'), `${meta()}\n${item(reasoning())}\n`)+ mkdirSync(join(dir, 'profile/sessions/2026/10/08'), { recursive: true })+ symlinkSync(join(dir, 'profile/sessions/real.jsonl'), join(dir, 'profile/sessions/2026/10/08', rolloutName()))+ },+ },+ { name: 'a folder where the rollout is', text: null, source: (dir) => ({ transcriptPath: join(dir, 'profile/sessions') }), setup: (dir) => mkdirSync(join(dir, 'profile/sessions'), { recursive: true }) },+ { name: 'a world-readable rollout', text: `${meta()}\n${item(reasoning())}\n`, setup: () => undefined },+ { name: 'a leftover backup and temporary file', text: `${meta()}\n${item(reasoning())}\n`, setup: (dir) => write(join(dir, 'profile/sessions/2026/10/08', `${rolloutName()}.reasoning-tmp-old`), 'x') },+]++/** Where the agent's Codex home is: its own profile, the daemon's, or one the person moved (remembered). */+function resumeCase(scenario: ResumeCase, where: Where): unknown {+ const dir = fresh(`resume-${where}-${scenario.name}`)+ const home = join(dir, where === 'profile' ? 'profile' : where === 'default' ? 'daemon' : 'moved')+ mkdirSync(join(home, 'sessions'), { recursive: true })+ mkdirSync(join(dir, 'elsewhere'), { recursive: true })+ const before = env.CODEX_HOME+ resetEngineHomes()+ try {+ if (where === 'default') env.CODEX_HOME = home+ else env.CODEX_HOME = join(dir, 'daemon-empty')+ if (where === 'moved') writeFileSync(join(env.ADAPTER_DATA_DIR, 'engine-homes.json'), JSON.stringify({ claude: [], codex: [home] }) + '\n')+ else rmSync(join(env.ADAPTER_DATA_DIR, 'engine-homes.json'), { force: true })+ const file = join(home, 'sessions/2026/10/08', rolloutName())+ if (scenario.text !== null && scenario.text !== undefined) write(file, scenario.text, scenario.name === 'a world-readable rollout' ? 0o644 : 0o600)+ // Only the profile's cases name paths of their own (setup, source); the others run in their own home.+ scenario.setup?.(dir)+ const source: ResumeSource = { engine: 'codex', sessionId: SESSION, transcriptPath: file, codexHome: where === 'profile' ? home : null, ...scenario.source?.(dir) }+ const result = attempt(() => prepareResume(source))+ return { result: JSON.parse(normalize(JSON.stringify(result))), files: snapshot(dir) }+ } finally {+ env.CODEX_HOME = before+ rmSync(join(env.ADAPTER_DATA_DIR, 'engine-homes.json'), { force: true })+ resetEngineHomes()+ }+}++function resumeCases(): Record<string, unknown> {+ const cases: Record<string, unknown> = {}+ for (const scenario of RESUME_CASES) cases[`profile · ${scenario.name}`] = resumeCase(scenario, 'profile')+ for (const name of ['a reasoning id', 'found by id', 'nothing to repair', 'no rollout at all']) {+ const scenario = RESUME_CASES.find((candidate) => candidate.name === name)!+ for (const where of ['default', 'moved'] as const) cases[`${where} · ${name}`] = resumeCase(scenario, where)+ }+ return cases+}++// ------------------------------------------------------------------------------------- instruction files++const INSTRUCTION_FILES = ['CLAUDE.md', 'AGENTS.md', 'AGENTS.override.md', 'GEMINI.md', '.hermes.md', '.cursorrules']+const WORKSPACE_STATES: Record<string, Record<string, string>> = {+ 'an empty workspace': {},+ 'CLAUDE.md': { 'CLAUDE.md': '# Claude rules' },+ 'AGENTS.md': { 'AGENTS.md': '# Shared rules\n' },+ 'CLAUDE.md and AGENTS.md': { 'CLAUDE.md': '# Claude rules\n', 'AGENTS.md': '# Shared rules\n' },+ 'CLAUDE.md importing AGENTS.md': { 'CLAUDE.md': '# Claude rules\n @AGENTS.md \n', 'AGENTS.md': '# Shared rules\n' },+ 'AGENTS.override.md and AGENTS.md': { 'AGENTS.override.md': '# Override', 'AGENTS.md': '# Shared rules' },+ 'GEMINI.md and .hermes.md': { 'GEMINI.md': '# Gemini', '.hermes.md': '# Hermes' },+}++function harnessPackage(dir: string): InstalledDsh {+ const pkg = join(dir, 'package')+ write(join(pkg, 'AGENTS.md'), '# Draw\nRead the draw skill.\n')+ write(join(pkg, 'skills/draw/SKILL.md'), '# Draw skill\n')+ return {+ id: 'acme/draw', dir: pkg, realDir: pkg, source: pkg, ref: null, commit: null, linked: true, installedAt: 1,+ manifest: { spec: 1, id: 'acme/draw', name: 'Drawing', engine: 'claude', agent: { instructions: 'AGENTS.md', skills: ['skills'] } },+ } as InstalledDsh+}++function instructionFiles(ws: string): Snapshot {+ const all = snapshot(ws)+ return Object.fromEntries(Object.entries(all).filter(([name]) => INSTRUCTION_FILES.includes(name)))+}++function instructionCases(): Record<string, unknown> {+ const cases: Record<string, unknown> = {}+ const deep = new Set<AgentEngine>(['claude', 'codex', 'opencode', 'hermes'])+ for (const engine of PROCESS_ENGINES) {+ for (const [state, files] of Object.entries(WORKSPACE_STATES)) {+ if (!deep.has(engine) && state !== 'an empty workspace' && state !== 'AGENTS.md') continue+ const dir = fresh(`harness-${engine}-${state}`)+ const ws = join(dir, 'workspace')+ mkdirSync(ws)+ for (const [name, text] of Object.entries(files)) write(join(ws, name), text)+ const pkg = harnessPackage(dir)+ const first = attempt(() => { prepareHarnessLaunch(pkg, ws, engine, 'runtime-1'); return 'prepared' })+ const after = instructionFiles(ws)+ const second = attempt(() => { prepareHarnessLaunch(pkg, ws, engine, 'runtime-1'); return 'prepared' })+ cases[`harness · ${engine} · ${state}`] = { first, second, after, again: instructionFiles(ws) }+ }+ }+ // An edited bootstrap is refused, and a symlinked instruction file is never replaced.+ for (const engine of ['claude', 'codex'] as const) {+ const file = engine === 'claude' ? 'CLAUDE.md' : 'AGENTS.md'+ const dir = fresh(`harness-${engine}-edited`)+ const ws = join(dir, 'workspace')+ mkdirSync(ws)+ write(join(ws, file), '# Rules\n<!-- harness:runtime v1 -->\nedited\n')+ cases[`harness · ${engine} · an edited bootstrap`] = { first: attempt(() => prepareHarnessLaunch(harnessPackage(dir), ws, engine, 'runtime-1') && 'prepared'), after: instructionFiles(ws) }+ const linked = fresh(`harness-${engine}-linked`)+ const lws = join(linked, 'workspace')+ mkdirSync(lws)+ write(join(linked, 'shared.md'), '# Shared\n')+ symlinkSync(join(linked, 'shared.md'), join(lws, file))+ cases[`harness · ${engine} · a symlinked instruction file`] = { first: attempt(() => prepareHarnessLaunch(harnessPackage(linked), lws, engine, 'runtime-1') && 'prepared'), after: instructionFiles(lws), shared: snapshot(linked)['shared.md'] }+ }+ // The saved APIs' note.+ const withApis = { list: () => [{ id: 'openrouter' }] } as unknown as ApiConnections+ const noApis = { list: () => [] } as unknown as ApiConnections+ const states: Record<string, (ws: string, file: string) => void> = {+ 'no file': () => undefined,+ 'a file of the person\'s': (ws, file) => write(join(ws, file), '# Mine\n\n\n'),+ 'a file already noted': (ws, file) => write(join(ws, file), '# Mine\n<!-- harness:apis -->\nold note\n'),+ 'a symlinked file': (ws, file) => { write(join(ws, '..', 'target.md'), '# Target\n'); symlinkSync(join(ws, '..', 'target.md'), join(ws, file)) },+ 'a folder by that name': (ws, file) => mkdirSync(join(ws, file)),+ }+ for (const engine of [...PROCESS_ENGINES, 'terminal', 'gemini']) {+ for (const [state, setup] of Object.entries(states)) {+ if (engine !== 'claude' && engine !== 'codex' && engine !== 'gemini' && state !== 'no file') continue+ for (const [apis, store] of [['saved APIs', withApis], ['no saved APIs', noApis]] as const) {+ if (apis === 'no saved APIs' && state !== 'no file') continue+ const dir = fresh(`apis-${engine}-${state}-${apis}`)+ const ws = join(dir, 'workspace')+ mkdirSync(ws)+ const file = engine === 'claude' ? 'CLAUDE.md' : engine === 'gemini' ? 'GEMINI.md' : 'AGENTS.md'+ setup(ws, file)+ const first = attempt(() => { prepareApiInstructions(store, ws, engine); return 'done' })+ const second = attempt(() => { prepareApiInstructions(store, ws, engine); return 'done' })+ cases[`apis · ${engine} · ${state} · ${apis}`] = { first, second, files: snapshot(dir) }+ }+ }+ }+ return cases+}++describe('launch preparation writes what it did before Claude Code and Codex declared it', () => {+ it('folder trust, resumable history and instruction files match the record', () => {+ const actual: Golden = { trust: trustCases(), resume: resumeCases(), instructions: instructionCases() }+ if (RECORD) {+ if (ROOT_USER) throw new Error('record as a user other than root: the permission cases are part of the record')+ const block = (cases: Record<string, unknown>): string => Object.entries(cases).map(([key, value]) => ` ${JSON.stringify(key)}: ${JSON.stringify(value)}`).join(',\n')+ writeFileSync(GOLDEN, `{\n"trust": {\n${block(actual.trust)}\n},\n"resume": {\n${block(actual.resume)}\n},\n"instructions": {\n${block(actual.instructions)}\n}\n}\n`)+ return+ }+ const golden = JSON.parse(readFileSync(GOLDEN, 'utf8')) as Golden+ for (const section of ['trust', 'resume', 'instructions'] as const) {+ // Compared case by case, so a failure names it. Root skips the permission cases it cannot reproduce.+ const expected = Object.keys(golden[section]).filter((key) => !ROOT_USER || key in actual[section])+ expect(Object.keys(actual[section]).sort(), section).toEqual(expected.sort())+ for (const key of expected) expect(actual[section][key], `${section} · ${key}`).toEqual(golden[section][key])+ }+ }, 120_000)++ it('records no machine-specific path', () => {+ const text = readFileSync(GOLDEN, 'utf8')+ expect(text).not.toContain(tmpdir())+ expect(text).not.toMatch(/\/Users\/|\/home\/runner/)+ })+})diff --git a/cli/src/engines/launchPrep.ts b/cli/src/engines/launchPrep.tsnew file mode 100644index 000000000..afced0349--- /dev/null+++ b/cli/src/engines/launchPrep.ts@@ -0,0 +1,60 @@+/**+ * What a launch prepares in the person's files before the engine starts: the folder trust an engine asks+ * about, and a conversation's history made resumable. Composed from each engine's launch contract (data,+ * engines/{claude,codex}/launch.ts) and the kit's mechanics (kit/folderTrust.ts, kit/resumeRepair.ts), so the+ * launch paths (core/agents/create.ts, launches.ts, launch.ts) name no engine. Both run in core, in line: a+ * launch is session control and waits on no engine worker (docs/design/2026-10-08-engine-launch.md).+ */+import { join } from 'node:path'+import { homeRoots, launchHomeOf } from '../lib/engineHomes.js'+import { recordTrustIn, trustsIn } from './kit/folderTrust.js'+import { repairHistory } from './kit/resumeRepair.js'+import { launchContract } from './launches.js'+import type { AgentEngine } from './types.js'++/** An engine's answer to "do you trust this folder?", read and recorded where the engine keeps it. */+export interface FolderTrust {+ /** Whether the engine already trusts `path`. */+ trusts(path: string): boolean+ /** Record trust in `path`: never removes anything, and leaves a file it cannot safely extend alone. */+ record(path: string): 'trusted' | 'already' | 'skipped'+}++/**+ * The folder trust of `engine` launched now, in `profile` (an agent's own engine home) where its home takes+ * one; null for an engine that asks no such question. The home is found at each call, as the person's shell+ * may have moved it since.+ */+export function folderTrust(engine: AgentEngine, profile?: string | null): FolderTrust | null {+ const trust = launchContract(engine)?.trust+ if (!trust) return null+ const file = (): string => join(launchHomeOf(trust.home, profile), trust.file)+ return { trusts: (path) => trustsIn(trust, file(), path), record: (path) => recordTrustIn(trust, file(), path) }+}++/** The session a resume relaunches. `codexHome` is the agent's own engine home, the row's profile. */+export interface ResumeSource {+ engine: string+ sessionId: string+ transcriptPath?: string | null+ codexHome?: string | null+}++/**+ * Make a stopped conversation's history resumable, before the engine is launched on it. `repairedBytes`,+ * set only when something was repaired, is the history's new length: a tail of that file moves there.+ */+export function prepareResume(source: ResumeSource): { repairedItems: number; repairedBytes?: number; backupPath?: string } {+ const contract = launchContract(source.engine)?.resumeRepair+ if (!contract || !source.sessionId) return { repairedItems: 0 }+ // The agent's own profile, else every home the person moved too (lib/engineHomes.ts): a rollout in a moved+ // CODEX_HOME was refused as outside the profile, so a restart or reopen failed after Codex had stopped.+ const { home, folder } = contract.sessions+ const roots = (source.codexHome ? [source.codexHome] : homeRoots(home.setting)).map((root) => join(root, folder))+ return repairHistory(contract, source.sessionId, source.transcriptPath, roots)+}++/** What `prepareResume` repairs in `engine`'s history, in the daemon's log's words. */+export function repairedItemsName(engine: string): string {+ return launchContract(engine)?.resumeRepair?.names.items ?? 'items'+}diff --git a/cli/src/engines/launches.ts b/cli/src/engines/launches.tsindex 6f8eec75e..0642884a6 100644--- a/cli/src/engines/launches.ts+++ b/cli/src/engines/launches.ts@@ -13,11 +13,16 @@ import { launchHome } from '../lib/engineHomes.js'export const engineLaunches = { claude, codex } satisfies Record<string, EngineLaunch>type MigratedEngine = keyof typeof engineLaunches-/** An engine's launch contract, for an engine that declares one. */-export function launchContract(engine: AgentEngine): EngineLaunch | undefined {+/** An engine's launch contract, for an engine that declares one. Any name: a session row's engine is a string. */+export function launchContract(engine: AgentEngine | string): EngineLaunch | undefined {return Object.hasOwn(engineLaunches, engine) ? engineLaunches[engine as MigratedEngine] : undefined}+/** The instruction file Harness writes its own notes into for `engine`, where it declares one. */+export function instructionFileOf(engine: AgentEngine | string): string | undefined {+ return launchContract(engine)?.instructionFile+}+/** Compatibility tables take their migrated entries from the same launch contract. */export function launchField<K extends keyof EngineLaunch>(key: K): Record<MigratedEngine, EngineLaunch[K]> {return Object.fromEntries(Object.entries(engineLaunches).map(([name, launch]) => [name, launch[key]])) as Record<MigratedEngine, EngineLaunch[K]>diff --git a/cli/src/lib/apiInstructions.ts b/cli/src/lib/apiInstructions.tsindex f4c64fdf6..54fa3ea5e 100644--- a/cli/src/lib/apiInstructions.ts+++ b/cli/src/lib/apiInstructions.ts@@ -2,6 +2,7 @@import { existsSync, lstatSync, readFileSync, writeFileSync } from 'node:fs'import { join } from 'node:path'import type { ApiConnections } from './apiConnections.js'+import { instructionFileOf } from '../engines/launches.js'const marker = '<!-- harness:apis -->'export const API_INSTRUCTIONS = `${marker}@@ -20,7 +21,7 @@ Adding an API does not change this harness's model or subscription.* no global agent settings or credentials are written into the project. */export function prepareApiInstructions(store: ApiConnections, workspace: string, engine: string): void {if (engine === 'terminal' || !store.list().length) return- const name = engine === 'claude' ? 'CLAUDE.md' : engine === 'gemini' ? 'GEMINI.md' : 'AGENTS.md'+ const name = instructionFileOf(engine) ?? (engine === 'gemini' ? 'GEMINI.md' : 'AGENTS.md')const file = join(workspace, name)if (existsSync(file) && (!lstatSync(file).isFile() || lstatSync(file).isSymbolicLink())) returnconst previous = existsSync(file) ? readFileSync(file, 'utf8') : ''diff --git a/cli/src/lib/claudeTrust.ts b/cli/src/lib/claudeTrust.tsdeleted file mode 100644index b4590c9ca..000000000--- a/cli/src/lib/claudeTrust.ts+++ /dev/null@@ -1,128 +0,0 @@-/**- * Claude Code asks "do you trust this folder?" the first time it opens a project. For a workspace- * Harness itself just made EMPTY — a fresh `~/harnesses/codex-2026-09-17-15-26`, or one a harness- * template was laid into — there is nothing in it to review, so the daemon records the answer the way- * Claude Code does: `projects[<path>].hasTrustDialogAccepted` in `~/.claude.json`.- *- * In the config the engine launched there actually reads (lib/engineHomes.ts): `.claude.json` in a moved- * CLAUDE_CONFIG_DIR, and `config.toml` in the agent's own Codex profile or a moved CODEX_HOME. Both were- * read and written in the default places alone, and such an agent got the trust prompt anyway.- *- * ⚠️ Never for a folder with content the person has not been asked about — a clone, their own repo,- * a worktree of one: that answer is theirs. The callers decide; see `backendSocket.ts` (project- * folders) and `cli.ts` (harness templates). A worktree only inherits the answer its source repo- * already has.- *- * Only ever ADDS trust, never removes anything, and does nothing when Claude Code has never run here- * (no `~/.claude.json`), when the file does not parse, or when the entry already says yes.- */-import { existsSync, readFileSync, realpathSync, renameSync, writeFileSync } from 'node:fs'-import { join } from 'node:path'-import { launchClaudeConfigDir, launchCodexHome } from './engineHomes.js'--function isPlainObject(value: unknown): value is Record<string, unknown> {- return typeof value === 'object' && value !== null && !Array.isArray(value)-}--/**- * Replace a config file atomically, THROUGH a symlink. Dotfile managers keep `~/.claude.json` and- * `~/.codex/config.toml` as links into a repo; renaming a temporary file over the link itself would- * swap it for a plain file and quietly detach the person's dotfiles.- */-function replaceConfigFile(file: string, text: string): void {- const target = realpathSync(file)- const tmp = `${target}.harness-${process.pid}.tmp`- writeFileSync(tmp, text, { mode: 0o600 })- renameSync(tmp, target)-}--/** `home`: the folder holding the `.claude.json` Claude Code reads (CLAUDE_CONFIG_DIR, else the home folder). */-export function preTrustClaudeProject(cwd: string, home = launchClaudeConfigDir()): 'trusted' | 'already' | 'skipped' {- const file = join(home, '.claude.json')- if (!existsSync(file)) return 'skipped'- let config: unknown- try {- config = JSON.parse(readFileSync(file, 'utf8'))- } catch {- return 'skipped'- }- // Anything but the shape Claude Code writes is left exactly as it is: writing trust into an array,- // or spreading a string entry into an object, would rewrite what the person has.- if (!isPlainObject(config)) return 'skipped'- if (config.projects !== undefined && !isPlainObject(config.projects)) return 'skipped'- const projects = (config.projects ?? {}) as Record<string, unknown>- const existing = projects[cwd]- if (existing !== undefined && !isPlainObject(existing)) return 'skipped'- if (existing?.hasTrustDialogAccepted === true) return 'already'- projects[cwd] = { allowedTools: [], ...(existing ?? {}), hasTrustDialogAccepted: true }- config.projects = projects- replaceConfigFile(file, JSON.stringify(config, null, 2))- return 'trusted'-}--/** Whether Claude Code already trusts `path`: its own entry, or a folder above it, says yes — the- * same inheritance Claude Code applies. Unreadable or absent config reads as no. */-export function claudeTrusts(path: string, home = launchClaudeConfigDir()): boolean {- const file = join(home, '.claude.json')- if (!existsSync(file)) return false- let config: unknown- try { config = JSON.parse(readFileSync(file, 'utf8')) } catch { return false }- if (!isPlainObject(config) || !isPlainObject(config.projects)) return false- for (const [key, entry] of Object.entries(config.projects)) {- if (!isPlainObject(entry) || entry.hasTrustDialogAccepted !== true) continue- const base = key.replace(/\/+$/, '')- if (path === base || path.startsWith(`${base}/`)) return true- }- return false-}--/** A `[projects.<key>]` header, however it is spaced or quoted. */-const CODEX_PROJECT_HEADER_RE = /^[ \t]*\[[ \t]*projects[ \t]*\.[ \t]*("(?:[^"\\\r\n]|\\.)*"|'[^'\r\n]*')[ \t]*\]/gm-/** `projects` defined any other way: an inline table, dotted keys, or a bare `[projects]` table. */-const CODEX_PROJECTS_OTHERWISE_RE = /^[ \t]*(?:projects[ \t]*[.=]|\[[ \t]*projects[ \t]*\])/m--/** The key a quoted TOML key names; null for an escape JSON does not share (`\U0001F600`). */-function tomlKey(quoted: string): string | null {- if (quoted.startsWith("'")) return quoted.slice(1, -1)- try { return JSON.parse(quoted) as string } catch { return null }-}--/** Whether Codex already trusts exactly `path` (a `[projects."<path>"]` table saying `trusted`), in the- * config of the agent's own profile (`codexHome`) or, without one, of the Codex home a launch uses. */-export function codexTrusts(path: string, codexHome?: string | null): boolean {- const file = join(launchCodexHome(codexHome), 'config.toml')- if (!existsSync(file)) return false- const text = readFileSync(file, 'utf8')- for (const match of text.matchAll(CODEX_PROJECT_HEADER_RE)) {- if (tomlKey(match[1]) !== path) continue- // The table's body runs to the next header; its trust_level is the answer.- const rest = text.slice((match.index ?? 0) + match[0].length)- const body = rest.split(/^[ \t]*\[/m)[0]- return /^[ \t]*trust_level[ \t]*=[ \t]*["']trusted["']/m.test(body)- }- return false-}--/**- * Codex keeps the same answer in `<CODEX_HOME>/config.toml` as a `[projects."<path>"]` table with- * `trust_level = "trusted"`. Same rules: only a folder the daemon made empty (or a worktree of one Codex- * already trusts), only when Codex has a config here, never rewriting what is there — the table is- * appended at the end.- *- * Appending is only safe when nothing else defines that table. The same folder under another quoting,- * or `projects` written as an inline table or dotted keys, would make the appended table a duplicate- * definition — a config.toml Codex refuses to load. Those are left alone.- */-export function preTrustCodexProject(cwd: string, codexHome?: string | null): 'trusted' | 'already' | 'skipped' {- const file = join(launchCodexHome(codexHome), 'config.toml')- if (!existsSync(file)) return 'skipped'- const text = readFileSync(file, 'utf8')- const keys = [...text.matchAll(CODEX_PROJECT_HEADER_RE)].map((match) => tomlKey(match[1]))- if (keys.includes(cwd)) return 'already'- // A key this cannot read might be this folder spelled another way: not safe to append after.- if (keys.includes(null) || CODEX_PROJECTS_OTHERWISE_RE.test(text)) return 'skipped'- // A TOML basic string is a JSON string, except that DEL must be escaped too.- const header = `[projects.${JSON.stringify(cwd).replace(/\x7f/g, '\\u007f')}]`- replaceConfigFile(file, `${text.replace(/\s*$/, '')}\n\n${header}\ntrust_level = "trusted"\n`)- return 'trusted'-}diff --git a/cli/src/lib/engineHomes.ts b/cli/src/lib/engineHomes.tsindex 3fbff18c7..bb25237e4 100644--- a/cli/src/lib/engineHomes.ts+++ b/cli/src/lib/engineHomes.ts@@ -23,6 +23,7 @@ import { homedir } from 'node:os'import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path'import { env } from '../config/env.js'import type { FolderSetting } from '../engines/facets/hooks.js'+import type { LaunchHome } from '../engines/facets/launch.js'import { loginShellEnvironment } from './loginShellEnv.js'const claudeHomes: string[] = []@@ -104,6 +105,15 @@ export function codexHomeRoots(own: string): string[] {return [own, ...codexHomes]}+/** The homes a setting's moves are remembered in, by setting: CODEX_HOME's are adopted above. */+const movedBySetting: Partial<Record<FolderSetting, string[]>> = { CODEX_HOME: codexHomes }++/** Every home a daemon setting names: the daemon's own, then each one the person moved and Harness adopted. */+export function homeRoots(setting: FolderSetting): string[] {+ load()+ return [env[setting], ...(movedBySetting[setting] ?? [])]+}+/*** The environment an engine launched now starts with, as far as its homes go. Every pane runs the engine* through the person's login shell, which reads their profile, so the login shell's variables outrank the@@ -166,7 +176,12 @@ export function sessionClaudeHome(session: { transcriptPath?: string | null }):* written in `~/.claude.json` alone, which a moved Claude Code never reads.*/export function launchClaudeConfigDir(environment: NodeJS.ProcessEnv = launchEnvironment()): string {- return movedHome(environment.CLAUDE_CONFIG_DIR) || homedir()+ return launchHomeOf({ variable: 'CLAUDE_CONFIG_DIR', otherwise: 'home' }, null, environment)+}++/** The home an engine's launch contract declares (engines/facets/launch.ts `LaunchHome`), for a launch made now. */+export function launchHomeOf(home: LaunchHome, profile: string | null | undefined, environment: NodeJS.ProcessEnv = launchEnvironment()): string {+ return 'setting' in home ? launchHome(home.setting, profile, environment) : movedHome(environment[home.variable]) || homedir()}/** Test seam: forget every home, and read the data folder's again on next use. */diff --git a/docs/design/2026-10-08-engine-launch.md b/docs/design/2026-10-08-engine-launch.mdindex 5b3b4d034..5a834015f 100644--- a/docs/design/2026-10-08-engine-launch.md+++ b/docs/design/2026-10-08-engine-launch.md@@ -7,7 +7,7 @@ declares what it needs as data on its launch contract (`Engine.launch`, `enginesShared mechanics in `engines/kit` read that data, and core runs them in line.(c) is too large to land as one change. It is split into five sub-batches, each green on its own. This-document records (c1), which is done, and plans the other four.+document records (c1) and (c2), which are done, and plans the other three.## (c1) Launch argv and the pane script: done@@ -90,7 +90,86 @@ files. It also checks two sets of closures:- **The launch callers** (create, fork, restart, swap, the resume service) reach only those contracts, thehook contracts, and `engines/codex/rollout.ts`. The registry still holds `rollout.ts` until (c4).-`core/agents/launch.ts` still imports `engines/codex/portableHistory.ts`. That is (c2).+`core/agents/launch.ts` still imported `engines/codex/portableHistory.ts`, until (c2) below.++## (c2) Launch preparation: done++| Was | Now |+| --- | --- |+| `lib/claudeTrust.ts`: Claude Code's `.claude.json` and Codex's `config.toml` folder trust, read and recorded | `EngineLaunch.trust`: the home (`LaunchHome`: a daemon setting with an agent's profile, or a variable else the home folder), the file and the format. Claude declares `json` (the projects key, the accepted flag, a new entry's defaults; a yes covers the folders below). Codex declares `toml` (the table, key and value; exact folders only). `engines/kit/folderTrust.ts` reads and writes both, through a symlink, atomically. |+| The `engine === 'claude'` and `engine === 'codex'` trust branches in `core/agents/create.ts` and `launches.ts` | `engines/launchPrep.ts` `folderTrust(engine, profile)`: null for an engine that asks no such question |+| `engines/codex/portableHistory.ts`, Codex's rollout made resumable | `EngineLaunch.resumeRepair`: where histories are and how one is found by id, the record that names the session, the records whose items are replayed, the repair (`portable-reasoning`, the relay's contract), the backup and temporary suffixes, and the names in messages and the log. `engines/kit/resumeRepair.ts` applies it with the same bounded reads, digest, backup and atomic rename. `engines/launchPrep.ts` `prepareResume` is what `core/agents/launch.ts` calls. |+| `engines/codex/rollout.ts`'s rollout lookup | The kit's `findSessionFile` on the same declared rule. The registry still calls `resolveCodexRollout` until (c4), which now delegates. |+| The instruction-file fallbacks in `dsh/runtime.ts` (`CLAUDE.md`, and Claude's `@AGENTS.md` import line) and `lib/apiInstructions.ts` | `EngineLaunch.instructionFile` and `instructionImport` (Claude); others keep AGENTS.md. |++`lib/engineHomes.ts` gains `launchHomeOf` (the declared home, at launch) and `homeRoots` (a setting's own home+and every one the person moved). `launchClaudeConfigDir` is now one case of it. The daemon's resume log line+names what was repaired in the contract's words, unchanged.++### The same bytes++**Golden record.** `engines/launchPrep.golden.spec.ts` was recorded in its own commit, before the change,+through a composition of the former code. It holds:++- **166 folder-trust cases.** Each answers five probe paths before and after, and records twice.+ - Claude Code's `.claude.json` in 40 states: none, empty, malformed, a byte order mark, JSON scalars,+ `projects` of every type, entries of every shape, a parent's trust, a trailing slash, a longer sibling,+ other settings, minified, duplicate keys, unicode, symlinks (kept), dangling, read-only, unreadable, a+ read-only folder, a folder, a private file, a leftover temporary file. Each in a moved and the default home.+ - Codex's `config.toml` in 27 states: none, empty, no final newline, CRLF, trusted, untrusted, quoted,+ single-quoted, spaced and escaped keys, a key JSON cannot read, inline, dotted and bare `projects`,+ other projects, sub-tables, a commented header, a path with a quote, a backslash, DEL and unicode,+ symlinks, permissions. Each in a profile, a moved and the default home.+ - A relative or `~` CLAUDE_CONFIG_DIR, and every engine that asks no such question.+- **36 resume repairs**:+ - repairs, nothing to repair, content into the summary, compaction, encrypted reasoning;+ - CRLF, blank lines, no final newline, past one 64 KiB read with a character across it;+ - every refusal; found by id, stale paths;+ - a symlinked or outside rollout, a folder, a world-readable file.++ They run in the profile's home, and four of them in the daemon's and a moved home as well.+- **96 instruction-file cases:** a harness's bootstrap for every engine and the workspace states that pick+ a file, and the saved APIs' note for every engine plus `terminal` and `gemini`.++Each case keeps what was returned or thrown, and every file: bytes (a hash past 4 KiB), mode, symlinks,+leftover temporary files and backups. The spec passes unchanged against the kit. These mutations each fail it:++- Claude's entry defaults, its import line, its instruction file or its home variable;+- Codex's trust value, its backup suffix, its compaction rule, its session id field or its file name;+- the kit's blank line before an appended table, its trust inheritance, its write mode, or its lookup.++**Seeded differential (not committed).** The former `lib/claudeTrust.ts` and `portableHistory.ts` ran beside+the kit in one process, on generated files, with 500 cases per seed and three seeds:++- **Trust:** 3,000 settings files. 1,233 Claude Code and 631 Codex records were written.+- **Repair as text:** 1,500 rollouts. 277 were repaired and 381 refused.+- **Repair as a file:** 300 files. 59 were rewritten.++Every answer, byte and mode was equal.++**Unchanged suites.** The former `lib/claudeTrust.spec.ts` and `engines/codex/portableHistory{,.real}.spec.ts`+run their cases unchanged against the kit (`engines/kit/folderTrust.spec.ts`,+`engines/kit/resumeRepair{,.real}.spec.ts`). The core specs (`create`, `launches`, `launch`) and+`backendSocket.spec.ts` route the same per-engine spies through `folderTrust`. The resume log case now uses a+Codex session, the only engine that declares a repair.++### Core closure++| | Lines | Files |+| --- | --- | --- |+| Before (#1046 rebased, `519e51fd6`) | 73,231 | 390 |+| After | 73,370 | 391 |++**Left:** `engines/codex/portableHistory.ts` (220 lines) and `lib/claudeTrust.ts` (129). `engines/codex/rollout.ts`+lost its own walk (16 lines). **Came in:** `kit/resumeRepair.ts` (259), `kit/folderTrust.ts` (129),+`engines/launchPrep.ts` (61) and the contracts' data (36 lines).++`architecture.spec.ts` adds the two deleted files as edge files. Its launch closure test now covers:++- **The builders:** the composition, both kit modules, `dsh/runtime.ts` and `lib/apiInstructions.ts`.+- **The callers:** `core/agents/launch.ts` and `launches.ts`.++They reach no Claude Code or Codex file but the declared contracts and `rollout.ts`, the registry's until (c4).## The plan for the rest of (c)@@ -99,7 +178,6 @@ paths. Each one records today's behavior in a golden spec first, in its own comm| | Scope | Why it is in this place | Golden proof || --- | --- | --- | --- |-| **(c2) Launch preparation** | Folder trust (`lib/claudeTrust.ts`, 129 lines, and the `engine === 'claude' / 'codex'` branches in `core/agents/create.ts` and `launches.ts`). Codex's rollout repair for resume (`engines/codex/portableHistory.ts`, 220 lines, `core/agents/launch.ts` `prepareSessionResume`). The instruction-file fallback in `dsh/runtime.ts` and `lib/apiInstructions.ts`. | Async callers, before the spawn. These write into the person's engine homes and into rollouts, so their bytes matter, but no hot path depends on them. The order must stay: repair, then `setTail`, then spawn. | Every file's bytes before and after, as the hooks batch did. The trust contract declares the file, the format (a JSON path, or a TOML table) and the rule that trust inherits downward. The resume repair declares which records it drops. || **(c3) Discovery and process matching** | `lib/tmux.ts` process signatures and `RESUME_ARGS`, `claudeNativeInstallPath`, `lib/gridAssignment.ts` `MODEL_IN_ARGV`, `lib/codexHomeProbe.ts`, `lib/claudeProject.ts`, `lib/cwdRepair.ts`, and the moved homes in `lib/engineHomes.ts` (with the `CODEX_HOME` env literal at create and relaunch). | This is static data, but it is read for every process row on every discovery pass, and a wrong answer adopts or drops agents. | A recorded classification of a corpus of process rows: executable, argv, environment → engine, session, bypass, model, home. || **(c4) Registry load and session identity** | The registry's Codex child-rollout repair (`lib/registry.ts` with `engines/codex/rollout.ts`), `lib/sessionRepair.ts` (about 190 of 716 lines), `lib/captureResumeIdentity.ts`, `lib/handoffDiscovery.ts`. | Synchronous, at load before any worker exists, and on the hook path. A wrong answer loses bindings at every restart. It goes after (c3) because it reuses (c3)'s homes. | Recorded transcripts and pid records → binding, session id and repair, read with the same bounds. || **(c5) Adoption readers and shared normalizers** | `lib/sessionSearch/externals/{claude,codex}.ts`, `lib/transcriptPages.ts`, `lib/transcriptReader.ts` and `lib/transcriptActivity.ts`. Also splitting the functions `engines/claude/normalize.ts` and `engines/codex/{normalizer,subagent}.ts` share with other engines into `engines/kit`. | The largest (1,000 to 2,000 lines) but async. Listing and paging sessions for adoption is not session control. Those readers may run in a worker, as long as adoption fails safe when it is down: refused with a reason, never a wrong session. | The adoption and paging specs, unchanged, plus a recorded corpus of transcripts → pages. |diff --git a/docs/design/2026-10-08-engine-remaining-facets.md b/docs/design/2026-10-08-engine-remaining-facets.mdindex 9744974e8..cee3acdba 100644--- a/docs/design/2026-10-08-engine-remaining-facets.md+++ b/docs/design/2026-10-08-engine-remaining-facets.md@@ -44,10 +44,11 @@ About 230 lines would leave. Transport, credential, routes and `registry.registe## (c) Launch, discovery and resume-Split into five sub-batches. See [engine launch](2026-10-08-engine-launch.md), which records (c1) and plans-(c2) to (c5). (c1) is done: the Codex pane script's startup probe and retry, its own-login provider, and-the two engines' context and env flags are now declared data, applied by `engines/kit`. Like (b), nothing-moved into a worker. The map below is as it stood before (c1).+Split into five sub-batches. See [engine launch](2026-10-08-engine-launch.md), which records (c1) and (c2)+and plans (c3) to (c5). (c1) is done: the Codex pane script's startup probe and retry, its own-login provider,+and the two engines' context and env flags are now declared data, applied by `engines/kit`. (c2) is done too:+folder trust, the resume repair and the instruction-file fallbacks. Like (b), nothing moved into a worker.+The map below is as it stood before (c1).| File | Engine-specific behavior | Stays in core | Can move | Risk || --- | --- | --- | --- | --- |@@ -115,7 +116,7 @@ About 220 lines would leave, and with them core's only native child process andclosure, and a few dozen lines of declared data come in.4. **(c) Launch, discovery and resume.** The largest. It has the most synchronous call sites (registryload, discovery tables, argv). It is split by risk into (c1) launch argv and the pane script (done),- (c2) launch preparation (trust writes and the resume repair), (c3) discovery and process matching,+ (c2) launch preparation (trust writes and the resume repair, done), (c3) discovery and process matching,(c4) registry load and session identity, and (c5) adoption readers and the shared normalizers([engine launch](2026-10-08-engine-launch.md)). Session control stays worker-free throughout, as in (b).