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

@@ -12,17 +12,11 @@ const assert = require('node:assert/strict');
const fs = require('fs');
const os = require('os');
const path = require('path');
const { runNode } = require('./helpers/process-seam.cjs');
const { runMsdTools, createTempProject, cleanup } = require('./helpers.cjs');
const { installerEnv } = require('./helpers/install-shared.cjs');
// #3145: class-norm timeout, not a per-suite value — see helpers/timeouts.cjs.
const { INSTALL_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
const AGENTS_DIR_NAME = 'agents';
const MODEL_PROFILES = require('../msd-core/bin/lib/model-profiles.cjs').MODEL_PROFILES;
const EXPECTED_AGENTS = Object.keys(MODEL_PROFILES);
const ROOT = path.join(__dirname, '..');
const INSTALL_SCRIPT = path.join(ROOT, 'bin', 'install.js');
/**
* Create a fake MSD install directory structure that mirrors what the installer
@@ -317,9 +311,9 @@ describe('Codex project-local validation status', () => {
});
});
// ─── Copilot .agent.md detection (#1512) ────────────────────────────────────
// ─── Agent file format detection (.toml / MSD_AGENTS_DIR) ────────────────────────────────────
describe('checkAgentsInstalled: Copilot .agent.md format (#1512)', () => {
describe('checkAgentsInstalled: agent file formats and MSD_AGENTS_DIR', () => {
let tmpDir;
beforeEach(() => {
@@ -330,72 +324,6 @@ describe('checkAgentsInstalled: Copilot .agent.md format (#1512)', () => {
cleanup(tmpDir);
});
test('agents_installed=true when agents exist as .agent.md (Copilot format)', () => {
// Simulate a Copilot install: agents are named msd-*.agent.md, not msd-*.md
// Use MSD_AGENTS_DIR to point at an isolated dir with ONLY .agent.md files,
// so the test does not accidentally pass via the repo's own agents/ dir.
const agentsDir = path.join(tmpDir, 'copilot-agents');
fs.mkdirSync(agentsDir, { recursive: true });
for (const name of EXPECTED_AGENTS) {
fs.writeFileSync(
path.join(agentsDir, `${name}.agent.md`),
`---\nname: ${name}\ndescription: Test agent\n---\nAgent content.\n`
);
}
const result = runMsdTools('validate agents --raw', tmpDir, { MSD_AGENTS_DIR: agentsDir });
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
// Must report the custom dir, not the default repo agents dir
assert.strictEqual(output.agents_dir, agentsDir,
'agents_dir must be the MSD_AGENTS_DIR override, not the repo default');
assert.strictEqual(output.agents_found, true,
'agents_found must be true when agents exist as .agent.md (Copilot format)');
assert.deepStrictEqual(output.missing, [],
'missing must be empty when all agents exist as .agent.md');
});
test('agents_installed=false when .agent.md files exist for only some agents', () => {
const agentsDir = path.join(tmpDir, 'agents');
fs.mkdirSync(agentsDir, { recursive: true });
// Only install the first agent
const firstAgent = EXPECTED_AGENTS[0];
fs.writeFileSync(
path.join(agentsDir, `${firstAgent}.agent.md`),
`---\nname: ${firstAgent}\ndescription: Test agent\n---\nAgent content.\n`
);
const result = runMsdTools('validate agents --raw', tmpDir, { MSD_AGENTS_DIR: agentsDir });
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
assert.strictEqual(output.agents_found, false,
'agents_found must be false when only some agents exist');
assert.ok(output.missing.length > 0, 'missing must be non-empty when some agents are absent');
});
test('init new-workspace includes agents_installed=true with Copilot .agent.md files', () => {
// Use an isolated dir with ONLY .agent.md files (no .md fallback)
const agentsDir = path.join(tmpDir, 'copilot-agents');
fs.mkdirSync(agentsDir, { recursive: true });
for (const name of EXPECTED_AGENTS) {
fs.writeFileSync(
path.join(agentsDir, `${name}.agent.md`),
`---\nname: ${name}\ndescription: Test agent\n---\nAgent content.\n`
);
}
const result = runMsdTools('init new-workspace --raw', tmpDir, { MSD_AGENTS_DIR: agentsDir });
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
assert.strictEqual(output.agents_installed, true,
'agents_installed must be true when Copilot .agent.md files are present');
assert.deepStrictEqual(output.missing_agents, [],
'missing_agents must be empty when all .agent.md files are present');
});
test('agents_installed=true when agents exist as .toml (Codex format) (#278)', () => {
const agentsDir = path.join(tmpDir, 'codex-agents');
fs.mkdirSync(agentsDir, { recursive: true });
@@ -436,77 +364,6 @@ describe('checkAgentsInstalled: Copilot .agent.md format (#1512)', () => {
});
});
// ─── Kimi agents/subagents detection (#743 review) ─────────────────────────
describe('checkAgentsInstalled: Kimi agents/subagents layout', () => {
test('Kimi install is detected by init, validate agents, and health checks', () => {
const tmpDir = createTempProject('msd-kimi-agent-status-project-');
const tmpConfig = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-agent-status-config-'));
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-agent-status-home-'));
const env = installerEnv({
HOME: tmpHome,
USERPROFILE: tmpHome,
KIMI_CONFIG_DIR: tmpConfig,
});
try {
const installResult = runNode(
[INSTALL_SCRIPT, '--kimi', '--global', '--config-dir', tmpConfig, '--no-sdk'],
{
cwd: tmpDir,
env,
timeoutMs: INSTALL_TIMEOUT_MS,
},
);
assert.strictEqual(
installResult.exitCode,
0,
`Kimi install failed\nstdout: ${installResult.stdout}\nstderr: ${installResult.stderr}`,
);
fs.writeFileSync(
path.join(tmpDir, '.planning', 'config.json'),
JSON.stringify({ runtime: 'kimi', model_profile: 'balanced' }, null, 2),
);
const initResult = runMsdTools('init new-workspace --raw', tmpDir, env);
assert.ok(initResult.success, `init failed: ${initResult.error}`);
const initOutput = JSON.parse(initResult.output);
assert.strictEqual(initOutput.agent_runtime, 'kimi');
assert.strictEqual(initOutput.agents_dir, path.join(tmpConfig, 'agents'));
assert.strictEqual(initOutput.agents_installed, true);
assert.deepStrictEqual(initOutput.missing_agents, []);
const validateResult = runMsdTools('validate agents --raw', tmpDir, {
...env,
MSD_RUNTIME: 'kimi',
});
assert.ok(validateResult.success, `validate agents failed: ${validateResult.error}`);
const validateOutput = JSON.parse(validateResult.output);
assert.strictEqual(validateOutput.agents_dir, path.join(tmpConfig, 'agents'));
assert.strictEqual(validateOutput.agents_found, true);
assert.deepStrictEqual(validateOutput.missing, []);
const healthResult = runMsdTools('validate health --raw', tmpDir, {
...env,
MSD_RUNTIME: 'kimi',
});
assert.ok(healthResult.success, `validate health failed: ${healthResult.error}`);
const healthOutput = JSON.parse(healthResult.output);
const agentWarnings = (healthOutput.warnings || []).filter(
(warning) => warning.code === 'W010' || /MSD agents/i.test(warning.message || ''),
);
assert.deepStrictEqual(agentWarnings, []);
} finally {
cleanup(tmpDir);
cleanup(tmpConfig);
cleanup(tmpHome);
}
});
});
// ─── validate agents subcommand ─────────────────────────────────────────────
describe('validate agents subcommand (#1371)', () => {
let tmpDir;