v1.39.1.0 feat: EXIT PLAN MODE GATE for plan-mode review skills#1512
Merged
Conversation
Add a terminal BLOCKING checklist that verifies the plan file ends with `## GSTACK REVIEW REPORT` before ExitPlanMode is called. Lives at EOF of all four plan-* review skills (eng/ceo/design/devex) and inside codex Step 2A. Tones down the preamble's "Plan Status Footer" to a neutral forward reference so review-report rules don't bleed into operational skills (/ship /qa /review). Single source of truth: `generateExitPlanModeGate` in scripts/resolvers/review.ts, registered as EXIT_PLAN_MODE_GATE in scripts/resolvers/index.ts. New test in test/gen-skill-docs.test.ts strips fenced code blocks before matching `## ` headings and asserts the gate is the terminal heading in all four plan-* review SKILL.md files. Codex's SKILL.md uses toContain (mid-file by design — Step 2B/2C are not plan-touching modes). Decisions locked via /plan-eng-review + /codex outside-voice: - D1=A: 4 plan-* reviews + codex (autoplan, office-hours deferred) - D2=B → D4=A: tone preamble down to neutral forward reference - D3=A: add automated test in test/gen-skill-docs.test.ts - D5=B: keep codex gate inside Step 2A (mid-file acceptable per gate self-gating) Codex pre-merge findings folded in: line numbers obsolete (use EOF), test regex must strip fences, fresh skill list (not stale REVIEW_SKILLS constant), gate check 4 short-circuits when no plan file in context. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
E2E Evals: ✅ PASS58/58 tests passed | $7.37 total cost | 12 parallel runners
12x ubicloud-standard-8 (Docker: pre-baked toolchain + deps) | wall clock ≈ slowest suite |
# Conflicts: # CHANGELOG.md # VERSION # package.json
# Conflicts: # CHANGELOG.md # VERSION # package.json
The three `{ git rev-parse HEAD 2>/dev/null || true; } > path/.version`
brace groups in the build script regressed when v1.38.0.0 merged into this
branch (resolved with --ours during conflict). Bun on Windows can't parse
brace groups in this position; the v1.38.0.0 invariant requires `(...)`
subshells. Windows CI test `package.json build scripts — POSIX shell compat`
caught it.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md # VERSION # package.json
anbangr
added a commit
to anbangr/gstack
that referenced
this pull request
May 16, 2026
….0 (release-daemon) Both my fork and upstream chose v1.39.1.0 in parallel: - Fork (this PR #37 at 548baca): release-daemon PATH fix + doctor subcommand + migration - Upstream (PR garrytan#1512 at f589770): EXIT PLAN MODE GATE blocking checklist Per user choice (B), kept my v1.39.1.0 entry as the fork's headline release and folded upstream's release notes in as a sub-section "Upstream sync: ExitPlanMode gate" inside the same v1.39.1.0 entry. The runtime at v1.39.1.0 now contains both feature sets. A disclosure note at the top of the entry calls out the parallel-version situation explicitly. Future fork ships will bump past v1.39.1.0 cleanly. Conflicts resolved: - CHANGELOG.md: kept my v1.39.1.0 heading + body; added upstream content as an "### Upstream sync" sub-section within the same entry. - scripts/resolvers/index.ts: kept fork-local `generateBuildCliCandidates`, added upstream's `generateExitPlanModeGate` import + resolver entry. - test/gen-skill-docs.test.ts: took upstream's preamble assertion rewrite (new behavior: no `NO REVIEWS YET` in operational skills, `EXIT PLAN MODE GATE` reference instead) — verified the regenerated office-hours SKILL.md matches the new test. Side effects of upstream's preamble retoning: 53 generated SKILL.md files regenerated by `bun run gen:skill-docs --host all`. Diff is mechanical: "Plan Status Footer" section in every skill's preamble now reads as a neutral forward reference to EXIT PLAN MODE GATE instead of imposing review-report rules on operational skills. Test status: - `bun test`: 1 failure, identical to the pre-existing P0 TODO from PR #37 (Step 4.8 fork overlay test). 8 other pre-existing failures apparently fixed by upstream changes (down from 9 to 1). - cli.test.ts (release-daemon work): all 202 tests pass. - migration-v1.39.1.0.test.ts: all 8 scenarios pass (6 darwin + 2 linux skipped on darwin host). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Adds a terminal blocking gate that fires before every
ExitPlanModecall in plan-mode review skills, reframing the call as a precondition-bearing contract (verify## GSTACK REVIEW REPORTis the file's terminal heading) rather than a soft permission to defer.Gate placement:
##heading at EOF of all four/plan-*-reviewSKILL.md files/codexSKILL.md (review mode only — Step 2B/2C are not plan-touching)Preamble retoned: the old
## Plan Status Footer("PLAN MODE EXCEPTION — always allowed") was soft permission language injected into every gstack skill via{{PREAMBLE}}. It now reads as a neutral forward reference, so operational skills (/ship,/qa,/review,/health) don't inherit review-report rules they can't satisfy.Test Coverage
New
EXIT PLAN MODE GATE placementdescribe block intest/gen-skill-docs.test.ts:3097(2 tests, 460 tests total in the file). Asserts:##heading in all 4 plan-* SKILL.md files (with fenced-code-block stripping —PLAN_FILE_REVIEW_REPORT's embedded## GSTACK REVIEW REPORTexample would false-match a naive regex).toContain(mid-file per design).test/host-config.test.tsgolden baselines updated forclaude-ship,codex-ship,factory-shipSKILL.md to capture the new preamble wording.bun test test/gen-skill-docs.test.ts test/host-config.test.ts→ 460 pass, 0 fail.Pre-Landing Review
Three review decisions resolved interactively via
/plan-eng-review:test/gen-skill-docs.test.tsOutside voice (codex): 11 findings raised; 6 factual fixes folded into plan before push (line numbers were not terminal, regex would false-match inside code fences,
REVIEW_SKILLSconstant was missing plan-devex, gate check 4 conflicted withPLAN_FILE_REVIEW_REPORT's skip-silently clause, sequencing ordering, hardcoded paths flagged but deferred). 2 scope tensions surfaced as D4+D5 for user decision. 3 lower-priority items moved to TODOs/NOT-in-scope.Plan Completion
Plan file at
~/.claude/plans/system-instruction-you-are-working-unified-coral.md. All implementation items DONE:generateExitPlanModeGateresolver —scripts/resolvers/review.ts:161EXIT_PLAN_MODE_GATEregistry entry —scripts/resolvers/index.ts:42UNVERIFIABLE: none. NOT DONE: none.
Test plan
bun test test/gen-skill-docs.test.ts— 389 cases passbun test test/host-config.test.ts— 73 cases pass (golden baselines green)bun testfull suite — exit 0 (verbose eval output suppresses summary line but exit code confirms green)##heading in plan-eng/ceo/design/devex SKILL.md🤖 Generated with Claude Code