From 214cf0b364786fb440fcd9106a7d5536d56fa703 Mon Sep 17 00:00:00 2001 From: garrytan Date: Sat, 3 Oct 2026 20:48:26 +0000 Subject: [PATCH] G1: quote the base placeholder in document-release title sync The title-sync block is checked with bash -n; an unquoted parses as a redirection. Migrates the test that pinned the old root VERSION read to the shared classifier call. --- document-release/sections/release-body.md.tmpl | 2 +- test/document-skills-redaction.test.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/document-release/sections/release-body.md.tmpl b/document-release/sections/release-body.md.tmpl index 72f138bd8..41d257d2a 100644 --- a/document-release/sections/release-body.md.tmpl +++ b/document-release/sections/release-body.md.tmpl @@ -369,7 +369,7 @@ PR titles must start with `v` whenever the project has a version source Run this entire block in one shell, substituting `github` or `gitlab` for `` from Step 0 and the base branch for ``. No variables cross tool calls. No version source (NO_VERSION) or no PR/MR skips title sync; an update failure warns and continues. ```bash -VB=$(bun run ~/.claude/skills/gstack/bin/gstack-version-bump classify --base ) || { echo "Title sync: not run (the version source is broken; see the error above)."; exit 0; } +VB=$(bun run ~/.claude/skills/gstack/bin/gstack-version-bump classify --base "") || { echo "Title sync: not run (the version source is broken; see the error above)."; exit 0; } V=$(echo "$VB" | jq -r '.currentVersion // empty') [ -n "$V" ] || { echo "Title sync: not applicable (no version source is configured)."; exit 0; } case "" in diff --git a/test/document-skills-redaction.test.ts b/test/document-skills-redaction.test.ts index 95fb96151..4c856e2b3 100644 --- a/test/document-skills-redaction.test.ts +++ b/test/document-skills-redaction.test.ts @@ -43,7 +43,8 @@ describe("/document-release redaction", () => { test("title synchronization keeps every variable in one valid shell block", () => { const section = RELEASE.slice(RELEASE.indexOf('**PR/MR title sync')); const script = section.match(/```bash\n([\s\S]*?)\n```/)![1]; - for (const command of ['V=$(cat VERSION', 'CURRENT_TITLE=$(gh pr view', 'NEW_TITLE=$(', 'gh pr edit --title "$NEW_TITLE"', 'glab mr update -t "$NEW_TITLE"']) { + // G1 (#2334): the version comes from the shared classifier, not a root VERSION read. + for (const command of ['VB=$(bun run ~/.claude/skills/gstack/bin/gstack-version-bump classify', 'CURRENT_TITLE=$(gh pr view', 'NEW_TITLE=$(', 'gh pr edit --title "$NEW_TITLE"', 'glab mr update -t "$NEW_TITLE"']) { expect(script).toContain(command); } const result = spawnSync('bash', ['-n'], { input: script, encoding: 'utf8', timeout: 5000 });