Skip to content

v1.91.375.0 captain: stop a finished /ship subagent at READY once its parent subscribes to the PR - #3597

Merged
capy-ai[bot] merged 5 commits into
mainfrom
capy/gsta156-ship-subagent-stop
Oct 31, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
capy/gsta156-ship-subagent-stop

Conversation

@garrytan

@garrytan garrytan commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3597,
  "head": "dcffa36c4d35faf7dc5f00c99a3d965ccf52304b",
  "version": "1.91.365.0",
  "base": "main",
  "gate": {
    "remote-free": {
      "pass": 3407,
      "fail": 0,
      "skip": 0
    },
    "guards": {
      "pass": 116,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "7e4d1427da0271900908c9e196b190cc9bd52251",
  "product_patch_id": "6b3907b58f7d3fd8c6452715e0c8ee7382d9c55a",
  "gstack_version": "1.91.366.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 9,
    "rules": "150435b0a543019a",
    "base": "12dc6782c26909f5f52be82c260d5f95d5dc5b37",
    "registry": "12dc6782c26909f5f52be82c260d5f95d5dc5b37",
    "gate_scan": {
      "tagged": 0,
      "head": "dcffa36c4d35faf7dc5f00c99a3d965ccf52304b"
    },
    "reasons": [
      "runtime=9<=50"
    ]
  },
  "pregate": "requires-remote cleared @7e4d1427da02 (7 checks, current for dcffa36c4d35)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41202079075",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41202079003",
    "pregate.json/remote_gate: remote-gate tree=7e4d1427da02 tests=3407"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, captain/, capy/, README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md searched for /ship subagent, READY and post-READY ownership"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 6,
    "fixed": 0,
    "scope": "frozen",
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  }
}

What changed

A finished /ship subagent now stops at READY after its parent subscribes to the PR, so CI and review callbacks stop waking it on a frozen head

A finished /ship subagent now stops at READY after its parent subscribes to the PR, so CI and review callbacks stop waking it on a frozen head.

Before/after as text: A finished /ship subagent now stops at READY after its parent subscribes to the PR, so CI and review callbacks stop waking it on a frozen head
--- Before · capy/skill/gstack/SKILL.md § Plan, approve, ship at a305302 · source text
+++ After · capy/skill/gstack/SKILL.md § Plan, approve, ship on this branch · source text
@@ ⋯ 3 unchanged ⋯ @@
 - **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 <run dir> --captain-name "<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 <run dir> --by "<owner>"`.
 - **/ship before ready.** Run /ship at the final pushed head before a PR is called ready; `SHIP_RECEIPT: pr=<n> head=<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 <n> --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.

Why

The approved plan (GSTA-156, P2) put it this way: "Stop finished /ship subagents". After READY, a /ship subagent kept getting woken by every check and review on its PR, which cost tokens and sometimes acted on a head that was meant to be frozen. Now the parent subscribes to the PR when the subagent opens it, stops the subagent at READY, and owns the PR from then on.

Blast radius

This is prose only, in the Capy gstack skill, the lane's /ship sequence in docs/captain.md and the lane brief template, so no ship-queue, receipt or skill-section code changes. The one number that moves is the Capy skill's context-budget ceiling, from 5136 to 5312: lib/context-bill measures the skill at 5135.9 tokens on main and 5311.6 on this branch, and the ratchet test passed at the new ceiling.

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-10-29 Approve the plan "Run each full suite once per tree; stop finished /ship subagents; scan only new patches in sealed (GSTA-156, v2)" (autoplan run autoplan-20261029033528, 8 decisions) “Garry: Do it” (Garry (via GStack Minder), relayed by agent:gstack-minder) approved the reviewed plan (sha256 3790c7eb1630), every recommendation taken none
2026-10-29 Approve the plan "Run each full suite once per tree; stop finished /ship subagents; scan only new patches in sealed (GSTA-156, v2)" (autoplan run autoplan-20261029033528, 1 decisions) “Garry: Do it” (Garry (via GStack Minder), relayed by agent:gstack-minder) approved the reviewed plan (sha256 3790c7eb1630), every recommendation taken none

Source: gstack-approvals record for capy/gsta156-ship-subagent-stop (display only; not an approval citation).

Summary

The rule lives in two places. The Capy mechanics are in capy/skill/gstack/SKILL.md: subscribe when the PR opens, keep one subscription until merge or close, stop the subagent only once that subscription is in place and READY has arrived, and treat any later automatic wake as a one-line report naming what woke it, its pin and the PR head. A message from the parent is still an instruction. The host-neutral sentence is in docs/captain.md, where the parent owns red checks, review, the slot stamp, re-READY and receipt carry after READY. The brief template carries a pointer. This head merges main at a305302 into the earlier pin, and the changelog entry is the fragment changelog.d/capy-gsta156-ship-subagent-stop.md.

Test Coverage

Prose and a budget fixture only, so there are no new code paths and the coverage gate does not apply. The guards that read these files ran: parity-suite, skill-md-size-guard, skill-size-budget, context-budget-ratchet, context-bill, catalog-budget, skill-budget-regression and claude-md-size, with 116 pass and 0 fail. No test pins the new clauses.

Tests ran: remote-free 3407
Tests ran: guards 116

Pre-Landing Review

No blocking findings. Pass 1 ran one batched specialist reader (testing, security, state machines and red team), which returned NO FINDINGS, and the native adversarial reviewer, which returned six informational notes, none at the blocking floor. The outside voice was skipped because this is a docs-only diff (crew rule 30(a)).

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

Gate edits: none detected (1 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none). The one listed hunk is the context-budget ceiling, raised by the measured growth above.

Outside review: skipped (docs-only diff, crew rule 30(a)); not counted as coverage.

Review notes

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

  • INFORMATIONAL capy/skill/gstack/SKILL.md:58 a red check that settles after the subagent's last turn but before the parent subscribes reaches neither; the parent does not read current checks at the pin after subscribing
  • INFORMATIONAL capy/skill/gstack/SKILL.md:58 a stopped Capy subagent is parked, so notices queue and arrive with the parent's resume message; the bullet does not say to leave queued notices unacted
  • INFORMATIONAL captain/templates/brief.md:37 the parent usually learns the PR number only from READY, so the subscription happens at READY and the subagent is idle, not stopped, until the stop call; brief.md and SKILL.md/captain.md word the timing differently
  • INFORMATIONAL capy/skill/gstack/SKILL.md:58 watch expiry may be silent, so re-subscribing on expiry has no trigger
  • INFORMATIONAL docs/captain.md:252 the host-neutral paragraph names subscribe and stop, which other hosts may lack
  • INFORMATIONAL test/fixtures/context-budget.json:12 the ceiling sits at the measured value, so the next PR that grows the skill must raise it again (deliberate per the fragment)

Exploratory QA

Smoke checks on the changed surface: the #plan-approve-ship anchor in docs/captain.md resolves to the "Plan, approve, ship" heading in capy/skill/gstack/SKILL.md, and the context-budget ratchet passes with the skill at 5311.6 tokens under the 5312 ceiling. No product code changed, so no other probes apply.

Design Review

No frontend files changed — design review skipped.

Eval Results

The project's eval selector (scripts/eval-select.ts against origin/main) selected no behavioral probes and no quality judges for these five files, so no evals ran.

Greptile Review

No Greptile comments.

Plan Completion

P2 items 1 and 2 are done. P3a is #3592; P3b and P1 follow.

Verification Results

No plan-specific verification items for this change. Step 16 found the reviewed tree unchanged (7e4d1427da02), the docs audit fresh, the guards lane fresh and gstack-pregate verify ok.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. No doc edits were needed: the new rule (the parent subscribes to a /ship subagent's PR, stops the subagent at READY and owns the PR afterwards) agrees with every related doc I checked.

Scope: committed diff a305302..dcffa36 (5 files: capy/skill/gstack/SKILL.md, docs/captain.md, captain/templates/brief.md, changelog.d/capy-gsta156-ship-subagent-stop.md, test/fixtures/context-budget.json). Nothing was staged, unstaged or untracked. I cross-checked the related docs on /ship subagents, READY and who owns the PR after READY: captain/templates/READY.md, capy/skill/gstack/factory.md, capy/skill/gstack/captain.md, captain/SKILL.md.tmpl and capy/README.md.

Documentation health:
  capy/skill/gstack/SKILL.md    Current (new 'Stop a finished /ship subagent' bullet agrees with docs/captain.md)
  docs/captain.md               Current (new paragraph after step 10; link to the skill's #plan-approve-ship resolves)
  captain/templates/brief.md    Current (one pointer line to the lane's /ship sequence)
  captain/templates/READY.md    Current (the lane, which is the parent, re-READYs; agrees)
  capy/skill/gstack/factory.md  Current (rule 2: send one READY and stop; agrees)
  capy/skill/gstack/captain.md  Current (no /ship-subagent statements)
  captain/SKILL.md.tmpl         Current (head frozen after READY; agrees)
  capy/README.md                Current (tip 8 prefers background operations to watcher subagents; agrees)
  CHANGELOG.md                  Skipped (fragment-based; Step 5 not run)
  TODOS.md                      Current (no related items)

Coverage debt: the stop-at-READY rule has reference coverage (capy/skill/gstack/SKILL.md), explanation (docs/captain.md) and a template pointer (captain/templates/brief.md). The lane-side guide, capy/skill/gstack/captain.md, doesn't repeat it, which is a minor gap. There is no how-to or tutorial, which is fine for a workflow rule.

Diagram drift: none.

Noted, not from this branch: captain/templates/brief.md step 3 and docs/captain.md (rule 15, the READY contract) still say the CHANGELOG entry goes under [Unreleased], while the repo uses changelog fragments.

Test plan

  • gstack-pregate --allow-repo-commands --remote --spend-cap 2 --timeout 2700 at dcffa36: remote gate 3407 tests, 0 failed on tree 7e4d1427da02 ($0.06). The macOS and Windows lanes are cleared from this PR's CI at the same head (Free Tests run 41202079075, Windows Free Tests run 41202079003).
  • Guards lane (bun test over the eight size, budget and parity files above): 116 pass, 0 fail.
  • gstack-prose-lint changelog.d/capy-gsta156-ship-subagent-stop.md --gate: ok.

garrytan and others added 3 commits October 29, 2026 06:21
…g to its PR

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>
…nt owns post-READY work, unconditional one-line wake, tight budget)

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

trunk-io Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

…agent-stop

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

# Conflicts:
#	CHANGELOG.md
#	test/fixtures/context-budget.json
@github-actions github-actions Bot changed the title captain: stop a finished /ship subagent at READY once its parent subscribes to the PR v1.91.375.0 captain: stop a finished /ship subagent at READY once its parent subscribes to the PR Oct 31, 2026
@capy-ai
capy-ai Bot merged commit 7d4e71b into main Oct 31, 2026
62 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