Repository navigation
[pull] main from DeusData:main - #134
Merged
Merged
Conversation
Land the four residual hardening points from #938 on the current semantic-search design (semantic_limit/offset, the certified top-K fetch loop): - extract_semantic_keywords rejects a semantic_query array that holds a non-string element instead of silently running the string subset; the caller gets the same isError as for a bare-string semantic_query. - run_semantic_query_core fails closed when the vector scan itself fails ("semantic search failed", isError) instead of rendering a store error as zero matches plus the broaden-your-keywords hint. cbm_store_vector_search now tells the two states apart: a store with no node_vectors table (lean index) is CBM_STORE_NOT_FOUND and keeps the empty-page + moderate/full-index hint that main relied on by swallowing the "no such table" prepare failure; a failing scan is CBM_STORE_ERR. - vs_min_cosine_score hoists the keyword norms (once per search) and the node norm (once per node) out of the per-(node, keyword) loop. The integer sums are exact, so every score stays bit-identical. - vs_append_result checks its strdup results, frees the partial row on failure and counts a row only once every copy succeeded, so the caller's free path stays valid. Two reproduce-first tests in the mcp suite fail on main and pass with the change: non-string elements produce the type error, and a forced cbm_cosine_i8 failure produces the fail-closed error for semantic-only and combined calls while a missing node_vectors table still yields the lean-index hint. Refs #915 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com> Co-authored-by: Dustin Persek <dustin.persek@protonmail.com>
fix(mcp): harden semantic search inputs and store-error handling
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )