Skip to content

fix(mcp): isolate semantic-only JSON search - #1319

Open
JJordan0C wants to merge 1 commit into
DeusData:mainfrom
JJordan0C:fix/search-graph-semantic-only-results
Open

fix(mcp): isolate semantic-only JSON search#1319
JJordan0C wants to merge 1 commit into
DeusData:mainfrom
JJordan0C:fix/search-graph-semantic-only-results

Conversation

@JJordan0C

Copy link
Copy Markdown

What does this PR do?

Fixes #1295.

search_graph already skipped the structural query for semantic-only calls in
the default response format, but format:"json" still ran an unfiltered
structural search. On a 21,221-node index that made the JSON response report all
21,221 nodes and include unrelated groups alongside the semantic matches.

This change shares the structural-filter detection between both output paths
and skips cbm_store_search for semantic-only JSON calls. Mixed
semantic/structural searches keep their existing behavior.

The regression test covers both output formats. The end-to-end reproduction now
returns total: 0, count: 0, and no structural groups while retaining
semantic rows.

Validation:

  • Full test runner: 6,792 passed, 4 platform-only skips
  • Full ASan/UBSan test runner: 6,792 passed, 4 platform-only skips
  • CI lint gate: cppcheck 2.20.0, clang-format 20, NOLINT policy
  • Production binary reproduction against the repository's full index

Checklist

  • Every commit is signed off (git commit -s) — required, CI rejects
    unsigned commits (DCO, see CONTRIBUTING.md)
  • Tests pass locally (make -f Makefile.cbm test)
  • Lint passes (make -f Makefile.cbm lint-ci)
  • New behavior is covered by a test (reproduce-first for bug fixes)

The JSON search_graph path always ran the structural search, even when semantic_query was the only filter. Reuse the shared structural-filter check so semantic-only JSON calls retain semantic hits without returning unrelated graph nodes.\n\nAdd regression coverage for both default and JSON output.

Signed-off-by: JJordan0K <69581081+JJordan0C@users.noreply.github.com>
@JJordan0C
JJordan0C requested a review from DeusData as a code owner July 28, 2026 16:44
@DeusData DeusData added this to the 0.9.1-rc milestone Jul 28, 2026
@DeusData DeusData added bug Something isn't working duplicate This issue or pull request already exists parsing/quality Graph extraction bugs, false positives, missing edges editor/integration Editor compatibility and CLI integration priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker. labels Jul 28, 2026
@DeusData

DeusData commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Thank you for the contribution and for covering the semantic-only JSON path with end-to-end regression tests. This is now triaged as a high-priority MCP output correctness bug for 0.9.1-rc. Current main already contains an overlapping fix and regression coverage for #1295, so review will determine whether this branch still contains any distinct work. Our community PR queue is currently quite full, so it may take a little time before we can complete that review. We are doing our best to support community contributions and will return with code-grounded feedback as capacity opens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working duplicate This issue or pull request already exists editor/integration Editor compatibility and CLI integration parsing/quality Graph extraction bugs, false positives, missing edges priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

search_graph: when only semantic_query is given, the results field returns the entire graph unfiltered

2 participants