fix(explore): #450 max_results overshoot + #448 rerank stem/case#455
Merged
Conversation
Three tests that fail on current main: - issue-450: searchContent overshoots max_results by 1 when Tier 0.5 prefix expansion fills the list and Tier 1 still runs a trigram scan. - issue-448: rerank doesn't boost src/explore.zig for query "Explorer" because the stem-contains-query check is one-directional. - issue-448: rerank symbol-definition boost is case-sensitive, so query "store" misses `pub const Store = struct`. Per CLAUDE.md, failing test on its own commit; fix follows in the next two commits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
After Tier 0.5 prefix expansion fills result_list to max_results, the function fell through into Tier 1's trigram scan. searchInContent only checked the cap after appending — so one extra match leaked through. Add an entry guard at the top of searchInContent that bails when the caller's quota is already met. Covers all five tiers that funnel through that helper. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…#448) Two narrow rerank fixes: 1. Symbol-definition boost was case-sensitive (std.mem.eql), so query "store" missed `pub const Store = struct`. Use asciiEqlIgnoreCase to match the case-insensitive content search. 2. Basename-stem matching was one-directional — only boosted when the stem CONTAINS the query. Query "Explorer" failed to boost src/explore.zig because "explore" doesn't contain "Explorer", even though the query clearly names the file. Add a symmetric branch: when stem.len >= 3 AND query contains stem, give the same +8 boost. Path-segment guard updated to skip when either direction fires, so we don't double-count. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Benchmark Regression ReportThresholds: 10.00% and 50,000 ns absolute delta
|
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
searchContentovershootsmax_resultsby one when Tier 0.5 prefix expansion fills the list and Tier 1 still runs.src/explore.zig) and case-insensitive symbol-definition equality (so query "store" boostspub const Store).Commits
test(explore): failing tests for #450 and #448— three tests that fail onmain.fix(explore): clamp searchInContent to max_results (#450)— one-line entry guard at the top ofsearchInContent.fix(explore): symmetric basename-stem + case-insensitive symbol boost (#448)— narrow tweaks inrerankSignalScore.Per CLAUDE.md: failing tests committed separately from fixes.
Test plan
zig build testpasses (full suite, all 521+ tests including the three newissue-450/issue-448blocks).issue-XXtest fails onmainand passes after its fix commit.🤖 Generated with Claude Code