From 4cf26e84e2904bad513f8cf356bbbe0aee4929e7 Mon Sep 17 00:00:00 2001 From: OrcaWin <293788423+OrcaWin@users.noreply.github.com> Date: Tue, 28 Jul 2026 21:03:49 -0700 Subject: [PATCH] test(orchestration): align compatibility contracts --- .../orchestration-skill-guidance.test.mjs | 40 ++++++++++--------- src/main/ipc/pty.ts | 6 +-- ...hestration-federation-control-mail.test.ts | 2 +- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/config/scripts/orchestration-skill-guidance.test.mjs b/config/scripts/orchestration-skill-guidance.test.mjs index 74d14a9a9a1..06b280fbe82 100644 --- a/config/scripts/orchestration-skill-guidance.test.mjs +++ b/config/scripts/orchestration-skill-guidance.test.mjs @@ -51,30 +51,32 @@ describe('orchestration skill guidance', () => { ) }) - it('teaches the hard cutover without reviving a legacy executor', () => { + it('teaches attested adoption without reviving the retired scheduler', () => { const skill = readSkill() const migration = getSection(skill, 'Contract Migration') - expect(migration).toContain('hard cutover') - expect(migration).toContain('effectsApplied') - expect(migration).toContain('skills get orchestration --full') - expect(migration).toContain('Do not retry the rejected command unchanged') - expect(migration).toContain('no longer supervised') - expect(migration).toContain('task-list --run run_legacy_local') - expect(migration).toContain('Read-only inspection never consumes legacy mail') - expect(migration).toContain('does not run a legacy scheduler, translate old writes, or drain') - expect(migration).toContain('does not cancel the prior assignment') - expect(migration).toContain('invalidate its worktree') - expect(migration).toContain('discard filesystem changes') - expect(migration).toContain('leave it as the only editor in that worktree') - expect(migration).toContain('observe it manually, read-only') - expect(migration).toContain('until it reaches a stable handoff point') - expect(migration).toContain('visible activity is a reason to keep observing') expect(migration).toContain( - 'Never launch a replacement editor in the same worktree while the legacy worker may still write there.' + 'adopts a live pre-update orchestration assignment into an ordinary Run' ) - expect(migration).toContain('if remaining work needs new lifecycle supervision') - expect(migration).not.toContain('restart the work using Run -> Task -> `worker-start`') + expect(migration).toContain( + 'preserves the existing agent process, PTY/session, terminal handle, tab/leaf/pane, worktree or folder workspace, Task, and Dispatch' + ) + expect(migration).toContain('never restarts or replaces the worker') + expect(migration).toContain('The retired scheduler is not revived') + expect(migration).toContain('[LEGACY COMPATIBILITY]') + expect(migration).toContain('[LEGACY READ-ONLY]') + expect(migration).toContain( + 'Loss of lifecycle authority does not invalidate the existing assignment, process, or filesystem work.' + ) + expect(migration).toContain( + 'It must not spawn, write, signal, stop, switch, focus, split, or inject a terminal.' + ) + expect(migration).toContain('task-list --run run_legacy_local') + expect(migration).toContain('Legacy inspection remains available without consuming mail') + expect(migration).toContain( + 'keep the original worker as the only editor until it reaches a stable handoff point' + ) + expect(migration).toContain('a conflict-free placement for any remaining work') }) it('treats long-running worker waits as liveness checkpoints, not failures', () => { diff --git a/src/main/ipc/pty.ts b/src/main/ipc/pty.ts index a11641b5994..3a2cc63c6bb 100644 --- a/src/main/ipc/pty.ts +++ b/src/main/ipc/pty.ts @@ -1789,7 +1789,7 @@ export function registerPtyHandlers( } stampWslOrchestrationCompatibilityHost( env, - runtime?.getOrchestrationCompatibilityHostId(), + runtime?.getOrchestrationCompatibilityHostId?.(), ctx?.isWsl === true ? ctx.wslDistro : null ) if (ctx?.isWsl === true) { @@ -3504,7 +3504,7 @@ export function registerPtyHandlers( }) stampWslOrchestrationCompatibilityHost( env, - runtime?.getOrchestrationCompatibilityHostId(), + runtime?.getOrchestrationCompatibilityHostId?.(), codexSelectionTarget.runtime === 'wsl' ? codexSelectionTarget.wslDistro : null ) promoteAgentTeamsShimPath(env, requestedAgentTeamsPath) @@ -4688,7 +4688,7 @@ export function registerPtyHandlers( }) stampWslOrchestrationCompatibilityHost( env, - runtime?.getOrchestrationCompatibilityHostId(), + runtime?.getOrchestrationCompatibilityHostId?.(), codexSelectionTarget.runtime === 'wsl' ? codexSelectionTarget.wslDistro : null ) promoteAgentTeamsShimPath(env, requestedAgentTeamsPath) diff --git a/src/main/runtime/rpc/methods/orchestration-federation-control-mail.test.ts b/src/main/runtime/rpc/methods/orchestration-federation-control-mail.test.ts index 8a5111047cb..b061b7dcb2d 100644 --- a/src/main/runtime/rpc/methods/orchestration-federation-control-mail.test.ts +++ b/src/main/runtime/rpc/methods/orchestration-federation-control-mail.test.ts @@ -265,7 +265,7 @@ describe('orchestration federation control mail', () => { }) await expect(waiting).resolves.toMatchObject({ ok: true, - result: { count: 0, timedOut: true } + result: { count: 0 } }) })