Repository navigation
Commit 1f3c7ff
* fix: expose 13 handler-declared params dropped by hand-written MCP wrappers (#559)
FastMCP derives each tool's client-visible inputSchema from the registered
wrapper function's own signature (tool_registry_*.py), not from the
handler's schema["inputSchema"] dict. 13 of 54 tools had drifted: the
handler declared a parameter (used in its own body) that the wrapper never
forwarded, making it silently unreachable over MCP, including
recall(tags_any=["archival"]) (host protocol) and remember(is_global=True)
(cortex-remember-global skill).
Root cause fix, not a patch. Widened tests_py/handlers/test_tool_schema_parity.py
from a remember/wiki_write-only guard with omission lists to a universal
check over every registered tool (mcp.list_tools()), asserting handler
inputSchema properties equal wrapper params in both directions, with no
per-tool omission list (the only structural exception is the documented
rooted-agent_topic variant). Closed every gap by exposing the parameter on
the wrapper with the handler schema's own type/default and forwarding it.
Verified each one is actually read in the handler body before adding it,
so none is a no-op forward. wiki_write's title/summary/body are the one
exception: declared on the handler's own inputSchema but never consumed by
wiki_write.handler() (grepped, confirmed dead). Exposed anyway since the
parity contract is wrapper-vs-handler-schema, not handler completeness;
documented at the wrapper as pre-existing, out-of-blast-radius debt.
tool_registry_memory.py exceeded the 300-line file cap, and one wrapper
briefly exceeded the 40-line method cap once its signature carried every
property recall.py declares. Split the maintenance/diagnostics tools (no
external caller, verified by grep) into tool_registry_memory_maintenance.py,
and factored a shared _do_recall delegate so neither the rooted nor
unrooted wrapper's own body exceeds the cap. Regenerated
.craftsmanship-baseline.json to prune the now-fixed file-size entry; no
new entries added.
Added tests_py/handlers/test_recall_remember_wrapper_reachability.py.
It calls the REGISTERED recall/remember tools via mcp.call_tool (not the
handler directly) and proves tags_any/is_global reach the handler's args
dict. Confirmed fail-before/pass-after for both new test files against
a3b3a79.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
* fix: remove dead title/summary/body from wiki_write's own contract (#559 follow-up)
Review caught that exposing a wrapper parameter the handler silently
drops is the same contract lie as #559 in the other direction. Grepped
the whole repo (tests, skills/cortex-wiki-author, docs/mcp-tools.md,
docs/api-reference.md, curate_wiki_serialize.py's authoring prompt,
scripts/, hooks/): nothing anywhere passes title/summary/body to
wiki_write; every real caller already uses content. The handler schema
was the one lying, not the wrapper.
Removed title/summary/body from wiki_write's inputSchema and from the
tool_registry_wiki.py wrapper. Corrected content's description, which
falsely claimed it was "used when structured fields (title/summary/body)
are not provided" -- content is unconditionally required and
wiki_write.handler() never reads those three keys. The universal parity
test now holds for wiki_write with no exception.
Re-audited every other parameter exposed in the original #559 commit,
grep-confirmed each is read in its handler body (see PR body table with
file:line citations) -- none is a repeat of this defect.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
* test(parity): an unmapped registered tool fails instead of being skipped (#559)
A registered tool with no handler schema entry has no contract its
client-visible parameters can be checked against; skipping it silently
would reopen the exact gap #559 closes.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
* test(parity): check every tool on a server with all upstream gates open (#559)
CI has no ai-architect codebase server, so ingest_codebase and
change_impact were not registered there and the hardcoded gated set
({ingest_prd}) failed. Building the server under test with
register_all(codebase=True, prd=True), as tests_py/test_main.py does,
makes the check identical on every machine and covers the gated tools'
parity too, with no exception list.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
---------
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
1 parent e382a6e commit 1f3c7ff
12 files changed
Lines changed: 523 additions & 308 deletions
File tree
- mcp_server
- handlers
- tests_py/handlers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
4732 | 4732 | | |
4733 | 4733 | | |
4734 | 4734 | | |
4735 | | - | |
4736 | | - | |
4737 | | - | |
4738 | | - | |
4739 | | - | |
4740 | 4735 | | |
4741 | 4736 | | |
4742 | 4737 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| 114 | + | |
112 | 115 | | |
113 | 116 | | |
114 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
101 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | 115 | | |
131 | 116 | | |
132 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
67 | 73 | | |
68 | 74 | | |
69 | 75 | | |
| |||
75 | 81 | | |
76 | 82 | | |
77 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
78 | 90 | | |
79 | 91 | | |
80 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| |||
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
| 100 | + | |
| 101 | + | |
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
| |||
108 | 112 | | |
109 | 113 | | |
110 | 114 | | |
| 115 | + | |
111 | 116 | | |
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
115 | 120 | | |
116 | 121 | | |
117 | 122 | | |
| 123 | + | |
118 | 124 | | |
119 | 125 | | |
120 | 126 | | |
| |||
152 | 158 | | |
153 | 159 | | |
154 | 160 | | |
| 161 | + | |
155 | 162 | | |
156 | 163 | | |
157 | 164 | | |
158 | 165 | | |
159 | 166 | | |
160 | 167 | | |
161 | 168 | | |
| 169 | + | |
162 | 170 | | |
163 | 171 | | |
164 | 172 | | |
| |||
0 commit comments