Repository navigation
[AI-1126] Phase D-c (CLI): materialize definition MCP allowlists — kcap-owned registry, capability strip, additive wire field - #253
Conversation
…Context Threads the flow definition's MCP allowlist from the server through the daemon to the launchers (Task 6 consumes it). LaunchAgentCommand gains string[]? McpAllowlist, appended last after SyncFromRepoRoot for positional-SignalR wire compatibility in both directions (old daemon ignores the new field; new daemon defaults to null against an old server). LauncherContext gains the same field, mapped in AgentOrchestrator where the context is built. Locks the wire contract with three tests: round-trip as snake_case mcp_allowlist, legacy payload without the field deserializes null, and a frozen copy of the pre-AI-1126 record shape (its own source-generated JsonSerializerContext, not bare reflection) proves an old reader tolerates the unknown field.
…etadata Implement the authoritative MCP server registry with case-insensitive name resolution and StartsFlows capability marking. Four known servers (kcap-review, kcap-sessions, kcap-memory, kcap-flows) resolve with correct Args arrays and capability flags. kcap-flow-result deliberately excluded (injection-only). Registry is the ONLY source flow definitions' mcp allowlists resolve against. All 22 new tests pass; full unit suite: 2156/2156 ✓ Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…pability strip, kcap-owned registry, flow-result injection preserved) Both ClaudeLauncher.BuildReviewFlowMcpConfig and CodexLauncher.AddAllowlistServers resolve LauncherContext.McpAllowlist entries against the kcap-owned KcapMcpRegistry (Task 5), skip unknown names, strip flow-starting servers regardless of casing, and materialize the rest into the same mcpServers config as the kcap-flow-result injection (KCAP_URL only, never KCAP_FLOW_AGENT_ID). Same ServerUrl/CapacitorPath gating as the flow-result server; empty/absent allowlist is byte-identical to today, locked by new regression tests.
PR Summary by QodoMaterialize MCP allowlists for review flows via kcap-owned registry (CLI/daemon)
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
Code Review by Qodo
1.
|
…ed-reviewer MCP wording KcapMcpRegistry.Resolve now guards against null/blank names before Trim(), since launchers pass wire-deserialized allowlist elements straight in and a null element previously threw a NullReferenceException during launch. Both launchers' unknown-name log calls are null-safe too. README no longer claims kcap-flow-result is the reviewer's only MCP server — the flow definition's mcp: allowlist can grant additional kcap-owned context servers.
Summary
CLI/daemon half of the final Phase-D slice (spec: kcap-server
docs/superpowers/specs/2026-07-02-ai1126-flows-phase-d-design.md; server half: kurrent-io/kcap-server#932 — either merge order is safe):LaunchAgentCommandgainsstring[]? McpAllowlist = null(appended last, snake_casemcp_allowlist). Compat pinned in BOTH directions through the production source-gen options: new reader/old payload → null, and an old-reader test deserializing a new payload into a frozen copy of the pre-change record shape (a real frozenJsonSerializerContext, not reflection defaults).KcapMcpRegistry(Cli.Core): the kcap-owned server registry —kcap-review/kcap-sessions/kcap-memory(StartsFlows=false) +kcap-flows(StartsFlows=true); case-insensitive, trimmed, canonical lower-case ids; args pinned againstCodexConfigToml+kcap/.mcp.json;kcap-flow-resultdeliberately absent (injection-only, never allowlistable).--mcp-configJSON as the AI-1139kcap-flow-resultinjection, under unchanged--strict-mcp-config+--disallowedTools Agent; Codex: dotted-c mcp_servers.<id>.…overrides after the whole-tablemcp_servers={}clear. Allowlist servers getKCAP_URLonly —KCAP_FLOW_AGENT_IDstays flow-result-exclusive. Same ServerUrl/CapacitorPath gating as flow-result.CollectionOrdering.Matching— a reordering probe fails them, verified).Test plan
KcapMcpRegistryTests22/22 (args independently verified against both authoritative sources in review)ServerUrlProbepreviously verified reproducing on clean baseline)Notes for the merger
StartsFlows: trueAND to the server'sFlowMcpServersdenylist (kcap-server#932) — the registry is the authoritative layer.🤖 Generated with Claude Code