Problem
handleSearch (src/mcp.zig, plain branch) fetches offset + max_results + 1 globally-ranked results, slices the page, and only THEN filters by path_glob at render time. When every fetched row is out-of-glob (the in-glob match ranks below the window), the response is the self-contradicting:
0 results for 'searchContent':
(more results — codedb_search query='searchContent' offset=20 for the next page)
Live repro on this repo: codedb_search query='searchContent' path_glob='src/explore.zig' → 0 results, although searchContent is defined in that file. Found during the 2026-06-10 dogfooding audit; same filter-after-cap family as #547/#553.
Failing Test
test "issue-560: path_glob page must not be starved by higher-ranked out-of-glob files" in src/test_search.zig (branch fix/issue-560-pathglob-starvation): 40 out-of-glob decoys tie the gold file, path-asc puts them first; {query:'starveTerm', path_glob:'src/**', max_results:5} must surface src/gold.zig and must not print 0 results. Verified failing on release/0.2.5825: 67/68 (fails at the gold-visibility assert).
Expected
In-glob results are what offset/max_results address. If matching results exist anywhere in the ranking, a glob-filtered query must return them.
Fix
In the plain-search branch: when path_glob is set, escalate the fetch window (×4, capped at the existing 100000 bound) until the in-glob set fills the requested page or the index is exhausted, then page over the glob-filtered sequence (offset becomes a cursor into in-glob results). scope=/regex= branches share the bug shape but keep their current single-fetch behavior for now — follow-up if it bites.
Problem
handleSearch(src/mcp.zig, plain branch) fetchesoffset + max_results + 1globally-ranked results, slices the page, and only THEN filters bypath_globat render time. When every fetched row is out-of-glob (the in-glob match ranks below the window), the response is the self-contradicting:Live repro on this repo:
codedb_search query='searchContent' path_glob='src/explore.zig'→ 0 results, althoughsearchContentis defined in that file. Found during the 2026-06-10 dogfooding audit; same filter-after-cap family as #547/#553.Failing Test
test "issue-560: path_glob page must not be starved by higher-ranked out-of-glob files"insrc/test_search.zig(branchfix/issue-560-pathglob-starvation): 40 out-of-glob decoys tie the gold file, path-asc puts them first;{query:'starveTerm', path_glob:'src/**', max_results:5}must surfacesrc/gold.zigand must not print0 results. Verified failing on release/0.2.5825: 67/68 (fails at the gold-visibility assert).Expected
In-glob results are what
offset/max_resultsaddress. If matching results exist anywhere in the ranking, a glob-filtered query must return them.Fix
In the plain-search branch: when
path_globis set, escalate the fetch window (×4, capped at the existing 100000 bound) until the in-glob set fills the requested page or the index is exhausted, then page over the glob-filtered sequence (offset becomes a cursor into in-glob results). scope=/regex= branches share the bug shape but keep their current single-fetch behavior for now — follow-up if it bites.