Repository navigation
feat: opt-in /autoplan stop gate with GSTACK_GATE markers (GST-1666) - #4100
Merged
Merged
Conversation
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>
|
😎 This pull request was merged. |
…(carve guard) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Anchor the runner match to a command position, treat a failed background launch as not pending, and read --ceo-only from a Skill call's command/skill fields and from the prompt before a Read load. Review-Finding: p1/outside-voice#1 reader=outside-voice Review-Finding: p1/outside-voice#2 reader=outside-voice Review-Finding: p1/outside-voice#3 reader=outside-voice Review-Finding: p1/adversarial-native#1 reader=adversarial-native Review-Finding: p1/red-team#1 reader=red-team 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>
4 tasks done
capy-ai Bot
added a commit
that referenced
this pull request
Nov 7, 2026
…T-1701) (#4102) * test: failing-first cases for the CEO review gate reading a transcript before Claude Code flushes it (GST-1701) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: the CEO review gate waits for the transcript flush through #4100's shared settle helper (GST-1701) 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>
This was referenced Nov 7, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Before: a session told to run /autoplan could stop after any phase, and nothing held it until the pipeline finished. After: with the opt-in
autoplan_gateswitch on (./setup --autoplan-gate,GSTACK_AUTOPLAN_GATE=onorgstack-config set autoplan_gate on), a Stop hook holds the final stop of a session that loaded /autoplan until Phase 0 ran scope, every applicable phase published its report and the Final Approval Gate is written. A--ceo-onlyrun needs Phase 1 and its end line instead. The gate is off by default. No screenshot: this is a CLI hook with no UI.Why
In GEVA-2's admission eval, Opus 5.5 told to run /autoplan showed none of autoplan's phases in 23 sessions. The leading hypothesis, not a proven cause because those transcripts were deleted, is that nothing kept the session going until every phase was done, so it stopped early. The gate turns that into a held stop that names the next missing step, capped at 3 blocks per run.
Summary
Runs of /autoplan ended early and silently. This PR adds an off-by-default Stop gate that reads the transcript, works out which phases the run's scope makes applicable, and blocks the stop with the next missing step. Stops that ask the user a question, stops waiting on a running background reviewer, and runs driven by the
gstack-autoplanrunner are never held. Review in /ship found four ways the check could misread a run; those are fixed here with tests.Blast radius
The change adds one new hook (
hosts/claude/hooks/autoplan-stop-gate.tsbehind theautoplan-stop-gate-stopshim) and one new switch name in setup, gstack-config, gstack-skill-gates, gstack-skill-route and gstack-settings-hook. It is safe because the switch defaults to off inlib/skill-route.tsSWITCH_DEFAULT, and every error fails open throughrunGateHook. The hook was run against fixture transcripts in /ship's QA: a complete run is released, an incomplete one is blocked, and with the switch off there is no output.Approvals
No approvals recorded for branch capy/gst-1666-autoplan-gate.
Documentation
Status: updated. I made two factual fixes for the opt-in /autoplan stop gate (GST-1666).
Scope: base e325b6d to HEAD 0654776: 4 commits and 16 files (setup, bin/gstack-config, bin/gstack-skill-gates, bin/gstack-skill-route, bin/gstack-settings-hook, lib/skill-gates.ts, lib/skill-route.ts, lib/autoplan-stop-gate.ts, hosts/claude/hooks/autoplan-stop-gate*, scripts/skill-gates-smoke.ts, tests, docs/skill-gates.md and the changelog fragment). Nothing was staged, unstaged or new.
Documentation health:
Coverage debt:
autoplan_gate,GSTACK_AUTOPLAN_GATE,--autoplan-gateandgstack-skill-gates settings --autoplanhave reference and explanation coverage in docs/skill-gates.md and insetup --help. There is no how-to or tutorial, which is common debt.Diagram drift: none.
Test Coverage
All new code paths have test coverage (Coverage: deterministic; each of 11 changed runtime files has a changed test naming it). The review fixes add three tests to
test/autoplan-stop-gate.test.ts; each is red on the pre-fix lib. The focused autoplan-stop-gate and autoplan-ceo-only files are green on the fix (48 tests).Pre-Landing Review
Pass 1 ran at full depth: a batched specialist, the red team, a native adversarial reader (Opus 5.5) and an outside voice (openai/gpt-6.1-sol). Four blocking findings, all in
lib/autoplan-stop-gate.ts, were fixed in 0654776:rg "gstack-autoplan next" docs/...) put the run in runner mode, so it was exempt. The runner match is now anchored to a command position.--ceo-onlywas missed on Read loads and on Skill calls that carry it incommandorskill. It is now read from those fields and from the prompt before a Read load.Pass 2 reviewed the fix range and found 3 informational notes, listed below.
REVIEW_LOOP: passes=2 blocking_found=4 deferred=0 noted=3 fixed=5 scope=frozen ledgers_read=3 dispatches=4
Gate edits: none detected (5 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: openai/gpt-6.1-sol completed, verdict request changes (3 findings, all fixed in 0654776).
Review notes
None of these block. Each is a candidate for a follow-up:
lib/autoplan-stop-gate.ts:75: the--ceo-onlyprompt fallback matches the bare substring (so "not --ceo-only" counts) and does not stop at an earlier load.lib/autoplan-stop-gate.ts:33: the anchored runner match misses runner calls behindtimeout,env,ifor{, quoted paths with spaces, and therun/reviseverbs (the old match never covered those verbs either).lib/autoplan-stop-gate.ts:33: a heredoc line that starts withgstack-autoplan nextstill counts as running the runner.STATUS: BLOCKEDrun has no exit from the gate;publishedand the gate check come from the model's wording, so the record shows what the model claimed, not proven exposure; the 2 s settle loop runs before the /autoplan-load check; runner skips are keyed by run, soreportdoes not show "runner"; a background agent with no result stays pending; scope evidence needs the literal snapshot path.Exploratory QA
Functional CLI surface, smoke bound 5 minutes / 12 probes, isolated state roots under the run directory. Captures 001-004 on 8277020: a complete run with the switch on is released (phases=ceo,eng); an incomplete run is blocked with missing=scope; the same run with the switch off prints nothing;
gstack-skill-gates settings --autoplanregisters the Stop shim and sets GSTACK_AUTOPLAN_GATE=on. Verdict: pass. After the fix, captures 005-007 reran the three hook probes on current inputs and pass. The ceo-only, runner, pending-agent and exhaustion paths are covered by unit tests, not probed.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: an opt-in Stop gate for /autoplan. Delivered: that gate, its switch wiring, docs, tests, and the review fixes.
Verification Results
No plan file is bound to this branch, so there are no plan-specific checks (VERIFY_RESULT: skipped).