Skip to content

/ship reuses CI's passing run when a base merge changed no file, and stops before long local test runs or an unknown base (GST-3019) - #4461

Merged
capy-ai[bot] merged 2 commits into
mainfrom
ship-reuses-same-tree-ci-run-and-stops-before-long-local-tests
Nov 17, 2026
Merged

capy-ai[bot] merged 2 commits into
mainfrom
ship-reuses-same-tree-ci-run-and-stops-before-long-local-tests

Conversation

@garrytan

@garrytan garrytan commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

/ship's preflight and its CI-run lookup now reuse a passing CI test run when a base merge left the files unchanged, stop instead of quietly starting an hour-long test suite on the local machine, and refuse a --base that names no commit instead of reporting an empty diff.
Why: gbrain #9662 lost a green CI run to a no-op base merge, then ran a 50-minute suite on a 4-CPU box, and its audit read a commit sha as a branch and saw zero changed files.
Nothing to do: --run-uncarried-here restores running an uncovered suite locally under --tests-only.

What changed

A merge of the base branch that changed no file used to throw away the green CI run of the commit before it, so /ship fell back to running the whole free suite on a small machine. Now a verified CI run of an earlier commit counts when git reads that commit's file tree as identical to HEAD's (git rev-parse <sha>^{tree}), under every existing rule: same workflow, event, jobs and command, newest attempt, freshness, and a tree.json naming that tree. Only HEAD's newest 20 ancestors are candidates, and a newer red or running run on any of them still blocks. The output names the commit and run it used (CI_CARRY_FROM:, and from=<sha> (same tree as HEAD) on the Step 5 line).

gstack-ship-preflight --tests-only now checks every mapped test suite read-only before anything starts. If one has no passing CI run to reuse, it starts nothing and stops with SHIP_LANE_NOT_CARRIED, naming the CI workflow to dispatch; --run-uncarried-here runs it on this machine instead.

--audit --base <commit sha> now diffs against that commit, and a base that names no commit stops with SHIP_BASE_UNKNOWN instead of reporting zero changed files.

The review found two problems, fixed in 6b83917 with tests written first: a docs-only CI run skipped at an earlier commit now counts only when HEAD itself is docs-only against the base, and the --tests-only stop no longer runs one suite's per-file leftovers before noticing another suite has no CI run.

Why

CI is the one full test run for gstack. Reusing an identical tree's run and refusing to start long suites by surprise keeps /ship fast on small machines without weakening what counts as tested.

Blast radius

The change touches the CI-run lookup that /ship's preflight, its evidence recorder and its local gate check all share, plus gstack-ship-preflight --tests-only. It stays safe because git, not the run's own record, decides tree identity, and every earlier rule still applies to the earlier commit. That was read in treeTwins and newestVerified and exercised by the negative controls in the three changed test files (104 targeted tests ran and passed).

Test Coverage

All new code paths have test coverage.
Tests: 1801 → 1801 test files (the two review-fix tests went into existing files).
Coverage: 100% value-weighted (100% including 0 weakly covered paths).
Test value: 0 tests written, 1 rejected by the authoring gate, 0 existing tests extended, 0 paths weakly covered.
Tests ran: test 1683

Pre-Landing Review

Two blocking problems were found by the second-model review and fixed (see What changed). Everything else is below the blocking floor and listed in the Agent notes: stale --tests-only advice in the release helper and the /ship driver, a race where waiting can return an earlier commit's finished run, a date-ordered ancestor window, extra GitHub API calls per identical commit, tests that read git history, a hex-looking base resolving a local branch first, and the new read-only check ignoring test exceptions. Two in-diff notes were skipped as below the floor: the SHIP_LANE_NOT_CARRIED text says "nothing ran here" even when a per-file leftover ran, and the 20-commit ancestor window is ordered by commit date across both parents.
Second-model review (openai/gpt-6.1-sol): completed, 2 blocking findings, both fixed.

Exploratory QA

Smoke checks at 8718f0d, all passed: --audit --base 0000000deadbeef stops with SHIP_BASE_UNKNOWN (exit 3); --audit --base e1cfceae6a34 diffs 17 files; --run-uncarried-here without --tests-only is a usage error (exit 2). No plan checks (bug fix, no plan).

Eval Results

One prompt template changed (ship/sections/tests.md.tmpl, three lines of Step 5 prose). The pull request eval route planned no paid cases, so no paid evals ran here; the scheduled paid gate on main covers them.

Scope Drift

Scope Check: CLEAN

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). This is a bug fix exempt from planning.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. The branch's own docs already describe every change, so no edits were needed.

Scope: base e1cfcea to head 6b83917 (2 commits, 18 files, nothing staged, unstaged or untracked). The changes: reusing CI runs from earlier commits that have HEAD's exact tree (CI_CARRY_FROM), gstack-ship-preflight --tests-only stopping with SHIP_LANE_NOT_CARRIED (and the --run-uncarried-here override), --audit --base <sha> resolving to a commit or stopping with SHIP_BASE_UNKNOWN, and a docs-only skipped run at an earlier commit counting only when HEAD is docs-only too.

Documentation health:

  • docs/pregate.md (the local gate check guide): current (same-tree commits, --tests-only stop, the docs-only reuse rule)
  • docs/ship-policy.md: current (preflight result codes table)
  • docs/troubleshooting.md: current (the two new stop codes)
  • ship/sections/tests.md.tmpl and tests.md: current and matching each other
  • ship/DRIVER.md and ship/DRIVER.md.tmpl: current

Coverage debt: none critical. Each new flag, output line and stop code has reference and how-to coverage. Diagram drift: none in scope.

Tests
  • CI Free Tests run 44171137012 at 6b83917: green, 37562 tests (1683 test files' results reused for the free suite)
  • bun test on the four changed test files (docs-only reuse, CI-run reuse, /ship reuse end to end, preflight): 104 pass, 0 fail
  • bun test on the head-policy test of the local gate check: 17 pass, 0 fail
  • bun test test/module-size-ratchet.test.ts test/spawnsync-timeout-tripwire.test.ts: 9 pass, 0 fail
  • bun run typecheck: clean

Open in Capy

Agent notes

Captain GStack Minder (GSTA-36), lane GSTA-593, issue GST-3019. Out of scope: other carry policy, the receipt stub (GST-3007), lib/review-ledger.ts and lib/ship-release.ts (untouched).

Approvals

No approvals recorded for branch ship-reuses-same-tree-ci-run-and-stops-before-long-local-tests.
Plan: exempt: bug fix

REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=4 fixed=2 scope=frozen ledgers_read=4 dispatches=8
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL lib/ship-release.ts:707 accept's refusal remediations still say 'run it here with gstack-ship-preflight --tests-only', which now stops with SHIP_LANE_NOT_CARRIED for a mapped lane that does not carry
  • INFORMATIONAL ship/DRIVER.md.tmpl:84 driver's fix programs gate on --tests-only and do not name the SHIP_LANE_NOT_CARRIED stop or --run-uncarried-here
  • INFORMATIONAL lib/ship-release.ts:707 accept refusals and ship/DRIVER.md.tmpl still advise plain --tests-only, which now stops with SHIP_LANE_NOT_CARRIED
  • INFORMATIONAL lib/ci-carry.ts:176 wait can report an ancestor's completed run before HEAD's own run registers
  • INFORMATIONAL lib/run-evidence.ts:401 ancestor window is commit-date ordered across parents and 40-hex only
  • INFORMATIONAL lib/ci-carry.ts:76 runsForHead REST calls multiply per same-tree commit without caching
  • INFORMATIONAL lib/ci-carry.ts:60 same-tree carry ignores tests that read git history; pregate re-check vetoes only on HEAD
  • INFORMATIONAL lib/ship-audit.ts:72 a hex-looking --base resolves a local ref before origin/
  • INFORMATIONAL lib/ship-bin-common.ts:232 the read-only find pre-check ignores test-lane exceptions, so an exception-only lane counts as refused and its exception preflight can still run before the hold
  • INFORMATIONAL lib/ship-bin-common.ts:232 under hold each mapped lane looks its runs up twice (find, then record-ci), and find uses bin()'s 600 s default timeout

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

{
  "schema_version": 1,
  "pr": 4461,
  "head": "6b839173e0cd88c1b1e906886c1feaf523ca60cf",
  "version": "1.100.0.0",
  "base": "main",
  "gate": {
    "test": {
      "pass": 1683,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 44171137012,
      "attempt": 1,
      "tree": "20fae95a6670ef5ac014e510812b904442f32ac3"
    }
  ],
  "calls": 35,
  "session_kind": "unattended",
  "run": "run",
  "head_tree": "20fae95a6670ef5ac014e510812b904442f32ac3",
  "product_patch_id": "fe90a486a9f532cdbfca0ab183e1d8f7022a6c7a",
  "gstack_version": "1.100.0.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 191,
    "rules": "eea6cc4231b53b9e",
    "base": "76535826f5d50c721f95820f300037a3efe833a9",
    "registry": "76535826f5d50c721f95820f300037a3efe833a9",
    "gate_scan": {
      "tagged": 0,
      "head": "6b839173e0cd88c1b1e906886c1feaf523ca60cf"
    },
    "reasons": [
      "runtime=191"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @20fae95a6670 (8 checks, current for 6b839173e0cd)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44171137012/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44169883824/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=20fae95a6670 tests=37562 skipped=104 runs=44171137012/1 profiles=ci-reuse/free-tests heads=6b839173e0cd verified=2026-11-17T20:45:54.868Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md and ship/sections/ (pregate, ship-policy, troubleshooting, ship Step 5 prose)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 2,
    "deferred": 0,
    "noted": 4,
    "fixed": 2,
    "scope": "frozen",
    "rounds": 2,
    "ledgers_read": 4,
    "dispatches": {
      "specialist": 6,
      "red-team": 2
    }
  },
  "gate_dispositions": []
}

…ong local test runs or an unknown base (GST-3019)

A commit whose tree git reads as an earlier commit's own now reuses that commit's verified CI run, and the output names it. gstack-ship-preflight --tests-only stops with SHIP_LANE_NOT_CARRIED instead of running a mapped suite here (--run-uncarried-here runs it). --audit --base accepts a commit sha and stops with SHIP_BASE_UNKNOWN for a base that names no commit.

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

trunk-io Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

…carries, and decide the tests-only hold before any lane runs

Review-Finding: s11/outside-voice#1 reader=outside-voice
Review-Finding: s11/outside-voice#2 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit da98d0a into main Nov 17, 2026
83 checks passed
This was referenced Nov 18, 2026
capy-ai Bot added a commit that referenced this pull request Nov 18, 2026
- A test, or a scratch repository in the temp directory, can no longer write approval rows into your real Capy Drive (GST-3027). (#4466)
- An unattended /autoplan run on Claude Code no longer says the publication guard is off while it is on. (#4481)
- A phase report written only in reasoning now gets a denial that says so and names the fix. (#4481)
- `gstack-autoplan revise` no longer refuses a plan that the first `next` accepted. (#4470)
- `revise --plan` with a different file now says the run follows that file. (#4470)
- A second-model plan review in `/autoplan` is no longer reported as unavailable when it actually ran (GST-3051). (#4471)
- The /ship conductor trial plan now lets case reverts that conflict with later code be resolved by hand in docs, tests and the planted file, so large pull requests can be cases (GST-3003). (#4460)
- A locked plan for a trial of /ship without its separate conductor subagent (GST-3003). (#4456)
- A driven /ship now runs each phase as one command, counts its calls, and stops itself at 100 minutes. (#4451)
- /ship stops asking owners to clear two kinds of bookkeeping noise: base-side merge text and a reviewer's confirmation prose. (#4458)
- A base merge that only touched base-side text no longer stops `/ship` finish for an owner's grant. (#4458)
- A reviewer's confirmation prose no longer becomes a Critical finding that only an owner can clear. (#4458)
- A CI run that passed only after its failed jobs were re-run is now marked wherever gstack reuses it. (#4473)
- /ship reuses CI's passing test run when merging the base changed no file, and stops instead of quietly starting hour-long test runs or reviewing an empty diff (GST-3019). (#4461)
- /ship on Codex no longer stops at the test coverage audit. (#4489)
- A cold first-use check before an app build reaches its owner (GST-3025). (#4465)
- `skill_prefix=true` now survives updates when gbrain is installed. (#4454)
- The OpenClaw docs no longer send you to ClawHub, which held only April 2026 builds of office-hours, ceo-review and retro and no longer has gstack skills (the docs also said four skills while listing three). (#4454)
- `gstack-issue-links` no longer reads other repositories' issues as gstack's. (#4454)
- /ship's pre-gate finds the tests of a monorepo app that imports through its own `@/` alias. (#4464)
- /office-hours explains why it recommends a mode. (#4450)
- /office-hours keeps its 34 founder videos and essays out of the skill file. (#4463)
- Two `gstack-owner-answers add` runs for the same answer no longer collide. (#4490)
- A Captain can check an ask against the owner's earlier answers before sending it. (#4467)
- `gstack-post` stops reading /ship's own receipt identifiers as phone numbers, so posting a /ship PR body no longer needs a confirm. (#4488)
- GitHub release notes now list every change in plain words, with a link to its pull request. (#4390)
- gstack's router no longer gives bug reports a special rule, so the model fixes a bug the way it would without gstack. (#4442)
- /ship's review plan now sorts Swift and Xcode files by risk instead of sending every iOS PR to the full review panel (GST-3041). (#4469)
- /ship's review plan now sends Swift code that touches private user data to the full review panel (GST-3052). (#4472)
- A round grant at /ship's review round cap now buys the fix round it names, in the same run or the next (GST-2968). (#4479)
- The secrets check stops flagging three kinds of ordinary code as a secret, and catches two misses. (#4457)
- A security finding's location and reason no longer go into a PR body. (#4486)
- The token-capped /ship child on Claude Code now starts its prompt with the typed `/ship` command, so the skill actually loads. (#4487)
- A /ship receipt now counts the second-model review's blocking findings, and refuses to be written while one is still open. (#4485)
- A `/ship` with a token cap on Claude Code no longer stops at its first handoff. (#4452)
- /ship's push step now always ends with one line that says whether it pushed (GST-3053). (#4474)
- A PR's review-round count can no longer be overwritten by the body `/ship` posts. (#4440)
- One queued record with a malformed path no longer stops artifacts sync for every project. (#4455)
- A failed artifacts push stays reported until a push succeeds. (#4455)
- The /sync-gbrain memory row no longer says OK when pages failed to import. (#4455)
- ### Tests (#4495)
- A policy-floor test no longer fails once gstack's own version reaches the minor after the newest policy key; it now checks a floor above both, so the v1.101.0.0 release can pass CI. (#4495)
- CI now uploads free-suite test results to Trunk with analytics-uploader v2.1.8 and analytics-cli 0.17.0, up from v2.1.6 and 0.16.2. (#4453)
- Packing a checkout for a Ubicloud run no longer fails when git beside it is rewriting a ref. (#4447)
- The /plan-ceo-review HOLD SCOPE eval no longer fails a review because its follow-up question didn't repeat the mode name. (#4447)
- Unattended /autoplan now records the owner's relayed gate reply instead of refusing it. (#4484)
- Unattended /autoplan now runs the second-model review you turned on, and waits for it instead of ending the session. (#4459)
- Two /autoplan runs started in the same second no longer share a run id. (#4459)

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