fix(augment): BM25 floor for the rescue's FTS fallback (#2092) - #2105
fix(augment): BM25 floor for the rescue's FTS fallback (#2092)#2105sloemo01 wants to merge 1 commit into
Conversation
…2092) A multi-token pattern where only one common token matches still returns FTS rows at score ~3, so the zero-result rescue emitted a confident 'Wiki suggests ...' line for an unrelated file (repro: 'bluetooth codec negotiation fallback' riding on 'fallback' at 3.45). Genuinely related pages score 2-3x higher. Below the 6.0 floor, silence beats a confident wrong suggestion. Tests: below-floor silent, above-floor fires — sabotage-verified.
|
Flagging this before anyone merges it on green CI, because the direction is one I already ruled out on #2092. An absolute BM25 floor cannot be a single constant across both backends. SQLite negates the FTS5 rank and it is unbounded ( What #2092 needs is token coverage, not a score threshold, reusing the There is also a claim question. #2092 is held for @punk-dev-robot, who has the local before-and-after measurements and asked for it first; @Aman-goel-04 asked on 3 September and was declined for the same reason. Please check the issue thread before opening a PR against an assigned issue, and if you want the token-coverage version, say so on #2092 and let punk-dev-robot answer. Closing nothing here, and I am not going to close it over my head, but I am not merging this shape. Not in today's release either way. |
What
Fixes #2092. The zero-result grep rescue's FTS fallback returned the first row without checking its relevance score, so a multi-token pattern where only one common token matched produced a confident "Wiki suggests ..." line for an unrelated file (repro:
bluetooth codec negotiation fallbackriding on "fallback" at BM25 3.45).Root cause
_rescueinaugment_cmd/search.pyreturned the first FTS row pointing at a code page with no score check. Weak matches cluster ~3; genuine ones score 2-3x higher (observed 3.45 vs 8.70), so the fallback leg had no quality gate while the symbol path held an exact-match bar.Changes
_RESCUE_FTS_MIN_SCORE = 6.0— below the floor, silence beats a confident wrong suggestion.Tests
Note:
test_plugin_contentis red on main itself (v0.47.0 release bug, unrelated to this PR).