Repository navigation
feat(wiki): expose the Path B draft tools over MCP (#579) - #581
Conversation
wiki_get_draft and wiki_refine_draft existed as handlers since ADR-0467 with no registration, so no client could call them and wiki_get_draft's own instructions named a tool tools/list never advertised. They now register from mcp_server/tool_registry_wiki_drafts.py, a module of their own so tool_registry_wiki.py stays inside the 300-line cap (ADR-1066). Reading a draft is read-only, submitting refined prose is a non-idempotent write (one audit memo per call), and both are interactive-class. The standalone tool count moves from 52 to 54, 57 with both upstream integrations; every document stating a count, the pinned test name and the docker-smoke floor move with it. The pinned baseline test no longer carries its membership assertions: under its new name the method would have been new debt against the craftsmanship gate, so the tool-name sets are module constants and the membership check is its own test. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Cz7A6goxVzfKL9NT7k4zDH
|
ZETETIC-REVIEW: APPROVE SummaryRegisters the two pre-existing Path B handlers (wiki_get_draft, wiki_refine_draft) as MCP tools from a new mcp_server/tool_registry_wiki_drafts.py, wired into merged_schemas()/register_all(), with matching annotations, docs, and tool-count updates across 10+ files. Closes #579 by choosing "register" over "remove", as the issue required. Mergeable as-is. Stakes classification (Move 7)High. The diff modifies the public MCP tool surface (two tools become externally callable for the first time) and totals 507 changed lines (424 additions, 83 deletions), over the 400-line advisory threshold. I applied the full set of Moves 1 through 6 with runtime checks, not just static reading. Move 0, ledger and seen-defect checkNo formal "Completion Ledger" heading, but the PR's Test Plan and Audit Notes sections enumerate every new code path (wrapper registration, argument forwarding, one SQLite end-to-end call) with a named test and a mutation note, matching this repo's established PR convention; the immediately preceding merged PR #580 uses the same format. My own re-enumeration of the diff's paths found nothing unmapped: the only new logic is two wrapper functions with no branches; handler_get and handler_refine bodies are untouched, confirmed via One claim needed correction. The PR states the 5 errors are tests_py/scripts/test_installer_*. Running the full suite here ( Verification performed
IssuesBlocking: none. Non-blocking:
Hand-offsNone needed. No root-cause fix, no structural decomposition, no formal-correctness or threat-modeling gap, and no performance claim to verify. VerdictAPPROVE |
Summary
wiki_get_draftandwiki_refine_draft(Path B of the wiki pipeline, ADR-0467) existed as handlers with no registration:mcp_server/tool_registry_wiki.pyregistered ten other wiki tools and no commit in the repository's history ever registered these two, so no client could call them andwiki_get_draft's own instructions told the caller to use a tooltools/listnever advertised.They now register from
mcp_server/tool_registry_wiki_drafts.py, wired into__main__'smerged_schemas()andregister_all(). The pair lives in its own module becausetool_registry_wiki.pystands at 266 lines against the 300-line cap and two registrations in that file's style cost about sixty (ADR-1066). Reading a draft isREAD_ONLY; submitting refined prose isNON_IDEMPOTENT_WRITE, since each call inserts an audit memo; both areinteractiveinhandlers/latency_class.py. Neither joinsLEAN_TOOL_NAMES, so the lean profile is unchanged.The standalone count moves from 52 to 54, and from 55 to 57 with both upstream integrations: the pinned
tests_py/test_main.py::test_standalone_baseline_is_54_tools,docs/mcp-tools.md, the seven other documentsscripts/check_doc_claims.pyscans, and thedocker_smoke.shfloor.Closes #579
Type of change
Test plan
tests_py/handlers/test_wiki_draft_tools.py: both names onlist_tools()with their annotations; the listing arguments (list_pending,kind,limit) and the content arguments (lead,sections,rationale, thesynth_modeldefault) reaching the handlers throughmcp.call_tool; and onewiki_refine_draftcall landing in a SQLite store.tests_py/handlers/test_tool_schema_parity.pyalready requires every registered wrapper's parameters to equal its handler'sinputSchemaproperties exactly, and now covers these two.tests_py/scripts/test_installer_*(added by [bug] deps idempotence guard replaces entries whose name is not their distribution's on every install #575), which shell out topython -m pipin the venv; this machine's uv venv ships no pip (No module named pip). They touch none of the files in this diff.ruff check,ruff format --check: clean.pyright mcp_server/in the CI typecheck environment built fromuv.lock: 0 errors.scripts/check_doc_claims.py: OK.scripts/check_craftsmanship.py --base origin/main: OK.registercall fails the surface test and the pinned count; swapping the two annotations fails the annotation assertions; dropping any wrapper parameter fails the schema-parity test.Audit notes
_NO_UPSTREAM_TOOLS,_EXTRACTED_TOOLS), the membership check is its own test, and the baseline loses one entry.Coding-standards compliance
Breaking changes
None. Two tools appear on
tools/listthat were never there; nothing is renamed or removed.Reviewer checklist
docs/mcp-tools.mdcatalogue entry and counts, ADR-1066).🤖 Generated with Claude Code
https://claude.ai/code/session_01Cz7A6goxVzfKL9NT7k4zDH