diff --git a/.changeset/graceful-sloths-wake.md b/.changeset/graceful-sloths-wake.md new file mode 100644 index 000000000..58bd4e24d --- /dev/null +++ b/.changeset/graceful-sloths-wake.md @@ -0,0 +1,5 @@ +--- +type: Fixed +pr: 3420 +--- +**`/gsd-progress --next` no longer falls through to the default route** — the command now surfaces raw arguments on a dedicated line before flag parsing so `--next`, `--do`, and `--forensic` routing instructions remain stable for the model. diff --git a/commands/gsd/progress.md b/commands/gsd/progress.md index 62f9d3f7b..1c76d2769 100644 --- a/commands/gsd/progress.md +++ b/commands/gsd/progress.md @@ -35,7 +35,8 @@ Three modes: -Parse the first token of $ARGUMENTS: +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 `--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/tests/bug-3418-progress-flag-routing.test.cjs b/tests/bug-3418-progress-flag-routing.test.cjs new file mode 100644 index 000000000..2bf7dc97d --- /dev/null +++ b/tests/bug-3418-progress-flag-routing.test.cjs @@ -0,0 +1,33 @@ +// allow-test-rule: source-text-is-the-product +// The command markdown is loaded directly by runtime prompt assembly. + +const { test, describe } = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('fs'); +const path = require('path'); + +describe('#3418: /gsd-progress flag routing prompt contract', () => { + test('progress command surfaces raw arguments on a dedicated line before routing parse', () => { + const command = fs.readFileSync( + path.join(__dirname, '..', 'commands', 'gsd', 'progress.md'), + 'utf8' + ); + + assert.ok( + command.includes('Arguments provided: "$ARGUMENTS"'), + 'progress.md must surface $ARGUMENTS on a dedicated line for stable flag parsing' + ); + }); + + test('progress command must not inline-substitute $ARGUMENTS into parse instruction text', () => { + const command = fs.readFileSync( + path.join(__dirname, '..', 'commands', 'gsd', 'progress.md'), + 'utf8' + ); + + assert.ok( + !command.includes('Parse the first token of $ARGUMENTS:'), + 'progress.md must keep parse instructions independent from argument interpolation' + ); + }); +});