Repository navigation
v1.91.377.0 pregate: clear the remote gate with verified Actions runs on the same tree (clear --run) - #3592
Merged
Conversation
… tree (clear --run) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…pt bind end to end Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…il closed, no pull_request runs, user-policy keys) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…sed, lane coverage, run re-read, base binding, paging, artifact bound, full assignment) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ered reason, unreadable-base and user-policy tests) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…user policy, verify's foreign-tree run receipt 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>
…ledger (sink run-evidence) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…vocation tripwire) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
capy-ai Bot
added a commit
that referenced
this pull request
Oct 30, 2026
…k/always-run.json (GST-167 PR 1, GST-98) (#3626) * pregate: always run the whole-tree tests listed in .gstack/always-run.json A diff-selected run never maps a touched file to a scanner that reads the whole tree, so tripwires, ratchets and conformance tests passed the selected gate and failed CI after review (#3592, #3593). The lanes selection now adds every tracked test the list's globs name whenever the branch selects a test, owes a lane or edits the list. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(pregate): restore the truncated pregate.md tail; cite seeded durations for the always-run list Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(changelog): [Unreleased] entry for the pregate always-run list 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>
…ence Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md # lib/pregate/config.ts
…s git.capy.ai proxy still names the GitHub repository Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…eto, inventory runs under pipefail, freshness reads job completion, and a pregate.json rewritten mid-clear refuses Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…; quote clear's real refusal line Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ate clears one of three ways Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
4 tasks done
This was referenced Oct 31, 2026
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
The remote gate gains a third way to clear: verified GitHub Actions runs on the same tree (
clear --run), so a repository stops running its full suite twice per slot.Before/after as text: The remote gate gains a third way to clear: verified GitHub Actions runs on the same tree (clear --run), so a repository stops running its full suite twice per slot
Why
GBRA-108: "#7872's slot took 5.6 h". Every gbrain slot ran its Ubicloud remote gate (30–45 min) and then a full-ci dispatch (18–20 min) on the identical tree. With
run_profilesdeclared on its base branch, gbrain runs the suite once in CI andgstack-pregate clear --runturns those runs into the gate's receipt, checked against GitHub's own record instead of a pasted URL.Blast radius
The new path runs only when a base branch declares
run_profiles/remote_gate_runsin.gstack/pregate.json. gstack's own base declares none, so--receipt,--run-urland--bundle-lanebehave as before for gstack and for every repository without profiles. Evidence: the unprofiled-lane and receipt-route tests in test/pregate-clear-runs.test.ts ran, and the remote gate passed at f0f4ca7 (1993 tests, 0 failed, tree 577891788a94). Two edges now fail closed where they used to record. A lane the base profiles refuses--bundle-lane, and an unreadable or invalid base config refuses--run-url/--bundle-laneon every lane. Aclearwhose pregate.json was rewritten while it ran now refuses instead of writing the old copy back.Approvals
Source: gstack-approvals record for capy/gsta156-run-evidence (display only; not an approval citation).
Summary
gbrain asked for one full suite per tree.
gstack-pregate clear --remote pregate.json/remote_gate --run <id> --run <id>accepts one run per profile the base declares. Each run is checked against the GitHub API (repository, event, newest attempt, every named job passing once, no run on the head that started at or after it and went red, age from its jobs' completion, OS) and against thetree.jsonit uploaded (run, attempt, event, head, and the tree git computes for that head). The runs must share one tree, either pregate.json's or a stamp-only predecessor of it, and theirfilesmust cover the obligation's tests plus everything the declared inventory command lists. Before the receipt is written, every run is read once more, and the inventory runs under pipefail.verifystays offline and refuses a run receipt recorded for another tree. A lane with its own profile clears the same way, and its--run-urlgoes through the verifier. The verifier's GitHub reads and its head fetch are recorded in the egress ledger (sinkrun-evidence). Refusals printREUSE: refused reason=<code>, and success printsREUSE: accepted.This re-ship fixed a bug the earlier review missed. On a Capy machine,
url.insteadOfrewrites origin to git.capy.ai, soclear --runcould never read the GitHub repository. Origin is now read fromremote.origin.urland normalized the way the ship queue already does.The release note is the fragment
changelog.d/capy-gsta156-run-evidence.md; the merge stamps it. Main was merged once at a305302 (cc22404) under GStack Minder's rule 19 grant. The only code conflict,lib/pregate/config.ts, was resolved as the union of main'stimeout_skey and this PR'srun_profiles/remote_gate_runs, and the review read that file in full.Plan deviations, approved in the decision trail. Verify does not re-call GitHub (row 12). The schema key is
remote_gate_runsrather thanremote_gate.accept_runs(row 11). The veto covers the run's head and pregate.json's head, not every head carrying the tree (row 29). REUSE lines print on clear outcomes only (row 24).Deferred to the next PRs of this plan:
gstack-ship-queue ready --dispatch-cistill records lane runs by URL, and offline verify cannot yet demand a verified receipt for profiled lanes (P3b, with gstack's own profiles and main-push reuse). Clear does not dispatch until green. A push after clear is caught by the tree check, not by clear. The workflow file and the inventory command are the branch's own, as the remote gate script already is.Test Coverage
Tests: test/run-evidence.test.ts (new), test/pregate-clear-runs.test.ts (new), test/pregate-user-policy.test.ts (extended), test/egress-receipt-wiring.test.ts (run-evidence registered as a sink). Five regression tests added in this re-ship each failed before their fix: the insteadOf origin, the same-second veto, freshness from job completion, the pipefail inventory, and a run that turns red while the clear is assembled.
Untested paths, all of which fail closed: the
REUSE: acceptedstdout line (needs a gh stub), the bin's inventory working-tree guards, the re-read of pregate.json before the write, and gh pagination and the artifact size bound.Tests ran: remote-free 1993
Pre-Landing Review
No blocking findings remain. Pass 1 (specialists on testing, security and state machines, then a red team) found one blocker:
clear --runcould not read the GitHub repository behind Capy's git.capy.ai proxy. It is fixed with a regression test. Pass 2 found two informational items, both noted below. Step 11 ran the native adversarial pass (Opus) and the outside voice (GPT-6.1 Sol). The outside voice raised three gate escapes: an inventory pipeline without pipefail, a run turning red during a multi-profile clear, and same-second runs skipping the veto. The native pass raised four fixable items. The tooling classified all seven as blocking. Five are fixed in code with tests, and two (re-running only the failed jobs refuses, and the size cap reads the zip) are documented limits that fail closed. The fix-check on those fixes found one stale sentence, now fixed, and a second fix-check on the prose found nothing. A first review pass ran against a stale local main ref and read main's own history. It was discarded and rerun on the right base.REVIEW_LOOP: passes=2 blocking_found=8 deferred=0 noted=8 fixed=7 scope=frozen fix_checks=2 dispatches=6
Gate edits: none detected (gate scan tagged 0 hunks at f0f4ca7's reviewed range)
Outside review: GPT-6.1 Sol (Step 11), completed.
Review notes
lib/pregate/index.tsverify: onlyclearenforces "a profiled lane clears through verified runs".ready --dispatch-ci, an older gstack, or a hand edit can still record a plain URL that verify accepts. This is P3b; the fragment now says so.bin/gstack-pregaterunCheck: the inventory closure's three guards (no--allow-repo-commands, a working tree that is not pregate.json's, a tree that changes while it runs) have no test.lib/run-evidence.ts: the 8 MiB bound checks the zipped artifact size, andgh run downloadextracts before tree.json's size is checked. Only a workflow on the branch itself can do this, and the temporary directory is removed.artifact_mismatchunless the job that uploads tree.json re-runs too (documented).run_profilesas an unknown key, so gbrain should commit profiles only after its lanes upgrade (the gbrain handoff note says so).o.localin parseConfig's return. It is benign and not allowlisted.lib/result-codes.tsfix strings for PREGATE_RECEIPT_INVALID and PREGATE_REMOTE_UNCLEARED do not mention--run. docs/troubleshooting.md does.Plan Completion
P3a items 1–7: done or changed with a trail row. Item 7, the gbrain handoff note, is in GStack Minder's drive at handoffs/GSTA-156/gbrain-note.md.
TODOS
No TODO items completed in this PR.
Documentation
Status: updated. Two factual fixes in docs/pregate.md; no blockers.
Scope: base a305302..26f8407 on capy/gsta156-run-evidence (11 committed files; nothing staged, unstaged or untracked). Audited the authored docs this change touches (docs/pregate.md, docs/troubleshooting.md, changelog.d/capy-gsta156-run-evidence.md) against bin/gstack-pregate, lib/pregate/config.ts, lib/pregate/index.ts and lib/run-evidence.ts. Also checked docs/ship-policy.md, CONTRIBUTING.md, ARCHITECTURE.md and docs/PROJECT_STRUCTURE.md for knock-on drift. Banned terms: none (no list on main).
Documentation health:
run_profilesandremote_gate_runsas refused in the user file (an emptyrun_profilesis accepted), and the remote gate section now says "one of three ways" (was "two") after the newclear --runbullet.REUSE: refused reason=<code>line.--dispatch-ciand--run-urlroute is unchanged, because gstack declares no run_profiles.Documentation Debt
gstack-pregate clear --run,run_profilesandremote_gate_runs: reference, how-to and explanation are in docs/pregate.md#run-evidence; no tutorial.tree.jsonartifact contract has reference coverage only. A how-to with a sample workflow step that writes and uploadstree.jsonis missing.gstack-ship-queue ready --dispatch-cion profiled lanes: the known limitation (planned follow-up P3b) is documented only in docs/pregate.md.Suggested follow-up:
/document-generatefor thetree.jsonhow-to; consider adocs-debtlabel.Test plan
UBI_OWNER=gsta156 gstack-pregate --allow-repo-commands --remote --spend-cap 2 --timeout 2700at f0f4ca7: remote gate 1993 tests, 0 failed on tree 577891788a94 ($0.05; the VM was destroyed, 0 left for owner gsta156).windows-free-shardcleared from the PR's Windows Free Tests run 41207036595 (green); Free Tests run 41207036618 is green at the same head.gstack-pregate verifyok.bun run typecheckclean.