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

@@ -62,8 +62,8 @@ const EXPECTED_MANIFEST_COUNT = MANIFEST_FAMILIES.length;
// Longest-first: `skills/msd` (hermes category dir) must win over `skills` for
// `skills/msd/...`, and `.agents/skills` must win over `.agents`.
const SKILLS_ROOTS = ['skills/msd', '.agents/skills', 'skills'];
const HOOKS_ROOTS = ['.kimi-code/hooks', '.kimi/hooks', 'hooks'];
const SKILLS_ROOTS = ['.agents/skills', 'skills'];
const HOOKS_ROOTS = ['hooks'];
/** Source-of-truth command dir every skill/command surface converts from. */
const COMMANDS_SRC = 'commands/msd';
@@ -194,9 +194,7 @@ const RUNTIME_NOTE_FILTER_TRANSFORM_SRCS = [
'bin/install.js',
];
const RUNTIME_NOTE_FILTERED_FAMILIES = new Set(
MANIFEST_FAMILIES
.filter(({ runtime }) => runtime !== 'copilot')
.map(({ name }) => name),
MANIFEST_FAMILIES.map(({ name }) => name),
);
/**
@@ -352,13 +350,6 @@ const PROVENANCE_RULES = [
sources: (m) => [`agents/${m[0]}`],
transforms: AGENT_TRANSFORM_SRCS,
},
{
id: 'copilot-agent-rename',
kind: 'rewrite',
roots: ['agents'],
pattern: /^([^/]+)\.agent\.md$/,
sources: (m) => [`agents/${m[1]}.md`],
},
// ── Derived from another repo file ─────────────────────────────────────────
{
@@ -373,15 +364,6 @@ const PROVENANCE_RULES = [
// every emitted .toml without touching any agents/*.md. See AGENT_TRANSFORM_SRCS.
transforms: AGENT_TRANSFORM_SRCS,
},
{
id: 'agents-subagent-derived',
kind: 'derived',
roots: ['agents'],
// Kimi emits a per-agent subagent pair (.md + .yaml) from one agents/*.md.
// install.js:2344 — `yamlPath: agents/subagents/${subagent.name}.yaml`.
pattern: /^subagents\/([^/]+)\.(md|yaml)$/,
sources: (m) => [`agents/${m[1]}.md`],
},
{
id: 'hooks-built',
// `kind` is a single scalar per rule, and this rule's majority sub-family
@@ -495,48 +477,6 @@ const PROVENANCE_RULES = [
return [COMMONJS_MARKER_SRC, INSTALLER_SRC, HOOKS_WINDOWS_SHIM_SRC];
},
},
{
// #3023: pi renames the shared hooks bundle's staged directory from the
// default `hooks/` to `msd-hooks/` (hostBehaviors.sharedHooksDirName,
// bin/install.js's resolveSharedHooksDirName). Same family as `hooks-built`
// above (built from hooks/ via scripts/build-hooks.js), staged under a
// different root for exactly one runtime — a dedicated, `runtimes`-scoped
// rule keeps that pi-only rename from ever being able to shadow another
// host's `(rel, runtime)` pair, rather than folding 'msd-hooks' into the
// shared HOOKS_ROOTS list `hooks-built`/`commonjs-marker` both key off.
// `package.json` (the CommonJS marker) is excluded here and owned by the
// dedicated `pi-shared-hooks-commonjs-marker` rule below, mirroring how
// `hooks-built` excludes it in favor of the shared `commonjs-marker` rule.
id: 'pi-shared-hooks-built',
kind: 'derived',
runtimes: new Set(['pi']),
roots: ['msd-hooks'],
pattern: /^(?!package\.json$).+$/,
sources: (m) => [`hooks/${m[0]}`],
},
{
// Companion to `pi-shared-hooks-built`: the CommonJS-mode marker written
// into pi's renamed `msd-hooks/` root by the same installSharedHooksBundle
// call the generic `commonjs-marker` rule attributes for the `hooks/`
// family. Kept as its own pi-scoped rule for the same reason as above.
id: 'pi-shared-hooks-commonjs-marker',
kind: 'code-derived',
runtimes: new Set(['pi']),
roots: ['msd-hooks'],
pattern: /^package\.json$/,
sources: () => [COMMONJS_MARKER_SRC, INSTALLER_SRC],
},
{
id: 'copilot-hook-registration',
kind: 'code-derived',
roots: ['hooks'],
// Deliberately golden-trackable: unlike settings.json / hooks.json (excluded
// by HOOK_CONFIG_FILES because they embed a platform-varying node-runner
// command), this one is platform-stable and stays in the manifest
// (src/runtime-hooks-surface.cts:73,89).
pattern: /^msd-session\.json$/,
sources: () => [CLINE_BODY_SRC],
},
// ── Skill / command surfaces — all convert from commands/msd/*.md ──────────
{
@@ -612,13 +552,6 @@ const PROVENANCE_RULES = [
// ── Code-derived: content is a literal in a repo source file ──────────────
// Attributable on purpose. Marking these exempt would make them permanently
// blind — they could change forever without ever raising an alarm.
{
id: 'cline-rules-code-derived',
kind: 'code-derived',
roots: ['.clinerules'],
pattern: /^(msd\.md|hooks\/PreToolUse)$/,
sources: () => [CLINE_BODY_SRC],
},
// #3547 removed `agents-md-code-derived` (roots: ['.agents'],
// ^AGENTS\.md$) and `synthesized-msd-defaults` (^\.msd/defaults\.json$):
// both paths only appeared in a manifest while the harness collapsed
@@ -630,24 +563,6 @@ const PROVENANCE_RULES = [
// — exactly as designed. The files are still written, still covered by the
// existence/config suites (kimi-upgrades, codex-config, install suites);
// they are simply no longer manifest members to attribute.
{
id: 'hermes-category-description',
kind: 'code-derived',
roots: ['skills/msd'],
pattern: /^DESCRIPTION\.md$/,
sources: () => [INSTALLER_SRC],
},
{
id: 'kimi-root-agent',
kind: 'code-derived',
roots: ['agents'],
// Kimi's root agent pair. The YAML/prompt bodies come from a code literal
// (src/runtime-artifact-layout.cts:303), and the YAML additionally enumerates
// every staged subagent — so adding or removing an agents/*.md legitimately
// moves this file too. Both sources are declared.
pattern: /^msd\.(yaml|md)$/,
sources: () => [KIMI_ROOT_AGENT_SRC, 'agents/'],
},
// ── Synthesized: install-time / environment state, no repo content source ──
{
@@ -658,14 +573,14 @@ const PROVENANCE_RULES = [
// `{"type":"commonjs"}` CommonJS-mode marker as the root one, written into
// each Kimi product's separate hooks root (installSharedHooksBundle; the
// per-runtime root split is #2755).
pattern: /^(\.msd-profile|package\.json|\.kimi(-code)?\/package\.json|msd-core\/VERSION|msd-core\/\.msd-runtime)$/,
pattern: /^(\.msd-profile|package\.json|msd-core\/VERSION|msd-core\/\.msd-runtime)$/,
sources: () => [],
},
{
id: 'synthesized-host-config',
kind: 'synthesized',
roots: null,
pattern: /^(opencode\.json|kilo\.json|mcp_config\.json|config\.toml|copilot-instructions\.md)$/,
pattern: /^(opencode\.json|mcp_config\.json|config\.toml)$/,
sources: () => [],
},
];

View File

@@ -64,21 +64,9 @@ const EXPECTED_ALL_HOOKS = [
const RUNTIME_META = {
claude: { localDir: '.claude', globalSuffix: '.claude' },
antigravity: { localDir: '.agents', globalSuffix: path.join('.gemini', 'antigravity') },
augment: { localDir: '.augment', globalSuffix: '.augment' },
cline: { localDir: '.cline', globalSuffix: '.cline' },
codebuddy: { localDir: '.codebuddy', globalSuffix: '.codebuddy' },
codex: { localDir: '.codex', globalSuffix: '.codex' },
copilot: { localDir: '.github', globalSuffix: '.copilot' },
cursor: { localDir: '.cursor', globalSuffix: '.cursor' },
hermes: { localDir: '.hermes', globalSuffix: '.hermes' },
kimi: { localDir: '.kimi-code', globalSuffix: path.join('.config', 'agents') },
'kimi-code': { localDir: '.kimi-code', globalSuffix: '.kimi-code' },
kilo: { localDir: '.kilo', globalSuffix: path.join('.config', 'kilo') },
opencode: { localDir: '.opencode', globalSuffix: path.join('.config', 'opencode') },
pi: { localDir: '.pi', globalSuffix: path.join('.pi', 'agent') },
qwen: { localDir: '.qwen', globalSuffix: '.qwen' },
trae: { localDir: '.trae', globalSuffix: '.trae' },
windsurf: { localDir: '.windsurf', globalSuffix: path.join('.codeium', 'windsurf') },
zcode: { localDir: '.zcode', globalSuffix: '.zcode' },
};
@@ -116,12 +104,11 @@ const MANIFEST_FAMILIES = [
* derived — it ratchets, and lowering it is a deliberate, reviewable act. It never
* blocks ADDING a runtime, which is the asymmetry the old shared literal lacked.
*/
const MINIMUM_MANIFEST_FAMILIES = 19;
const MINIMUM_MANIFEST_FAMILIES = 7;
// Runtimes that emit per-skill files under skills/ (not rules-based or commands-based)
const SKILL_RUNTIMES = [
'claude', 'opencode', 'kilo', 'codex', 'copilot', 'antigravity',
'cursor', 'augment', 'trae', 'qwen', 'codebuddy',
'claude', 'opencode', 'codex', 'antigravity', 'cursor',
];
// ─── Golden install-parity manifest (canonical — issue #2266) ────────────────