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:
@@ -38,9 +38,7 @@ const {
|
||||
EXPECTED_MANIFEST_COUNT,
|
||||
PROVENANCE_RULES,
|
||||
COMMANDS_SRC,
|
||||
CLINE_BODY_SRC,
|
||||
HOOKS_WINDOWS_SHIM_SRC,
|
||||
KIMI_ROOT_AGENT_SRC,
|
||||
AGENT_TRANSFORM_SRCS,
|
||||
RUNTIME_NOTE_FILTER_TRANSFORM_SRCS,
|
||||
stripSkillPrefix,
|
||||
@@ -69,7 +67,7 @@ function manifests() {
|
||||
|
||||
// ─── Totality (issue #2722's headline acceptance criterion) ──────────────────
|
||||
|
||||
test('totality: every emitted path across all 19 manifests matches exactly one rule', () => {
|
||||
test('totality: every emitted path across all runtime manifests matches exactly one rule', () => {
|
||||
// Assert the COUNT, not just "some files": a glob that silently matched fewer
|
||||
// fixtures would otherwise report a vacuous pass over a shrunken universe.
|
||||
assert.equal(
|
||||
@@ -80,7 +78,12 @@ test('totality: every emitted path across all 19 manifests matches exactly one r
|
||||
|
||||
const { checked, byRule } = assertTotality(manifests());
|
||||
|
||||
assert.ok(checked > 8000, `expected the full emitted corpus, only checked ${checked}`);
|
||||
// Per-manifest floor (not a corpus-wide literal) so the bar scales with the
|
||||
// number of runtime families instead of silently going stale when one is added/removed.
|
||||
assert.ok(
|
||||
checked > 500 * EXPECTED_MANIFEST_COUNT,
|
||||
`expected the full emitted corpus, only checked ${checked} across ${EXPECTED_MANIFEST_COUNT} manifests`,
|
||||
);
|
||||
// No dead rules — assertTotality already throws on one; this pins the contract
|
||||
// so a future refactor cannot quietly downgrade it to a warning.
|
||||
for (const [ruleId, count] of byRule) {
|
||||
@@ -160,9 +163,7 @@ test('spot-check: flat skill attributes to commands/msd, NOT the generated repo
|
||||
});
|
||||
|
||||
test('spot-check: nested skill attributes to its child stem, not its router', () => {
|
||||
// augment is a real nested-layout host (#69); the key below is verbatim from
|
||||
// tests/fixtures/golden-install-parity/augment.json, not a constructed path.
|
||||
const nested = attributeEmittedPath('skills/msd-ns-manage/skills/config/SKILL.md', 'augment');
|
||||
const nested = attributeEmittedPath('skills/msd-ns-manage/skills/config/SKILL.md', 'claude');
|
||||
assert.equal(nested.ruleId, 'skills-nested-from-commands');
|
||||
assert.deepEqual(nested.sources, [`${COMMANDS_SRC}/config.md`]);
|
||||
assert.ok(
|
||||
@@ -171,21 +172,12 @@ test('spot-check: nested skill attributes to its child stem, not its router', ()
|
||||
);
|
||||
|
||||
// The router itself is a normal flat skill and resolves to its own stem.
|
||||
const router = attributeEmittedPath('skills/msd-ns-manage/SKILL.md', 'augment');
|
||||
const router = attributeEmittedPath('skills/msd-ns-manage/SKILL.md', 'claude');
|
||||
assert.equal(router.ruleId, 'skills-from-commands');
|
||||
assert.deepEqual(router.sources, [`${COMMANDS_SRC}/ns-manage.md`]);
|
||||
});
|
||||
|
||||
test('spot-check: alternate skills roots (hermes category, codex .agents) strip correctly', () => {
|
||||
// Every key here is verbatim from the named runtime's committed manifest.
|
||||
assert.deepEqual(
|
||||
attributeEmittedPath('skills/msd/msd-ns-context/SKILL.md', 'hermes').sources,
|
||||
[`${COMMANDS_SRC}/ns-context.md`],
|
||||
);
|
||||
assert.deepEqual(
|
||||
attributeEmittedPath('skills/msd/msd-ns-context/skills/docs-update/SKILL.md', 'hermes').sources,
|
||||
[`${COMMANDS_SRC}/docs-update.md`],
|
||||
);
|
||||
test('spot-check: alternate skills roots (codex .agents) strip correctly', () => {
|
||||
// codex — NOT antigravity: codex's skills kind carries a `home` override to
|
||||
// $HOME/.agents/skills (ADR-1239 upgrade 3 / #2088), which is why its emitted
|
||||
// skills sit under `.agents/skills/` rather than `skills/`.
|
||||
@@ -197,54 +189,20 @@ test('spot-check: alternate skills roots (hermes category, codex .agents) strip
|
||||
|
||||
test('spot-check: nativePlugin source is per-runtime, read from the descriptor', () => {
|
||||
const opencode = attributeEmittedPath('plugins/msd-core.js', 'opencode');
|
||||
const kilo = attributeEmittedPath('plugins/msd-core.js', 'kilo');
|
||||
const pi = attributeEmittedPath('extensions/msd.js', 'pi');
|
||||
|
||||
assert.equal(opencode.ruleId, 'native-plugin');
|
||||
assert.deepEqual(opencode.sources, ['.opencode/plugins/msd-core.js']);
|
||||
assert.deepEqual(kilo.sources, ['.kilo/plugins/msd-core.js']);
|
||||
assert.deepEqual(pi.sources, ['pi/msd.cjs']);
|
||||
|
||||
// Independence: the SAME emitted key resolves differently per host. A design
|
||||
// keyed on `rel` alone would silently give kilo opencode's source.
|
||||
assert.notDeepEqual(
|
||||
opencode.sources,
|
||||
kilo.sources,
|
||||
'attribution must be a function of (rel, runtime), not rel alone',
|
||||
);
|
||||
});
|
||||
|
||||
test('spot-check: agents identity, Copilot rename, Codex toml, and Kimi subagent derivation', () => {
|
||||
test('spot-check: agents identity and Codex toml derivation', () => {
|
||||
assert.deepEqual(
|
||||
attributeEmittedPath('agents/msd-planner.md', 'claude').sources,
|
||||
['agents/msd-planner.md'],
|
||||
);
|
||||
// Copilot renames to <name>.agent.md — attributing that as identity resolved to
|
||||
// a file that does not exist (real bug found by the source-existence gate).
|
||||
assert.deepEqual(
|
||||
attributeEmittedPath('agents/msd-planner.agent.md', 'copilot').sources,
|
||||
['agents/msd-planner.md'],
|
||||
);
|
||||
assert.deepEqual(
|
||||
attributeEmittedPath('agents/msd-planner.toml', 'codex').sources,
|
||||
['agents/msd-planner.md'],
|
||||
);
|
||||
// Two emitted paths sharing one source is legal; one path matching two rules is not.
|
||||
const yaml = attributeEmittedPath('agents/subagents/msd-planner.yaml', 'kimi');
|
||||
const md = attributeEmittedPath('agents/subagents/msd-planner.md', 'kimi');
|
||||
assert.deepEqual(yaml.sources, ['agents/msd-planner.md']);
|
||||
assert.deepEqual(md.sources, yaml.sources);
|
||||
});
|
||||
|
||||
test('spot-check: Kimi root agent is code-derived, not a repo agent file', () => {
|
||||
const rootYaml = attributeEmittedPath('agents/msd.yaml', 'kimi');
|
||||
assert.equal(rootYaml.ruleId, 'kimi-root-agent');
|
||||
assert.equal(rootYaml.kind, 'code-derived');
|
||||
// Built from a literal AND an enumeration of every staged agent, so both are
|
||||
// declared; the trailing-slash entry is a prefix, not a file.
|
||||
assert.ok(rootYaml.sources.includes(KIMI_ROOT_AGENT_SRC));
|
||||
assert.ok(rootYaml.sources.includes('agents/'));
|
||||
assert.deepEqual(attributeEmittedPath('agents/msd.md', 'kimi').ruleId, 'kimi-root-agent');
|
||||
});
|
||||
|
||||
test('spot-check: hooks attribute to repo source, not the dist build artifact', () => {
|
||||
@@ -256,15 +214,6 @@ test('spot-check: hooks attribute to repo source, not the dist build artifact',
|
||||
attributeEmittedPath('hooks/lib/git-cmd.js', 'claude').sources,
|
||||
['hooks/lib/git-cmd.js'],
|
||||
);
|
||||
// Kimi installs the same bundle under its own hooks root.
|
||||
assert.deepEqual(
|
||||
attributeEmittedPath('.kimi/hooks/msd-statusline.js', 'kimi').sources,
|
||||
['hooks/msd-statusline.js'],
|
||||
);
|
||||
// Copilot's hook REGISTRATION json is a code literal, not a built script.
|
||||
const reg = attributeEmittedPath('hooks/msd-session.json', 'copilot');
|
||||
assert.equal(reg.ruleId, 'copilot-hook-registration');
|
||||
assert.deepEqual(reg.sources, [CLINE_BODY_SRC]);
|
||||
});
|
||||
|
||||
test('spot-check: Windows-only .cmd shim is code-derived from its generator, not from the .js hook it wraps (#3426/#2767)', () => {
|
||||
@@ -318,18 +267,6 @@ test('spot-check: Windows-only .cmd shim is code-derived from its generator, not
|
||||
assert.deepEqual(plain.transforms, []);
|
||||
});
|
||||
|
||||
test('spot-check: cline rules are code-derived (attributable), not exempt', () => {
|
||||
for (const rel of ['.clinerules/msd.md', '.clinerules/hooks/PreToolUse']) {
|
||||
const got = attributeEmittedPath(rel, 'cline');
|
||||
assert.equal(got.kind, 'code-derived', `${rel} must stay attributable`);
|
||||
assert.deepEqual(got.sources, [CLINE_BODY_SRC]);
|
||||
}
|
||||
// #3547 dropped the `.agents/AGENTS.md` spot-check: that path only entered a
|
||||
// manifest while the harness's collapsed --config-dir walked cline's
|
||||
// ~/.agents sibling; with the real `.cline` config home it can never occur,
|
||||
// and the rule was removed by the dead-rule arm.
|
||||
});
|
||||
|
||||
test('spot-check: install-time state is exempt with an empty source list', () => {
|
||||
for (const [rel, rt] of [
|
||||
['.msd-profile', 'claude'],
|
||||
@@ -368,14 +305,12 @@ test('#4482 runtime-note-filtered command and skill surfaces declare their conve
|
||||
assert.deepEqual(skill.transforms, RUNTIME_NOTE_FILTER_TRANSFORM_SRCS);
|
||||
assert.deepEqual(workflow.transforms, RUNTIME_NOTE_FILTER_TRANSFORM_SRCS);
|
||||
|
||||
assert.deepEqual(attributeEmittedPath('commands/msd-plan-phase.md', 'kilo').transforms, RUNTIME_NOTE_FILTER_TRANSFORM_SRCS);
|
||||
assert.deepEqual(attributeEmittedPath('skills/msd-plan-phase/SKILL.md', 'cursor').transforms, RUNTIME_NOTE_FILTER_TRANSFORM_SRCS);
|
||||
assert.deepEqual(attributeEmittedPath('msd-core/workflows/mvp-phase.md', 'claude-local').transforms, RUNTIME_NOTE_FILTER_TRANSFORM_SRCS);
|
||||
assert.deepEqual(attributeEmittedPath('msd-core/workflows/mvp-phase.md', 'copilot').transforms, []);
|
||||
});
|
||||
|
||||
test('a rule with no transforms field still returns an empty array, never undefined', () => {
|
||||
const got = attributeEmittedPath('agents/msd-planner.agent.md', 'copilot');
|
||||
const got = attributeEmittedPath('plugins/msd-core.js', 'opencode');
|
||||
assert.deepEqual(got.transforms, [], 'absence of transforms must be a stable empty array, not undefined');
|
||||
});
|
||||
|
||||
@@ -543,11 +478,14 @@ test('removing a rule fails the guard with the unmatched paths named', () => {
|
||||
() => assertTotality(manifests(), without),
|
||||
(err) => {
|
||||
assert.match(err.message, /match no provenance rule/);
|
||||
// A count is reported, and it is the real one — 5,510 msd-core paths across
|
||||
// 19 manifests, not the 10 the message samples.
|
||||
// A count is reported, and it is the real one — thousands of msd-core paths
|
||||
// across every runtime manifest, not the 10 the message samples.
|
||||
const m = err.message.match(/(\d+) emitted path\(s\) match no provenance rule/);
|
||||
assert.ok(m, 'the failure must report how many paths went unattributed');
|
||||
assert.ok(Number(m[1]) > 5000, `expected the full msd-core corpus, got ${m[1]}`);
|
||||
assert.ok(
|
||||
Number(m[1]) > 200 * EXPECTED_MANIFEST_COUNT,
|
||||
`expected the full msd-core corpus, got ${m[1]}`,
|
||||
);
|
||||
// Named samples are real emitted paths from the removed rule's family.
|
||||
assert.match(err.message, /msd-core\//);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user