Repository navigation
v1.94.37.0 feat(ci): pull requests reuse a green Free Tests run they can't control (GSTA-258 L4 plan E) - #3930
Merged
Merged
Conversation
…ol (GSTA-258 L4, plan E) A pull_request run of free-tests.yml reuses a green push or dispatch run on main, or a dispatch run on its own branch, at the merge commit's exact tree, only when the merge commit leaves the workflow, scripts/ci-tree-reuse.ts and lib/run-evidence.ts byte-identical to main. A pull_request run is never a source. Opt-in per workflow with find --pull-request; windows-free-tests.yml is unchanged. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…experiments are never evidence; a re-run never reuses) Review-Finding: p1/specialist-batched#1 reader=security Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/red-team#2 reader=red-team 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>
docs/pregate.md keeps the ci-reuse-pr subsection and main's Owner-granted flaky exception section (#3911), in that order. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
lib/run-evidence.ts keeps #3929's skipped_files, job_skipped, skipped and skipped_jobs evidence and its verifyRun unchanged option next to #3930's sizing_experiment field and refusal and the ignoreRun option. docs/pregate.md run_profiles row keeps #3930's wording and adds skippable?. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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
scripts/ci-tree-reuse.ts find --pull-request,findPrReuse). A source is a greenpushorworkflow_dispatchrun on main, or aworkflow_dispatchrun on the pull request's own branch. It counts only when its tested tree is GitHub's merge commit's tree and the merge commit leaves.github/workflows/free-tests.yml,scripts/ci-tree-reuse.tsandlib/run-evidence.tsbyte-identical to its main parent. Apull_requestrun is never a source.reusejob also runs onpull_requestand passes--pull-request. The aggregate's route step accepts a reuse onpull_requestruns ofrefs/pull/<n>/mergeas well as main pushes. windows-free-tests.yml is unchanged.reusejob checks out the base commit (github.event.pull_request.base.sha), never the merge commit, and runs bun with--no-env-file --config=/dev/null. The script, everything it imports and.gstack/pregate.jsonare main's bytes.free_runner,free_shardsorfree_jobsrecordssizing_experiment: trueintested-tree, andverifyRunrefuses it for every consumer (PR reuse, main-push reuse, CI-carry,--from-run).rerun), so a red earlier attempt of the same pull request run can't be hidden.verifyRuntakesignoreRun, so the pull request's own in-progress run doesn't veto a branch dispatch at the same head.ApiRungains the optionalhead_branch.pull_requestrun, for a push or dispatch on another branch, for a fork head and for a malformed merge commit. test/ci-reuse-workflow-wiring.test.ts changes only to state the narrower property, and the route step now passes apull_requestreuse on free-tests.yml and still fails one on windows-free-tests.yml.Why
Plan E in plans/ship-90-90.md: a lane dispatches Free Tests on its branch for CI-carry, and the
pull_requestrun at the same tree then runs the whole suite again. Today only a push to main consumes, because a pull request mustn't certify itself (GST-1190's bootstrap rule: head policy never certifies itself). This keeps that rule. Every source is a run the pull request can't change, and the rules that decide the reuse (the workflow, the reuse script and the verifier) must be main's bytes.Security call-out (R45)
This edits a required workflow,
.github/workflows/free-tests.yml. Thereusejob now runs onpull_requestwith the job-levelactions: readit already had for main pushes; every other job keepscontents: read. It reads this repository's runs, commits and file blobs through the GitHub API withGITHUB_TOKEN(gh api), and downloads a source run'stested-treeartifact as before. No secrets, nopull_request_target, no new dependency, and no install or setup change. A fork pull request is refused before any read. A pull request that edits the workflow, the reuse script orlib/run-evidence.tsnever reuses, so it can't change what reuse accepts in its own run. That guard trusts the workflow file itself. A pull request that rewrites the workflow'sfindstep could fake its outputs and skip the suite, just as any workflow edit could skip jobs before this change, so a change to.github/workflows/still needs a person's review.Pre-Landing Review
REVIEW_LOOP: passes=2 blocking_found=3 deferred=0 noted=1 fixed=3 scope=frozen ledgers_read=3 fix_checks=1 dispatches=4
Pass 1 (gate class, full) raised three findings, each one a way to turn the required check green without a valid run. I raised them to CRITICAL and fixed them in 284bd91 with failing-first tests. The PR run executed its own copy of the reuse code, a sizing-experiment dispatch could be the source, and a re-run hid its own red earlier attempt. Pass 2 and Step 11's adversarial and outside voices found only the notes below. docs/pregate.md counts as a behavior input, so its docs-audit edits sent finish back to Step 9. The review plan at 567cc96 said done (round cap reached, below-floor fixes ship as notes), so no reader ran again.
Review-loop exception: accepted by GStack Minder 2026-11-03 via GSTA-36's call relayed by GSTA-258, 2026-11-03 (approval a-daba080eb8aa): L4's clean Opus reader of the 83-line resolution at 73f1fd6 (the lib/run-evidence.ts and docs/pregate.md union hunks) counts as #3930's second exception, no further rounds (fix-check at 73f1fd6, 0 findings)
Review-loop exception: accepted by GStack Minder 2026-11-03 via GSTA-36's call relayed by GSTA-258, 2026-11-03 (approval a-8bf00b828253): third, last exception on #3930: the one-line head_branch dedupe in ApiRun at 97784ce (rule 19 merge of main ade35bc, keeping #3934's copy); one clean Opus scoped reader confirmed only that field moved, no further rounds (fix-check at 97784ce, 0 findings)
Base merges (rule 19)
Main bf2bcf1 (merge b9a4287). docs/pregate.md keeps this PR's
#ci-reuse-prsubsection and v1.94.9.0 feat(pregate): owner-granted flaky exception for named cases in a red run (GST-1096) #3911's flaky-exception section, in that order. The +/- lines didn't change, so the receipt carried after one scoped reader checked the moved context.Main 2f9d11a (merge 73f1fd6). v1.94.17.0 ci-carry: guard carry, jobs-mapped lanes, aliases, per-file carry of runner-skipped files, path-skipped jobs (GST-1186, GST-1189, GST-1190) #3929's ci-carry work conflicted with this PR's own lines. Each resolution keeps both sides:
TreeRecordhassizing_experimentandskipped_files, the refusal union hasjob_skippedandsizing_experiment, andverifyRuntakesignoreRunandunchanged.run_profilesrow keeps this wording and addsskippable?.v1.94.17.0 ci-carry: guard carry, jobs-mapped lanes, aliases, per-file carry of runner-skipped files, path-skipped jobs (GST-1186, GST-1189, GST-1190) #3929's skipped-job path only applies to pull_request runs, and
findPrReuseonly takes push or dispatch runs as sources, so a pull request still can't reuse a run whose jobs were skipped. One granted fix-check read the 83-linegit show --ccand found nothing (exception below the review line).Main ade35bc (merge 97784ce). v1.94.26.0 gstack-evidence: sum sharded bun lanes; docs: dispatch-carry warning and record-ci recheck order (GSTA-258 L6 follow-up) #3934 (7caca33) added the same
head_branch?: string | nullfield toApiRun, on the repository line, so the textual merge left two copies and typecheck failed in train 104 (Free Tests run 41667341486). The merge drops this PR's copy and keeps v1.94.26.0 gstack-evidence: sum sharded bun lanes; docs: dispatch-carry warning and record-ci recheck order (GSTA-258 L6 follow-up) #3934's; the type is unchanged. One Opus reader confirmed only that field moved and found nothing (the third exception, above).Open review notes (below the blocking floor, not fixed)
sizing_experimentfield, soverifyRunaccepts it untilmax_age_hours(24) expires it. Don't use a sizing dispatch from that window as evidence.windows_jobsset still uploads an acceptedtested-tree. Windows Free Tests is nightly and manual and never a PR obligation; the fix isSIZING_OVERRIDE: ${{ inputs.windows_jobs }}in a follow-up.base.shacan lag the merge commit's main parent. The reuse job runs main's code frompull_request.base.sha, and the guard compares against the merge commit's first parent. While main moves under an open PR, a newer tightening of the reuse code wouldn't apply to that PR until its next push. The code that runs is still main's.Documentation
Documentation exception: accepted by GSTA-258 (2026-11-03) 2026-11-03 via GSTA-258 message to L4 (Subagent 13), same call as #3904, #3920 and #3923: re-audit launch failed on a missing candidate; both stale statements from audit 1 fixed in 81d54d3 and 567cc96
Audit 1 (read-only) found two stale statements in docs/pregate.md: the
reusejob "runs only on a push to main", and "only a push to main reuses". Both are fixed, in 81d54d3 and 567cc96. The re-audit launch failed on a missing candidate file, which spent the audit budget. No known doc gap remains.Sibling merges (rule 25)
Trial merges at 97784ce against trains 105 and 106 (#3920, #3947, #3958, #3933, #3917, #3937, #3955, #3926 and #3931) are clean, and
bun run typecheckexits 0 on each merged tree. #3957 conflicts in test/fixtures/skill-md-size-allowlist.json, a file this PR doesn't touch; #3957 conflicts with main ade35bc the same way.Blast radius
Free Tests on pull requests. A refusal or any lookup failure runs every job exactly as before. A reused pull request run uploads no
tested-tree, so CI-carry and the post-merge main push read the source run directly or run in full.Refs GST-1136 (plan E follow-up to #3926). Independent of #3926: the two PRs share no file.
Approvals
Approved: yes (record r-e6470791e898). The full approval record stays private: this repository is public or its visibility is unknown.