From e1d1931006b001ec65090f11a90cfcb81d63b86e Mon Sep 17 00:00:00 2001 From: "Claude (noether)" Date: Sun, 10 May 2026 06:06:14 +0000 Subject: [PATCH] phase0 review: tighten phase 2 row + add Q9, Q10, sharpen Q6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Captures three findings from the review of 013c625 ("phase0 amendment: insert MCP phase 2"). Opening as a PR rather than direct-to-main: the non-PR-flow convention works fine for autonomous work, but feedback- required iteration needs a readable medium that isn't the Claude Code transcript. §11 phase 2 row: spell out two scope items the original row left implicit — the system-prompt rewrite to declare the tools schema (Phase 0's `CMD:` contract is hard-coded into the prompt) and `safety.lua` extension to gate tool calls (per Q8). §13 Q6: explicit note that choosing "retire `CMD:`" requires a §3 invariant amendment in the same commit — keeps the substrate-vs-phase boundary honest. Adds (§3 if retiring) to the impact column. §13 Q9 (new): MCP system-prompt augmentation locus — static block in broker.lua / per-request assembly from connected servers / hybrid. Real architectural call with token-cost tradeoff per option. §13 Q10 (new): tool-call streaming vs the Phase 1 SSE substrate — phase-ordering question. Either Phase 2 lands on the blocking Phase 0 broker and refits when SSE arrives, or Phase 1 SSE moves before MCP so tool-call deltas stream from day one. --- docs/PHASE0.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/PHASE0.md b/docs/PHASE0.md index 888c947..8574fdf 100644 --- a/docs/PHASE0.md +++ b/docs/PHASE0.md @@ -282,7 +282,7 @@ Config path resolution order: |---|---| | **0** | Blocking REPL, `io.popen` exec, single model, in-memory context, meta commands | | **1** | SSE streaming via libcurl FFI, PTY via `forkpty` FFI, session persistence (`sessions/*.jsonl`), readline custom bindings | -| **2** | MCP client (`mcp.lua`): tool-calling via OpenAI-compatible `tools` field on `/v1/chat/completions`; MCP JSON-RPC 2.0 over HTTP/SSE transport (target: lmcp); tool-result turns in context; per-server config + runtime `:mcp` meta commands | +| **2** | MCP client (`mcp.lua`): tool-calling via OpenAI-compatible `tools` field on `/v1/chat/completions`; MCP JSON-RPC 2.0 over HTTP/SSE transport (target: lmcp); tool-result turns in context; per-server config + runtime `:mcp` meta commands; system prompt rewrite to declare the tools schema (replaces or augments §6's `CMD:` contract — see Q6); `safety.lua` extended to gate tool calls (see Q8) | | **3** | Chuck Norris autonomous mode, destructive op heuristic (static + model), HALT/confirm gate, planning loop (now able to use MCP tools as well as `CMD:` lines) | | **4** | `memory.jsonl` summarization, startup context injection from memory, `:history` management, pruning | | **5** | Multi-model routing by task type, cloud fallback, context summarization via fast model on eviction | @@ -311,9 +311,11 @@ Security posture: aish trusts the local user. The destructive-op gate in Norris | Q3 | Summarization at session end: automatic on `:quit`, or explicit `:save`? | UX + history.lua API | Phase 4 | | Q4 | Should `CMD:` extraction support multi-command blocks (here-doc style)? | executor.lua parser | Phase 1 | | Q5 | Cloud model routing: explicit `:model cloud` only, or automatic fallback on local timeout? | router.lua policy | Phase 5 | -| Q6 | How do `CMD:` extraction (Phase 0) and MCP tool-calls (Phase 2) coexist — both, prefer tools, retire `CMD:`? | broker.lua + executor.lua + system prompt | Phase 2 | +| Q6 | How do `CMD:` extraction (Phase 0) and MCP tool-calls (Phase 2) coexist — both, prefer tools, retire `CMD:`? Note: choosing "retire `CMD:`" requires a §3 invariant amendment in the same commit, not just a Phase 2 internal call. | broker.lua + executor.lua + system prompt + (§3 if retiring) | Phase 2 | | Q7 | MCP server discovery: declared in `config.lua` only, runtime `:mcp connect `, or both? | config.lua schema + repl.lua meta set | Phase 2 | | Q8 | Tool-call authorization gate: per-call confirm (like `confirm_cmd`), per-tool policy in config, or trust-list by server? | safety.lua + mcp.lua + Norris-mode interaction | Phase 2 (informs Phase 3) | +| Q9 | MCP system-prompt augmentation locus: static block in `broker.lua`, assembled per-request from connected servers' tool schemas, or hybrid (static frame + dynamic tool list)? Per-request assembly costs tokens on every turn; static drifts from server reality; hybrid splits the cost. | broker.lua + mcp.lua + system prompt | Phase 2 | +| Q10 | Tool-call streaming vs the Phase 1 SSE substrate: does Phase 2 land tool calls on the still-blocking Phase 0 broker (and refit when SSE arrives in Phase 1), or require Phase 1 SSE to land first so tool-call deltas stream from day one? Phase ordering implication either way. | broker.lua + mcp.lua + phase ordering | Phase 2 (informs Phase 1 ordering) | ---