Skip to content

feat: surface graph staleness, omitted counts, and symbol disambiguation#458

Open
jaissebastian wants to merge 2 commits into
tirth8205:mainfrom
jaissebastian:feature/agent-transparency
Open

feat: surface graph staleness, omitted counts, and symbol disambiguation#458
jaissebastian wants to merge 2 commits into
tirth8205:mainfrom
jaissebastian:feature/agent-transparency

Conversation

@jaissebastian
Copy link
Copy Markdown
Contributor

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.

jaissebastian and others added 2 commits May 10, 2026 12:41
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>
@jaissebastian jaissebastian force-pushed the feature/agent-transparency branch from e94970e to cb08a35 Compare May 10, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant