Skip to content

v1.94.27.0 feat(pregate): housekeeping guards before every push (GST-1138) - #3923

Merged
capy-ai[bot] merged 7 commits into
mainfrom
gsta258-l6-prepush-guards
Nov 3, 2026
Merged

capy-ai[bot] merged 7 commits into
mainfrom
gsta258-l6-prepush-guards

Conversation

@garrytan

@garrytan garrytan commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3923,
  "head": "5660d09adca37c6d572ebf9d3a4aa4dc7cf2a894",
  "version": "1.94.19.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1560,
      "fail": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 41655486773,
      "attempt": 1,
      "tree": "a433e43e18375127f5be69c455f29ce5a43db6d0"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "a433e43e18375127f5be69c455f29ce5a43db6d0",
  "product_patch_id": "24ac63e48154d3639ce2824f0981e699b646b278",
  "gstack_version": "1.94.19.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 118,
    "rules": "19881e1ecf7ed1ad",
    "base": "2f9d11a59d68822c36b3e03fb3e535f48a8ace96",
    "registry": "2f9d11a59d68822c36b3e03fb3e535f48a8ace96",
    "gate_scan": {
      "tagged": 0,
      "head": "5660d09adca37c6d572ebf9d3a4aa4dc7cf2a894"
    },
    "reasons": [
      "gate-class",
      "runtime=118"
    ],
    "risk": []
  },
  "pregate": "requires-remote cleared @a433e43e1837 (7 checks, current for 5660d09adca3)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41655486773/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=a433e43e1837 tests=34823 skipped=70 runs=41655486773/1 profiles=ci-reuse/free-tests heads=5660d09adca3 verified=2026-11-03T14:43:53.810Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "blocked",
    "scope": "ship/SKILL.md.tmpl Step 17 and ship/sections/tests.md.tmpl early-push prose (audit l6docs2); docs inputs changed by the 2f9d11a59 base merge (bin/gstack-pregate, docs/pregate.md, lib/pregate/index.ts, lib/ship-release.ts)",
    "exception": {
      "accepted_by": "GSTA-258",
      "date": "2026-11-03",
      "via": "GSTA-258 message to L6 (docs named risk, #3923 base merge; trail row 19)",
      "reason": "the 2f9d11a59 base merge changed docs inputs (main's #3929 edits); #3923's own docs lines are unchanged since l6docs2; #3934's audit of the merged docs/pregate.md covers the gap"
    }
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 2,
    "deferred": 0,
    "noted": 1,
    "fixed": 5,
    "scope": "frozen",
    "fix_checks": 2,
    "rounds": 4,
    "unrecorded": 1,
    "ledgers_read": 3,
    "dispatches": {
      "specialist": 3,
      "red-team": 2
    }
  },
  "review_loop_exception": {
    "accepted_by": "GStack Minder",
    "date": "2026-11-03",
    "via": "GSTA-258 (GSTA-36 choice A, #3923 base merge)",
    "reason": "one scoped reader on the docs/pregate.md seam at 5660d09ad, #3923's second exception, no further rounds",
    "fix_check": {
      "head": "5660d09adca37c6d572ebf9d3a4aa4dc7cf2a894",
      "findings": 0,
      "files": [
        "docs/pregate.md"
      ]
    }
  }
}

Why

Housekeeping checks used to fail only after a push, in CI. gbrain had 64 of 93 red heads from checks like typecheck, the size guards and generated-file freshness, and #3908 went red on the context-budget ratchet. Running those checks before every push turns a lost CI round into a local stop with a fix line.

Summary

  • gstack-pregate --stage guards --allow-repo-commands runs only generated-file freshness (regen) and the repo's guards, each only for the files the branch touched, and writes .gstack/tmp/pregate-guards.json so it never replaces the full run's record.
  • gstack-ship-release push runs it before every push, early or final, prints GUARDS:, and stops with the failing guard's fix while pushing nothing. A pass already recorded at HEAD's exact tree is reused.
  • Push skips the guards only when origin holds no other branch, refuses when HEAD moves during the run, and a dirty-tree stop names the failing guards.
  • gstack declares its own guards in .gstack/pregate.json: typecheck, the skill size guards, the parity suite, the context-budget ratchet, the module-size ratchet, the /ship goldens and the CLAUDE.md size cap.

GST-1138 (ship-90-90 plan, lane L6 of GSTA-258). The brief named a prepush_guards key in ship-policy.json; this uses the existing pregate.json guards key, which every gstack at or above this repo's version floor already reads, so the floor does not move.

Blast radius

Every gstack-ship-release push in a repo that declares guards now runs them first. Security note: push now makes a git ls-remote call to origin and runs the repo's own guard commands before pushing; both already happen elsewhere in /ship (Step 17 and the pregate), and nothing new reads secrets or widens permissions.

Test Coverage

  • test/pregate-guards.test.ts: --stage guards runs only regen and guards, writes its own record and refuses --only and --from-run; gstack's guard list validates and fires only on its own inputs.
  • test/ship-release.test.ts: a failing guard stops the push and pushes nothing; a same-tree pass is reused and a new commit reruns the guards; the skip and HEAD-moved rules. On main, all five new tests fail.

Pre-Landing Review

REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=1 fixed=5 scope=frozen unrecorded=1 ledgers_read=3 fix_checks=2 dispatches=5

Full depth (gate class). Pass 1 found one CRITICAL (push guards could certify a tree other than HEAD's), fixed in e9b98e2. Pass 2 found one CRITICAL (a missing base skipped the guards), fixed in f44e61c and c85d3e6. One scoped fix-check (grant a-fffcf58cab70) left one informational note: no test yet asserts the fix-check's INFORMATIONAL path at test/ship-release.test.ts:393.

Base merge (rule 19, GStack Minder's grant at 2f9d11a). 5660d09 merges main, which now carries #3929. The only conflict was docs/pregate.md, where this PR's #prepush section and #3929's #guard-carry section were inserted at the same spot; both are kept, #prepush first. This PR's own lines are byte-identical to c85d3e6, and only the neighboring context moved. One scoped reader read the seam at 5660d09 and found nothing.

Review-loop exception: accepted by GStack Minder 2026-11-03 via GSTA-258 (GSTA-36 choice A, #3923 base merge): one scoped reader on the docs/pregate.md seam at 5660d09, #3923's second exception, no further rounds (fix-check at 5660d09, 0 findings)

Issues

GST-1138 (Capy issue).

Documentation

Scope: docs/pregate.md (#prepush section and the finish/push/accept paragraph), checked against lib/ship-release.ts push() and lib/pregate/index.ts; then the docs inputs the 2f9d11a base merge changed (bin/gstack-pregate, docs/pregate.md, lib/pregate/index.ts, lib/ship-release.ts).

Result: blocked. Audit l6docs1 corrected docs/pregate.md. Audit l6docs2 found /ship Step 17 and the early-push text (ship/SKILL.md.tmpl, ship/sections/tests.md.tmpl) still describe the old push order. That fix moved to #3929 so this PR ships at its reviewed head. The later base merge changed docs inputs with no audit left in the budget.

Documentation exception: accepted by GSTA-258 2026-11-03 via GSTA-258 message to L6 (docs named risk, #3923 base merge; trail row 19): the 2f9d11a base merge changed docs inputs (main's #3929 edits); #3923's own docs lines are unchanged since l6docs2; #3934's audit of the merged docs/pregate.md covers the gap

Debt: no CONTRIBUTING "Which command do I run?" row for --stage guards.

Test plan

  • CI green at 5660d09, every check; Free Tests run 41655486773 carried: LANE: free carried run=41655486773/1 tests_ran=1560 (files)
  • gstack-pregate verify ok on the stamped tree; remote gate cleared from run 41655486773 (skipped=70), macOS lane from the same run
  • Focused tests after the merge: test/ship-release.test.ts and test/gstack-clean-producers.test.ts green; test/pregate-guards.test.ts green except the per-process timing case, which also fails at bun's 5 s default on main 2f9d11a and passes with a 30 s limit (tracked on GSTA-262's flaky lane)

gstack: ok 1.94.19.0 for=ship

…s them, gstack's guard list) (GST-1138)

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 4 commits November 3, 2026 04:30
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ssing base; classify pregate-guards.json; cover finish-record reuse

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ch; a refused run or unreachable origin stops

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ranch; HEAD must not move during the run; a dirty-tree stop names failing guards

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot marked this pull request as ready for review November 3, 2026 07:34
capy-ai Bot added a commit that referenced this pull request Nov 3, 2026
…e carry of runner-skipped files, path-skipped jobs (GST-1186, GST-1189, GST-1190) (#3929)

* feat(pregate): a guard that already passed at this tree carries from CI or the ledger (GST-1186)

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

* feat(ci-carry): jobs-mapped lanes, aliases, narrow-lane counts, --simulate proof, policy-base check on carried (GST-1189, GST-1190)

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

* fix(ci-carry): a file whose every test skipped on CI is not carried; tree.json records skipped_files (GST-1190)

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

* feat(ci-carry): path-skipped jobs count only under an unchanged gate; find --policy-from head --simulate (GST-1190)

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

* ship: name the pre-push guards in Step 17 and the early push (moved from #3923 per GSTA-258)

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

* ci-carry: per-file lane carry for runner-skipped files; review fixes (gate inputs, passed ignores CI rows, simulate consent, pull_request-only skips, guard not-owed)

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

* ship: Step 17 names the pre-push guards without a code this branch cannot print

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

* pregate: gstack's bun run test lane runs its runner-skipped files with per_file

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

* ci-carry: a per_file remainder must run tests here and the carried runs must still stand (l6c-p2)

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

* ci-carry: read record-ci from its own last record line; the remainder's count must come from this run's row (l6c-p2 red-team)

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

* test(ci-tree-reuse): type the skipped_files fixture for the test typecheck ratchet

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

* Revert "pregate: gstack's bun run test lane runs its runner-skipped files with per_file"

This reverts commit fafbae5.

* ci-carry: ship the skipped_files reader inert; gstack's writer and per_file move to the adoption PR; Step 17 keeps its refs/heads marker

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

* docs: guard carry, per_file and the too-old message in pregate and troubleshooting (docs audit l6cdocs2)

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

* gstack-evidence record-ci: recheck the working tree after the post-remainder run recheck (#3929 second fix-check)

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

* windows-curation: exclude test/ship-ci-carry.test.ts like its ship-bin-fixture siblings (the path-scoped Windows check runs it at its first spawn)

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>
…l6-prepush-guards

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

# Conflicts:
#	docs/pregate.md
capy-ai Bot added a commit that referenced this pull request Nov 3, 2026
…ry warning and record-ci recheck order (GSTA-258 L6 follow-up) (#3934)

* feat(pregate): a guard that already passed at this tree carries from CI or the ledger (GST-1186)

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

* feat(ci-carry): jobs-mapped lanes, aliases, narrow-lane counts, --simulate proof, policy-base check on carried (GST-1189, GST-1190)

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

* fix(ci-carry): a file whose every test skipped on CI is not carried; tree.json records skipped_files (GST-1190)

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

* feat(ci-carry): path-skipped jobs count only under an unchanged gate; find --policy-from head --simulate (GST-1190)

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

* ship: name the pre-push guards in Step 17 and the early push (moved from #3923 per GSTA-258)

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

* ci-carry: per-file lane carry for runner-skipped files; review fixes (gate inputs, passed ignores CI rows, simulate consent, pull_request-only skips, guard not-owed)

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

* ship: Step 17 names the pre-push guards without a code this branch cannot print

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

* pregate: gstack's bun run test lane runs its runner-skipped files with per_file

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

* ci-carry: a per_file remainder must run tests here and the carried runs must still stand (l6c-p2)

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

* ci-carry: read record-ci from its own last record line; the remainder's count must come from this run's row (l6c-p2 red-team)

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

* test(ci-tree-reuse): type the skipped_files fixture for the test typecheck ratchet

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

* Revert "pregate: gstack's bun run test lane runs its runner-skipped files with per_file"

This reverts commit fafbae5.

* ci-carry: ship the skipped_files reader inert; gstack's writer and per_file move to the adoption PR; Step 17 keeps its refs/heads marker

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

* docs: guard carry, per_file and the too-old message in pregate and troubleshooting (docs audit l6cdocs2)

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

* gstack-evidence record-ci: recheck the working tree after the post-remainder run recheck (#3929 second fix-check)

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

* gstack-evidence: sum bun --shard processes in a lane's tests_ran; docs: dispatch-carry warning and record-ci recheck order (GBEV-3, GSTA-258 L6 follow-up)

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

* gstack-evidence: keep shard and count lines that leave the output tail; sum only shards 1..N in order; soften the dispatch-carry mechanism claim (l6f-p1 fixes)

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

* ci-carry: a pull_request run whose base moved names the one-command dispatch fix (TRUT-7)

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

* docs: the tree_mismatch refusal names its fix command (l6fdocs3)

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

* ci-carry: a pull_request run that recorded its merge tree names the base-moved fix (the real tree_mismatch path; #3934 fix-check)

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>
@github-actions github-actions Bot changed the title feat(pregate): housekeeping guards before every push (GST-1138) v1.94.27.0 feat(pregate): housekeeping guards before every push (GST-1138) Nov 3, 2026
@capy-ai
capy-ai Bot merged commit 208d0c8 into main Nov 3, 2026
50 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