Skip to content

fix: hint search_graph toward the sibling label on a zero-result label search - #3

Open
pranitpanda-affirm wants to merge 1 commit into
fix/publish-staged-generation-stampfrom
fix/search-graph-label-hint
Open

fix: hint search_graph toward the sibling label on a zero-result label search#3
pranitpanda-affirm wants to merge 1 commit into
fix/publish-staged-generation-stampfrom
fix/search-graph-label-hint

Conversation

@pranitpanda-affirm

@pranitpanda-affirm pranitpanda-affirm commented Aug 26, 2026

Copy link
Copy Markdown

What does this PR do?

search_graph calls filtered by label:"Function" silently miss constructs that register as Method instead (JDBI/interface methods, for one). The existing zero-result hint ("no nodes with this label") reads exactly like "this doesn't exist" rather than "wrong label" — an agent trusting a clean zero-result response will confidently report a real symbol as absent, which is a data-completeness footgun, not just friction.

Fix: before falling back to the existing generic hints, probe the same filters under the Function/Method sibling label (the one confusable pair known to cause this) and, if it has a hit, point the caller at it directly instead of the generic "no nodes with this label" message. Applies to both the default tree/text output and format:"json".

Testing

New search_graph_zero_result_hints_sibling_label test in tests/test_mcp.c: reproduces the exact scenario (a Method node named findById, searched with label:"Function") and asserts the sibling-label hint fires in both output formats.

mcp suite: 192 passed / 2 skipped — no regressions (191 passed/2 skipped before this test was added).

Checklist

  • Every commit is signed off (git commit -s) — not yet done, flagging for follow-up
  • Tests pass locally (make -f Makefile.cbm test) — relevant suites (mcp, store_*, graph_buffer, pipeline) are clean; the full run has ~327 pre-existing failures in tree-sitter grammar/extraction probes, unrelated to this change and present on main before it
  • Lint passes (make -f Makefile.cbm lint-ci) — not run locally (cppcheck/clang-format unavailable in this environment); deferring to CI
  • New behavior is covered by a test (reproduce-first for bug fixes)

…l search

label:"Function" search_graph calls silently miss JDBI/interface methods
and other constructs that register as Method, not Function -- the
existing zero-result hint ("no nodes with this label") reads exactly
like "this doesn't exist" instead of "wrong label", and an agent taking
that at face value will confidently report a real symbol as absent.

Before falling back to the existing generic hints, probe the same
filters under the Function/Method sibling label (the one pair known to
cause this) and point the caller at it directly when it has a hit.
Applies to both the default tree/text output and format:"json".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@pranitpanda-affirm
pranitpanda-affirm marked this pull request as ready for review August 26, 2026 22:39
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.

2 participants