Repository navigation
/ship reruns the test gate when its record was taken against a different base branch (GST-3493) - #4706
Merged
Conversation
…ent base branch (GST-3493) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
Review-Finding: p1/specialist-batched#2 reader=testing Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… another base clear checks the recorded head against the base, so a detached checkout is covered too. Review-Finding: p1/outside-voice#1 reader=outside-voice Review-Finding: p1/specialist-batched#1 reader=security Review-Finding: p1/adversarial-native#1 reader=adversarial-native Review-Finding: p1/outside-voice#2 reader=outside-voice 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>
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 no longer accepts a test-gate record taken against a different base branch: it reruns the gate against the base it ships to.
Why: a record cleared while a pull request was stacked on another branch still verified after the pull request was retargeted at main with the same code, though it used the other branch's policy and CI run profiles.
Nothing to do.
What changed
gstack-pregate verify --base <branch>refuses a record whose base names another branch (PREGATE_STALE). Without--baseit behaves as before, and a record with no base still verifies.gstack-ship-queue readyand the step that writes /ship's sign-off record for the final head make the same check, so a stale record can't reach the merge queue or the sign-off either.gstack-pregate clearrefuses a base that already contains the recorded head (BASE_CONTAINS_HEAD), on a branch or a detached checkout, before it reads that base's policy.docs/pregate.mdanddocs/troubleshooting.mddescribe the new refusal and its fix.Why
GST-3381 (#4689) found that a test-gate record taken while a pull request was stacked on another branch kept verifying after the pull request moved to main. That record's checks used the stacked branch's policy and CI run profiles, so the merge checks could pass on evidence gathered for a different base.
Blast radius
Only the test-gate record's verify and clear paths in
bin/gstack-pregateandlib/pregate/index.ts, and the three callers that now pass a base (/ship's finish step, the merge-queue check and the sign-off writer). A record whose base matches, or that names no base, verifies exactly as before; the only new outcome is a refusal that sends /ship back to rerun the gate.Tests
test/pregate-verify-base.test.ts(new): a record cleared under a stacked base verifies with--base stackand is refused with--base main; a record with no base still verifies under--base;clearrefuses once the stacked base holds the head, on a branch or detached, and leaves the record uncleared.test/ship-release.test.ts: finish passesverify okon a matching record and reruns the gate once the record's base names another branch.test/ship-queue-ready-pr-base.test.ts:readyrefuses a record from another base.Each new case fails without its fix. CI's full free suite passed at this tree (run 45030602055).
Agent notes
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
sf-4bb7a4340685security finding, details recorded privatelysf-79029a8012b0security finding, details recorded privatelysf-27544975cb81security finding, details recorded privatelybin/gstack-ship-receipt:586no test covers the base comparison in receipt write and carry; carry without --base skips itsf-632487ab67easecurity finding, details recorded privatelysf-bf570b47ca0bsecurity finding, details recorded privatelyGST-3493, follow-up to GST-3381 (#4689), ruled ship-as-note by GSTA-36 on finding outside-voice#2, with the clear-side BASE_CONTAINS_HEAD scope added from #4689's cross-family trail read. Round 1's second-model review raised two blockers (ready and receipt write still accepted a record from another base; the clear guard read HEAD, which is null on a detached checkout); both are fixed in ce77277. Round 2 found no blockers. Evals: none affected (no prompt, template or judge change).
Documentation (Step 14.5 audit docs-4706a-1, inserted unchanged):
Scope. The audit covered the committed diff from main (f528f5b) to the head (91efe35). The working tree was clean. The diff adds
gstack-pregate verify --base, which refuses a test-gate record taken against another base branch. It also makesgstack-pregate clearrefuse withBASE_CONTAINS_HEAD, and makesgstack-ship-receiptandgstack-ship-queue readycheck the base. The changelog.d fragment already describes the change.Result. Two docs were updated with small additions:
docs/pregate.md:verify --base <branch>now refuses a record taken against another base branch (PREGATE_STALE).docs/troubleshooting.md: thePREGATE_STALEentry now explains the base-mismatch cause and its fix (rerungstack-pregate --base <real base>). TheBASE_CONTAINS_HEADentry now says thatgstack-pregate clearrefuses even on a detached checkout.Debt. None found. CHANGELOG.md, TODOS.md and VERSION were not touched, and no generated files changed.
Approvals
Plan: exempt: bug fix (merge-check correctness, GST-3493)