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:
Jakub Zych
2026-10-06 20:02:40 +02:00
parent 12ee75a509
commit 6cfa0c55d2
509 changed files with 1869 additions and 47737 deletions

View File

@@ -30,10 +30,9 @@ const {
} = require(path.join(__dirname, '../msd-core/bin/lib/capability-validator.cjs'));
// Folded from tests/fix-2598-opencode-background-dispatch.test.cjs and
// tests/fix-2603-kimi-code-host-matrix.test.cjs (#3333, test-hygiene backlog).
// (#3333, test-hygiene backlog).
const ROOT = path.join(__dirname, '..');
const OPENCODE_DESCRIPTOR = path.join(ROOT, 'capabilities', 'opencode', 'capability.json');
const KIMI_CODE_DESCRIPTOR = path.join(ROOT, 'capabilities', 'kimi-code', 'capability.json');
const HOST_INTEGRATION_MATRIX = path.join(ROOT, 'docs', 'reference', 'host-integration-capability-matrix.md');
function opencodeDispatch() {
@@ -41,10 +40,6 @@ function opencodeDispatch() {
return parsed.runtime.hostIntegration.dispatch;
}
function kimiCodeAxes() {
return JSON.parse(fs.readFileSync(KIMI_CODE_DESCRIPTOR, 'utf8')).runtime.hostIntegration;
}
/** Extract the `## <host>` section body, stopping at the next top-level host heading. */
function matrixSection(host) {
const matrix = fs.readFileSync(HOST_INTEGRATION_MATRIX, 'utf8');
@@ -55,12 +50,6 @@ function matrixSection(host) {
return end === -1 ? rest : rest.slice(0, end);
}
/** Read the `| <axis> | <value> | …` cell out of a matrix section. */
function matrixValue(section, axis) {
const row = section.split('\n').find((l) => l.startsWith(`| ${axis} |`));
return row ? row.split('|')[2].trim() : null;
}
// All 8 scalar hostIntegration axis keys
const SCALAR_AXES = ['embeddingMode', 'commandSurface', 'modelMode', 'hookBus', 'stateIO', 'transport', 'runtime'];
// All 6 dispatch sub-keys (includes backgroundDispatch added in feat/1679-dispatch-flatten)
@@ -73,31 +62,15 @@ const DISPATCH_KEYS = ['namedDispatch', 'nested', 'maxDepth', 'background', 'sub
const RUNTIME_IDS = Object.keys(registry.runtimes);
// Contract-pinned profile split (derived from .host-cli-final.json):
// programmatic-cli: claude, cline, cursor, hermes, kilo, kimi, opencode, pi, qwen, trae (10)
// declarative-cli: antigravity, augment, codebuddy, codex, copilot, kimi-code, windsurf, zcode (8)
// kimi-code moved programmatic-cli → declarative-cli in #2603: its plugin surface is a
// `kimi.plugin.json` manifest plus markdown Skills with no in-process programmatic API
// (docs/en/customization/plugins.md), the same shape as codex. The value had been inherited
// from the Python `kimi` descriptor rather than sourced for Kimi Code CLI.
// programmatic-cli: claude, cursor, opencode
// declarative-cli: antigravity, codex, zcode
// ide: vscode (1) — #2103, the first installed ide-profile host.
const EXPECTED_PROFILES = {
claude: 'programmatic-cli',
cline: 'programmatic-cli',
cursor: 'programmatic-cli',
hermes: 'programmatic-cli',
kilo: 'programmatic-cli',
kimi: 'programmatic-cli',
opencode: 'programmatic-cli',
pi: 'programmatic-cli',
qwen: 'programmatic-cli',
trae: 'programmatic-cli',
antigravity: 'declarative-cli',
augment: 'declarative-cli',
codebuddy: 'declarative-cli',
codex: 'declarative-cli',
copilot: 'declarative-cli',
'kimi-code': 'declarative-cli',
windsurf: 'declarative-cli',
zcode: 'declarative-cli',
vscode: 'ide',
};
@@ -311,48 +284,23 @@ describe('ADR-1239 Phase A: hostIntegration descriptors', () => {
// dispatch declares nested:true + subagentToolkit:"full" + a depth budget > 1.
// true (must inline) for the other 17.
//
// #2939: the depth-aware rule reclassifies codex/kimi/kimi-code, which the old
// two-field (background+backgroundDispatch) rule admitted as background-eligible
// despite each lacking what a backgrounded nesting orchestrator actually needs:
// - codex: nested:true + full toolkit, BUT maxDepth:1 (no room for a depth-2 leaf)
// - kimi: nested:false (cannot host a nesting orchestrator at all)
// - kimi-code: subagentToolkit:'built-in-only' (cannot delegate to full subagents)
// cursor (maxDepth:2) remains the only background-capable host with a sufficient budget.
// #2939: the depth-aware rule: cursor (nested:true + full toolkit + maxDepth:2) is the only
// background-capable host with a sufficient budget; every other kept host must inline.
const EXPECTED_FLATTEN = {
antigravity: true,
augment: true,
claude: true,
cline: true,
codebuddy: true,
codex: true,
copilot: true,
cursor: false,
hermes: true,
kilo: true,
// #2095/#2939: Kimi CAN background a single agent (backgroundDispatch:true), BUT
// nested:false means a backgrounded kimi agent cannot nest the plan-checker/executor/
// verifier pipeline the workflows require → flatten. backgroundDispatch stays true on
// the descriptor (UPGRADE 2 holds); only the flatten consequence changes.
kimi: true,
// #2454/#2939: Kimi Code declares background/backgroundDispatch both true, BUT
// subagentToolkit:'built-in-only' cannot delegate to full subagents → flatten.
'kimi-code': true,
// #2598: OpenCode's background subagents sit behind the opt-in
// OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS flag (default false), and the
// session loop still handles one subtask at a time (upstream #29638, OPEN).
// #2087 read v1.15/v1.17 as default-on; that does not hold against current
// `dev`, so dispatch.background/backgroundDispatch are false → force-flattened.
opencode: true,
// #2102: pi's dispatch.background/backgroundDispatch are both false
// (undocumented background-subagent primitive) → force-flattened.
pi: true,
qwen: true,
trae: true,
windsurf: true,
zcode: true,
// #2103: vscode's dispatch.backgroundDispatch is 'undocumented' (no
// documented background-subagent primitive) → fails closed to false →
// force-flattened, mirroring the pi (#2102) precedent above.
// force-flattened, fails closed (#2102 precedent).
vscode: true,
};
@@ -386,12 +334,12 @@ describe('ADR-1239 Phase A: hostIntegration descriptors', () => {
'background-eligible set must match EXPECTED_FLATTEN (a dispatch axis may have flipped)');
});
test('contract-pin: spot-check claude→programmatic-cli, codex→declarative-cli, opencode→programmatic-cli, windsurf→declarative-cli', () => {
test('contract-pin: spot-check claude→programmatic-cli, codex→declarative-cli, opencode→programmatic-cli, antigravity→declarative-cli', () => {
const checks = [
['claude', 'programmatic-cli'],
['codex', 'declarative-cli'],
['opencode', 'programmatic-cli'],
['windsurf', 'declarative-cli'],
['antigravity', 'declarative-cli'],
];
for (const [id, expectedProfile] of checks) {
const cap = registry.runtimes[id];
@@ -537,159 +485,6 @@ describe('#2598: OpenCode does not declare background/concurrent subagent dispat
// allow-test-rule: source-text-is-the-product #2603 — the descriptor JSON and the
// host-integration matrix ARE the negotiated contract; asserting their values is behavioral.
describe('#2603: the host-integration matrix documents kimi-code', () => {
test('a `## kimi-code` section exists', () => {
assert.ok(
matrixSection('kimi-code'),
'the matrix is the deployment source-of-truth for every installed runtime; kimi-code must have a section',
);
});
test('every hostIntegration axis kimi-code declares is documented in the matrix', () => {
const section = matrixSection('kimi-code');
const axes = kimiCodeAxes();
const scalarAxes = Object.keys(axes).filter((k) => k !== 'dispatch');
for (const axis of scalarAxes) {
assert.ok(
matrixValue(section, axis),
`matrix must document the "${axis}" axis for kimi-code`,
);
}
// `builtInSubagents` is a MSD-side list, not a negotiated axis — the matrix
// documents it in prose, not as its own row.
const dispatchAxes = Object.keys(axes.dispatch).filter((k) => k !== 'builtInSubagents');
for (const axis of dispatchAxes) {
assert.ok(
matrixValue(section, `dispatch.${axis}`),
`matrix must document the "dispatch.${axis}" sub-axis for kimi-code`,
);
}
});
test('the matrix values agree with the shipped descriptor', () => {
const section = matrixSection('kimi-code');
const axes = kimiCodeAxes();
for (const axis of Object.keys(axes).filter((k) => k !== 'dispatch')) {
assert.equal(
matrixValue(section, axis),
String(axes[axis]),
`matrix "${axis}" must match the descriptor`,
);
}
for (const axis of Object.keys(axes.dispatch).filter((k) => k !== 'builtInSubagents')) {
assert.equal(
matrixValue(section, `dispatch.${axis}`),
String(axes.dispatch[axis]),
`matrix "dispatch.${axis}" must match the descriptor`,
);
}
});
test('the kimi-code section is sourced independently of the kimi section', () => {
// The two are distinct products (Python kimi-cli vs TypeScript Kimi Code CLI);
// the issue's central requirement is that kimi's section was NOT copied. The
// check is scoped to the axis ROWS — the section's prose intro deliberately
// names kimi's Python API to draw the contrast, which is the opposite of a copy.
const rows = matrixSection('kimi-code')
.split('\n')
.filter((l) => l.startsWith('| ') && !l.startsWith('| Axis |') && !l.startsWith('|---'));
assert.ok(rows.length >= 11, 'expected a row per hostIntegration axis');
for (const row of rows) {
assert.ok(
!row.includes('kimi_cli'),
`kimi-code axis row must not cite the Python kimi-cli: ${row.slice(0, 60)}`,
);
assert.ok(
!row.includes('moonshotai.github.io/kimi-cli'),
`kimi-code axis row must not cite kimi-cli docs: ${row.slice(0, 60)}`,
);
}
assert.ok(
rows.some((r) => r.includes('kimi-code/blob/main/docs')),
'kimi-code axes must cite the Kimi Code CLI docs',
);
});
});
describe('#2603: axis values inherited from the Python kimi descriptor are corrected', () => {
test('embeddingMode is declarative — plugins expose no in-process API', () => {
assert.equal(kimiCodeAxes().embeddingMode, 'declarative');
});
test('kimi-code therefore classifies as the declarative-cli profile', () => {
assert.equal(profileOf(kimiCodeAxes()), 'declarative-cli');
});
test('dispatch.nested is true — the coder built-in dispatches nested sub-agents', () => {
assert.equal(kimiCodeAxes().dispatch.nested, true);
});
test('dispatch.maxDepth is the undocumented sentinel, not a guessed integer', () => {
assert.equal(kimiCodeAxes().dispatch.maxDepth, 'undocumented');
});
test('namedDispatch stays false — MSD installs no agent files for this host', () => {
// Guard against a well-meaning "the docs say custom agents exist" edit: flipping
// this makes resolveDispatchType return `msd-planner` unchanged, which kimi-code
// cannot dispatch (docs/migration/kimi-to-kimi-code.md).
assert.equal(kimiCodeAxes().dispatch.namedDispatch, false);
});
test('the undocumented maxDepth sentinel is reported as a sentinel, not as malformed', () => {
// Surfaced by this change: maxDepth was the ONE dispatch sub-axis with no
// sentinel-specific warning, so the documented fail-closed value was reported
// as "missing or not a number" — indistinguishable from a genuinely broken
// descriptor. kimi-code would have been the sixth runtime to hit that path.
const { warnings } = negotiateHostCapabilities(kimiCodeAxes());
assert.ok(
warnings.some((w) => w.includes('dispatch.maxDepth is undocumented')),
`expected a maxDepth sentinel warning, got: ${JSON.stringify(warnings)}`,
);
assert.ok(
!warnings.some((w) => w.includes('maxDepth is missing or not a number')),
'the documented sentinel must not be reported as a malformed value',
);
});
test('a genuinely malformed maxDepth is still reported as malformed', () => {
// Boundary: the sentinel carve-out must not swallow the real error case.
const axes = kimiCodeAxes();
const malformed = { ...axes, dispatch: { ...axes.dispatch, maxDepth: 'not-a-number' } };
const { warnings } = negotiateHostCapabilities(malformed);
assert.ok(
warnings.some((w) => w.includes('maxDepth is missing or not a number')),
`expected the malformed-value warning, got: ${JSON.stringify(warnings)}`,
);
});
test('both maxDepth paths still degrade the effective value closed to 0', () => {
const axes = kimiCodeAxes();
assert.equal(negotiateHostCapabilities(axes).effective.dispatch.maxDepth, 0);
const malformed = { ...axes, dispatch: { ...axes.dispatch, maxDepth: 'not-a-number' } };
assert.equal(negotiateHostCapabilities(malformed).effective.dispatch.maxDepth, 0);
});
test('the axes that were already correct are left intact', () => {
const axes = kimiCodeAxes();
assert.equal(axes.commandSurface, 'slash-file');
assert.equal(axes.modelMode, 'passive');
assert.equal(axes.hookBus, 'host');
assert.equal(axes.stateIO, 'filesystem');
assert.equal(axes.transport, 'mcp');
assert.equal(axes.runtime, 'node');
assert.equal(axes.dispatch.background, true);
assert.equal(axes.dispatch.backgroundDispatch, true);
assert.equal(axes.dispatch.subagentToolkit, 'built-in-only');
assert.equal(axes.dispatch.isolation, 'orchestrator-worktree');
});
});
describe('#3747: matrix must not cite the disproven configHome skills path for antigravity', () => {
// The stateIO row sourced its evidence from an explainx.ai blog claiming the
// CLI reads global skills from ~/.gemini/antigravity-cli/skills/. A live