From d8b432da1e599cdf2ff0dde95602b678e0c40324 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Sat, 23 May 2026 18:10:19 -0400 Subject: [PATCH] =?UTF-8?q?fix(#14):=20wire=20--auto=20flag=20through=20pr?= =?UTF-8?q?ogress=E2=86=92next=20handoff=20(#148)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(#14): document --auto in progress.md and wire chaining logic in next.md The --auto flag was accepted by /gsd:progress --next --auto but silently ignored: it was not documented in the section of progress.md and had no handling in the next.md show_and_execute step, so it was dropped at the handoff boundary and never produced step chaining. - Add --auto and --next --auto entries to progress.md - Update progress.md to explicitly list --auto as a passthrough arg - Add --auto chaining logic to next.md show_and_execute: after each step completes, re-invoke /gsd:progress --next --auto until milestone complete or a blocking decision is required - Add regression test (4 assertions) covering all three fix points Co-Authored-By: Claude Sonnet 4.6 * fix(#14): bump lint-test-file-count progress ceiling for bug-14 test bug-14-progress-auto-flag-dropped.test.cjs resolves to the "progress" effective prefix and legitimately grows the cluster to 6. Co-Authored-By: Claude Opus 4.7 * chore(#14): add changeset fragment Co-Authored-By: Claude Opus 4.7 * fix(#14): address review feedback — differentiate duplicate tests, scope assertions to specific blocks Test 2 now extracts the block and asserts --auto within it, distinguishing it from test 1's -level check. Remaining assertions use semantic token matches (--auto, --next --auto) that are robust to benign reformatting. Co-Authored-By: Claude Sonnet 4.6 --------- Co-authored-by: Claude Sonnet 4.6 --- .changeset/14-progress-auto-flag.md | 5 ++ commands/gsd/progress.md | 3 +- get-shit-done/workflows/next.md | 12 +++ scripts/lint-test-file-count.allowlist.json | 2 +- ...bug-14-progress-auto-flag-dropped.test.cjs | 73 +++++++++++++++++++ 5 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 .changeset/14-progress-auto-flag.md create mode 100644 tests/bug-14-progress-auto-flag-dropped.test.cjs diff --git a/.changeset/14-progress-auto-flag.md b/.changeset/14-progress-auto-flag.md new file mode 100644 index 000000000..ce0d1c4b4 --- /dev/null +++ b/.changeset/14-progress-auto-flag.md @@ -0,0 +1,5 @@ +--- +type: Fixed +pr: 148 +--- +The `--auto` flag is now wired through the `/gsd:progress` → `/gsd:next` handoff so that chaining these commands works without requiring the flag to be re-supplied manually. diff --git a/commands/gsd/progress.md b/commands/gsd/progress.md index e85cc4517..f351c69ea 100644 --- a/commands/gsd/progress.md +++ b/commands/gsd/progress.md @@ -23,6 +23,7 @@ Three modes: - **--next**: Detect current project state and automatically invoke the next logical GSD workflow step. Scans all prior phases for incomplete work before routing. `--next --force` bypasses safety gates. +- **--next --auto**: Like `--next`, but after the determined step completes, automatically re-invokes `/gsd:progress --next --auto` to continue chaining steps until completion or a blocking decision. Enables hands-free plan→execute→verify→complete progression. - **--do "..."**: Smart dispatcher — match freeform intent to the best GSD command using routing rules, confirm the match, then hand off. - **--forensic**: Run 6-check integrity audit after the standard progress report. - **(no flag)**: Standard progress check + intelligent routing (Routes A through F). @@ -38,7 +39,7 @@ Three modes: Arguments provided: "$ARGUMENTS" Parse the first token from the provided arguments: -- If it is `--next`: strip the flag, execute the next workflow (passing remaining args e.g. --force). +- If it is `--next`: strip the flag, execute the next workflow (passing remaining args e.g. --force, --auto). - If it is `--do`: strip the flag, pass remainder as freeform intent to the do workflow. - Otherwise: execute the progress workflow end-to-end (pass --forensic through if present). diff --git a/get-shit-done/workflows/next.md b/get-shit-done/workflows/next.md index c10e989fd..fba00866f 100644 --- a/get-shit-done/workflows/next.md +++ b/get-shit-done/workflows/next.md @@ -219,6 +219,18 @@ Display the determination: Then immediately invoke the determined command via SlashCommand. Do not ask for confirmation — the whole point of `/gsd:progress --next` is zero-friction advancement. + +**If `--auto` was passed:** after the determined command completes, automatically re-invoke `/gsd:progress --next --auto` to continue chaining to the next step. Repeat until one of: +- A milestone completes (`/gsd:complete-milestone` is reached) +- A blocking decision is required (safety gate triggers, prior-phase completeness prompt, user input needed) +- An error or paused state is detected + +When stopping due to a blocker, display: +``` +⛔ Auto-chain stopped: [reason — e.g. safety gate, blocking decision required] + +Resume with: `/gsd:progress --next --auto` once resolved. +``` diff --git a/scripts/lint-test-file-count.allowlist.json b/scripts/lint-test-file-count.allowlist.json index a35faef7d..3adf4608c 100644 --- a/scripts/lint-test-file-count.allowlist.json +++ b/scripts/lint-test-file-count.allowlist.json @@ -11,7 +11,7 @@ "state": { "current": 10, "issue": "21" }, "config": { "current": 8, "issue": "TBD" }, "graphify": { "current": 7, "issue": "TBD" }, - "progress": { "current": 5, "issue": "TBD" }, + "progress": { "current": 6, "issue": "14" }, "cli": { "current": 5, "issue": "TBD" }, "surface": { "current": 5, "issue": "TBD" }, "commit": { "current": 4, "issue": "TBD" }, diff --git a/tests/bug-14-progress-auto-flag-dropped.test.cjs b/tests/bug-14-progress-auto-flag-dropped.test.cjs new file mode 100644 index 000000000..88767adc5 --- /dev/null +++ b/tests/bug-14-progress-auto-flag-dropped.test.cjs @@ -0,0 +1,73 @@ +// allow-test-rule: source-text-is-the-product +// The command markdown is loaded directly by runtime prompt assembly. +// This test verifies that --auto is documented in progress.md and handled in next.md. + +'use strict'; + +const { test, describe } = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); + +const ROOT = path.join(__dirname, '..'); + +describe('#14: /gsd:progress --next --auto flag must be documented and propagated', () => { + test('progress.md section documents --auto flag', () => { + const command = fs.readFileSync( + path.join(ROOT, 'commands', 'gsd', 'progress.md'), + 'utf8' + ); + + assert.ok( + command.includes('--auto'), + 'progress.md must document the --auto flag in the section' + ); + }); + + test('progress.md block explicitly passes --auto through to next workflow', () => { + const command = fs.readFileSync( + path.join(ROOT, 'commands', 'gsd', 'progress.md'), + 'utf8' + ); + + // Extract only the … block so this assertion is + // scoped to the handoff wiring, not just any occurrence in the file. + const processMatch = command.match(/([\s\S]*?)<\/process>/); + assert.ok( + processMatch, + 'progress.md must contain a block' + ); + const processBlock = processMatch[1]; + + assert.ok( + processBlock.includes('--auto'), + 'progress.md block must explicitly mention --auto so it is not silently stripped at the --next handoff' + ); + }); + + test('next.md show_and_execute step handles --auto to chain steps', () => { + const workflow = fs.readFileSync( + path.join(ROOT, 'get-shit-done', 'workflows', 'next.md'), + 'utf8' + ); + + assert.ok( + workflow.includes('--auto'), + 'next.md must handle the --auto flag to chain step invocations automatically' + ); + }); + + test('next.md --auto chaining re-invokes /gsd:progress --next after step completion', () => { + const workflow = fs.readFileSync( + path.join(ROOT, 'get-shit-done', 'workflows', 'next.md'), + 'utf8' + ); + + // The workflow must contain instructions to re-invoke /gsd:progress --next --auto + // after the determined step completes, enabling the chain. + assert.ok( + workflow.includes('--next --auto'), + 'next.md must instruct re-invocation of /gsd:progress --next --auto after step completion to enable chaining' + ); + }); +});