Skip to content

Stop the stable cut counting its own check runs against the commit it cuts (GST-2463) - #4297

Merged
capy-ai[bot] merged 3 commits into
mainfrom
stable-cut-ignores-its-own-check-runs
Nov 11, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
stable-cut-ignores-its-own-check-runs

Conversation

@garrytan

@garrytan garrytan commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

The daily stable release no longer blocks itself on its own check run, so a commit the release gate passed can reach stable the same day. This serves the stable channel's promise that important fixes reach users within a day.

What changed

gateVerdict in crew/scripts/release-cut.ts now sets aside the check runs that the stable-release workflow produced itself, whether running or finished. Every other check run is judged exactly as before.

How it recognises its own check runs. The lookup runs only when a candidate has a check run that is still going or red. It reads the commit's workflow runs (GET repos/{repo}/actions/runs?head_sha=<sha>) and keeps the runs whose path is .github/workflows/weekly-release.yml (CUT_WORKFLOW). For each of those it lists every job, re-run attempts included (GET repos/{repo}/actions/runs/{id}/jobs?filter=all). It then drops only the check runs whose id is one of those job ids, because an Actions job's id is its check run's id. That was checked live: job 130716281605 is the "Cut the release" check run on 19ed2ac. A job name like "Cut the release" can be reused by any workflow, so the name is never the key.

Why not the check suite. The first version of this PR matched on check_suite.id. Two reviewers pointed out that GitHub files a check run that a workflow creates through the API with GITHUB_TOKEN under some github-actions check suite on that commit, and the creator can't choose which. The main-backstop check runs from release-gate.yml and evals-main-backstop.yml are created exactly that way. So a red main-backstop could land in the cut's suite, be set aside, and let the cut release past a failed backstop. Matching by job id leaves API-created check runs alone.

Fails closed to today's behaviour. If the workflow-runs or jobs read fails, nothing is set aside, so the verdict is what it was before this change. A clean commit makes no extra API call.

Permissions. Both jobs in weekly-release.yml gain actions: read (read-only) for the lookup.

Lines that change gate behaviour (crew/scripts/release-cut.ts at the final head): line 79, export const CUT_WORKFLOW = '.github/workflows/weekly-release.yml';, and lines 126-136, the if (runs.some(c => c.status !== 'completed' || RED.has(c.conclusion ?? ''))) block that builds own from the jobs of the cut's workflow runs and ends with runs = runs.filter(c => !(typeof c.id === 'number' && own.has(c.id)));. Everything after it (required check, backstop, train and release-record evidence, red and running checks) is unchanged and runs over the remaining check runs. The freeze and the RED release-record hold live in readTrainNotes, which this doesn't touch.

Why

"Stable has been stuck on v1.99.0.0." The daily cut runs on main's newest commit, so its own "Cut the release" job lands a check run on the very commit it might release. While the cut runs, that commit looks unfinished and is skipped. When a cut fails, its red check run keeps the commit out of every later cut. On 2026-11-11 the release gate passed 19ed2ac (v1.99.1.0). The 18:16Z cut (run 43076123863) skipped it because its own job was still going, failed with NO_RELEASE_PR, and left a red "Cut the release" check run on 19ed2ac. With this change, the live release-cut.ts --dry-run --daily plans 19ed2ac.

Blast radius

This touches only the stable cut's commit selection (gateVerdict, whose one production caller is planRelease) and the read-only permissions of weekly-release.yml. It's safe because the set-aside is limited to check runs whose id matches a job of a weekly-release.yml run on that commit. A failed lookup sets nothing aside. That was confirmed by reading release-cut.ts:126-136 and by tests that fail on the old code and pass here.

Summary

The cut was deadlocking on itself, because its own running or failed job counted as a not-green check on the commit it was cutting. It now recognises its own jobs through the workflow file and those runs' job ids, and ignores them. The review turned up the check-suite flaw described above, so matching moved from check suites to job ids. docs/releases.md now explains the set-aside, the actions: read it needs and the fail-safe.

Test Coverage

All new code paths have test coverage. These tests in crew/test/release-cut.test.ts (describe "the cut sets aside its own check runs (GST-2463)") fail against the earlier versions of release-cut.ts (main's, and the check-suite version) and pass here:

  • The cut's own in-progress, queued or failed check run, on a commit with a GREEN release record, is green.
  • Still not green: a red run from another workflow beside the cut's own; a "Cut the release" job from another workflow's run; a running check run that isn't one of the cut's jobs; a red API-created main-backstop filed under the cut's check suite; a running free-tests; no gate evidence; an unreadable workflow-runs API.
  • The 11-11 state: head with its backstop and the cut still running, a release-gated commit carrying the failed cut's red run, and stable on the released commit before it. The cut picks the gated commit, and a RED release record on it still refuses.

test/weekly-release-workflow.test.ts expects actions: read on both jobs.

Tests ran: free 1662 (files, CI run 43082282390 attempt 2)

Pre-Landing Review

Pre-Landing Review: 5 issues — 2 auto-fixed (one defect, found by the Red Team and the native adversarial pass), 0 asked, 0 deferred, 3 noted. The suite-membership defect (p1/red-team#1 = p1/adversarial-native#1) is fixed in 505dbe1. The first item in Review notes below is that same finding, now fixed. One fix-check on the fix range found nothing.

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=3 fixed=2 scope=frozen ledgers_read=4 fix_checks=1 dispatches=3 est_input_tokens=17759

Gate edits: none detected (6 listed, 3 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

Outside review: completed, CLEAN (openai/gpt-6.1-sol, a host subagent of another model family).

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL crew/scripts/release-cut.ts:129 Check runs are set aside by check-suite membership; GitHub files API-created check runs (main-backstop from release-gate.yml/evals-main-backstop.yml) into an arbitrary github-actions suite on the sha, so one can land in the cut's suite and be hidden. Fix: set aside only check runs whose id is a job id of the cut workflow's own runs.
  • INFORMATIONAL crew/scripts/release-cut.ts:126 A failed actions/runs lookup sets nothing aside silently; the verdict's reason doesn't say the lookup failed.
  • INFORMATIONAL crew/scripts/release-cut.ts:125 Main's head is judged before late API-published check runs exist; same race as older commits, shorter window. INVESTIGATE.
  • INFORMATIONAL crew/scripts/release-cut.ts:128 The PR dry-run job's check runs are set aside too, reachable only if a PR head sha becomes a main commit (main lands by squash).

Exploratory QA

Smoke checks: bun test crew/test/release-cut.test.ts test/weekly-release-workflow.test.ts crew/test/release-cadence.test.ts gave 43 pass, 0 fail at tree f53fbae0. With the source reverted to the check-suite version, the two GST-2463 tests fail (0 pass, 2 fail). Not run here: a live workflow run of the cut (the live dry run cited under Why was run on the first version of this PR).

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). This is a bug fix, exempt from a plan.

Issues

Refs p1/adversarial-native#1
Refs p1/red-team#1

Verification Results

No Step 8.1 obligations (no plan bound); verification is the targeted tests and CI run above.

TODOS

No TODO items completed in this PR.

Documentation

Status: updated. One factual sentence added to docs/releases.md.

Scope: base 19ed2ac to head 505dbe1 on branch stable-cut-ignores-its-own-check-runs (2 commits, 6 files; nothing staged, unstaged or untracked). The change: the stable cut ignores check runs from its own workflow (weekly-release.yml), matched by job id, and the workflow now needs actions: read.

Documentation health:

  • docs/releases.md: Updated. Added that the lookup needs actions: read and that nothing is set aside when the lookup fails.
  • crew/docs/recommended-harness.md: Current. Its summary links to releases.md.
  • docs/ship-policy.md: Current. Release-gate check runs come from another workflow.
  • crew/README.md: Current.
  • changelog.d/stable-cut-ignores-its-own-check-runs.md: Current. Reviewed only; the parent owns it.

Coverage debt: none. Diagram drift: none.

Test plan

  • bun run test (free suite, carried from CI run 43082282390 attempt 2 at tree 60588e90): 1662 files, green
  • bun test crew/test/release-cut.test.ts test/weekly-release-workflow.test.ts crew/test/release-cadence.test.ts: 43 pass, 0 fail
  • bun run typecheck: clean

🤖 Generated with Claude Code

Agent notes

GSTA-36 lane GSTA-517, GST-2463. CI attempt 1 of run 43082282390 had one infrastructure red (quick-bun-default shard 2/8, "shard cleanup or home containment failed: native process identity unavailable", 0 failing tests); failed jobs were rerun once under the flaky rule and attempt 2 is green.

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=3 fixed=2 scope=frozen ledgers_read=4 fix_checks=1 dispatches=3 est_input_tokens=17759

Gate edits: none detected (6 listed, 3 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

Approvals

No approvals recorded for branch stable-cut-ignores-its-own-check-runs.
Plan: exempt: bug fix
Plan check: exempt bug fix

Refs GST-2463

{
  "schema_version": 1,
  "pr": 4297,
  "head": "d2d810217f405780463377f8b335ff0adcbccacc",
  "version": "1.99.1.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1662,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 43082282390,
      "attempt": 2,
      "tree": "60588e90325193d1ddec98e20d6330d3cd169691"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "60588e90325193d1ddec98e20d6330d3cd169691",
  "product_patch_id": "759aac708048600c91b655923257f176d0ac3e34",
  "gstack_version": "1.99.1.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 26,
    "rules": "66e5174161eecc2c",
    "base": "19ed2ac5bbe82f681627fbb097b4992a66929c4c",
    "registry": "19ed2ac5bbe82f681627fbb097b4992a66929c4c",
    "gate_scan": {
      "tagged": 0,
      "head": "d2d810217f405780463377f8b335ff0adcbccacc"
    },
    "reasons": [
      "gate-class",
      "runtime=26"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "warn @60588e903251 (8 checks, current for d2d810217f40)",
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/, README.md, CLAUDE.md and AGENTS.md against 19ed2ac5"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 3,
    "fixed": 2,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 2,
    "est_input_tokens": 17759,
    "ledgers_read": 4,
    "dispatches": {
      "specialist-batched": 1,
      "red-team": 1,
      "fix-check": 1
    }
  }
}

… cuts (GST-2463)

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

trunk-io Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 2 commits November 11, 2026 18:47
…-2463)

GitHub files a check run another workflow creates through the API (main-backstop from release-gate.yml and evals-main-backstop.yml) under any github-actions check suite on the commit, so suite membership could hide a red main-backstop. The cut now lists the jobs of its own workflow runs and sets aside only check runs whose id is one of those job ids.

Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/adversarial-native#1 reader=adversarial-native
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…s safe (GST-2463)

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

capy-ai Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Free Tests run 43082282390 attempt 1: quick-bun-default went red on a test-harness cleanup step, not a test. Shard 2/8 printed shard cleanup or home containment failed: native process identity unavailable with 0 failing test(s) in 0 file(s); every other shard, all ten free-suite jobs and macos-named-regressions passed, and free-tests failed only downstream of it. This PR changes no browser or shard-harness code, and the same harness class is already in the flaky ledger (#4095). Rerunning the failed jobs once under the standing flaky rule; a second failure counts as real.

@capy-ai
capy-ai Bot merged commit 0ead11c into main Nov 11, 2026
77 of 79 checks passed
garrytan added a commit that referenced this pull request Nov 17, 2026
… read too (GST-2252)

After #4297 the cut sets aside check runs from its own workflow and the Windows nightly by job id, but the rows from lib/ci-head-checks.ts skipped that filter, so the cut waited on its own run. headCheckRows now takes the set-aside check run and workflow run ids and removes them from every list before ciAtHead reads it.

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 Nov 17, 2026
… head green while a check on it failed (GST-2252) (#4257)

* Make gstack-pr-wait, gstack-ci-gate and the release cut count a failed check hidden behind an empty rerun (GST-2252)

GitHub rollup and default check-runs list hold only each check suite latest attempt, so a rerun attempt with no jobs hid the failed run before it, and a workflow run that failed before any job never appeared. All three readers now add CI at the commit as the merge queue reads it (ciAtHead via lib/ci-head-checks.ts) and keep the worse bucket per check. Tests reuse the gstack-evals#303 recording from #4235.

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

* Have the release cut read every check attempt only for commits that pass its named checks (GST-2252)

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

* Say in the changelog that the release cut now counts failed commit statuses (GST-2252)

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

* Let the release cut set its own jobs aside in the every-attempt check read too (GST-2252)

After #4297 the cut sets aside check runs from its own workflow and the Windows nightly by job id, but the rows from lib/ci-head-checks.ts skipped that filter, so the cut waited on its own run. headCheckRows now takes the set-aside check run and workflow run ids and removes them from every list before ciAtHead reads it.

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