Skip to content

Commit c82eafa

Browse files
sdsrssclaude
andcommitted
fix(mcp): 12-tool accuracy audit fixes (v0.11.1)
Post-audit fixes surfacing from systematic testing of all 12 MCP tools. Critical: find_references/impact_analysis/get_call_graph fuzzy fallback now prefer exact name before substring — eliminates false-ambiguity reports for names that are prefixes of others (e.g. handle_tool vs handle_tools_list). Precision improvements: - truncate_large_strings keeps arrays homogeneous; _array_truncations metadata records true pre-truncation length per field. - project_map.hot_functions SQL restricted to function/method (structs no longer leak in); entry_points gain `kind` to distinguish main vs http_route. - dependency_graph filters the synthetic <external> bucket. - find_similar_code reports cutoff_applied/cutoff_dropped/hint when max_distance shortfalls below top_k. - impact_analysis returns risk_level=UNKNOWN for type queries with zero call-graph callers instead of the misleading LOW. Tests: +2 unit (helpers truncation), +6 integration (one per fix). Full suite 343 passed, clippy clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0e17e45 commit c82eafa

File tree

17 files changed

+381
-35
lines changed

17 files changed

+381
-35
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.0"
8+
"version": "0.11.1"
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.0",
15+
"version": "0.11.1",
1616
"author": {
1717
"name": "sdsrs"
1818
},

CHANGELOG.md

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

3+
## v0.11.1 — 12-tool accuracy audit: 1 critical bugfix + 5 precision improvements
4+
5+
Post-audit fixes for tool output correctness. All changes are additive/tightening —
6+
no consumer schema breakage.
7+
8+
### Fixes
9+
10+
1. **`find_references` — critical bugfix for exact-name resolution.**
11+
`resolve_fuzzy_name` was matching substrings before exact names, so
12+
`find_references("handle_tool")` falsely reported ambiguity with
13+
`handle_tools_list` / `handle_tools_call`. Now exact-name matches win first;
14+
same-name-in-multiple-files still produces `Ambiguous` but scoped to exact
15+
matches only. Same fix benefits `impact_analysis` and `get_call_graph`
16+
fuzzy-fallback paths.
17+
18+
2. **Centralized truncation keeps arrays homogeneous.** The
19+
`centralized_compress` pipeline used to splice a string sentinel
20+
(`"... [N items truncated]"`) into the middle of object arrays, breaking
21+
type consistency for strict JSON consumers and hiding how much was dropped.
22+
Arrays now truncate silently to `first-10 + last-5` (15 homogeneous items),
23+
and a new `_array_truncations: {<field>: {original, kept}}` sibling records
24+
the true pre-truncation length so callers can reconcile `count`/`total`
25+
siblings against what was actually returned.
26+
27+
3. **`project_map` schema sharpened.**
28+
- `hot_functions` SQL tightened to `n.type IN ('function','method')` so
29+
structs/classes no longer leak into the "hot functions" bucket.
30+
- `entry_points[].kind` added: `"main"` for program entry points, `"http_route"`
31+
for framework-registered handlers. Lets LLMs skip `main` when scanning the
32+
HTTP surface without sniffing the `route` string.
33+
34+
4. **`dependency_graph` filters the `<external>` sentinel.** The synthetic
35+
bucket for unresolved imports now no longer surfaces as a fake file dependency.
36+
37+
5. **`find_similar_code` reports cutoff-driven shortfalls.** When
38+
`max_distance` drops candidates below `top_k`, the response now carries
39+
`cutoff_applied: true`, `cutoff_dropped: N`, and a `hint` suggesting the
40+
user widen `max_distance`. Also echoes `top_k` and `max_distance` in every
41+
response for transparency.
42+
43+
6. **`impact_analysis` on types returns `risk_level: "UNKNOWN"`.** When the
44+
target is a struct/class/enum/interface/type_alias and the call graph finds
45+
zero callers, the risk level is now `UNKNOWN` instead of `LOW` — so LLMs
46+
don't mistake "call graph can't see type usage" for "no one uses this".
47+
The existing type_warning still explains why and points to
48+
`semantic_code_search` for broader coverage.
49+
50+
### Test coverage
51+
52+
- +2 unit tests in `src/mcp/server/helpers.rs` (truncation homogeneity,
53+
no-op when arrays < 20).
54+
- +6 integration tests in `tests/integration.rs` covering each fix above.
55+
- Full suite: lib 221 + integration 41 + cli_e2e 50 + parser 19 + plugin 6 +
56+
hardening 6 = 343 passed, clippy clean.
57+
358
## v0.11.0 — auto-refresh stale decision table on plugin upgrade
459

560
### Migration note

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.0"
3+
version = "0.11.1"
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.0",
7+
"version": "0.11.1",
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.0",
3+
"version": "0.11.1",
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.0",
3+
"version": "0.11.1",
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.0",
3+
"version": "0.11.1",
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.0",
3+
"version": "0.11.1",
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.0",
3+
"version": "0.11.1",
44
"description": "code-graph-mcp binary for Windows x64",
55
"license": "MIT",
66
"repository": {

0 commit comments

Comments
 (0)