Problem
rerankSignalScore's test penalty checks only DIRECTORY segments (pathHasSegment 'test'/'tests'), so test files identified by basename — src/tests.zig, src/adversarial_tests.zig, src/test_*.zig — receive no penalty in the scan-rerank path. Live: codedb search snapshot ranks src/tests.zig at file-rank 3, above non-test source. BM25's pathRelevanceMultiplier already handles this (startsWith(base,\"test\") / indexOf(base,\"_test\")); the two scorers should agree.
Failing Test
In src/test_search.zig (named after this issue once assigned): a denser-mentioning src/zz_tests.zig must rank below src/owner.zig for a concept query. Fails red on release/0.2.5825 (test file first).
Fix
Extend the penalty condition in rerankSignalScore with the same basename checks BM25 uses.
Problem
rerankSignalScore's test penalty checks only DIRECTORY segments (pathHasSegment 'test'/'tests'), so test files identified by basename —src/tests.zig,src/adversarial_tests.zig,src/test_*.zig— receive no penalty in the scan-rerank path. Live:codedb search snapshotrankssrc/tests.zigat file-rank 3, above non-test source. BM25'spathRelevanceMultiplieralready handles this (startsWith(base,\"test\")/indexOf(base,\"_test\")); the two scorers should agree.Failing Test
In
src/test_search.zig(named after this issue once assigned): a denser-mentioningsrc/zz_tests.zigmust rank belowsrc/owner.zigfor a concept query. Fails red on release/0.2.5825 (test file first).Fix
Extend the penalty condition in
rerankSignalScorewith the same basename checks BM25 uses.