Repository navigation
fix(review-exclude): ready binds an older digest when no selection holds a PR file; name scan greps consumers only (GST-1434, GST-1435) - #4036
Merged
Conversation
…lds a PR file; the name scan greps consumers only (GST-1434, GST-1435) GST-1434: gstack-ship-queue ready (and train build, land) refused any receipt whose recorded review_exclude digest differed from the base policy's, so a policy edit on main voided every receipted PR even when no PR file fell under a pattern (harness-evals #274, #276 after #278). excludeMismatch now uses carryExcludeBinds, the predicate carry uses since #4030: a digest change binds when neither the recorded selection nor HEAD's holds a file the PR changed; anything else still refuses. GST-1435: the named-by-code scan ran git grep over the whole tree, so on harness-evals #269 it searched 30 MB of receipts for 4,354 candidate paths, ran 278 s past its 120 s limit and kept every file. It now lists each tree, keeps the consumer files (code and tests outside the candidates) and greps only those through literal pathspecs in 24 KB chunks. A git failure or timeout still keeps every candidate. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
grepFixed keeps every candidate when a consumer's name does not survive UTF-8 decoding, since its literal pathspec would match nothing. Review-Finding: p1/outside-voice#1 reader=outside-voice Review-Finding: p1/adversarial-native#1 reader=adversarial-native Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.
What changed
On a 6,500-file results PR the review pass used to time out its name scan, keep every file and stop over the diff ceiling; now it excludes the data and plans every reader in about 13 s.
Before/after as text: On a 6,500-file results PR the review pass used to time out its name scan, keep every file and stop over the diff ceiling; now it excludes the data and plans every reader in about 13 s
GST-1434.
gstack-ship-queue ready(and train build and land, throughbindShippedReceipt) now binds a receipt whose recordedreview_excludedigest is older than the base policy's when neither the recorded selection nor HEAD's holds a file the PR changed. It reusescarryExcludeBinds, the predicate carry has used since #4030, so carry and the queue apply one rule. A selection that holds a PR file (excluded or kept, on either side) and an unreadable base policy still refuse.GST-1435. The named-by-code scan in
lib/review-exclude.tsran onegit grep -F -o -f <candidates>over the whole tree at the head and the merge base. It now lists each tree, keeps only consumer files (code and tests outside the candidates, the sameconsumer()filter as before) and greps those through literal pathspecs in 24 KB chunks. Data under the patterns is never read. A git failure or timeout still returns null, so every candidate stays kept asconsumer-scan-unavailable. After review, a consumer whose name does not survive UTF-8 decoding also returns null, because its literal pathspec would match nothing and the data it names would be excluded instead of kept.Why
harness-evals #274 and #276 were refused by
readyafter policy PR #278 merged (recorded=5ae7e95a07b5 expected=323c17cf6249) though neither PR touches a pattern. On #269 the whole-tree grep took 278 s against its 120 s limit and kept all 4,354 files (30 MB), which put the PR over every reviewer and carry cap. Now those receipts bind, and the scan's cost follows the code a results PR can be read by rather than the data it adds.Proof
the #274 shapetest was red on main (RECEIPT_INVALID field=review_exclude) and is green here;the consumer scan greps only consumer fileswas red on main (git grep got no pathspecs) and is green here. The review fix's test (a consumer whose name is not valid UTF-8 keeps the candidates) was red at 99946df and is green at 5c7b0ef.reviewExcludeat the head, 4-core Capy machine:results/**, 6,500 results files, 27.7 MB diff,gstack-review-dispatch pass --base main --voices -- --gate-tagged 0(targeted reader in the voices stage)git diff <diff-base> -- . ':(top,exclude,glob)results/**'The remaining growth comes from the per-candidate steps (pattern count, blob sniffing), not from the scan reading the data.
Blast radius
excludeMismatchonly accepts more receipts, exactly thosecarryExcludeBindsalready accepts at carry; its one caller isbindShippedReceipt(lib/ship-receipt-depth.ts:444), which refuses an unreadable policy before it gets there (file:line read, and the red-team reader traced it). The scan change affects which files git grep reads, not which references count, because the consumer filter only looks at paths (script ran: the focused file passes 36 of 36). One existing GST-1408 test asserted the old refusal of an older digest; it is replaced by the #274-shape test plus refusal cases for a PR file in either selection and an unreadable policy.Approvals
No approvals recorded for branch capy/gst-1434-review-exclude-ready-scan.
Summary
Results PRs in harness-evals hit two walls in the merge checks:
readyrefused receipts after an unrelatedreview_exclude_pathsedit on main, and the review_exclude name scan timed out on large result sets and kept every file. The queue now uses carry's rule for a policy change that touches none of the PR's files, and the scan reads only code and tests. Review added one fail-closed guard for file names git cannot hand back through a literal pathspec, and the docs audit corrected the matching paragraph in docs/troubleshooting.md.Test Coverage
All new code paths have test coverage. Coverage: deterministic (each of 4 changed runtime files has a changed test naming it; no audit reader).
Tests ran: free 1590 (files, carried from CI run 42046075541/1 at 99946df; the final head's run is carried in accept)
Pre-Landing Review
Pass 1 (full panel: batched specialist, red team, targeted, Claude adversarial, outside voice on openai/gpt-6.1-sol): one blocking finding, found by the outside voice and confirmed by the adversarial reader.
grepFixeddecoded the tree listing as UTF-8, so a consumer with a non-UTF-8 name became a pathspec that matched nothing and the data it names was excluded instead of kept. Fixed in 5c7b0ef with a failing-first test. Pass 2 (full on the range): no blocking findings.REVIEW_LOOP: passes=2 blocking_found=1 deferred=0 noted=1 fixed=1 scope=frozen unbound=1 ledgers_read=3 dispatches=4
(unbound=1 is the fix commit's second Review-Finding trailer,
p1/adversarial-native#1, which the judge folded intop1/outside-voice#1as a duplicate.)Gate edits: none detected (3 listed, 2 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: completed (openai/gpt-6.1-sol, host subagent); its one finding is fixed.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
lib/review-exclude.ts:256timeout: each chunk keeps the 120 s git timeout, but the scan has no overall limit, so a very large code tree could outlast its caller's timeout before any chunk times out.docs/ship-policy.md:1429docs: with no head, the scan lists the index throughls-filesrather than a tree, and untracked files are not grepped (unchanged from main).lib/review-exclude.ts:261testing: one non-UTF-8 consumer name anywhere in the tree makes the scan keep every candidate for that repo, with no line naming the cause. It fails safe; a REVIEW_EXCLUDE note naming the file would make the cause visible.core.precomposeUnicode=true, a consumer stored under a decomposed (NFD) name might not match its literal pathspec. Not reproducible on Linux.Exploratory QA
Status: pass (smoke, 4 probes at 5c7b0ef, functional surface: the ship-queue receipt binding and the review_exclude name scan, through the repository's focused tests; the 3-probe run at 99946df is superseded by this one after the review fix).
Limits: smoke only; no plan checks are bound to this branch.
Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Review bot comments
No review bot comments.
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). Fix: add "Plan: " to the PR body, or run /autoplan.
Issues
Refs #269
Refs #274
Refs #276
Refs #278
Refs #4030
Refs p1/adversarial-native#1
Refs p1/outside-voice#1
Verification Results
No Step 8.1 obligations (no plan is bound to this branch).
TODOS
No TODO items completed in this PR.
Documentation
Status: updated. One stale paragraph in
docs/troubleshooting.mdwas corrected.Scope: the diff from base 467be16 to head 5c7b0ef plus the unstaged changelog fragment. That covers the review-exclude name scan (GST-1435) and the queue's
readycheck, which now follows carry's rule (GST-1434). I audited the authored docs that namereview_exclude, the receipt, carry and the queue.Documentation health:
docs/ship-policy.md: current. It already documents the consumer-only name scan, chunked literal pathspecs and the shared carry-and-queue exception.docs/troubleshooting.md: updated. Thefield=review_excludenote said the queue skips onlyrecorded=nonereceipts. It now says the queue binds any differing digest when neither selection holds a PR file.docs/review-policy.md: current.changelog.d/capy-gst-1434-review-exclude-ready-scan.md: reviewed only. It matches the behavior.Coverage debt: none. Both changes are covered in reference form in ship-policy and troubleshooting. No diagram drift.
Test plan
🤖 Generated with Claude Code