fix: hint search_graph toward the sibling label on a zero-result label search - #3
Open
pranitpanda-affirm wants to merge 1 commit into
Open
Conversation
…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
marked this pull request as ready for review
August 26, 2026 22:39
DanielDeng2024
approved these changes
Aug 26, 2026
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.
What does this PR do?
search_graphcalls filtered bylabel:"Function"silently miss constructs that register asMethodinstead (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_labeltest intests/test_mcp.c: reproduces the exact scenario (aMethodnode namedfindById, searched withlabel:"Function") and asserts the sibling-label hint fires in both output formats.mcpsuite: 192 passed / 2 skipped — no regressions (191 passed/2 skipped before this test was added).Checklist
git commit -s) — not yet done, flagging for follow-upmake -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 onmainbefore itmake -f Makefile.cbm lint-ci) — not run locally (cppcheck/clang-formatunavailable in this environment); deferring to CI