docs(mcp): add reconciled two-layer tool-consolidation plan; refresh stale comments

Adds docs/launch/tool-consolidation-v2.2.0.md — the single sequenced plan that
reconciles the two prior planning notes:
  - Layer 1 (this PR): 34 → 12 advertised tools, safe commit order, alias policy,
    preserved invariants, and the test that proves each.
  - Layer 2 (follow-up): tiny always-on default surface + SessionStart/Stop hooks.

Also refreshes stale in-code comments to match the consolidated surface:
  - server.rs handle_tools_list header (was "v2.1.21: 25 tools") and the
    size-annotation rationale (now lists recall/memory_status/dedup/graph).
  - tools/mod.rs module doc (the facade vs. granular-handler relationship).

No behavior change. Gates: cargo test --workspace, cargo clippy -D warnings,
pnpm dashboard check + build — all green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sam Valladares 2026-06-28 18:12:16 -05:00
parent 7398f0c1b3
commit ec8bf27255
3 changed files with 152 additions and 10 deletions

View file

@ -240,9 +240,10 @@ impl McpServer {
/// Handle tools/list request
async fn handle_tools_list(&self) -> Result<serde_json::Value, JsonRpcError> {
// v2.1.21: 25 tools (verified by the `tools.len() == 25` assertion in the
// handle_tools_list test below — the `suppress` tool landed in v2.0.5).
// Deprecated tools still work via redirects in handle_tools_call.
// v2.2: 12 advertised tools after Layer-1 Tool Consolidation
// (verified by `tools.len() == 12` in test_tools_list_returns_all_tools).
// 22 deprecated/folded names still work as hidden redirects in
// handle_tools_call. See docs/launch/tool-consolidation-v2.2.0.md.
let mut tools = vec![
// ================================================================
// RECALL — unified retrieval tool (v2.2). HOT PATH.
@ -387,10 +388,11 @@ impl McpServer {
// chunk-read them.
//
// Per-tool caps below are sized at ~2× observed peak with growth
// headroom; max permitted by Anthropic is 500_000. Only the four
// empirically-measured high-payload tools carry the annotation today;
// the remaining 21 tools deliberately do NOT (cargo-cult prevention —
// annotating a small-payload tool dilutes the signal).
// headroom; max permitted by Anthropic is 500_000. Only the
// high-payload tools carry the annotation (recall, memory_status,
// memory, codebase, dedup, graph); the remaining advertised tools
// deliberately do NOT (cargo-cult prevention — annotating a
// small-payload tool dilutes the signal).
//
// Other tools that COULD plausibly grow into the annotated set with
// future workload (`deep_reference`, `cross_reference`, `memory_graph`,

View file

@ -2,9 +2,14 @@
//!
//! Tool implementations for the Vestige MCP server.
//!
//! The unified tools (codebase_unified, intention_unified, memory_unified, search_unified)
//! are the primary API. The granular tools below are kept for backwards compatibility
//! but are not exposed in the MCP tool list.
//! v2.2 Tool Consolidation (Layer 1): the advertised surface is 12 tools —
//! recall, memory, codebase, intention, smart_ingest, source_sync,
//! memory_status, dedup, graph, maintain, session_start, suppress. The unified
//! facade modules (recall, dedup, memory_status, graph_unified, maintain, plus
//! the earlier *_unified) dispatch on an action/mode/view discriminator and
//! delegate to the granular handler modules below, which stay in the crate as
//! the implementation layer and as hidden back-compat aliases (see the redirect
//! arms in server.rs). See docs/launch/tool-consolidation-v2.2.0.md.
// Active unified tools
pub mod codebase_unified;