feat(graph): add symbol callers, callees and impact tools - #124
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <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
This is the next S1.07 slice of the CodeGraph parity roadmap. CodeGraph's MCP surface has eight tools. GraphNest already covered search, explore, files and status; this PR adds callers, callees and impact, addressed by symbol name the way agents call them. The remaining tool,
node, is a follow-up.POST /v1/graph/callers,/v1/graph/calleesand/v1/graph/impact-radius.graph_callers,graph_calleesandgraph_impact_radius, listed in the capability workflows.matchesSymbol:Class.method,module::fn,dir/module) matched by qualified-name suffix, or by path for Rust and Python modules;crate::,super::andself::stripped;fn/3) must match;options.declaration first.filenarrows by path or suffix; when nothing matches, all definitions are returned withfile_filter: unmatched.calls,imports,instantiates,navigatesandreferencesone hop, in the producer's edge order. Each neighbor appears once with its first edge.limitapplies per definition (default 20, clamped to 1–100) andtruncatedreports when more exist.ImpactRadius(depthdefault 2, clamped to 1–10).Evidence
b9ca4b7) now also runs upstream's realcodegraph_callers,codegraph_calleesandcodegraph_impacthandlers: 11 new answers, 52 in all. They cover grouping of same-named definitions (normalize×3,greet×4,identity×2),filenarrowing and its fallback, a qualified name, a limit, a depth, an absent symbol, andvia instantiationandvia importlabels.workflow-baseline.jsonis refreshed because it pins the harness file's hash. It was measured on the same machine class.TestGraphSymbolToolsMatchCodeGraphloads the real fixture into PostgreSQL, renders GraphNest's structured answers in upstream's markdown layout and compares them:TestGraphSymbolToolsRESTAndMCPshows REST and MCP return identical answers from PostgreSQL, and that an ungranted repository returns404.Known differences from upstream
Documented in
docs/graph-exploration.mdand the execution record:searchNodesport yet. Upstream's name search is SQLite FTS5 BM25 with LIKE and Levenshtein fallbacks and rescoring. GraphNest'sDiscoveris exploration ranking: for example it matchesFixtureforMissingFixtureSymbol987, where upstream finds nothing. So these tools use exact-name candidates with upstream's matching rules. Consequences:not_foundinstead of upstream's best non-exact guess.consumer.tsandprocessGreeting, which upstream's depth-first walk omits, and order within a file differs.Compatibility and security
No schema or migration change and no new dependency. New read-only routes and tools only. The edge-ordering option is internal (
EntityNeighborQuery.ProducerOrder).Verification
Not in this PR
codegraph_node(file and symbol modes), asearchNodesport, and the rest of S1.07, S1.09 and S1.10. The Stage 1 gate has not been run.🤖 Generated with Claude Code