openpencil/crates/op-mcp
Fini b58cb463f6 fix(ai): keep debug_validation_report out of the production MCP catalog
debug_validation_report was registered in rebuild_registry and listed
in tools/list unconditionally — only call() consulted
OPENPENCIL_DEBUG_TOOLS. A production client (flag unset) still saw the
debug tool in its catalog and could invoke it, getting a bare
ToolFailed. That leaks the debug surface into the production catalog.

Gate it everywhere instead of only at call time: rebuild_registry
registers the tool only when debug_tools_enabled(), and
tools_list_response appends the debug schema — now a separate
DEBUG_TOOL_SCHEMAS const, removed from TOOL_SCHEMAS — only when the
flag is set. A client without the flag never sees the tool at all,
matching the TS design where debug tools ship only in a debug build.

debug_tools_enabled() is promoted to pub and re-exported from op-mcp.
The tools/list catalog test now exercises both gate states (82 tools
flag-off, debug tool present flag-on).
2026-05-23 18:39:09 +08:00
..
src fix(ai): keep debug_validation_report out of the production MCP catalog 2026-05-23 18:39:09 +08:00
Cargo.toml feat(ai): implement op-design-lint Rust crate (S1) 2026-05-23 18:39:08 +08:00