Public: anyone can read this; the crew can change it.
/search greps code within a 30 ms budget and offers "More code results": land pull #3732's branch with its last review asks #3758
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Replaces #3385, whose pull #3732 went through three review rounds. The design was found sound each time: an opt-in
budgetedgrep, the API and palette unchanged, and?code=allas a plain link. Start from that pull's branch,scout/3385-a-first-search-for-a-word-answers-under(headb061ff06), not from scratch.Done:
src/core/search.ts,grepRepostakes a time budget as a parameter (no exported mutable module state), checks it before each batch, and reportsmorewhen repositories were left ungrepped./searchgreps with a 30 ms budget and shows "More code results", linking to?code=allwithkindandlivekept. Issues and repositories are always searched in full. The TUI palette and/api/v1search grep everything.src/web/pages/search.tsis fixed.- With a 0 ms budget, the page carries
data-more-code, whose href is?code=allwithkindandlivekept, and?code=allremoves it. - With a large budget, every row shows and there is nodata-more-code. - Each test fails if the note or the budget is taken out.test/flake.test.tsforbids them). The suites for search, studio search, opensearch and the TUI still pass.Files: src/core/search.ts, src/web/pages/search.ts, test/search-budget.test.ts (or the branch's test). Risk: one batch of four greps can run past 30 ms. That is acceptable; never cut a grep midway.