From 7d4e71bd940a9611ffc7020a4128403952c77af9 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sat, 31 Oct 2026 09:50:03 -0700 Subject: [PATCH] v1.91.375.0 captain: stop a finished /ship subagent at READY once its parent subscribes to the PR (#3597) * captain: stop a finished /ship subagent at its READY after subscribing to its PR Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * chore: CHANGELOG for stopping finished /ship subagents (unreleased) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * captain: /ship subagent stop review fixes (subscribe at PR open, parent owns post-READY work, unconditional one-line wake, tight budget) 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 | 9 +++++++++ VERSION | 2 +- agents-digest/gstack-AGENTS.md | 2 +- captain/templates/brief.md | 1 + capy/skill/gstack/SKILL.md | 1 + docs/captain.md | 7 +++++++ package.json | 2 +- test/fixtures/context-budget.json | 2 +- 8 files changed, 22 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 220029eb1..7d56aa2a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [1.91.375.0] - 2026-10-31 + +**A /ship subagent now stops once its READY is sent, so CI and review callbacks on a frozen head stop waking it.** Finished /ship subagents kept getting woken by checks and reviews on a PR they had already READY'd. Each wake cost tokens, and some acted on a head that was supposed to be frozen. The parent now subscribes to the PR first, so red checks and human review still reach an owner, and then stops the subagent. + +### Changed +- **`capy/skill/gstack/SKILL.md`** (Plan, approve, ship): the parent subscribes to the PR when the /ship subagent opens it and keeps that subscription until the PR merges or closes. It stops the subagent at READY and owns the PR from then on. A stopped /ship subagent woken by a check, review or merge notice reports one line (what woke it, its pin, the PR head) and ends the turn, while a message from its parent is an instruction it carries out. +- **`docs/captain.md`** (the lane's /ship sequence): the host-neutral rule (the parent owns red checks, review, the slot stamp, re-READY and receipt carry after READY), with a pointer to the Capy mechanics. **`captain/templates/brief.md`**: one pointer line. +- **`test/fixtures/context-budget.json`**: the Capy skill's eager ceiling moves from 5136 to 5312 for the 176 tokens it grew (5136 to 5312, measured with `lib/context-bill`), set at the captured value as main's last raise was, rather than a fresh 10% headroom. + ## [1.91.374.0] - 2026-10-31 **/ship pauses on a red base instead of failing.** When main is red for a reason outside a PR, /ship's Step 5 used to fail or ask the fix/TODO/blame/skip question, and unattended lanes either burned runs or held by hand. Truther's two main-red fixes (#815 and the cover-contract branch) each failed only on the other's broken cases, so neither could pass /ship alone until a Captain folded them into #818 by hand (GSTA-157, from the 2026-10-29 speed feedback). diff --git a/VERSION b/VERSION index e849722ad..d0cfa08b9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.91.374.0 +1.91.375.0 diff --git a/agents-digest/gstack-AGENTS.md b/agents-digest/gstack-AGENTS.md index 2817a10b0..4bf39473a 100644 --- a/agents-digest/gstack-AGENTS.md +++ b/agents-digest/gstack-AGENTS.md @@ -1,4 +1,4 @@ -# gstack digest v1.91.374.0 — regenerate/re-copy after upgrading gstack +# gstack digest v1.91.375.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/templates/brief.md b/captain/templates/brief.md index efb283815..6af25e7cd 100644 --- a/captain/templates/brief.md +++ b/captain/templates/brief.md @@ -34,6 +34,7 @@ Spend cap: 3. Ship. CHANGELOG entry under [Unreleased]; GUARD_CHECKS, pregate and /ship at the final head; one unstamped READY block (captain/templates/READY.md) to me; the PR body carries gstack-approvals render. Never merge; stamp only on my slot call. + The lane subscribes to the PR, then stops its /ship subagent at READY (docs/captain.md, the lane's /ship sequence). Done when: the READY block is sent at a frozen head, reports/.md is written, and its Approvals table carries the plan approval row (the owner's words, the date) or the diff --git a/capy/skill/gstack/SKILL.md b/capy/skill/gstack/SKILL.md index 6bbb4e0c5..b513fdbdf 100644 --- a/capy/skill/gstack/SKILL.md +++ b/capy/skill/gstack/SKILL.md @@ -55,6 +55,7 @@ Every Capy thread that uses gstack follows these for new work, under a Captain o - **Plan first.** Before building new functionality, run `/autoplan` on it as the first act after the install check, sized to the work (scope flags and `--max-rounds`; a one-file fix gets `--no-ui --no-dx --max-rounds 1` with `--estimate-usd` and a small `--spend-cap`, never no run). - **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. diff --git a/docs/captain.md b/docs/captain.md index f804bbf7c..65cee4050 100644 --- a/docs/captain.md +++ b/docs/captain.md @@ -254,6 +254,13 @@ a push included. The sequence that works unattended on Capy: 10. After the slot call, the stamp commit keeps the pin's receipt; re-READY with the same receipt, no second /ship. +When /ship runs in a subagent, the parent subscribes to the pull request's check and +review notices as soon as the subagent opens it, and stops the /ship subagent only once +that subscription is in place and its READY arrives. From then on the parent owns the pull +request: red checks, human review, the slot stamp and re-READY of step 10, and any receipt +carry. It does that work itself or sends it to the subagent as an explicit instruction. On +Capy the mechanics are in [the gstack skill](../capy/skill/gstack/SKILL.md#plan-approve-ship). + When the base moves under a reviewed branch, merge it in; never rebase. A merge that leaves the product diff unchanged carries the receipt with `gstack-ship-receipt carry` (pregate at HEAD, no review rerun), and a merge whose resolution changed product code diff --git a/package.json b/package.json index 36f46b3a6..81a67521f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gstack", - "version": "1.91.374", + "version": "1.91.375", "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/fixtures/context-budget.json b/test/fixtures/context-budget.json index 9f26e133f..ba51a7dba 100644 --- a/test/fixtures/context-budget.json +++ b/test/fixtures/context-budget.json @@ -9,7 +9,7 @@ "browser-skills/hackernews-frontpage": 371, "canary": 7738, "captain": 6551, - "capy/skill/gstack": 5136, + "capy/skill/gstack": 5312, "careful": 1239, "codex": 9890, "context-restore": 6287,