Skip to content

Make autoplan's plan-approval gate item p1 so gstack-gate accepts it (#4181) - #4219

Merged
capy-ai[bot] merged 3 commits into
mainfrom
capy/autoplan-gate-accepts-plan-approval-replies
Nov 9, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
capy/autoplan-gate-accepts-plan-approval-replies

Conversation

@garrytan

@garrytan garrytan commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

/autoplan's final approval gate now renders, and replies to its plan-approval item parse. The skill told the agent to name that item plan, which gstack-gate refuses, so the whole gate failed before anyone could answer it.

What changed

  • autoplan/SKILL.md.tmpl (and the regenerated autoplan/SKILL.md) names the plan-approval gate item p1 instead of plan, and lists its replies as p1a, p1c, p1d and p1e instead of plana, planc, pland and plane.
  • test/gate-list.test.ts adds "the /autoplan Phase 4 gate as documented (/autoplan tells the agent to write a gate item with id plan, which gstack-gate rejects #4181)": it builds the gate from the template's own text and runs bin/gstack-gate render and parse for every documented reply.
  • test/fixtures/skill-md-size-allowlist.json lowers 12 autoplan size pins by the 10 characters the rename saves.
  • changelog.d/autoplan-gate-accepts-plan-approval-replies.md adds the release note.

Why

"gstack-gate render exits 1" on the gate /autoplan Phase 4 tells the agent to write (#4181, reported by @exGeni). gstack-gate only accepts an item id made of a lowercase label and a number (ID_RE at lib/gate-list.ts:75, and the reply-token pattern at :207), so plan failed validation and plana never matched. p1 is the id gstack's own gate builder (lib/autoplan-gate.ts) and docs/unattended.md already use, so the skill now agrees with the tool.

Blast radius

Only /autoplan's Phase 4 prose and its test and size pins change; no code path changes. The new test builds the gate from the template text itself, so a future rename that breaks the id fails CI (rung: script ran; failing first on main 6473a17, where render and all four parses exit 1 with "items[2].id must match [a-z]*[0-9]+"). The change touches no network, secrets, permissions, workflows, install scripts or dependencies.

Outside credit: @ElNeMeR70 (#4189) and @szsunyuan (#4191) proposed the same rename. Their code was read as text only and never checked out or run; this change was written on main, and the commit credits both with Co-authored-by trailers.

Summary

  • Rename the /autoplan plan-approval gate item to p1 so gstack-gate renders the gate and parses its replies (7b97904).
  • A review fix round rewrote the reply mapping (b746d50); the Captain had it reverted (6dca760), so the shipped tree is the reviewed rename-only tree 40fc985. The reply-mapping gaps ship as ruled notes below.

Test Coverage

Coverage: deterministic (each of 2 changed runtime files has a changed test naming it). The new #4181 test failed first on main 6473a17 and passes here.

Pre-Landing Review

Pre-Landing Review: 2 issues — 0 auto-fixed, 2 asked (0 fixed, 2 skipped), 0 deferred, 0 noted (pass 1). The b746d50 fix round was reverted, so every reply-mapping finding is open as a note or ruling below.

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

Review notes

Below the blocking floor or ruled by the Captain; recorded here and not fixed in this PR.

Ruled note: autoplan/SKILL.md.tmpl:401:outside-voice:pending at 7b97904 ruled by Captain GStack Minder (GSTA-36), 2026-11-09 at 2026-11-09T14:47:47.470Z: p1a can pass A while a uc item is pending: main's existing answer-path mapping with only the token renamed; out of scope; queued for an answer-path follow-up (approval a-0eaad14c8f72)
Ruled note: autoplan/SKILL.md.tmpl:401:adversarial-native:pending at 6dca760 ruled by Captain GStack Minder (GSTA-36), 2026-11-09 at 2026-11-09T14:47:47.565Z: same finding as p1 outside-voice#1: p1a can pass A while a uc item is pending; main's existing answer-path mapping with only the token renamed; out of scope (approval a-e370ccde32ed)
Ruled note: autoplan/SKILL.md.tmpl:401:adversarial-native:all-rec at 6dca760 ruled by Captain GStack Minder (GSTA-36), 2026-11-09 at 2026-11-09T14:47:59.714Z: all/rec maps to approve-as-written while gstack-gate applies plan-changing recommendations: main's wording, token renamed; own answer-path PR after this lands (approval a-bb204dad025d)

  • INFORMATIONAL autoplan/SKILL.md.tmpl:401 (pass 1 red-team#1, adversarial-native#2): all is an alias of rec, which takes plan-changing recommendations, but the mapping sends it to A. Covered in substance by the all-rec ruling above.
  • INFORMATIONAL autoplan/SKILL.md.tmpl:402 (pass 1 adversarial-native#3): a bare p1b reply has no outcome mapping.
  • INFORMATIONAL autoplan/SKILL.md.tmpl:360 (pass 1 adversarial-native#4, investigate): hand-written gates now reach the code that reads p1 rows (autoplan-carry, the shadow reader) without item_class, origin or changes_plan; approval-record degrades sensibly, the other readers were not traced.
  • INFORMATIONAL autoplan/SKILL.md.tmpl:401 (Step 11 rerun adversarial-native#3): the new test expects p1a to pass with uc1 pending and never checks pending.
  • INFORMATIONAL autoplan/SKILL.md.tmpl:363 (Step 11 rerun adversarial-native#4, investigate): the hand-written p1 hard-codes "a) approve as-is (recommended)" and sets no changes_plan, unlike planApproval in lib/autoplan-gate.ts, which recommends b when a recommendation changes the plan.
  • Findings raised on b746d50 (pass 2 red-team, and the Step 11 run at that head) are void: that commit is reverted.

Exploratory QA

Smoke, 3 probes on the checkout's bin/gstack-gate with a gate built as the template describes: render exits 0; uc1a p1a parses (p1=a, nothing pending); plana now fails with GATE_REPLY_UNPARSED. No browser surface. QA's method sections were not read for this prose-only rename.

Eval Results

evals: none affected (eval-select, pr profile: 0 behavioral probes, 0 quality judges; 32 autoplan and journey behaviors stay on release coverage).

Plan Completion

Plan completion audit: not run (bug fix, Plan: exempt: bug fix (R65)).

Issues

Fixes #4181
Refs p1/adversarial-native#1
Refs p1/adversarial-native#2
Refs p1/outside-voice#1
Refs p1/red-team#1
Refs p1/red-team#2
Related: #4189 (@ElNeMeR70)
Related: #4191 (@szsunyuan)

Verification Results

No plan obligations (bug fix). Repro: failing first on main 6473a17, passing at 6dca760.

TODOS

No TODO items completed in this PR.

Documentation

Status: current — the docs already match the change, and no edits were needed (read-only audit).

Scope: base 6473a17 through head 6dca760 (3 commits, 5 files): the autoplan plan-approval gate item is renamed from plan to p1, with replies p1a/p1c/p1d/p1e. No staged, unstaged or new files.

Documentation health:

  • autoplan/SKILL.md.tmpl: Updated in this branch (gate id p1)
  • autoplan/SKILL.md: Current (generated output matches the template)
  • changelog.d/autoplan-gate-accepts-plan-approval-replies.md: Current
  • docs/unattended.md: Current (already uses p1 ids)
  • docs/skills.md: Current (no gate-id detail)

Coverage debt: none. The changed contract is covered by reference docs (the skill template and docs/unattended.md). Diagram drift: none.

Test plan

  • bun run test: carried from CI run 42638791483/1 at tree 40fc985 (1653 files, 36832 tests)
  • Focused on this tree: gate-list, parity-suite, skill-md-size-guard, gen-skill-docs, gen-skill-docs-checks, spawnsync-timeout-tripwire, test-value-bar (600 pass, 0 fail); bun run typecheck 0; typecheck:test none new; gen:skill-docs --host all --dry-run fresh
  • gstack-pregate --allow-repo-commands: requires-remote cleared (remote gate from run 42638791483, macos-named-regressions from 42638791483, windows-smoke from 42636603793)
Agent notes

Lane GSTA-446 (Captain GStack Minder, GSTA-36). Pin 6dca760, tree 40fc985031bd50bbfe25f3d97cb9bbd49a7b7a6e (equal to 7b97904's).

REVIEW_LOOP: passes=2 blocking_found=7 deferred=0 noted=20 fixed=5 scope=frozen ledgers_read=5 dispatches=4
The fixed=5 count comes from b746d50's Review-Finding trailers; 6dca760 reverted that commit, so none of those fixes ship. Every finding they name is a ruled or listed note above.
Gate edits: none detected (2 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Ruled note: autoplan/SKILL.md.tmpl:401:outside-voice:pending at 7b97904 ruled by Captain GStack Minder (GSTA-36), 2026-11-09 at 2026-11-09T14:47:47.470Z: p1a can pass A while a uc item is pending: main's existing answer-path mapping with only the token renamed; out of scope; queued for an answer-path follow-up (approval a-0eaad14c8f72)
Ruled note: autoplan/SKILL.md.tmpl:401:adversarial-native:pending at 6dca760 ruled by Captain GStack Minder (GSTA-36), 2026-11-09 at 2026-11-09T14:47:47.565Z: same finding as p1 outside-voice#1: p1a can pass A while a uc item is pending; main's existing answer-path mapping with only the token renamed; out of scope (approval a-e370ccde32ed)
Ruled note: autoplan/SKILL.md.tmpl:401:adversarial-native:all-rec at 6dca760 ruled by Captain GStack Minder (GSTA-36), 2026-11-09 at 2026-11-09T14:47:59.714Z: all/rec maps to approve-as-written while gstack-gate applies plan-changing recommendations: main's wording, token renamed; own answer-path PR after this lands (approval a-bb204dad025d)

Approvals

Approved: yes (record r-f47838d7a91a). The full approval record stays private.
Plan: exempt: bug fix (R65)
Plan check: exempt bug fix

Refs #4181

{
  "schema_version": 1,
  "pr": 4219,
  "head": "6dca76089ae432f79d0ceff68ad3a494846f7944",
  "version": "1.98.0.0",
  "base": "main",
  "gate": {
    "free-suite": {
      "pass": 1653,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free-suite",
      "run": 42638791483,
      "attempt": 1,
      "tree": "40fc985031bd50bbfe25f3d97cb9bbd49a7b7a6e"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "40fc985031bd50bbfe25f3d97cb9bbd49a7b7a6e",
  "product_patch_id": "ca001bf90bd4c69c9be5c24605c31fb40de3be6f",
  "gstack_version": "1.98.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 6,
    "rules": "66e5174161eecc2c",
    "base": "324135dfb150dc6a756801184a39f218b23b77c4",
    "registry": "324135dfb150dc6a756801184a39f218b23b77c4",
    "gate_scan": {
      "tagged": 0,
      "head": "6dca76089ae432f79d0ceff68ad3a494846f7944"
    },
    "reasons": [
      "gate-class",
      "runtime=6"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @40fc985031bd (8 checks, current for 6dca76089ae4)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42638791483/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/42636603793/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=40fc985031bd tests=36832 skipped=105 runs=42638791483/1 profiles=ci-reuse/free-tests heads=6dca76089ae4 verified=2026-11-09T15:11:55.023Z"
  ],
  "issues": {
    "fixes": [
      4181
    ],
    "refs": [],
    "flakes": [],
    "related": [
      {
        "pr": 4189,
        "author": "ElNeMeR70",
        "closes": [
          4181
        ]
      },
      {
        "pr": 4191,
        "author": "szsunyuan",
        "closes": [
          4181
        ]
      }
    ]
  },
  "docs": {
    "status": "current",
    "scope": "docs/ and README.md (140 files), read-only, base 6473a17 to head 6dca760"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 7,
    "deferred": 0,
    "noted": 20,
    "fixed": 5,
    "scope": "frozen",
    "rounds": 2,
    "ledgers_read": 5,
    "dispatches": {
      "specialist": 2,
      "red-team": 2
    }
  },
  "ruled_notes": [
    {
      "finding": "autoplan/SKILL.md.tmpl:401:outside-voice:pending",
      "head": "7b97904bc8c285179b448a05e100d810dc75477c",
      "by": "Captain GStack Minder (GSTA-36), 2026-11-09",
      "reason": "p1a can pass A while a uc item is pending: main's existing answer-path mapping with only the token renamed; out of scope; queued for an answer-path follow-up",
      "at": "2026-11-09T14:47:47.470Z",
      "approval": "a-0eaad14c8f72"
    },
    {
      "finding": "autoplan/SKILL.md.tmpl:401:adversarial-native:pending",
      "head": "6dca76089ae432f79d0ceff68ad3a494846f7944",
      "by": "Captain GStack Minder (GSTA-36), 2026-11-09",
      "reason": "same finding as p1 outside-voice#1: p1a can pass A while a uc item is pending; main's existing answer-path mapping with only the token renamed; out of scope",
      "at": "2026-11-09T14:47:47.565Z",
      "approval": "a-e370ccde32ed"
    },
    {
      "finding": "autoplan/SKILL.md.tmpl:401:adversarial-native:all-rec",
      "head": "6dca76089ae432f79d0ceff68ad3a494846f7944",
      "by": "Captain GStack Minder (GSTA-36), 2026-11-09",
      "reason": "all/rec maps to approve-as-written while gstack-gate applies plan-changing recommendations: main's wording, token renamed; own answer-path PR after this lands",
      "at": "2026-11-09T14:47:59.714Z",
      "approval": "a-bb204dad025d"
    }
  ]
}

…4181)

/autoplan Phase 4 told the agent to write a gate item with id `plan` and
to read replies `plana`/`planc`/`pland`/`plane`. gstack-gate only accepts
ids of a lowercase label plus a number, so render refused the gate and the
replies never parsed. Rename it to `p1` (the id lib/autoplan-gate.ts and
docs/unattended.md already use), lower the autoplan size pins by the 10
characters saved, and add a test that builds the gate from the template text
and runs it through bin/gstack-gate render and parse.

Co-authored-by: Eng. Mahmoud Bek ElNemer <[email protected]>
Co-authored-by: Yuan S. <[email protected]>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 2 commits November 9, 2026 14:25
Now that the /autoplan Phase 4 gate renders, its reply mapping is reachable.
gstack-gate parse accepts p1a while a User Challenge is still pending, and
treats all as rec, which takes plan-changing recommendations, yet the skill
sent both straight to A (approve as written). Re-present a reply that leaves
an approval item pending, and send a plan change chosen on a d<n> or uc<n>
item, all included, to B or B2. The paragraph is 3 characters shorter, so
the 12 autoplan size pins drop by 3.

Review-Finding: p1/outside-voice#1 reader=outside-voice
Review-Finding: p1/adversarial-native#1 reader=adversarial-native
Review-Finding: p1/adversarial-native#2 reader=adversarial-native
Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/red-team#2 reader=red-team
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.

/autoplan tells the agent to write a gate item with id plan, which gstack-gate rejects

1 participant