Repository navigation
v1.91.132.0 feat(pregate): a remote gate for gstack's own pregate (Ubicloud or keyless local shards); concurrent next-version fetches - #3258
Merged
Conversation
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… remote gate (keyed Ubicloud VM, keyless local shards) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… is an unknown claim Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…te row Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
Contributor
E2E Evals: ✅ PASS121 executed, 0 reused rule/judge records | 0 manual accepted (unscored; no score-cache credit) | $93.14 rule/judge cost | reconcile exit: 0 Profile: pr / mode Derived dependents (scripts/pr-dependencies.ts):
Rule and judge shards
Fail-closed reconciliationSliced lane: planner → duration-packed executors → fail-closed report. Behavior cases run a pre-registered 3-trial panel (PASS at 2/3 with no contract violation); a PASS 2/3 is shown with its failed trial, never as a clean pass. Reused results retain their original provenance and expiry. |
…ds reason codes and the keyless backend line Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…: false) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…red keyed/keyless timing Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
pregate kills the remote gate at --timeout with a 5 s grace, which could cut a VM teardown short. pregate-remote.sh now reads the enclosing deadline (PREGATE_TIMEOUT_S, else the gstack-pregate --timeout it runs under, else 600), reserves 120 s for teardown plus 15 s margin, and tells the VM to stop at the earlier of that point and the cap's wall; a deadline that leaves under 300 s refuses before any VM (PREGATE_REMOTE_TIMEOUT_TOO_SHORT). It names the VM up front and prints the exact ubi-runner.sh down line, and the body is one braced block so an edit to the script mid-run cannot change what the run executes (keyed run 5 died after teardown with '$2: unbound variable' for that reason). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
gstack-next-version now returns complete: false with unknown_claims when a PR's VERSION fetch timed out or failed. restamp's claim-at-open path took any usable JSON as 'read'; it now says 'incomplete', names the unknown PRs and calls the version provisional, the same warn-not-refuse stance as the existing 'unverified' fallback. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…adline The ancestor walk matched any command line that mentioned gstack-pregate, so a shell line running pregate beside the tests (bash -c '...; bin/gstack-pregate ...') gave the stub gate a 600 s deadline. It now matches only a process whose program, or the script its interpreter runs, is gstack-pregate. 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>
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.
Fix wave 3, W2-A3 (plan: docs/designs/fix-wave-3-2026-10-17/PLAN.md, gate rev 1 approved by Garry: "rec").
What changes
A remote gate for gstack's own pregate.
.gstack/pregate.jsondeclares"remote_gate": "bash scripts/ubicloud/pregate-remote.sh". On a machine under 8 cores, pregate already turns the local test tier into arequires-remoteobligation when a remote gate is declared (lib/pregate/checks/lanes.ts:207, unchanged here); until now gstack declared none, so a full-fallback lane ran locally and never finished within an hour on 4 cores (GSTA-35: 798 files, >3,550 s).scripts/ubicloud/pregate-remote.sh(new), run bygstack-pregate --stage tests --remote --spend-cap <usd> --allow-repo-commands:PREGATE_TREE(exit 3, "nothing uploaded, nothing spent").UBICLOUD_API_KEY: one VM through ubi-runner with test-free.sh's environment (setup-free-suite.sh, xvfb-run,GSTACK_EXPECT_BINARIES=1, the free retry policy; a parity test pins the two scripts together). The spend cap buys the wall timeout at Ubicloud's list price for the actualUBI_SIZE(at most 45 min); a cap that cannot buy 20 minutes refuses before any VM exists (exit 5). On the VM it recomputes the tree after unpack and checks the planned set's digest before any test runs, reports what setup's build rebuilt, and requires the tests to leave the post-setup tree unchanged. Infra failures exit 4 with the ubi-runner message, VM name, teardown line, log path andspent=; a vCPU-quota refusal gets one retry. Phase timings are logged.spent=0.PREGATE_REMOTE: tree=<tested tree> tests=<n> failed=<n> spent=<usd>, judged in tests through lanes.ts's ownparseRemoteReport/remoteReportProblem.PREGATE_REMOTE_PAID_ONLYandtests=0, which never clears. The keyless path printsbackend=local (N cores; not the CI environment).PREGATE_REMOTE_USAGE,TREE_MISMATCH,TREE_MOVED,VM_TREE,NO_RESULT,PAID_ONLY,CAP_TOO_LOW,NO_PRICE,TIMEOUT_TOO_SHORT,INFRA,INTERRUPTED) and ends withsee docs/pregate.md#remote-gate, where the table lives.--timeoutwith a 5 s grace, so the script reads that deadline (PREGATE_TIMEOUT_S, else thegstack-pregatecommand it runs under: its--timeout, else 600), reserves 120 s for teardown plus 15 s margin, and tells the VM to stop at the earlier of that and the cap's wall. A deadline leaving under 300 s refuses before any VM. At create time it prints the VM name and the exactbash scripts/ubicloud/ubi-runner.sh down <name>line. The script body is one braced block, so editing it mid-run cannot change what runs (a keyed run hit$2: unbound variableafter teardown when the file was edited under it).scripts/test-free-shards.ts --files-from <path>: plans exactly the listed repo-relative files. Unknown paths (first five plus a count), an empty list and malformed or repeated lines are rejected before planning; it conflicts with--quick,--windows-only,--list,--ci-*,--record-durationsand--attribute-home(recording a subset would replace the whole duration seed).Concurrent next-version fetches.
bin/gstack-next-versiondeclaredGH_API_CONCURRENCY = 10but its workers calledspawnSync, so per-PR VERSION fetches ran one at a time (8 PRs at 0.5 s took 4,160 ms). Workers now use asyncspawn, at most 10 in flight, 15 s timeout each; claims and warnings are sorted by PR number. A timeout says so ("claim unknown, the slot may collide"), the JSON gainsunknown_claimsandcomplete: false, and the pick is marked provisional on stdout and stderr; the fork/path hint appears only for HTTP 404. Not changed here (outside this PR's files):lib/restamp.ts:181-186andship/SKILL.md.tmplStep 12 read this JSON and do not yet act oncomplete: false.Receipt: a real Ubicloud run
All 1,280 free test files through the new gate (f235ca9; only two test-line comments changed since):
PREGATE_REMOTE: tree=21752dccc9fa2cfb2d6db3d06080b5be182bc2a5 tests=29012 failed=0 spent=0.06. Phases: create 24 s, setup 72 s, run 250 s, teardown 8 s (404 s). Every VM confirmed destroyed. Four runs in total, $0.19; earlier runs caught three real test failures from this change (fixed) and correctly refused a tree edited mid-upload. A fifth (3e14ca1, the 1,280 free files plus 5 skill-e2e files) named and excluded the 5 paid files and passedfiles=1280 tests=29014 failed=0, VM destroyed.End state:
gstack-pregate --remotethenverifypregate runs the base branch's
remote_gate, so this can't run against origin/main until the declaration lands. Proven in a clone where this head (8fa3e0d) is the base (--base fakebase) and one test file is touched, on a 4-core machine, keyed:gstack-pregate run --stage tests --remote --base fakebase --spend-cap 2 --timeout 900 --allow-repo-commandsprintedthe VM is told to stop after 765s (gstack-pregate --timeout 900s minus 120 s teardown reserve and 15 s margin), the VM name and down line, thenPREGATE_REMOTE: tree=a7c1342ee7bf… tests=17 failed=0 spent=0.03andpregate.json/remote_gate … cleared by remote-gate tree=a7c1342ee7bf tests=17.gstack-pregate verifythen no longer listspregate.json/remote_gate; it refuses only on the separatewindows-free-tests.yml/windows-free-shardobligation, which needs a Windows run URL (PREGATE_REMOTE_UNCLEARED … windows-free-tests.yml/windows-free-shard).Gate edits
filesFrom: null(11 objects); flags, defaults and errors for every existing argv unchangedgstack-timing-ok(the 2 s concurrency contract; a killed fetch under 5 s)Behavior changes
gstack-pregate --stage testsrecords the local tier asrequires-remote pregate.json/remote_gateinstead of running it. Lanes clear it withgstack-pregate --stage tests --remote --spend-cap 2 --timeout 2700 --allow-repo-commands(same command with or without a key). Keyless is practical for small selections only: 98 files took 103 s on 4 cores (one failure from missing local Playwright Chromium), GSTA-35's 798 files 3,550 s. GStack Minder adds the crew rule when this merges.gstack-restamp --next(claim-at-open) reportsclaims: incomplete (…the VERSION claims of PR #N are unknown, so X is provisional and may collide; rerun, then ask the coordinator before stamping…)instead ofreadwhen next-version returnscomplete: false. It warns rather than refuses, matching the existingunverifiedfallback.gstack-pregate, so a shell line that merely mentions pregate cannot impose a false 600 s deadline.test-free-shards.tsgains--files-from.gstack-next-versionfetches in parallel, sorts output by PR number, addsunknown_claimsandcomplete, and shows the fork/path hint only for 404s.Validation
On 8fa3e0d:
test/ubicloud-pregate-remote.test.ts17 pass (real script against a stub ubi-runner: bare run, tree mismatch before/after, zero tests, failures, paid partition, reason codes, cap refusal with no VM, create/setup failure, quota retry, process-group SIGKILL, TERM mid-run under an outer deadline, an outer deadline shorter than the wall viaPREGATE_TIMEOUT_Sand via a parentgstack-pregate --timeout, a too-short deadline refusing before any VM, and an edit to the script mid-run; that last one fails without the braced block). 11 focused files 137 pass with next-version, files-from, shard-cli-parity, heredoc, free-fixtures, spawnsync tripwire, module-size ratchet, ubicloud-runner, pregate-remote and census-red-docs. typecheck clean; typecheck:test 831 known, none new; pregate preflight warn only. Not verified: the stop deadline firing on a real VM (stub only).On 72443fb (main 77d125e merged): restamp claim-at-open test (real
gstack-restamp --nextwith a gh shim answering one PR and 502 for another; fails on the old code) and the deadline-walk regression (fails on the loose match); 15 focused files 177 pass. PR gate run 39083793205 GREEN (rule 108/108, judge 24/24; $92.36 known). Earlier gates 39066860900 (3e14ca1, ship-exploratory-late-input) and 39067885089 (8fa3e0d, autoplan-guard-pty and ship-exploratory-plan-checks) were red on causes #3260 repaired.bun run teston Ubicloud: 29,072 pass, 0 fail.