fix(handlers): route read intents (α=read) → GET /world (D3 rehearsal block)#16
Merged
Conversation
…exec Real-world block из custom-culture D3 rehearsal 2026-05-09. mcp-server диспетчил все intents (включая read) через POST /api/agent/:domain/exec. runtime-local v0.6 для read-intent'ов возвращает 400 (read_intent_not_executable, by design в A1.2). Claude Desktop получал tool error → не мог list_products / list_orders / etc. Что внутри: - makeToolCallHandler принимает intentsById map (intentId → intent) - Если intent.alpha === "read" → GET /api/agent/:domain/world + filter rows через toCollectionName helper (matches /resources/list pluralization) - Иначе (add/replace/remove/batch) — POST /exec как было - Fallback (intent не найден в map) — POST /exec для backward compat Архитектурное обоснование: runtime-local намеренно отделяет mutation (/exec с invariants + lifecycle.requiresApproval) от read (/world resource snapshot). Корректный MCP-маппинг: read → resource в spec'е, но Claude Desktop часто spontaneous'но дёргает tools по имени. Поэтому tool-call handler сам routes по alpha — для UX, без потери arch-purity. Tests: 5 новых + 41 existing = 46/46 passing - read intent → GET /world + filter → confirmed/count/rows shape - mutation intent → POST /exec - intent не в map → fallback POST (backward compat) - read с target='Entity.field' — base entity для collection-name - read когда /world 500 → isError + world_fetch_failed Bump 1.0.3 → 1.0.4. Refs: D3 rehearsal log 2026-05-09 19:04 UTC, Claude prompt "Покажи список продуктов" → 400 read_intent_not_executable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что
Real-world block найденный в D3 rehearsal 2026-05-09. mcp-server диспетчил все intents (включая
α=read) через POST/api/agent/:domain/exec. runtime-local v0.6 для read-intent'ов возвращает 400 (read_intent_not_executable, by design A1.2).Claude Desktop получал tool error → ответил пользователю «инструменты read не работают, я не могу показать продукты».
Решение
makeToolCallHandlerтеперь маршрутит поintent.alpha:Архитектурное обоснование
runtime-local намеренно отделяет:
engine.submit(invariants + lifecycle.requiresApproval + Φ ingest)engine.foldWorld()В MCP-spec'е read intents должны быть
resources, неtools. Но Claude Desktop часто спонтанно дёргает tools по имени (когда видитlist_productsв наборе). Поэтому tool-call handler сам routes по alpha — для UX, без потери arch-purity (resources всё равно работают черезidf://domain/collectionURI).После этого PR Claude может равноценно использовать как tool name (
list_products), так и resource URI (idf://custom-culture/products) — зависит от его модели и контекста.Demo flow после fix'а
Тесты
5 новых + 41 existing = 46/46 passing:
{status:'confirmed', collection:'products', count:3, rows:[...]}target='Entity.field'→ base entity for collection nameisError: true+world_fetch_failedЧто НЕ в этом PR (отложено)
Bump
@intent-driven/mcp-server: 1.0.3 → 1.0.4После merge для D3 rehearsal
После npm publish:
npx -y @intent-driven/mcp-serverподтянет 1.0.4Покажи продукты→ работаетCancel order ORD-...→ 202 ApprovalRequest (mutation flow as before)Refs: D3 rehearsal log 2026-05-09 19:04 UTC.