Repository navigation
Review leaves out copied open-source files that match their upstream byte for byte (GST-3298) - #4665
Merged
Merged
Conversation
…ins (work in progress, GST-3298) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…byte for byte (GST-3298) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…till changes, and checks nothing when a pattern hides the manifest A file the merge base's manifest pins now verifies at that pin only when the range deletes it. When a review_exclude_paths pattern matches a manifest, no file counts as verified, so readers see every file it pins. Review-Finding: p1/specialist-batched#1 reader=specialist-batched Review-Finding: p1/specialist-batched#2 reader=specialist-batched Review-Finding: p1/red-team#1 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… keeps its vendored count Vendored files count as code when review looks for files that name excluded content, so every file that is not vendored keeps the selection it had on main. The plan's JSON now carries the vendored check under vendored_selection, so the numeric count reaches the reviewers' disclosure line. Review-Finding: s11/outside-voice#1 reader=outside-voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…3298) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
4 tasks done
capy-ai Bot
added a commit
that referenced
this pull request
Nov 22, 2026
… bytes (GST-3298) (#4690) A branch that replaces your own file, or drops a local patch, so the file now matches an upstream copy byte for byte no longer leaves review: a changed file counts as vendored only if it was already vendored and verified at the merge base, or is new on the branch. This closes the gap the second-model review of #4665 found, so readers always see your own lines leave. Nothing to do for repos without `review_vendored`, which is every repo today. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: p1/outside-voice#1 reader=outside-voice Review-Finding: p1/outside-voice#2 reader=outside-voice Review-Finding: p1/red-team#1 reader=red-team
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.
Files a repo copies unchanged from an allowlisted open-source project, and that gstack verifies byte for byte against the pinned upstream commit, can now be left out of
/ship's review underreview_exclude_paths.Why: verified upstream code doesn't need a reviewer, so its bytes no longer count toward the 2 MB reader limit, while every other keep rule still applies.
Nothing to do for repos without
review_vendored: their review selection is unchanged (216 of 216 replayed commits identical).What changed
Repos that copy whole open-source test suites hit the 2 MB reader limit, because review had to read every copied file as if the repo had written it. Now a file that a
review_exclude_pathspattern matches, and thatreview_vendoredverifies byte for byte against an allowlisted upstream at the pinned commit, counts as vendored content and can leave the reviewers' diff..github/and.gstack/, gate paths, credential lines and gate tags still keep a file. A gate-tagged upstream test file stays in review whole.REVIEW_VENDORED: unavailable.gstack-review-planfetches the upstreams and prints what verified and what didn't. The review dispatch and the final ship check read the same cache without the network, and the verified list is part of the selection the final ship check binds.gstack-vendored-verify, which also stops trusting a cached copy of an upstream branch that was deleted.Blast radius
The change is inside
reviewExcludeand only runs when the base branch declaresreview_vendored; gstack itself does not, and the no-loss replay over 216 first-parent commits in gstack, harness-evals and gstack-evals produced identical selections (replay fixture read and test run). The plan's JSON now carries the vendored check asvendored_selection; its only readers are the review dispatch, which reads the numeric count, and this PR's tests (callers read).What this does not fix
harness-evals#504 still goes over the 2 MB reader limit: 161 gate-tagged upstream test files (5.83 MB, mostly skip markers) stay in review whole by design (5 more gate-tagged files, pyproject.toml, are shown as excerpts), so that PR needs a separate change.
Known limit
A machine whose vendored cache is empty verifies nothing, so the final ship check there refuses until
gstack-vendored-verify --base <base>fills it.Pre-Landing Review
This commit got one final full review with no fix round, because the PR had already been through two review rounds. The targeted reader for the gate path found nothing, and the second-model review completed. Seven findings were raised at blocking severity; none of them fails a test, breaks production or loses data or secrets. Each one either refuses to run instead of running wrongly, or says something wrong in a message, and only in repos that set
review_vendored(none does today). Each is listed under Agent notes as a ruled note, and a follow-up PR closes them. Two missing tests are ruled notes too.Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
sf-73eeaff8b633security finding, details recorded privatelysf-949e084a49a4security finding, details recorded privatelylib/review-vendored.ts:119The head's manifest chooses local and upstream prefixes, so verified upstream files such as conftest.py can land in directories where they run; a trust-model question.Exploratory QA
Two command-line checks on owned local fixtures passed:
gstack-review-plan --base mainon gstack itself (noreview_vendored) exits 0 and prints no vendored lines, and a vendored file one byte off its pin stays in review as code and is named asREVIEW_VENDORED_KEPT. The live fetch from real upstreams, a machine with an empty cache and lock timeouts were not probed.Documentation
Scope: a read-only audit of
review-skips-verified-vendored-filesagainstmain(head 184a50a), covering committed changes plus a check for staged, unstaged and new files (none found). It read the branch's doc edits (docs/vendored-code.md, docs/ship-policy.md, the changelog.d fragment) and searched the repository for related or stale mentions ofreview_vendoredandREVIEW_VENDORED. Result: current. The new "What review leaves out" section and the updatedreview_vendoredpolicy row match the code in lib/review-vendored.ts, lib/review-exclude.ts and bin/gstack-review-plan. The old "a later release lets" wording is gone, and docs/troubleshooting.md is still accurate. Debt: none found.Tests
bun run test(CI, free-tests run 44987722587 at this commit): 1,741 files passedbun test test/review-exclude-vendored.test.ts -t 'one changed byte': 1 pass, 0 failbun run typecheck: no errors (push guards at this commit)Agent notes
Approvals
Approved: yes (record r-d26f0a64ecf9). The full approval record stays private.
Plan: approved (record r-c8f31452adaa)
Plan check: approved (record r-c8f31452adaa)
REVIEW_LOOP: passes=1 blocking_found=7 deferred=2 noted=3 fixed=0 scope=frozen open=5 dispatches=4
Gate edits: none detected (2 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Ruled note: lib/review-vendored.ts:319:outside-voice at 184a50a ruled by GSTA-36 (relayed from GSTA-674:2026-11-22T05:34:03.313Z) at 2026-11-22T05:34:16.680Z: A modified vendored file is checked only at the head, so restoring a locally patched file to its upstream bytes leaves review; only in repos that set review_vendored, and PR 3 closes it (approval a-b13086df6a82)
Ruled note: bin/gstack-review-plan:250:outside-voice at 184a50a ruled by GSTA-36 (relayed from GSTA-674:2026-11-22T05:34:03.313Z) at 2026-11-22T05:34:16.991Z: Each plan run fetches the upstreams again inside the 180 s plan limit, so a stalled upstream stops the pass; it fails closed and only in repos that set review_vendored (approval a-03d29e662e66)
Ruled note: lib/review-exclude.ts:524:adversarial at 184a50a ruled by GSTA-36 (relayed from GSTA-674:2026-11-22T05:34:03.313Z) at 2026-11-22T05:34:17.146Z: The keep-too-large refusal points at lines the plan does not print on a refusal and can overcount unverified vendored files; wrong wording only, fixed in PR 3 (approval a-465e2a55663a)
Ruled note: lib/review-exclude.ts:592:adversarial at 184a50a ruled by GSTA-36 (relayed from GSTA-674:2026-11-22T05:34:03.313Z) at 2026-11-22T05:34:17.302Z: The reviewer disclosure says the manifest is in the diff even when it is unchanged; wrong wording only, fixed in PR 3 (approval a-1f8f70cbcd04)
Ruled note: lib/review-vendored.ts:326:outside-voice at 184a50a ruled by GSTA-36 (relayed from GSTA-674:2026-11-22T05:34:03.313Z) at 2026-11-22T05:34:26.310Z: gstack-vendored-verify warms only the head's pins, so land on a clean machine refuses a re-pin with deletions; fails closed, only in repos that set review_vendored (approval a-34e2ec714f5c)
Ruled note: lib/ship-receipt-depth.ts:470:adversarial at 184a50a ruled by GSTA-36 (relayed from GSTA-674:2026-11-22T05:36:38.150Z) at 2026-11-22T05:36:38.437Z: Land checks the selection against its own cache; an empty cache refuses with the wrong fix. Fails closed, code this PR did not change (approval a-d7269d3b7710)
Ruled note: lib/review-vendored.ts:201:adversarial at 184a50a ruled by GSTA-36 (relayed from GSTA-674:2026-11-22T05:36:38.150Z) at 2026-11-22T05:36:38.558Z: A failed fetch overwrites good cached pins, so a later offline step refuses. Fails closed, code this PR did not change (approval a-56c03033262e)
Ruled note: lib/review-vendored.ts:207:testing at 184a50a ruled by GSTA-36 (relayed from GSTA-674:2026-11-22T05:36:38.150Z) at 2026-11-22T05:36:38.652Z: Test gap: no test for dropping a cached branch ref after the upstream deletes the branch (approval a-d325179948a4)
Ruled note: lib/review-vendored.ts:330:testing at 184a50a ruled by GSTA-36 (relayed from GSTA-674:2026-11-22T05:36:38.150Z) at 2026-11-22T05:36:38.741Z: Test gap: no test that a working-tree edit to a vendored file keeps it in review (approval a-128876ba6d96)