Skip to content

chore(arch): declare every router's MCP surface + refresh stale architecture.md counts (#2238) - #2482

Merged
vybe merged 1 commit into
devfrom
chore/2238-mcp-none-markers-arch-counts
Sep 2, 2026
Merged

vybe merged 1 commit into
devfrom
chore/2238-mcp-none-markers-arch-counts

Conversation

@trinity-ability

Copy link
Copy Markdown
Contributor

Summary

Follow-up to the full /validate-architecture run recorded on #2238 (comment of 2026-09-01). Two of the quick wins from that report:

Invariant #13 — every router declares its MCP surface. 44 of the non-excluded routers had neither a same-named MCP tool module nor a # mcp: none marker, so the validator could not tell "unexposed on purpose" from "forgotten". Every router outside the by-design exclusions (internal, setup, auth, public, paid) now opens with a one-line # mcp: header:

  • 30 × # mcp: none — <reason> — admin surfaces (canary, audit log, ops, soft-delete recovery…), grant-vs-use human-only surfaces (sharing, users, MCP keys, settings, public links…), and UI-only data (analytics, telemetry, dashboard, onboarding…).
  • 14 × # mcp: <module>.ts (<tools>) — routers whose tools live in a differently named module (agent_rename.py → agents.ts (rename_agent), telegram.py → channels.ts, …). Each pointer was verified against the URL builders in src/mcp-server/src/client.ts.

Comments only. An AST check confirms every module docstring is still the first statement.

Doc drift — architecture.md + CLAUDE.md counts. Router / service / tool-module / tool counts, agents.py size, AGENT_REFS cascade width, compatibility check count, and four endpoint-group headings. The MCP tools table gains its three missing modules (a2a.ts, connector.ts, rooms.ts) and the chat.ts/skills.ts rows catch up (fan_out, run_skill, list_runnable_skills). The "DEPRECATED Redis credential keys" bullet is removed — nothing in src/backend reads or writes those keys any more. Invariant #13's text now records the header convention.

Verification

  • python3 -m pytest tests/unit/test_models_centralized.py test_1310_auth_wiring.py test_293_admin_gate_rejects_agent_keys.py test_186_enumeration_uniformity.py test_agent_auth_header_guard.py test_1677_operator_alert_emitters.py test_ent435_settings_sink_guard.py — 90 passed (the AST guards that walk routers/).
  • tests/unit/test_1966_ops_reset_audit.py, test_2008_dead_credentials_update.py (the two tests that read the live architecture.md) and test_compatibility_checks.py (spec-doc sync) — all pass.
  • Re-ran the Invariant feat: SMARTS trading pipeline with Telegram notifications and Miro visualization #13 check: 0 routers without a # mcp: header or a same-named tool module.
  • enterprise-docs-guard pattern grepped over both edited docs: no hits.

Not in this PR

The other gaps from the same run stay open on #2238: views/Library.vue calling the API client directly (#6), raw fetch() in McpKeysTab.vue / HostTelemetry.vue (#7), /api/agent-dashboard/{name} nesting (#15), and the three execution-creating boundaries without an Idempotency-Key path (#18).

Related to #2238

🤖 Generated with Claude Code

https://claude.ai/code/session_01AQHbGS2GV78AmBFnZX78j6

…tecture.md counts (#2238)

A full /validate-architecture run on 9b0ed63 found Invariant #13 unenforceable — 44 of the
non-excluded routers had neither a same-named MCP tool module nor a `# mcp: none` marker —
and seven architecture.md counts more than 25% stale.

- Every router outside the by-design exclusions (internal/setup/auth/public/paid) now opens
  with a `# mcp:` header: 30 x `none — <reason>` (admin, grant-vs-use human-only, UI-only)
  and 14 x a pointer to the covering tool module (`agents.ts (rename_agent)`, ...), so the
  validator can tell "unexposed on purpose" from "forgotten". Comments only; each module
  docstring stays the first statement (AST-checked).
- architecture.md: router / service / tool-module / tool counts, agents.py size, AGENT_REFS
  cascade width, compatibility check count, four endpoint-group counts; the MCP tools table
  gains its three missing modules (a2a, connector, rooms) and the chat/skills rows catch up;
  the dead "DEPRECATED Redis credential keys" bullet (zero readers or writers) is removed;
  Invariant #13 records the header convention.
- CLAUDE.md: MCP tool count and endpoint/router count.

Related to #2238 — the remaining #6/#7/#15/#18 gaps stay tracked there.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AQHbGS2GV78AmBFnZX78j6
@vybe
vybe force-pushed the chore/2238-mcp-none-markers-arch-counts branch from 53ee902 to 4b2c9a1 Compare September 2, 2026 08:33

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated via /validate-pr: 44 routers each gain exactly one first-line '# mcp:' comment (0 removals, no import/route change, docstring still first statement in all 73 modules); every refreshed architecture.md count reproduced from the head (72 routers, 127/155 services, 121 tools / 30 modules, AGENT_REFS 50, 89 checks); all 14 pointer headers resolve to registered tools and none of the 30 'none' routers has an MCP consumer. All 21 checks green incl. six-seed pytest + regression diff. 'Related to #2238' left as-is on purpose (partial fix, 4 gaps stay open). Approving.

@vybe
vybe merged commit f070251 into dev Sep 2, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants