/ship's review plan finishes on repositories with large trial files (HARN-98) (#4651)

/ship's review plan no longer runs out of time on results repositories
whose trial files name many data files. On harness-evals #551 the scan
now takes about 40 s instead of running past its limit.

Why: harness-evals #551 is blocked on it. git's `grep -o` with about 80
file names took 220 s on one 16 MB trials file, and the plan timed out
at 1,703 s.

Nothing to do.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=testing
Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: v1/outside-voice#1 reader=outside-voice
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-22 04:43:46 +00:00
1 parent e8e755473f
commit c2b4f0d2ad
4 files changed
+263 -33

No files matched your search

+8 -1
View File
@@ -427,7 +427,14 @@ The cap counts files before `review_exclude_paths` applies, because the exclusio
the depth this scan decides, and it changes only depth: excluded files still stay out of the readers' diffs; a `git grep` failure is `consumer_scan_failed`
and fails the depth closed. The scan first lists the files that contain a candidate's
extension and then searches only those, docs files left out, so a large data tree
costs one cheap pass. Each scan gets one 120-second deadline, set in milliseconds with
costs one cheap pass. That extension pass runs once per scan at each commit and in the working
tree; the files it keeps go into a scratch index, `git grep -l` lists the ones that hold a
name, and the scan picks each such file's matches itself the way `git grep -o` does
(earliest start, longest name there, then on from its end), so its results are
byte-identical to the -o grep. git's own -o retries every name after each match and took
220 s on one 16 MB trials file with 80 names (HARN-98, harness-evals #551); on that PR's
304,000-file tree the whole scan now takes about 40 s on a 4-core machine, where it used to
run past its deadline. Each scan gets one 120-second deadline, set in milliseconds with
`GSTACK_CONSUMER_SCAN_TIMEOUT_MS`; a scan that runs past it, or whose matches pass
256 MB, is also `consumer_scan_failed`, and its detail says what stopped it and names
the deadline. One scan fits a minute inside the 180 seconds /ship gives