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:
5
.changeset/graceful-sloths-wake.md
Normal file
5
.changeset/graceful-sloths-wake.md
Normal 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.
|
||||
@@ -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).
|
||||
|
||||
33
tests/bug-3418-progress-flag-routing.test.cjs
Normal file
33
tests/bug-3418-progress-flag-routing.test.cjs
Normal 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'
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user