Skip to content

v1.92.47.0 fix(ship): /ship Step 5 runs test lanes one at a time on 4 cores or fewer, with --lanes serial|parallel (GST-851) - #3821

Merged
capy-ai[bot] merged 5 commits into
mainfrom
gst-851-serial-lanes
Nov 1, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
gst-851-serial-lanes

Conversation

@garrytan

@garrytan garrytan commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3821,
  "head": "043f86f00d71eadb80f6c0293278e9a44718b1a7",
  "version": "1.92.37.0",
  "base": "main",
  "gate": {
    "ship": {
      "pass": 87,
      "fail": 0,
      "skip": 0
    },
    "skill": {
      "pass": 635,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "aed5c1161ddbd84e75cfc3cd50747fa7211e1e84",
  "product_patch_id": "4fb3155af630e70ba5f427562e440caba885cd97",
  "gstack_version": "1.92.37.0",
  "review_depth": {
    "depth": "standard",
    "class": "code",
    "runtime_lines": 55,
    "rules": "150435b0a543019a",
    "base": "1ea86923a86129d1f32828b36acfe6f91f17c8e6",
    "registry": "1ea86923a86129d1f32828b36acfe6f91f17c8e6",
    "gate_scan": {
      "tagged": 0,
      "head": "043f86f00d71eadb80f6c0293278e9a44718b1a7"
    },
    "reasons": [
      "runtime=55>50"
    ]
  },
  "pregate": "requires-remote cleared @aed5c1161ddb (1 checks, current for 043f86f00d71)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41347393870",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41347393913",
    "pregate.json/remote_gate: remote-gate tree=aed5c1161ddb tests=18401"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, ship/ (templates and generated sections), README.md, CONTRIBUTING.md, AGENTS.md"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 1,
    "fixed": 2,
    "scope": "frozen",
    "fix_checks": 2,
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  }
}

What changed

preflight with two lanes on a 4-core machine: main starts both at once; this branch runs one at a time and prints LANES: serial (4 cores)

preflight with two lanes on a 4-core machine: main starts both at once; this branch runs one at a time and prints LANES: serial (4 cores).

Before/after as text: preflight with two lanes on a 4-core machine: main starts both at once; this branch runs one at a time and prints LANES: serial (4 cores)
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+# this branch
-# main 1ea8692
 $ gstack-ship-preflight --tests-only --base main --lane unit=... --lane typecheck=...   (exit 0)
 PREGATE: warn
+LANES: serial (4 cores)
 LANE: unit pass exit=0 tests_ran=2 log=…
 LANE: typecheck pass exit=0 tests_ran=2 log=…
 -- lane log --
+20:22:46.478 start unit
+20:22:48.483 end unit
+20:22:48.780 start typecheck
+20:22:50.783 end typecheck
-20:22:41.961 start typecheck
-20:22:41.975 start unit
-20:22:43.965 end typecheck
-20:22:43.979 end unit
 

Why

On garrytan/gstack-evals#115, GSTA-2 watched /ship Step 5 start six lanes (a 1,451-test bun suite, tsc, a Docker tier and an arm tarball trial) within 60 ms of each other on a 4-core, 16 GB machine, and running lanes together has taken machines down before (gstack-evals #101, #106, #107). Folding every command into one lane is not a fix, because the receipt reads each lane's own tests_ran. Now preflight runs lanes one at a time on 4 or fewer cores, keeps every lane's count, and --lanes serial|parallel picks the mode by hand (GST-851).

Blast radius

runLanes has one other caller, gstack-ship-release finish, which passes a single lane and keeps the old default (all at once), so its behavior is unchanged (read at lib/ship-release.ts:305). The new LANES: line cannot be read as a lane because consumers match LANE: with the space (checked by grep over lib, bin and scripts, and by both reviewers).

Approvals

No approvals recorded for branch gst-851-serial-lanes.

Plan-first exempt: a bug fix the Captain diagnosed and filed as GST-851 (crew rule "Fix-lane exemption"; Captain: "No /autoplan (bug fix)").

Summary

GST-851 asked for a policy key or flag so a small machine stops running every Step 5 lane at once. This PR ships the flag and a core-count default:

  • Default. With no flag, preflight runs one lane at a time when os.availableParallelism() is 4 or less, and all lanes at once above that.
  • Flag. --lanes serial or --lanes parallel overrides the default. Any other value, or --lanes with no value, exits 2.
  • Output. A LANES: serial|parallel (--lanes|<n> cores) line before the LANE lines says which mode ran and why. Each lane keeps its own LANE line and tests_ran, in the order given.
  • No ship-policy key. A new key needs key versioning and a min_gstack_version bump, and the core-count default already covers the reported 4-core case. A repository that wants serial lanes on a bigger machine passes --lanes serial.
  • Docs. The /ship Step 5 prose (ship/sections/tests.md.tmpl) now says lanes run one at a time on 4 or fewer cores and names --lanes and LANES: (+66 bytes, size-ledger entry test/size-ledger/ship/gst-851-serial-lanes.json).

Failing-first proof. The new --lanes serial test fails on main 1ea8692: with --lanes ignored, the lane log reads "start b", "start a", so both lanes ran at once. The image above shows the same thing outside the test.

Security read. No network calls, environment or secret reads, permission changes, workflow, setup or install edits, or new dependencies.

Test Coverage

All new code paths have test coverage: laneConcurrency (default by core count, both overrides, a bad value), the bare --lanes usage error, serial order, parallel result order when a later lane finishes first, and the unflagged LANES line (test/ship-preflight.test.ts, three tests).

Tests ran: ship 87
Tests ran: skill 635

Pre-Landing Review

Pre-Landing Review: 3 issues — 2 auto-fixed, 0 asked, 0 deferred, 1 noted (the noted Step 5 prose drift was later fixed through the docs audit).

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=1 fixed=2 scope=frozen fix_checks=2 dispatches=4

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

Outside review: openai/gpt-6.1-sol read the code diff (round 1) and the final diff with the changelog numbers (round 2); no findings either time. Native adversarial (claude-opus-5-5): four Low notes, none blocking. Two review rounds, the R51 cap.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL ship/sections/tests.md.tmpl:12 The /ship Step 5 prose still says preflight runs 'every lane in parallel inside the evidence ledger'. That prose is in the template and in the generated ship/sections/tests.md:216, and it is the only interface the agent reads. On a machine with 4 or fewer cores, preflight now runs lanes one at a time by default. Every Capy cloud machine is in that group (os.availableParallelism() returns 4 here). So an agent following the skill expects parallel wall-clock time while it gets the sum of the lane times. The skill also never mentions the new --lanes serial|parallel override or the new LANES: output line, so neither can be found from the skill. The specialists only looked at the bin's code and tests. Nothing catches this drift: the code change left the template untouched, so gen:skill-docs freshness passes, and binding-template-drift.test.ts only checks the command string.

Update to the review note above: the Step 5 prose drift was fixed afterwards in commit 043f86f, through the docs audit (a851-1 blocked on it, the re-audit a851-2 came back current).

Open notes (below the blocking floor, not fixed):

  • The core-count default reads CPU affinity only, not memory or a cgroup CPU quota, so an 8-core, low-memory machine still runs lanes at once; --lanes serial covers it (adversarial, INVESTIGATE).
  • Serial runs take the sum of the lane times, up to N times the 1-hour lane timeout when lanes hang (adversarial).
  • --lanes serial --lanes is read as serial because the flag reader takes the last value (fix-check 2). --lanes=serial is ignored like every other = flag, and --lanes without any --lane is accepted and ignored.
  • The LANES: line uses one of preflight's 30 output lines.

Eval Results

Paid evals not run in the lane; they are pending the train gate (gstack/full-gate, pre-approved). At 043f86f the selector picks 113 behavioral probes and 24 quality judges, driven by the derived references lib/ship-bin-common.ts and lib/ship-preflight.ts, and gstack-ship-queue ready recommends --no-screen because the train gate's full census covers them.

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.

TODOS

No TODO items completed in this PR.

Documentation

Status: current — re-audit a851-2 of gst-851-serial-lanes (1ea8692..043f86f, clean working tree) found no stale docs; a851-1's Step 5 blocker is fixed by 043f86f.

Scope: the committed diff (lib/ship-bin-common.ts, lib/ship-preflight.ts, ship/sections/tests.md(.tmpl), changelog.d fragment, test, size-ledger entry) plus every tracked .md/.tmpl that mentions preflight lanes, lane concurrency, --tests-only or LANE output (ship/SKILL.md.tmpl, ship/DRIVER.md.tmpl, docs/pregate.md, docs/troubleshooting.md, docs/ship-policy.md). No staged, unstaged or new files.

Documentation health:

  • ship/sections/tests.md.tmpl — Current (Step 5 says lanes run one at a time on 4 or fewer cores unless --lanes serial|parallel, and prints LANES:)
  • ship/sections/tests.md — Current (generated; matches template)
  • ship/DRIVER.md.tmpl, ship/SKILL.md.tmpl — Current (no concurrency claim)
  • docs/troubleshooting.md, docs/pregate.md — Current (no lane-concurrency claim)
  • README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md, ARCHITECTURE.md — Current (not affected)
  • CHANGELOG.md / changelog.d — not edited (parent-owned)

Coverage debt: --lanes serial|parallel and the LANES: line are documented as reference and how-to in ship/sections/tests.md and the preflight help text; the explanation exists only in the changelog fragment, with no tutorial (common gap). Diagram drift: none.

Test plan

  • gstack-ship-preflight --tests-only lane ship (ship-preflight, ship-preflight-base-ancestor, pregate-head-policy, ship-driver, ship-rereview-triggers, binding-template-drift): exit 0, tests_ran 87
  • lane skill (parity-suite, size-ledger, ship-workflow-clarity, ship-control-flow, skill-validation, gate-integrity-templates, render-sections-provenance, generated-bash-placeholders, external-host-carve, ship-measure-loop-skill): exit 0, tests_ran 635
  • bun run typecheck: no errors
  • Remote pregate on Ubicloud (UBI_OWNER=gsta234), tree aed5c116: 18,401 tests ran, 0 failed, $0.07, VM destroyed

Note: the lanes unset the gstack launch variables (GSTACK_CAPY and the rest) inside the lane command. With them set, nine tests in pregate-head-policy, ship-preflight and ship-rereview-triggers fail on main 1ea8692 as well, so that is an existing test-environment leak, not this change.

🤖 Generated with Claude Code

garrytan and others added 5 commits November 1, 2026 19:42
…er, with --lanes serial|parallel (GST-851)

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>
…nd names --lanes (GST-851 docs audit)

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

trunk-io Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@github-actions github-actions Bot changed the title fix(ship): /ship Step 5 runs test lanes one at a time on 4 cores or fewer, with --lanes serial|parallel (GST-851) v1.92.47.0 fix(ship): /ship Step 5 runs test lanes one at a time on 4 cores or fewer, with --lanes serial|parallel (GST-851) Nov 1, 2026
@capy-ai
capy-ai Bot merged commit 35a676f into main Nov 1, 2026
64 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