fix(mcp): return semantic-only graph results as primary - #938
Conversation
|
Thanks for the semantic_query fix for #915. Triage: high-priority query correctness bug. Review should verify semantic-only calls put vector-ranked hits in the primary results array, combined structural+semantic behavior stays compatible, and total/has_more report the semantic candidate set rather than the broad structural fallback. |
|
The shape of this is right: one semantic-query collection feeding either the primary One change requested: the refactor quietly switched With that addressed this is merge-ready. |
|
Implemented your preference and restored yyjson_mut_obj_add_strcpy for all four vector-result strings. |
|
Thanks @dpersek — reviewed in depth. The core fix is right and we want it: a semantic-only Two changes before we can merge, both about not shipping a scale/contract foot-gun:
Also please rebase onto current |
Signed-off-by: Dustin Persek <dustin.persek@protonmail.com>
4d14460 to
0850901
Compare
|
Reviewed properly at last — apologies this took so long, because the delay is most of the problem here. Your diagnosis of #915 was exactly right, and it is worth saying plainly: the unfiltered structural search being prepended, letting vector-less nodes win the ranking alphabetically, is precisely the bug. Main's default-path isolation follows the direction this PR established, and it is live today at What happened is that main moved out from under you, twice. Since your last rebase in mid-July, TOON was pruned in favour of the tree format, and then Two pieces here are still genuinely valuable and are not on main:
Both would make a strong focused follow-up against current main. Two things I would want split out and decided explicitly, because they cut results rather than reorder them:
Neither is wrong; both trade recall for precision, and that is a product call we want to make deliberately rather than inherit. Splitting them out lets each be judged on its own. Also riding along undeclared: a store-API signature change ( Suggested path: let #1319 take the #1295 JSON residual, and open a focused PR against current main with the pagination and deterministic ordering. If you would rather not carry that yourself, we can distill those two pieces with One correction I owe you for accuracy: I initially attributed main's isolation to a different commit while reviewing this. The correct one is |
What does this PR do?
Fixes #915.
search_graphnow returns vector-ranked semantic hits in the primaryresultsarray for semantic-onlysemantic_querycalls, instead of returning broad structural results that can make vector-less nodes appear to win the ranking.Combined structural + semantic calls still expose
semantic_results, and non-arraysemantic_queryvalues still return the existing validation error. The vector search path now also reports a full semantic candidate count sototalandhas_morestay meaningful withlimit/offsetpagination.Local full-suite caveat:
make -f Makefile.cbm testis not green in this environment, but the failing graph-contract/probe slice reproduces on a cleanupstream/mainworktree, so it is not introduced by this patch. Focused MCP proof andlint-ciare green.Checklist
git commit -s) — required, CI rejectsunsigned commits (DCO, see CONTRIBUTING.md)
make -f Makefile.cbm test)make -f Makefile.cbm lint-ci)