From 92432ad7505edc573242a1559275d91549e6ab92 Mon Sep 17 00:00:00 2001 From: Hare Date: Sat, 20 Jun 2026 17:48:39 +0900 Subject: [PATCH] ticket: accept mcp tools call --- .../artifacts/orchestration-plan.jsonl | 1 + .yoi/tickets/00001KVHR3WSD/item.md | 4 +- .yoi/tickets/00001KVHR3WSD/thread.md | 65 +++++++++++++++++++ 3 files changed, 68 insertions(+), 2 deletions(-) diff --git a/.yoi/tickets/00001KVHR3WSD/artifacts/orchestration-plan.jsonl b/.yoi/tickets/00001KVHR3WSD/artifacts/orchestration-plan.jsonl index 4fa63ffe..60b3d6c6 100644 --- a/.yoi/tickets/00001KVHR3WSD/artifacts/orchestration-plan.jsonl +++ b/.yoi/tickets/00001KVHR3WSD/artifacts/orchestration-plan.jsonl @@ -1 +1,2 @@ {"id":"orch-plan-20260620-060022-1","ticket_id":"00001KVHR3WSD","kind":"blocked_by","related_ticket":"00001KVHR3WS6","note":"tools/call execution requires registered MCP tools. `00001KVHR3WS6` is queued and depends on lifecycle; leave this Ticket queued until tool registration is closed.","author":"yoi-orchestrator","at":"2026-06-20T06:00:22Z"} +{"id":"orch-plan-20260620-084746-2","ticket_id":"00001KVHR3WSD","kind":"accepted_plan","accepted_plan":{"summary":"Registered MCP tool invocationを existing ordinary Tool pathから MCP `tools/call` に接続する。PreToolCall/Tool permission denial は server request 前に適用し、normal result / MCP `isError` / JSON-RPC protocol error を区別し、content/structuredContent/_meta を boundedに Tool resultへ変換する。","branch":"impl/00001KVHR3WSD-mcp-tools-call","worktree":"/home/hare/Projects/yoi/.worktree/00001KVHR3WSD-mcp-tools-call","role_plan":"ユーザーが blocker のない作業の並列実行を許可したため、Dashboard/Console refactor と並行して MCP `tools/call` Ticket を専用 worktree `.worktree/00001KVHR3WSD-mcp-tools-call` で開始する。Coder は child worktree narrow write scopeで実装し、Reviewer は permission-before-call、ordinary Tool history path、bounded result serialization、no resources/prompts/list_changed scope creep を確認する。"},"author":"yoi-orchestrator","at":"2026-06-20T08:47:46Z"} diff --git a/.yoi/tickets/00001KVHR3WSD/item.md b/.yoi/tickets/00001KVHR3WSD/item.md index 6e78768e..98b916cf 100644 --- a/.yoi/tickets/00001KVHR3WSD/item.md +++ b/.yoi/tickets/00001KVHR3WSD/item.md @@ -1,8 +1,8 @@ --- title: 'MCP: execute tools/call through ordinary Tool path' -state: 'queued' +state: 'inprogress' created_at: '2026-06-20T05:30:04Z' -updated_at: '2026-06-20T06:00:44Z' +updated_at: '2026-06-20T08:48:15Z' assignee: null readiness: 'implementation_ready' risk_flags: ['mcp', 'tools-call', 'permission', 'history', 'bounded-output'] diff --git a/.yoi/tickets/00001KVHR3WSD/thread.md b/.yoi/tickets/00001KVHR3WSD/thread.md index 58f6808c..34c8b109 100644 --- a/.yoi/tickets/00001KVHR3WSD/thread.md +++ b/.yoi/tickets/00001KVHR3WSD/thread.md @@ -27,3 +27,68 @@ Next: - `00001KVHR3WS6` が closed になった後、改めて reroute する。 --- + + + +## Decision + +Routing decision: implementation_ready_parallel + +Reason: +- User directive: 「blocker無いなら並列にやっちゃえよ」。この指示により、未解決 blocker がない Ticket は並列実装対象として扱う。 +- 前回は `00001KVHR3WS6` tool registration が未完了だったため blocked/queued hold としたが、現在 `00001KVHR3WS6` は closed。 +- Ticket body は MCP `tools/call` execution、permission-before-call、ordinary Tool result/history path、normal result / MCP `isError` / JSON-RPC protocol error の区別、bounded result serialization を実装可能な粒度で定義している。 +- 現在 inprogress は Dashboard/Console TUI refactor `00001KVHX0WBE` のみで、作業領域は TUI/CLI naming/module boundary。MCP `tools/call` 実装とは直接 conflict しないため、別 worktree / sibling Coder Pod で並列化できる。 +- Orchestrator worktree は clean、matching branch/worktree はなし。 +- Risk domain は mcp / tools-call / permission / history / bounded-output だが、Ticket は permission denied before server request、ordinary Tool result/history path、bounded output、untrusted content treatment を明示している。bounded context check 後も implementation 前に必要な追加 human decision は見つからなかった。 + +Evidence checked: +- Ticket `00001KVHR3WSD` body / thread / relations / artifacts。 +- `TicketRelationQuery(00001KVHR3WSD)`: outgoing `depends_on 00001KVHR3WS6` is now closed。 +- `TicketOrchestrationPlanQuery(00001KVHR3WSD)`: previous `blocked_by 00001KVHR3WS6` is resolved; accepted plan recorded now。 +- Workspace state: + - Orchestrator worktree clean at `381db88e`。 + - inprogress: `00001KVHX0WBE` only。 + - visible spawned child: Dashboard/Console Coder only。 + - no matching MCP tools-call branch/worktree。 + +IntentPacket: + +Intent: +- Route invocation of registered MCP-backed Yoi tools to MCP `tools/call` through ordinary Yoi Tool execution/result/history paths。 +- Enforce existing PreToolCall / Tool permission policy before any MCP server request is sent。 + +Binding decisions / invariants: +- Permission denial must occur before sending `tools/call` to the MCP server。 +- MCP result content is untrusted and must not become hidden context injection。 +- Results must be recorded through ordinary Tool call/result history path。 +- Distinguish normal result, MCP `isError: true`, and JSON-RPC protocol error。 +- Serialize content blocks / structuredContent / `_meta` boundedly; oversize/rich results must be truncated or rejected by explicit policy。 +- Preserve lifecycle/registration redaction and bounds from previous MCP Tickets。 +- Do not implement resources/read, prompts/get, list_changed, sampling, or elicitation in this Ticket。 + +Requirements / acceptance criteria: +- MCP mock tool returns normal result through ordinary Yoi Tool result。 +- MCP `isError: true` is represented distinctly from JSON-RPC protocol failure。 +- Permission denied call is not sent to MCP server。 +- Oversize/rich results are bounded/truncated or rejected according to explicit policy。 +- Tool history shows ordinary tool call/result, not hidden context injection。 +- Tests cover normal result, `isError`, protocol error, permission denial, and output bounds。 + +Escalate if: +- Existing ToolRegistry contribution path cannot route invocation without broad provider-substrate redesign。 +- Permission-before-call cannot be represented without changing Tool policy architecture。 +- Result serialization requires product decisions beyond a safe bounded subset。 + +Next action: +- Record `queued -> inprogress` and commit Ticket records before creating implementation worktree and spawning Coder。 + +--- + + + +## State changed + +User explicitly authorized parallel implementation when no blocker exists. Ticket body/thread, relation metadata, closed MCP tool-registration dependency, Orchestrator worktree state, visible Pods, existing branch/worktree, and bounded MCP tools/call context were checked. Dependency `00001KVHR3WS6` is closed, no matching worktree/branch exists, and no missing planning decision was found. Accepting this queued Ticket for parallel implementation before worktree/Pod side effects. + +---