You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(surface): make 'public surface says X' actually be true
Five real-surface bugs caught by a parallel session. All gated by the
"public surface says something, prove it is true" thread.
1. cmd_surface.mcp_exposed had collapsed to false for every row
The summary line claimed 193 MCP-exposed commands but every row
in the per-command table showed `mcp_exposed: false`. Root cause:
the wrapper-name candidate set was computed once at module load
and then never matched the per-row name string after canonical
normalization. Hoisted the candidate-set computation into
surface_counts.py so the CLI surface and the MCP wrapper-coverage
audit cannot drift apart again; per-row `mcp_exposed` now matches
the summary count.
2. mcp_server.py emitted unfiltered third-party stderr on import
FastMCP's authlib deprecation warnings + transitive imports
bled through to stderr on every roam invocation, masking the
actual import failure cause when the real bridge module fails
to load. Quietened the third-party import-time stderr and made
the broken-import path emit a clean structured cause.
3. cmd_explain_command.db_tables_referenced scanned prose
The "tables this command touches" field was matching tokens
inside docstrings/comments instead of SQL literals, producing
spurious "tables" like `the` and `roam`. Switched to a SQL-literal
scan: complexity now reports `files, symbol_metrics, symbols`
instead of prose/comment-derived noise.
4. cmd_pr_analyze.py placeholder_density signal docstring
Drive-by comment cleanup ("TODO/FIXME/PLACEHOLDER added by
stub-style generation" -> generic "stub-marker comments added
by generated code") to keep the leak-gate clean.
5. Regression tests
tests/test_surface_consistency.py + tests/test_mcp_server.py +
tests/test_cli_contract.py extended to pin the surface contract:
mcp_exposed row-vs-summary parity, MCP-import error-cause shape,
db_tables_referenced SQL-only sourcing.
Verified (per parallel-session checklist):
- ruff format + ruff check on all 9 touched files (clean)
- pytest tests/test_surface_consistency.py tests/test_mcp_server.py
tests/test_cli_contract.py tests/test_mcp_wrapper_coverage.py -q
-> 870+ passed, 1 xfail, 1 skip
- python dev/todo_guard.py: no violations
- python dev/build_readme_counts.py --check: ok across 9 surfaces
- python scripts/sync_surface_counts.py: all in sync
0 commit comments