Repository navigation
v1.91.253.0 feat(captain): /captain skill (also /crew), crew templates and docs/captain.md for running a crew from one controller - #3473
Conversation
…aptain.md for running a crew from one controller 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> # Conflicts: # CHANGELOG.md
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…uence, owner device and lessons loop in docs/captain.md; owner-brief closes with the do-it reply Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…tches the tool's lines, slot-2 and freeze wording, mergeChangelogs named, parameter lists and doc numbers aligned Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…e-race wording across skill, CREW.md and docs; router routes on phrases; receipt head width as printed Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ry crew rule gets a canonical home in gstack (lane discipline, outside contributions, stale READYs, standing spend, the lane side of flaky reruns in docs/captain.md; the rule-to-home map) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
E2E Evals: ✅ PASS125 executed, 0 reused rule/judge records | 0 manual accepted (unscored; no score-cache credit) | $32.98 rule/judge cost | reconcile exit: 0 Profile: pr / mode Full gate restored by:
Derived dependents (scripts/pr-dependencies.ts):
Rule and judge shards
Fail-closed reconciliationSliced lane: planner → duration-packed executors → fail-closed report. Behavior cases run a pre-registered 3-trial panel (PASS at 2/3 with no contract violation); a PASS 2/3 is shown with its failed trial, never as a clean pass. Reused results retain their original provenance and expiry. Dispatched narrow screen (gstack-ship-queue ready --screen) of merge commit |
…s and docs/captain.md for running a crew from one controller (#3473) Merge origin/main (8663c3d) into the pin 1c9cc17; CHANGELOG resolved by mergeChangelogs (additive). gstack-restamp --next --base main --pr 3473 --expect-base 8663c3d --expect-order 3473: STAMP_VERSION 1.91.253.0; FILES: CHANGELOG.md VERSION agents-digest/gstack-AGENTS.md package.json. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
What changed
Before → after: the README power-tools table at main vs this branch. One new row registers the skill and links the team guide.
Before → after: docs/skills.md had no section; the branch adds the
/captaindeep dive that summarises the whole operating model in one screen.Text version
/captainCrew Controller linkingdocs/captain.md.## /captainsection (usage, the rules, the templates, the guide link).Why
Several Capy Captain crews run the same operating model (one controller merges, lanes stop at a READY block, merge trains with per-slot stamps, approvals in fixed shapes, a daily flaky pass), but it lived only in one crew's private drive notes. A team that wants gstack plus Capy as its harness had nothing to copy. This PR ships the model generically as a gstack skill (
/captain, also/crew), nine copy-paste templates and a setup guide, with every repo-specific name a parameter.What the skill teaches. The one rule (controller merges, lanes never); the READY contract as a field table with a refusal list (full head SHA, base, CI counts, pregate, gate evidence,
SHIP_RECEIPTat the pin, screen choice with justification, receipt path, logged flaky cases; a green PR page or a cheap tier is never merge evidence); merge trains (build, verdict, slot call, lane stamps on call with a commit that holds only tool output, verify,gh pr merge --match-head-commit, verify again, prune); the red-train rules (in-run flaky rerun once, bisect on the red cases, exactly one unchanged rebuild, one infra re-dispatch); the tree rule, gate-ahead and the severe race as options; the backstop, the freeze and the post-merge babysit; the digest shape (Needs you / New / In progress with ages); the three approval shapes (A per-thread record, B plan ask with before → after and a "do it" reply, C merge ask with captioned before/after images); the daily flaky-fix pass (ledger format, sources, red-before-green fix PRs, one named infra rerun allowance, never thresholds, trials or kinds); reports and wave PRs. Where two crews' protocols differ, both ship as options for the crew rules file.Templates (
captain/templates/):CREW.md(parameters, a standing-approvals table, and 23 one-line rules that each point at the rule's home in gstack),AGENTS.md,NOTES.md,DIGEST.md,flaky-ledger.md,report.md,READY.md,slot-call.md,plan-ask.md,merge-ask.md,automation-flaky-pass.md.Docs and registration:
docs/captain.md(roles, drive layout, the rule-to-home map, lane discipline, outside contributions, READY and the lane's /ship sequence, trains, approvals, digest, flaky pass, owner device, lessons loop, setup steps); rows in README, AGENTS.md, docs/skills.md, docs/PROJECT_STRUCTURE.md; a root-router rule;lib/doctor-components.ts; the context-budget and catalog-budget ratchets moved by the new skill (and CLAUDE.md's copy of the catalog ceiling); a CHANGELOG entry under[Unreleased].test/captain-skill.test.tspins the contract, the template set, the generic wording (no crew codes, names or repository literals) and the registration points.gstack holds the rules, the crew file points at them. Every rule a running crew carries was mapped to a canonical home in gstack (the table in
docs/captain.md→ "CREW.md: the lanes' contract"). Rules that had no home got one indocs/captain.md: lane discipline (validation, file ownership, one routing path, keep going, guards before paid work, plain-language decisions), contributions from outside the crew (untrusted diffs, porting with authorship kept), stale READYs after a contract change, standing spend as a shape-A approval, and the lane's side of flaky reruns next to the daily pass. Rules that already had a home point at it: session start →docs/capy-install.md; remote pregate →docs/pregate.md; READY, stamps, the CHANGELOG position, CHANGELOG-only conflicts and /ship before READY →docs/ship-policy.md; the gate's flaky rerun →docs/TESTING_INTERNALS.md; approvals →capy/skill/gstack/captain.md.Gaps (a rule whose home is not yet written in gstack): rule 23, review convergence (scope frozen after pass 1, delta-only later passes, a three-pass cap, the blocking floor), is pointed at the /ship and /review skills, where GSTA-113 is placing it; this PR does not duplicate its text. Rule 17 (entry-point and isolation conventions for new files) is a repository rule, not a crew rule: it points at the repository's own AGENTS.md through the
REPO_CONVENTIONSparameter.Not in scope: ship-queue code, the retro scorecard, edits to other skills' templates. No alias mechanism exists in the generator, so
/crewis a trigger and a router phrase, not a second skill directory.Approvals
Source: gstack-approvals record for gsta-109-captain-skill (display only; not an approval citation).
Evidence
bun run gen:skill-docsclean (regenerated output committed);bun run typecheck0 errors;bun run typecheck:testno new diagnostics.test/captain-skill.test.ts(7 tests).bun run test:quicklocally: every failure is environmental on this machine (Playwright Chromium not downloaded, CSO not built, codex host render absent, the machine's forced git identity in the retro-metrics fixture); none touches this diff. The remote free tier runs in /ship's pregate before READY.1c9cc178133de1bca44c3d8e5fe6af86db09e2b8(treea4f4114247e0): pregate preflightPREGATE: warn tree=a4f4114247e0 head=1c9cc178133d checks=6(regen 2 entries fresh, secrets 1920 added lines clean, literals, timing and guards pass; the one warn isPREGATE_STRAYSfor the intended new top-levelcaptain/directory). Remote free tier on one Ubicloud VM:PREGATE_REMOTE: tree=a4f4114247e0d37ab02ce7c0f7e468080fa92ef2 tests=18935 failed=0 spent=0.12(eu-central-h1, attempt 1 of 6, VM destroyed). The macOS and Windows lane obligations were cleared with this head's own green runs (Free Tests run 40346182735, Windows Free Tests run 40346182462); every CI check at this head is green (Workflow Lint, Quality gate, Skill Docs Freshness, Version Gate, Free Tests, E2E Evals, Windows Free Tests).origin/main, six specialists (testing, maintainability, security, performance, state-machines, simplification advisory) plus a native adversarial pass; 0 blocking findings under the floor (a finding blocks only if it would fail a test, break production, or lose data or secrets). Pass 2 was not run: nothing changed after pass 1, so its range-diff is empty, which is the loop's exit. Earlier heads of this branch (30caa1f, 02ac865, 1bd130f) had their own passes; the 10 fixable findings from those passes landed in 02ac865 and 1bd130f.test/captain-skill.test.ts:64: the "rule n names its home" regex[^]*?Home:spans into later rules, so a rule missing its Home: still passes while any later rule has one; (2)test/captain-skill.test.ts:89: the link check drops#fragments, so a renamed heading breaks the rule-to-home pointers silently (all 11 anchors resolve at this head); (3)test/gate-list.test.ts:152: the alias loop does not includedo it, and no test drives--owner-reply "do it"throughanswerGate(probed at this head: every answered row getsowner_reply_parsed:true); (4) rule 23's home (captain/templates/CREW.md:124,docs/captain.md:99) points at the /ship and /review convergence policy, which GSTA-113 is still placing there, so today the pointer lands on the three-cycle cap without the floor; (5) parameter lists diverge: CREW.md has 15 parameters,captain/SKILL.md.tmpl:67-78lists 10,docs/captain.md:63-66names 12, the test loop pins 7; (6)captain/templates/CREW.md:48:REPO_CONVENTIONSis defined for rule 17 (new-file section) but rule 2 reuses it to name the validation file; (7)captain/templates/merge-ask.md:9(and shape C in the skill and docs/captain.md): before/after images via the host's public PR asset tool without the "public repositories only, through gstack-pr-shots" qualifier thatcapy/skill/gstack/captain.md:119carries; (8)docs/captain.md:154: "bash scripts/install.sh --for ship from the project directory" names a path that exists only ascapy/skill/gstack/scripts/install.shbeside the Capy skill; (9)docs/captain.md:10: "every file named below has a copy-paste template" overstates it (skills/<name>/SKILL.mdandplans/have none); (10) simplification advisories: the 23-row rule table indocs/captain.md:75-99duplicates CREW.md's pointers;captain/SKILL.md.tmpl:88-92carries a third enumeration of the rules;TRAIN_MAX/FULL_GATE_CHECK/FILL_HOURSmirror.gstack/ship-policy.json's train block;captain/templates/READY.md:26restates the pin a third time; the standing-approvals table in CREW.md is a third slot for the owner's words next to AGENTS.md's; rules 6/14/15/19/22 each state a piece of the stamp-commit rule.lib/gate-list.ts:130tokenizer does not strip./!, sodo it.is refused withGATE_REPLY_UNPARSED(same asrec.today); five pre-existing untested owner-reply matrix cells (all,approve all,accept all,take all recommendations,as-is×--owner-reply);capy/skill/gstack/captain.md:60linksdocs/ship-policy.md#approval-classes, an anchor that does not exist (also absent at base). Earlier deferred item: touchfiles-data.ts, filed as eval:select: map captain/templates/*.md in test/helpers/touchfiles-data.ts so a templates-only PR does not fall back to the full gate #3477.test/fixtures/context-budget.jsonalwaysOnTotal 7458 vs captured 7591 (~3.2% headroom).Pre-Landing Review
Pass 1 at 1c9cc17: 6 specialists dispatched, 25 findings before dedup (performance: none), 17 unique after dedup: 1 CRITICAL-labelled untested state-matrix cell in the diff (
do it×--owner-reply, behaviour verified by probe, test gap), 9 INFORMATIONAL in-diff notes, 7 deferred pre-existing items, plus 7 simplification advisories; every item has a disposition under the crew's blocking floor (named above). Core checklist: no defect. State matrix: 1 machine, 18 cells, 12 tested, 6 untested (all listed). Focused suites at this head: 45 pass, 0 fail (captain-skill, captain-brief, gate-list, catalog-budget, context-budget-ratchet, doctor-components).Gate edits: none detected (7 listed, 4 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none). The four read hunks (test/captain-brief.test.ts import and order line, test/catalog-budget.test.ts ratchet 1,197 → 1,251 with its measurement in the hunk, test/fixtures/context-budget.json captain row) are additions or measured ratchet moves, not relaxations.
Outside review: unavailable (no Codex harness in this Capy session); adversarial coverage is the native Claude pass only, 5 INFORMATIONAL findings, 3 shared with the specialists.
Exploratory QA
Functional smoke at 1c9cc17 (
.gstack/qa-reports/ship-1c9cc17/functional, 300 s budget, 4 probes, verdict pass): focused suites 35 pass 0 fail; the generated root router line equals the template's (SKILL.md:217 == SKILL.md.tmpl:93) and is the only router bullet naming captain/crew;parseReplyacceptsdo it,Do itandrecas mode rec and refuses free text withGATE_REPLY_UNPARSED; everyHome:pointer in CREW.md resolves to a heading or file in gstack, and the doctor Bash twin'srequires()printsclaudefor captain and fails for an unknown name. Not run: auth, timeout, retry, idempotency and concurrency contracts (no such surface in this diff); no agent-driven run of the skill prose.Documentation
Status: current — the release documentation matches the candidate at 1c9cc17 (base 5755601); no edits were needed and nothing blocks.
Audited scope. The gsta-109-captain-skill branch, 37 files over 7 commits since the merge-base, with the reading concentrated on the delta since the previous audit at 02ac865:
captain/templates/CREW.mdrestructured into 23 one-line pointer rules plus a parameter table and a standing-approval table;docs/captain.mdgained the rule-to-home map, Lane discipline, Contributions from outside the crew, the stale-READY rule, standing spend, the lane's side of flaky reruns andtrain build --repair;captain/SKILL.md(.tmpl)aligned theSHIP_RECEIPTwidth and the repair-train wording;test/captain-skill.test.tspins 23 rules with homes and the map rows; the CHANGELOG line now reads 23 pointer rules. Every home and anchor the pointers name was resolved in the checkout, the tool claims were checked againstlib/ship-queue-train*.ts,lib/ship-receipt.tsandlib/gate-list.ts, generated outputs were regenerated in a scratch copy and found byte-identical, and the four focused test files pass (25/25). The working tree is clean; no staged, unstaged or new-file bytes were in the candidate.Documentation health:
README.md Current (
/captainskills row and docs-table row match the skill and docs/captain.md)AGENTS.md Current (
/captainrow; #validation-discipline is the home rule 2 points at)CLAUDE.md Current (catalog budget 1,251 matches test/catalog-budget.test.ts)
CONTRIBUTING.md Current (catalog budget 1,251; remote-gate command matches pregate.md#remote-gate)
CHANGELOG.md Current (Unreleased entry names 23 pointer rules, the parameters and the standing-approval table; not polished in read-only mode)
docs/captain.md Current (23-row map resolves to existing anchors; Lane discipline and Contributions sections present; --repair, FLAKY N, verdict states and receipt width match the code)
docs/skills.md Current (
/captainsection and index row; #ship and #captain anchors exist)docs/CONTRIBUTOR_REFERENCE.md Current (catalog budget 1,251)
docs/PROJECT_STRUCTURE.md Current (captain/ entry in the tree)
docs/capy-install.md Current (#session-start and #working-under-a-captain are the homes rule 1 and the intro point at)
docs/ship-policy.md Current (explicit anchors stamp-at-merge, run-a-merge-train, ship-before-ready exist;
train build --repairat :540)docs/pregate.md Current (#remote-gate anchor at :322)
docs/unattended.md Current (#owner-brief at :399)
docs/TESTING_INTERNALS.md Current (#flaky-reruns at :462)
autoplan/DRIVER.md Current (
do italias matches lib/gate-list.ts)capy/skill/gstack/captain.md Current for this candidate (lane side points at /captain and docs/captain.md; a pre-existing link to ship-policy.md#approval-classes at :60 has no anchor, outside this diff)
captain/templates/CREW.md Current (every rule names a home that exists; parameters match the names docs/captain.md:63-66 lists)
captain/templates/README/report/slot-call/plan-ask/merge-ask Current (sha12 width, STAMP_VERSION, do it as the test pins)
captain/SKILL.md, SKILL.md, gstack/llms.txt, agents-digest/gstack-AGENTS.md, bin/gstack-doctor-components.sh Current (regenerated in a scratch copy, byte-identical to the checkout)
TODOS.md Skipped (file does not exist)
Documentation coverage:
⚠️ pointer only (CREW.md:124, docs/captain.md:99 → /ship and /review skills, which hold the 3-cycle cap and fix-range repeats but no blocking floor; docs/skills.md#ship does not describe it) how-to ❌ tutorial ❌ explanation ❌
/captain (also /crew) reference ✅ AGENTS.md, README, docs/skills.md, llms.txt how-to ✅ docs/captain.md tutorial ✅ docs/captain.md "Setting it up on Capy" explanation ✅ docs/captain.md "The model in one paragraph"
CREW.md pointers + parameters (GUARD_CHECKS, REMOTE_PREGATE, REPO_CONVENTIONS, REVIEW_SCOPE, CONTRACT_DATE) reference ✅ CREW.md, docs/captain.md map how-to ✅ docs/captain.md:62-71 tutorial ❌ explanation ✅ ("a rule that exists only in a crew's file is a gap in gstack")
train build --repair reference ✅ ship-policy.md:540, docs/captain.md:194, captain/SKILL.md how-to ✅ ship-policy.md tutorial ❌ explanation ✅ docs/captain.md (freeze)
do itas an alias ofrecreference ✅ autoplan/DRIVER.md, capy/skill/gstack/captain.md, lib/gate-list.ts how-to ✅ tutorial ❌ explanation ❌Review convergence (rule 23: pass cap, delta-only later passes, blocking floor) reference
Coverage debt: the blocking floor and the delta-only later-pass rule that rule 23 describes have no home in gstack yet; the pointer lands on the skills' cycle cap. Common gap, not critical: the rule is stated in one line in CREW.md. Pre-existing debt outside this candidate: capy/skill/gstack/captain.md:60 links docs/ship-policy.md#approval-classes, which has no anchor.
Diagram drift: none. No ASCII or Mermaid diagrams in the touched docs; the docs/PROJECT_STRUCTURE.md tree gained
captain/and matches the checkout.