refactor: drop 12 runtimes, keep Claude, Codex, OpenCode, Cursor, ZCode, Antigravity
Removes kilo, kimi, kimi-code, copilot, windsurf, augment, trae, qwen, hermes, cline, codebuddy and pi end to end: capability descriptors, installer branches and converters (bin/install.js 14.9k -> 11.2k lines), TypeScript converters, hook surfaces and runtime homes, review lanes qwen/kimi-code, the two pi migrations, Kimi payload normalization in the hook guards, dead hostBehaviors vocabulary, launcher home probes, fixtures, runtime-specific tests and the prose that presented them as supported. Installer output for the six kept runtimes is byte-identical to before the prune. The Kimi tool-vocabulary tests in workflow-guard, read-guard and read-injection-scanner are left in place pending a decision.
This commit is contained in:
@@ -88,10 +88,6 @@ describe('extensionEventSurfaceFor (extension-system event dialect — #1943)',
|
||||
assert.ok(!s.some((e) => /plan:|verify:|ship:/.test(e)),
|
||||
'opencode extension events include no workflow-phase events (engine owns phase sequencing)');
|
||||
});
|
||||
test('pi resolves (extension-system dialect)', () => {
|
||||
const s = extensionEventSurfaceFor('pi');
|
||||
assert.ok(Array.isArray(s), 'pi is a consumed extensionEvents value');
|
||||
});
|
||||
test('none = empty surface (host exposes no extension events; engine owns the bus)', () => {
|
||||
assert.deepEqual(extensionEventSurfaceFor('none'), []);
|
||||
});
|
||||
@@ -101,15 +97,9 @@ describe('extensionEventSurfaceFor (extension-system event dialect — #1943)',
|
||||
assert.equal(extensionEventSurfaceFor('nope'), null);
|
||||
assert.equal(extensionEventSurfaceFor(undefined), null);
|
||||
});
|
||||
test('EXTENSION_EVENT_SURFACES is frozen + covers opencode/pi/hermes/kilo/none', () => {
|
||||
test('EXTENSION_EVENT_SURFACES is frozen + covers opencode/none', () => {
|
||||
assert.equal(Object.isFrozen(EXTENSION_EVENT_SURFACES), true);
|
||||
assert.deepEqual(Object.keys(EXTENSION_EVENT_SURFACES).sort(), ['hermes', 'kilo', 'none', 'opencode', 'pi']);
|
||||
});
|
||||
test('kilo reuses the IDENTICAL event array as opencode (Kilo is an OpenCode fork, same bus — #2093)', () => {
|
||||
const kiloSurface = extensionEventSurfaceFor('kilo');
|
||||
const opencodeSurface = extensionEventSurfaceFor('opencode');
|
||||
assert.ok(kiloSurface, 'kilo must resolve (non-null) — it is a consumed extensionEvents value');
|
||||
assert.deepEqual(kiloSurface, opencodeSurface);
|
||||
assert.deepEqual(Object.keys(EXTENSION_EVENT_SURFACES).sort(), ['none', 'opencode']);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1909,15 +1899,13 @@ describe('#2584 orchestratorExec — parity / divergence guard', () => {
|
||||
assert.equal(result.ok, true,
|
||||
`${id}: runtime.orchestratorExec must resolve cleanly; got reason="${result.ok ? '' : result.reason}"`);
|
||||
}
|
||||
// Sanity: the sweep actually found the 4 known hosts (guards a broken sweep
|
||||
// Sanity: the sweep actually found the 2 known hosts (guards a broken sweep
|
||||
// silently matching zero capabilities and passing vacuously).
|
||||
assert.deepEqual(orchestratorWorktreeHosts.sort(), ['codex', 'kimi', 'kimi-code', 'opencode']);
|
||||
assert.deepEqual(orchestratorWorktreeHosts.sort(), ['codex', 'opencode']);
|
||||
});
|
||||
|
||||
// #2627: the two guards below encode the per-host research that found two
|
||||
// shipped descriptors which would have failed at spawn time — kimi resolving
|
||||
// to an interactive TUI (orchestrator hangs) and kimi-code naming a binary
|
||||
// that does not exist (ENOENT).
|
||||
// #2627: the guard below encodes the per-host research that found shipped
|
||||
// descriptors which would have failed at spawn time (interactive TUI hang).
|
||||
test('every orchestrator-worktree descriptor resolves to a HEADLESS invocation, never an interactive TUI', () => {
|
||||
// A host that binds cwd by flag alone, with no leading subcommand or
|
||||
// headless flag, launches its interactive UI. Each host must contribute at
|
||||
@@ -1927,8 +1915,6 @@ describe('#2584 orchestratorExec — parity / divergence guard', () => {
|
||||
const expected = {
|
||||
codex: ['exec'],
|
||||
opencode: ['run'],
|
||||
kimi: ['--print'],
|
||||
'kimi-code': [],
|
||||
};
|
||||
for (const [id, leadingArgs] of Object.entries(expected)) {
|
||||
const cap = loadCapability(id);
|
||||
@@ -1943,16 +1929,6 @@ describe('#2584 orchestratorExec — parity / divergence guard', () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('kimi and kimi-code both spawn the "kimi" binary — kimi-code is a package name, not a binary', () => {
|
||||
// Moonshot ships both agents as a binary named `kimi`; `kimi-code` is the
|
||||
// npm package / config-home name only. Declaring command:"kimi-code" is an
|
||||
// immediate ENOENT at spawn.
|
||||
for (const id of ['kimi', 'kimi-code']) {
|
||||
assert.equal(loadCapability(id).runtime.orchestratorExec.command, 'kimi',
|
||||
`${id}: orchestratorExec.command must be the real binary name "kimi"`);
|
||||
}
|
||||
});
|
||||
|
||||
test('every capability whose dispatch.isolation is "harness-worktree" declares a non-empty harnessIsolationFlag', () => {
|
||||
const capIds = fs.readdirSync(CAPABILITIES_DIR).filter((entry) => (
|
||||
fs.existsSync(path.join(CAPABILITIES_DIR, entry, 'capability.json'))
|
||||
@@ -2719,27 +2695,27 @@ describe('#3714 dispatch-isolation CLI — model policy end-to-end (RED pre-fix
|
||||
});
|
||||
|
||||
// DEFECT 1 REGRESSION ROW: the same '-c' pin under a host with NO
|
||||
// modelFlag at all (kimi-code) must resolve byte-identical argv to the
|
||||
// modelFlag at all (opencode) must resolve byte-identical argv to the
|
||||
// no-pin case — before the fix, resolveOrchestratorExec's leading-dash
|
||||
// guard fires BEFORE the modelFlag presence check, so this host (which
|
||||
// previously ignored the model entirely) was newly broken by the pin
|
||||
// policy. The pin policy (and its warning) is gated on the descriptor
|
||||
// declaring a non-empty `modelFlag`; kimi-code declares none, so this must
|
||||
// declaring a non-empty `modelFlag`; opencode declares none, so this must
|
||||
// now produce NO stderr warning either (item 2 follow-up) — the value
|
||||
// policy never runs at all for a host that was never going to emit
|
||||
// --model.
|
||||
test('DEFECT 1 REGRESSION: "-c" pin under kimi-code (no modelFlag host) -> argv byte-identical to no-pin, exec NOT null, stderr EMPTY', () => {
|
||||
const noPinDir = createTempProject('msd-3714-kimi-nopin-');
|
||||
const pinnedDir = createTempProject('msd-3714-kimi-pinned-');
|
||||
test('DEFECT 1 REGRESSION: "-c" pin under opencode (no modelFlag host) -> argv byte-identical to no-pin, exec NOT null, stderr EMPTY', () => {
|
||||
const noPinDir = createTempProject('msd-3714-opencode-nopin-');
|
||||
const pinnedDir = createTempProject('msd-3714-opencode-pinned-');
|
||||
try {
|
||||
writeConfig(noPinDir, {});
|
||||
writeConfig(pinnedDir, { model_overrides: { 'msd-executor': '-c' } });
|
||||
const { json: noPinResult } = queryCodexJson(noPinDir, { MSD_RUNTIME: 'kimi-code' });
|
||||
const { json: pinnedResult, stderr } = queryCodexJson(pinnedDir, { MSD_RUNTIME: 'kimi-code' });
|
||||
assert.notEqual(noPinResult.exec, null, 'kimi-code no-pin: exec must not be null');
|
||||
assert.notEqual(pinnedResult.exec, null, 'kimi-code "-c" pin: exec must not be null (this is the regression)');
|
||||
const { json: noPinResult } = queryCodexJson(noPinDir, { MSD_RUNTIME: 'opencode' });
|
||||
const { json: pinnedResult, stderr } = queryCodexJson(pinnedDir, { MSD_RUNTIME: 'opencode' });
|
||||
assert.notEqual(noPinResult.exec, null, 'opencode no-pin: exec must not be null');
|
||||
assert.notEqual(pinnedResult.exec, null, 'opencode "-c" pin: exec must not be null (this is the regression)');
|
||||
assert.deepEqual(pinnedResult.exec.args, noPinResult.exec.args,
|
||||
'kimi-code argv with a "-c" pin must be byte-identical to the no-pin argv');
|
||||
'opencode argv with a "-c" pin must be byte-identical to the no-pin argv');
|
||||
assert.equal(stderr, '', 'a host with no modelFlag must never run the pin policy, so no warning');
|
||||
} finally {
|
||||
cleanup(noPinDir);
|
||||
@@ -2840,28 +2816,10 @@ describe('#3714 dispatch-isolation CLI — model policy end-to-end (RED pre-fix
|
||||
// ITEM 2 follow-up — the pin policy (and its warning) is HOST-NEUTRAL code
|
||||
// running at a site shared by every runtime, so it previously ran (and
|
||||
// warned) even for hosts whose descriptor declares no `modelFlag` at all
|
||||
// (opencode, kimi, kimi-code) — none of which were ever going to emit a
|
||||
// (opencode) — none of which were ever going to emit a
|
||||
// --model regardless of the pin's value. The fix gates the whole policy on
|
||||
// the resolved runtime's orchestratorExec declaring a non-empty modelFlag.
|
||||
// ---------------------------------------------------------------------------
|
||||
test('ITEM 2: a "sonnet" pin under kimi-code -> argv byte-identical to no-pin, stderr EMPTY (no modelFlag declared)', () => {
|
||||
const noPinDir = createTempProject('msd-3714-item2-kimicode-nopin-');
|
||||
const pinnedDir = createTempProject('msd-3714-item2-kimicode-pinned-');
|
||||
try {
|
||||
writeConfig(noPinDir, {});
|
||||
writeConfig(pinnedDir, { model_overrides: { 'msd-executor': 'sonnet' } });
|
||||
const { json: noPinResult, stderr: noPinStderr } = queryCodexJson(noPinDir, { MSD_RUNTIME: 'kimi-code' });
|
||||
const { json: pinnedResult, stderr: pinnedStderr } = queryCodexJson(pinnedDir, { MSD_RUNTIME: 'kimi-code' });
|
||||
assert.deepEqual(pinnedResult.exec.args, noPinResult.exec.args,
|
||||
'kimi-code argv with a "sonnet" pin must be byte-identical to the no-pin argv');
|
||||
assert.equal(noPinStderr, '');
|
||||
assert.equal(pinnedStderr, '', 'kimi-code declares no modelFlag — the pin policy must not run at all, so no warning');
|
||||
} finally {
|
||||
cleanup(noPinDir);
|
||||
cleanup(pinnedDir);
|
||||
}
|
||||
});
|
||||
|
||||
test('ITEM 2: a "sonnet" pin under opencode -> argv byte-identical to no-pin, stderr EMPTY (no modelFlag declared)', () => {
|
||||
const noPinDir = createTempProject('msd-3714-item2-opencode-nopin-');
|
||||
const pinnedDir = createTempProject('msd-3714-item2-opencode-pinned-');
|
||||
@@ -2955,12 +2913,8 @@ describe('#2627 dispatch-isolation CLI route', () => {
|
||||
test('each orchestrator-worktree host resolves to its own documented argv shape', () => {
|
||||
const args = (id) => queryJson(id, ['--cwd-target', '/tmp/wt', '--prompt', 'P']).exec.args;
|
||||
assert.deepEqual(args('opencode'), ['run', '--dir', '/tmp/wt', 'P']);
|
||||
// kimi carries the prompt behind --prompt (its --print mode requires it),
|
||||
// unlike codex/opencode which take it positionally.
|
||||
assert.deepEqual(args('kimi'), ['--print', '--work-dir', '/tmp/wt', '--prompt', 'P']);
|
||||
// kimi-code binds by process cwd — no flag in argv, but cwd still returned.
|
||||
assert.deepEqual(args('kimi-code'), ['--prompt', 'P']);
|
||||
assert.equal(queryJson('kimi-code', ['--cwd-target', '/tmp/wt', '--prompt', 'P']).exec.cwd, '/tmp/wt');
|
||||
assert.deepEqual(args('codex'), ['exec', '--cd', '/tmp/wt', 'P']);
|
||||
assert.equal(queryJson('opencode', ['--cwd-target', '/tmp/wt', '--prompt', 'P']).exec.cwd, '/tmp/wt');
|
||||
});
|
||||
|
||||
test('a cwd target with no prompt still resolves (prompt is optional at this seam)', () => {
|
||||
@@ -2973,7 +2927,7 @@ describe('#2627 dispatch-isolation CLI route', () => {
|
||||
// The invariant the scheduler depends on: if isolation is non-none, the
|
||||
// corresponding mechanism is present. Anything else would have the wave
|
||||
// create a worktree and then discover it has nothing to spawn into it.
|
||||
for (const id of ['claude', 'cursor', 'codex', 'opencode', 'kimi', 'kimi-code', 'pi', 'cline', 'zcode']) {
|
||||
for (const id of ['claude', 'cursor', 'codex', 'opencode', 'antigravity', 'zcode']) {
|
||||
const r = queryJson(id, ['--cwd-target', '/tmp/wt', '--prompt', 'P']);
|
||||
if (r.isolation === 'harness-worktree') {
|
||||
assert.ok(r.harnessFlag && r.harnessFlag.length > 0, `${id}: harness-worktree without a flag`);
|
||||
@@ -2988,10 +2942,10 @@ describe('#2627 dispatch-isolation CLI route', () => {
|
||||
});
|
||||
|
||||
test('a none-isolation host never yields an exec even when a target is supplied', () => {
|
||||
const pi = queryJson('pi', ['--cwd-target', '/tmp/wt', '--prompt', 'P']);
|
||||
assert.equal(pi.isolation, 'none');
|
||||
assert.equal(pi.exec, null);
|
||||
assert.equal(pi.harnessFlag, null);
|
||||
const zcode = queryJson('zcode', ['--cwd-target', '/tmp/wt', '--prompt', 'P']);
|
||||
assert.equal(zcode.isolation, 'none');
|
||||
assert.equal(zcode.exec, null);
|
||||
assert.equal(zcode.harnessFlag, null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3290,7 +3244,7 @@ describe('#2652 dispatch-site parity — isolation gates on capability, not runt
|
||||
fc.constantFrom('=', '==', '!='),
|
||||
fc.boolean(), // reversed operands?
|
||||
fc.constantFrom('"$RUNTIME"', '$RUNTIME', '"${RUNTIME}"'),
|
||||
fc.constantFrom('claude', 'codex', 'kimi-code'),
|
||||
fc.constantFrom('claude', 'codex', 'opencode'),
|
||||
fc.boolean(), // quote the literal?
|
||||
fc.constantFrom('', ' '), // extra padding
|
||||
(form, op, reversed, rtTok, id, quoted, pad) => {
|
||||
|
||||
Reference in New Issue
Block a user