Skip to content

Commit d6f1dc0

Browse files
sdsrssclaude
andcommitted
feat(mcp): tool-description tightening +5% P@1 + OpenRouter backend (v0.11.6)
Routing-recall bench first run on v0.11.4: 18/20 = 90.0% (2 misses from semantic overlap between adjacent tools). Tightened 4 descriptions leading with a shape verb + explicit deflection to the adjacent tool. Rerun: 19/20 = 95.0% net +5.0pt. Remaining miss ("show me EmbeddingModel struct" → ast_search) is borderline since ast_search with type=struct returns the right answer. Tool-description changes (src/mcp/tools.rs, all ≤200 chars): - get_call_graph: leads with "Who calls X, what X calls" + "Returns a graph" - find_references: "Flat enumeration of all usage sites" + "For 'who calls X?', use get_call_graph" - get_ast_node: "Inspect ONE named symbol" + "you have a symbol name" - ast_search: "Enumerate MULTIPLE symbols" + "For ONE known symbol, use get_ast_node" Routing-bench OpenRouter backend (tests/routing_bench.rs): Auto-detect ANTHROPIC_API_KEY or OPENROUTER_API_KEY. OpenAI-compat schema conversion (tools -> {type: function, function: {...}}). Model default anthropic/claude-sonnet-4.5; override with ROUTING_BENCH_MODEL. Baselines (tracked in feedback_routing_bench memory): v0.11.4 18/20 = 90.0% openrouter/anthropic/claude-sonnet-4.5 v0.11.6 19/20 = 95.0% openrouter/anthropic/claude-sonnet-4.5 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent edd838b commit d6f1dc0

File tree

13 files changed

+222
-77
lines changed

13 files changed

+222
-77
lines changed

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
},
66
"metadata": {
77
"description": "AST knowledge graph plugin for Claude Code — semantic search, call graph, HTTP tracing, impact analysis",
8-
"version": "0.11.5"
8+
"version": "0.11.6"
99
},
1010
"plugins": [
1111
{
1212
"name": "code-graph-mcp",
1313
"source": "./claude-plugin",
1414
"description": "AST knowledge graph for intelligent code navigation — auto-indexes your codebase and provides semantic search, call graph traversal, HTTP route tracing, and impact analysis via MCP tools",
15-
"version": "0.11.5",
15+
"version": "0.11.6",
1616
"author": {
1717
"name": "sdsrs"
1818
},

CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,53 @@
11
# Changelog
22

3+
## v0.11.6 — Tool-description tightening (+5% routing P@1) + OpenRouter backend
4+
5+
First run of the routing-recall benchmark landed v0.11.4 at **P@1 = 18/20 = 90.0%**
6+
(`anthropic/claude-sonnet-4.5` via OpenRouter). The two misses were both semantic
7+
overlaps between adjacent tools. This release tightens 4 tool descriptions and
8+
re-runs the bench: **P@1 = 19/20 = 95.0%**, a net +5.0 points with one miss
9+
remaining (borderline — "show me the EmbeddingModel struct" routes to `ast_search`
10+
with `type=struct`, which returns the right answer albeit via the "enumerate"
11+
tool rather than the "inspect ONE" tool).
12+
13+
### Tool-description changes (`src/mcp/tools.rs`)
14+
15+
All stay under the 200-char registry limit.
16+
17+
- **`get_call_graph`** — leads with `"Who calls X, what X calls"` + `"Returns a
18+
graph (not a flat list)"`. Fixed routing for "Who calls ensure_indexed?"
19+
(was → `find_references`, now → `get_call_graph`).
20+
- **`find_references`** — leads with `"Flat enumeration of all usage sites"` +
21+
explicit deflection: `"For 'who calls X?', use get_call_graph."`.
22+
- **`get_ast_node`** — leads with `"Inspect ONE named symbol"` + `"you have a
23+
symbol name (or node_id) and want its definition/body"` to claim the
24+
"show me X / signature of Y" intent.
25+
- **`ast_search`** — leads with `"Enumerate MULTIPLE symbols by structural
26+
criteria"` + deflection: `"For ONE known symbol, use get_ast_node."`.
27+
28+
Pattern: each description now leads with a shape verb (`who calls`, `flat
29+
enumeration`, `inspect ONE`, `enumerate MULTIPLE`) and points at the
30+
adjacent tool when a query drifts into overlap.
31+
32+
### Routing-bench OpenRouter backend (`tests/routing_bench.rs`)
33+
34+
Auto-detects `ANTHROPIC_API_KEY` (native Messages API) or `OPENROUTER_API_KEY`
35+
(OpenAI-compatible `/chat/completions`). Tool schemas re-packaged as
36+
`{type: "function", function: {...}}` for the OpenRouter path. Model default
37+
`anthropic/claude-sonnet-4.5`; override with `ROUTING_BENCH_MODEL`. Anthropic
38+
wins if both keys present.
39+
40+
### Baseline measurement (published)
41+
42+
| Run | Backend / Model | P@1 |
43+
|-----|-----------------|-----|
44+
| v0.11.4 baseline | openrouter / anthropic/claude-sonnet-4.5 | 18/20 (90.0%) |
45+
| v0.11.6 post-tightening | openrouter / anthropic/claude-sonnet-4.5 | 19/20 (95.0%) |
46+
47+
Cost ≈ $0.10/run. Threshold stays at 0.70; consider raising to 0.85 after two
48+
more releases confirm 95% as stable baseline (20-query sample is within model
49+
stochasticity range).
50+
351
## v0.11.5 — Hotfix: clippy 1.95 parity (`unnecessary_sort_by`)
452

553
`-D warnings` on stable clippy 1.95 flagged the two `sort_by(|a, b| b.0.cmp(&a.0))`

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "code-graph-mcp"
3-
version = "0.11.5"
3+
version = "0.11.6"
44
edition = "2021"
55

66
[features]

claude-plugin/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"author": {
55
"name": "sdsrs"
66
},
7-
"version": "0.11.5",
7+
"version": "0.11.6",
88
"keywords": [
99
"code-graph",
1010
"ast",

npm/darwin-arm64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sdsrs/code-graph-darwin-arm64",
3-
"version": "0.11.5",
3+
"version": "0.11.6",
44
"description": "code-graph-mcp binary for macOS ARM64",
55
"license": "MIT",
66
"repository": {

npm/darwin-x64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sdsrs/code-graph-darwin-x64",
3-
"version": "0.11.5",
3+
"version": "0.11.6",
44
"description": "code-graph-mcp binary for macOS x64",
55
"license": "MIT",
66
"repository": {

npm/linux-arm64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sdsrs/code-graph-linux-arm64",
3-
"version": "0.11.5",
3+
"version": "0.11.6",
44
"description": "code-graph-mcp binary for Linux ARM64",
55
"license": "MIT",
66
"repository": {

npm/linux-x64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sdsrs/code-graph-linux-x64",
3-
"version": "0.11.5",
3+
"version": "0.11.6",
44
"description": "code-graph-mcp binary for Linux x64",
55
"license": "MIT",
66
"repository": {

npm/win32-x64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sdsrs/code-graph-win32-x64",
3-
"version": "0.11.5",
3+
"version": "0.11.6",
44
"description": "code-graph-mcp binary for Windows x64",
55
"license": "MIT",
66
"repository": {

0 commit comments

Comments
 (0)