Skip to content

fix(#546): down-rank first-party tooling paths in searchContent rerank#557

Merged
justrach merged 2 commits into
release/0.2.5825from
fix/issue-546-nonsource-rank
Jun 10, 2026
Merged

fix(#546): down-rank first-party tooling paths in searchContent rerank#557
justrach merged 2 commits into
release/0.2.5825from
fix/issue-546-nonsource-rank

Conversation

@justrach

Copy link
Copy Markdown
Owner

Problem

Part of #546 (structurally-relevant files rank below lexical hits). Single-word codedb_search/CLI search queries rank via rerankSignalScore, which penalizes tests/examples/vendor/doc files but has no prior for first-party tooling directories. Mention-heavy files under bench/, scripts/, website/, install/ tie the implementing source file and win the path-asc tiebreaker.

Observed on this repo (audit run, 2026-06-10):

Fix

One multiplier in rerankSignalScore (src/explore.zig): path segments bench/benchmarks/scripts/website/install → score ×0.5 (between vendor 0.4 and tests 0.6). BM25/searchContentRanked path was checked and does not exhibit the bug in a minimal repro, so it is left untouched.

Failing Test

test "issue-546: searchContent rerank penalizes non-source tooling paths (bench/install/scripts/website)" in src/test_search.zig — 5 identical-content files; pre-fix bench/sample.zig ranks first by path-asc, post-fix src/sample.zig wins. Committed red in 87e5386, fix in follow-up commit.

Validation

🤖 Generated with Claude Code

justrach and others added 2 commits June 10, 2026 10:31
… implementation

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…/install) in rerank

Single-word searchContent queries rank by rerankSignalScore, which
penalized tests/examples/vendor/docs but had no prior for first-party
tooling directories. Mention-heavy files under bench/, scripts/,
website/, and install/ tied or beat the implementing src file and won
on the path-asc tiebreaker (live repo: 'snapshot' ranked
install/install.sh above src/snapshot.zig, gold at rank 6; engram
codedb-insights MRR 0.30 vs 0.60).

Apply a 0.5 multiplier for bench/benchmarks/scripts/website/install
path segments — milder than vendor (0.4), stronger than tests (0.6
on a usually-lower base). Post-fix 'snapshot' ranks src/snapshot.zig
first on this repo.

Co-Authored-By: Claude Fable 5 <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 110980 108771 -1.99% -2209 OK
codedb_changes 13627 11193 -17.86% -2434 OK
codedb_context 1152285 1178522 +2.28% +26237 OK
codedb_deps 330 319 -3.33% -11 OK
codedb_edit 48946 51392 +5.00% +2446 OK
codedb_find 11722 10176 -13.19% -1546 OK
codedb_hot 26329 28717 +9.07% +2388 OK
codedb_outline 34662 41696 +20.29% +7034 NOISE
codedb_read 17989 20397 +13.39% +2408 NOISE
codedb_search 27248 26252 -3.66% -996 OK
codedb_snapshot 73500 73417 -0.11% -83 OK
codedb_status 10229 9748 -4.70% -481 OK
codedb_symbol 51002 48446 -5.01% -2556 OK
codedb_tree 51305 50951 -0.69% -354 OK
codedb_word 13746 12863 -6.42% -883 OK

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.

1 participant