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
fix: require complete native home catalog evidence (#1126)
Dee3972e54a607d
diff --git a/cli/e2e/enginehomes.e2e.ts b/cli/e2e/enginehomes.e2e.tsindex 4ad4aee0e..f959c291b 100644--- a/cli/e2e/enginehomes.e2e.ts+++ b/cli/e2e/enginehomes.e2e.ts@@ -345,7 +345,7 @@ describe('the person\'s engines keeping their data elsewhere', () => {client.close()}, 300_000)- it('an incomplete native identity holds binding, Stop and Close while readiness and a sibling continue', async () => {+ it.each(['process record', 'home catalog'] as const)('an incomplete %s holds binding, Stop and Close while readiness and a sibling continue', async fault => {const d = await IsolatedDaemon.create({ env: { HOOK_INSTALL_ENGINES: 'codex' } }); daemon = donTestFailed(() => console.log(`---- daemon log\n${d.log().split('\n').slice(-150).join('\n')}`))await d.start()@@ -365,12 +365,15 @@ describe('the person\'s engines keeping their data elsewhere', () => {try { const files = readdirSync(records); return files.length === 1 ? join(records, files[0]) : null }catch { return null }})- const complete = readFileSync(path, 'utf8')- const native = JSON.parse(complete)- writeFileSync(path, '{')+ const nativeBytes = readFileSync(path, 'utf8')+ const native = JSON.parse(nativeBytes)+ const faultFile = fault === 'process record' ? path : join(d.dataDir, 'engine-homes.json')+ const complete = fault === 'process record' ? nativeBytes : JSON.stringify({ claude: [], codex: [] })+ const reason = fault === 'process record' ? 'the process record is incomplete' : 'the saved engine-home catalog is incomplete'+ writeFileSync(faultFile, '{', { mode: 0o600 })await d.start()client = await LocalClient.connect(d)- await until('the binding hold with its reason', () => d.log().includes('binding held · Conversation identity is held: the process record is incomplete'))+ await until('the binding hold with its reason', () => d.log().includes(`binding held · Conversation identity is held: ${reason}`))const held = await row(client, tile.id)expect(held?.engine).toBe('claude')expect(held?.sessionId).toBeFalsy()@@ -382,11 +385,11 @@ describe('the person\'s engines keeping their data elsewhere', () => {expect(stopped.error, JSON.stringify(stopped)).toBeTruthy()const closed = await client.request('agent_close', { agentId: tile.id, sessionId: held!.sessionId,createdAt: held!.createdAt, mode: 'now' }, 60_000)- expect(closed).toMatchObject({ error: 'IDENTITY_UNAVAILABLE', detail: expect.stringContaining('process record is incomplete') })+ expect(closed).toMatchObject({ error: 'IDENTITY_UNAVAILABLE', detail: expect.stringContaining(reason) })expect(IsolatedDaemon.alive(native.pid)).toBe(true)expect((await row(client, tile.id))?.status).toBe('active')- writeFileSync(path + '.complete', complete)- renameSync(path + '.complete', path)+ writeFileSync(faultFile + '.complete', complete, { mode: 0o600 })+ renameSync(faultFile + '.complete', faultFile)await until('the same live process to bind after its record becomes complete', async () => {const now = await row(client, tile.id)return now?.status === 'active' && now.sessionId === native.sessionIddiff --git a/cli/scripts/handoff-2026-10-08/home-catalog-cost.ts b/cli/scripts/handoff-2026-10-08/home-catalog-cost.tsnew file mode 100644index 000000000..587ec6254--- /dev/null+++ b/cli/scripts/handoff-2026-10-08/home-catalog-cost.ts@@ -0,0 +1,54 @@+/** Fresh private catalog workloads. No daemon, vendor binary or owner input. */+import { chmodSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, statSync, utimesSync, writeFileSync } from 'node:fs'+import { tmpdir } from 'node:os'+import { join, resolve } from 'node:path'+import { pathToFileURL } from 'node:url'+import { performance } from 'node:perf_hooks'++const workload = process.argv[2] ?? 'empty'+const cli = process.env.CATALOG_COST_CLI ?? resolve(import.meta.dirname, '../..')+const root = realpathSync(mkdtempSync(join(tmpdir(), 'home-catalog-cost-')))+for (const name of ['HOME', 'ADAPTER_DATA_DIR', 'ADAPTER_RUNTIME_DIR', 'CODEX_HOME', 'CLAUDE_CONFIG_DIR']) process.env[name] = join(root, name)+process.env.CLAUDE_PROJECTS_DIR = join(process.env.CLAUDE_CONFIG_DIR!, 'projects')+const data = process.env.ADAPTER_DATA_DIR!, file = join(data, 'engine-homes.json')+mkdirSync(data)+try {+ const homes = await import(pathToFileURL(join(cli, 'src/lib/engineHomes.ts')).href)+ const roots = homes.nativeSessionRoots ?? homes.sessionRoots+ const count = workload === 'eight' ? 8 : workload === 'full' || workload === 'large' ? 63 : 0+ const known = Array.from({ length: count }, (_, i) => join(root, `moved-${i}${workload === 'large' ? 'x'.repeat(940) : ''}`))+ const text = JSON.stringify({ claude: [], codex: known })+ if (workload !== 'empty') writeFileSync(file, text, { mode: 0o600 })+ if (workload === 'malformed') writeFileSync(file, '{')+ if (workload === 'oversized') writeFileSync(file, ' '.repeat(65537))+ if (workload === 'same-stamp') {+ const changed = JSON.stringify({ codex: [join(root, 'added')] })+ writeFileSync(file, '{"codex":[]}'.padEnd(changed.length, ' '))+ const at = new Date('2026-10-09T00:00:00Z'); utimesSync(file, at, at)+ roots('codex')+ writeFileSync(file, changed); utimesSync(file, at, at)+ }+ if (workload === 'unsaved') {+ chmodSync(data, 0o500)+ homes.adoptHomes({ CODEX_HOME: join(root, 'unsaved') })+ if (readFileSync(file, 'utf8') !== text) throw new Error('The private write-failure fixture was not effective')+ }+ const bytes = workload === 'empty' ? 0 : statSync(file).size+ const latenciesMs: number[] = [], outcomes: Record<string, number> = {}+ const cpu = process.cpuUsage()+ for (let i = 0; i < 25; i++) {+ const started = performance.now()+ let outcome: string+ try { outcome = `roots:${roots('codex').length}` }+ catch (error) {+ if ((error as { code?: string }).code !== 'IDENTITY_UNAVAILABLE') throw error+ outcome = 'held'+ }+ latenciesMs.push(Number((performance.now() - started).toFixed(4)))+ outcomes[outcome] = (outcomes[outcome] ?? 0) + 1+ }+ const used = process.cpuUsage(cpu)+ console.log(JSON.stringify({ workload, iterations: 25, bytes, outcomes, latenciesMs,+ cpuMs: (used.user + used.system) / 1000, peakRssMiB: process.resourceUsage().maxRSS / 1024,+ node: process.version, platform: process.platform, arch: process.arch }))+} finally { chmodSync(data, 0o700); rmSync(root, { recursive: true, force: true }) }diff --git a/cli/scripts/handoff-2026-10-08/mutate-home-catalog.py b/cli/scripts/handoff-2026-10-08/mutate-home-catalog.pynew file mode 100644index 000000000..b0fb3dfcc--- /dev/null+++ b/cli/scripts/handoff-2026-10-08/mutate-home-catalog.py@@ -0,0 +1,66 @@+"""Run in an owned disposable worktree; every deliberately broken boundary must assertion-fail."""+import os+from pathlib import Path+import subprocess+import sys++cli = Path(sys.argv[1]).resolve()+kit = 'src/engines/kit/homeCatalog.ts'+homes = 'src/lib/engineHomes.ts'+spec = 'src/engines/kit/homeCatalog.spec.ts'+golden = 'src/lib/engineHomes.golden.spec.ts'+mutations = [+ ('identity uses legacy roots', 'src/lib/sessionRepair.ts', "import { nativeSessionRoots }", "import { sessionRoots as nativeSessionRoots }", spec),+ ('moved roots disconnected', homes, '...read.homes[engine as SessionStoreEngine].map(home => join(home, moved.folder))', '...[]', golden),+ ('known competing homes ignored', homes, 'if (nativeKnownHomes[name].some(home => !read.homes[name].includes(home)))', 'if (false)', spec),+ ('unsaved adoption ignored', homes, 'const legacy = movedByEngine[name]', 'const legacy: string[] = []', spec),+ ('previous fresh homes forgotten', homes, 'const names = Object.keys(sessionStoreContracts)', 'nativeKnownHomes = { claude: [], codex: [] }; const names = Object.keys(sessionStoreContracts)', spec),+ ('held-read positive facts forgotten', homes, 'nativeKnownHomes[name].push(home)', "if (!nativeKnownHomes[name].some(known => !read.homes[name].includes(known))) nativeKnownHomes[name].push(home)", spec),+ ('legacy list bound removed', homes, 'if (legacy.length > MAX_CATALOG_HOMES)', 'if (false)', spec),+ ('cumulative home bound removed', homes, 'if (nativeKnownHomes[name].length === MAX_CATALOG_HOMES)', 'if (false)', spec),+ ('overflow fact forgotten', homes, 'if (nativeCatalogOverflow) overflow()', 'if (false) overflow()', spec),+ ('byte bound removed', kit, 'if (info.size > MAX_BYTES)', 'if (false)', spec),+ ('root bound removed', kit, 'if (homes.length > MAX_CATALOG_HOMES)', 'if (false)', spec),+ ('read-operation bound removed', kit, 'if (++calls > 64)', 'if (false)', spec),+ ('read deadline removed', kit, 'if (performance.now() - started > 250)', 'if (false)', spec),+ ('path replacement fence removed', kit, 'stamp(lstatSync(file)) !== stamp(before)', 'false', spec),+ ('write permission ignored', kit, '|| (info.mode & 0o022)', '|| false', spec),+ ('malformed home list omitted', kit, "if (!Array.isArray(homes)) throw unavailable('has an invalid home list')", 'if (!Array.isArray(homes)) continue', spec),+ ('duplicate home lists accepted', kit, 'if (keys.has(key))', 'if (false)', spec),+ ('invalid UTF-8 replaced silently', kit, "new TextDecoder('utf-8', { fatal: true })", "new TextDecoder('utf-8')", spec),+ ('dangling catalog parent treated as empty', kit, 'return absent(file, deadline)', "return { homes: { claude: [], codex: [] }, text: null, version: null }", spec),+ ('catalog loses typed hold', kit, 'new IdentityReadUnavailable(`the saved engine-home catalog ${reason}`)', 'new Error(`the saved engine-home catalog ${reason}`)', spec),+ ('exact lookup final roots not checked', 'src/lib/sessionRepair.ts', "if (repairRoots(engine, opts?.codexHome).join('\\0') !== roots.join('\\0'))", 'if (false)', spec),+]+env = {**os.environ, 'TZ': 'UTC', 'TMPDIR': '/tmp'}+for key in list(env):+ if key in ['TMUX', 'TMUX_PANE'] or key.startswith('RECORD_'):+ env.pop(key)+if not Path(env.get('TMUX_TMPDIR', '/missing-private-tmux')).is_dir():+ raise SystemExit('An existing private TMUX_TMPDIR is required')+++def run(specs):+ return subprocess.run(['node', 'node_modules/vitest/vitest.mjs', 'run', *specs, '--maxWorkers=1'],+ cwd=cli, env=env, capture_output=True, text=True, timeout=120)+++baseline = run([spec, golden])+if baseline.returncode:+ print(baseline.stdout + baseline.stderr)+ raise SystemExit('baseline failed; no mutants ran')+print('unchanged baseline passed', flush=True)+for label, relative, before, after, target in mutations:+ path = cli / relative+ original = path.read_text()+ assert original.count(before) == 1, (label, original.count(before))+ try:+ path.write_text(original.replace(before, after))+ result = run([target])+ output = result.stdout + result.stderr+ if result.returncode == 0 or 'AssertionError' not in output:+ print(output)+ raise SystemExit(f'{label}: not caught by an assertion')+ print(f'{label}: caught by assertion', flush=True)+ finally:+ path.write_text(original)diff --git a/cli/src/engines/kit/homeCatalog.spec.ts b/cli/src/engines/kit/homeCatalog.spec.tsnew file mode 100644index 000000000..e48815e96--- /dev/null+++ b/cli/src/engines/kit/homeCatalog.spec.ts@@ -0,0 +1,256 @@+import * as fs from 'node:fs'+import * as asyncFs from 'node:fs/promises'+import { tmpdir } from 'node:os'+import { dirname, join } from 'node:path'+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'+import { readHomeCatalog } from './homeCatalog.js'++const clock = vi.hoisted(() => ({ now: 0 }))+vi.mock('node:perf_hooks', async original => ({ ...await original<object>(), performance: { now: () => clock.now } }))+vi.mock('node:fs', async original => {+ const actual = await original<typeof import('node:fs')>()+ return { ...actual, lstatSync: vi.fn(actual.lstatSync), openSync: vi.fn(actual.openSync),+ readSync: vi.fn(actual.readSync), fstatSync: vi.fn(actual.fstatSync), closeSync: vi.fn(actual.closeSync), renameSync: vi.fn(actual.renameSync) }+})+vi.mock('node:fs/promises', async original => {+ const actual = await original<typeof import('node:fs/promises')>()+ return { ...actual, opendir: vi.fn(actual.opendir) }+})+vi.mock('../../lib/loginShellEnv.js', () => ({ loginShellEnvironment: () => ({}) }))+let actual: typeof fs, root = ''+let homes: typeof import('../../lib/engineHomes.js')+let repair: typeof import('../../lib/sessionRepair.js')+const path = (...parts: string[]) => join(root, ...parts)+const catalog = () => path('data', 'engine-homes.json')+const ID = 'aaaaaaaa-1111-4222-8333-444444444444'+function write(text: unknown): void {+ fs.mkdirSync(dirname(catalog()), { recursive: true })+ fs.writeFileSync(catalog(), typeof text === 'string' ? text : JSON.stringify(text), { mode: 0o600 })+}+function transcript(home: string): string {+ const file = join(home, 'sessions', 'day', `rollout-${ID}.jsonl`)+ fs.mkdirSync(dirname(file), { recursive: true })+ fs.writeFileSync(file, JSON.stringify({ type: 'session_meta', payload: { id: ID, cwd: path('work'), source: 'cli' } }) + '\n')+ return file+}+beforeEach(async () => {+ actual = await vi.importActual<typeof fs>('node:fs')+ vi.mocked(asyncFs.opendir).mockReset().mockImplementation((await vi.importActual<typeof asyncFs>('node:fs/promises')).opendir)+ for (const name of ['lstatSync', 'openSync', 'readSync', 'fstatSync', 'closeSync', 'renameSync'] as const) {+ vi.mocked(fs[name]).mockReset().mockImplementation(actual[name] as never)+ }+ clock.now = 0+ root = actual.realpathSync(fs.mkdtempSync(join(tmpdir(), 'home-catalog-')))+ for (const [name, value] of Object.entries({ HOME: path('home'), ADAPTER_DATA_DIR: path('data'),+ ADAPTER_RUNTIME_DIR: path('runtime'), CODEX_HOME: path('codex'), CLAUDE_PROJECTS_DIR: path('claude', 'projects') })) vi.stubEnv(name, value)+ vi.resetModules()+ homes = await import('../../lib/engineHomes.js')+ repair = await import('../../lib/sessionRepair.js')+})+afterEach(() => {+ homes.resetEngineHomes(); vi.restoreAllMocks(); vi.unstubAllEnvs()+ actual.rmSync(root, { recursive: true, force: true })+})++describe('fresh complete native home evidence', () => {+ it('reads a new installation and bypasses catalog evidence for explicit profiles and other engines', () => {+ expect(homes.nativeSessionRoots('codex')).toEqual([path('codex', 'sessions')])+ write('{ incomplete')+ expect(homes.nativeSessionRoots('codex', path('profile'))).toEqual([path('profile', 'sessions')])+ expect(homes.nativeSessionRoots('pi')).toEqual([])+ expect(homes.nativeSessionRoots('toString')).toEqual([])+ expect(() => homes.nativeSessionRoots('claude', path('profile'))).toThrow(/catalog/)+ })++ it('reads each complete list fresh, deduplicates only equal paths and returns independent arrays', () => {+ write({ claude: [path('c'), path('c')], codex: [path('a')] })+ expect(homes.nativeSessionRoots('claude')).toEqual([path('claude', 'projects'), path('c', 'projects')])+ const first = homes.nativeSessionRoots('codex'); first.push('/not-evidence')+ write({ claude: [path('c')], codex: [path('a'), path('b')] })+ expect(homes.nativeSessionRoots('codex')).toEqual([path('codex', 'sessions'), path('a', 'sessions'), path('b', 'sessions')])+ })++ it('does not reuse the legacy inode/mtime/size stamp when a competitor is added', async () => {+ const own = transcript(path('codex')); transcript(path('moved'))+ const text = JSON.stringify({ codex: [path('moved')] })+ write('{"codex":[]}'.padEnd(text.length, ' '))+ const before = actual.statSync(catalog())+ // Pin a representable timestamp before priming the old stamp cache.+ actual.utimesSync(catalog(), before.atime, new Date('2026-10-09T00:00:00Z'))+ expect(homes.movedHomes('codex')).toEqual([])+ await expect(repair.findResumedTranscript('codex', ID)).resolves.toBe(own)+ write(text); actual.utimesSync(catalog(), before.atime, new Date('2026-10-09T00:00:00Z'))+ expect(homes.movedHomes('codex')).toEqual([]) // This compatibility behavior is intentionally not the new authority.+ await expect(repair.findResumedTranscript('codex', ID)).rejects.toThrow('more than one transcript')+ })++ it.each(['{', '[]', 'null', '{"codex":42}', '{"claude":["relative"]}', '{"codex":[null]}',+ '{"future":["/home"]}', '{"codex":["/bad\\u0000path"]}', '{"codex":["/competitor"],"codex":[]}',+ '{"co\\u0064ex":["/competitor"],"codex":[]}'])('holds malformed evidence without rewriting it: %s', text => {+ write(text)+ expect(() => homes.nativeSessionRoots('codex')).toThrow(/saved engine-home catalog/)+ expect(actual.readFileSync(catalog(), 'utf8')).toBe(text)+ write({ codex: [path('recovered')] })+ expect(homes.nativeSessionRoots('codex')).toContain(path('recovered', 'sessions'))+ })++ it.each(['bytes', 'homes', 'path'])('bounds the complete catalog: %s', limit => {+ write(limit === 'bytes' ? '{}'.padEnd(65537, ' ') : { codex: limit === 'homes'+ ? Array.from({ length: 64 }, (_, n) => path(String(n))) : ['/' + 'x'.repeat(4096)] })+ expect(() => readHomeCatalog(catalog())).toThrow(/limit|oversized|invalid home/)+ expect(() => homes.nativeSessionRoots('codex')).toThrow(/limit|oversized|invalid home/)+ if (limit === 'bytes') expect(fs.openSync).not.toHaveBeenCalled()+ })++ it('bounds the raw list before deduplicating repeated homes', () => {+ write({ codex: Array.from({ length: 64 }, () => path('same')) })+ expect(() => readHomeCatalog(catalog())).toThrow('known session-home limit')+ })++ it('holds a catalog that disappears or drops a previously observed home, then recovers', () => {+ write({ codex: [path('a')] }); homes.nativeSessionRoots('codex')+ actual.unlinkSync(catalog())+ expect(() => homes.nativeSessionRoots('codex')).toThrow('previously observed or unsaved home')+ write({ codex: [path('b')] })+ expect(() => homes.nativeSessionRoots('codex')).toThrow('previously observed or unsaved home')+ write({ codex: [path('a'), path('b')] })+ expect(homes.nativeSessionRoots('codex')).toHaveLength(3)+ })++ it('retains a competing home observed by a valid held read across A -> B -> A recovery', async () => {+ const own = transcript(path('codex')); transcript(path('b'))+ write({ codex: [path('a')] })+ await expect(repair.findResumedTranscript('codex', ID)).resolves.toBe(own)+ write({ codex: [path('b')] })+ await expect(repair.findResumedTranscript('codex', ID)).rejects.toThrow('previously observed or unsaved home')+ write({ codex: [path('a')] })+ await expect(repair.findResumedTranscript('codex', ID)).rejects.toThrow('previously observed or unsaved home')+ write({ codex: [path('a'), path('b')] })+ await expect(repair.findResumedTranscript('codex', ID)).rejects.toThrow('more than one transcript')+ })++ it('retains a bounded overflow fact when successive valid catalogs reveal too many homes', () => {+ const first = Array.from({ length: 63 }, (_, n) => path(`observed-${n}`))+ write({ codex: first }); expect(homes.nativeSessionRoots('codex')).toHaveLength(64)+ write({ codex: [path('one-more')] })+ expect(() => homes.nativeSessionRoots('codex')).toThrow('known session-home limit')+ write({ codex: first })+ expect(() => homes.nativeSessionRoots('codex')).toThrow('known session-home limit')+ })++ it('holds an oversized legacy list before copying or iterating it', () => {+ const legacy = Array.from({ length: 64 }, (_, n) => path(`legacy-${n}`))+ write({ codex: legacy }); homes.movedHomes('codex')+ write({ codex: [] })+ let visited = false+ const iterator = Array.prototype[Symbol.iterator]+ Array.prototype[Symbol.iterator] = function (this: unknown[]) {+ if (this.length === 64 && this[0] === legacy[0]) {+ visited = true+ throw new Error('oversized legacy list must not be visited')+ }+ return iterator.call(this)+ }+ try {+ expect(() => homes.nativeSessionRoots('codex')).toThrow('known session-home limit')+ expect(visited).toBe(false)+ } finally { Array.prototype[Symbol.iterator] = iterator }+ })++ it('does not exclude a known competitor after legacy adoption failed to persist', async () => {+ transcript(path('codex')); transcript(path('unsaved'))+ write({ codex: [] })+ vi.mocked(fs.renameSync).mockImplementation(() => { throw new Error('fixture disk unavailable') })+ expect(homes.adoptHomes({ CODEX_HOME: path('unsaved') })).toMatchObject({ codex: path('unsaved') })+ expect(JSON.parse(actual.readFileSync(catalog(), 'utf8'))).toEqual({ codex: [] })+ await expect(repair.findResumedTranscript('codex', ID)).rejects.toThrow('previously observed or unsaved home')+ write({ codex: [path('unsaved')] })+ await expect(repair.findResumedTranscript('codex', ID)).rejects.toThrow('more than one transcript')+ })++ it('keeps the typed hold when the catalog becomes unreadable during exact lookup', async () => {+ write({ codex: [] }); transcript(path('codex'))+ const native = await vi.importActual<typeof asyncFs>('node:fs/promises')+ vi.mocked(asyncFs.opendir).mockImplementationOnce(async (name, options) => {+ const directory = await native.opendir(name, options)+ write('{')+ return directory+ })+ await expect(repair.findResumedTranscript('codex', ID)).rejects.toMatchObject({ code: 'IDENTITY_UNAVAILABLE' })+ write({ codex: [] })+ await expect(repair.findResumedTranscript('codex', ID)).resolves.toBe(transcript(path('codex')))+ })++ it.each(['directory', 'symlink', 'dangling parent', 'write permission'])('holds unsafe native file evidence: %s', kind => {+ fs.mkdirSync(path('data'))+ if (kind === 'directory') fs.mkdirSync(catalog())+ else if (kind === 'symlink') { fs.writeFileSync(path('target'), '{}'); fs.symlinkSync(path('target'), catalog()) }+ else if (kind === 'dangling parent') { fs.rmdirSync(path('data')); fs.symlinkSync(path('missing'), path('data')) }+ else { write({}); fs.chmodSync(catalog(), 0o666) }+ expect(() => homes.nativeSessionRoots('codex')).toThrow(/catalog/)+ })++ it.each(['inspect', 'open', 'read'])('holds %s errors and succeeds on the next fresh read', stage => {+ write({ codex: [path('a')] })+ const method = stage === 'inspect' ? 'lstatSync' : stage === 'open' ? 'openSync' : 'readSync'+ vi.mocked(fs[method]).mockImplementationOnce(() => { throw Object.assign(new Error('denied'), { code: 'EACCES' }) })+ expect(() => homes.nativeSessionRoots('codex')).toThrow(/catalog/)+ expect(homes.nativeSessionRoots('codex')).toContain(path('a', 'sessions'))+ })++ it('handles short reads without accepting a prefix and closes every opened descriptor', () => {+ write({ codex: [path('a')] })+ vi.mocked(fs.readSync).mockImplementation((fd, buffer, options = {}) =>+ actual.readSync(fd, buffer, { ...options, length: Math.min(options.length ?? buffer.byteLength, 3) }))+ expect(readHomeCatalog(catalog()).homes.codex).toEqual([path('a')])+ expect(fs.closeSync).toHaveBeenCalledTimes(1)+ vi.mocked(fs.readSync).mockReturnValueOnce(0)+ expect(() => readHomeCatalog(catalog())).toThrow('ended during its read')+ expect(fs.closeSync).toHaveBeenCalledTimes(2)+ })++ it.each(['operations', 'deadline'])('bounds an unfinished read by %s', limit => {+ write({ codex: [path('a'.repeat(200))] })+ vi.mocked(fs.readSync).mockImplementation((fd, buffer, options = {}) => {+ if (limit === 'deadline') clock.now = 251+ return actual.readSync(fd, buffer, limit === 'deadline' ? options : { ...options, length: 1 })+ })+ expect(() => readHomeCatalog(catalog())).toThrow(limit === 'deadline' ? 'read deadline' : 'read-operation limit')+ expect(fs.closeSync).toHaveBeenCalledTimes(1)+ })++ it.each(['append', 'rename', 'ancestor replacement'])('rejects a catalog changed by %s during its descriptor read', kind => {+ write({ codex: [path('a')] })+ vi.mocked(fs.readSync).mockImplementationOnce((fd, buffer, options) => {+ const count = actual.readSync(fd, buffer, options)+ if (kind === 'append') actual.appendFileSync(catalog(), ' ')+ else if (kind === 'rename') { actual.writeFileSync(path('replacement'), '{}'); actual.renameSync(path('replacement'), catalog()) }+ else {+ // Moving the ordinary parent preserves the opened file's inode/ctime. Only the+ // pathname fence can notice that a different catalog now occupies its old path.+ actual.renameSync(path('data'), path('saved-data')); write({})+ }+ return count+ })+ expect(() => readHomeCatalog(catalog())).toThrow('changed during its read')+ expect(fs.closeSync).toHaveBeenCalledTimes(1)+ })++ it('ties an opened descriptor to the inspected inode even when the pathname returns before fstat', () => {+ write({ codex: [path('a')] }); actual.writeFileSync(path('other'), '{}', { mode: 0o600 })+ vi.mocked(fs.openSync).mockImplementationOnce((name, flags) => {+ actual.renameSync(catalog(), path('original')); actual.renameSync(path('other'), catalog())+ const fd = actual.openSync(name, flags)+ actual.renameSync(catalog(), path('other')); actual.renameSync(path('original'), catalog())+ return fd+ })+ expect(() => readHomeCatalog(catalog())).toThrow('changed before it could be opened')+ expect(fs.closeSync).toHaveBeenCalledTimes(1)+ })++ it('rejects invalid UTF-8 instead of turning replacement characters into a native home', () => {+ fs.mkdirSync(path('data'))+ actual.writeFileSync(catalog(), Buffer.concat([Buffer.from('{"codex":["/'), Buffer.from([0xff]), Buffer.from('"]}')]), { mode: 0o600 })+ expect(() => readHomeCatalog(catalog())).toThrow('could not be read completely')+ })+})diff --git a/cli/src/engines/kit/homeCatalog.ts b/cli/src/engines/kit/homeCatalog.tsnew file mode 100644index 000000000..ec1d5c20b--- /dev/null+++ b/cli/src/engines/kit/homeCatalog.ts@@ -0,0 +1,117 @@+/** The native home catalog is control evidence. A partial read is never an empty list. */+import { closeSync, constants, fstatSync, lstatSync, openSync, readSync, type Stats } from 'node:fs'+import { dirname, isAbsolute } from 'node:path'+import { performance } from 'node:perf_hooks'+import { IdentityReadUnavailable } from './identityScan.js'++export type HomeCatalog = { claude: string[]; codex: string[] }+export type HomeCatalogRead = { homes: HomeCatalog; text: string | null; version: string | null }+const MAX_BYTES = 64 * 1024+export const MAX_CATALOG_HOMES = 63 // The default home occupies the remaining slot in the 64-root native pool.+const stamp = (s: Stats) => `${s.dev}:${s.ino}:${s.mode}:${s.uid}:${s.size}:${s.mtimeMs}:${s.ctimeMs}`+const unavailable = (reason: string) => new IdentityReadUnavailable(`the saved engine-home catalog ${reason}`)+const missing = (error: unknown) => (error as NodeJS.ErrnoException).code === 'ENOENT'++function absent(file: string, deadline: () => void): HomeCatalogRead {+ // ENOENT through a dangling data-directory link is unreadable state, not a new installation.+ let parent = dirname(file)+ for (let depth = 0; depth < 32; depth++) {+ deadline()+ try {+ if (!lstatSync(parent).isDirectory()) throw unavailable('has an unavailable parent directory')+ return { homes: { claude: [], codex: [] }, text: null, version: null }+ } catch (error) {+ if (!missing(error)) throw unavailable('has an unavailable parent directory')+ const next = dirname(parent)+ if (next === parent) break+ parent = next+ }+ }+ throw unavailable('exceeded its parent-directory limit')+}++function inspect(info: Stats): void {+ if (!info.isFile() || (typeof process.getuid === 'function' && info.uid !== process.getuid()) || (info.mode & 0o022)) {+ throw unavailable('has an unsafe owner, type or write permission')+ }+ if (info.size > MAX_BYTES) throw unavailable('exceeds its byte limit')+}++function parse(text: string): HomeCatalog {+ let value: unknown+ try { value = JSON.parse(text) }+ catch { throw unavailable('is incomplete or invalid JSON') }+ if (!value || typeof value !== 'object' || Array.isArray(value)+ || Object.keys(value).some(key => key !== 'claude' && key !== 'codex')) {+ throw unavailable('has an unknown schema')+ }+ // JSON.parse silently keeps the last duplicate property. This catalog is a complete pool:+ // an earlier list cannot disappear, including when a key uses an escaped spelling.+ const keys = new Set<string>()+ for (const match of text.matchAll(/"(?:\\.|[^"\\])*"/g)) {+ let next = match.index! + match[0].length+ while (' \t\r\n'.includes(text[next] ?? '\0')) next+++ if (text[next] !== ':') continue+ const key = JSON.parse(match[0]) as string+ if (keys.has(key)) throw unavailable('contains a repeated home list')+ keys.add(key)+ }+ const result: HomeCatalog = { claude: [], codex: [] }+ for (const engine of ['claude', 'codex'] as const) {+ const homes = (value as Record<string, unknown>)[engine]+ if (homes === undefined) continue+ if (!Array.isArray(homes)) throw unavailable('has an invalid home list')+ if (homes.length > MAX_CATALOG_HOMES) throw new IdentityReadUnavailable('the known session-home limit was reached')+ for (const home of homes) {+ if (typeof home !== 'string' || home.length > 4096 || home.includes('\0') || !isAbsolute(home)) {+ throw unavailable('contains an invalid home')+ }+ if (!result[engine].includes(home)) result[engine].push(home)+ }+ }+ return result+}++/** Fresh, bounded bytes tied to their opened descriptor and current pathname. No stamp cache. */+export function readHomeCatalog(file: string): HomeCatalogRead {+ const started = performance.now()+ const deadline = () => { if (performance.now() - started > 250) throw unavailable('exceeded its read deadline') }+ let info: Stats+ try { info = lstatSync(file) }+ catch (error) {+ if (missing(error)) return absent(file, deadline)+ throw unavailable('could not be inspected')+ }+ inspect(info)+ let fd: number | undefined+ try {+ deadline()+ fd = openSync(file, constants.O_RDONLY | constants.O_NONBLOCK | constants.O_NOFOLLOW)+ const before = fstatSync(fd)+ inspect(before)+ if (stamp(before) !== stamp(info)) throw unavailable('changed before it could be opened')+ const buffer = Buffer.alloc(before.size)+ let read = 0, calls = 0+ while (read < buffer.length) {+ deadline()+ if (++calls > 64) throw unavailable('exceeded its read-operation limit')+ const count = readSync(fd, buffer, { offset: read, length: buffer.length - read, position: read })+ if (!count) throw unavailable('ended during its read')+ read += count+ }+ if (stamp(fstatSync(fd)) !== stamp(before) || stamp(lstatSync(file)) !== stamp(before)) {+ throw unavailable('changed during its read')+ }+ const text = new TextDecoder('utf-8', { fatal: true }).decode(buffer)+ const homes = parse(text)+ deadline()+ return { homes, text, version: stamp(before) }+ } catch (error) {+ if (error instanceof IdentityReadUnavailable) throw error+ throw unavailable('could not be read completely')+ } finally {+ if (fd !== undefined) {+ try { closeSync(fd) } catch { throw unavailable('could not close its read descriptor') }+ }+ }+}diff --git a/cli/src/lib/__fixtures__/engine-homes.golden.json b/cli/src/lib/__fixtures__/engine-homes.golden.jsonnew file mode 100644index 000000000..877a28201--- /dev/null+++ b/cli/src/lib/__fixtures__/engine-homes.golden.json@@ -0,0 +1,155 @@+{+ "default:own": [+ "<root>/CLAUDE_CONFIG_DIR",+ "<root>/CODEX_HOME"+ ],+ "default:roots": [+ [+ "<root>/CLAUDE_CONFIG_DIR/projects"+ ],+ [+ "<root>/CODEX_HOME/sessions"+ ],+ []+ ],+ "default:moved": {+ "claude": [],+ "codex": []+ },+ "default:ignored": {+ "claude": null,+ "codex": null+ },+ "ignored:relative": {+ "claude": null,+ "codex": null+ },+ "ignored:~/elsewhere": {+ "claude": null,+ "codex": null+ },+ "ignored: ": {+ "claude": null,+ "codex": null+ },+ "ignored:undefined": {+ "claude": null,+ "codex": null+ },+ "adopt:both": {+ "claude": "<root>/moved-claude",+ "codex": "<root>/moved-codex"+ },+ "adopt:saved": {+ "claude": [+ "<root>/moved-claude"+ ],+ "codex": [+ "<root>/moved-codex"+ ]+ },+ "adopt:duplicate": {+ "claude": null,+ "codex": null+ },+ "adopt:roots": [+ [+ "<root>/CLAUDE_CONFIG_DIR/projects",+ "<root>/moved-claude/projects"+ ],+ [+ "<root>/CODEX_HOME/sessions",+ "<root>/moved-codex/sessions"+ ]+ ],+ "adopt:home-roots": [+ [+ "<root>/CODEX_HOME",+ "<root>/moved-codex"+ ],+ [+ "<root>/CLAUDE_CONFIG_DIR/projects"+ ]+ ],+ "profile:roots": [+ [+ "<root>/CLAUDE_CONFIG_DIR/projects",+ "<root>/moved-claude/projects"+ ],+ [+ "<root>/profile/sessions"+ ],+ []+ ],+ "profile:environment": [+ null,+ {+ "CODEX_HOME": "<root>/profile"+ },+ null+ ],+ "unknown:moved": [+ [],+ []+ ],+ "restart:before-shell": {+ "claude": [+ "<root>/moved-claude"+ ],+ "codex": [+ "<root>/moved-codex"+ ]+ },+ "refresh:atomic-replacement": {+ "claude": [+ "<root>/moved-claude"+ ],+ "codex": [+ "<root>/moved-codex",+ "<root>/second-codex"+ ]+ },+ "refresh:search-roots": [+ [+ "<root>/CLAUDE_CONFIG_DIR/projects",+ "<root>/moved-claude/projects"+ ],+ [+ "<root>/CODEX_HOME",+ "<root>/moved-codex",+ "<root>/second-codex"+ ]+ ],+ "bound:sessions": [+ "<root>/moved-codex",+ "<root>/moved-codex/sessions",+ "<root>/profile"+ ],+ "bound:archived_sessions": [+ "<root>/moved-codex",+ "<root>/moved-codex/sessions",+ "<root>/profile"+ ],+ "bound:claude": "<root>/moved-claude",+ "bound:sibling-prefix": [+ "<root>/new-codex",+ "<root>/new-claude"+ ],+ "launch:shell": [+ "<root>/new-codex",+ "<root>/new-claude"+ ],+ "launch:profile": "<root>/profile",+ "launch:explicit-environment": [+ "<root>/moved-codex",+ "<root>/moved-claude"+ ],+ "launch:invalid-environment": [+ "<root>/CODEX_HOME",+ "<root>/HOME"+ ],+ "bound:no-shell-cache": [+ "<root>/second-codex",+ "<root>/moved-claude"+ ]+}diff --git a/cli/src/lib/engineHomes.golden.spec.ts b/cli/src/lib/engineHomes.golden.spec.tsnew file mode 100644index 000000000..c21a84855--- /dev/null+++ b/cli/src/lib/engineHomes.golden.spec.ts@@ -0,0 +1,94 @@+/** Healthy saved-home answers recorded on main before removing the catalog's stamp cache.+ * Linux, UTC, fixed time and private homes; no host binary or login-shell probe. */+import { mkdirSync, mkdtempSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync } from 'node:fs'+import { tmpdir } from 'node:os'+import { dirname, join } from 'node:path'+import { fileURLToPath } from 'node:url'+import { afterAll, beforeAll, expect, it, vi } from 'vitest'++const shell = vi.hoisted(() => ({ environment: {} as NodeJS.ProcessEnv }))+vi.mock('./loginShellEnv.js', () => ({ loginShellEnvironment: () => shell.environment }))+vi.mock('node:child_process', () => {+ const forbidden = () => { throw new Error('Host binaries are forbidden in this golden') }+ return { exec: forbidden, execSync: forbidden, execFile: forbidden, execFileSync: forbidden,+ spawn: forbidden, spawnSync: forbidden, fork: forbidden }+})+const GOLDEN = fileURLToPath(new URL('./__fixtures__/engine-homes.golden.json', import.meta.url))+const RECORD = process.env.RECORD_ENGINE_HOMES_GOLDEN === '1'+const platform = Object.getOwnPropertyDescriptor(process, 'platform')!+const captured: Record<string, unknown> = {}+let expected: Record<string, unknown>, root = ''+let homes: typeof import('./engineHomes.js')+let config: typeof import('../config/env.js')+const path = (...parts: string[]) => join(root, ...parts)+const saved = () => path('ADAPTER_DATA_DIR', 'engine-homes.json')+function check(key: string, value: unknown): void {+ captured[key] = JSON.parse(JSON.stringify(value ?? null).split(root).join('<root>'))+ if (!RECORD) expect({ key, value: captured[key] }).toEqual({ key, value: expected[key] })+}+beforeAll(async () => {+ root = realpathSync(mkdtempSync(join(tmpdir(), 'engine-homes-golden-')))+ for (const name of ['HOME', 'ADAPTER_DATA_DIR', 'ADAPTER_RUNTIME_DIR', 'CODEX_HOME', 'CLAUDE_CONFIG_DIR',+ 'XDG_CONFIG_HOME', 'XDG_DATA_HOME']) {+ vi.stubEnv(name, path(name))+ mkdirSync(path(name), { recursive: true })+ }+ vi.stubEnv('CLAUDE_PROJECTS_DIR', path('CLAUDE_CONFIG_DIR', 'projects'))+ vi.stubEnv('TZ', 'UTC')+ Object.defineProperty(process, 'platform', { ...platform, value: 'linux' })+ vi.useFakeTimers({ toFake: ['Date'], now: Date.parse('2026-10-09T17:00:00Z') })+ vi.resetModules()+ homes = await import('./engineHomes.js')+ config = await import('../config/env.js')+ expected = RECORD ? {} : JSON.parse(readFileSync(GOLDEN, 'utf8'))+})+afterAll(() => {+ if (RECORD) writeFileSync(GOLDEN, JSON.stringify(captured, null, 2) + '\n')+ homes?.resetEngineHomes(); shell.environment = {}; vi.useRealTimers(); vi.unstubAllEnvs()+ Object.defineProperty(process, 'platform', platform)+ rmSync(root, { recursive: true, force: true })+})++it('records declared roots, durable adoption, profiles and bound-home selection', () => {+ const { env } = config+ check('default:own', [homes.ownHomeOf('claude'), homes.ownHomeOf('codex')])+ check('default:roots', [homes.nativeSessionRoots('claude'), homes.nativeSessionRoots('codex'), homes.nativeSessionRoots('pi')])+ check('default:moved', homes.movedEngineHomes())+ check('default:ignored', homes.adoptHomes({ CLAUDE_CONFIG_DIR: dirname(env.CLAUDE_PROJECTS_DIR), CODEX_HOME: `${env.CODEX_HOME}/` }))+ for (const value of ['relative', '~/elsewhere', ' ', undefined]) {+ check(`ignored:${String(value)}`, homes.adoptHomes({ CLAUDE_CONFIG_DIR: value, CODEX_HOME: value }))+ }+ const claude = path('moved-claude'), codex = path('moved-codex'), profile = path('profile')+ check('adopt:both', homes.adoptHomes({ CLAUDE_CONFIG_DIR: ` ${claude}/ `, CODEX_HOME: `${codex}/` }))+ check('adopt:saved', JSON.parse(readFileSync(saved(), 'utf8')))+ check('adopt:duplicate', homes.adoptHomes({ CLAUDE_CONFIG_DIR: claude, CODEX_HOME: codex }))+ check('adopt:roots', [homes.nativeSessionRoots('claude'), homes.nativeSessionRoots('codex')])+ check('adopt:home-roots', [homes.homeRoots('CODEX_HOME'), homes.homeRoots('CLAUDE_PROJECTS_DIR')])+ check('profile:roots', [homes.nativeSessionRoots('claude', profile), homes.nativeSessionRoots('codex', profile), homes.nativeSessionRoots('pi', profile)])+ check('profile:environment', [homes.profileEnvironment('claude', profile), homes.profileEnvironment('codex', profile), homes.profileEnvironment('pi', profile)])+ check('unknown:moved', [homes.movedHomes('pi'), homes.movedHomes('toString')])+ homes.resetEngineHomes()+ check('restart:before-shell', homes.movedEngineHomes())+ const extra = path('second-codex')+ writeFileSync(`${saved()}.draft`, JSON.stringify({ claude: [claude], codex: [codex, extra] }))+ renameSync(`${saved()}.draft`, saved())+ check('refresh:atomic-replacement', homes.movedEngineHomes())+ check('refresh:search-roots', [homes.claudeProjectsRoots(env.CLAUDE_PROJECTS_DIR), homes.codexHomeRoots(env.CODEX_HOME)])+ shell.environment = { CLAUDE_CONFIG_DIR: path('new-claude'), CODEX_HOME: path('new-codex') }+ for (const folder of ['sessions', 'archived_sessions']) {+ const transcriptPath = join(codex, folder, 'thread.jsonl')+ check(`bound:${folder}`, [homes.sessionCodexHome({ transcriptPath }), homes.sessionFolderOf('codex', { transcriptPath }),+ homes.sessionCodexHome({ transcriptPath, codexHome: profile })])+ }+ check('bound:claude', homes.sessionClaudeHome({ transcriptPath: join(claude, 'projects', 'workspace', 'thread.jsonl') }))+ check('bound:sibling-prefix', [homes.sessionCodexHome({ transcriptPath: join(codex, 'sessions-other', 'thread.jsonl') }),+ homes.sessionClaudeHome({ transcriptPath: join(claude, 'projects-other', 'thread.jsonl') })])+ check('launch:shell', [homes.launchCodexHome(null), homes.launchClaudeConfigDir()])+ check('launch:profile', homes.launchCodexHome(profile))+ check('launch:explicit-environment', [homes.launchCodexHome(null, { CODEX_HOME: `${codex}/` }), homes.launchClaudeConfigDir({ CLAUDE_CONFIG_DIR: claude })])+ check('launch:invalid-environment', [homes.launchCodexHome(null, { CODEX_HOME: '~/invalid' }), homes.launchClaudeConfigDir({ CLAUDE_CONFIG_DIR: 'relative' })])+ shell.environment = {}+ check('bound:no-shell-cache', [homes.sessionCodexHome({ transcriptPath: join(extra, 'sessions', 'thread.jsonl') }),+ homes.sessionClaudeHome({ transcriptPath: join(claude, 'projects', 'workspace', 'thread.jsonl') })])+})+it('records every observation', () => { if (!RECORD) expect(Object.keys(captured).sort()).toEqual(Object.keys(expected).sort()) })diff --git a/cli/src/lib/engineHomes.ts b/cli/src/lib/engineHomes.tsindex 3407d217c..9ad9fa1fa 100644--- a/cli/src/lib/engineHomes.ts+++ b/cli/src/lib/engineHomes.ts@@ -27,10 +27,16 @@ import type { LaunchHome } from '../engines/facets/launch.js'import { sessionStoreContracts, sessionStoreOf, type SessionStoreEngine } from '../engines/sessionStoreContracts.js'import type { AgentEngine } from '../engines/types.js'import { loginShellEnvironment } from './loginShellEnv.js'+import { MAX_CATALOG_HOMES, readHomeCatalog, type HomeCatalog } from '../engines/kit/homeCatalog.js'+import { IdentityReadUnavailable } from '../engines/kit/identityScan.js'/** The homes each engine's person moved (its session store's `sessions.moved.variable`), by engine, as saved. */const movedByEngine = Object.fromEntries(Object.keys(sessionStoreContracts).map((engine) => [engine, [] as string[]])) as Record<SessionStoreEngine, string[]>let loadedStamp = ''+// Positive facts only: they can require a hold, never supply roots absent from a fresh read.+let nativeCatalogFile = ''+let nativeKnownHomes: HomeCatalog = { claude: [], codex: [] }+let nativeCatalogOverflow = falseconst savedFile = (): string => join(env.ADAPTER_DATA_DIR, 'engine-homes.json')@@ -121,6 +127,45 @@ export function sessionRoots(engine: AgentEngine | string, profile?: string | nureturn [below(env[own.setting]), ...movedHomes(engine).map((home) => join(home, moved.folder))]}+/** Complete native identity pools cannot use the legacy reader's partial or cached catalog.+ * Legacy lifecycle callers migrate separately, together with their durable hold/retry handling. */+export function nativeSessionRoots(engine: AgentEngine | string, profile?: string | null): string[] {+ const store = sessionStoreOf(engine)+ if (!store) return []+ const { own, moved, profile: followsProfile } = store.sessions+ const below = (home: string): string => own.folder ? join(home, own.folder) : home+ if (followsProfile && profile) return [below(profile)]+ const file = savedFile(), read = readHomeCatalog(file)+ if (nativeCatalogFile !== file) {+ nativeCatalogFile = file; nativeKnownHomes = { claude: [], codex: [] }; nativeCatalogOverflow = false+ }+ const names = Object.keys(sessionStoreContracts) as SessionStoreEngine[]+ const overflow = (): never => {+ nativeCatalogOverflow = true+ throw new IdentityReadUnavailable('the known session-home limit was reached')+ }+ if (nativeCatalogOverflow) overflow()+ for (const name of names) {+ // Adoption predates this boundary and can keep an unsaved home in memory. Bound that+ // legacy list before copying or visiting it; remembering an overflow also prevents forgetting it.+ const legacy = movedByEngine[name]+ if (legacy.length > MAX_CATALOG_HOMES) overflow()+ for (const list of [read.homes[name], legacy]) for (const home of list) {+ if (nativeKnownHomes[name].includes(home)) continue+ if (nativeKnownHomes[name].length === MAX_CATALOG_HOMES) overflow()+ nativeKnownHomes[name].push(home)+ }+ }+ // Even a held read can reveal a competitor. Retain all bounded positive facts before+ // checking omissions, so A -> B (held) -> A cannot forget the observed B.+ for (const name of names) {+ if (nativeKnownHomes[name].some(home => !read.homes[name].includes(home))) {+ throw new IdentityReadUnavailable('the saved engine-home catalog omits a previously observed or unsaved home')+ }+ }+ return [below(env[own.setting]), ...read.homes[engine as SessionStoreEngine].map(home => join(home, moved.folder))]+}+/** Every moved home known: adopted on this boot or an earlier one. */export function movedEngineHomes(): { claude: string[]; codex: string[] } {return { claude: movedHomes('claude'), codex: movedHomes('codex') }@@ -246,4 +291,7 @@ export function profileEnvironment(engine: AgentEngine | string, home: string):export function resetEngineHomes(): void {for (const homes of Object.values(movedByEngine)) homes.length = 0loadedStamp = ''+ nativeCatalogFile = ''+ nativeKnownHomes = { claude: [], codex: [] }+ nativeCatalogOverflow = false}diff --git a/cli/src/lib/sessionRepair.ts b/cli/src/lib/sessionRepair.tsindex c9652ac2d..d01f6fa06 100644--- a/cli/src/lib/sessionRepair.ts+++ b/cli/src/lib/sessionRepair.ts@@ -35,7 +35,7 @@ import { COPILOT_CWD } from '../engines/copilot/contract.js'import { recordCwd } from '../engines/kit/sessionLocation.js'import { sqliteReadAll, type SqliteParam } from './sqliteRead.js'import { sqlitePreflightMessage } from './sqliteAvailability.js'-import { sessionRoots } from './engineHomes.js'+import { nativeSessionRoots } from './engineHomes.js'import { argvTokens, engineProcessMatchScore, processRows, type ProcessRow } from './tmux.js'/**@@ -54,7 +54,7 @@ const MAX_FILES = 400/** Known empty homes still require native probes. Do not let a saved catalog bypass the walk bound. */function repairRoots(engine: AgentEngine, profile?: string): string[] {- const roots = sessionRoots(engine, profile)+ const roots = nativeSessionRoots(engine, profile)if (roots.length > 64) throw new IdentityReadUnavailable('the known session-home limit was reached')return roots}diff --git a/docs/research/2026-10-09-daemon-core-completion.md b/docs/research/2026-10-09-daemon-core-completion.mdindex 6ec04b891..02b4ccce8 100644--- a/docs/research/2026-10-09-daemon-core-completion.md+++ b/docs/research/2026-10-09-daemon-core-completion.md@@ -17,10 +17,11 @@ This is the remaining completion scope as of October 9, after the six extraction- [x] Exact Cursor/Grok locations, Copilot/agy process claims and discovery retries retain incomplete evidence (#1118, merged as `902ab6038` at 15:01:46 UTC).- [x] Fresh bounded Hermes pools and Stop home preservation (#1120, merged as `a847441e5` at 16:39:44 UTC).+- [x] Complete exact Claude/Codex/Pi resume pools and typed Pi Close recovery (#1123, merged as `fb834fb18` at 17:14:15 UTC).## Remaining blockers-1. **Complete native identity and retry.** Bound exact transcript lookup, lock/descriptor enumeration and the saved-home catalog. The native Hermes pool is landed; optional home promotion and shared handle-cache lifetime still need their authority/resource audit. An unreadable or truncated pool cannot prove absence or uniqueness. Every binding entry and transcript poll retains pending work, isolates a failed lookup, and retries without blocking sibling sessions or readiness. Surface the hold reason through the shared session state.+1. **Complete native identity and retry.** Exact transcript lookup is landed; lock/descriptor enumeration, legacy registry repair and the saved-home catalog remain. The [catalog audit](2026-10-09-native-home-catalog.md) records its fresh-evidence boundary and required remaining caller/writer migration. The native Hermes pool is landed; optional home promotion and shared handle-cache lifetime still need their authority/resource audit. An unreadable or truncated pool cannot prove absence or uniqueness. Every binding entry and transcript poll retains pending work, isolates a failed lookup, and retries without blocking sibling sessions or readiness. Surface the hold reason through the shared session state.2. **Complete native launch preparation.** Probe executable/version facts asynchronously with a deadline and one confirmed executable snapshot per launch. Failed hook writes/removals hold launch, preserve foreign configuration and are checked consistently by create, fork, restart, retarget, restore and upgrades. Do not memoize an unavailable version as a permanent answer.3. **Durable manual lifecycle intent and mutation authority.** Preserve create/fork/restart/retarget requests across unavailable services and daemon restart. Publish generated configuration atomically after dependencies are ready. Check immutable session ownership after every relevant await and before native writes, signals and publication. Reconcile unconfirmed OpenCode v2 mutations read-only; unreadable catalogs must not authorize mutation. Cover v1 missing-row/rollback cases and report a confirmed native change followed by failed respawn truthfully.4. **Close, turns and input stay in core.** Audit OpenCode v2 Close checkpointing against its current conversation store; unavailable checkpoint/activity evidence keeps the live session with its reason. Finish per-engine Stop/turn facts, authority across asynchronous drains, Cursor pending-task persistence, agy backstop control, input verification declarations, and Pi header/argv and unwritten-conversation handling.diff --git a/docs/research/2026-10-09-native-home-catalog-cost.json b/docs/research/2026-10-09-native-home-catalog-cost.jsonnew file mode 100644index 000000000..203e79b25--- /dev/null+++ b/docs/research/2026-10-09-native-home-catalog-cost.json@@ -0,0 +1,2120 @@+{+ "startedAt": "2026-10-09T17:56:18.623751+00:00",+ "finishedAt": "2026-10-09T17:56:35.357070+00:00",+ "method": "Three interleaved fresh processes per source/workload, twenty-five root collections per process. Identical private files. Setup and imports excluded from root-collection CPU/latency; peak RSS includes setup/import. No daemon or vendor binary. Reference measurements, no numerical performance gate.",+ "driver": "/** Fresh private catalog workloads. No daemon, vendor binary or owner input. */\nimport { chmodSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, statSync, utimesSync, writeFileSync } from 'node:fs'\nimport { tmpdir } from 'node:os'\nimport { join, resolve } from 'node:path'\nimport { pathToFileURL } from 'node:url'\nimport { performance } from 'node:perf_hooks'\n\nconst workload = process.argv[2] ?? 'empty'\nconst cli = process.env.CATALOG_COST_CLI ?? resolve(import.meta.dirname, '../..')\nconst root = realpathSync(mkdtempSync(join(tmpdir(), 'home-catalog-cost-')))\nfor (const name of ['HOME', 'ADAPTER_DATA_DIR', 'ADAPTER_RUNTIME_DIR', 'CODEX_HOME', 'CLAUDE_CONFIG_DIR']) process.env[name] = join(root, name)\nprocess.env.CLAUDE_PROJECTS_DIR = join(process.env.CLAUDE_CONFIG_DIR!, 'projects')\nconst data = process.env.ADAPTER_DATA_DIR!, file = join(data, 'engine-homes.json')\nmkdirSync(data)\ntry {\n const homes = await import(pathToFileURL(join(cli, 'src/lib/engineHomes.ts')).href)\n const roots = homes.nativeSessionRoots ?? homes.sessionRoots\n const count = workload === 'eight' ? 8 : workload === 'full' || workload === 'large' ? 63 : 0\n const known = Array.from({ length: count }, (_, i) => join(root, `moved-${i}${workload === 'large' ? 'x'.repeat(940) : ''}`))\n const text = JSON.stringify({ claude: [], codex: known })\n if (workload !== 'empty') writeFileSync(file, text, { mode: 0o600 })\n if (workload === 'malformed') writeFileSync(file, '{')\n if (workload === 'oversized') writeFileSync(file, ' '.repeat(65537))\n if (workload === 'same-stamp') {\n const changed = JSON.stringify({ codex: [join(root, 'added')] })\n writeFileSync(file, '{\"codex\":[]}'.padEnd(changed.length, ' '))\n const at = new Date('2026-10-09T00:00:00Z'); utimesSync(file, at, at)\n roots('codex')\n writeFileSync(file, changed); utimesSync(file, at, at)\n }\n if (workload === 'unsaved') {\n chmodSync(data, 0o500)\n homes.adoptHomes({ CODEX_HOME: join(root, 'unsaved') })\n if (readFileSync(file, 'utf8') !== text) throw new Error('The private write-failure fixture was not effective')\n }\n const bytes = workload === 'empty' ? 0 : statSync(file).size\n const latenciesMs: number[] = [], outcomes: Record<string, number> = {}\n const cpu = process.cpuUsage()\n for (let i = 0; i < 25; i++) {\n const started = performance.now()\n let outcome: string\n try { outcome = `roots:${roots('codex').length}` }\n catch (error) {\n if ((error as { code?: string }).code !== 'IDENTITY_UNAVAILABLE') throw error\n outcome = 'held'\n }\n latenciesMs.push(Number((performance.now() - started).toFixed(4)))\n outcomes[outcome] = (outcomes[outcome] ?? 0) + 1\n }\n const used = process.cpuUsage(cpu)\n console.log(JSON.stringify({ workload, iterations: 25, bytes, outcomes, latenciesMs,\n cpuMs: (used.user + used.system) / 1000, peakRssMiB: process.resourceUsage().maxRSS / 1024,\n node: process.version, platform: process.platform, arch: process.arch }))\n} finally { chmodSync(data, 0o700); rmSync(root, { recursive: true, force: true }) }\n",+ "samples": [+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 0,+ "wallSeconds": 0.369,+ "workload": "empty",+ "iterations": 25,+ "bytes": 0,+ "outcomes": {+ "roots:1": 25+ },+ "latenciesMs": [+ 0.1873,+ 0.0224,+ 0.0174,+ 0.0148,+ 0.0196,+ 0.0137,+ 0.0131,+ 0.0133,+ 0.0635,+ 0.0352,+ 0.0187,+ 0.0149,+ 0.0141,+ 0.014,+ 0.014,+ 0.0147,+ 0.0139,+ 0.0138,+ 0.0136,+ 0.0136,+ 0.0136,+ 0.0139,+ 0.0143,+ 0.0136,+ 0.0134+ ],+ "cpuMs": 1.204,+ "peakRssMiB": 80.328125,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 0,+ "wallSeconds": 0.386,+ "workload": "empty",+ "iterations": 25,+ "bytes": 0,+ "outcomes": {+ "roots:1": 25+ },+ "latenciesMs": [+ 0.3876,+ 0.0493,+ 0.1113,+ 0.0632,+ 0.035,+ 0.0278,+ 0.0599,+ 0.0437,+ 0.0355,+ 0.0428,+ 0.0335,+ 0.0296,+ 0.0284,+ 0.0284,+ 0.0253,+ 0.024,+ 0.0249,+ 0.0247,+ 0.0254,+ 0.0278,+ 0.025,+ 0.0236,+ 0.0241,+ 0.0243,+ 0.0274+ ],+ "cpuMs": 4.281,+ "peakRssMiB": 84.63671875,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 0,+ "wallSeconds": 0.333,+ "workload": "eight",+ "iterations": 25,+ "bytes": 407,+ "outcomes": {+ "roots:9": 25+ },+ "latenciesMs": [+ 0.2864,+ 0.0328,+ 0.0231,+ 0.0273,+ 0.0312,+ 0.0909,+ 0.0352,+ 0.0207,+ 0.0185,+ 0.0212,+ 0.0168,+ 0.016,+ 0.0158,+ 0.0154,+ 0.0154,+ 0.0155,+ 0.0155,+ 0.0159,+ 0.0159,+ 0.0157,+ 0.0206,+ 0.0164,+ 0.0158,+ 0.0173,+ 0.0167+ ],+ "cpuMs": 1.962,+ "peakRssMiB": 80.671875,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 0,+ "wallSeconds": 0.345,+ "workload": "eight",+ "iterations": 25,+ "bytes": 407,+ "outcomes": {+ "roots:9": 25+ },+ "latenciesMs": [+ 0.8555,+ 0.4574,+ 0.2359,+ 0.1657,+ 0.2212,+ 0.1397,+ 0.2,+ 0.1648,+ 0.1425,+ 0.1399,+ 0.1219,+ 0.1238,+ 0.1021,+ 0.0935,+ 0.0911,+ 0.0848,+ 0.0826,+ 0.0835,+ 0.0863,+ 0.0905,+ 0.09,+ 0.1062,+ 0.1554,+ 0.1,+ 0.0859+ ],+ "cpuMs": 8.771,+ "peakRssMiB": 79.64453125,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 0,+ "wallSeconds": 0.35,+ "workload": "full",+ "iterations": 25,+ "bytes": 3100,+ "outcomes": {+ "roots:64": 25+ },+ "latenciesMs": [+ 0.3913,+ 0.082,+ 0.0667,+ 0.0635,+ 0.1196,+ 0.0929,+ 0.0741,+ 0.0615,+ 0.0825,+ 0.0659,+ 0.0595,+ 0.0573,+ 0.0572,+ 0.0729,+ 0.0607,+ 0.0554,+ 0.0548,+ 0.0556,+ 0.0853,+ 0.0843,+ 0.0846,+ 0.095,+ 0.102,+ 0.0842,+ 0.081+ ],+ "cpuMs": 5.111,+ "peakRssMiB": 80.51953125,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 0,+ "wallSeconds": 0.335,+ "workload": "full",+ "iterations": 25,+ "bytes": 3100,+ "outcomes": {+ "roots:64": 25+ },+ "latenciesMs": [+ 1.1664,+ 0.4029,+ 0.2594,+ 0.2111,+ 0.2102,+ 0.2456,+ 0.2587,+ 0.2012,+ 0.2035,+ 0.2142,+ 0.2134,+ 0.2112,+ 0.2109,+ 0.2376,+ 0.2228,+ 0.2078,+ 0.2093,+ 0.2095,+ 0.2106,+ 0.2494,+ 0.2301,+ 0.3133,+ 0.2489,+ 0.2275,+ 0.2527+ ],+ "cpuMs": 15.249,+ "peakRssMiB": 86.37109375,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 0,+ "wallSeconds": 0.31,+ "workload": "large",+ "iterations": 25,+ "bytes": 62320,+ "outcomes": {+ "roots:64": 25+ },+ "latenciesMs": [+ 0.6569,+ 0.2729,+ 0.2454,+ 0.2387,+ 0.3133,+ 0.2746,+ 0.2843,+ 0.2901,+ 0.3185,+ 0.3045,+ 0.3101,+ 0.2791,+ 0.2873,+ 0.2786,+ 0.2788,+ 0.2743,+ 0.3002,+ 0.2793,+ 0.2972,+ 0.2782,+ 0.2923,+ 0.3143,+ 0.6291,+ 0.2522,+ 0.2405+ ],+ "cpuMs": 17.497,+ "peakRssMiB": 85.87109375,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 0,+ "wallSeconds": 0.317,+ "workload": "large",+ "iterations": 25,+ "bytes": 62320,+ "outcomes": {+ "roots:64": 25+ },+ "latenciesMs": [+ 1.1286,+ 0.572,+ 0.511,+ 0.6171,+ 0.6426,+ 0.6357,+ 0.637,+ 0.6745,+ 0.6125,+ 0.5687,+ 0.8554,+ 0.4655,+ 0.4468,+ 0.4398,+ 0.4422,+ 0.5235,+ 0.555,+ 0.547,+ 0.5642,+ 0.5517,+ 0.5518,+ 0.5841,+ 0.9796,+ 0.4715,+ 0.4466+ ],+ "cpuMs": 31.22,+ "peakRssMiB": 89.5625,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 0,+ "wallSeconds": 0.319,+ "workload": "malformed",+ "iterations": 25,+ "bytes": 1,+ "outcomes": {+ "roots:1": 25+ },+ "latenciesMs": [+ 0.2732,+ 0.027,+ 0.0165,+ 0.0142,+ 0.0145,+ 0.0685,+ 0.0314,+ 0.0157,+ 0.0183,+ 0.0253,+ 0.0129,+ 0.0104,+ 0.0095,+ 0.0096,+ 0.0105,+ 0.01,+ 0.0103,+ 0.0098,+ 0.0097,+ 0.0096,+ 0.0116,+ 0.0096,+ 0.0095,+ 0.0094,+ 0.0098+ ],+ "cpuMs": 1.201,+ "peakRssMiB": 75.4140625,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 0,+ "wallSeconds": 0.324,+ "workload": "malformed",+ "iterations": 25,+ "bytes": 1,+ "outcomes": {+ "held": 25+ },+ "latenciesMs": [+ 0.5789,+ 0.1988,+ 0.1653,+ 0.1109,+ 0.1156,+ 0.0969,+ 0.1403,+ 0.0907,+ 0.0918,+ 0.0957,+ 0.0863,+ 0.0845,+ 0.0872,+ 0.0855,+ 0.0897,+ 0.0852,+ 0.0836,+ 0.083,+ 0.0846,+ 0.0838,+ 0.0838,+ 0.0907,+ 0.1051,+ 0.0861,+ 0.0809+ ],+ "cpuMs": 6.176,+ "peakRssMiB": 78.8671875,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 0,+ "wallSeconds": 0.327,+ "workload": "oversized",+ "iterations": 25,+ "bytes": 65537,+ "outcomes": {+ "roots:1": 25+ },+ "latenciesMs": [+ 0.3869,+ 0.0279,+ 0.0178,+ 0.0152,+ 0.0147,+ 0.0713,+ 0.0333,+ 0.0171,+ 0.0157,+ 0.0263,+ 0.014,+ 0.0115,+ 0.0109,+ 0.0103,+ 0.0102,+ 0.0102,+ 0.01,+ 0.0103,+ 0.0101,+ 0.0103,+ 0.0101,+ 0.0101,+ 0.0103,+ 0.0105,+ 0.0102+ ],+ "cpuMs": 1.863,+ "peakRssMiB": 80.34375,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 0,+ "wallSeconds": 0.326,+ "workload": "oversized",+ "iterations": 25,+ "bytes": 65537,+ "outcomes": {+ "held": 25+ },+ "latenciesMs": [+ 0.3029,+ 0.0311,+ 0.024,+ 0.0214,+ 0.0172,+ 0.0705,+ 0.0327,+ 0.0192,+ 0.0233,+ 0.0271,+ 0.0191,+ 0.0157,+ 0.0166,+ 0.0153,+ 0.0149,+ 0.0147,+ 0.0146,+ 0.0145,+ 0.0147,+ 0.0146,+ 0.0147,+ 0.0144,+ 0.0143,+ 0.0147,+ 0.0142+ ],+ "cpuMs": 1.62,+ "peakRssMiB": 79.6171875,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 0,+ "wallSeconds": 0.334,+ "workload": "same-stamp",+ "iterations": 25,+ "bytes": 57,+ "outcomes": {+ "roots:1": 25+ },+ "latenciesMs": [+ 0.038,+ 0.0188,+ 0.019,+ 0.0521,+ 0.1262,+ 0.0438,+ 0.0223,+ 0.0205,+ 0.0328,+ 0.016,+ 0.0125,+ 0.0134,+ 0.0105,+ 0.0104,+ 0.011,+ 0.0103,+ 0.0101,+ 0.0102,+ 0.0103,+ 0.0105,+ 0.0147,+ 0.0115,+ 0.0101,+ 0.0101,+ 0.0102+ ],+ "cpuMs": 1.053,+ "peakRssMiB": 81.00390625,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 0,+ "wallSeconds": 0.33,+ "workload": "same-stamp",+ "iterations": 25,+ "bytes": 57,+ "outcomes": {+ "roots:2": 25+ },+ "latenciesMs": [+ 0.3045,+ 0.2462,+ 0.1813,+ 0.1345,+ 0.1037,+ 0.1784,+ 0.1016,+ 0.0894,+ 0.0838,+ 0.0778,+ 0.0735,+ 0.0715,+ 0.0722,+ 0.0726,+ 0.0704,+ 0.0703,+ 0.0696,+ 0.0691,+ 0.0698,+ 0.0687,+ 0.0684,+ 0.07,+ 0.0696,+ 0.0682,+ 0.0675+ ],+ "cpuMs": 6.635,+ "peakRssMiB": 81.23828125,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 0,+ "wallSeconds": 0.328,+ "workload": "unsaved",+ "iterations": 25,+ "bytes": 24,+ "outcomes": {+ "roots:2": 25+ },+ "latenciesMs": [+ 0.1217,+ 0.0278,+ 0.0227,+ 0.0166,+ 0.082,+ 0.0391,+ 0.0224,+ 0.0313,+ 0.0215,+ 0.023,+ 0.0144,+ 0.0127,+ 0.0169,+ 0.0127,+ 0.0111,+ 0.0109,+ 0.0114,+ 0.0161,+ 0.0149,+ 0.0115,+ 0.011,+ 0.0109,+ 0.0115,+ 0.0142,+ 0.0143+ ],+ "cpuMs": 1.502,+ "peakRssMiB": 80.8515625,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 0,+ "wallSeconds": 0.345,+ "workload": "unsaved",+ "iterations": 25,+ "bytes": 24,+ "outcomes": {+ "held": 25+ },+ "latenciesMs": [+ 0.6167,+ 0.21,+ 0.1702,+ 0.1718,+ 0.2358,+ 0.1241,+ 0.1655,+ 0.1158,+ 0.0996,+ 0.0979,+ 0.09,+ 0.0871,+ 0.0863,+ 0.0856,+ 0.0855,+ 0.1238,+ 0.0955,+ 0.0823,+ 0.0822,+ 0.0819,+ 0.083,+ 0.0819,+ 0.0835,+ 0.0821,+ 0.0824+ ],+ "cpuMs": 7.04,+ "peakRssMiB": 80.00390625,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 1,+ "wallSeconds": 0.367,+ "workload": "empty",+ "iterations": 25,+ "bytes": 0,+ "outcomes": {+ "roots:1": 25+ },+ "latenciesMs": [+ 0.3445,+ 0.0486,+ 0.1072,+ 0.0581,+ 0.0328,+ 0.0276,+ 0.0593,+ 0.0398,+ 0.0315,+ 0.0347,+ 0.0262,+ 0.0261,+ 0.0245,+ 0.0242,+ 0.0241,+ 0.0249,+ 0.0254,+ 0.0241,+ 0.0246,+ 0.0274,+ 0.0239,+ 0.023,+ 0.0226,+ 0.0234,+ 0.0229+ ],+ "cpuMs": 2.291,+ "peakRssMiB": 82.671875,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 1,+ "wallSeconds": 0.346,+ "workload": "empty",+ "iterations": 25,+ "bytes": 0,+ "outcomes": {+ "roots:1": 25+ },+ "latenciesMs": [+ 0.202,+ 0.0235,+ 0.0175,+ 0.0148,+ 0.015,+ 0.0143,+ 0.0138,+ 0.0216,+ 0.0701,+ 0.0368,+ 0.0178,+ 0.0143,+ 0.0139,+ 0.0136,+ 0.0136,+ 0.0137,+ 0.0139,+ 0.0135,+ 0.0135,+ 0.0136,+ 0.0133,+ 0.0133,+ 0.0138,+ 0.0132,+ 0.0132+ ],+ "cpuMs": 1.364,+ "peakRssMiB": 75.5,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 1,+ "wallSeconds": 0.342,+ "workload": "eight",+ "iterations": 25,+ "bytes": 407,+ "outcomes": {+ "roots:9": 25+ },+ "latenciesMs": [+ 0.667,+ 0.3794,+ 0.1914,+ 0.1296,+ 0.1944,+ 0.1256,+ 0.1929,+ 0.1236,+ 0.1052,+ 0.0985,+ 0.0911,+ 0.0869,+ 0.0897,+ 0.0863,+ 0.0864,+ 0.0845,+ 0.0852,+ 0.0881,+ 0.0845,+ 0.0872,+ 0.0842,+ 0.0952,+ 0.0842,+ 0.0866,+ 0.0903+ ],+ "cpuMs": 7.204,+ "peakRssMiB": 78.734375,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 1,+ "wallSeconds": 0.378,+ "workload": "eight",+ "iterations": 25,+ "bytes": 407,+ "outcomes": {+ "roots:9": 25+ },+ "latenciesMs": [+ 0.3541,+ 0.039,+ 0.0265,+ 0.0314,+ 0.0373,+ 0.1113,+ 0.0404,+ 0.0215,+ 0.0192,+ 0.0218,+ 0.0173,+ 0.016,+ 0.0175,+ 0.016,+ 0.0156,+ 0.0155,+ 0.0156,+ 0.0156,+ 0.0155,+ 0.0155,+ 0.0151,+ 0.0156,+ 0.0156,+ 0.0153,+ 0.0153+ ],+ "cpuMs": 1.967,+ "peakRssMiB": 80.5,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 1,+ "wallSeconds": 0.362,+ "workload": "full",+ "iterations": 25,+ "bytes": 3100,+ "outcomes": {+ "roots:64": 25+ },+ "latenciesMs": [+ 0.9258,+ 0.3336,+ 0.263,+ 0.2198,+ 0.2208,+ 0.2467,+ 0.2604,+ 0.2059,+ 0.2058,+ 0.1813,+ 0.2165,+ 0.2542,+ 0.2265,+ 0.2355,+ 0.2247,+ 0.2189,+ 0.2156,+ 0.2205,+ 0.2377,+ 0.2229,+ 0.2198,+ 0.3372,+ 0.234,+ 0.2218,+ 0.2231+ ],+ "cpuMs": 14.653,+ "peakRssMiB": 80.81640625,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 1,+ "wallSeconds": 0.345,+ "workload": "full",+ "iterations": 25,+ "bytes": 3100,+ "outcomes": {+ "roots:64": 25+ },+ "latenciesMs": [+ 0.3785,+ 0.0827,+ 0.0654,+ 0.0634,+ 0.1204,+ 0.0942,+ 0.0742,+ 0.0617,+ 0.0792,+ 0.065,+ 0.0575,+ 0.0575,+ 0.0569,+ 0.0673,+ 0.0577,+ 0.0557,+ 0.0548,+ 0.0564,+ 0.0712,+ 0.0853,+ 0.0962,+ 0.0998,+ 0.0864,+ 0.0865,+ 0.0882+ ],+ "cpuMs": 3.973,+ "peakRssMiB": 78.78515625,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 1,+ "wallSeconds": 0.343,+ "workload": "large",+ "iterations": 25,+ "bytes": 62320,+ "outcomes": {+ "roots:64": 25+ },+ "latenciesMs": [+ 1.2502,+ 0.6317,+ 0.6357,+ 0.6414,+ 0.606,+ 0.7242,+ 0.7069,+ 0.6844,+ 0.6549,+ 0.5869,+ 0.9993,+ 0.5008,+ 0.4917,+ 0.462,+ 0.4612,+ 0.5323,+ 0.6319,+ 0.5774,+ 0.5684,+ 0.5759,+ 0.5998,+ 0.6273,+ 1.6953,+ 0.5153,+ 0.4476+ ],+ "cpuMs": 34.518,+ "peakRssMiB": 89.51953125,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 1,+ "wallSeconds": 0.325,+ "workload": "large",+ "iterations": 25,+ "bytes": 62320,+ "outcomes": {+ "roots:64": 25+ },+ "latenciesMs": [+ 0.6375,+ 0.2597,+ 0.2444,+ 0.2414,+ 0.3027,+ 0.2707,+ 0.2569,+ 0.3236,+ 0.3083,+ 0.3109,+ 0.2901,+ 0.2922,+ 0.2882,+ 0.2862,+ 0.2787,+ 0.3113,+ 0.2851,+ 0.2829,+ 0.2766,+ 0.2835,+ 0.2823,+ 0.3002,+ 0.2747,+ 0.6588,+ 0.2515+ ],+ "cpuMs": 17.157,+ "peakRssMiB": 83.8984375,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 1,+ "wallSeconds": 0.329,+ "workload": "malformed",+ "iterations": 25,+ "bytes": 1,+ "outcomes": {+ "held": 25+ },+ "latenciesMs": [+ 0.7113,+ 0.2389,+ 0.1787,+ 0.1193,+ 0.1328,+ 0.1197,+ 0.1494,+ 0.0991,+ 0.0914,+ 0.0961,+ 0.0868,+ 0.0855,+ 0.0847,+ 0.0898,+ 0.0859,+ 0.0887,+ 0.0873,+ 0.0825,+ 0.0842,+ 0.0903,+ 0.1044,+ 0.0965,+ 0.1002,+ 0.1175,+ 0.0869+ ],+ "cpuMs": 6.908,+ "peakRssMiB": 79.7578125,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 1,+ "wallSeconds": 0.325,+ "workload": "malformed",+ "iterations": 25,+ "bytes": 1,+ "outcomes": {+ "roots:1": 25+ },+ "latenciesMs": [+ 0.2864,+ 0.0264,+ 0.0171,+ 0.0177,+ 0.0143,+ 0.0666,+ 0.031,+ 0.0162,+ 0.0145,+ 0.0249,+ 0.0141,+ 0.0114,+ 0.0106,+ 0.0107,+ 0.0106,+ 0.0107,+ 0.0102,+ 0.0103,+ 0.01,+ 0.0102,+ 0.0101,+ 0.0101,+ 0.0099,+ 0.0098,+ 0.0098+ ],+ "cpuMs": 1.506,+ "peakRssMiB": 79.375,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 1,+ "wallSeconds": 0.337,+ "workload": "oversized",+ "iterations": 25,+ "bytes": 65537,+ "outcomes": {+ "held": 25+ },+ "latenciesMs": [+ 0.3245,+ 0.0342,+ 0.0267,+ 0.0233,+ 0.0201,+ 0.0761,+ 0.0354,+ 0.0208,+ 0.0213,+ 0.0289,+ 0.0217,+ 0.0178,+ 0.017,+ 0.0167,+ 0.0161,+ 0.0161,+ 0.0161,+ 0.0183,+ 0.0169,+ 0.0163,+ 0.016,+ 0.0163,+ 0.016,+ 0.0162,+ 0.0161+ ],+ "cpuMs": 1.477,+ "peakRssMiB": 79.9375,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 1,+ "wallSeconds": 0.337,+ "workload": "oversized",+ "iterations": 25,+ "bytes": 65537,+ "outcomes": {+ "roots:1": 25+ },+ "latenciesMs": [+ 0.4062,+ 0.0272,+ 0.0181,+ 0.0154,+ 0.015,+ 0.0698,+ 0.0327,+ 0.0171,+ 0.016,+ 0.0261,+ 0.0143,+ 0.0116,+ 0.011,+ 0.0111,+ 0.0109,+ 0.0108,+ 0.0105,+ 0.0107,+ 0.0105,+ 0.0105,+ 0.0106,+ 0.0106,+ 0.0106,+ 0.0106,+ 0.0106+ ],+ "cpuMs": 1.668,+ "peakRssMiB": 78.28515625,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 1,+ "wallSeconds": 0.332,+ "workload": "same-stamp",+ "iterations": 25,+ "bytes": 57,+ "outcomes": {+ "roots:2": 25+ },+ "latenciesMs": [+ 0.2573,+ 0.253,+ 0.1826,+ 0.1393,+ 0.1075,+ 0.1867,+ 0.1029,+ 0.0914,+ 0.0834,+ 0.0757,+ 0.0742,+ 0.0889,+ 0.0744,+ 0.074,+ 0.0713,+ 0.0731,+ 0.0711,+ 0.0717,+ 0.0752,+ 0.0769,+ 0.0742,+ 0.074,+ 0.0807,+ 0.075,+ 0.0751+ ],+ "cpuMs": 5.508,+ "peakRssMiB": 82.86328125,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 1,+ "wallSeconds": 0.328,+ "workload": "same-stamp",+ "iterations": 25,+ "bytes": 57,+ "outcomes": {+ "roots:1": 25+ },+ "latenciesMs": [+ 0.0317,+ 0.0189,+ 0.0165,+ 0.0144,+ 0.0707,+ 0.0337,+ 0.017,+ 0.015,+ 0.0329,+ 0.0143,+ 0.0115,+ 0.0109,+ 0.0109,+ 0.0107,+ 0.0104,+ 0.0103,+ 0.0102,+ 0.0104,+ 0.0106,+ 0.0131,+ 0.0107,+ 0.0103,+ 0.0102,+ 0.0103,+ 0.0105+ ],+ "cpuMs": 1.473,+ "peakRssMiB": 79.4765625,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 1,+ "wallSeconds": 0.325,+ "workload": "unsaved",+ "iterations": 25,+ "bytes": 24,+ "outcomes": {+ "held": 25+ },+ "latenciesMs": [+ 0.5956,+ 0.1988,+ 0.1671,+ 0.1697,+ 0.2317,+ 0.1219,+ 0.1568,+ 0.1096,+ 0.095,+ 0.0936,+ 0.0851,+ 0.0808,+ 0.0801,+ 0.0893,+ 0.0819,+ 0.0793,+ 0.079,+ 0.0792,+ 0.078,+ 0.079,+ 0.0782,+ 0.0783,+ 0.0785,+ 0.0781,+ 0.0781+ ],+ "cpuMs": 6.769,+ "peakRssMiB": 78.9765625,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 1,+ "wallSeconds": 0.337,+ "workload": "unsaved",+ "iterations": 25,+ "bytes": 24,+ "outcomes": {+ "roots:2": 25+ },+ "latenciesMs": [+ 0.1151,+ 0.024,+ 0.0186,+ 0.0158,+ 0.0695,+ 0.0332,+ 0.0197,+ 0.0275,+ 0.0177,+ 0.0224,+ 0.0135,+ 0.0117,+ 0.0115,+ 0.0111,+ 0.0111,+ 0.0108,+ 0.0131,+ 0.0109,+ 0.0109,+ 0.0108,+ 0.0106,+ 0.0107,+ 0.0108,+ 0.011,+ 0.0109+ ],+ "cpuMs": 1.548,+ "peakRssMiB": 79.91796875,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 2,+ "wallSeconds": 0.341,+ "workload": "empty",+ "iterations": 25,+ "bytes": 0,+ "outcomes": {+ "roots:1": 25+ },+ "latenciesMs": [+ 0.1849,+ 0.0226,+ 0.0169,+ 0.0148,+ 0.0152,+ 0.0142,+ 0.0135,+ 0.0131,+ 0.0671,+ 0.0375,+ 0.0183,+ 0.0148,+ 0.0139,+ 0.0134,+ 0.0133,+ 0.0132,+ 0.0132,+ 0.0133,+ 0.0136,+ 0.0137,+ 0.0134,+ 0.0132,+ 0.014,+ 0.0133,+ 0.0132+ ],+ "cpuMs": 1.215,+ "peakRssMiB": 77.6015625,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 2,+ "wallSeconds": 0.335,+ "workload": "empty",+ "iterations": 25,+ "bytes": 0,+ "outcomes": {+ "roots:1": 25+ },+ "latenciesMs": [+ 0.3698,+ 0.0471,+ 0.1147,+ 0.062,+ 0.0357,+ 0.0294,+ 0.0562,+ 0.0401,+ 0.035,+ 0.0383,+ 0.0277,+ 0.0262,+ 0.0251,+ 0.0245,+ 0.0246,+ 0.0246,+ 0.0244,+ 0.0266,+ 0.0254,+ 0.0279,+ 0.0247,+ 0.0272,+ 0.0241,+ 0.0237,+ 0.0235+ ],+ "cpuMs": 2.315,+ "peakRssMiB": 77.8046875,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 2,+ "wallSeconds": 0.34,+ "workload": "eight",+ "iterations": 25,+ "bytes": 407,+ "outcomes": {+ "roots:9": 25+ },+ "latenciesMs": [+ 0.4384,+ 0.0448,+ 0.0274,+ 0.0314,+ 0.0357,+ 0.1088,+ 0.0453,+ 0.0223,+ 0.0301,+ 0.0249,+ 0.0241,+ 0.0205,+ 0.0157,+ 0.0173,+ 0.017,+ 0.0169,+ 0.0189,+ 0.0165,+ 0.0164,+ 0.0166,+ 0.0152,+ 0.0185,+ 0.0155,+ 0.0162,+ 0.0177+ ],+ "cpuMs": 2.675,+ "peakRssMiB": 76.33203125,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 2,+ "wallSeconds": 0.344,+ "workload": "eight",+ "iterations": 25,+ "bytes": 407,+ "outcomes": {+ "roots:9": 25+ },+ "latenciesMs": [+ 0.6378,+ 0.3406,+ 0.1743,+ 0.1242,+ 0.1603,+ 0.104,+ 0.1694,+ 0.1102,+ 0.095,+ 0.0911,+ 0.0872,+ 0.0818,+ 0.0814,+ 0.0812,+ 0.0829,+ 0.0794,+ 0.0792,+ 0.0807,+ 0.0798,+ 0.08,+ 0.0797,+ 0.0853,+ 0.0799,+ 0.087,+ 0.0834+ ],+ "cpuMs": 6.692,+ "peakRssMiB": 77.27734375,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 2,+ "wallSeconds": 0.449,+ "workload": "full",+ "iterations": 25,+ "bytes": 3100,+ "outcomes": {+ "roots:64": 25+ },+ "latenciesMs": [+ 0.6344,+ 0.1686,+ 0.1342,+ 0.1397,+ 0.256,+ 0.1915,+ 0.1568,+ 0.138,+ 0.1906,+ 0.1523,+ 0.1278,+ 0.1435,+ 0.1635,+ 0.1226,+ 0.119,+ 0.1232,+ 0.1266,+ 0.128,+ 0.1556,+ 0.1117,+ 0.1333,+ 0.2142,+ 0.1507,+ 0.1607,+ 0.6948+ ],+ "cpuMs": 10.638,+ "peakRssMiB": 83.77734375,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 2,+ "wallSeconds": 0.453,+ "workload": "full",+ "iterations": 25,+ "bytes": 3100,+ "outcomes": {+ "roots:64": 25+ },+ "latenciesMs": [+ 0.9597,+ 0.3528,+ 0.2675,+ 0.229,+ 0.2295,+ 0.269,+ 0.3112,+ 0.2384,+ 0.2344,+ 0.1998,+ 0.2286,+ 0.2294,+ 0.2239,+ 0.2689,+ 0.2467,+ 0.226,+ 0.2216,+ 0.2236,+ 0.24,+ 0.239,+ 0.3113,+ 0.3074,+ 0.2561,+ 0.2805,+ 0.3534+ ],+ "cpuMs": 16.92,+ "peakRssMiB": 84.12109375,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 2,+ "wallSeconds": 0.388,+ "workload": "large",+ "iterations": 25,+ "bytes": 62320,+ "outcomes": {+ "roots:64": 25+ },+ "latenciesMs": [+ 0.7229,+ 0.3,+ 0.2745,+ 0.2455,+ 0.3378,+ 0.2769,+ 0.276,+ 0.363,+ 0.331,+ 0.3166,+ 0.2899,+ 0.2898,+ 0.2761,+ 0.2798,+ 0.2843,+ 0.3114,+ 0.2898,+ 0.2864,+ 0.2777,+ 0.294,+ 0.2793,+ 0.309,+ 0.2728,+ 0.7116,+ 0.2473+ ],+ "cpuMs": 17.965,+ "peakRssMiB": 87.30859375,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 2,+ "wallSeconds": 0.371,+ "workload": "large",+ "iterations": 25,+ "bytes": 62320,+ "outcomes": {+ "roots:64": 25+ },+ "latenciesMs": [+ 2.5606,+ 0.9902,+ 0.6703,+ 0.9561,+ 0.7874,+ 0.7066,+ 0.7218,+ 0.6315,+ 0.6315,+ 0.6157,+ 1.2807,+ 0.5975,+ 0.5272,+ 0.5153,+ 0.5081,+ 0.6538,+ 0.5845,+ 0.6029,+ 0.6763,+ 0.6628,+ 0.7271,+ 0.8225,+ 1.5181,+ 0.6797,+ 0.4993+ ],+ "cpuMs": 43.031,+ "peakRssMiB": 90.4140625,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 2,+ "wallSeconds": 0.389,+ "workload": "malformed",+ "iterations": 25,+ "bytes": 1,+ "outcomes": {+ "roots:1": 25+ },+ "latenciesMs": [+ 0.2845,+ 0.0331,+ 0.0224,+ 0.0202,+ 0.019,+ 0.0734,+ 0.0402,+ 0.0204,+ 0.0259,+ 0.0308,+ 0.0217,+ 0.0169,+ 0.0154,+ 0.0115,+ 0.0109,+ 0.0105,+ 0.0109,+ 0.0127,+ 0.0162,+ 0.0142,+ 0.0112,+ 0.0356,+ 0.0179,+ 0.0172,+ 0.0161+ ],+ "cpuMs": 0.922,+ "peakRssMiB": 80.21875,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 2,+ "wallSeconds": 0.385,+ "workload": "malformed",+ "iterations": 25,+ "bytes": 1,+ "outcomes": {+ "held": 25+ },+ "latenciesMs": [+ 0.6837,+ 0.2729,+ 0.3327,+ 0.1218,+ 0.1119,+ 0.0955,+ 0.1464,+ 0.0923,+ 0.0902,+ 0.0951,+ 0.0962,+ 0.243,+ 0.1837,+ 0.2112,+ 0.1123,+ 0.0945,+ 0.0877,+ 0.0849,+ 0.1281,+ 0.1047,+ 0.0924,+ 0.0886,+ 0.086,+ 0.0855,+ 0.0862+ ],+ "cpuMs": 8.135,+ "peakRssMiB": 80.38671875,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 2,+ "wallSeconds": 0.359,+ "workload": "oversized",+ "iterations": 25,+ "bytes": 65537,+ "outcomes": {+ "roots:1": 25+ },+ "latenciesMs": [+ 0.4133,+ 0.0275,+ 0.0168,+ 0.0147,+ 0.0147,+ 0.073,+ 0.0329,+ 0.0165,+ 0.0151,+ 0.0266,+ 0.014,+ 0.0109,+ 0.0103,+ 0.0104,+ 0.0105,+ 0.0108,+ 0.0103,+ 0.0102,+ 0.0103,+ 0.0098,+ 0.0101,+ 0.0103,+ 0.0098,+ 0.0098,+ 0.0103+ ],+ "cpuMs": 0.914,+ "peakRssMiB": 79.01953125,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 2,+ "wallSeconds": 0.347,+ "workload": "oversized",+ "iterations": 25,+ "bytes": 65537,+ "outcomes": {+ "held": 25+ },+ "latenciesMs": [+ 0.3522,+ 0.0342,+ 0.028,+ 0.0239,+ 0.019,+ 0.093,+ 0.0363,+ 0.0209,+ 0.0215,+ 0.0327,+ 0.0216,+ 0.0168,+ 0.0164,+ 0.0161,+ 0.0163,+ 0.0163,+ 0.0155,+ 0.0161,+ 0.0169,+ 0.016,+ 0.0152,+ 0.0155,+ 0.0154,+ 0.015,+ 0.0154+ ],+ "cpuMs": 1.494,+ "peakRssMiB": 79.4375,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 2,+ "wallSeconds": 0.352,+ "workload": "same-stamp",+ "iterations": 25,+ "bytes": 57,+ "outcomes": {+ "roots:1": 25+ },+ "latenciesMs": [+ 0.029,+ 0.0177,+ 0.0165,+ 0.0138,+ 0.0868,+ 0.0348,+ 0.0171,+ 0.0205,+ 0.03,+ 0.0153,+ 0.0117,+ 0.0107,+ 0.0106,+ 0.0104,+ 0.0123,+ 0.0101,+ 0.0096,+ 0.0098,+ 0.0098,+ 0.0101,+ 0.0103,+ 0.0097,+ 0.01,+ 0.0095,+ 0.0096+ ],+ "cpuMs": 0.795,+ "peakRssMiB": 78.5703125,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 2,+ "wallSeconds": 0.345,+ "workload": "same-stamp",+ "iterations": 25,+ "bytes": 57,+ "outcomes": {+ "roots:2": 25+ },+ "latenciesMs": [+ 0.2509,+ 0.2513,+ 0.1852,+ 0.1456,+ 0.1107,+ 0.1818,+ 0.109,+ 0.0966,+ 0.0908,+ 0.0834,+ 0.0776,+ 0.107,+ 0.0809,+ 0.0796,+ 0.0784,+ 0.0763,+ 0.0759,+ 0.0751,+ 0.0747,+ 0.0747,+ 0.0748,+ 0.074,+ 0.0829,+ 0.0764,+ 0.0748+ ],+ "cpuMs": 6.319,+ "peakRssMiB": 79.39453125,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "former",+ "commit": "fb834fb18c8642b424a30d06b643db376ca27cf9",+ "repeat": 2,+ "wallSeconds": 0.329,+ "workload": "unsaved",+ "iterations": 25,+ "bytes": 24,+ "outcomes": {+ "roots:2": 25+ },+ "latenciesMs": [+ 0.1186,+ 0.0219,+ 0.0179,+ 0.0148,+ 0.0747,+ 0.0315,+ 0.0191,+ 0.025,+ 0.0167,+ 0.0168,+ 0.0125,+ 0.0116,+ 0.0113,+ 0.0116,+ 0.0106,+ 0.0107,+ 0.0106,+ 0.0107,+ 0.0107,+ 0.0123,+ 0.011,+ 0.0109,+ 0.0105,+ 0.0105,+ 0.0106+ ],+ "cpuMs": 1.237,+ "peakRssMiB": 77.31640625,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ },+ {+ "source": "current",+ "commit": "81d028f3f78741fd72a8d72e97c4923fc7546e91",+ "repeat": 2,+ "wallSeconds": 0.361,+ "workload": "unsaved",+ "iterations": 25,+ "bytes": 24,+ "outcomes": {+ "held": 25+ },+ "latenciesMs": [+ 0.6341,+ 0.2174,+ 0.1663,+ 0.1694,+ 0.3145,+ 0.1699,+ 0.2401,+ 0.1298,+ 0.1015,+ 0.1023,+ 0.089,+ 0.0862,+ 0.0823,+ 0.082,+ 0.0853,+ 0.0811,+ 0.0807,+ 0.0809,+ 0.0808,+ 0.0807,+ 0.0806,+ 0.0808,+ 0.0784,+ 0.0792,+ 0.0798+ ],+ "cpuMs": 7.219,+ "peakRssMiB": 84.0546875,+ "node": "v22.23.2",+ "platform": "darwin",+ "arch": "x64"+ }+ ]+}diff --git a/docs/research/2026-10-09-native-home-catalog.md b/docs/research/2026-10-09-native-home-catalog.mdnew file mode 100644index 000000000..6324e5f93--- /dev/null+++ b/docs/research/2026-10-09-native-home-catalog.md@@ -0,0 +1,41 @@+# Native home catalog evidence++Exact resume and process discovery now read a fresh bounded `engine-homes.json` through `nativeSessionRoots`. The former reader cached inode/mtime/size and treated read failures as an empty or partial catalog. An unreadable competing home could therefore disappear from an identity pool. A same-stamp replacement could also hide a newly adopted home.++The new reader requires a complete regular file owned by this account, without group/world write permission or a final symlink. It opens nonblocking, ties the descriptor to the inspected file, reads at most 64 KiB, and checks the descriptor and pathname again. Invalid UTF-8, incomplete JSON, duplicate properties, unknown schemas and malformed paths hold lookup with `IDENTITY_UNAVAILABLE`. There are at most 63 moved homes per engine, leaving one slot for its default home, 64 read calls and a 250 ms work deadline. Missing parents are inspected with a 32-component bound; a dangling parent link does not prove an empty installation. These are bounded work and change-detection checks, not cancellable kernel I/O or an atomic filesystem snapshot.++Every positive moved root comes from that call's complete file. Within a process, previously observed and in-memory adopted homes are used only to detect missing evidence: an unsaved adoption cannot silently remove a possible competitor. Valid held reads add positive facts before omission checks, so A → B (held) → A cannot forget competitor B. The cumulative facts stay bounded; an overflow remains a hold, and an oversized legacy list is rejected before visiting it. Those facts cannot supply a cached positive result. An explicit Codex profile and engines without movable session stores do not require this catalog. Existing exact/discovery/process-record final root checks read it again after asynchronous native evidence.++The separate golden commit `75d80e65f2ebf56b7c31ffdff94e012cd7b1fe7f` recorded 28 former-main observations on `fb834fb18c8642b424a30d06b643db376ca27cf9`, with Linux, UTC, fixed time, private homes and forbidden host binaries. Native roots replay its healthy observations; the artifact stays unchanged at SHA-256 `271edb4bf525076a19681d142b16be2db22da4e21aa115b2341093e4ad081f7f`. Compatibility observations, including legacy bound-home fallback, remain explicitly about the old API.++Validation covers malformed and disappearing catalogs, failed adoption persistence, a same-stamp added competitor, descriptor/path replacement, short reads, bounds, typed recovery and deliberate broken wiring. The private daemon case corrupts the catalog while a hookless process awaits binding: readiness and a sibling continue, Stop/Close keep the process alive with the reason, and the same process binds after atomic catalog recovery. Exact-head receipts, review and merge timing belong in the PR body. All 21 deliberate wiring mutations failed by assertion after a green baseline. The corrected source passed 429 focused assertions, 1,942 core/service assertions and 265 harnessd assertions (both coverage gates at 100%), 27 private enginehomes/machine e2e cases, and 57 private tmux cases. The latter excludes 15 vendor-dependent rows; harnessd retains its existing single skip. Serial resume ran alone: 451 assertions and 100% coverage. An intermediate iterator test mock crashed its worker; the corrected fixture and its mutation passed. No failed run is counted as passing.++## Measured root-collection cost++The [private workload driver](../../cli/scripts/handoff-2026-10-08/home-catalog-cost.ts) ran three interleaved fresh processes per source/workload, with 25 calls per process, on Node 22.23.2, macOS x64, UTC and `/tmp`. Former source matches main `fb834fb18c8642b424a30d06b643db376ca27cf9`; current source is `81d028f3f78741fd72a8d72e97c4923fc7546e91`. Measurement ran October 9 17:56:18–17:56:35 UTC without concurrent local validation. An earlier sandbox invocation stopped before sampling because its private runner IPC socket was denied. [Raw samples](2026-10-09-native-home-catalog-cost.json) include every call, CPU and whole-process peak RSS.++| Catalog workload | Former median / p95 ms | Current median / p95 ms | Current result across 75 calls |+|---|---:|---:|---|+| New installation | 0.0139 / 0.0701 | 0.0274 / 0.1147 | Default root |+| Eight moved homes | 0.0173 / 0.1113 | 0.0911 / 0.4574 | All nine roots |+| 63 moved homes | 0.0864 / 0.3785 | 0.2295 / 0.4029 | All 64 roots |+| 62,320-byte valid catalog | 0.2862 / 0.6569 | 0.6157 / 1.2807 | All 64 roots |+| Malformed JSON | 0.0142 / 0.0734 | 0.0945 / 0.3327 | Held |+| 65,537-byte catalog | 0.0109 / 0.0730 | 0.0169 / 0.0930 | Held |+| Added home, unchanged old cache stamp | 0.0115 / 0.0521 | 0.0769 / 0.2513 | Both roots |+| Failed adoption persistence | 0.0131 / 0.0820 | 0.0862 / 0.3145 | Held |++For eight homes, median CPU per 25 calls was 1.967 → 7.204 ms; for the 62,320-byte catalog it was 17.497 → 34.518 ms. Median process peak RSS across the workloads ranged from 77.60–85.87 MiB before and 78.73–89.56 MiB after. Setup/import is excluded from timed calls and CPU but included in peak RSS. These measure root collection only, not complete discovery or resume. The former reader returned a partial/default or unconfirmed root pool in the failure workloads; its shorter time is not equivalent evidence. These are reference measurements without a numerical performance gate.++## Explicitly unfinished compatibility migration++This change does not make legacy `sessionRoots`, `movedHomes`, home selection or catalog writers strict. Their caller migration remains part of the fixed [completion checklist](2026-10-09-daemon-core-completion.md). The independent design review identified the required ordering:++- Serialize cooperating catalog writers and confirm durable adoption before treating it as saved. A missing catalog after durable adoption must remain distinguishable from a new installation across restart. A failed save must retain pending adoption; retry hook installation even if rename succeeded before durability confirmation failed.+- Preserve typed unavailability through transcript validation, and contain registration errors per discovery row. Registry load must retain affected bindings and prevent unverified rows from automatically restoring.+- Check home evidence before restart terminates an engine. Restore needs a durable hold and a real retry trigger; native catalog recovery does not produce a service-connect event.+- Validate checkpoint evidence before writing screen/history files. A bound transcript with no proven home must not fall back to another login.+- Contain unavailable homes per row for titles, activity, resources and optional readers. Search admission requires a complete snapshot and final fence when its roots migrate.+- Hook publication must retain pending intent if its final synchronous commit cannot confirm evidence. Prompt effects follow successful admission, and distinct prompt deliveries must remain distinct.++These are existing callers that must migrate together with their hold/retry behavior. Leaving the compatibility API explicit avoids introducing a new exception after a legacy caller has already stopped a process or written a checkpoint. The native-identity group is not yet complete. No release is authorized.