Repository navigation
/ship's review plan finishes on repositories with large trial files (HARN-98) - #4651
Merged
Merged
Conversation
…eview, and the consumer-scan cap can be raised (HARN-64) The exclusion's name scan used git grep -o with every candidate path, which ran past its 120 s bound on harness-evals #538 (2,140 paths in one pins.sha256), so every file stayed in review. It now lists hit files with git grep -l and reads each one, and a file whose lines are all digests and paths names nothing. Those manifest lines also no longer set money, security, data or eval risk; secret lines still count. GSTACK_REVIEW_CONSUMER_SCAN_CAP raises the 2,000-file consumer-scan cap, and a tripped cap prints a CONSUMER_SCAN line naming both fixes. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ash-manifests Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # bin/gstack-review-plan
Planning 460 recent main commits across gstack, harness-evals and gstack-evals with the old and new rules gives the same class and risk classes on all 460 (replay HARN-64). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…HARN-98) The consumer scan ran git grep -o with every data basename, and git's -o retries every pattern after each match: on harness-evals #551 one 16 MB trials file took 220 s. The scan now lists candidate files once per scan, greps a scratch index of them with -l, and picks the matches itself the way -o does, so its lines are byte-identical. #551's scan takes about 40 s instead of passing its 120 s deadline. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…fast Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # docs/review-policy.md # lib/review-exclude.ts # test/review-exclude-pin-manifest.test.ts
capy-ai
Bot
changed the base branch from
review-scan-cap-and-hash-manifests
to
main
November 22, 2026 02:24
|
😎 This pull request was merged. |
At a commit it reads blobs in cat-file batches of at most 64 MB, in the working tree it reads one file at a time, and a file larger than the output cap goes to git's own -o grep, so many large trial files no longer fail the scan or exhaust memory. (HARN-98) Review-Finding: p1/specialist-batched#1 reader=testing Review-Finding: p1/red-team#1 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…es for one file Lines from git's fallback grep are now added one at a time, and the byte cap is checked as each line is added, so a large file with about a million name matches gives git's lines or fails closed instead of throwing RangeError. (HARN-98) Review-Finding: v1/outside-voice#1 reader=outside-voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The scan's scratch index now lives under the repository's git directory, as patch-id diffs do, so an unwritable TMPDIR no longer throws; a directory it cannot create fails the scan closed with a named error. (HARN-98) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Merged
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/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 -owith 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.
What changed
Results repositories hit a review plan that never finished. The scan that decides whether a changed data file is read by code ran
git grep -owith every data file name, and git's-oretries every name after each match, so one 16 MB trials file took 220 s. The scan now lists the files that can hold a name once per scan, finds the ones that do withgit grep -lover a scratch index, and picks their matches itself the way-odoes (earliest start, longest name there, then on from its end), so its output is byte-identical to the old grep.git cat-file --batchcalls of at most 64 MB, working-tree files one at a time, and a file larger than the output cap goes back to git's own-ogrep. Lines are added one at a time against the byte cap, so a file with a million matches gives git's lines or fails closed instead of crashing.-opath.scanConsumerscredits each match through a per-depth lookup instead of testing every probe against every line (about 50 s on feat: design binary — real UI mockup generation for gstack skills (v0.13.0.0) #551).Evidence
consumer_scan_failed). Given an unbounded deadline, it took 2,382 s and found 1,327 consumed data files. After: the commit scan took 38 s and the working-tree scan took 39 s, and both found the identical 1,327 files.git grep -oon a seeded fixture with overlapping, nested and repeated names, an edited file, assume-unchanged and skip-worktree entries, an untracked file and a symlink, at a commit and in the working tree.Why
"The plan timed out at 1,703 s" on harness-evals #551 even with a 30-minute limit, which blocked that results PR. Results PRs with large trial files now get their review plan in about 40 s, with the same consumed-file answer as before.
Blast radius
The only caller is
scanConsumersin lib/review-collect.ts, which feeds the review depth; every scan failure still returnsconsumer_scan_failedand fails the depth closed (walked failure path, lib/review-collect.ts). Output equality withgit grep -ois checked by seeded differential tests at a commit and in the working tree (script ran), and reviewers compared 19 more edge-case repos byte for byte.Test Coverage
Coverage: 65% of the 17 new code paths (11 covered, 4 strongly); the 6 gaps are fail-closed error branches and rare fallbacks.
Tests: 1859 → 1860 test files (+1 new: test/review-consumer-scan-speed.test.ts with 4 tests).
Tests ran: focused 35
Tests ran: tests 1740 (files, from CI run 44984635840)
Pre-Landing Review
Two full review passes, a second-model review, an adversarial read and a targeted read. Fixed: blob bodies read under one 256 MB buffer at a commit, a whole chunk of working-tree files held in memory at once, and a crash when git's fallback returned about a million matches. A later CI failure (an unwritable TMPDIR) was fixed by moving the scratch index under the git directory. The second-model review (openai/gpt-6.1-sol) found the crash; it was fixed and rechecked clean.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
lib/review-collect.ts:283The output cap is checked only after a whole chunk of matches is collected in memory (now checked per line as lines are added).lib/review-collect.ts:172With core.splitIndex=true the scratch update-index writes a sharedindex file into the real .git.lib/review-collect.ts:172A temp-directory failure threw instead of returning a scan failure (since fixed: it is now a named scan failure).test/review-consumer-scan-speed.test.ts:86The 5 s wall-clock bound may flake on a loaded runner (the scan measures about 0.5 s there).lib/review-collect.ts:176update-index verify_path may refuse historical paths, failing the scan closed.test/review-consumer-scan-speed.test.ts:66The batch/oversize equality test also passes on the code before that fix.lib/review-collect.ts:290No test covers the cat-file --batch-check missing-object or size-mismatch failure branches.lib/review-collect.ts:174A deadline that hits the new rev-parse in a linked worktree reports an unwritable directory instead of a timeout (still fails closed).lib/review-collect.ts:176A killed scan leaves its scratch index under .git/gstack-consumers; nothing sweeps them.Exploratory QA
Smoke, 2 probes: the 16 MB, 80-name trials fixture scans in 537 ms at a commit and 327 ms in the working tree with 586,800 identical lines each; the batch and oversize equality test passes. No failed, blocked or not-run probes.
Eval Results
No prompt-related files changed — evals skipped.
Scope Drift
Scope Check: CLEAN
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Bug fix, plan exempt.
Issues
Refs #538
Refs #551
Refs p1/red-team#1
Refs p1/specialist-batched#1
Refs v1/outside-voice#1
TODOS
No TODO items completed in this PR.
Documentation
Status: current. The docs already match the change, so no edits were made.
Scope: the committed diff from 8d0e827 to a80aefc on review-consumer-scan-fast:
lib/review-collect.ts,docs/review-policy.md,changelog.d/review-consumer-scan-fast.mdandtest/review-consumer-scan-speed.test.ts. There are no staged, unstaged or new files.Documentation health:
docs/review-policy.md: Current. The consumer-scan paragraph matches the code: one extension pass per scan for each commit and the working tree, a scratch index read withgit grep -l, and matches picked the way-opicks them (byte-identical results). The 120 s deadline and 256 MB cap are unchanged.docs/ship-policy.md: Current. The review-exclude name scan is unaffected.changelog.d/review-consumer-scan-fast.md: Current. It is consistent with the code and the policy doc.docs/troubleshooting.md: Current, with one gap noted below.Coverage debt: the scan's new scratch-index step has reference and explanation coverage in
docs/review-policy.md. The new failure that names an unwritable scratch directory under the git directory has notroubleshooting.mdentry (a common gap).Diagram drift: none.
Tests
Agent notes
Lane GSTA-757 for GST-3425 (HARN-98, relayed through HARN-1). Built on #4643 (merged).
REVIEW_LOOP: passes=2 blocking_found=1 deferred=0 noted=9 fixed=3 scope=frozen ledgers_read=7 fix_checks=2 dispatches=8
Gate edits: none detected (GATE_SCAN tagged=0)
Approvals
Approved: yes (record r-0102f706aa29). The full approval record stays private.
Plan: exempt: bug fix GST-3425 under the GSTA-36 brief
Plan check: exempt bug fix