Skip to content

/ship stops instead of running the whole test suite here when CI's run can't be reused (GST-3277) - #4565

Merged
capy-ai[bot] merged 3 commits into
mainfrom
ship-preflight-stops-when-ci-cannot-be-reused
Nov 20, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
ship-preflight-stops-when-ci-cannot-be-reused

Conversation

@garrytan

@garrytan garrytan commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

gstack-ship-preflight now stops with SHIP_LANE_NOT_CARRIED whenever a test suite mapped to CI has no reusable CI run, in a full preflight as well as --tests-only; --run-uncarried-here still runs it here.
Why: a full preflight on gbrain-evals#547 ran the whole suite locally for 7 minutes after CI's run went stale, and the stop told an outside-author PR to dispatch a workflow that has no workflow_dispatch trigger.
Nothing to do: a workflow that can't be dispatched now gets "merge the base and push it, or ask the author to" instead.

What changed

A /ship run on gbrain-evals#547 spent 7 minutes running the whole test suite on a small machine because CI's run no longer matched the tree, and the stop it printed suggested a gh workflow run the workflow could not accept. Now every preflight, full or --tests-only, stops before any test suite mapped to CI runs when CI's run can't be reused, whatever the reason. The stop names a route that works. It says to dispatch the workflow when it takes workflow_dispatch, and otherwise to merge the base and push it (or ask the pull request's author to). After a full preflight, the stop says to rerun with --tests-only, because rerunning the same full command with --run would stop on its own open run. --run-uncarried-here is accepted in both modes and still runs the suite here.

Why

Running the full suite locally can take most of an hour on a 4-CPU machine, and CI already runs it. The stop keeps that work in CI and gives advice that works on outside pull requests.

Blast radius

The change touches gstack-ship-preflight's test step, the CI-reuse fix text in lib/run-evidence.ts and the CI-reuse lookup, and gstack-pregate clear's run check. The dispatch check only reads workflow files from git and changes advice text, never whether a CI run is reused (lib/pregate/workflows.ts:231 read; both new tests and test/ship-ci-carry.test.ts ran).

Test Coverage

Coverage: 9 of 13 new paths covered (69%), every covered path at two stars or better. Tests: 1838 → 1838 (+0 new by the audit; the PR adds one new test file for this stop).
Regression proof: fails at HEAD: yes (2 of 2 assertion failures on pre-fix code) · passes at base: unavailable (the test is new) · passes after fix: yes.
Gaps, as proposed tests: no_tests wording on a profile that can't be dispatched; gstack-pregate clear's dispatch wiring; mixed dispatchable and push-only profiles in one stop; a test suite that isn't mapped to CI still runs in a full preflight.
Tests ran: test 1719 (files; 38505 tests) from CI run 44768253420.

Pre-Landing Review

One fix: a full preflight's stop said "rerun this command", which with --run stops again on the run's own open marker. It now points to the --tests-only rerun (41e5602). A scoped re-review of the fix found nothing blocking.

Review notes

Below the blocking floor; recorded here and not fixed in this PR.

  • INFORMATIONAL CI-reuse lookup (line 84) The dispatch check runs once per candidate run inside the loop.
  • INFORMATIONAL lib/pregate/workflows.ts:231 An unreadable ref or workflow reads as not dispatchable; a reusable workflow whose caller takes workflow_dispatch gets push-only advice.
  • INFORMATIONAL lib/ship-preflight.ts:238 The push-only NEXT line drops "commit this tree".
  • INFORMATIONAL lib/ship-preflight.ts:310 A full preflight no longer falls back to running the suite here; profiles that accept only pull_request on a fast-moving base rely on --run-uncarried-here.
  • INFORMATIONAL lib/ship-preflight.ts:236 The --tests-only rerun hint names the base and the test-suite flags but not --policy-from, --timeout, --step-timeout or the concurrency flag.
  • INFORMATIONAL The new test (line 84): the push-only NEXT line is asserted only under --tests-only.
  • INFORMATIONAL ship/sections/tests.md.tmpl:34 The skill text says to rerun with --run-uncarried-here without naming --tests-only.

Exploratory QA

Functional smoke, 2 probes, both pass: bin/gstack-ship-preflight --help documents the full-preflight stop and flag; the read-only CI-reuse lookup on this repo accepted CI run 44757538558 at the first head. The stop paths are covered by the new tests rather than a live probe, since a live refused preflight with a test suite could start the suite on the QA machine.

Eval Results

No PR evals selected: the selector maps the changed libraries to scheduled and release coverage, and CI's eval route skipped eval slices.

Scope Drift

Scope Check: CLEAN

TODOS

No TODO items completed in this PR.

Documentation

Scope: The audit covered the GST-3277 branch diff against base bd04289 at tree eff71ef40bd209fc458fdde0055d99ecdd93f710. The working tree was clean, with no staged, unstaged or new files. The diff changes how gstack-ship-preflight behaves: a full preflight now stops with SHIP_LANE_NOT_CARRIED, gives advice when a run can't be dispatched, and suggests rerunning with --tests-only. I checked docs/pregate.md, docs/ship-policy.md, docs/troubleshooting.md and ship/sections/tests.md (and its .tmpl) against lib/ship-preflight.ts, lib/pregate/workflows.ts and the preflight help text.

Result: Current. Every doc the code change touches already matches it, so I edited no files. A search across the whole repo found no leftover description of the old full-preflight behavior. The changelog.d fragment exists.

Debt: None found.

Tests

  • CI free suite (run 44768253420 at 2d416b5): green, its run reused here (38505 tests)
  • bun run typecheck: 0 errors
  • bun test test/ship-preflight-carry-stop.test.ts test/ship-ci-carry.test.ts test/module-size-ratchet.test.ts: 63 pass, 0 fail
Agent notes

Issue GST-3277, from GBEV-115 (gbrain-evals#547, gstack 1.102.0.0). Out of scope: carry matching rules, adding workflow_dispatch anywhere.

Refs GST-3277

Approvals

No approvals recorded for branch ship-preflight-stops-when-ci-cannot-be-reused.
Plan: exempt: bug fix with a failing-first test (crew rule: bug fixes skip plan review)
Plan check: exempt bug fix

Gate edits: none detected

{
  "schema_version": 1,
  "pr": 4565,
  "head": "2d416b59f4c32d50cf6bdcad6ad12426784271aa",
  "version": "1.102.0.0",
  "base": "main",
  "gate": {
    "test": {
      "pass": 1719,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 44768253420,
      "attempt": 1,
      "tree": "eff71ef40bd209fc458fdde0055d99ecdd93f710"
    }
  ],
  "calls": 35,
  "session_kind": "unattended",
  "run": "gst3277-ship",
  "head_tree": "eff71ef40bd209fc458fdde0055d99ecdd93f710",
  "product_patch_id": "7ff9d34b2edb7e1dbeb5e504918ffa0d98fbba01",
  "gstack_version": "1.102.0.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 60,
    "rules": "3e7e9d5d0a0d8879",
    "base": "bd0428974aaf2caa89e878e593c6505b35ad82ab",
    "registry": "bd0428974aaf2caa89e878e593c6505b35ad82ab",
    "gate_scan": {
      "tagged": 0,
      "head": "2d416b59f4c32d50cf6bdcad6ad12426784271aa"
    },
    "reasons": [
      "runtime=60"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @eff71ef40bd2 (8 checks, current for 2d416b59f4c3)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44768253420/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44766536388/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=eff71ef40bd2 tests=38505 skipped=104 runs=44768253420/1 profiles=ci-reuse/free-tests heads=2d416b59f4c3 verified=2026-11-20T16:06:27.960Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md and ship/sections against the branch diff"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 1,
    "deferred": 0,
    "noted": 9,
    "fixed": 1,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 3,
    "dispatches": {
      "specialist": 1,
      "red-team": 1
    }
  },
  "gate_dispositions": []
}

Open in Capy

…n can't be reused (GST-3277)

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

trunk-io Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 2 commits November 20, 2026 15:29
… works

A full preflight that stops on a lane CI can't reuse now says to rerun with --tests-only and the same lanes, because rerunning the same full command with --run stops on its own open run.

Review-Finding: p1/adversarial-native#1 reader=adversarial-native
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>
@capy-ai
capy-ai Bot merged commit 6121a19 into main Nov 20, 2026
82 of 83 checks passed
@garrytan garrytan mentioned this pull request Nov 20, 2026
capy-ai Bot added a commit that referenced this pull request Nov 20, 2026
- Two /ship approval records stop needing workarounds. (#4549)
- For contributors: the paid auto-decide check counts a start step that ran while the skill loaded. (#4543)
- The destructive-command check closes three ways past its disk-wipe and force-push blocks. (#4534)
- A green CI run still counts when the repository's artifact storage is full. (#4536)
- `/cso` now audits repositories that track symlinks. (#4567)
- A doc-sync eval stops failing when the audit child drops one field from its result line. (#4555)
- The browse daemon no longer picks port 10080, which Chromium refuses to open. (#4554)
- Opted-in telemetry now says why a skill run ended, which coding agent and model family ran it, and whether an upgrade worked. (#4542)
- A preregistration with only its write-up and plain data now gets the write-up review: one reviewer, one round. (#4544)
- When owner rulings don't clear a stopped review, `gstack-review-read` now says which findings are left. (#4553)
- The prompt-routing hook now names your installed bug-fix skill on bug reports, alone, and never puts /verify ahead of it. (#4539)
- Owner rulings now close a stopped review whose findings were logged in a findings file. (#4568)
- /ship can finish after the owner accepts a stopped review's findings as open notes. (#4552)
- /ship no longer starts the full test suite on your machine when CI's earlier run can't be reused (GST-3277). (#4565)
- The prompt-routing hook no longer acts on words inside backticks. (#4566)
- In Claude Code, a gstack skill's start step now runs when the skill loads, so the model can't skip it. (#4509)
- gstack's telemetry backend only accepts writes through its own validated endpoint, and the community dashboard now counts real use. (#4537)
- gstack now says what it's adding before it adds a background job or a browser extension. (#4538)
- For contributors: every flaky pass in Free Tests is now recorded. (#4572)
- For contributors: Free Tests on pull requests starts its test shards one round of small jobs sooner. (#4570)
- Secret values written as `name=value` at the end of a path are now hidden. (#4571)

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