Skip to content

v1.91.158.0 feat(config): plan_mode_preamble=off drops the plan-mode preamble from installed skills (port of #3213) - #3308

Merged
capy-ai[bot] merged 7 commits into
mainfrom
crew/port-3213-plan-mode-optin
Oct 19, 2026
Merged

capy-ai[bot] merged 7 commits into
mainfrom
crew/port-3213-plan-mode-optin

Conversation

@garrytan

Copy link
Copy Markdown
Owner

Ports #3213 by @xingzihai (fixes #3168) and finishes it as an opt-in gstack-config key, as asked on the original PR. Installed copies never run the generator by hand, so a --plan-mode=off flag alone helps nobody. The contributor's commit is a cherry-pick with them as author. Default output and every install path are byte-identical while the key is on or unset.

The flag (from #3213)

gen-skill-docs --plan-mode=off drops the "Plan Mode Safe Operations" and "Skill Invocation During Plan Mode" preamble block (about 1.8 KB per skill). The PLAN MODE EXCEPTION — ALWAYS RUN markers inside skill bodies still apply. On main, hosts whose capabilities say planMode:false already render without the block (#3236), so this matters for Claude, Copilot and OpenCode.

The key

  • gstack-config set plan_mode_preamble off (values on|off, default on). An unknown value warns and stores on. When set outside setup, it prints how to apply it now: ./setup --refresh-registered.
  • setup reads the key once and passes --plan-mode=off to every gen:skill-docs invocation (16 sites). When a build already rendered the env-var hosts without the flag, setup renders them again.
  • The default Claude install normally serves the committed SKILL.md files with no render. With the key off, gstack_claude_render_action chooses a plain render, the .overlay record notes plan_mode=off, and switching back to on removes that render, including on the gbrain-unknown "keep" branch. setup no longer deletes the last good render before re-rendering when the key is off. A gbrain render carries the flag too.
  • gstack-relink re-renders the Claude root router in place with the key off, and restores the committed bytes when it is switched back on. It also refreshes the _gstack-command alias after a router rewrite, which fixes the same stale alias for disabled_skills. gstack-config gbrain-refresh passes the key to its render. gstack-upgrade reruns setup, so it inherits the choice.

Scope note

The Captain cleared the setup call sites and the one gstack-config key. On top of that, review found three things that needed small setup edits: the five NEEDS_BUILD guards (the build path rendered env hosts without the flag), the inline render-removal guard (it deleted the last good render before the re-render), and bin/gstack-relink and bin/gstack-render-claude.sh, which no open PR owns. setup and bin/gstack-config are also edited by the held PRs #3298 and #3192, which rebase when they're unheld.

Gate integrity

No existing test was edited, and no threshold, trial count, case kind or judge changed. New tests: plan-mode-off-generation (3), plan-mode-preamble-config (6), plan-mode-preamble-render (12) and plan-mode-preamble-setup (1). plan-mode-off-build (9) is kept unchanged from #3213. Negative controls, each checked by reverting the code:

  • dropping the flag from one setup call site fails the source test that asserts every gen:skill-docs invocation in setup and the render helper carries it;
  • removing the render-removal guard fails the setup end-to-end test, which injects a render failure;
  • removing the alias refresh fails two relink tests.

Validation

  • 36 related test files: 1030 pass, 0 fail, covering overlay, relink, router, setup, gstack-config, gen-skill-docs, spawnsync-timeout-tripwire, module-size-ratchet and the new tests.
  • typecheck is clean, and typecheck:test reports no new diagnostics. gen:skill-docs leaves git clean.
  • Pregate preflight passes 6/6. Remote free tier: 19,809 tests, 0 failed. Ubicloud spend was $0.10.
  • Reviewed with gstack /review plus an outside voice on gpt-6.1-sol. Three critical findings (the build-path renders, losing the last good render, the stale relink alias) are fixed above.

Known gap, not caused by this change: setup copies the deprecated connect-chrome alias from the committed source, so it ignores this key just as it ignores overlay and gbrain renders.

CHANGELOG entry is under [Unreleased]. Unstamped.

Closes #3168

Open in Capy

xingzihai and others added 4 commits October 19, 2026 18:39
…ble (#3168)

Generated skills ship a ~1.8 KB "## Plan Mode Safe Operations" +
"## Skill Invocation During Plan Mode" block on every skill, for hosts
and users who never enter plan mode. This adds a --plan-mode=off flag to
gen-skill-docs that drops that block at gen time. Default builds
(planMode undefined or true) keep the block byte-identically.

The "PLAN MODE EXCEPTION — ALWAYS RUN" markers inside skill bodies
still apply when the flag is off.

(cherry picked from commit 51edee9)
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… and every installed render

gstack-config plan_mode_preamble (on|off, default on) makes ./setup pass
--plan-mode=off to every gen:skill-docs render, gbrain-refresh and the
gstack-relink router render. The default Claude install, which otherwise
serves the committed SKILL.md files, gets a plain render with the key off;
the activation record notes plan_mode=off so switching back on removes the
render, including on the gbrain=unknown keep branch. With the key on or
unset every path and record is byte-for-byte unchanged.

Fixes #3168. Finishes #3213 by @xingzihai.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…renders; alias follows the router

Review findings on the plan_mode_preamble wiring:
- a build renders env hosts without --plan-mode=off, so with the key off
  setup no longer skips their re-render after a build;
- with the key off the gbrain-absent branch leaves the render to the plain
  re-render, so a failed render keeps the previous one;
- gstack-relink refreshes the _gstack-command alias after re-rendering the
  router (also fixes the same staleness for disabled_skills).

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

trunk-io Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

…ode-optin

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

# Conflicts:
#	CHANGELOG.md
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

E2E Evals: ❌ FAIL

[test:paid] VERDICT RED — lane gate/pr, attempt 1
  rule 107/108 · behavior 0/0 · judge 24/24 · quarantined 0 (0 failing the lane)
  SKIPPED 0 · INFRA 0 · INCOMPLETE 0 · unattributed 0 · ACTION REQUIRED 2
  wall 7m13s · cost $33.41 known + 54 of 132 trial(s) cost unknown

121 executed, 0 reused rule/judge records | 0 manual accepted (unscored; no score-cache credit) | $33.41 rule/judge cost | reconcile exit: 1

Profile: pr / mode full-fallback; selected behaviors: 108, judges: 24. Deferred to scheduled/release coverage: 139 behaviors and 0 changed prompt files. Deferred checks did not run and receive no PR-pass credit.

Derived dependents (scripts/pr-dependencies.ts):

  • bin/gstack-render-claude.sh: 20 case(s), 0 judge(s)
Rule and judge shards
Shard Automated result Manual/unscored Executed Reused Status Cost
e2e-deploy/skill-e2e-deploy--setup-deploy-workflow 1/1 0 1 0 ✅ $0.13
e2e/skill-e2e-coverage-audit 2/2 0 2 0 ✅ $0.28
llm-judge/skill-llm-eval 24/24 0 24 0 ✅ $1.44
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-current 0/1 0 1 0 ❌ $1.68
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-store 1/1 0 1 0 ✅ $1.04
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-completion 1/1 0 1 0 ✅ $1.13
e2e-qa-callers/skill-e2e-qa-callers--ship-exploratory-plan-checks 1/1 0 1 0 ✅ $0.8
e2e/skill-e2e-test-value 3/3 0 3 0 ✅ $0.76
e2e-qa-callers/skill-e2e-qa-callers--review-exploratory-small-cli 1/1 0 1 0 ✅ $0.71
e2e-qa-workflow/skill-e2e-qa-workflow--qa-only-no-fix 1/1 0 1 0 ✅ $0.65
e2e/skill-e2e-shared-libs--shared-libs-read-only 1/1 0 1 0 ✅ $0.27
e2e-docsync-spawned/skill-e2e-docsync-spawned 1/1 0 1 0 ✅ $0.5
e2e-deploy/skill-e2e-deploy--land-and-deploy-first-run 1/1 0 1 0 ✅ $0.38
e2e-deploy/skill-e2e-deploy--land-and-deploy-review-gate 1/1 0 1 0 ✅ $0.28
e2e-review-army/skill-e2e-review-army--review-army-migration-safety 1/1 0 1 0 ✅ $0.28
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-stale-after 1/1 0 1 0 ✅ $0.36
e2e-learnings/skill-e2e-learnings 1/1 0 1 0 ✅ $0.08
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-late-result 1/1 0 1 0 ✅ $0.33
e2e-review-army/skill-e2e-review-army--review-army-json-findings 1/1 0 1 0 ✅ $0.07
e2e-deploy/skill-e2e-deploy--benchmark-workflow 1/1 0 1 0 ✅ $0.21
e2e/skill-e2e-investigate-owned-completion 1/1 0 1 0 ✅ $0.07
e2e/skill-e2e-shared-libs-paths--shared-libs-review-index-flags 1/1 0 1 0 ✅ $1
e2e-qa-callers/skill-e2e-qa-callers--ship-exploratory-small-cli 1/1 0 1 0 ✅ $0.81
e2e-review-army/skill-e2e-review-army--review-army-perf-n-plus-one 1/1 0 1 0 ✅ $0.34
e2e-triage/skill-e2e-triage 1/1 0 1 0 ✅ $0.12
e2e-qa-workflow/skill-e2e-qa-workflow--qa-bootstrap 1/1 0 1 0 ✅ $0.08
e2e-third-party-actions/skill-e2e-third-party-actions 5/5 0 5 0 ✅ $0.43
e2e-design/skill-e2e-design--plan-design-review-no-ui-scope 1/1 0 1 0 ✅ $0.09
e2e-deploy/skill-e2e-deploy--canary-workflow 1/1 0 1 0 ✅ $0.1
e2e/skill-e2e-investigate-owned-termination 2/2 0 2 0 ✅ $0.18
e2e/skill-e2e-ship-hook-consent 2/2 0 2 0 ✅ $0.25
e2e-review-army/skill-e2e-review-army--review-army-delivery-audit 1/1 0 1 0 ✅ $0.13
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-timeout-unsettled 1/1 0 1 0 ✅ $0.19
e2e-session-intelligence/skill-e2e-session-intelligence 4/4 0 4 0 ✅ $0.29
e2e-design/skill-e2e-design--design-review-detector-shim 1/1 0 1 0 ✅ $0.13
e2e-plan-tune/skill-e2e-plan-tune 1/1 0 1 0 ✅ $0.13
e2e-safety-pair-agent/skill-e2e-safety-pair-agent 1/1 0 1 0 ✅ $0.1
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-launch-failure 1/1 0 1 0 ✅ $0.15
e2e/skill-e2e-ship-hook-refresh 1/1 0 1 0 ✅ $0.1
e2e-qa-callers/skill-e2e-qa-callers--ship-exploratory-unavailable 1/1 0 1 0 ✅ $0.69
e2e/skill-e2e-plan--plan-review-report 1/1 0 1 0 ✅ $1.44
e2e-retro/skill-e2e-retro 1/1 0 1 0 ✅ $0.3
e2e-qa-functional-fix/skill-e2e-qa-functional-fix 2/2 0 2 0 ✅ $1
e2e/skill-e2e-ship-skip 1/1 0 1 0 ✅ $0.23
e2e-qa-workflow/skill-e2e-qa-workflow--qa-quick 1/1 0 1 0 ✅ $0.44
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-stale-before 1/1 0 1 0 ✅ $0.33
e2e-review-attribution/skill-e2e-review-attribution 3/3 0 3 0 ✅ $0.29
e2e/skill-e2e-shared-libs-paths--shared-libs-review-prior-coverage 1/1 0 1 0 ✅ $0.95
e2e/skill-e2e-shared-libs--shared-libs-review-lifecycle 1/1 0 1 0 ✅ $0.83
e2e-safety-codex-consult/skill-e2e-safety-codex-consult 1/1 0 1 0 ✅ $0.26
e2e-deploy/skill-e2e-deploy--land-and-deploy-workflow 1/1 0 1 0 ✅ $0.57
e2e/skill-e2e-workflow 4/4 0 4 0 ✅ $0.97
e2e-review-army/skill-e2e-review-army--review-army-quality-score 1/1 0 1 0 ✅ $0.1
e2e-hermetic/skill-e2e-hermetic-canary 2/2 0 2 0 ✅ $0.02
e2e-browse/skill-e2e-bws 6/6 0 6 0 ✅ $0.29
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-missing-asset 1/1 0 1 0 ✅ $0.33
e2e-design/skill-e2e-design--design-review-plugin-handoff 1/1 0 1 0 ✅ $0.14
e2e-design/skill-e2e-design--design-review-detector-shim-dom 1/1 0 1 0 ✅ $0.25
e2e-safety-ship-evidence/skill-e2e-safety-ship-evidence 1/1 0 1 0 ✅ $0.12
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-missing-marker 1/1 0 1 0 ✅ $0.18
e2e/skill-e2e-shared-libs--shared-libs-unsupported-git 1/1 0 1 0 ✅ $0.16
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-recovery 1/1 0 1 0 ✅ $0.33
e2e-review/skill-e2e-review 2/2 0 2 0 ✅ $0.29
e2e/skill-e2e-shared-libs--shared-libs-review-revalidation 1/1 0 1 0 ✅ $1.78
e2e-qa-functional/skill-e2e-qa-functional 2/2 0 2 0 ✅ $0.76
e2e-cso/skill-e2e-cso 1/1 0 1 0 ✅ $0.38
e2e-qa-callers/skill-e2e-qa-callers--ship-exploratory-late-input 1/1 0 1 0 ✅ $0.87
e2e-skillify/skill-e2e-skillify 3/3 0 3 0 ✅ $0.75
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-failure 1/1 0 1 0 ✅ $0.8
e2e/skill-e2e-shared-libs-paths--shared-libs-review-path-eligibility 1/1 0 1 0 ✅ $1.49
Fail-closed reconciliation

  slice 14  passed             27s  test/skill-e2e-ship-docsync.test.ts#ship-docsync-launch-failure
  slice 14  passed             32s  test/skill-e2e-session-intelligence.test.ts
  slice 14  passed             33s  test/skill-e2e-ship-hook-consent.test.ts
  slice 14  passed             26s  test/skill-e2e-investigate-owned-termination.test.ts
  slice 14  passed             40s  test/skill-e2e-design.test.ts#design-review-detector-shim
  slice 14  passed             20s  test/skill-e2e-deploy.test.ts#canary-workflow
  slice 14  passed             29s  test/skill-e2e-ship-hook-refresh.test.ts
  slice 14  passed             15s  test/skill-e2e-design.test.ts#plan-design-review-no-ui-scope
  slice 14  passed             26s  test/skill-e2e-review-army.test.ts#review-army-delivery-audit
  slice 14  passed             26s  test/skill-e2e-safety-pair-agent.test.ts
  slice 14  passed             26s  test/skill-e2e-qa-workflow.test.ts#qa-bootstrap
  slice 15  passed             14s  test/skill-e2e-learnings.test.ts
  slice 15  passed             20s  test/skill-e2e-diagram.test.ts
[test:paid] collector final outcomes: 121 executed, 0 reused; 120 passed, 1 failed, 0 manual accepted (unscored; no score-cache credit) (121 attempt records from 70 collectors; every record counts)
[test:paid] deselected testcases, zero credit (312):
[test:paid]    298  sibling case of a case shard (its own shard runs it)
[test:paid]      8  periodic-tier case (this lane runs gate)
[test:paid]      6  Bun hook placeholder of a skipped describe block (not a test)
[test:paid] VERDICT RED — lane gate/pr, attempt 1
  rule 107/108 · behavior 0/0 · judge 24/24 · quarantined 0 (0 failing the lane)
  SKIPPED 0 · INFRA 0 · INCOMPLETE 0 · unattributed 0 · ACTION REQUIRED 2
  wall 7m13s · cost $33.41 known + 54 of 132 trial(s) cost unknown
[test:paid] failures and split verdicts:
  ✗ ship-docsync-current  rule  FAIL  assertion — expect(received).toEqual(expected)  · cause assertion: session completed; check failed  Expected: [] · Received: [ "command outside declared docs observation interface", "command outside declared docs observation interface", "command outside declared docs observation interface", "command outside declared docs o…  [slice 3, attempt 1]  evidence: paid-slice-3-a1/shards/skill-e2e-ship-docsync--ship-docsync-current (fetch: bun run eval:pass-rates --run 39338691964 --case ship-docsync-current)  after a repair: bun run scripts/test-paid-shards.ts --tier gate --case ship-docsync-current
[test:paid] exercised-path map (shadow, non-blocking): 8 MAP_GAP line(s) over 101 executed case(s) with recorded commands
  MAP_GAP document-release bin/gstack-banned-terms: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP land-and-deploy-review-gate bin/gstack-approval-classes: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP plan-review-report bin/gstack-plan-reality: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP plan-review-report browse/dist/browse: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP plan-review-report design/dist/design: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP shared-libs-review-path-eligibility bin/gstack-approval-classes: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP ship-docsync-current bin/gstack-banned-terms: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP test-audit-report-only design/dist/design: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)

Sliced lane: planner → duration-packed executors → fail-closed report. Behavior cases run a pre-registered 3-trial panel (PASS at 2/3 with no contract violation); a PASS 2/3 is shown with its failed trial, never as a clean pass. Reused results retain their original provenance and expiry.

Failures and split verdicts

✗ ship-docsync-current  rule  FAIL  assertion — expect(received).toEqual(expected)  · cause assertion: session completed; check failed  Expected: [] · Received: [ "command outside declared docs observation interface", "command outside declared docs observation interface", "command outside declared docs observation interface", "command outside declared docs o…  [slice 3, attempt 1]  evidence: paid-slice-3-a1/shards/skill-e2e-ship-docsync--ship-docsync-current (fetch: bun run eval:pass-rates --run 39338691964 --case ship-docsync-current)  after a repair: bun run scripts/test-paid-shards.ts --tier gate --case ship-docsync-current

@capy-ai

capy-ai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

flaky: tpa-absent-darwin, failed in run 39315041557 attempt 1 (eval-slices (14)), passed on rerun 39315041557 attempt 2, logged for the daily flaky-fix pass

flaky: /plan-design-review with UI scope, failed in run 39315041557 attempt 1 (eval-slices (4), outcome=ceiling_reached), passed on rerun 39315041557 attempt 2, logged for the daily flaky-fix pass

garrytan and others added 2 commits October 19, 2026 20:36
…ode-optin

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

# Conflicts:
#	CHANGELOG.md
…preamble from installed skills (port of #3213)

Merge origin/main and stamp 1.91.158.0.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title feat(config): plan_mode_preamble=off drops the plan-mode preamble from installed skills (port of #3213) v1.91.158.0 feat(config): plan_mode_preamble=off drops the plan-mode preamble from installed skills (port of #3213) Oct 19, 2026
@capy-ai

capy-ai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

flaky: ship-docsync-current, failed in run 39338691964 attempt 1 (eval-slices (3): 5x "command outside declared docs observation interface"), passed on rerun 39338691964 attempt 2, logged for the daily flaky-fix pass

@capy-ai

capy-ai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Merging under Garry's flaky-test rule (2026-10-19). ship-docsync-current failed in attempt 1 and passed on the rule-16 rerun of its slice only. It's unrelated to this diff and logged in the flaky ledger. slices-report stays bound to attempt 1 by design until F1 lands. — GStack Minder

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.

Option to omit the plan-mode preamble from generated skills

2 participants