Skip to content

v1.95.0.0 feat(release-gate): gate main every 8 hours and feed the stable release (inert until adopted) - #3917

Merged
capy-ai[bot] merged 22 commits into
mainfrom
gsta258-l1-release-gate
Nov 4, 2026
Merged

capy-ai[bot] merged 22 commits into
mainfrom
gsta258-l1-release-gate

Conversation

@garrytan

@garrytan garrytan commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3917,
  "head": "88996e1e8675a4a1eb77a4932acad383290cce0c",
  "version": "1.95.4.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 35206,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "1576ec54ea257bfa8571cd6c2bad93014e263087",
  "product_patch_id": "793f9ef346b74a8fc363498a8b7ca3fe7309d17e",
  "gstack_version": "1.94.24.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 928,
    "rules": "19881e1ecf7ed1ad",
    "base": "1cf7835e62096ceec1d76fc1e9275ff50f15ce8c",
    "registry": "1cf7835e62096ceec1d76fc1e9275ff50f15ce8c",
    "gate_scan": {
      "tagged": 1,
      "head": "88996e1e8675a4a1eb77a4932acad383290cce0c"
    },
    "reasons": [
      "gate-class",
      "risk:money",
      "risk:security",
      "runtime=928"
    ],
    "risk": [
      "money",
      "security"
    ]
  },
  "pregate": "requires-remote cleared @1576ec54ea25 (7 checks, current for 88996e1e8675)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41749862369/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/41749862238/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=1576ec54ea25 tests=35206 skipped=76 runs=41749862369/1 profiles=ci-reuse/free-tests heads=88996e1e8675 verified=2026-11-04T00:56:48.983Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "blocked",
    "scope": "docs/ and README.md against the 25 files in f6d6215..0fc4c07; updated docs/releases.md; the docs/ship-policy.md release_gate key row is deferred",
    "exception": {
      "accepted_by": "GSTA-258",
      "date": "2026-11-03",
      "via": "GSTA-258 relay (option B on #3917)",
      "reason": "docs/ship-policy.md release_gate key row deferred to the L1 adoption PR, which turns the key on and is reviewed as money code; row text kept from audit d107fc4"
    }
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 2,
    "deferred": 0,
    "noted": 8,
    "fixed": 4,
    "scope": "frozen",
    "fix_checks": 5,
    "rounds": 5,
    "dispatches": {
      "specialist": 6,
      "red-team": 2
    }
  },
  "review_loop_exception": {
    "accepted_by": "GStack Minder",
    "date": "2026-11-03",
    "via": "GSTA-36 relay: rule 19 grant at 1cf7835e for one merge with union resolution and de-stamp, plus the approved RELEASE_GATE_KEY_VERSION v1.96.0.0 line",
    "reason": "rule 19 merge of main 1cf7835e: one scoped reader on the resolution only (merge + release_gate union in lib/ship-policy.ts, LandNote + ReleaseRecord union in lib/ship-queue-train-record.ts, the changelog.d fragment, and RELEASE_GATE_KEY_VERSION moved to the tentative v1.96.0.0 because main's v1.95.0.0 is #3973's release)",
    "fix_check": {
      "head": "88996e1e8675a4a1eb77a4932acad383290cce0c",
      "findings": 0,
      "files": [
        "lib/ship-policy.ts",
        "lib/ship-queue-train-record.ts",
        "changelog.d/gsta258-l1-release-gate.md"
      ]
    }
  },
  "review_targeted": {
    "classes": [
      "money",
      "gate"
    ],
    "rules": "c82addff6fb60fa0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "793f9ef346b74a8fc363498a8b7ca3fe7309d17e",
    "status": "done",
    "findings": 1,
    "raised_by": "targeted"
  }
}

Lane L1 of GSTA-258 (GST-1133).

What changed

release-cut on main 6f1dfd5: before, it refuses because the backstop check is neutral; after, the release gate's green record counts as the gate

release-cut on main 6f1dfd5: before, it refuses because the backstop check is neutral; after, the release gate's green record counts as the gate.

Before/after as text: release-cut on main 6f1dfd5: before, it refuses because the backstop check is neutral; after, the release gate's green record counts as the gate
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+FLOOR_UNKNOWN: no annotated v1.92.55.0 tag points at stable 2512dd7624a4, so its last move cannot be dated; only a --security cut can move it until one does
+NEXT_ALLOWED: none until an annotated v<VERSION> tag dates the release stable points at
+CANDIDATE: 6f1dfd5b7cd0507d29e62d09a31e77f7e787e947 (2026-11-03) [hotfix: --ref] gated by release gate run 41568848358
+VERSION: 1.93.37.0 -> tag v1.93.37.0
+STABLE: 2512dd7624a4 (v1.92.55.0) -> 6f1dfd5b7cd0
+NOTES: 66 version lines, 9807 chars
+FLOOR: unknown
-REFUSED: --ref 6f1dfd5b7cd0 is not green: main-backstop concluded neutral
-SKIPPED: 6f1dfd5b7cd0: main-backstop concluded neutral
 
  • Release gate, shipped inert. .github/workflows/release-gate.yml runs bin/gstack-release-gate every 8 hours. When main has moved since the last gate, it runs the full paid gate on main's head once, writes a release note to refs/notes/gstack-trains, and publishes the main-backstop check run on that commit. A red gate bisects its red cases within bisect_spend_cap_usd. Nothing runs until main's .gstack/ship-policy.json declares a release_gate block. The key version is v1.95.0.0, tentative, and the slot stamp moves it through stamp_paths.
  • Stable is still written only by scripts/release-cut.ts. The 72-hour floor and its security and regression exceptions are unchanged. Release-cut now also accepts a GREEN release record as proof that a commit was gated. A RED record with no GREEN record on a later commit refuses every cut, and that refusal is the freeze. test/release-cut.test.ts proves both.
  • Backstop trigger choice. evals-main-backstop.yml keeps its per-push trigger. While a release_gate block exists, its policy step reports train=false, so a push starts no gate, sets no freeze and publishes no check run, and main is never gated twice. The gate has its own workflow, so the backstop's push-only contract and per-push concurrency group stay untouched while trains still run (until L2).
  • Capy installer follows the update channel. capy/skill/gstack/scripts/install.sh (wrapper revision 4) uses stable or main with the same override and fallback as gstack-upgrade. ./setup is untouched.

Why

GSTA-258 asked for "a release gate on main every 8h + stable ref" (option A): one full gate on main every 8 hours replaces a gate on every push, and the stable release reads its verdict. Option C, shortening the 72-hour floor, isn't ours to raise, so the floor stays as it is.

Blast radius

The change touches three workflows (release-gate.yml is new; evals.yml and evals-main-backstop.yml gain one policy branch each), release-cut and the Capy installer. All of it stays off until a release_gate block is adopted in a later PR, because every new branch reads that block at the base revision first; test/release-gate-workflow.test.ts runs those policy steps on scratch repositories (script ran), and the free suite passed at this tree (Free Tests run 41612197176; CI carry 41612200230, 34710 tests).

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-11-03 Grant one scoped fix-check on #3917 (Step 11's two fixes) “standing grant, GSTA-258 builds, 2026-11-03” (GStack Minder (via GSTA-258)) approved review_loop_exception: one scoped fix-check on #3917 at the merged head none
2026-11-03 Grant one scoped fix-check on #3917 (review_loop_grant 98b60a1) “standing grant, GSTA-258 builds, 2026-11-03” (GStack Minder (via GSTA-258)) approved review_loop_exception: one scoped fix-check on #3917 covering Step 11's two fixes, run at the merged head none
2026-11-03 Second scoped fix-check on #3917 (review_loop_grant 37af351) “second exception, #3917 bisect cap” (GStack Minder (via GSTA-258)) approved review_loop_exception: a targeted re-check of the collectRound bisect-cap hunk only none

Source: gstack-approvals record for gsta258-l1-release-gate (display only; not an approval citation).

Summary

Main got a full paid gate on every push, and nothing tied the stable release to a gate's verdict except the backstop's check run. This PR adds the gate as its own 8-hour workflow, records each verdict as a note release-cut can read, and keeps release-cut as the only writer of stable. Review found that the bisect could spend past its cap when a prefix reported no cost; each such prefix is now charged at the trial reservation, so the bisect ends capped within its cap. A base merge of main (v1.94.0.0) kept both new policy keys, moved assertInsideRoot to lib/path-containment.ts to keep lib/ship-policy.ts under 800 lines, and re-pinned the key version above main. A second, granted merge of main (v1.94.10.0) regenerated the harness-version entry for scripts/test-pr-profile.ts so it names both new free-only workflows, and the new Windows-by-path check showed that Git Bash rewrites origin/main:.gstack/… arguments, so the workflow test now runs its policy steps with that conversion off.

Adoption (two steps)

  1. This PR ships the reader and the workflow inert.
  2. Once it lands and its version is known, a one-line PR adds the release_gate block to .gstack/ship-policy.json and raises min_gstack_version to that version.

Security call-out (R45)

  • Workflows. release-gate.yml is new. Its gate job holds contents: write (to push the release note and the bisect's release-gate/<id> refs) and actions: write (to dispatch evals.yml and read its artifacts). The check run comes from a separate job that holds checks: write, checks out no code and runs only a validated action word, sha and check name. evals.yml gains a git-and-jq policy step and routes release-gate/ bisect refs only under a release_gate block at the base revision. The backstop gains one stand-down branch.
  • Install script. install.sh gains channel resolution. It reads only GSTACK_UPDATE_CHANNEL and the existing bin/gstack-update-channel.sh, fetches only the existing origin, and uses no new secrets.
  • Network and secrets. The bin calls gh and git with GH_TOKEN (the workflow's github.token) and nothing else.

Test Coverage

New code paths have tests: test/release-gate.test.ts (run, bisect, status and the null-cost bisect cap; 13 tests, all green), test/release-gate-workflow.test.ts, test/release-cut.test.ts, test/train-gate.test.ts and test/capy-skill-wrapper.test.ts. The bisect-cap test ('null prefix costs are charged at the reservation, and the bisect ends capped within its cap') fails on the code before 82f91f8 and passes after it.

Tests ran: free 34710 (CI carry run 41612200230 at tree d8d291a; Free Tests 41612197176, windows-smoke 41612201954)

Pre-Landing Review

Two specialist passes and Step 11's voices fixed 7 blocking findings. The first granted fix-check found one CRITICAL money finding (the bisect cap was never enforced), fixed in 82f91f8; the second granted fix-check on that hunk found one INFORMATIONAL item, listed below. A scoped review of the merged test-only edit in test/pregate-selection.test.ts read clean (anthropic/claude-opus-5-5). After the second main merge, a third granted scoped check covered the harness-version merge resolution and the Windows fixture fix and found nothing. The targeted reader (money, gate) read the final head 598467d and found two INFORMATIONAL items, listed in the review notes below.

REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=8 fixed=4 scope=frozen fix_checks=5 dispatches=8

Review-loop exception: accepted by GStack Minder 2026-11-03 via GSTA-36 relay: rule 19 grant at 1cf7835 for one merge with union resolution and de-stamp, plus the approved RELEASE_GATE_KEY_VERSION v1.96.0.0 line: rule 19 merge of main 1cf7835: one scoped reader on the resolution only (merge + release_gate union in lib/ship-policy.ts, LandNote + ReleaseRecord union in lib/ship-queue-train-record.ts, the changelog.d fragment, and RELEASE_GATE_KEY_VERSION moved to the tentative v1.96.0.0 because main's v1.95.0.0 is #3973's release) (fix-check at 88996e1, 0 findings)

Two later rule 19 main merges carried the receipt: 2f9d11a (resolved lib/ship-policy.ts against #3892; one scoped review of those hunks read clean) and 1ccab0d (moved this PR's scripts/test-pr-profile.ts harness pin into scripts/harness-pins/ after #3903; the scoped check above confirmed the record is the one reviewed at 0fc4c07). The targeted money and gate reader reran at c0d33a2 and found nothing. A third merge, bf2cab3, appended release_gate to the POLICY_KEY_INTRODUCED line that #3920 had changed (a mechanical union beside main's stamped REVIEW_POLICY_KEY_VERSION); the targeted reader reran at e9277ef and raised 2 INFORMATIONAL findings, both listed in Review notes.

Rule 25 trial merge with #39261b31842 (L4's bf2cab3 merge; shared file docs/ship-policy.md): no conflicts, bun run typecheck 0 errors, and 228 tests pass across the 15 test files that read docs/ship-policy.md.

A fourth main merge, 1cf7835 (rule 19), unions merge from #3973 with release_gate in lib/ship-policy.ts and LandNote with ReleaseRecord in lib/ship-queue-train-record.ts, takes main's VERSION, package.json, CHANGELOG.md and agents digest as they are, and keeps this PR's entry in changelog.d/gsta258-l1-release-gate.md so it can land with land --pin. RELEASE_GATE_KEY_VERSION moves to the tentative v1.96.0.0 because main's v1.95.0.0 is #3973's release; the release stamp moves it through stamp_paths. One scoped reader on those hunks read clean, and the targeted money and gate reader at 88996e1 raised only the known sha-less failed note.

Review notes

Below the blocking floor; recorded here and not fixed in this PR.

  • A PENDING record saved before its run was linked (run null) is not treated as open, so a crashed job can still lose that one verdict. release-cut needs positive green evidence, so this never releases an ungated commit.
  • No test covers finishing an open RED gate whose bisect is still running. The PENDING branch is tested, and both branches go through the same selection.
  • Finishing an old red bisect can delay gating a fix-forward head by up to three cadences. The run's policy is read at GITHUB_SHA, not at the resolved head. A red commit gets a duplicate failure check each time its bisect is finished.
  • An open record that follow() can never resolve (a deleted run, or a run pushed out of the 30 newest dispatches) keeps blocking main's head with no way out of the open state short of editing the notes.
  • A failed notes push can leave a phantom PENDING record.
  • A policy refusal leaves the gate job green while the backstop stands down. The targeted reader at 598467d found the same for every sha-less failed result (a refused policy, unreadable notes, an unresolved branch): the job ends green and no check is published. The backstop stands down for any release_gate object without validating it, so an invalid block (cadence_hours=6, a stray key) makes the gate return action=failed with no sha: both workflows stay green and no paid gate runs. release-cut still refuses commits with no evidence, so this weakens monitoring and opens no release. The fix is to stand down only for a block that validates, or to fail the gate job when it has no sha.
  • A red prefix's one flaky rerun (rule 16) means a bisect can spend up to about twice the booked cap. This must be fixed before the gate is turned on; the fix and its failing-first test go in the adoption PR.
  • A running release bisect's stored cap can only go up (Math.max in bisectRecord), so lowering bisect_spend_cap_usd, even to 0, does not stop it, and a one-off bisect --spend-cap N stays in the record (targeted reader at 598467d, money, below the floor).
  • classifyRun records GREEN when a run concluded success but its report-verdict artifact is missing or failed to download, and release-cut counts that as evidence. The old backstop also trusted run success, so this is not a regression (targeted reader at e9277ef, below the floor).
  • The release_gate row in docs/ship-policy.md's Schema v1 key table is deferred to the adoption PR (named documentation risk below); its text is kept from audit d107fc4.

Live proof

gstack-release-gate run --policy <file> --ignore-cadence on main 6f1dfd5 (the policy passed on the command line, nothing adopted) dispatched evals run 41568848358 and recorded RELEASE: green sha=6f1dfd5b7cd0… run=41568848358 cost=37.80. A fresh state root then read LAST_GATE: GREEN … run=41568848358 back from origin's notes, a dry run skipped on cadence, and scripts/release-cut.ts --ref 6f1dfd5… --dry-run printed CANDIDATE: 6f1dfd5… gated by release gate run 41568848358. That dry run also reported FLOOR_UNKNOWN: stable 2512dd7 has no annotated v1.92.55.0 tag. That state was already on main and this PR doesn't change it.

Exploratory QA

The live proof above is the end-to-end check: one real gate run, its note read back from origin, and a release-cut dry run that accepted it.

Design Review

No frontend files changed, so design review was skipped.

Eval Results

One paid gate ran as the live proof (run 41568848358, green, $37.80). No other evals ran.

Review bot comments

No review bot comments.

TODOS

No TODO items completed in this PR.

Documentation

Documentation: blocked. Scope: docs/ and README.md against the 25 files in f6d6215..0fc4c07. The audit updated docs/releases.md (the release gate's evidence and hold); its docs/ship-policy.md key-table row is deferred.

Documentation exception: accepted by GSTA-258 2026-11-03 via GSTA-258 relay (option B on #3917): docs/ship-policy.md release_gate key row deferred to the L1 adoption PR, which turns the key on and is reviewed as money code; row text kept from audit d107fc4

Test plan

  • bun run test: 34710 tests passed in CI carry run 41612200230 at tree d8d291a (Free Tests run 41612197176)
  • Windows: windows-smoke run 41612201954; a Windows Scoped Tests run ran test/release-gate-workflow.test.ts at 0fc4c07
  • bun test test/release-gate.test.ts: 13 tests, all green at 82f91f8

garrytan and others added 3 commits November 3, 2026 02:51
…se (inert until adopted)

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>
…ation

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 10 commits November 3, 2026 03:48
… neutral check for an unfinished gate)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…tself; an open gate on stable or older than three cadences)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…gin; held or failed leaves the gate job green)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…exclude_paths and release_gate)

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

# Conflicts:
#	lib/ship-policy.ts
…InsideRoot to lib/path-containment.ts to keep ship-policy.ts under 800 lines

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

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… bisect prefix cost so the cap holds across rounds

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

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…e old literal

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>
garrytan and others added 6 commits November 3, 2026 09:03
…0; harness-version entry for test-pr-profile.ts regenerated for both workflows)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…conversion off, as on the Linux runners (windows-scoped-shard)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… in the policy key table (Step 14.5 audit)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…on PR (named documentation risk, GSTA-258)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Resolve lib/ship-policy.ts against #3892: keep both POLICY_KEY_INTRODUCED
entries (release_gate and stamp_placeholders); main's stamped
STAMP_PLACEHOLDERS_KEY_VERSION is kept as is.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Resolve scripts/harness-version.json against #3903: take main's manifest
and carry this branch's test-pr-profile.ts pin into
scripts/harness-pins/scripts/test-pr-profile.ts.json.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Resolve lib/ship-policy.ts against #3920: keep main's stamped
REVIEW_POLICY_KEY_VERSION and its review entry, and append release_gate
to the same POLICY_KEY_INTRODUCED line.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title feat(release-gate): gate main every 8 hours and feed the stable release (inert until adopted) v1.95.0.0 feat(release-gate): gate main every 8 hours and feed the stable release (inert until adopted) Nov 3, 2026
Union lib/ship-policy.ts (merge + release_gate) and
lib/ship-queue-train-record.ts (LandNote + ReleaseRecord). Take main's
VERSION, package.json, CHANGELOG.md and agents-digest as they are and keep
this PR's entry in changelog.d/gsta258-l1-release-gate.md, dropping the
train-107 stamp. RELEASE_GATE_KEY_VERSION moves to the tentative 1.96.0.0
because main's 1.95.0.0 is #3973's release.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit cff1de2 into main Nov 4, 2026
44 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