Skip to content

Unattended /autoplan on Claude Code says its phase guard is on, and a report hidden in reasoning gets a clear fix (GST-3062) - #4481

Merged
capy-ai[bot] merged 3 commits into
mainfrom
autoplan-guard-says-when-it-is-on
Nov 18, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
autoplan-guard-says-when-it-is-on

Conversation

@garrytan

@garrytan garrytan commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

An unattended /autoplan run on Claude Code now says its phase guard is on, instead of saying it is off while the guard blocks it. A phase report written only in reasoning now gets a denial that says so and names the exact command to send.
Why: in the day-one eval, two runs were blocked by a guard their own record called off, and one run ended blocked after four publish attempts whose report was invisible.
Nothing to do.

What changed

An unattended /autoplan start on Claude Code now says the phase guard is on, because Claude Code runs the hook whatever the session kind

An unattended /autoplan start on Claude Code now says the phase guard is on, because Claude Code runs the hook whatever the session kind.

--- Before · before.txt · captured output (base 33b1a965)
+++ After · after.txt · captured output (this branch)
-autoplan guard: not enforced by this host; publication order is unverified (GUARD_NOT_INSTALLED)
+autoplan guard: enforced by Claude Code's /autoplan hook at phase Reads and reviewer dispatch; publish each phase report as visible message text, not reasoning, before the next phase (GUARD_ENFORCED)

Runs were stopped by a guard that their own start line called off. The start line now follows the host. On Claude Code, with no other host active and the installed autoplan/SKILL.md declaring the hook, it prints GUARD_ENFORCED. Everywhere else it prints GUARD_NOT_INSTALLED as before. gstack-artifact validate accepts either line in an unattended run's record.

When a true autoplan-published message after the close packet Read has no visible text, the guard now denies with its own corrective code, publication_not_visible, instead of the generic publication_missing. Every publication denial names the exact command (for example true autoplan-published dx), the line the report must start with, and says reasoning does not count. The guard still denies when the report is really missing, and a saved report file still does not count.

Why

"The guard blocked the run while the record said it was off." Unattended Claude Code runs now get a start line that matches what the host does, and a stuck run gets a denial that tells it the one next step instead of a generic retry.

Blast radius

The change touches the autoplan start line in bin/gstack-skill-start, the gstack-autoplan run record (lib/autoplan-run.ts), the publication hook's denial path and the validator's guard-line check. The validator accepts the old GUARD_NOT_INSTALLED line unchanged, so existing records still validate (lib/headless-artifacts.ts:552 read, covered by test/headless-artifacts.test.ts). The full free suite passed in CI at this head (Free Tests run 44266618870).

Test Coverage

Test Coverage Audit: 12 new code paths, 9 covered (75% have any test, 75% have a two-star or better test). No tests generated (audit only).

Tests: 1811 → 1811 (+0 new from the audit; the branch itself adds test/autoplan-publication-visible.test.ts).

Leftover gaps, proposed as follow-up tests:

  • Guard status with an autoplan/SKILL.md that lacks the hook, has it only in the body, or is missing should give GUARD_NOT_INSTALLED in both bash and TypeScript.
  • initRun with CLAUDECODE=1 (the fixture removes it today).
  • Denial text for phases 2, 2.5 and 3 naming design, dx and eng.

Tests ran: free 1693 files (37778 tests), reused from CI run 44266618870 at this exact tree.

Pre-Landing Review

No blocking issues found. One review round on the whole diff (a batched specialist reader for testing, security, state machines and red-team, plus a same-model adversarial reader). Three findings sit below the blocking floor and are left as notes below.

Review notes
  • lib/autoplan-run.ts:133: the gstack-autoplan runner records GUARD_ENFORCED whenever CLAUDECODE is set. A Claude Code agent that drives the runner through autoplan/DRIVER.md, without starting /autoplan as a skill, has no hook registered, so its run record would wrongly say the guard was on. The record line is wrong, but no test, run or data breaks. Follow-up: keep the runner on GUARD_NOT_INSTALLED, or claim enforcement only when the skill is provably active.
  • lib/autoplan-guard-status.ts:8: the header comment names test/autoplan-guard-status.test.ts, which does not exist. The bash and TypeScript parity check lives in test/gstack-skill-start.test.ts:403.
  • autoplan/bin/phase-publication-hook.ts:479: if a journal ever leaves out message ids, a publish message that did have text, just not a correct report, would be denied as publication_not_visible instead of publication_missing. It still denies, so the guard stays safe, but the fix it names would be the wrong one.
Exploratory QA

Smoke probes of the start line on this branch, unattended: CLAUDECODE=1 printed GUARD_ENFORCED; CLAUDECODE=1 with GSTACK_ACTIVE_HOST=codex printed GUARD_NOT_INSTALLED; no CLAUDECODE printed GUARD_NOT_INSTALLED. The TypeScript rule returned GUARD_NOT_INSTALLED for an autoplan/SKILL.md whose hook appears only in the body. A bash probe of that same case from a copied script was inconclusive (the copy lacked its neighbours) and is listed as not run.

Eval Results

Paid evals were not run locally. The E2E Evals workflow runs on this pull request in CI.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. The docs already describe the autoplan guard-line change and the new publication_not_visible denial; this audit made no edits.

Scope: base 33b1a96 to head 2fd0b97 (19 files), plus the staged rename and unstaged edit of the changelog.d fragment.

Documentation health:

  • docs/unattended.md: Current (the guard line follows the host; both lines are named)
  • docs/troubleshooting.md: Current (GUARD_NOT_INSTALLED entry revised; new #guard-enforced entry)
  • docs/autoplan-guard-troubleshooting.md: Current (publication_missing updated; publication_not_visible added)
  • docs/skill-gates.md: Current
  • autoplan/sections/phase-close.md.tmpl: Current

Coverage: GUARD_ENFORCED and publication_not_visible both have reference and how-to coverage. No critical gaps and no diagram drift.

Debt: a source comment in lib/autoplan-guard-status.ts names test/autoplan-guard-status.test.ts, which does not exist. The older design records in docs/designs/ still describe the previous rule and are left as history.

Tests
  • bun test test/autoplan-publication-visible.test.ts test/test-of-test-ratchet.test.ts: 8 pass, 0 fail (after the ratchet fix)
  • bun run typecheck:test: 812 known diagnostics, none new
  • Free suite (bun run test): carried from CI run 44266618870 at this tree, 37778 tests
Agent notes

Agent notes

Lane GSTA-609 for GST-3062, from GEVA-549 (GST-2948) on e671a53 with Claude Code 2.1.314. Decision trail: captain drive reports/GSTA-609-decisions.tsv. Refs GST-3062.

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

Gate edits: none detected (8 listed, 2 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

Approvals

No approvals recorded for branch autoplan-guard-says-when-it-is-on.
Plan: exempt: bug fix (R65)
Plan check: exempt bug fix

{
  "schema_version": 1,
  "pr": 4481,
  "head": "5c1db8c870fca141743b519b1af4b814c9854e83",
  "version": "1.100.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 37778,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 44266618870,
      "attempt": 1,
      "tree": "6f1260d730edfbfaa368d1f0505ac0503e7e0ca4"
    }
  ],
  "calls": 24,
  "session_kind": "unattended",
  "run": "ship-4481",
  "head_tree": "6f1260d730edfbfaa368d1f0505ac0503e7e0ca4",
  "product_patch_id": "11b16f014516b85c77de90e43bdd1686a67b37b2",
  "gstack_version": "1.100.0.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 106,
    "rules": "1afa38a4be3b5eef",
    "base": "33b1a965bacb9ae28ac9281a1a70cbd987e54c01",
    "registry": "33b1a965bacb9ae28ac9281a1a70cbd987e54c01",
    "gate_scan": {
      "tagged": 0,
      "head": "5c1db8c870fca141743b519b1af4b814c9854e83"
    },
    "reasons": [
      "runtime=106"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @6f1260d730ed (8 checks, current for 5c1db8c870fc)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/44266618870/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44266618870/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44266618940/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=6f1260d730ed tests=37778 skipped=105 runs=44266618870/1 profiles=ci-reuse/free-tests heads=5c1db8c870fc verified=2026-11-18T08:36:17.432Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md (guard-line and publication docs current; no edits)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  },
  "gate_dispositions": []
}

… report hidden in reasoning gets a clear fix (GST-3062)

The skill-start guard line now follows the host instead of the session kind, the run record and validator accept GUARD_ENFORCED, and a publish message with no visible text gets the publication_not_visible denial naming the exact command.

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

trunk-io Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 2 commits November 18, 2026 08:01
…asons module

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…name and drops a mid-sentence colon

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 44170d6 into main Nov 18, 2026
58 checks passed
This was referenced Nov 18, 2026
capy-ai Bot added a commit that referenced this pull request Nov 18, 2026
- A test, or a scratch repository in the temp directory, can no longer write approval rows into your real Capy Drive (GST-3027). (#4466)
- An unattended /autoplan run on Claude Code no longer says the publication guard is off while it is on. (#4481)
- A phase report written only in reasoning now gets a denial that says so and names the fix. (#4481)
- `gstack-autoplan revise` no longer refuses a plan that the first `next` accepted. (#4470)
- `revise --plan` with a different file now says the run follows that file. (#4470)
- A second-model plan review in `/autoplan` is no longer reported as unavailable when it actually ran (GST-3051). (#4471)
- The /ship conductor trial plan now lets case reverts that conflict with later code be resolved by hand in docs, tests and the planted file, so large pull requests can be cases (GST-3003). (#4460)
- A locked plan for a trial of /ship without its separate conductor subagent (GST-3003). (#4456)
- A driven /ship now runs each phase as one command, counts its calls, and stops itself at 100 minutes. (#4451)
- /ship stops asking owners to clear two kinds of bookkeeping noise: base-side merge text and a reviewer's confirmation prose. (#4458)
- A base merge that only touched base-side text no longer stops `/ship` finish for an owner's grant. (#4458)
- A reviewer's confirmation prose no longer becomes a Critical finding that only an owner can clear. (#4458)
- A CI run that passed only after its failed jobs were re-run is now marked wherever gstack reuses it. (#4473)
- /ship reuses CI's passing test run when merging the base changed no file, and stops instead of quietly starting hour-long test runs or reviewing an empty diff (GST-3019). (#4461)
- /ship on Codex no longer stops at the test coverage audit. (#4489)
- A cold first-use check before an app build reaches its owner (GST-3025). (#4465)
- `skill_prefix=true` now survives updates when gbrain is installed. (#4454)
- The OpenClaw docs no longer send you to ClawHub, which held only April 2026 builds of office-hours, ceo-review and retro and no longer has gstack skills (the docs also said four skills while listing three). (#4454)
- `gstack-issue-links` no longer reads other repositories' issues as gstack's. (#4454)
- /ship's pre-gate finds the tests of a monorepo app that imports through its own `@/` alias. (#4464)
- /office-hours explains why it recommends a mode. (#4450)
- /office-hours keeps its 34 founder videos and essays out of the skill file. (#4463)
- Two `gstack-owner-answers add` runs for the same answer no longer collide. (#4490)
- A Captain can check an ask against the owner's earlier answers before sending it. (#4467)
- `gstack-post` stops reading /ship's own receipt identifiers as phone numbers, so posting a /ship PR body no longer needs a confirm. (#4488)
- GitHub release notes now list every change in plain words, with a link to its pull request. (#4390)
- gstack's router no longer gives bug reports a special rule, so the model fixes a bug the way it would without gstack. (#4442)
- /ship's review plan now sorts Swift and Xcode files by risk instead of sending every iOS PR to the full review panel (GST-3041). (#4469)
- /ship's review plan now sends Swift code that touches private user data to the full review panel (GST-3052). (#4472)
- A round grant at /ship's review round cap now buys the fix round it names, in the same run or the next (GST-2968). (#4479)
- The secrets check stops flagging three kinds of ordinary code as a secret, and catches two misses. (#4457)
- A security finding's location and reason no longer go into a PR body. (#4486)
- The token-capped /ship child on Claude Code now starts its prompt with the typed `/ship` command, so the skill actually loads. (#4487)
- A /ship receipt now counts the second-model review's blocking findings, and refuses to be written while one is still open. (#4485)
- A `/ship` with a token cap on Claude Code no longer stops at its first handoff. (#4452)
- /ship's push step now always ends with one line that says whether it pushed (GST-3053). (#4474)
- A PR's review-round count can no longer be overwritten by the body `/ship` posts. (#4440)
- One queued record with a malformed path no longer stops artifacts sync for every project. (#4455)
- A failed artifacts push stays reported until a push succeeds. (#4455)
- The /sync-gbrain memory row no longer says OK when pages failed to import. (#4455)
- ### Tests (#4495)
- A policy-floor test no longer fails once gstack's own version reaches the minor after the newest policy key; it now checks a floor above both, so the v1.101.0.0 release can pass CI. (#4495)
- CI now uploads free-suite test results to Trunk with analytics-uploader v2.1.8 and analytics-cli 0.17.0, up from v2.1.6 and 0.16.2. (#4453)
- Packing a checkout for a Ubicloud run no longer fails when git beside it is rewriting a ref. (#4447)
- The /plan-ceo-review HOLD SCOPE eval no longer fails a review because its follow-up question didn't repeat the mode name. (#4447)
- Unattended /autoplan now records the owner's relayed gate reply instead of refusing it. (#4484)
- Unattended /autoplan now runs the second-model review you turned on, and waits for it instead of ending the session. (#4459)
- Two /autoplan runs started in the same second no longer share a run id. (#4459)

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