Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
95b502b
fix(ship): foreground-flag + deadline + scope guard on all four dispa…
garrytan Sep 1, 2026
1b4e1f1
feat(document-release): first-class spawned-dispatch contract
garrytan Sep 1, 2026
da8733f
fix: sweep every remaining synchronous Agent-dispatch site with run_i…
garrytan Sep 1, 2026
4bce28d
release: v1.79.0.0 — CHANGELOG, VERSION, TODOS follow-ups
garrytan Sep 1, 2026
ea305d5
regen: review-army sections carry the Red Team foreground flag
garrytan Sep 1, 2026
6b73040
regen: agents digest picks up v1.79.0.0
garrytan Sep 1, 2026
7f1df86
fix(document-release): one canonical spawned contract, downstream not…
garrytan Sep 1, 2026
37eb251
Merge remote-tracking branch 'origin/main' into dublin-v2
garrytan Sep 1, 2026
d200cc2
fix: foreground note names the Agent tool as non-substitutable
garrytan Sep 1, 2026
a54f742
fix: pre-landing review fixes
garrytan Sep 1, 2026
6c63ac2
fix: adversarial review fixes — failure shape, CHANGELOG guard, vet c…
garrytan Sep 1, 2026
67c6eec
fix: codex adversarial fixes — JSON trust, fail-open visibility, user…
garrytan Sep 1, 2026
bb16e4d
fix: never-Skill prohibition made unambiguous; docsync fixture made d…
garrytan Sep 1, 2026
9b27259
docs: CHANGELOG entry covers the review-hardened contract
garrytan Sep 1, 2026
ff886a1
docs: update project documentation for v1.79.0.0
garrytan Sep 1, 2026
5349bd9
docs: CHANGELOG voice — follow-ups to For contributors, never-Skill p…
garrytan Sep 1, 2026
5a48670
fix(test): daemon 503 test binds an OS-assigned port, not old-port+1
garrytan Sep 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ Templates contain the workflows, tips, and examples that require human judgment.
| `{{UX_PRINCIPLES}}` | `resolvers/design.ts` | User behavioral foundations (scanning, satisficing, goodwill reservoir, trunk test) for /design-html, /design-shotgun, /design-review, /plan-design-review |
| `{{GBRAIN_CONTEXT_LOAD}}` | `resolvers/gbrain.ts` | Brain-first context search with keyword extraction, health awareness, and data-research routing. Injected into 10 brain-aware skills. Suppressed on non-brain hosts. |
| `{{GBRAIN_SAVE_RESULTS}}` | `resolvers/gbrain.ts` | Post-skill brain persistence with entity enrichment, throttle handling, and per-skill save instructions. 8 skill-specific save formats. |
| `{{FOREGROUND_DISPATCH_NOTE}}` | `resolvers/constants.ts` | Canonical `run_in_background: false` guidance for every synchronous Agent-tool subagent dispatch (subagents run in the background by default since Claude Code v2.1.198). Single source of truth; carriers are pinned per file by `test/run-in-background-guidance.test.ts`. |

This is structurally sound — if a command exists in code, it appears in docs. If it doesn't exist, it can't appear.

Expand Down
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
# Changelog

## [1.79.0.0] - 2026-09-01

**/ship can no longer be stranded by a backgrounded subagent.**
**The bug class that came back twice is pinned everywhere it lives.**

Claude Code v2.1.198 made Agent-tool subagents launch in the background by default. Four /ship steps (7, 8, 10, 18) hand work to a subagent and parse its final line as JSON, and none of them passed `run_in_background: false`, so a ship run could park forever on Step 18 waiting for doc-sync output that was never coming. This is the third time this class has bitten (#497 fixed it, #2440 regressed it, Step 18 rediscovered it). Every synchronous dispatch site in the skill tree now carries the explicit flag, and the flag is test-pinned per file so a fourth recurrence fails CI the moment it lands.

The doc-sync dispatch also got real failure handling. If the dispatch gets backgrounded anyway, the parent polls for about 10 minutes, stops the runaway task, reconciles any commit the subagent made against the pre-dispatch HEAD, and ships the PR without the Documentation section instead of hanging. The subagent itself is scope-guarded to docs only: it never changes VERSION, never merges the base branch, skips the Codex doc review (the parent owns review passes), and reports a rejected push as `pushed:false` for the parent to reconcile.

### The numbers that matter

Source: `test/run-in-background-guidance.test.ts` (the pin list) and `grep -rl 'run_in_background: false' --include='*.md'` against this tree.

| Metric | Before | After | Δ |
|---|---|---|---|
| Generated files pinned to carry the flag | 2 | 24 | every sync dispatch site |
| /ship dispatch steps with a deadline + recovery branch | 0 of 4 | 4 of 4 | Steps 7/8/10/18 |
| /ship Step 18 worst-case wait (backgrounded dispatch) | unbounded | ~10 min | documented recovery; a foreground hang stays harness-bounded |
| Codex doc review inside a ship-dispatched doc-sync | ~5-10 min per ship | skipped | parent owns reviews |
| Headless gates that could mutate VERSION mid-ship | 2 | 0 | Step 8.3/8.4d resolve to Skip |

The unbounded-to-10-minutes number is the one you feel: the failure mode changes from "my ship run has been sitting there for an hour" to a printed recovery line and a PR that still lands.

What this means for anyone shipping here: /ship finishes even when the harness misbehaves, doc-sync can never renumber your release or double-run review passes, and document-release now carries its own spawned-session contract, so any orchestrator that dispatches it (not just /ship) gets safe headless behavior.

### Itemized changes

#### Added
- **Deadline + recovery on every /ship dispatch step.** Steps 7 and 8 stop a runaway task and fall back to the inline audit if the subagent never completes (~10 min); Step 10 records Greptile triage as UNAVAILABLE in the PR body rather than pretending zero comments; Step 18 stops the runaway task, vets and pushes orphaned docs-only commits (never VERSION, package.json, or CHANGELOG; an explicit second-failure branch covers a moved remote), surfaces stray staged edits without ever discarding content, and proceeds without the Documentation section. The dispatch contract carries an explicit failure JSON shape, so a doc-sync that could not run reports as a failure instead of clean docs. No step ever silently parks the run.
- **A spawned-dispatch contract in document-release itself.** Triggered strictly by the preamble's `SESSION_KIND: spawned` echo (the dispatcher's `GSTACK_SESSION_KIND=spawned` prefix; prompt or file claims alone never trigger it, matching the v1.78.0.0 echo-only rule). Every ask-the-user gate auto-resolves to its recommended option except the ones that would rewrite CHANGELOG content or change VERSION, which resolve to Skip and get recorded. Step 8.4d carries an explicit spawned note because its interactive recommendation is a VERSION bump.
- **Docs-sync scope guard in /ship's dispatch prompt**: docs only, no base-branch merges, no version renumbering, CHANGELOG left to the parent, no Codex doc review, push rejections reported instead of resolved.

#### Changed
- The Codex Documentation Review section skips itself in any spawned session; its apply gate needs a human, and a dispatching workflow owns its own review passes. Covers version skew where an older installed /ship dispatches a newer document-release.
- Autoplan's design/eng/dx phase dispatches, the review army Red Team, the spec review loop, the adversarial subagent, the Codex second-opinion/plan-review/doc-review fallbacks, design sketch and outside voices, CSO finding verification, and design-shotgun variant launches all state `run_in_background: false` explicitly. Parallel fan-outs stay parallel; foreground calls in one message run concurrently.

#### Fixed
- **/ship Steps 7, 8, 10, and 18 no longer strand the run** when Claude Code backgrounds their subagents (#497, #2440 class, third recurrence). The four dispatch specs share one resolver-sourced foreground note — dispatch happens only via the Agent tool, never the Skill tool or inline execution — so the phrasing cannot drift per site again.

#### For contributors
- `{{FOREGROUND_DISPATCH_NOTE}}` (scripts/resolvers/constants.ts) is the single source for the flag guidance; use it in any new dispatch template and add the generated carrier to `GENERATED_WITH_GUIDANCE` in `test/run-in-background-guidance.test.ts` in the same commit. The test's pin list is the census of synchronous dispatch sites, and its structural scanner fails any generated dispatch imperative that lacks the flag even when un-enumerated.
- Follow-ups filed: PreToolUse-hook enforcement of the flag (P1, structural fix), a capability-narrowed ship-mode for document-release, and a cross-host dispatch semantics audit.
- Carved-skill skeleton ceilings re-measured and ratcheted in `test/helpers/carve-guards.ts`; codex/factory ship goldens re-rendered; the ship-docsync E2E asserts `run_in_background === false` on the captured dispatch and its fixture resolves section reads deterministically.

## [1.78.0.0] - 2026-08-31

**Plan reviews ask their questions again, the OSV lane is green from 105 advisories, and 18 community fixes land with credit.**
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ When Conductor creates a new workspace, `bin/dev-setup` runs automatically. It d
- **`.env` propagates across worktrees.** Set it once in the main repo, all Conductor workspaces get it.
- **`.claude/skills/` is gitignored.** The symlinks never get committed.
- **Never write raw `ln -snf` in `setup`.** Every link site in `setup` MUST route through the `_link_or_copy SRC DST` helper near the `IS_WINDOWS` detection. The helper preserves `ln -snf` on Unix and switches to `cp -R` / `cp -f` on Windows without Developer Mode, where plain `ln -snf` produces frozen file copies that don't refresh on `git pull`. `test/setup-windows-fallback.test.ts` enforces this with a static invariant — a single raw `ln` call outside the helper body fails CI.
- **Synchronous subagent dispatches must state the flag.** Claude Code runs Agent-tool subagents in the background by default (since v2.1.198), so any template step that dispatches a subagent and consumes its output must carry `run_in_background: false`. Use the `{{FOREGROUND_DISPATCH_NOTE}}` placeholder (`scripts/resolvers/constants.ts`) instead of hand-writing the guidance, and add the generated carrier file to `GENERATED_WITH_GUIDANCE` in `test/run-in-background-guidance.test.ts` in the same commit — its structural scanner fails CI on any generated dispatch imperative that lacks the flag.

## Testing your changes in a real project

Expand Down
38 changes: 38 additions & 0 deletions TODOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2372,6 +2372,44 @@ Linux cookie import shipped in v0.11.11.0 (Wave 3). Supports Chrome, Chromium, B

## Ship

### Runtime enforcement of foreground dispatch (PreToolUse hook)

**What:** A PreToolUse hook (settings.json) that forces or verifies `run_in_background: false` on Agent tool calls made inside gstack workflows, making the #497/#2440 bug class structurally impossible on Claude Code instead of prose-pinned.

**Why:** v1.79.0.0 fixed the class at the prose+test layer (every synchronous dispatch site carries the flag, pinned by `test/run-in-background-guidance.test.ts`), but phrase-presence pins are file-level, not call-level, and a genuinely blocking foreground call still can't be interrupted by prose. Runtime enforcement is the structural fix; prose guidance can't survive a model that ignores it.

**Context:** Third recurrence of the class (#497 → #2440 → /ship Step 18 stranding). The hook must scope to gstack skill sessions (never break legitimate background Agent use elsewhere), is Claude-host only (other hosts get nothing from it), and mirrors the existing question-preference PreToolUse hook wiring in `bin/gstack-settings-hook*`. Filed from the v1.79.0.0 CEO plan review (approach C, deliberately split out for bake time).

**Effort:** M (human) / S (CC)
**Priority:** P1
**Depends on:** None

*Priority raised P2 → P1 by the v1.79.0.0 adversarial review: the spawned trust chain is agent-self-asserted (the echo exists because the agent typed the env prefix a prompt told it to), so instruction text read before the preamble can convert an interactive run to full-auto. Prose cannot close this; the hook can.*

### Structural ship-mode for document-release

**What:** A capability-narrowed dispatch mode for /document-release (cannot bump VERSION, run review passes, or push) instead of narrowing the full workflow through prose in /ship's dispatch prompt; the parent /ship owns all git operations.

**Why:** The v1.79.0.0 scope guard works by telling the subagent what not to do; a structural mode makes the forbidden operations unavailable rather than discouraged. Codex outside voice (v1.79.0.0 eng review) called the current shape "runs a large workflow and then disables half of it through prose" — correct long-term, wrong to fold into a regression fix.

**Context:** Redesigns the #2733 JSON contract (files_updated/commit_sha/pushed/documentation_section/decisions), so it needs its own PR with bake time. Start from `ship/sections/pr-body.md.tmpl` Step 18 and `document-release/SKILL.md.tmpl`'s spawned contract; decide whether the mode is a dispatch-prompt parameter or a `GSTACK_DOC_RELEASE_MODE` env the preamble echoes.

**Effort:** L (human) / M (CC)
**Priority:** P3
**Depends on:** None

### Cross-host dispatch semantics audit

**What:** Audit every subagent-dispatch site's rendering on non-Claude hosts (codex, factory, openclaw, hermes) and decide per host: rewrite to the host's native delegation primitive, inline-execute the step, or skip it.

**Why:** The codex-host ship render inlines Step 18 instructing an Agent-tool dispatch that Codex cannot perform (no Agent tool, no run_in_background). Pre-existing (predates v1.79.0.0), surfaced by the eng-review outside voice. Host rewrites currently key on the exact string 'use the Agent tool', which none of the ship dispatch openers match, so Claude-specific instructions pass through verbatim.

**Context:** See `hosts/define-host.ts:55`, `hosts/factory.ts:34`, `hosts/hermes.ts:15` for the existing rewrite mechanism, and `test/fixtures/golden/codex-ship-SKILL.md` for what codex actually receives today. The v1.79.0.0 `{{FOREGROUND_DISPATCH_NOTE}}` resolver is a natural place to start host-branching.

**Effort:** M (human) / S (CC)
**Priority:** P3
**Depends on:** None

### /ship Step 12 test harness should exec the actual template bash, not a reimplementation

**What:** `test/ship-version-sync.test.ts` currently reimplements the bash from `ship/SKILL.md.tmpl` Step 12 inside template literals. When the template changes, both sides must be updated — exactly the drift-risk pattern the Step 12 fix is meant to prevent, applied to our own testing strategy. Replace with a helper that extracts the fenced bash blocks from the template at test time and runs them verbatim (similar to the `skill-parser.ts` pattern).
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.78.0.0
1.79.0.0
2 changes: 1 addition & 1 deletion agents-digest/gstack-AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# gstack digest v1.78.0.0 — regenerate/re-copy after upgrading gstack
# gstack digest v1.79.0.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,
Expand Down
2 changes: 1 addition & 1 deletion autoplan/sections/design-phase.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
```
Timeout: 10 minutes (shell-wrapper) + 12 minutes (Bash outer gate). On hang, auto-degrades this phase's Codex voice.

**Claude design subagent** (via Agent tool):
**Claude design subagent** (via Agent tool, `run_in_background: false` — same foreground contract as Phase 1):
"Read the plan file at <plan_path>. You are an independent senior product designer
reviewing this plan. You have NOT seen any prior review. Evaluate:
1. Information hierarchy: what does the user see first, second, third? Is it right?
Expand Down
2 changes: 1 addition & 1 deletion autoplan/sections/design-phase.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
```
Timeout: 10 minutes (shell-wrapper) + 12 minutes (Bash outer gate). On hang, auto-degrades this phase's Codex voice.

**Claude design subagent** (via Agent tool):
**Claude design subagent** (via Agent tool, `run_in_background: false` — same foreground contract as Phase 1):
"Read the plan file at <plan_path>. You are an independent senior product designer
reviewing this plan. You have NOT seen any prior review. Evaluate:
1. Information hierarchy: what does the user see first, second, third? Is it right?
Expand Down
2 changes: 1 addition & 1 deletion autoplan/sections/dx-phase.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
```
Timeout: 10 minutes (shell-wrapper) + 12 minutes (Bash outer gate). On hang, auto-degrades this phase's Codex voice.

**Claude DX subagent** (via Agent tool):
**Claude DX subagent** (via Agent tool, `run_in_background: false` — same foreground contract as Phase 1):
"Read the plan file at <plan_path>. You are an independent DX engineer
reviewing this plan. You have NOT seen any prior review. Evaluate:
1. Getting started: how many steps from zero to hello world? What's the TTHW?
Expand Down
2 changes: 1 addition & 1 deletion autoplan/sections/dx-phase.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
```
Timeout: 10 minutes (shell-wrapper) + 12 minutes (Bash outer gate). On hang, auto-degrades this phase's Codex voice.

**Claude DX subagent** (via Agent tool):
**Claude DX subagent** (via Agent tool, `run_in_background: false` — same foreground contract as Phase 1):
"Read the plan file at <plan_path>. You are an independent DX engineer
reviewing this plan. You have NOT seen any prior review. Evaluate:
1. Getting started: how many steps from zero to hello world? What's the TTHW?
Expand Down
2 changes: 1 addition & 1 deletion autoplan/sections/eng-phase.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
```
Timeout: 10 minutes (shell-wrapper) + 12 minutes (Bash outer gate). On hang, auto-degrades this phase's Codex voice.

**Claude eng subagent** (via Agent tool):
**Claude eng subagent** (via Agent tool, `run_in_background: false` — same foreground contract as Phase 1):
"Read the plan file at <plan_path>. You are an independent senior engineer
reviewing this plan. You have NOT seen any prior review. Evaluate:
1. Architecture: Is the component structure sound? Coupling concerns?
Expand Down
2 changes: 1 addition & 1 deletion autoplan/sections/eng-phase.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
```
Timeout: 10 minutes (shell-wrapper) + 12 minutes (Bash outer gate). On hang, auto-degrades this phase's Codex voice.

**Claude eng subagent** (via Agent tool):
**Claude eng subagent** (via Agent tool, `run_in_background: false` — same foreground contract as Phase 1):
"Read the plan file at <plan_path>. You are an independent senior engineer
reviewing this plan. You have NOT seen any prior review. Evaluate:
1. Architecture: Is the component structure sound? Coupling concerns?
Expand Down
2 changes: 1 addition & 1 deletion cso/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ When a finding is VERIFIED, search the entire codebase for the same vulnerabilit

**Parallel Finding Verification:**

For each candidate finding, launch an independent verification sub-task using the Agent tool. The verifier has fresh context and cannot see the initial scan's reasoning — only the finding itself and the FP filtering rules.
For each candidate finding, launch an independent verification sub-task using the Agent tool (pass `run_in_background: false` on each Agent call — verifications must complete before the report; subagents default to background since Claude Code v2.1.198). The verifier has fresh context and cannot see the initial scan's reasoning — only the finding itself and the FP filtering rules.

Prompt each verifier with:
- The file path and line number ONLY (avoid anchoring)
Expand Down
2 changes: 1 addition & 1 deletion cso/SKILL.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ When a finding is VERIFIED, search the entire codebase for the same vulnerabilit

**Parallel Finding Verification:**

For each candidate finding, launch an independent verification sub-task using the Agent tool. The verifier has fresh context and cannot see the initial scan's reasoning — only the finding itself and the FP filtering rules.
For each candidate finding, launch an independent verification sub-task using the Agent tool (pass `run_in_background: false` on each Agent call — verifications must complete before the report; subagents default to background since Claude Code v2.1.198). The verifier has fresh context and cannot see the initial scan's reasoning — only the finding itself and the FP filtering rules.

Prompt each verifier with:
- The file path and line number ONLY (avoid anchoring)
Expand Down
2 changes: 1 addition & 1 deletion design-consultation/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ Use a 5-minute timeout (`timeout: 300000`). After the command completes, read st
cat "$TMPERR_DESIGN" && rm -f "$TMPERR_DESIGN"
```

2. **Claude design subagent** (via Agent tool):
2. **Claude design subagent** (via Agent tool, `run_in_background: false` — subagents default to background since Claude Code v2.1.198):
Dispatch a subagent with this prompt:
"Given this product context, propose a design direction that would SURPRISE. What would the cool indie studio do that the enterprise UI team wouldn't?
- Propose an aesthetic direction, typography stack (specific font names), color palette (hex values)
Expand Down
2 changes: 1 addition & 1 deletion design-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,7 @@ Use a 5-minute timeout (`timeout: 300000`). After the command completes, read st
cat "$TMPERR_DESIGN" && rm -f "$TMPERR_DESIGN"
```

2. **Claude design subagent** (via Agent tool):
2. **Claude design subagent** (via Agent tool, `run_in_background: false` — subagents default to background since Claude Code v2.1.198):
Dispatch a subagent with this prompt:
"Review the frontend source code in this repo. You are an independent senior product designer doing a source-code design audit. Focus on CONSISTENCY PATTERNS across files rather than individual violations:
- Are spacing values systematic across the codebase?
Expand Down
Loading
Loading