fix(mcp): bump INDEX_VERSION, improve empty search UX, reduce call noise#2
Merged
fix(mcp): bump INDEX_VERSION, improve empty search UX, reduce call noise#2
Conversation
- Bump INDEX_VERSION 2→3 to force full rebuild for stale indexes that
were missing cross-file call edges (e.g., run_serve→handle_message)
- Return structured {results, message, hint} instead of bare [] when
semantic_code_search finds no matches, so callers get actionable feedback
- Add flush/close/read/write to CROSS_FILE_CALL_NOISE to prevent false
positive edges like stdout.flush() → metrics::flush()
- Add regression test for Rust method call extraction in try/match contexts
- Update integration test for new empty-results response format
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sdsrss
added a commit
that referenced
this pull request
Apr 20, 2026
Three changes driven by real-usage-data review of this repo's own `.code-graph/usage.jsonl`: 1. `code-graph-mcp stats` — new CLI subcommand that aggregates JSONL session metrics (per-tool counts, search totals, index activity). Running on this repo's 153-session, 570-call history surfaced the rebuild_index error pattern motivating change #2. Flags: `--last N`, `--json`. 5 new unit tests on the pure `aggregate_usage_jsonl` helper. 2. `rebuild_index` MCP tool: embedding-busy rejection now returns `Ok({status:"busy", retry_after_ms:2000})` instead of `Err`, matching `run_incremental_with_cache_restore`'s precedent and keeping the usage-metrics `err` counter from inflating on legitimate retry signals. **Contract change** — SDK clients must now distinguish busy success payloads from JSON-RPC errors; JSON-RPC errors on this tool now indicate real failures only. 3. `plugin_code_graph_mcp.md` template: CLI `search` (FTS5-only) and MCP `semantic_code_search` (RRF hybrid of FTS5 + vector) are no longer conflated — the core-7 decision table and CLI cheat sheet now state the difference explicitly. Adopted memory files auto-refresh on next SessionStart (v0.11.0+). Clippy 1.95 parity verified pre-push: `cargo +1.95.0 clippy --no-default-features -- -D warnings` ✓ `cargo +1.95.0 clippy --all-targets -- -D warnings` ✓ 235/235 lib tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
run_serve → handle_messagewas lost because incremental index doesn't re-process unchanged files after indexer logic improvements)semantic_code_searchnow returns{results: [], message, hint}instead of bare[], giving callers actionable guidance when no matches are foundflush,close,read,writetoCROSS_FILE_CALL_NOISEto prevent false positive edges likestdout.flush()→metrics::flush()Test plan
cargo test --no-default-features)cargo build --release)get_call_graph("handle_message", callers)showsrun_serve(depth 1) andmain(depth 2)run_serve → flushfalse positive eliminateddependency_graph("src/main.rs")correctly showsserver.rsdependency🤖 Generated with Claude Code