Repository navigation
Local checks reuse every green CI run at your code, not only the first (GST-3381) - #4671
Merged
Merged
Conversation
…rst (GST-3381) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ile (GST-3381) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…e (GST-3381) CI's free suite refused shard 9 because the test wrote ~/.gstack/security/egress.jsonl in the runner's real home. The test now points GSTACK_STATE_ROOT at the fixture's home, as pregate-from-run.test.ts does. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…docs say a two-profile gate is refused (GST-3381) 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.
Local checks before opening a PR now reuse the newest verified CI run per eligible profile at your exact code, so files an end-to-end run already passed beside the test run no longer run again on your machine.
Before, only the first matching profile's run counted; a failed run, a run of different code, or a run that changes while it is being read still counts for nothing.
Nothing to do: this changes what runs locally, not what CI runs.
What changed
Agent notes
Agent notes
Files
lib/pregate/index.ts: the CI carry keeps every run profile that verified at HEAD's tree (ctx.fromRun.runs) instead of stopping at the first; the remote-gate clear uses the run under the gate's profile.lib/pregate/checks/lanes.ts:fromRunverifies each kept run under its own profile and unions theirtree.jsonfiles.lib/pregate/types.ts,docs/pregate.md,changelog.d/fragment,test/pregate-ci-carry-profiles.test.ts. Commit 14c3760 points the test's state root at its fixture home, so it no longer writes the runner's real~/.gstack/security/egress.jsonl(CI's free suite refused shard 9 for that at 92dc2e9).fromRunrereads every kept run withrunChangedonce the union is built, asfindCarrydoes, and refuses the reuse on any change;docs/pregate.mdsays aremote_gate_runsnaming two profiles is refused by the carry; a new case flips the Test run to a red attempt while the E2E run is read. One scoped fix-check on 14c3760..860fe60: clean, one informational note (the reread runs only when two or more runs verified;lib/pregate/checks/lanes.ts:745).Pre-Landing Review
Pre-Landing Review: 13 issues — 0 auto-fixed, 0 asked, 1 deferred, 7 noted, 4 skipped (informational, below the blocking floor), 1 ruled note
Gate edits: none detected (GATE_SCAN tagged=0 at 14c3760)
Scope Check: CLEAN
Coverage: 7/9 paths (78%); gaps: which carried run feeds the gate clear, and the skipped count across runs
Exploratory QA: no server or browser surface; smoke covered by the targeted test lane (494 tests) including the red-run and other-tree negative controls
Pass 1 (full panel plus second-model review) raised the findings below; pass 2 read the test-only fix range and found nothing.
Deferred findings
Blocking findings in code this PR did not change (review scope: frozen). They stay on this PR and are not filed as issues.
lib/pregate/index.ts:1361. Multi-profile remote gates never auto-clear.lib/pregate/index.ts:136passes onlyctx.fromRun.reftoclearByRuns, which requires exactly one distinct run perremote_gate_runsprofile. If two declared runs are green and jointly cover the gate inventory, but a gate-only file leaves a remote obligation, pregate still refuses withgot 1. Small-machine shipping stays blocked until someone clears the gate manually. Pass the verified runs for the configured gate profiles toclearByRuns. Severity: High. Blocks: yes.Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
lib/pregate/checks/lanes.ts:7471. Duplicate run in the receipt (lib/pregate/checks/lanes.ts:747). Say two base profiles share a workflow and OS but list different jobs. They can resolve to the same run id, and then the receipt showsruns=123/1,123/1and countstests=twice. The union of files is still correct; only the receipt number is wrong. Fix: dedupeokbyrun_id/run_attemptbefore summing and before callingrunReceiptFields. FIXABLE. Severity: Low. Blocks: no.lib/pregate/index.ts:1362. Remote gate gets one run even though all runs are now known (lib/pregate/index.ts:136, with :87).carryGatestill passes only[ctx.fromRun.ref]toclearByRuns. So a base whoseremote_gate_runsnames two profiles is always refused with "exactly 2 run(s)", even thoughctx.fromRun.runsnow holds both verified runs. This existed before the change, but the change makes it a one-line fix: passruns.filter(r => gateRuns.profiles.includes(r.profile)).map(r => r.ref). FIXABLE. Severity: Low. Blocks: no.lib/pregate/index.ts:883. CI_CARRY line can list a run that REUSE later drops (lib/pregate/index.ts:88 against lanes.ts:740–742).autoCarryprintsCI_CARRY: accepted A + BfromfindCarry. ThenfromRunverifies again and silently drops any run that fails (for example a docs-only run with no files). The REUSE line shows the true smaller set, but the CI_CARRY line pasted into READY claims more than was used. FIXABLE. Severity: Low. Blocks: no.lib/pregate/checks/lanes.ts:7424. Refusal reason comes from the first run only (lib/pregate/checks/lanes.ts:742). When every run fails re-verification, the REUSE refusal names only the first profile's reason, which hides the others. Fix: join every refused verdict, asverifyFromRundoes. FIXABLE. Severity: Low. Blocks: no.lib/ship-release.ts:7405. Long CI_CARRY line gets truncated (lib/ship-release.ts:738–740). A line with several receipts joined by+is clipped to 240 characters there, so the second receipt can be cut off in release output. Display only. FIXABLE. Severity: Low. Blocks: no.lib/pregate/index.ts:806. More GitHub API calls per pregate (lib/pregate/index.ts:80).autoCarryused to stop at the first accepted profile. It now runsfindCarryand thenverifyFromRunfor every matching profile, which adds run and artifact reads against the shared 7,900-per-hour budget. This only matters on repositories with several same-OS profiles. INVESTIGATE (is the extra coverage worth the calls?). Severity: Low. Blocks: no.Skipped (informational, below the floor)
docs/pregate.mdsays the carried runs clear the remote gate, butcarryGatepasses one run (lib/pregate/index.ts:136).fromRun.ref, and the skipped count when another run ran the file.tests=(lib/pregate/checks/lanes.ts:746).CI_CARRY: accepted A + Bcan name a run that the later re-verification drops without saying why (lib/pregate/checks/lanes.ts:742).Documentation
Status: current. The docs already match the change, so no edits were made and nothing blocks.
Scope: candidate base c2b4f0d2 to head 860fe60, 6 committed files (lib/pregate/{index,types,checks/lanes}.ts, a new test, docs/pregate.md and a changelog.d fragment). Nothing was staged, unstaged or untracked. Every Markdown and template file was searched for the changed output formats (
CI_CARRY: accepted,REUSE: accepted).Documentation health:
CI_CARRY: accepted <receipt> + <receipt>…format, and the refusal of aremote_gate_runsthat names two profiles. The--from-runreceipt format (runs=<id>/<attempt>) still holds.Coverage debt: the behaviour change has reference coverage (docs/pregate.md) and an explanation of why a red run or a run on another tree adds nothing. No tutorial covers it, which is acceptable for an internal gate flag. No critical gaps.
Diagram drift: none. No diagrams reference the changed modules.
Tests
bun test test/pregate-*.test.ts(40 files): 494 tests passed at 14c3760pregate-ci-carry-profiles,pregate-from-run,pregate-carry-gate,pregate-remote-gate-runs) pass, 15 tests; the full 40-file run hit unrelated 5 s timeouts on a slow machine (each passed on one rerun)Approvals
Approved: yes (record r-6fe014209a01). The full approval record stays private.
Plan: exempt: bug fix with a failing-first test (GST-3381)
Plan check: exempt bug fix
Ruled note: lib/pregate/checks/lanes.ts:744:correctness at 92dc2e9 ruled by GStack Minder (relayed from GSTA-36:2026-11-22T05:25:48Z) at 2026-11-22T05:42:33.064Z: same verify-then-use window as the single-run path; below the blocking floor (approval a-8f868ce8a09b)
Review-loop exception: accepted by GSTA-36 2026-11-22 via GStack Minder grant relayed by the #4671 lane (approval a-9f7bcc32d32c): Match findCarry's documented reread-after-collect contract and correct the docs; scoped read only. (fix-check at 14c3760, 1 finding)
Gate edits: none detected (GATE_SCAN tagged=0 at 14c3760)