feat: surface graph staleness, omitted counts, and symbol disambiguation#458
Open
jaissebastian wants to merge 2 commits into
Open
feat: surface graph staleness, omitted counts, and symbol disambiguation#458jaissebastian wants to merge 2 commits into
jaissebastian wants to merge 2 commits into
Conversation
Tool responses now carry the information agents need to self-correct without extra round-trips: graph_meta block — every query_graph, semantic_search_nodes, and get_impact_radius response includes indexed_at (ISO timestamp), indexed_commit / head_commit (8-char SHAs from the graph DB and current HEAD), and is_stale so an agent knows whether to re-index before trusting callers_of results. Omitted counts — query_graph gains max_results (default 100) and always returns results_omitted so agents don't mistake a cap for "no callers found". Minimal mode reports the same. semantic_search_nodes and get_impact_radius minimal modes add their own omitted counts. Symbol disambiguation — when a bare name matches multiple nodes, the response now returns a ranked disambiguation list (exact QN > exact name > partial match) with qualified_name, file_path, and line_start for each candidate, plus a hint field explaining the fix. Replaces the old unranked candidates key. 29 tests in tests/test_agent_transparency.py covering all three features. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rmat)
Agents and IDEs write targets in Java package-qualified form:
com.example.service.OrderHandler.process
The graph indexes nodes by file-path qualified name:
/repo/src/.../OrderHandler.java::OrderHandler.process
Without this fix, lookup silently returns not_found even though the node
exists, because the Java package prefix prevents both the exact-match and
the FTS fallback from resolving it.
Fix: four-step resolution cascade in query_graph —
1. Exact graph QN lookup
2. Absolute path lookup
3. FTS search on raw target string
4. Java FQN decomposition: strip package prefix, try "Class.method"
(last 2 segments), then bare "method" (last 1 segment)
Each step only runs if the previous returned nothing. If decomposition
yields one match it resolves transparently; if it yields multiple it
returns the ranked disambiguation list so the agent can re-run with the
correct qualified name.
4 new tests in TestJavaFQNResolution covering ClassName.method,
package.Class.method, unique bare name, and ambiguous decomposition.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e94970e to
cb08a35
Compare
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.
Tool responses now carry the information agents need to self-correct without extra round-trips:
graph_meta block — every query_graph, semantic_search_nodes, and get_impact_radius response includes indexed_at (ISO timestamp), indexed_commit / head_commit (8-char SHAs from the graph DB and current HEAD), and is_stale so an agent knows whether to re-index before trusting callers_of results.
Omitted counts — query_graph gains max_results (default 100) and always returns results_omitted so agents don't mistake a cap for "no callers found". Minimal mode reports the same. semantic_search_nodes and get_impact_radius minimal modes add their own omitted counts.
Symbol disambiguation — when a bare name matches multiple nodes, the response now returns a ranked disambiguation list (exact QN > exact name
29 tests in tests/test_agent_transparency.py covering all three features.