Repository navigation
v1.92.39.0 ci: main pushes reuse the merged PR's verified run of the same tree; dispatch-ci and --from-run go through the run verifier (GSTA-156 P3b) - #3709
Merged
Conversation
…n verifier, --from-run tests stage (GSTA-156 P3b) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…run of the same tree (GSTA-156 P3b) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…tion on its strict path, and only a verified reuse skips it (GSTA-156 P3b) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…nd ready --dispatch-ci keep the URL path until GST-555 (GSTA-156 P3b) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ee-tests call, and --from-run refuses a run that recorded zero tests (GSTA-156 P3b) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…aller grant and zero-test refusal Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
5 tasks done
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # lib/pregate/checks/lanes.ts
6 tasks done
4 of 5 tasks
capy-ai Bot
added a commit
that referenced
this pull request
Nov 2, 2026
…ee-suite flake counts (#3725) (#3822) A main push that reused its merged PR's verified run (#3709) runs no shards and uploads nothing, so both readers counted it as a zero-flake run and diluted real flake rates under the 5% bar. reuseChecker (scripts/lib/ci-history.ts) marks a run with no artifacts and a green reuse job; readCiFlakeLedgers leaves it out and refills the window, readFreeRetries leaves it out of the free-retry count. One capped job listing per artifact-less run (40 per read); past the cap or on a failed listing the run counts as before, with a note. 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
A push to main no longer reruns Free Tests and Windows Free Tests on a tree its pull request already passed. On a main push, a new
reusejob finds the merged pull request, requires its head's tree to equal the pushed tree, and verifies that head's newest greenpull_requestorworkflow_dispatchrun with the same checksgstack-pregate clear --runuses. When the run verifies, every suite job is skipped and the required check links the reused run. Anything else, a failed or skippedreusejob included, runs every job exactly as before.tested-treerecord (tree.json) only after strict verification passes. Reused runs never upload one, so a reused run is never reused.gstack-pregate --stage tests --from-run <run>counts the selected local test files a verified Free Tests run on this exact tree already ran, and runs the rest..gstack/pregate.jsondeclares two run profiles,ci-reuse/free-testsandci-reuse/windows-free-tests. Neither is named after a lane, so macOS and Windows lane clears andgstack-ship-queue ready --dispatch-cikeep recording the run URL exactly as today.lib/ship-queue-dispatch-ci.tsis unchanged from main. This branch first routed dispatch-ci clears through the verifier, but that path would still refuse a lane when the base config or origin couldn't be read, which changes behavior for pull requests already in flight. I reverted it to main and dropped its test. Lane profiles and dispatch-ci verification wait until open pull requests carry thetested-treeproducer. Follow-up: GST-555tree.jsonlists no files or zero tests never counts (no_tests).Why
22 of 22 merges in 30 hours (Oct 27–29) reran both suites on the identical tree, about 66 Linux shard-minutes and 44 Windows minutes per merge. The pull request run already proved that exact tree.
Workflow and permission changes
Every change under
.github/workflows, and why it's needed:free-tests.ymlandwindows-free-tests.yml: newreusejob withpermissions: { contents: read, actions: read }. It runs on main pushes only.actions: readlets it list this repository's workflow runs and download theirtested-treeartifacts. It's the only job in either workflow with that grant, and the workflow-level permission stayscontents: read. Every suite job gainsneeds: reuseand anif:that runs it unless reuse verified a run. The aggregates pick the reuse or strict path in their first step, and the strict path is unchanged.free-durations-record.yml: thewindows:job (uses: ./.github/workflows/windows-free-tests.yml) now grantscontents: readandactions: read. A called workflow can't hold more than its caller grants, and the called workflow's newreusejob asks foractions: read. Without this grant GitHub rejects the scheduled duration run before it starts. Nothing else in that file changed. A new test fails if any caller of either workflow drops the grant.scripts/ci-tree-reuse.ts. Thereusestep passesGH_TOKEN: ${{ github.token }}to theghCLI, which makes read-onlygh apiGET calls on this repository's own pull requests, runs and artifacts (at most 10 pull requests and 10 candidate runs). It never writes, never reads another repository, and checkout usespersist-credentials: false.Approvals
Source: gstack-approvals record for capy/gsta156-ci-reuse (display only; not an approval citation).
Summary
Every merge to main ran both free suites twice, once on the pull request and again on the push of the same tree. This makes the main push reuse the pull request's verified run when the trees match, and fall back to the full run on any doubt. The same verifier lets
gstack-pregate --from-runskip local files a verified run already passed.Blast radius
The change touches the two required free-suite workflows, the duration recorder that calls the Windows one, and pregate's tests stage. Pull request and dispatch runs never take the reuse path, and a skipped or failed
reusejob runs every job as before. Evidence:test/ci-reuse-workflow-wiring.test.tsevaluates each suite job's condition for a skipped, failed and successful reuse, and both workflows ran green at ceeab44 on this pull request withreuseskipped.Test Coverage
All new code paths have test coverage:
test/ci-tree-reuse.test.ts,test/ci-reuse-workflow-wiring.test.ts,test/pregate-from-run.test.ts,test/run-evidence.test.ts,test/free-durations-record-workflow.test.tsandtest/cso-distribution.test.ts.test/pregate-from-run.test.ts, the zero-test case intest/run-evidence.test.ts, and the caller-grant check intest/ci-reuse-workflow-wiring.test.ts.Pre-Landing Review
The red team found one blocking issue. Lane-named run profiles would have blocked macOS and Windows lane clears for pull requests already in flight. It was fixed by naming the reuse profiles after no lane and leaving
ready --dispatch-ciunchanged (GST-555). The outside voice found that a run recording zero tests could count as evidence, soverifyFromRunnow refuses it (no_tests). The adversarial pass found that the duration recorder's Windows caller didn't grantactions: read, so the scheduled run would fail at startup. That's fixed with the caller grant above. Both fix-checks found no new issues.REVIEW_LOOP: passes=1 blocking_found=1 deferred=0 noted=4 fixed=1 scope=frozen fix_checks=2 dispatches=4
Gate edits: 29 listed, 13 read, 0 findings — 0 kept, 0 restored, 0 open
Outside review: completed (openai/gpt-6.1-sol); its one blocking finding is fixed.
Review notes
Below the blocking floor; recorded here, not fixed in this PR.
scripts/lib/ci-history.ts:293(adversarial, filed as test:health flake rate counts reused main pushes that ran no shards (after #3709) #3725):test:healthcounts every green main Free Tests run in the flake-rate window. A reused main push runs no shards, so as reuse takes over, the 20-run window holds fewer runs that actually tested anything and real flake rates read lower.lib/factory-scorecard.tshas the same gap. Related: test:health flake rate counts reused main pushes that ran no shards (after #3709) #3725lib/pregate/checks/lanes.ts:525:--from-runwithout--allow-repo-commandsreportsREPO_COMMANDS_NOT_ALLOWEDeven when every selected file passed in the run. It fails closed, and the crew's remote pregate always passes the flag.lib/pregate/checks/lanes.ts:542:--from-runmatches only profiles that hold a local non-platform lane, so on a Mac it does nothing today..github/workflows/free-tests.yml:734: Free Tests'tree.jsonlists Linux, macOS and Windows whilefilesholds only the Linux plan. Nothing reads it that way until GST-555 adds a macOS or Windows profile on this workflow.scripts/ci-tree-reuse.ts:46: fail-safe refusals (the commit-to-PR lookup lagging right after a squash merge, the 24-hour age limit, twotested-treeartifacts after a rerun) will put the reuse hit rate below 22 of 22.Exploratory QA
No user-facing surface changed; the workflow behavior is covered by the wiring tests above.
Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Plan Completion
The plan from autoplan-20261029033528 is done, with one item moved out. Lane-named run profiles and dispatch-ci verification go to GST-555, as the Captain decided.
Issues
Related: #3725
Documentation
Status: updated. Two factual corrections to docs/pregate.md. No blockers.
Scope: branch
capy/gsta156-ci-reuse, basec830c9b8to heade4997003(5 commits, 21 files). The candidate selected only committed changes, and nothing was staged, unstaged or untracked. The candidate lists 140 docs, and I checked all of them for terms the diff touches (run profiles,clear --run,tested-tree,ci-tree-reuse,--from-run,dispatch-ci,free-durations-record,pull_requestruns). I read docs/pregate.md in full, the matching sections of docs/ship-policy.md, docs/troubleshooting.md and docs/TESTING_INTERNALS.md, and the changelog fragment. I checked each claim against scripts/ci-tree-reuse.ts, lib/run-evidence.ts, lib/pregate/checks/lanes.ts, lib/pregate/run-check.ts, bin/gstack-pregate and both workflow diffs. Banned terms: none (the repo keeps no list).Documentation health:
run_profilesrow in the pregate-v1 key table now says--from-runand the main-push reuse job also verify runs against these profiles, with links to #from-run and #ci-reuse. The--from-runrefusal codes now includeno_verified_run, whichverifyFromRunreturns when more than one profile applied and each refused. The new #from-run and #ci-reuse sections already match the code: the 10-PR and 10-run limits, the reason codes, the job permissions, the route step and the producer fields.--dispatch-ciURL recording is still accurate (GST-555 follow-up). The line saying slot checks run live "until GSTA-156's exact-tree reuse is on main" still holds, because this branch reuses runs only on main pushes and train-build reuse is a later GSTA-156 step.PREGATE_RECEIPT_INVALIDandPREGATE_CONFIG_INVALIDstill describeclear --runandrun_profilescorrectly. A--from-runrefusal is not an error code, because it runs every test.Coverage debt:
gstack-pregate --from-run: reference in docs/pregate.md#from-run and in--help; no how-to (common gap).scripts/ci-tree-reuse.ts, thereusejobs, thetested-treeartifact): reference and explanation in docs/pregate.md#ci-reuse; no troubleshooting entry for reading aREUSE: refusedstep summary on main (common gap).ci-reuse/free-testsandci-reuse/windows-free-testsprofiles: reference only (common gap).Diagram drift: none. No diagram names an entity this diff changed.
Test plan
UBI_OWNER=gsta156 gstack-pregate --allow-repo-commands --remote --spend-cap 2 --timeout 2700at ceeab44: 8993 tests, 0 failed on tree 113a4412d3b8, $0.07, VM destroyedgstack-pregate verifyokChangelog:
changelog.d/capy-gsta156-ci-reuse.md.