Skip to content

fix(explore): #450 max_results overshoot + #448 rerank stem/case#455

Merged
justrach merged 3 commits into
mainfrom
claude/sleepy-roentgen-0ba2a5
May 11, 2026
Merged

fix(explore): #450 max_results overshoot + #448 rerank stem/case#455
justrach merged 3 commits into
mainfrom
claude/sleepy-roentgen-0ba2a5

Conversation

@justrach
Copy link
Copy Markdown
Owner

Summary

  • Fixes #450: searchContent overshoots max_results by one when Tier 0.5 prefix expansion fills the list and Tier 1 still runs.
  • Fixes #448 (both parts): rerank now uses symmetric basename-stem containment (so query "Explorer" boosts src/explore.zig) and case-insensitive symbol-definition equality (so query "store" boosts pub const Store).

Commits

  1. test(explore): failing tests for #450 and #448 — three tests that fail on main.
  2. fix(explore): clamp searchInContent to max_results (#450) — one-line entry guard at the top of searchInContent.
  3. fix(explore): symmetric basename-stem + case-insensitive symbol boost (#448) — narrow tweaks in rerankSignalScore.

Per CLAUDE.md: failing tests committed separately from fixes.

Test plan

  • zig build test passes (full suite, all 521+ tests including the three new issue-450 / issue-448 blocks).
  • Per-test verification: each issue-XX test fails on main and passes after its fix commit.
  • No CI regressions.

🤖 Generated with Claude Code

justrach and others added 3 commits May 12, 2026 01:17
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>
@github-actions
Copy link
Copy Markdown

Benchmark Regression Report

Thresholds: 10.00% and 50,000 ns absolute delta

NOISE means the percentage threshold was exceeded, but the absolute delta was too small to fail CI.

Tool Base (ns) Head (ns) Delta Abs Delta (ns) Status
codedb_bundle 560511 546113 -2.57% -14398 OK
codedb_changes 61676 56816 -7.88% -4860 OK
codedb_deps 10338 8970 -13.23% -1368 OK
codedb_edit 7174 6131 -14.54% -1043 OK
codedb_find 63904 62406 -2.34% -1498 OK
codedb_hot 106094 97215 -8.37% -8879 OK
codedb_outline 308381 297740 -3.45% -10641 OK
codedb_read 96638 99339 +2.79% +2701 OK
codedb_search 213439 158354 -25.81% -55085 OK
codedb_snapshot 304799 289692 -4.96% -15107 OK
codedb_status 213626 206030 -3.56% -7596 OK
codedb_symbol 63051 61519 -2.43% -1532 OK
codedb_tree 68259 67275 -1.44% -984 OK
codedb_word 75743 69693 -7.99% -6050 OK

@justrach justrach merged commit 078ddba into main May 11, 2026
1 check passed
@justrach justrach deleted the claude/sleepy-roentgen-0ba2a5 branch May 11, 2026 17:38
justrach added a commit that referenced this pull request May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

explore: Tier 0.5 prefix expansion can exceed max_results explore: rerank misses canonical files for basename-stem and case variants

1 participant