From 56c4e873b2a83074ff8c832a178f3f90f7f86bc4 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Mon, 9 Nov 2026 17:33:31 -0800 Subject: [PATCH] Stop the pre-merge check from accepting a half-finished run (GST-2194) (#4258) * Make pregate verify refuse a record from a partial run (GST-2194) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Update pregate and queue test fixtures to complete records Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Document that verify needs every check and that a staged rerun keeps the rest Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Skip the partial-record pregate tests on Windows, where the fixture lane is a remote obligation Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Give the crew queue tests complete pregate records The train, train-ops and wave tests wrote one-check pregate records, which verify now refuses as a partial run. They now write every registered check, as test/gstack-ship-queue.test.ts already does (CI free-suite run 42718782737). Review-Finding: lib/pregate/index.ts:251:functional-contract reader=core Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Explain the missing-checks pregate refusal in troubleshooting Documents that verify refuses a record missing registered checks, and that a fix commit needs a full gstack-pregate run (Step 14.5 docs audit). 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> --- bin/gstack-pregate | 15 ++- .../pregate-verify-refuses-partial-run.md | 4 + crew/test/ship-queue-train-ops.test.ts | 11 +- crew/test/ship-queue-train.test.ts | 15 ++- crew/test/ship-queue-wave.test.ts | 5 +- docs/pregate.md | 32 +++-- docs/troubleshooting.md | 15 ++- lib/pregate/index.ts | 31 ++++- test/gstack-ship-queue.test.ts | 25 ++-- test/pregate-clear-runs.test.ts | 2 +- test/pregate-flaky-exception.test.ts | 6 +- test/pregate-head-policy.test.ts | 1 + test/pregate-partial-record.test.ts | 119 ++++++++++++++++++ test/pregate-remote-gbrain.test.ts | 1 + test/pregate-remote-stamp-only.test.ts | 8 +- test/pregate-remote.test.ts | 1 + test/pregate-user-policy.test.ts | 5 +- test/ship-accept-remote-gate-lanes.test.ts | 4 +- 18 files changed, 250 insertions(+), 50 deletions(-) create mode 100644 changelog.d/pregate-verify-refuses-partial-run.md create mode 100644 test/pregate-partial-record.test.ts diff --git a/bin/gstack-pregate b/bin/gstack-pregate index cdf79cbd7..6c0b3c0ee 100755 --- a/bin/gstack-pregate +++ b/bin/gstack-pregate @@ -5,7 +5,7 @@ * gstack-pregate [run] [--stage preflight|tests|guards|all] [--only ] [--base ] * [--allow-repo-commands] [--policy-from base|head] [--out ] * [--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 verify [--out ] [--json] publication check: current tree, every registered check, no fail/incomplete, obligations cleared * gstack-pregate clear --remote --run-url | --run [--run …] [--allow-repo-commands] | --bundle-lane