Skip to content

Let autoplan revise accept a plan without section headings, as next does (GST-3050) - #4470

Merged
capy-ai[bot] merged 2 commits into
mainfrom
autoplan-revise-accepts-heading-less-plans
Nov 18, 2026
Merged

capy-ai[bot] merged 2 commits into
mainfrom
autoplan-revise-accepts-heading-less-plans

Conversation

@garrytan

@garrytan garrytan commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

gstack-autoplan revise now accepts a revised plan whenever the first next accepted its shape, so a run no longer pays for a full review round and then refuses the owner's edit.
Why: a plan with no section headings is reviewed whole by next, but once the owner added one heading, revise stopped with PLAN_SECTIONS_INVALID.
Nothing to do: runs already in progress pick this up too.

What changed

A plan with no section headings is reviewed whole by next. When the owner later added one heading while editing (say a ## Review record listing the accepted changes), revise stopped with PLAN_SECTIONS_INVALID after a paid review round and pointed at a --scaffold flag the first next never asked for. It hit all four sessions in the day-one eval's third smoke repeat.

  • revise adds the missing heading when next would have. When the run's first plan had no section headings (read from the run's restore point, which holds that plan's exact bytes, so older runs are covered without a run.json change) or the run was scaffolded, a revision missing exactly one heading gets it added in the run's own copy, and revise prints SCAFFOLDED: added "<heading>" (...; copy at <out>/plan-source.v<k>.md; <file> unchanged). The owner's file is never edited. Duplicate, reversed or empty sections still refuse, as before.
  • Runs that started with both headings keep both. Dropping one there would fold the private Review record into reviewed text, so revise still refuses, now saying this run's first plan had both headings, so its revisions keep both.
  • A different plan file is allowed, never silent. revise --plan <other file> used to move run.json's plan_input quietly. It now prints PLAN_INPUT: <old> -> <new> (drift checks and later revises read <new>; pass --plan <old> to go back) and records plan_input_from on the plan_revised journal row.
  • The troubleshooting entry for PLAN_SECTIONS_INVALID and the revise notes in docs/unattended.md now describe both lines.
Why

"revise refused the plan the first next accepted, after we paid for the round." The other option was for next to refuse or add headings up front, but next can't know what shape the owner's later edit will take, and refusing bare plans would break the documented "a plan with no headings is reviewed whole" path. Adding one missing heading is unambiguous (the same rule next --scaffold uses), so revise accepting it is the cheap, safe fix.

Blast radius

Only gstack-autoplan revise changes: revisionText in lib/autoplan-revise.ts and its one other caller, settleEvidence, which now reads .text from the same function. The restore file it reads is written once at init and never rewritten by revise (lib/autoplan-run.ts:113, read), and an unreadable restore file makes firstPlanBare return false, so revise refuses exactly as before (walked failure path).

Pre-Landing Review

No blocking issues found. One review pass ran: a batched specialist reader (testing, security, state machines, red team) found nothing, and an adversarial reader found four low-severity notes, listed below; none would fail a test, break a run or lose data, so none was fixed here.

Review notes

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

  • INFORMATIONAL lib/result-codes.ts:542 PLAN_SECTIONS_INVALID fix text still suggests --scaffold for a mid-run revise refusal
  • INFORMATIONAL lib/autoplan-plan-text.ts:36 driftLine suggests revise for a both-headings run that dropped a heading; revise refuses (pre-existing)
  • INFORMATIONAL lib/autoplan-revise.ts:212 PLAN_INPUT notice compares path strings, not file identity (informational output only)
  • INFORMATIONAL lib/autoplan-revise.ts:41 first-plan-bare is re-derived from restore.md instead of recorded in state; fails closed
  • Documentation leftover: autoplan/DRIVER.md:129 still points only at next --scaffold for PLAN_SECTIONS_INVALID; agents load that file, so the docs audit left it for a follow-up.
Exploratory QA

Smoke: the three new revise cases (bare plan gaining either heading, both-headings refusal, and the plan-file move with its same-file control) ran on this branch: 3 pass, 0 fail. No plan checks apply (bug fix, no plan).

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Review bot comments

No review bot comments.

Scope Drift

Scope Check: CLEAN
Intent: let revise accept a revision that next would have accepted, and make a plan-file move visible.
Delivered: the same, plus matching docs lines.

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.

Verification Results

No plan verification items (bug fix, no plan): 0 PASS, 0 FAIL, 0 BLOCKED, 0 NOT RUN.

TODOS

No TODO items completed in this PR.

Documentation

Scope: branch autoplan-revise-accepts-heading-less-plans vs main. The branch lets gstack-autoplan revise add a missing plan heading for runs whose first plan had no headings, and adds the PLAN_INPUT: line. Result: updated the PLAN_SECTIONS_INVALID entry in docs/troubleshooting.md and the revise bullet in docs/unattended.md to describe the SCAFFOLDED: behavior on revise and the PLAN_INPUT: line. Debt: the PLAN_SECTIONS_INVALID line in autoplan/DRIVER.md (agent-loaded) still points only at next --scaffold.

Tests
  • bun test test/autoplan-revise.test.ts (the three new cases): 3 pass, 0 fail; all three fail at cbd21f9 and pass here.
  • Free test suite in CI at e8ac136 (Free Tests run 44220836346): green, 1,690 files.
  • Typecheck, module-size and conflict-marker guards at the pushed tree: pass.
Agent notes

Refs GST-3050. Reported by GEVA-549. Thread GSTA-602. Decision trail: captain drive reports/GSTA-602-decisions.tsv. Not verified: the GEVA-549 session that "lost a gate" after writing plan-v2.md; this PR makes that move visible but no transcript was read.

Approvals

No approvals recorded for branch autoplan-revise-accepts-heading-less-plans.
Plan: exempt: bug fix
Plan check: exempt bug fix

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=0 fixed=0 scope=frozen ledgers_read=2 dispatches=1
Gate edits: none detected (1 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Scoped reader after review: docs/unattended.md audit prose, clean (anthropic/claude-opus-5-5); not a review round.
Pictures: skipped (no visible surface; text only).

🤖 Generated with Claude Code

{
  "schema_version": 1,
  "pr": 4470,
  "head": "e8ac136879c668f374e8d0a2c06a6414cdee6cc4",
  "version": "1.100.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1690,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 44220836346,
      "attempt": 1,
      "tree": "cd204fa2b8538bbfe42201d8211f1e9520d707ac"
    }
  ],
  "calls": 22,
  "session_kind": "unattended",
  "run": "ship-4470",
  "head_tree": "cd204fa2b8538bbfe42201d8211f1e9520d707ac",
  "product_patch_id": "a49b81d7c8146947badb3657d1d74e6b19d30a51",
  "gstack_version": "1.100.0.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 32,
    "rules": "85446ac5884d68a3",
    "base": "29e950227b2d6b87a0529492885f42e522483969",
    "registry": "29e950227b2d6b87a0529492885f42e522483969",
    "gate_scan": {
      "tagged": 0,
      "head": "e8ac136879c668f374e8d0a2c06a6414cdee6cc4"
    },
    "reasons": [
      "runtime=32"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @cd204fa2b853 (8 checks, current for e8ac136879c6)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44220836346/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=cd204fa2b853 tests=37663 skipped=67 runs=44220836346/1 profiles=ci-reuse/free-tests heads=e8ac136879c6 verified=2026-11-18T02:15:45.205Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "README.md and docs/ (troubleshooting.md and unattended.md updated for revise's SCAFFOLDED: and PLAN_INPUT: lines)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 2,
    "dispatches": {
      "specialist": 1
    }
  },
  "gate_dispositions": []
}

…oes (GST-3050)

A run whose first plan had no section headings now scaffolds a revision that gained one of them instead of refusing it with PLAN_SECTIONS_INVALID after a paid round. A revise from a different plan file prints PLAN_INPUT and journals the move.

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.

…in the docs

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 2373714 into main Nov 18, 2026
81 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