Skip to content

v1.93.18.0 fix(pregate): a green Free Tests run at the pregate tree clears gstack's remote gate (GST-1024) - #3883

Merged
capy-ai[bot] merged 5 commits into
mainfrom
gst-1024-remote-gate-runs
Nov 2, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
gst-1024-remote-gate-runs

Conversation

@garrytan

@garrytan garrytan commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3883,
  "head": "60d7ae8bc13bf526eeffef3ccaf51fb0256b58ae",
  "version": "1.93.8.0",
  "base": "main",
  "gate": {
    "pregate-local": {
      "pass": 181,
      "fail": 0,
      "skip": 0
    },
    "typecheck": {
      "pass": 1,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "fb073508ddb06b9de093ede9a20336e31fe0ace3",
  "product_patch_id": "176149a61f1a50a0bba89972dacd649061043d48",
  "gstack_version": "1.93.8.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 99,
    "rules": "b2272efd321ce7cb",
    "base": "40a317033599cafc4152f3f852cb394e637f9ff6",
    "registry": "40a317033599cafc4152f3f852cb394e637f9ff6",
    "gate_scan": {
      "tagged": 0,
      "head": "60d7ae8bc13bf526eeffef3ccaf51fb0256b58ae"
    },
    "reasons": [
      "gate-class",
      "risk:security",
      "runtime=99"
    ],
    "risk": [
      "security"
    ]
  },
  "pregate": "requires-remote cleared @fb073508ddb0 (1 checks, current for 60d7ae8bc13b)",
  "requires_remote": [
    "pregate.json/remote_gate: remote-gate tree=fb073508ddb0 tests=1957"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/ (131 authored docs; docs/pregate.md, docs/troubleshooting.md read) and changelog.d/gst-1024-remote-gate-runs.md"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 1,
    "fixed": 2,
    "scope": "frozen",
    "rounds": 2,
    "ledgers_read": 3,
    "dispatches": {
      "specialist": 2,
      "red-team": 2
    }
  }
}

What changed

clear --run on #3869's green Free Tests run: refused on main, accepted here; five real wrong runs still refuse

clear --run on #3869's green Free Tests run: refused on main, accepted here. Five real wrong runs still refuse.

Before/after as text: clear --run on #3869's green Free Tests run: refused on main, accepted here; five real wrong runs still refuse
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+$ gstack-pregate clear --remote pregate.json/remote_gate --run <run> --allow-repo-commands
+# same head and tree; base = fc292e22 plus this PR's remote_gate_runs
+run 41484634592 (green Free Tests, same tree):
+REUSE: accepted pregate.json/remote_gate remote-gate tree=fce1840715b9 tests=34079 skipped=71 runs=41484634592/1 profiles=ci-reuse/free-tests heads=3f2bcf3efc28
+run 41489219200 (green, another tree):   refused reason=tree_not_stamp_only
+run 41484634668 (windows-smoke.yml):     refused reason=workflow_mismatch
+run 41483407085 (failed):                refused reason=run_not_success (concluded failure)
+run 41472151782 (cancelled):             refused reason=run_not_success (concluded cancelled)
+run 41418344008 (green, fork):           refused reason=fork_run (ran for AndreIntelas/gstack)
-$ gstack-pregate clear --remote pregate.json/remote_gate --run 41484634592 --allow-repo-commands
-# #3869 head 3f2bcf3, tree fce1840715b9; base main fc292e22 (no remote_gate_runs)
-gstack-pregate clear: --run clears pregate.json/remote_gate only when the base branch's .gstack/pregate.json declares remote_gate_runs
-# declaration alone, without skipped:
-REUSE: refused reason=inventory_uncovered — 71 of the 1606 test file(s) pregate.json/remote_gate must cover appear in no run's tree.json (test/codex-e2e-shared-libs.test.ts, test/codex-e2e-sol-scope.test.ts, ...)
 

Why

GST-1024: "a slow or contended VM blocks a PR even when CI is green at the same head." On #3869, every check passed at 3f2bcf3 (Free Tests run 41484634592). Two Ubicloud remote gate runs at the same tree still failed, on bun timeouts in files the PR doesn't touch. docs/pregate.md already described clearing the gate from a CI run, but gstack never declared it, so that route always refused. Now a green Free Tests run at the pregate tree clears pregate.json/remote_gate with gstack-pregate clear --remote pregate.json/remote_gate --run <run> --allow-repo-commands.

Blast radius

The code change is one optional key, remote_gate_runs.skipped, in the run-evidence clear. A repository that doesn't declare it, gbrain included, gets the same checks as before, because the new branch in clearByRuns runs only when skipped is set. Evidence: test/pregate-clear-runs.test.ts passes unchanged (script ran). The profile, the inventory and the skipped command are all read from the base branch only, so this PR has no effect until it lands on main.

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-11-02 GST-1024: declare remote_gate_runs so a verified Actions run at the exact tree clears remote_gate “Declare the profile so a verified Actions run at the exact tree clears remote_gate, with negative controls: wrong tree, wrong workflow, failed or cancelled run, and a forked-repo run. Docs in docs/pregate.md. This is a repair of a documented path, so no /autoplan is needed. It i…” (GStack Minder (Captain)) approved GST-1024 lane: config, tests, docs; no autoplan; full review depth none

Source: gstack-approvals record for gst-1024-remote-gate-runs (display only; not an approval citation).

Summary

gstack declares the CI route (.gstack/pregate.json). remote_gate_runs names the existing ci-reuse/free-tests profile. That profile requires every Free Tests job to pass, a same-repository run, the free-tests.yml workflow, a pull_request or workflow_dispatch event, and a tested-tree artifact on the exact tree. The inventory is scripts/test-free-shards.ts --list, the same 1,534 files the Free Tests plan shards.

Paid files need a skipped list (lib/run-evidence.ts, lib/pregate/index.ts, lib/pregate/run-check.ts). The declaration alone still refused #3869's run. All 71 selected files that tree.json didn't list are paid test files, which scripts/ubicloud/pregate-remote.sh leaves to the paid PR gate by design. remote_gate_runs.skipped is a command that reads the selected files from PREGATE_FILES_FILE and prints the ones the gate never runs. gstack's uses the same isPaidTestFile helper the gate script uses. These rules keep it tight:

  • A file the inventory lists stays required even when skipped names it.
  • A failing command refuses (skipped_failed).
  • A selection that is entirely skipped refuses (paid_only), the same as the gate's own tests=0.
  • The receipt records the skipped count as skipped=<n>.

Proof

  • Real runs, real API. I tested v1.93.21.0 fix(ship): native FIXABLE collects at its own Severity outside gate and risk reviews (GST-987) #3869's head 3f2bcf3 (tree fce1840715b9) against a scratch base: main fc292e2 plus this PR's remote_gate_runs. The real GitHub runs gave these results (handoffs/GST-1024/proof3.log in the Captain drive):
    • 41484634592 (green Free Tests) cleared with tests=34079 skipped=71, and verify then showed only the separate macOS lane uncleared.
    • 41489219200 (green, another tree) refused tree_not_stamp_only.
    • 41484634668 (windows-smoke.yml) refused workflow_mismatch.
    • 41483407085 (failed) refused run_not_success.
    • 41472151782 (cancelled) refused run_not_success.
    • 41418344008 (green, from the fork AndreIntelas/gstack) refused fork_run.
      On real main, the same run refuses because no remote_gate_runs is declared.
  • Red first. test/pregate-remote-gate-runs.test.ts fails all four of its tests on main 40a3170 (handoffs/GST-1024/red.log); on this branch all four succeed.

Security read

  • The skipped and inventory commands are pin-file commands. They run only under --allow-repo-commands, only when pregate.json's tree matches the working tree, and only from the base branch's copy of the config. skipped gets one new environment variable, PREGATE_FILES_FILE, pointing at a temporary file of selected paths that is removed in finally.
  • Run verification makes the same GitHub API reads as before. Nothing here adds a network call, reads a secret, adds a dependency, or touches .github/workflows, setup, install or upgrade scripts. No outside code was carried over.

Test Coverage

All new code paths have test coverage: the declaration's inventory equals the Free Tests plan, the skipped command's paid split, the clear through buildRunCheck with gstack's real profile, ten refusal controls, and skipped config validation.
Tests ran: pregate-local 181
Tests ran: typecheck count unavailable
Tests ran: remote gate (Ubicloud us-east-a2) 1957, 0 failed, tree fb073508ddb0, $0.08

Pre-Landing Review

Pass 1 (gate class, full depth: batched testing, security and state-machines specialist, then Red Team) found 2 INFORMATIONAL findings, both fixed:

  • skipped validation had no negative tests; they are added now.
  • A paid-only selection would clear through --run while the gate refuses it; it now refuses with paid_only.

Pass 2 on the fix range found one INFORMATIONAL count error in the changelog, fixed at Step 13. Step 11 ran the native adversarial pass and the outside voice (openai/gpt-6.1-sol): NO FINDINGS from both.
REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=1 fixed=2 scope=frozen ledgers_read=3 dispatches=4
Gate edits: none detected (1 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: completed, no findings.

Exploratory QA

The smoke probe was the real-run check above, run at this PR's code against live GitHub Actions runs: one success and five refusals, each with the reason the verifier names. The required plan checks are the four focused tests. No browser surface changed.

Design Review

No frontend files changed, so design review was skipped.

Eval Results

No prompt-related files changed, so evals were skipped.

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). GST-1024 is the plan of record. The Captain waived /autoplan because this repairs a documented path.

TODOS

No TODO items completed in this PR.

Documentation

Status: current — the docs already match the change; no edits.

Scope: the committed diff 40a3170..60d7ae8 (.gstack/pregate.json, lib/run-evidence.ts, lib/pregate/{index,run-check,config}.ts, changelog.d/gst-1024-remote-gate-runs.md, docs/pregate.md). There are no staged, unstaged or new files. I also searched every authored .md and .tmpl file for remote_gate_runs and the remote-gate clear.

Documentation health:

  • docs/pregate.md — current: the config table, the run-evidence rules for skipped, the reason codes, the receipt format and gstack's own-profiles paragraph all match the code.
  • docs/troubleshooting.md — current.
  • changelog.d/gst-1024-remote-gate-runs.md — reviewed and agrees with the code; not edited.

Coverage debt: remote_gate_runs.skipped and the gstack Free Tests remote-gate clear have both reference and how-to coverage in docs/pregate.md. There's no tutorial, which is fine for a contributor-facing gate option. No architecture diagrams are affected.

Test plan

  • bun test test/pregate-remote-gate-runs.test.ts test/pregate-clear-runs.test.ts test/run-evidence.test.ts test/pregate-user-policy.test.ts test/pregate-remote.test.ts test/pregate-remote-stamp-only.test.ts test/pregate-remote-gbrain.test.ts test/pregate-selection.test.ts test/ubicloud-pregate-remote.test.ts test/module-size-ratchet.test.ts test/spawnsync-timeout-tripwire.test.ts test/bun-entry-isolation.test.ts test/free-tests-workflow-wiring.test.ts: 181 pass, 0 fail
  • bun run typecheck: zero errors
  • bun run typecheck:test: 814 known diagnostics, none new
  • Remote pregate (Ubicloud us-east-a2) on the finished tree: 1957 tests, 0 failed, tree fb073508ddb0, $0.08, VM torn down (UBICLOUD: left=0)
  • Real-run proof against GitHub Actions: 1 accepted, 5 refused (proof3.log)

garrytan and others added 4 commits November 2, 2026 17:31
…at the pregate tree clears remote_gate (GST-1024)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…; validate skipped)

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>
@trunk-io

trunk-io Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@github-actions github-actions Bot changed the title fix(pregate): a green Free Tests run at the pregate tree clears gstack's remote gate (GST-1024) v1.93.18.0 fix(pregate): a green Free Tests run at the pregate tree clears gstack's remote gate (GST-1024) Nov 2, 2026
@capy-ai
capy-ai Bot merged commit 8af121f into main Nov 2, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant