Skip to content

Move the tools only Capy crews use into a crew/ folder (GST-1833) - #4145

Open
garrytan wants to merge 17 commits into
mainfrom
capy/move-crew-only-code-into-crew-gst-1833
Open

garrytan wants to merge 17 commits into
mainfrom
capy/move-crew-only-code-into-crew-gst-1833

Conversation

@garrytan

@garrytan garrytan commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Moves the tools that only Capy crews use to merge and release gstack into a crew/ folder, along with their tests. Nothing changes for anyone who installs gstack, so the public install stays small and fast for outside users.

Do not land before the scheduled stable cut on Sun 2026-11-08 14:00Z finishes. This PR moves files the release path runs (weekly-release.yml, release-gate.yml, the release-cut script and the release-gate command).

What changed

Capy-crew-only commands and modules move from bin/, lib/ and scripts/ into crew/

Capy-crew-only commands and modules move from bin/, lib/ and scripts/ into crew/, so the public tree holds only what outside users run.

Before/after as text: Capy-crew-only commands and modules move from bin/, lib/ and scripts/ into crew/
--- Before · before.txt · captured output
+++ After · after.txt · captured output
 $ ls bin/gstack-release-gate bin/gstack-coauthor-trailers lib/ship-queue-train.ts scripts/release-cut.ts
+cannot access 'bin/gstack-release-gate': No such file or directory
+cannot access 'bin/gstack-coauthor-trailers': No such file or directory
+cannot access 'lib/ship-queue-train.ts': No such file or directory
+cannot access 'scripts/release-cut.ts': No such file or directory
-bin/gstack-coauthor-trailers
-bin/gstack-release-gate
-lib/ship-queue-train.ts
-scripts/release-cut.ts
 $ ls crew
+README.md bin docs lib scripts test 
-(no crew/ folder on main)
 
  • 43 modules and their 26 test files moved: gstack-release-gate and gstack-coauthor-trailers to crew/bin/; the merge-train and wave modules, release gate, release cut and cadence, gate-cost reports and the train and backstop eval scripts to crew/lib/, crew/scripts/ and crew/test/.
  • The Captain guides now live in crew/docs/. The old paths docs/captain.md and docs/recommended-harness.md keep a one-line pointer.
  • gstack-flaky, lib/flaky-run.ts and lib/factory-scorecard.ts stay public, because docs/flaky.md tells outside users to run bin/gstack-flaky.
  • Every free test run still runs every crew test. The earlier plan to skip crew tests when a pull request leaves crew/ alone was taken out of this PR and comes back in a later one.

Why

Garry approved keeping the crew tools in this repo under crew/ and loading them only on Capy machines, so everyone else gets gstack without them. This PR does the move with no behavior change. Later phases unhook the few public modules that still import crew/.

Blast radius

The move touches every workflow, import, doc and test fixture that named an old path. Free Tests at b7da0b7 (run 42426000235, 36,305 tests at tree 98d620a95bcb) passed with every crew test planned. Two install paths needed more than a rename:

  • Setup builds each host's install folder (Codex, Cursor, Copilot, Gemini and others) by linking bin/ and lib/, or by copying them on Windows. Root commands such as gstack-ship-receipt and gstack-pregate now import crew/lib/, so setup copies crew/lib/ beside them. A copied folder from this branch failed with Cannot find module '../crew/lib/...' before the fix. A new test in test/env-host-runtime-assets.test.ts builds a Windows-style copied folder and starts both commands; it failed before the fix and passes after it.
  • The release bisect checks out older commits and runs the train-gate script from them, so it now uses scripts/train-gate.ts when a commit predates the move.

On a Capy machine the launch file adds crew/bin to PATH after bin, so gstack-release-gate and gstack-coauthor-trailers still work by bare name; a test covers it.

Approvals

Approved: yes (record r-99e90e0c8eb1). The full approval record stays private: this repository is public or its visibility is unknown.
Plan: approved (record r-dade9f38e7ca)
Plan check: approved (record r-dade9f38e7ca)

Summary

Capy-crew-only tooling moves into crew/ with its tests, and every caller, workflow and doc points at the new paths. /ship's review found two places where a rename was not enough: Windows installs copy bin/ and lib/ without crew/lib/, and a release bisect over older commits looked for the script at its new path. Both are fixed here, with a regression test for the install.

Test Coverage

All changed code paths have test coverage. Step 7 audit (audit-only, 0 tests written): the 4 paths the coverage map flagged are each a one-line path change already exercised by existing suites (test/base-red.test.ts, test/pregate-remote-gate-runs.test.ts, test/test-free-shards.test.ts and test/windows-native-workflows.test.ts, all green in the audit's local run); bin/gstack-factory-scorecard changed only a comment.
Tests ran: the free suite carried from CI run 42433004325/1 at this tree (count in the receipt); no local suite ran in this /ship.

Pre-Landing Review

Pre-Landing Review: 2 issues — 0 auto-fixed, 0 asked (0 fixed, 0 skipped), 0 deferred, 2 noted. Step 11's voices added 5 informational notes (one a duplicate of the first), none blocking. One full pass at 456e024 (gate class: specialists batched, red team, targeted money review, a native adversarial reader and an outside voice on openai/gpt-6.1-sol). No blocking findings, so no fix round. The merge-resolution delta since the last /ship (baf3c31) was checked by hand: crew/lib/ship-queue-train-gate.ts, ship-queue-wave.ts and ship-queue-train-land.ts differ from main's lib/ copies only in import paths, comments, the runner path depth and the existing crew/ area-key line.

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=2 fixed=0 scope=frozen ledgers_read=2 dispatches=2
Gate edits: none new since the last /ship's scan at baf3c31 (183 listed, 170 read, 0 findings); the merge brought no gate edits.
Outside review: completed (openai/gpt-6.1-sol), clean.

Review notes

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

  • INFORMATIONAL scripts/test-pr-profile.ts:342 DERIVABLE_PREFIXES lacks crew/, so crew-only PRs fall back to the full paid PR profile (fails closed: more spend, no lost coverage). Targeted reader raised the same (targeted#1, money). Kept as decided earlier on this PR: crew/ stays out of DERIVABLE_PREFIXES.
  • INFORMATIONAL .gstack/pregate.json:40 Pregate module-size and conflict-marker guard path filters do not name crew/**; CI's free suite still enforces the ratchet.
  • INFORMATIONAL lib/pregate/import-graph.ts:492 The pregate import graph parses extensionless entrypoints only under bin/, so crew/bin files have no outgoing edges; local focused test selection narrows, CI still runs everything.
  • INFORMATIONAL .github/workflows/evals.yml:463 Recover-receipts and gate-reuse steps check only crew/scripts paths; a manual run with a pre-move base_sha skips reuse and pays a full gate.
  • INFORMATIONAL bin/gstack-install-registry.sh:1 gstack_on_capy now accepts any ~/.capy entry; a leftover ~/.capy keeps /captain registered. Kept as decided earlier on this PR.
  • INFORMATIONAL docs/captain.md:1 Pointer stubs for moved manuals drop old section anchors for outside deep links. Pointer-stub layout decided earlier on this PR.
  • INFORMATIONAL lib/pregate/import-graph.ts:492 The pregate import graph parses extensionless entrypoints only under bin/, so crew/bin files have no outgoing edges; local focused test selection narrows, CI still runs everything (adversarial).
  • INFORMATIONAL .github/workflows/evals.yml:463 Recover-receipts and gate-reuse steps check only crew/scripts paths; a manual run with a pre-move base_sha skips reuse and pays a full gate (adversarial).
  • INFORMATIONAL bin/gstack-install-registry.sh Capy detection accepts any ~/.capy entry; carried note, kept per the lane brief (adversarial).
  • INFORMATIONAL docs/captain.md:1 Pointer stubs drop old section anchors for outside deep links; carried note (adversarial).
  • The targeted money reader raised the DERIVABLE_PREFIXES item again (folded into the first note); crew/ stays out of DERIVABLE_PREFIXES per the earlier decision.

Exploratory QA

Functional smoke, 2 probes, verdict pass (checkpoint 002 under ~/.capy/work/ship-4145-456e024/qa/functional):

  • crew/bin/gstack-release-gate --help runs from its new path (exit 0).
  • bin/gstack-ship-queue --help starts; its import closure reaches crew/lib (exit 0).
    Not run here: the full free suite and typecheck, which CI ran at this tree and the receipt carries.

Design Review

No frontend files changed, so design review was skipped.

Eval Results

Prompt files changed (captain/SKILL.md.tmpl, retro/SKILL.md.tmpl, path prefixes only), but no paid evals ran: this lane's paid budget is $0. The merge owner's gate decides paid coverage.

Review bot comments

No review bot comments.

Scope Drift

Scope Check: CLEAN
Intent: move Capy-crew-only code into crew/ with no behavior change (GST-1833 Phase 1), without the crew-test skip (owner's option A).
Delivered: the move, repointed callers, crew/bin on PATH on Capy, the review-depth crew/ prefix, and two fixes so copied installs and older bisects keep working.

Plan Completion

Plan: docs/designs/GSTACK_ON_CAPY.md (Phase 1 of GST-1833). 3 of 3 items done, 0 changed, 0 not done.

  • Move code no public skill calls into crew/ and repoint callers
  • Register the crew skills only on Capy machines
  • Tests for the move and the gating (crew-move-layout, crew-skills-on-capy, gstack-capy-install, env-host-runtime-assets)

Issues

No issues are fixed or referenced. gstack-issue-links printed only the review-finding trailers as references:

Refs p1/outside-voice#1
Refs p1/outside-voice#2
Refs p1/specialist-batched#1

Verification Results

All 43 pull-request checks passed at 456e024 with none pending (12 skipped by their path filters), including free-tests run 42433004325/1, windows-smoke, windows-setup and the macOS jobs. Pregate verify passed on the final tree with its four remote lanes cleared from those runs.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. The docs match the move of crew-only code into crew/; no edits were needed.

Scope: the diff from 914e7b6 to 456e024 (210 files; nothing staged, unstaged or untracked), including the docs main brought in through the merge at d866187. Every tracked .md and .tmpl file (except CHANGELOG, changelog.d and golden fixtures) was searched for the 59 non-test files that moved into crew/.

Documentation health:

  • crew/docs/captain.md: current. The plain-title paragraph from main is here, and its docs/ship-policy.md#plain-titles link resolves.
  • crew/docs/recommended-harness.md and crew/README.md: current, with no broken relative links.
  • docs/captain.md and docs/recommended-harness.md: current pointer stubs.
  • docs/ship-policy.md, CONTRIBUTING.md, docs/skills.md and docs/troubleshooting.md: current, with no references to moved paths.
  • Dated design, plan and review records under docs/designs/: kept as written. They name old paths as a record of history.

Coverage debt: none new. The move changes no public surface.

Diagram drift: none found.

Test plan

  • bun run test (free suite): carried from Free Tests CI run 42433004325/1 at the pushed head (see receipt)
  • All 43 pull-request checks green at 456e024
  • QA smoke: crew/bin/gstack-release-gate --help, bin/gstack-ship-queue --help

Open in Capy

Agent notes
  • GST-1833 Phase 1, PR 3 of 3 (leaf move). Thread GSTA-401. Stacked after Install /captain only on Capy machines (GST-1833) #4143.
  • The brief counted 41 leaf modules. This PR moves 43 entries because the two bins count separately, and gstack-flaky, flaky-run and factory-scorecard stay public.
  • captain/ (the skill folder) does not move, because the skill generator only finds top-level folders. Install /captain only on Capy machines (GST-1833) #4143 keeps it unregistered off Capy.
  • Public-to-crew/ import edges remain (ship-queue-gate, ship-queue-train-record, ship-queue-land-lock, version-gate-train, eval-input-cache, recover-receipts, restamp-release). Phase 2 removes them.
  • No GSTA-398, GSTA-399 or GSTA-379 logic changed.
  • /ship at 456e024 (fresh run after the main merge at d866187): one full pass, no blocking findings, no fix round, nothing pushed.
{
  "schema_version": 1,
  "pr": 4145,
  "head": "456e024e900b41bd466f9a253a845a91a3561b83",
  "version": "1.98.0.0",
  "base": "main",
  "gate": {
    "test": {
      "pass": 1639,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 42433004325,
      "attempt": 1,
      "tree": "d3f86cfe5af6eed8f07c3db8ffb41ee8d7b463f8"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "d3f86cfe5af6eed8f07c3db8ffb41ee8d7b463f8",
  "product_patch_id": "e054bdba666d1c6082e8a4e367415f3b1c8a99ef",
  "gstack_version": "1.98.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 23800,
    "rules": "c6a079fdf812f479",
    "base": "914e7b6fb3ec74de11500da8fe91e13dc325ed63",
    "registry": "914e7b6fb3ec74de11500da8fe91e13dc325ed63",
    "gate_scan": {
      "tagged": 0,
      "head": "456e024e900b41bd466f9a253a845a91a3561b83"
    },
    "reasons": [
      "gate-class",
      "risk:money",
      "risk:security",
      "risk:eval",
      "runtime=23800"
    ],
    "risk": [
      "money",
      "security",
      "eval"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @d3f86cfe5af6 (8 checks, current for 456e024e900b)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/42433004325/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42433004325/attempts/1",
    "windows-setup-e2e.yml/windows-setup: https://github.com/garrytan/gstack/actions/runs/42433004395/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/42433004361/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=d3f86cfe5af6 tests=36402 skipped=106 runs=42433004325/1 profiles=ci-reuse/free-tests heads=456e024e900b verified=2026-11-08T02:01:24.330Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md, docs/, crew/docs/"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 2,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 2,
    "dispatches": {
      "specialist": 1,
      "red-team": 1
    }
  },
  "review_targeted": {
    "classes": [
      "money"
    ],
    "rules": "8811fd300bf305f0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "e054bdba666d1c6082e8a4e367415f3b1c8a99ef",
    "status": "done",
    "findings": 1,
    "raised_by": "targeted"
  }
}

garrytan and others added 4 commits November 7, 2026 20:43
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>
…n needed (GST-1833)

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 mentioned this pull request Nov 7, 2026
4 tasks done
garrytan and others added 2 commits November 7, 2026 22:19
…ode-into-crew-gst-1833

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

# Conflicts:
#	README.md
#	crew/README.md
#	test/crew-skills-on-capy.test.ts
…tain

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot changed the base branch from capy/crew-tools-load-on-capy-only-gst-1833 to main November 7, 2026 22:22
@trunk-io

trunk-io Bot commented Nov 7, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

garrytan and others added 9 commits November 7, 2026 22:35
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>
…rew/

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

Review-Finding: p1/specialist-batched#1 reader=testing
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… a later change

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

Setup now copies crew/lib into every host's runtime root beside bin and lib, so Windows installs (which copy instead of linking) can still start gstack-ship-receipt, gstack-pregate and the other commands that import it. The release bisect runs the train-gate script from wherever the checked-out commit has it, so a bisect over commits from before the move still gets a verdict.

Review-Finding: p1/outside-voice#1 reader=outside-voice
Review-Finding: p1/outside-voice#2 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…w/ move

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

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai capy-ai Bot changed the title Move Capy-only crew tooling into a crew/ folder and run its tests only when a PR touches it (GST-1833) Move the tools only Capy crews use into a crew/ folder (GST-1833) Nov 8, 2026
garrytan and others added 2 commits November 8, 2026 01:01
…ode-into-crew-gst-1833

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

# Conflicts:
#	crew/lib/ship-queue-train-gate.ts
#	crew/test/ship-recheck.test.ts
#	docs/captain.md
#	scripts/harness-pins/scripts/test-pr-profile.ts.json
…T-1833)

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

This branch has not been deployed

No deployments
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