fix: stabilize /gsd-progress flag routing parse contract (#3420)

* fix: stabilize /gsd-progress flag parsing prompt contract (#3418)

* chore: set changeset PR reference to #3420
This commit is contained in:
Tom Boucher
2026-05-11 22:09:59 -04:00
committed by GitHub
parent b5676b59c0
commit 3eb46a083c
3 changed files with 40 additions and 1 deletions

View File

@@ -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.

View File

@@ -35,7 +35,8 @@ Three modes:
</execution_context>
<process>
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).

View File

@@ -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'
);
});
});