fix: quote debug command argument-hint (#3435)
* test: add debug command YAML regression (#3431) * fix: quote debug command argument-hint (#3431) * docs: add changeset for #3431 * docs: set changeset pr for #3431 * test: parse debug frontmatter via shared helper
This commit is contained in:
5
.changeset/wise-koalas-climb.md
Normal file
5
.changeset/wise-koalas-climb.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
type: Fixed
|
||||||
|
pr: 3435
|
||||||
|
---
|
||||||
|
**`/gsd-debug` command metadata now parses as valid YAML** — external YAML tooling and command-contract validation no longer fail on the unquoted argument hint.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: gsd:debug
|
name: gsd:debug
|
||||||
description: Systematic debugging with persistent state across context resets
|
description: Systematic debugging with persistent state across context resets
|
||||||
argument-hint: [list | status <slug> | continue <slug> | --diagnose] [issue description]
|
argument-hint: "[list | status <slug> | continue <slug> | --diagnose] [issue description]"
|
||||||
allowed-tools:
|
allowed-tools:
|
||||||
- Read
|
- Read
|
||||||
- Write
|
- Write
|
||||||
|
|||||||
28
tests/bug-3431-debug-command-yaml.test.cjs
Normal file
28
tests/bug-3431-debug-command-yaml.test.cjs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
// allow-test-rule: source-text-is-the-product
|
||||||
|
// Command markdown frontmatter is the deployed contract; this regression test
|
||||||
|
// verifies the real YAML surface that external parsers consume.
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const { test } = require('node:test');
|
||||||
|
const assert = require('node:assert/strict');
|
||||||
|
const fs = require('node:fs');
|
||||||
|
const path = require('node:path');
|
||||||
|
const { parseFrontmatter } = require('./helpers.cjs');
|
||||||
|
|
||||||
|
const DEBUG_COMMAND_PATH = path.join(__dirname, '..', 'commands', 'gsd', 'debug.md');
|
||||||
|
|
||||||
|
function readFrontmatter(filePath) {
|
||||||
|
return parseFrontmatter(fs.readFileSync(filePath, 'utf8'));
|
||||||
|
}
|
||||||
|
|
||||||
|
test('#3431: commands/gsd/debug.md frontmatter parses as YAML and preserves argument-hint', () => {
|
||||||
|
const frontmatter = readFrontmatter(DEBUG_COMMAND_PATH);
|
||||||
|
|
||||||
|
assert.equal(frontmatter.name, 'gsd:debug');
|
||||||
|
assert.equal(
|
||||||
|
frontmatter['argument-hint'],
|
||||||
|
'[list | status <slug> | continue <slug> | --diagnose] [issue description]',
|
||||||
|
'argument-hint should remain user-visible text after YAML parsing'
|
||||||
|
);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user