Skip to content

v1.91.329.0 pregate: always run the whole-tree tests listed in .gstack/always-run.json (GST-167 PR 1, GST-98) - #3626

Merged
capy-ai[bot] merged 4 commits into
mainfrom
gst167-always-run
Oct 30, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
gst167-always-run

Conversation

@garrytan

@garrytan garrytan commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3626,
  "head": "f970eb9960981d09e040ebc75b6ffb1228757e30",
  "version": "1.91.324.0",
  "base": "main",
  "gate": {
    "cheap-checks": {
      "pass": 104,
      "fail": 0,
      "skip": 0
    },
    "remote_gate": {
      "pass": 10253,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "9773ed49ba96ac6f9f15341fd6b68fca241a7536",
  "product_patch_id": "1811fbc306ca42e027b53c49d944559f2cb1e226",
  "gstack_version": "1.91.324.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 46,
    "rules": "55726fab80631072",
    "base": "53db038c6ba6f1408e12418a4adaf61c21808607",
    "registry": "53db038c6ba6f1408e12418a4adaf61c21808607",
    "gate_scan": {
      "tagged": 0,
      "head": "f970eb9960981d09e040ebc75b6ffb1228757e30"
    },
    "reasons": [
      "gate-class",
      "runtime=46<=50"
    ]
  },
  "pregate": "requires-remote cleared @9773ed49ba96 (1 checks, current for f970eb996098)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/40964422549",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/40964422490",
    "pregate.json/remote_gate: remote-gate tree=9773ed49ba96 tests=10253"
  ],
  "issues": {
    "fixes": [],
    "refs": [
      3592,
      3593
    ],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/pregate.md and the pregate-selection passages of docs/ship-policy.md, docs/TESTING_INTERNALS.md, CONTRIBUTING.md, AGENTS.md, CLAUDE.md, docs/captain.md, docs/troubleshooting.md, README.md, ARCHITECTURE.md"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 6,
    "fixed": 0,
    "scope": "frozen",
    "dispatches": {
      "specialist": 6,
      "red-team": 1
    }
  }
}

What changed

gstack-pregate's lanes selection now always includes the whole-tree tests listed in a new .gstack/always-run.json: tripwires, ratchets, env-host fence conformance, free-fixtures, bun-entry-isolation and egress wiring. They are added whenever a branch selects any test, owes a lane, or edits the list itself. --explain prints each one as <test> (always_run, .gstack/always-run.json). A glob that matches nothing prints <glob> matches no test file. A docs-only branch adds nothing.

  • lib/pregate/lane-selection.ts: ALWAYS_RUN_PATH and alwaysRunTests() (malformed JSON or a non-string glob stops with a message naming the file); the list file is a pin file that pregate validates, so it owes no lane.
  • .gstack/always-run.json (new, force-added like pregate.json): gstack's list, which matches 15 test files. The 13 with a seed in scripts/free-test-durations.json (recorded 2026-10-19) total about 13 s there; bun-entry-isolation and launch-env-echo-ratchet have no seed yet. host-conformance, which runs ./setup, is deliberately left off.
  • docs/pregate.md: a section on the file and why it is separate from pregate.json (older readers reject unknown keys there).

On this branch, the remote pregate against main added 11 of the 15 tests to the selection (the other 4 were already selected by the import graph).

Why

GST-98 / GST-167 PR 1. A diff-selected pregate never maps a touched file to a scanner that reads the whole tree, so those scanners passed the selected gate and failed CI only after review. That happened on #3592 (egress and script-invocation tripwires) and #3593 (env-host fence conformance and free-fixtures), and cost about 4M tokens. Garry, 2026-10-29: "do it" on the GST-167 plan (handoffs/GSTA-151/gst167-plan-v2.md in the GStack Minder drive).

Blast radius

Pregate selection only: more tests run locally and on the remote gate for code PRs. CI workflows, the paid lane and the train are unchanged. gbrain sees no change unless it adds the file (handoffs/GSTA-151/gbrain-note.md).

Tests

test/pregate-always-run.test.ts (new, fails against main): covers a code change adding the scanner the graph never selects; the same change with no list file; a docs-only branch; an edit to the list; malformed lists; and gstack's own list, which names only tracked tests and includes the GST-98 scanners.

Approvals

Plan approved by Garry 2026-10-29 ("do it"), relayed by GStack Minder; autoplan run ap-20261029205119.

Issues

Refs #3592
Refs #3593

Pre-Landing Review

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=6 fixed=0 scope=frozen dispatches=7

Reviewers: a core checklist pass, one batched specialist pass (testing, maintainability, security, performance, simplification, state machines, red team), a native adversarial pass, and a cross-family outside voice (openai/gpt-6.1-sol). None of them found anything at the blocking floor. Before the review, /ship restored the tail of docs/pregate.md, which fa8fa63 had truncated by 498 lines.

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

Review notes

These are informational and were not looped, under crew rule 30:

  • lib/pregate/lane-selection.ts:28: the list is read from the branch's own tree, so a branch could drop a scanner it breaks from its own selected gate (CI still runs it). Follow-up: take the union with the merge-base list.
  • lib/pregate/lane-selection.ts:272: always-run tests in the Windows set add a Windows requires-remote obligation. That set already holds 1,421 tests, so nearly every code branch owed it before.
  • .gstack/always-run.json:3: single-segment globs leave out browse/test/server-route-dispatch-ratchet.test.ts.
  • test/pregate-always-run.test.ts: no bin-level case for a malformed list reaching PREGATE_INCOMPLETE.
  • docs/pregate.md: "tracked test file" also covers untracked files on disk, the same as graph selection.
  • Docs-only, stamp-only and inert branches skip the list by design, so a scanner over docs would not run on them.

Documentation

Status: current. The new .gstack/always-run.json section in docs/pregate.md is accurate, and no other doc contradicts it or needs a pointer.

Scope: 5 committed paths (53db038..f970eb9: .gstack/always-run.json, lib/pregate/lane-selection.ts, docs/pregate.md, CHANGELOG.md, test/pregate-always-run.test.ts); no staged, unstaged or untracked content. I read all of docs/pregate.md and searched docs/ship-policy.md, docs/TESTING_INTERNALS.md, CONTRIBUTING.md, AGENTS.md, CLAUDE.md, docs/captain.md, docs/troubleshooting.md, README.md and ARCHITECTURE.md for descriptions of pregate selection.

Documentation health:
docs/pregate.md Current (the new section matches the code; the 15-test count and the git add -f note checked out)
docs/ship-policy.md Current (no description of lanes selection)
docs/TESTING_INTERNALS.md Current (covers paid diff selection only)
CONTRIBUTING.md Current (links to the remote gate only)
AGENTS.md Current
CLAUDE.md Current (test selection there is the paid touchfile runner)
docs/captain.md Current (links to the remote gate only)
CHANGELOG.md Current ([Unreleased] entry, not polished in ship-owned mode)

Documentation coverage:
[entity] [reference] [how-to] [tutorial] [explanation]
.gstack/always-run.json ✅ docs/pregate.md ⚠️ partial (format, git add -f) ❌ ✅ docs/pregate.md

Documentation Debt

  • ⚠️ docs/pregate.md does not say whether .gstack/always-run.json is read from the branch or from origin/<base>. The code reads the branch's working tree, unlike pregate.json.
  • ⚠️ The empty-lane paragraph in docs/pregate.md says .gstack/ files still need a lane, but the pin files (pregate.json, generated.json, now always-run.json) owe none. This predates the branch.
  • Common gap: there is no worked how-to for adding a new whole-tree scanner to the list (reference only).

Diagram drift: none (ARCHITECTURE.md does not mention pregate).

Test plan

  • bun run typecheck, bun run typecheck:test (814 known diagnostics, none new), git diff --check: clean
  • bun test on the 10 pregate and ratchet files: 104 pass, 0 fail
  • Remote pregate at f970eb9 against main (Ubicloud): 323 files, 10,253 tests, 0 failed, $0.05; Windows and macOS lanes cleared from this head's CI runs
  • CI at f970eb9: 46 checks passed, 0 failed

Open in Capy

….json

A diff-selected run never maps a touched file to a scanner that reads the whole tree, so tripwires, ratchets and conformance tests passed the selected gate and failed CI after review (#3592, #3593). The lanes selection now adds every tracked test the list's globs name whenever the branch selects a test, owes a lane or edits the list.

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

trunk-io Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits October 29, 2026 21:56
…ations for the always-run list

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>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title pregate: always run the whole-tree tests listed in .gstack/always-run.json (GST-167 PR 1, GST-98) v1.91.329.0 pregate: always run the whole-tree tests listed in .gstack/always-run.json (GST-167 PR 1, GST-98) Oct 30, 2026
@capy-ai
capy-ai Bot merged commit de53aef into main Oct 30, 2026
63 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