Fix kbsearch ranking, --root filter, and daemon start - #5
Merged
Conversation
Go search took worst BM25 hits (ORDER BY score), cut to -n before --root, and never called ensureDaemon. Ranking and flag parsing move to a cgo-free package so CI can fail those regressions without ladybug. --hop errors instead of being swallowed into the query.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
eSlider
added a commit
that referenced
this pull request
Aug 13, 2026
#5) Go search took worst BM25 hits (ORDER BY score), cut to -n before --root, and never called ensureDaemon. Ranking and flag parsing move to a cgo-free package so CI can fail those regressions without ladybug. --hop errors instead of being swallowed into the query.
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.
Summary
ORDER BY score(worst BM25 first). Statement is nowORDER BY score DESC, next to vectorORDER BY distance.--root/--reporan after-n, so facts below the cut vanished. Filter first, then limit.ensureDaemon()existed and was never called; CLI now starts it (Setsid+Release).KBSEARCH_NO_DAEMON=1keeps the in-process fallback.SET STREAM_SANDBOXran on a nil connection. Open first, close on error paths, reject quotes in the value.bin/kbsearch/rank(no cgo). CI runsgo test ./rankthere so these regressions can go red without ladybug.--hopis an error (not swallowed into the query). File/FROM_FILE edges are still missing; hop itself is not in this PR.Does not take evidence nodes or DROP INDEX from #2 — those would regress
b73b4d4.Test plan
go test ./rank -count=1inbin/kbsearchbin/kb/search "hybrid search" --root facts -n 5on a local brain with ladybugbin/kb/search "q" --hop 1exits 2 and does not search for"q 1"