ticket: accept mcp list changed handling

This commit is contained in:
Keisuke Hirata 2026-06-20 19:07:15 +09:00
parent b11f83c8b3
commit d31b89072d
No known key found for this signature in database
3 changed files with 68 additions and 2 deletions

View File

@ -1 +1,2 @@
{"id":"orch-plan-20260620-060022-1","ticket_id":"00001KVHR3WSW","kind":"blocked_by","related_ticket":"00001KVHR3WS6","note":"list_changed handling requires initial tools/list registration. `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-060022-1","ticket_id":"00001KVHR3WSW","kind":"blocked_by","related_ticket":"00001KVHR3WS6","note":"list_changed handling requires initial tools/list registration. `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-100629-2","ticket_id":"00001KVHR3WSW","kind":"accepted_plan","accepted_plan":{"summary":"MCP `notifications/tools/list_changed`, `notifications/resources/list_changed`, `notifications/prompts/list_changed` を安全に扱う。Active run の model-visible schema/context を不意に変えず、safe boundary refresh / restart-required diagnostic / next-turn refresh など deterministic policyを実装し、silent staleを避ける。","branch":"impl/00001KVHR3WSW-mcp-list-changed","worktree":"/home/hare/Projects/yoi/.worktree/00001KVHR3WSW-mcp-list-changed","role_plan":"Orchestrator は acceptance records を commit 後、専用 implementation worktree `.worktree/00001KVHR3WSW-mcp-list-changed` を作成し、Coder をその child worktree への narrow write scope で起動する。Coder 実装後、Reviewer が current-run schema/history invariants、safe-boundary refresh policy、bounded diagnostics、tools/resources/prompts notifications、no hidden resource/prompt context injection を確認する。"},"author":"yoi-orchestrator","at":"2026-06-20T10:06:29Z"}

View File

@ -1,8 +1,8 @@
--- ---
title: 'MCP: handle list_changed notifications safely' title: 'MCP: handle list_changed notifications safely'
state: 'queued' state: 'inprogress'
created_at: '2026-06-20T05:30:04Z' created_at: '2026-06-20T05:30:04Z'
updated_at: '2026-06-20T06:00:44Z' updated_at: '2026-06-20T10:07:07Z'
assignee: null assignee: null
readiness: 'implementation_ready' readiness: 'implementation_ready'
risk_flags: ['mcp', 'notifications', 'tool-schema', 'prompt-cache', 'refresh'] risk_flags: ['mcp', 'notifications', 'tool-schema', 'prompt-cache', 'refresh']

View File

@ -27,3 +27,68 @@ Next:
- `00001KVHR3WS6` が closed になった後、改めて reroute する。 - `00001KVHR3WS6` が closed になった後、改めて reroute する。
--- ---
<!-- event: decision author: yoi-orchestrator at: 2026-06-20T10:07:00Z -->
## Decision
Routing decision: implementation_ready
Reason:
- User directive: 「blocker無いなら並列にやっちゃえよ」。現在 inprogress は 0 件であり、最後に残った queued Ticket の dependency blocker も解消済みのため開始する。
- 前回は `00001KVHR3WS6` initial tools/list registration が未完了だったため blocked/queued hold としたが、現在 `00001KVHR3WS6` は closed。
- Related resources/prompts operations Ticket `00001KVHR3WSN` も closed になっており、tools/resources/prompts list_changed をまとめて扱う context が揃っている。
- Ticket body は `notifications/tools/list_changed`, `notifications/resources/list_changed`, `notifications/prompts/list_changed` の handling、current run schema consistency、prompt-cache/history invariants、deterministic refresh/diagnostic behavior、unsafe refresh fallback を実装可能な粒度で定義している。
- Orchestrator worktree は clean、matching branch/worktree はなし。
- Risk domain は mcp / notifications / tool-schema / prompt-cache / refresh だが、Ticket は current run schema consistency、no hidden context mutation、bounded diagnostics を明示している。bounded context check 後も implementation 前に必要な追加 human decision は見つからなかった。
Evidence checked:
- Ticket `00001KVHR3WSW` body / thread / relations / artifacts。
- `TicketRelationQuery(00001KVHR3WSW)`: outgoing `depends_on 00001KVHR3WS6` is now closed。
- `TicketOrchestrationPlanQuery(00001KVHR3WSW)`: previous `blocked_by 00001KVHR3WS6` is resolved; accepted plan recorded now。
- Workspace state:
- Orchestrator worktree clean at `b11f83c8`
- queued: this Ticket only。
- inprogress: 0。
- spawned child implementation Pods: 0。
- no matching MCP list_changed branch/worktree。
IntentPacket:
Intent:
- Handle MCP list_changed notifications without silently staying stale forever and without mutating active-run model-visible tool schema or prompt/context history invariants unsafely。
- Implement a deterministic safe-boundary refresh / restart-required diagnostic / next-turn refresh policy that covers tools/resources/prompts list changes。
Binding decisions / invariants:
- Do not mutate current LLM context with hidden resource/prompt content。
- Do not unexpectedly mutate active run tool schema in a way that breaks request/history/prompt-cache invariants。
- list_changed notifications are signals; they should produce bounded state/diagnostic and deterministic refresh behavior at safe boundaries。
- Bounded diagnostics should identify server and list kind without leaking secrets。
- Preserve existing explicit Tool operations for tools/resources/prompts。
- Do not implement remote transports, sampling, or elicitation。
Requirements / acceptance criteria:
- Handle `notifications/tools/list_changed`, `notifications/resources/list_changed`, and `notifications/prompts/list_changed`
- list_changed does not silently stale forever。
- Current run tool schema consistency is not broken。
- Refresh/diagnostic behavior is deterministic and documented。
- Prompt-context/history invariants are preserved。
- Tests cover tools/resources/prompts list_changed and unsafe refresh fallback。
Escalate if:
- Safe refresh requires changing Worker history/model schema lifecycle beyond this Ticket。
- Current provider/feature architecture cannot represent pending refresh diagnostics without broad redesign。
- A live schema mutation would be required to satisfy the feature expectation; stop instead and record restart/next-turn policy。
Next action:
- Record `queued -> inprogress` and commit Ticket records before creating implementation worktree and spawning Coder。
---
<!-- event: state_changed author: yoi-orchestrator at: 2026-06-20T10:07:07Z from: queued to: inprogress reason: orchestrator_acceptance_mcp_list_changed field: state -->
## State changed
User explicitly authorized implementation when no blocker exists. Ticket body/thread, relation metadata, closed MCP tool-registration dependency, closed resources/prompts context, Orchestrator worktree state, visible Pods, existing branch/worktree, and bounded list_changed/schema/history context were checked. Dependency `00001KVHR3WS6` is closed, no inprogress/capacity blocker exists, no matching worktree/branch exists, and no missing planning decision was found. Accepting this queued Ticket for implementation before worktree/Pod side effects.
---