ticket: refine plugin feature layering

This commit is contained in:
2026-06-14 01:28:42 +09:00
parent 234ffbff2e
commit 0f7cac62ef
13 changed files with 447 additions and 202 deletions
+21 -8
View File
@@ -2,10 +2,10 @@
title: 'Implement MCP 2025-11-25 local stdio server-feature bridge'
state: 'planning'
created_at: '2026-06-10T07:48:49Z'
updated_at: '2026-06-10T07:48:49Z'
updated_at: '2026-06-13T15:29:21Z'
assignee: null
readiness: 'blocked'
risk_flags: ['mcp', 'authority-boundary', 'prompt-context', 'permission-scope', 'secrets', 'process-exec', 'feature-api']
risk_flags: ['mcp', 'prompt-context', 'permission-scope', 'secrets', 'process-exec', 'feature-api', 'trust-boundary']
---
## Background
@@ -14,12 +14,21 @@ Yoi に MCP integration を追加する。対象は現時点の latest MCP speci
この Ticket は MCP 実装を担当し、`pod::feature` / Worker / ToolRegistry の拡張そのものは別 Ticket `00001KTR81P9X` に分離する。MCP 実装は、その拡張 API に乗り、Yoi の通常 ToolRegistry / permission / history / bounded result path を迂回しない。
MCP は Plugin model そのものではなく、feature API 上に構築される protocol-backed integration layer として扱う。MCP server の enablement、local stdio server trust、command/env/secret policy は MCP layer が独自に持つ。`pod::feature` の authority/grant model で MCP server process の能力を制御する前提は置かない。
Objective context: `00001KTR80WMN`
## Requirements
- MCP specification `2025-11-25` を基準にする。
- local stdio transport の MCP server を explicit Profile/config から有効化できる。
- package/discovery や workspace presence だけで auto-start しない。
- configured server は local executable としてユーザー権限で動く trust boundary であることを docs/diagnostics に明記する。
- Yoi `HostAuthority` は server process の OS-level side effects を sandbox しない。
- MCP local stdio server の configuration/trust policy を MCP layer で定義する。
- command / args / cwd / env / secret refs は明示 config 由来にする。
- inherited env の扱いと secret redaction を決める。
- command/env/secret values を diagnostics / logs / model context に plaintext で出さない。
- stdio subprocess lifecycle を実装する。
- stdin/stdout newline-delimited JSON-RPC。
- stdout は MCP messages として扱う。
@@ -47,10 +56,10 @@ Objective context: `00001KTR80WMN`。
- `isError`
- `_meta`
- text / image / audio / resource_link / embedded resource
- roots を実装する場合は Yoi authorized scope 由来の root のみに限定する。
- roots を実装する場合は、Yoi が server に通知する root を Yoi authorized scope 由来の root のみに限定する。
- これは server process 自体の OS filesystem access sandbox ではない。
- sampling / elicitation は初期実装では client capability として宣言せず、要求された場合は fail-closed diagnostic とする。
- Streamable HTTP transport / OAuth / remote auth / MCP Registry distribution / automatic package execution はこの Ticket の対象外。
- secret refs / env values / command args containing secrets を diagnostics / logs / model context に plaintext で出さない。
- local mock MCP server を使った focused tests を追加する。
- docs に local stdio MCP server の設定例、trust model、permission/scope/secret guidance を追加する。
@@ -59,13 +68,14 @@ Objective context: `00001KTR80WMN`。
- docs/tests/config で MCP spec baseline `2025-11-25` が明記されている。
- 少なくとも1つの local stdio MCP server を Profile/config で有効化できる。
- configured server の initialize 成功/失敗が観測可能で、失敗時に server 名と phase が分かる。
- docs が local stdio server の trust boundary を明記する: server は明示 config で起動される local executable であり、Yoi feature authority では sandbox されない。
- discovered MCP tools が namespaced stable name で Yoi の model-visible tool schema に現れる。
- registered MCP tool を呼ぶと `tools/call` が実行され、normal result / `isError: true` / JSON-RPC protocol error が区別される。
- `resources/list` / `resources/read``prompts/list` / `prompts/get` が明示 tool operations として使え、結果が通常 tool result として history に残る。
- resource/prompt content は history に残らない形で context に注入されない。
- `structuredContent` / output schema / rich content blocks が bounded serialization される。
- list-changed notification が silent stale にならず、safe refresh または restart/reinitialize-required diagnostic として扱われる。
- PreToolCall permission denial が通常 Yoi tool denial と同じ経路で動
- PreToolCall permission denial が通常 Yoi tool denial と同じ経路で動き、denied call は MCP server に送信されない
- server-provided metadata/content が system/developer instruction や Yoi scope/permission を弱めない。
- secrets が diagnostics/logs/model context に plaintext で出ないことを focused test または review で確認できる。
- sampling / elicitation / Streamable HTTP / remote auth / distribution は disabled, fail-closed, or explicitly out-of-scope として実装・docs に反映されている。
@@ -74,10 +84,11 @@ Objective context: `00001KTR80WMN`。
## Binding decisions / invariants
- MCP server は untrusted external capability provider として扱う。
- MCP integration は `pod::feature` / Worker / ToolRegistry の通常 authority path に乗せ、private/ad-hoc bypass を作らない。
- MCP integration は `pod::feature` / Worker / ToolRegistry の通常 contribution path に乗せ、private/ad-hoc bypass を作らない。
- MCP enablement、local stdio command/env/secret policy、server trust model は MCP layer の責務であり、`pod::feature` の authority/grant には載せない。
- `resources/read` / `prompts/get` の結果を hidden context injection しない。明示 tool result としてのみ model-visible にする。
- local process 起動は explicit config と explicit process authority に限る
- filesystem roots を公開する場合は Yoi authorized scope 由来に限定する。
- local process 起動は explicit MCP config と explicit user/workspace policy に限る。feature authority から暗黙に派生させない
- filesystem roots を server に公開する場合は Yoi authorized scope 由来に限定する。
- unsupported client features, including sampling and elicitation, are fail-closed。
## Implementation latitude
@@ -89,6 +100,7 @@ Objective context: `00001KTR80WMN`。
## Escalation conditions
- API extension Ticket `00001KTR81P9X` の完了前に private bypass が必要になりそうな場合。
- MCP local server trust/permission policy が Plugin permission model または feature API authority と混ざりそうな場合。
- MCP tasks / task-augmented tool calls を full support するために Yoi Task / approval / resume model との統合判断が必要になる場合。
- server-provided resource/prompt content を tool result 以外の context path に入れる必要が出た場合。
- Streamable HTTP、remote auth、sampling、elicitation、workspace-provided executable/package auto-start に踏み込む必要が出た場合。
@@ -97,4 +109,5 @@ Objective context: `00001KTR80WMN`。
- Objective: `00001KTR80WMN`
- API prerequisite: `00001KTR81P9X`
- Plugin extension surface: `00001KSXRQ4G8`
- Decomposed from broad Ticket: `00001KST8H4M0`
+18
View File
@@ -4,4 +4,22 @@
LocalTicketBackend によって作成されました。
---
<!-- event: decision author: hare at: 2026-06-13T15:29:21Z -->
## Decision
決定:
- `pod::feature` は API / contribution substrate として扱い、Plugin や MCP の権限管理を担わせない。
- Plugin は `pod::feature` をユーザー向け package/config/runtime 形式で使わせる層であり、Plugin permission / trust policy は Plugin layer で定義する。
- MCP は `pod::feature` 上に protocol-backed integration layer を構築するが、MCP server enablement / command-env-secret policy / trust boundary / MCP-specific permission は MCP layer が独自に持つ。
- MCP local stdio server の OS-level side effects は Yoi feature authority では制御できないため、feature-layer authority / grant を MCP や Plugin の permission model に流用しない。
反映:
- `00001KTR81P9X` は authority ではなく provider lifecycle / dynamic contribution / normal ToolRegistry path / untrusted normalization に絞る。
- `00001KTR82RB7` は MCP 固有の explicit config と trust model を持つ。
- `00001KSXRQ4G8``00001KT0Z4BK8` は Plugin permission を Plugin layer として扱い、MCP を初期 Plugin packaging/runtime から分離する。
---