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:
@@ -35,7 +35,6 @@ const { resolveRuntimeArtifactLayout } = require(
|
||||
path.join(ROOT, 'msd-core', 'bin', 'lib', 'runtime-artifact-layout.cjs'),
|
||||
);
|
||||
const { getGlobalConfigDir } = require(path.join(ROOT, 'msd-core', 'bin', 'lib', 'runtime-homes.cjs'));
|
||||
const { createTempDir, cleanup } = require('./helpers.cjs');
|
||||
|
||||
const sorted = (iterable) => [...iterable].sort();
|
||||
|
||||
@@ -145,10 +144,6 @@ describe('finishPermissionWriter', () => {
|
||||
assert.strictEqual(resolveRuntimeConfigIntent('opencode').finishPermissionWriter, 'opencode');
|
||||
});
|
||||
|
||||
test('kilo -> "kilo"', () => {
|
||||
assert.strictEqual(resolveRuntimeConfigIntent('kilo').finishPermissionWriter, 'kilo');
|
||||
});
|
||||
|
||||
test('every registry runtime whose descriptor permissionWriter is null/absent resolves to null', () => {
|
||||
for (const row of EXPECTED_TABLE.filter((r) => r.finishPermissionWriter === null)) {
|
||||
assert.strictEqual(
|
||||
@@ -169,11 +164,7 @@ describe('finishPermissionWriter', () => {
|
||||
describe('installSurface correctness', () => {
|
||||
test('dedicated surfaces are stable (spot-check)', () => {
|
||||
assert.strictEqual(resolveRuntimeConfigIntent('codex').installSurface, 'codex-toml');
|
||||
assert.strictEqual(resolveRuntimeConfigIntent('copilot').installSurface, 'copilot-instructions');
|
||||
assert.strictEqual(resolveRuntimeConfigIntent('cline').installSurface, 'cline-rules');
|
||||
assert.strictEqual(resolveRuntimeConfigIntent('cursor').installSurface, 'cursor-hooks-json');
|
||||
assert.strictEqual(resolveRuntimeConfigIntent('windsurf').installSurface, 'profile-marker-only');
|
||||
assert.strictEqual(resolveRuntimeConfigIntent('trae').installSurface, 'profile-marker-only');
|
||||
});
|
||||
|
||||
test('every registry runtime resolves to its descriptor-declared installSurface', () => {
|
||||
@@ -245,23 +236,20 @@ describe('INSTALL_SURFACES export', () => {
|
||||
const EXPECTED_SURFACES = new Set([
|
||||
'settings-json',
|
||||
'codex-toml',
|
||||
'copilot-instructions',
|
||||
'cline-rules',
|
||||
'cursor-hooks-json',
|
||||
'profile-marker-only',
|
||||
// 'none' added #2103 — vscode has no CLI install surface at all.
|
||||
'none',
|
||||
]);
|
||||
|
||||
test('INSTALL_SURFACES contains exactly the 7 surface strings', () => {
|
||||
test('INSTALL_SURFACES contains exactly the 5 surface strings', () => {
|
||||
assert.deepStrictEqual(new Set(INSTALL_SURFACES), EXPECTED_SURFACES);
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveInstallPlan — hooksSurface is descriptor-owned', () => {
|
||||
test('real descriptor-owned none surface is preserved for opencode and kilo', () => {
|
||||
test('real descriptor-owned none surface is preserved for opencode', () => {
|
||||
assert.strictEqual(resolveInstallPlan('opencode').hooksSurface, 'none');
|
||||
assert.strictEqual(resolveInstallPlan('kilo').hooksSurface, 'none');
|
||||
});
|
||||
|
||||
test('synthetic descriptor resolves hooksSurface without runtime-name fallback', () => {
|
||||
@@ -535,65 +523,6 @@ describe('issue-57 AC2 — config-mutation dispatch is closed over the explicit
|
||||
+ 'from runtimeFlags (Marketplace-distributed, never CLI-installed).',
|
||||
);
|
||||
});
|
||||
|
||||
// Behavioral replacement for the delegation-presence source grep (#3466).
|
||||
//
|
||||
// The EXPECTED_TABLE / resolveInstallPlan projection-contract tests above
|
||||
// (`resolveInstallPlan — descriptor-projection contract`) prove resolveInstallPlan
|
||||
// ITSELF maps every registry descriptor correctly — but they call the registry
|
||||
// function directly and never touch bin/install.js, so they cannot by themselves
|
||||
// prove install.js actually CONSULTS it rather than reimplementing an equivalent
|
||||
// per-runtime branch. This test closes that gap: it stubs the registry's
|
||||
// resolveInstallPlan (the SAME module object bin/install.js requires and
|
||||
// destructures) so it reports a different installSurface for every runtime,
|
||||
// re-requires a fresh bin/install.js so its destructured reference picks up the
|
||||
// stub, and asserts a REAL install(false, 'copilot') run STOPS producing the
|
||||
// copilot-instructions.md artifact that installSurface === 'copilot-instructions'
|
||||
// gates directly inside install() (bin/install.js:~12164 — no finishInstall/CLI
|
||||
// orchestration layer involved, so this is reachable from install() alone). If
|
||||
// install.js ever reverts to a `runtime === 'copilot'` inline branch instead of
|
||||
// reading resolveInstallPlan(runtime).installSurface, the stub has no effect on
|
||||
// that branch and the artifact keeps getting written — which is exactly the
|
||||
// divergence this test would then catch (verified by mutating install.js to that
|
||||
// exact inline form during authoring: the assertion below goes red).
|
||||
test('bin/install.js dispatches config through the REAL resolveInstallPlan (stubbing it changes install() output)', () => {
|
||||
const installPath = require.resolve('../bin/install.js');
|
||||
const registryPath = require.resolve('../msd-core/bin/lib/runtime-config-adapter-registry.cjs');
|
||||
const registryModule = require(registryPath);
|
||||
const originalResolveInstallPlan = registryModule.resolveInstallPlan;
|
||||
|
||||
registryModule.resolveInstallPlan = (runtime) => ({
|
||||
...originalResolveInstallPlan(runtime),
|
||||
// Force every gate bin/install.js checks against
|
||||
// resolveInstallPlan(runtime).installSurface to read as "nothing special for
|
||||
// this runtime" — including copilot's own surface, which the real descriptor
|
||||
// sets to 'copilot-instructions'.
|
||||
installSurface: 'settings-json',
|
||||
});
|
||||
|
||||
delete require.cache[installPath];
|
||||
const stubbedInstaller = require(installPath);
|
||||
|
||||
const tmpDir = createTempDir('msd-3466-delegation-guard-');
|
||||
const previousCwd = process.cwd();
|
||||
process.chdir(tmpDir);
|
||||
try {
|
||||
const result = stubbedInstaller.install(false, 'copilot');
|
||||
const instructionsPath = path.join(result.configDir, 'copilot-instructions.md');
|
||||
assert.equal(
|
||||
fs.existsSync(instructionsPath), false,
|
||||
'with resolveInstallPlan stubbed to report installSurface: "settings-json" for every '
|
||||
+ 'runtime, install(\'copilot\') must NOT write copilot-instructions.md — if it still '
|
||||
+ 'does, bin/install.js is not actually gating on resolveInstallPlan(runtime) for this '
|
||||
+ 'decision (a regression to scattered per-runtime branching)',
|
||||
);
|
||||
} finally {
|
||||
process.chdir(previousCwd);
|
||||
cleanup(tmpDir);
|
||||
registryModule.resolveInstallPlan = originalResolveInstallPlan;
|
||||
delete require.cache[installPath];
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user