From 5f705f367ae396aff143080a8eafd9951f32f70c Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Mon, 2 Nov 2026 20:40:02 -0800 Subject: [PATCH] v1.94.4.0 captain docs: plan-first rule matches R65 (no plan review for bug fixes) (#3908) * captain docs: plan-first rule matches R65 (no plan review for bug fixes) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * captain docs: trim plan-first wording under the context-budget ceilings The eager-loaded captain and Capy gstack skills grew past their context-budget ratchet ceilings (captain 6576 > 6551, capy/skill/gstack 5367 > 5315). Shorten the sentence in both, drop the duplicate bug-fix clause from the Capy skill's Plan first bullet, and remove the stale 'short run, not no run' clause from docs/captain.md that contradicted the new rule. The test now asks each copy for --kind fix and --kind feature. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes (plain bug fixes are exempt, proof is a repro or failing test) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes (proof is a repro on current main or a failing test written first) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * changelog: gsta258 row 8 fragment matches the final wording 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> --- CHANGELOG.md | 4 ++++ VERSION | 2 +- agents-digest/gstack-AGENTS.md | 2 +- captain/SKILL.md | 3 ++- captain/SKILL.md.tmpl | 3 ++- captain/templates/CREW.md | 5 +++-- captain/templates/brief.md | 6 ++---- capy/skill/gstack/SKILL.md | 4 ++-- docs/captain.md | 13 +++++++------ package.json | 2 +- test/captain-skill.test.ts | 10 ++++++---- 11 files changed, 31 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3b0d6af6..9332270ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [1.94.4.0] - 2026-11-03 + +- The captain skill, the CREW template, the lane brief, docs/captain.md and the Capy gstack skill now follow R65 instead of telling a lane that every fix needs a one-round, eng-only plan. A bug fix is exempt from plan review (`gstack-autoplan next --kind fix`; the brief's reason is `bug fix (R65)`), and its PR carries a repro on current main or a failing test written first. A feature gets the lean run (`--kind feature`): one reviewer reading the plan and the draft code together. The S1 and audited-problem-list exemptions are unchanged. + ## [1.94.3.0] - 2026-11-03 **`gstack-ship-preflight` no longer trusts a local `origin/HEAD` when origin can't say its default branch.** Preflight fell back to the local `origin/HEAD` whenever `git ls-remote --symref origin HEAD` failed or named no branch. With no local `origin/HEAD`, it went on from the default branch itself and merged the given base into it. When a PR-branch clone's `origin/HEAD` named the feature branch, it refused that branch as "on the base branch". Now a failed `ls-remote` stops with `git ls-remote origin HEAD failed: …; restore access first` before anything merges. A remote HEAD that names no branch (a detached HEAD, or a server that sends no symref) falls back to the shared default-base order in `lib/default-base.ts`, which uses the local `origin/HEAD` only when it doesn't name the checked-out branch, its upstream or HEAD's commit. The default-branch check now runs after the fetch, so a failed fetch still reports the fetch. diff --git a/VERSION b/VERSION index e304b416f..5cd01ae7d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.94.3.0 +1.94.4.0 diff --git a/agents-digest/gstack-AGENTS.md b/agents-digest/gstack-AGENTS.md index 5d9bef45c..e0bdb5e62 100644 --- a/agents-digest/gstack-AGENTS.md +++ b/agents-digest/gstack-AGENTS.md @@ -1,4 +1,4 @@ -# gstack digest v1.94.3.0 — regenerate/re-copy after upgrading gstack +# gstack digest v1.94.4.0 — regenerate/re-copy after upgrading gstack Behavioral rules from gstack (https://github.com/garrytan/gstack), compressed for agent hosts without a full skill install. The full skills add workflows, diff --git a/captain/SKILL.md b/captain/SKILL.md index 776349ddb..897b7b312 100644 --- a/captain/SKILL.md +++ b/captain/SKILL.md @@ -374,7 +374,8 @@ lane builds only after the owner's word is answered into the run and it reports New scope taken on part-way gets its own plan. Read-only lanes, the flaky pass's repairs, slot stamps, CHANGELOG resolves, cap re-pins under a grant, S1 emergencies (broken install or upgrade, red main, a security bug) and fixes from an already-diagnosed, audited problem -list are exempt; every other fix gets a one-round, eng-only plan. The brief a +list are exempt. Other bug fixes skip plan review (`--kind fix`, R65) but carry a repro +on current main or a failing test written first; features get the lean run (`--kind feature`). The brief a controller hands a lane, with its `Plan: required | approved | exempt` line, is `captain/templates/brief.md`; the rule is `docs/captain.md` (Plan before build). diff --git a/captain/SKILL.md.tmpl b/captain/SKILL.md.tmpl index 1a5fb0e40..b234f7d31 100644 --- a/captain/SKILL.md.tmpl +++ b/captain/SKILL.md.tmpl @@ -302,7 +302,8 @@ lane builds only after the owner's word is answered into the run and it reports New scope taken on part-way gets its own plan. Read-only lanes, the flaky pass's repairs, slot stamps, CHANGELOG resolves, cap re-pins under a grant, S1 emergencies (broken install or upgrade, red main, a security bug) and fixes from an already-diagnosed, audited problem -list are exempt; every other fix gets a one-round, eng-only plan. The brief a +list are exempt. Other bug fixes skip plan review (`--kind fix`, R65) but carry a repro +on current main or a failing test written first; features get the lean run (`--kind feature`). The brief a controller hands a lane, with its `Plan: required | approved | exempt` line, is `captain/templates/brief.md`; the rule is `docs/captain.md` (Plan before build). diff --git a/captain/templates/CREW.md b/captain/templates/CREW.md index 1d0165ae5..fb6ac2fda 100644 --- a/captain/templates/CREW.md +++ b/captain/templates/CREW.md @@ -135,8 +135,9 @@ Homes are paths in the gstack checkout the lane checked at session start. import --autoplan`. New scope taken on part-way gets the same. Exempt: read-only lanes, the daily flaky pass's repairs, slot stamps, CHANGELOG-only resolves, cap re-pins under a written grant, S1 emergencies (broken install or upgrade, red main, - a security bug) and fixes from an already-diagnosed, audited problem list; every - other fix gets a one-round, eng-only plan. Home: `docs/captain.md` (Plan before build), + a security bug) and fixes from an already-diagnosed, audited problem list. Any other + bug fix is exempt too (`gstack-autoplan next --kind fix`, R65) and carries a repro on + current main or a failing test written first in the PR; a feature gets the lean run (`--kind feature`). Home: `docs/captain.md` (Plan before build), `captain/templates/brief.md`. ## Crew-specific rules diff --git a/captain/templates/brief.md b/captain/templates/brief.md index 6af25e7cd..6dd212cfd 100644 --- a/captain/templates/brief.md +++ b/captain/templates/brief.md @@ -17,10 +17,8 @@ Spend cap: set, run dir under ~/.capy/work). Write the plan with its ## ELI5, ## Before → after, ## Why it matters, ## What caused this work, ## Big decisions and ## Implementation plan sections, then run gstack-autoplan next --out --plan - sized to this brief (a fix: --no-ui --no-dx --max-rounds 1 --estimate-usd - --spend-cap , then close the CEO phase before dispatching its voices with - gstack-autoplan close --out --phase ceo --deferred "eng-only fix plan" - --by agent:). + sized to this brief (a feature: --kind feature, the lean run with one reviewer over + the plan and the draft code; a bug fix needs no plan run: Plan: exempt: bug fix (R65)). At the gate send me the output of gstack-owner-brief render --captain --out whole, as a needs-you report. Build nothing yet. diff --git a/capy/skill/gstack/SKILL.md b/capy/skill/gstack/SKILL.md index ad8c801bf..9e837424d 100644 --- a/capy/skill/gstack/SKILL.md +++ b/capy/skill/gstack/SKILL.md @@ -52,13 +52,13 @@ Token caps on /ship: pass a brief's cap as `--token-cap `. /ship reads `cost. Every Capy thread that uses gstack follows these for new work, under a Captain or on its own. The rule in full is `docs/captain.md`, "Plan before build"; the lane side is section 3 of captain.md in this folder. -- **Plan first.** Run `/autoplan` on new functionality right after the install check. A bug fix needs none (`gstack-autoplan next --kind fix`), just a repro or failing test in the PR. A feature gets the lean run (the Capy default), one reviewer over plan and draft code; `--full` adds every phase. +- **Plan first.** Run `/autoplan` on new functionality right after the install check. The lean run (the Capy default) is one reviewer over plan and draft code; `--full` adds every phase. - **ELI5, then the word.** Send the plan and gate to the person, or the Captain, in plain language: `gstack-owner-brief render --captain --out --captain-name ""`, its choices as lettered lines in the ask format (`docs/captain.md`) and "do it" taking every recommendation at full scope. Build only after their word is answered into the run and it reports `APPROVED`; then `gstack-approvals import --autoplan --by ""`. - **/ship before ready.** Run /ship at the final pushed head before a PR is called ready; `SHIP_RECEIPT: pr= head=` must name that head, and a later push needs a new /ship. The review inside /ship, like the autoplan, is sized to the change. - **Stop a finished /ship subagent.** When a /ship subagent opens its PR, the parent subscribes to that PR with Capy's subscribe tool and keeps that one subscription until the PR merges or closes, re-subscribing if the watch expires, then cancels it. Once the subscription is in place and READY arrives, the parent stops the subagent and owns the PR from then on, slot stamp, re-READY and receipt carry included. A stopped /ship subagent woken by a check, review or merge notice, not by its parent, reports one line naming what woke it, its pin and the PR head (`gh pr view --json headRefOid --jq .headRefOid`) and ends the turn without acting, whether or not the head moved. A message from its parent is an instruction it carries out. - **No merge without the owner's word.** A thread never merges on its own; under a Captain the controller merges on a recorded standing approval, and a thread with no Captain asks the person. -Exempt from the plan step: read-only work, the daily flaky pass's repairs, slot stamps, CHANGELOG-only resolves, cap re-pins under a written grant, S1 emergencies (a broken install or upgrade, a red main, a security bug) and fixes from an already-diagnosed, audited problem list. Every other fix gets a one-round, eng-only plan. +Exempt from the plan step: read-only work, the daily flaky pass's repairs, slot stamps, CHANGELOG-only resolves, cap re-pins under a written grant, S1 emergencies (a broken install or upgrade, a red main, a security bug) and fixes from an already-diagnosed, audited problem list. Other bug fixes skip plan review (`--kind fix`, R65) but carry a repro on current main or a failing test written first; features get the lean run (`--kind feature`). ## Working under a Captain diff --git a/docs/captain.md b/docs/captain.md index b09778c50..f7127194f 100644 --- a/docs/captain.md +++ b/docs/captain.md @@ -135,9 +135,8 @@ alone is not an ask. A lane that builds something plans first. Its first act after the session-start install check, before any product code, is a `/autoplan` run on its brief, sized to the work. The -phases run in order, CEO, then design, then DX, then eng, with design and DX only when the -scope has them, and a fix the exemptions below don't cover gets a short run (`--no-ui --no-dx --max-rounds 1`, with -`--estimate-usd` set so a small `--spend-cap` still seats its attempts), not no run. On Capy the +full run's phases run in order, CEO, then design, then DX, then eng, with design and DX only when the +scope has them. A bug fix gets no plan review and a feature gets the lean run (both below). On Capy the unattended loop is `autoplan/DRIVER.md` in the gstack checkout. New functionality a lane takes on part-way, scope its brief did not name, gets its own plan and its own ask before the lane builds it. In the rules file this is rule 24 of the @@ -183,9 +182,11 @@ flaky pass's repairs, slot stamps, CHANGELOG-only conflict resolves and a size o cap re-pinned under the controller's written grant need no plan. Two kinds of fix are exempt too: an S1 emergency (a broken install or upgrade, a red main, a security bug), and a fix from a problem list that was already diagnosed and audited, where that list is the plan. -Every other fix, a one-line bug fix included, gets a one-round, eng-only plan: the short -run above, with the CEO phase closed before its voices are dispatched -(`gstack-autoplan close --out --phase ceo --deferred "eng-only fix plan" --by agent:`). +Any other bug fix is exempt too (R65; the brief's reason is `bug fix (R65)`): `gstack-autoplan next --kind fix` prints +`AUTOPLAN: not needed (bug fix; R65)` and writes nothing, and the PR carries the bug's +proof, a repro on current main or a failing test written first. A feature gets the lean +run, `--kind feature`: one reviewer reading the plan and the draft code together, one gate +revision and no carry check (docs/unattended.md). `--full` brings back the full run. A crew may add exemptions in its rules file with the owner's words and date; it does not remove these. The brief says which applies, `Plan: required | approved: | exempt: `, so an diff --git a/package.json b/package.json index 686d966e4..88bbc7e81 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gstack", - "version": "1.94.3", + "version": "1.94.4", "description": "Garry's Stack — Claude Code skills + fast headless browser. One repo, one install, entire AI engineering workflow.", "license": "MIT", "type": "module", diff --git a/test/captain-skill.test.ts b/test/captain-skill.test.ts index 60d21a1f7..8eb9ee154 100644 --- a/test/captain-skill.test.ts +++ b/test/captain-skill.test.ts @@ -81,15 +81,17 @@ describe('/captain skill', () => { expect(read('captain/templates/automation-flaky-pass.md')).toContain('never merge'); }); - test('every copy of the plan-first exemptions names the two fix exemptions and the eng-only plan for every other fix', () => { + test('every copy of the plan-first exemptions names the two fix exemptions and the R65 no-review rule for other bug fixes', () => { for (const rel of ['docs/captain.md', 'captain/SKILL.md', 'captain/templates/CREW.md', 'capy/skill/gstack/SKILL.md']) { const text = read(rel).replace(/\s+/g, ' '); expect(text, rel).toMatch(/S1 emergenc(?:y|ies) \(a? ?broken install or upgrade, a? ?red main, a security bug\)/); expect(text, rel).toMatch(/already[- ]diagnosed,? (?:and )?audited problem list|problem list that was already diagnosed and audited/); - expect(text, rel).toContain('one-round, eng-only plan'); + expect(text, rel).toContain('--kind fix'); + expect(text, rel).toContain('--kind feature'); + expect(text, rel).not.toContain('one-round, eng-only plan'); } - expect(read('docs/captain.md')).toContain('gstack-autoplan close --out --phase ceo --deferred'); - expect(read('captain/templates/brief.md').replace(/\s+/g, ' ')).toContain('gstack-autoplan close --out --phase ceo --deferred'); + expect(read('docs/captain.md')).toContain('AUTOPLAN: not needed (bug fix; R65)'); + expect(read('captain/templates/brief.md').replace(/\s+/g, ' ')).toContain('--kind feature'); }); test('is generic: parameters, not one crew\'s codes, names or repository', () => {