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:
@@ -1129,72 +1129,3 @@ describe('input validators: shell metacharacter and identifier rejection', () =>
|
||||
assert.strictEqual(validateFieldName('').valid, false);
|
||||
});
|
||||
});
|
||||
|
||||
// ─── Hook: msd-prompt-guard under Kimi tool vocabulary (#2304) ──────────────
|
||||
|
||||
describe('#2304: msd-prompt-guard engages on Kimi tool vocabulary', () => {
|
||||
// Payload shapes mirror kimi-cli's actual tool schemas
|
||||
// (src/kimi_cli/tools/file/{write,replace}.py): WriteFile takes
|
||||
// `path`/`content`, StrReplaceFile takes `path` + `edit: Edit | list[Edit]`.
|
||||
|
||||
test('WriteFile of hostile .planning/ content triggers the advisory like Write', () => {
|
||||
const content = fs.readFileSync(
|
||||
path.join(FIXTURE_DIR, 'context-instruction-override.md'), 'utf-8');
|
||||
const r = runHook(PROMPT_GUARD_HOOK, {
|
||||
tool_name: 'WriteFile',
|
||||
tool_input: { path: '/proj/.planning/CONTEXT.md', content },
|
||||
});
|
||||
assert.strictEqual(r.status, 0, 'hooks never block (must exit 0)');
|
||||
assert.ok(r.parsed, `Kimi WriteFile of hostile content must trigger the advisory; got ${JSON.stringify(r.stdout)}`);
|
||||
assert.strictEqual(r.parsed.hookSpecificOutput.hookEventName, 'PreToolUse');
|
||||
assert.ok(typeof r.additionalContext === 'string' && r.additionalContext.length > 0,
|
||||
'advisory must include non-empty additionalContext');
|
||||
});
|
||||
|
||||
test('StrReplaceFile with a hostile edit.new triggers the advisory like Edit', () => {
|
||||
const content = fs.readFileSync(
|
||||
path.join(FIXTURE_DIR, 'plan-fake-system-tags.md'), 'utf-8');
|
||||
const r = runHook(PROMPT_GUARD_HOOK, {
|
||||
tool_name: 'StrReplaceFile',
|
||||
tool_input: { path: '/proj/.planning/PLAN.md', edit: { old: 'x', new: content } },
|
||||
});
|
||||
assert.strictEqual(r.status, 0);
|
||||
assert.ok(r.parsed, 'Kimi StrReplaceFile of hostile content must trigger the advisory');
|
||||
});
|
||||
|
||||
test('StrReplaceFile with a hostile edit in a list of edits triggers the advisory', () => {
|
||||
const content = fs.readFileSync(
|
||||
path.join(FIXTURE_DIR, 'context-instruction-override.md'), 'utf-8');
|
||||
const r = runHook(PROMPT_GUARD_HOOK, {
|
||||
tool_name: 'StrReplaceFile',
|
||||
tool_input: {
|
||||
path: '/proj/.planning/PLAN.md',
|
||||
edit: [{ old: 'a', new: 'benign text' }, { old: 'b', new: content }],
|
||||
},
|
||||
});
|
||||
assert.strictEqual(r.status, 0);
|
||||
assert.ok(r.parsed, 'a hostile edit anywhere in the list must trigger the advisory');
|
||||
});
|
||||
|
||||
test('module-qualified kimi_cli.tools.file:WriteFile is recognized', () => {
|
||||
const content = fs.readFileSync(
|
||||
path.join(FIXTURE_DIR, 'context-instruction-override.md'), 'utf-8');
|
||||
const r = runHook(PROMPT_GUARD_HOOK, {
|
||||
tool_name: 'kimi_cli.tools.file:WriteFile',
|
||||
tool_input: { path: '/proj/.planning/CONTEXT.md', content },
|
||||
});
|
||||
assert.strictEqual(r.status, 0);
|
||||
assert.ok(r.parsed, 'module-qualified Kimi WriteFile must trigger the advisory');
|
||||
});
|
||||
|
||||
test('non-write Kimi tools stay silent even with hostile content', () => {
|
||||
const content = fs.readFileSync(
|
||||
path.join(FIXTURE_DIR, 'context-instruction-override.md'), 'utf-8');
|
||||
const r = runHook(PROMPT_GUARD_HOOK, {
|
||||
tool_name: 'kimi_cli.tools.file:Grep',
|
||||
tool_input: { path: '/proj/.planning/PLAN.md', content },
|
||||
});
|
||||
assert.strictEqual(r.status, 0);
|
||||
assert.strictEqual(r.silent, true, 'prompt-guard scope is write tools only — Grep must stay silent');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user