From f33fd30b028106e67d5f47230ec93e60384b7f78 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Tue, 3 Nov 2026 00:34:42 -0800 Subject: [PATCH 1/6] v1.94.9.0 feat(pregate): owner-granted flaky exception for named cases in a red run (GST-1096) (#3911) * feat(pregate): owner-granted flaky exception for named cases in a red run (GST-1096) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(pregate): bind flaky exceptions to the consuming PR head, quote the grant command, recheck red runs (review fixes) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(changelog): plain wording in the flaky exception fragment 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> --- CHANGELOG.md | 12 + VERSION | 2 +- agents-digest/gstack-AGENTS.md | 2 +- bin/gstack-pregate | 32 ++- bin/gstack-ship-receipt | 8 +- docs/pregate.md | 85 ++++++ lib/headless-artifacts.ts | 8 + lib/pregate/flaky-exception.ts | 403 +++++++++++++++++++++++++++ lib/pregate/index.ts | 46 ++- lib/pregate/run-check.ts | 4 +- lib/run-evidence.ts | 43 +++ lib/ship-queue.ts | 7 + lib/ship-receipt.ts | 2 +- package.json | 2 +- test/pregate-flaky-exception.test.ts | 317 +++++++++++++++++++++ 15 files changed, 948 insertions(+), 25 deletions(-) create mode 100644 lib/pregate/flaky-exception.ts create mode 100644 test/pregate-flaky-exception.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e7fd0818..cd6d79e28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.94.9.0] - 2026-11-03 + +**A pull request can clear its remote gate obligation from a run with named flaky failures, once the owner grants it (GST-1096).** A timing flake in a test file the pull request never touched used to keep the pregate red with no way through but another paid run. `gstack-pregate clear --remote --run --flaky-exception "::" --pr --grant ` now accepts such a run when every failure is named from the run's own shard results and logs, at most three cases, each file outside the pull request's diff and its import closure, none paid and none a security scan test, and a gstack-approvals row in the owner's words binds the repository, PR, head, tree, lane, run attempt and cases. It covers the pregate only, and a red required CI check still needs its own green run. + +### Added +- **`--flaky-exception`, `--pr` and `--grant` on `gstack-pregate clear`** (`lib/pregate/flaky-exception.ts`). Every job of the run attempt is reconciled (only test-shard jobs and their aggregate may fail), every planned shard needs a complete result, and each failed shard's log must name no failure its result leaves out. Without `--grant` the clear checks everything and prints the exact `gstack-approvals add` command, whose scope is a digest of everything the grant binds, so a grant can never be moved to another head or case list. +- **`pass-with-exception`.** pregate.json records `exceptions`; `gstack-pregate verify` re-checks the binding offline and prints `PREGATE: pass-with-exception (; grant )`; `gstack-ship-queue ready` accepts it and prints a `FLAKY_EXCEPTION:` line; the ship receipt records `flaky_exception`. +- **docs/pregate.md#flaky-exception**, including why `base_red` is not used: it proves a failure by reproducing it on the base, and a timing flake passes there. + +### Tests +- `test/pregate-flaky-exception.test.ts`: a red run with one named flake clears once the bound grant exists, and verify, ready and the receipt report it; refusals for an unnamed or extra failure, a case that did not fail, more than three cases, an unattributed failure, a failed non-shard job, a missing result or log, a timed-out shard, a log failure the result omits, a file in the diff or its import closure, a paid or security test, another head, another PR head, a newer run, a run from another repository or fork, a stale or unfinished run, a moved attempt (also after the inventory runs), and a grant with another scope, outcome or speaker; ready still refuses red CI, and refuses an exception granted for another PR or head. The printed grant command quotes case names for the shell. These tests failed before the change. + ## [1.94.8.0] - 2026-11-03 **`gstack-approvals render` no longer puts the owner's exact words, autoplan run ids or plan hashes into PR bodies on public repositories (GST-1160).** On a public repo, /ship pasted the full `## Approvals` table into the PR description. That table carries the owner's verbatim quote, the run id and the plan sha256, and GitHub keeps every earlier version of a description in its edit history, which no API can delete. diff --git a/VERSION b/VERSION index c0460b1e3..eb726c996 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.94.8.0 +1.94.9.0 diff --git a/agents-digest/gstack-AGENTS.md b/agents-digest/gstack-AGENTS.md index 48d8520f5..ba11f3a5f 100644 --- a/agents-digest/gstack-AGENTS.md +++ b/agents-digest/gstack-AGENTS.md @@ -1,4 +1,4 @@ -# gstack digest v1.94.8.0 — regenerate/re-copy after upgrading gstack +# gstack digest v1.94.9.0 — regenerate/re-copy after upgrading gstack Behavioral rules from gstack (https://github.com/garrytan/gstack), compressed for agent hosts without a full skill install. The full skills add workflows, diff --git a/bin/gstack-pregate b/bin/gstack-pregate index 3ea31c0bd..c14279033 100755 --- a/bin/gstack-pregate +++ b/bin/gstack-pregate @@ -7,6 +7,7 @@ * [--timeout ] [--stall-timeout ] [--remote --spend-cap ] [--run ] [--from-run ] [--no-ci-carry] [--explain] [--json] * gstack-pregate verify [--out ] [--json] publication check: current tree, no fail/incomplete, obligations cleared * gstack-pregate clear --remote --run-url | --run [--run …] [--allow-repo-commands] | --bundle-lane