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

@@ -94,7 +94,7 @@ const ROOT = path.join(__dirname, '..');
const NEW_LANE_ONLY_IDS = ['coderabbit', 'ollama', 'lm-studio', 'llama-cpp'];
/** The six pre-existing dual-purpose `role:"runtime"` capabilities. */
const RUNTIME_REVIEWER_IDS = ['antigravity', 'claude', 'codex', 'cursor', 'opencode', 'qwen'];
const RUNTIME_REVIEWER_IDS = ['antigravity', 'claude', 'codex', 'cursor', 'opencode'];
/**
* The shipped roster BEFORE this phase, as a literal (not computed) sorted
@@ -104,10 +104,7 @@ const RUNTIME_REVIEWER_IDS = ['antigravity', 'claude', 'codex', 'cursor', 'openc
*/
const LITERAL_ROSTER = [
'antigravity', 'claude', 'coderabbit', 'codex', 'cursor',
// `kimi-code` joined in Phase 5b (#2799, closes #2718) — see
// kimiCodeIsDeclaredAndInvocableInThisPhase for why it landed here and not in 5a.
'kimi-code',
'llama_cpp', 'lm_studio', 'ollama', 'opencode', 'qwen',
'llama_cpp', 'lm_studio', 'ollama', 'opencode',
];
/**
@@ -281,7 +278,6 @@ describe('B. The six existing runtime capabilities', () => {
codex: ['artifactLayout', 'commandStyle', 'configFormat', 'configHome', 'extendedHookEvents', 'hookEvents', 'hooksSurface', 'hostBehaviors', 'hostIntegration', 'installSurface', 'localConfigDir', 'orchestratorExec', 'permissionWriter', 'sandboxTier', 'supportTier', 'triggerPrecedence', 'writesSharedSettings'],
cursor: ['artifactLayout', 'commandStyle', 'configFormat', 'configHome', 'extendedHookEvents', 'harnessIsolationFlag', 'hookEvents', 'hooksSurface', 'hostBehaviors', 'hostIntegration', 'installSurface', 'localConfigDir', 'permissionWriter', 'sandboxTier', 'supportTier', 'triggerPrecedence', 'writesSharedSettings'],
opencode: ['artifactLayout', 'commandStyle', 'configFormat', 'configHome', 'extendedHookEvents', 'extensionEvents', 'hooksSurface', 'hostBehaviors', 'hostIntegration', 'installSurface', 'localConfigDir', 'orchestratorExec', 'permissionWriter', 'sandboxTier', 'supportTier', 'triggerPrecedence', 'writesSharedSettings'],
qwen: ['artifactLayout', 'commandStyle', 'configFormat', 'configHome', 'extendedHookEvents', 'hookEvents', 'hooksSurface', 'hostBehaviors', 'hostIntegration', 'installSurface', 'localConfigDir', 'permissionWriter', 'sandboxTier', 'supportTier', 'triggerPrecedence', 'writesSharedSettings'],
};
test('runtimeBodiesAreUnchangedByLaneDeclaration', () => {
@@ -356,7 +352,7 @@ describe('C. Roster derivation — src/review-reviewer-selection.cts', () => {
// KEYSTONE. This row is GREEN before and after #2801 — it is the invariant
// the phase must not break, not a red row. The literal list is never
// computed by the machinery under test.
assert.equal(KNOWN_REVIEWER_SLUGS.length, 11, 'roster must be exactly 11 — not 10, not 12');
assert.equal(KNOWN_REVIEWER_SLUGS.length, 9, 'roster must be exactly 9');
assert.deepEqual(
[...KNOWN_REVIEWER_SLUGS].sort(), LITERAL_ROSTER,
`roster must be exactly the declared lane set, got: ${JSON.stringify(KNOWN_REVIEWER_SLUGS)}`,
@@ -545,47 +541,12 @@ describe('D. Cross-phase invariants that must not regress', () => {
assert.equal(result.ok, true);
});
test('kimiCodeIsDeclaredAndInvocableInThisPhase', () => {
// Phase 5a deliberately withheld this lane: declaring it there would have made it selectable
// but NOT invocable — present in `--all`, selected, and producing an empty section for the
// whole 5a -> 5b window. ADR-2782's phase table lands it here, with the iteration that runs it.
assert.equal(KNOWN_REVIEWER_SLUGS.includes('kimi-code'), true);
const cap = SHIPPED.capMap.get('kimi-code');
assert.ok(cap, 'expected the kimi-code capability to exist');
assert.equal('reviewer' in cap, true, 'kimi-code must declare a reviewer body in 5b');
assert.equal(cap.reviewer.slug, 'kimi-code');
// The probe is the whole reason D7 ships wider than existence: `kimi` is claimed by BOTH the
// Kimi Code CLI and the legacy Python kimi-cli, so an existence-only probe registers the wrong
// tool. And it MUST be bounded — the original was an unbounded `kimi --help | grep` that ran
// on every review regardless of flags.
assert.equal(cap.reviewer.probe.kind, 'command-capability');
assert.equal(cap.reviewer.probe.binary, 'kimi');
assert.ok(cap.reviewer.probe.timeoutMs > 0, 'every process-starting probe must be bounded');
assert.equal(
Boolean(cap.runtime && cap.runtime.hostBehaviors && cap.runtime.hostBehaviors.reviewerCli),
false,
'the body is the declaration — the legacy reviewerCli alias must not also be set',
);
});
test('legacyKimiCapabilityIsNotAReviewerLane', () => {
assert.equal(KNOWN_REVIEWER_SLUGS.includes('kimi'), false, '"kimi" (the legacy Python CLI) must not be a reviewer lane');
const cap = SHIPPED.capMap.get('kimi');
assert.ok(cap, 'expected the kimi capability to exist');
assert.equal('reviewer' in cap, false, 'kimi must not acquire a reviewer body by proximity to kimi-code');
assert.equal(
Boolean(cap.runtime && cap.runtime.hostBehaviors && cap.runtime.hostBehaviors.reviewerCli),
false,
'kimi must not carry the legacy reviewerCli alias',
);
});
test('allElevenDeclaredLanesSatisfyUniqueness', () => {
test('allNineDeclaredLanesSatisfyUniqueness', () => {
const errs = validateCrossCapability(SHIPPED.capMap, new Set());
const laneErrs = errs.filter((e) => e.startsWith('reviewer '));
assert.deepEqual(
laneErrs, [],
`expected no reviewer-lane uniqueness violations (slug/flag/section) across the real eleven, got: ${JSON.stringify(laneErrs)}`,
`expected no reviewer-lane uniqueness violations (slug/flag/section) across the real nine, got: ${JSON.stringify(laneErrs)}`,
);
});
@@ -595,7 +556,7 @@ describe('D. Cross-phase invariants that must not regress', () => {
// derivation would also surface here — normalizeReviewerInstances /
// resolveReviewerSelection gate config_default membership on
// KNOWN_REVIEWER_SLUGS.includes(...).
const detected = ['codex', 'claude', 'qwen'];
const detected = ['codex', 'claude', 'opencode'];
const explicit = resolveReviewerSelection({
detected, explicitFlags: ['codex'], allFlag: true, configuredDefaultReviewers: ['claude'],
@@ -610,10 +571,10 @@ describe('D. Cross-phase invariants that must not regress', () => {
assert.deepEqual(allFlagResult.selected, [...detected].sort());
const configDefault = resolveReviewerSelection({
detected, explicitFlags: [], allFlag: false, configuredDefaultReviewers: ['claude', 'qwen'],
detected, explicitFlags: [], allFlag: false, configuredDefaultReviewers: ['claude', 'opencode'],
});
assert.equal(configDefault.source, 'config_default');
assert.deepEqual(configDefault.selected, ['claude', 'qwen']);
assert.deepEqual(configDefault.selected, ['claude', 'opencode']);
const noConfig = resolveReviewerSelection({ detected, explicitFlags: [], allFlag: false });
assert.equal(noConfig.source, 'no_config_all_detected');
@@ -638,8 +599,8 @@ describe('E. Lane fidelity — no translation layer', () => {
}
}
assert.equal(REVIEWER_LANES.length, 11, 'expected exactly 11 declared descriptor lanes');
assert.equal(bySlug.size, 11, `expected exactly 11 capabilities declaring a reviewer body, got: ${bySlug.size}`);
assert.equal(REVIEWER_LANES.length, 9, 'expected exactly 9 declared descriptor lanes');
assert.equal(bySlug.size, 9, `expected exactly 9 capabilities declaring a reviewer body, got: ${bySlug.size}`);
// Top-level scalar/array fields compared whole; the two fields that are
// themselves nested objects (probe, invoke) are compared sub-field-by-
@@ -751,7 +712,7 @@ describe('F. Isolated-security-review regressions', () => {
// The module under test already imported successfully above; assert the
// derived roster is a usable array rather than a partially-initialised value.
assert.ok(Array.isArray([...KNOWN_REVIEWER_SLUGS]), 'roster must be iterable after module load');
assert.equal(KNOWN_REVIEWER_SLUGS.length, 11, 'the real registry still yields the eleven lanes');
assert.equal(KNOWN_REVIEWER_SLUGS.length, 9, 'the real registry still yields the nine lanes');
// And the derivation itself is total over the shapes JSON can express.
for (const hostile of [null, undefined, [], 0, 'x', { capabilities: null }, { capabilities: [] }]) {
assert.doesNotThrow(