feat(#2095): migrate Kimi CLI onto EoS imperative adapter + native hook-bus + background dispatch (ADR-1239)

Fold all runtime==='kimi'/isKimi logic branches into descriptor-driven
hostBehaviors (localInstallDeferred, verificationStyle, agentManifestStyle,
reapplyCommand, doneBannerStyle) + add 'kimi' to _DESCRIPTOR_AGENTS_RUNTIMES.
Kimi's skills/kimi-agents dispatch was already descriptor-driven (converter-by-
name + kimi-agents kind). Zero isKimi/runtime==='kimi' branches remain.

UPGRADE 1 (native hook bus): new hooksSurface 'kimi-hooks-toml' + a marker-
delimited config.toml [[hooks]] emitter (buildKimiHooksTomlBlock/writeKimiHooksToml
in runtime-hooks-surface.cts; resolveKimiHooksTomlDir in runtime-homes.cts).
GSD's lifecycle hooks now wire into Kimi's native ~/.kimi/config.toml (Context7-
confirmed path) at SessionStart/PreToolUse/Stop/PreCompact/SubagentStart/
SubagentStop — kimi becomes a hooks/ consumer (the 3 && !isKimi exclusion guards
removed). config.toml holds absolute install paths so it's golden-excluded via
an exact relative-path (.kimi/config.toml), not a basename (which would blind
Codex's config.toml). New hooksSurface value added to the closed enum in
capability-validator + runtime-config-adapter-registry.
UPGRADE 2 (background dispatch): flip dispatch.backgroundDispatch true (Kimi's
Agent tool takes run_in_background; root agent already gets the Agent tool), so
negotiation no longer flattens dispatch. subagentToolkit stays 'undocumented'
per AC (coder/explore/plan have distinct tool policies).
MCP transport explicitly deferred (no installer-driven MCP for any runtime).

Golden: only kimi.json changes (hooks/ scripts now installed); all 15 others +
claude-local byte-identical (kilo/zcode keep their own exclusions). Tests:
kimi-imperative-reference (adapter/axes/fail-closed/hostBehaviors + source-grep
guard) + kimi-upgrades (config.toml [[hooks]] SessionStart + marker idempotency
+ backgroundDispatch negotiation). CONTEXT.md glossary + matrix + how-to updated;
changeset (Added).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-07-10 23:30:09 -04:00
parent a022eec117
commit ab04916682
23 changed files with 1239 additions and 103 deletions

View File

@@ -1,6 +1,32 @@
{
".gsd-profile": "0e716a5fef4e6dc1",
".gsd/defaults.json": "560664b045e645cb",
".kimi/hooks/gsd-check-update-worker.js": "6593f80914f4edee",
".kimi/hooks/gsd-check-update.js": "aac7612ee04ff5fe",
".kimi/hooks/gsd-config-reload.js": "96546e0e8bb47904",
".kimi/hooks/gsd-context-monitor.js": "783c93351e82151f",
".kimi/hooks/gsd-cursor-post-tool.js": "9168e0a09de1972a",
".kimi/hooks/gsd-cursor-pre-tool.js": "873998b25e308c29",
".kimi/hooks/gsd-cursor-session-start.js": "9b2e6f4f0c405375",
".kimi/hooks/gsd-cursor-stop.js": "bfaaf60f419e3238",
".kimi/hooks/gsd-cursor-subagent-start.js": "06d77fde5c1372b6",
".kimi/hooks/gsd-cursor-subagent-stop.js": "4bbf22917da4d389",
".kimi/hooks/gsd-ensure-canonical-path.js": "8bd016237c88b738",
".kimi/hooks/gsd-graphify-update.sh": "e4c6e14fe6ad64ff",
".kimi/hooks/gsd-phase-boundary.sh": "32739d5fbe0d0a1c",
".kimi/hooks/gsd-prompt-guard.js": "a749b8cb2c5248de",
".kimi/hooks/gsd-read-guard.js": "9e423cd03e2d1b16",
".kimi/hooks/gsd-read-injection-scanner.js": "c519598b9257aafa",
".kimi/hooks/gsd-session-state.sh": "e54379ba86bf1b6d",
".kimi/hooks/gsd-statusline.js": "2736b0885aa97bbf",
".kimi/hooks/gsd-update-banner.js": "55143a25f978f301",
".kimi/hooks/gsd-validate-commit.sh": "bf5dd61d33cb3a38",
".kimi/hooks/gsd-workflow-guard.js": "91ae24a15d2bca6f",
".kimi/hooks/gsd-worktree-path-guard.js": "cfde29a547677422",
".kimi/hooks/lib/git-cmd.js": "268ba15992ca0b23",
".kimi/hooks/lib/gsd-graphify-rebuild.sh": "66af89601074d2a9",
".kimi/hooks/managed-hooks-registry.cjs": "07c6a5ecd724edb3",
".kimi/package.json": "dbf8353f77358bc1",
"agents/gsd.md": "60fee7782ae4f2c6",
"agents/gsd.yaml": "253a23ddda06c6c2",
"agents/subagents/gsd-advisor-researcher.md": "81bdc6cbd8fcde40",