Skip to content

fix(preamble): gate upgrade-handling prose on update_check opt-out (#2001)#2022

Open
0xDevNinja wants to merge 2 commits into
garrytan:mainfrom
0xDevNinja:fix/2001-update-check-preamble-gate
Open

fix(preamble): gate upgrade-handling prose on update_check opt-out (#2001)#2022
0xDevNinja wants to merge 2 commits into
garrytan:mainfrom
0xDevNinja:fix/2001-update-check-preamble-gate

Conversation

@0xDevNinja

Copy link
Copy Markdown
Contributor

Problem

update_check: false correctly silences the gstack-update-check binary (exits early, emits nothing), but the instruction text telling the agent how to act on update-check output still shipped in every generated SKILL.md preamble. The runtime layer honored the opt-out; the instruction layer ignored it. Same bug class as #1150, different flag.

Fix — echo-then-gate, like every other runtime flag

Every other flag (PROACTIVE, SKILL_PREFIX, EXPLAIN_LEVEL, QUESTION_TUNING) is echoed in the preamble bash and gated in the instruction layer. update_check now follows suit:

  • scripts/resolvers/preamble/generate-preamble-bash.ts — reads update_check and echoes UPDATE_CHECK: <value> alongside the other config flags.
  • scripts/resolvers/preamble/generate-upgrade-check.ts — prepends a gate: If UPDATE_CHECK is "false", skip the next two lines — the binary emits nothing, so there is no UPGRADE_AVAILABLE / JUST_UPGRADED output to act on.

All 49 preamble-bearing SKILL.md regenerated via bun run gen:skill-docs.

Out of scope (intentionally)

gstack-upgrade/SKILL.md documents its own inline upgrade flow (hand-authored in the .tmpl). A user invoking that skill is explicitly upgrading, so gating its prose would be wrong. The 50-vs-49 count difference is exactly this one file.

Tests

New invariant in test/gen-skill-docs.test.ts iterates every generated SKILL.md with the config-echo cluster and asserts it (a) echoes UPDATE_CHECK, (b) reads update_check, (c) gates the upgrade prose on the flag. Guards against the scope filter matching nothing.

735 pass (gen-skill-docs + skill-validation), gen-skill-docs freshness check clean.

Fixes #2001.

update_check: false makes gstack-update-check exit early and emit
nothing, but the preamble instruction text that tells the agent how to
act on UPGRADE_AVAILABLE / JUST_UPGRADED output still shipped in every
generated SKILL.md. The runtime layer honored the opt-out; the
instruction layer did not.

Follow the same echo-then-gate convention every other runtime flag uses
(PROACTIVE, SKILL_PREFIX, EXPLAIN_LEVEL, QUESTION_TUNING):
- generate-preamble-bash.ts reads update_check and echoes UPDATE_CHECK
  so the instruction layer can see the value.
- generate-upgrade-check.ts gates the UPGRADE_AVAILABLE / JUST_UPGRADED
  prose on UPDATE_CHECK == false.

The gstack-upgrade skill's own inline-flow documentation is unchanged:
a user in that skill is explicitly upgrading, so its prose is correctly
out of scope. All 49 preamble-bearing SKILL.md regenerated via
bun run gen:skill-docs.

Fixes garrytan#2001.
Iterates every generated SKILL.md carrying the runtime config-echo
cluster and asserts it echoes UPDATE_CHECK, reads the update_check
config, and gates the UPGRADE_AVAILABLE / JUST_UPGRADED prose on the
flag. Guards against the scope filter matching nothing. Pins the garrytan#2001
fix so the instruction layer can't silently drift back to ignoring the
opt-out.

Refs garrytan#2001.
@trunk-io

trunk-io Bot commented Jun 16, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

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.

update_check: false gates the binary but not the preamble instruction text — upgrade-handling prose ships unconditionally

1 participant