docs(plan): 2.6.1.1 — slice 9 (MCP surface expansion) shipped

Documents the slice that exposed the 12 read_tools over the
MCP wire (commit 0b0a71f on lore-engine-poc-v3 main).
448/448 tests green; 24 tools total.

Cross-references the deferred slice-4 tools (state_at, cite,
summarize_chain, narrate_arc) and the 6 deferred write_tools
that remain out of MCP scope.

Why: keeps docs/plan/ accurate; lets a new agent know what
the MCP surface looks like today and what's still deferred.
How to apply: when picking the next slice, slice 5 (TypeTemplate)
and slice 6 (Planes) both require Cognee/Neo4j and stay
blocked on substrate rehydration; slice 7 (Reasoning Harness)
needs OLLAMA_API_KEY to exercise real LLM calls; slice 8
(Polish) is mostly UI/import/export work. The lowest-friction
next POC slice is **exposing the 6 deferred write_tools over
MCP** (mirrors slice 9.1: pure registration, no new logic).
This commit is contained in:
2026-06-18 11:56:43 -04:00
parent 121ef2b761
commit a8c5b47070

View File

@@ -0,0 +1,78 @@
# Slice 2.6.1.1 — MCP Surface Expansion (12 read tools)
**Status:** ✅ shipped 2026-06-18. Commit `0b0a71f`. 448/448 tests
green (was 435; +13 from new dispatch tests).
## Goal
Expose the 12 `read_tools` in `lore_engine_poc.read_tools` over the
MCP wire. They were already implemented and unit-tested in
`tests/test_tools/`; this slice is **pure registration** — hand-written
JSON Schema + adapter binding per tool.
## What shipped
12 new tools in the MCP registry (was 12, now 24):
| Tool | Group | Description |
|---|---|---|
| `entity_context` | Disambiguation | One-hop summary (factions/locations/items/lifespan) |
| `true_during` | Time-aware | Edges active in a time range |
| `entities_present` | Time-aware | Entities in a location at a time |
| `timeline` | Time-aware | All edges touching an entity, sorted |
| `list_lineage` | Lineage | Lineage + members |
| `list_offspring` | Lineage | Direct PARENT_OF children |
| `ancestors_of` | Lineage | Bounded reverse PARENT_OF walks |
| `descendants_of` | Lineage | Bounded forward PARENT_OF walks |
| `location_hierarchy` | Hierarchy | PART_OF up/down |
| `event_chain` | Event | CAUSED/PRECEDED/CONCURRENT_WITH walks |
| `events_during` | Event | Events intersecting an era |
| `lore_about` | Lore | LoreSource docs mentioning an entity |
## What was NOT shipped (deferred to other slices)
The 4 deferred slice-4 tools that need LLM/embeddings and remain
unaddressed:
- `state_at` — needs LLM summarization
- `cite` — needs vector retrieval
- `summarize_chain` — needs LLM
- `narrate_arc` — needs LLM
The 6 deferred write_tools (`update_entity`, `delete_entity`,
`retcon`, `mark_verified`, `merge_entities`, `set_alias`,
`define_era`, `define_calendar`, `define_date`) are also not in
the MCP surface — they're callable from `scripts/02_demo.py` but
not exposed over MCP. See the deferred list in
`lore_engine_poc/write_tools.py:6-12`.
## Files
- `lore_engine_poc/mcp_tools.py` — TOOL_REGISTRY goes from 12 → 24
entries; the 12 new schemas are hand-written (no auto-gen)
- `tests/test_mcp/test_tool_registry.py` — EXPECTED_TOOLS /
EXPECTED_FN grown to 24; new tools' signatures cross-checked
against the schema by the existing schema-vs-signature test
(caught zero drift)
- `tests/test_mcp/test_protocol.py` — tools/list test updated to
24 tools
- `tests/test_mcp/test_slice9_dispatch.py` — 13 new subprocess
tests, one per new tool (entity_context has 2: happy + unknown)
## Decisions
* **Hand-written JSON Schemas** continued: 24 schemas is small
enough that auto-gen (jsonschema, pydantic) would add a
dependency for ~150 lines of code. Not worth it.
* **The schema-vs-signature test** in `test_tool_registry.py` is
the drift-detector; it passes for all 24 tools as of this slice.
## Cross-references
- `docs/plan/04-slice-tools.md` — the original 45-tool catalog
(this slice ships 12 of the deferred read tools)
- `lore-engine-poc/memory/lore-engine-slice9-status.md`
status memory
- `lore-engine-poc/memory/lore-engine-slice4-status.md`
the prior MCP-surface work
- `lore-engine-poc/memory/lore-engine-slice2.6-status.md`
the MCP server itself