refactor: hard-fork GSD -> MSD (Make Software Done)
Mechanical rename produced by scripts/msd-rename.cjs: gsd/Gsd/GSD -> msd/Msd/MSD across contents and paths, upstream package/repo coordinates -> @golem15/msd-core and golem15com/msd-core. Deep links into upstream history, sibling upstream packages, the GSD-2 import feature, CHANGELOG.md and .changeset/ are kept as-is. Hand edits on top: MSD block-letter banner and logos, LICENSE copyright line, package/plugin identity, regenerated lockfile, install-tree fixtures, derived registries and benchmark baseline; migration checksum baseline re-locked (MSD keeps its own install state, so no install had applied the old sums); sort-order and regex-escaped expectations in tests adjusted.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads docs/*.md files whose deployed text IS what the user sees — asserting
|
||||
// that every slash-command token in docs resolves to a live registered command
|
||||
// tests the deployed contract. The commands/gsd/*.md reads in the helper are
|
||||
// tests the deployed contract. The commands/msd/*.md reads in the helper are
|
||||
// the source-of-truth registry (product markdown).
|
||||
|
||||
/**
|
||||
@@ -26,7 +26,7 @@
|
||||
* ALLOWED_HISTORICAL_MENTIONS: files that legitimately reference deleted
|
||||
* commands as part of deprecation documentation are excluded from the scan.
|
||||
* Preserved from the three legacy tests:
|
||||
* - gsd-core/workflows/help.md (deprecation-trail prose)
|
||||
* - msd-core/workflows/help.md (deprecation-trail prose)
|
||||
* - CHANGELOG.md (historical release notes, must not be rewritten)
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,7 @@ const LOCALES = ['ja-JP', 'ko-KR', 'zh-CN', 'pt-BR'];
|
||||
// Preserved from the three legacy tests — do not remove without understanding
|
||||
// why the exemption exists (see issue #3049 and legacy test comments).
|
||||
const ALLOWED_HISTORICAL_MENTIONS = new Set([
|
||||
path.join(ROOT, 'gsd-core', 'workflows', 'help.md'),
|
||||
path.join(ROOT, 'msd-core', 'workflows', 'help.md'),
|
||||
path.join(ROOT, 'CHANGELOG.md'),
|
||||
]);
|
||||
|
||||
@@ -58,7 +58,7 @@ function isReleaseDoc(filePath) {
|
||||
}
|
||||
|
||||
// Slugs that appear in docs as internal component names or documentation
|
||||
// syntax placeholders — they match the /gsd-* regex but are NOT user-typable
|
||||
// syntax placeholders — they match the /msd-* regex but are NOT user-typable
|
||||
// slash commands and never appear in the command registry. Adding a slug here
|
||||
// requires a code comment explaining why it is not a slash command.
|
||||
//
|
||||
@@ -68,39 +68,39 @@ function isReleaseDoc(filePath) {
|
||||
const INTERNAL_COMPONENT_SLUGS = new Set([
|
||||
// Documentation syntax placeholder — "command-name" is used in ARCHITECTURE.md,
|
||||
// COMMANDS.md, and USER-GUIDE.md to show the template form of a slash command
|
||||
// (e.g. "/gsd-command-name [args]"). It is not a registered command.
|
||||
// (e.g. "/msd-command-name [args]"). It is not a registered command.
|
||||
'command-name',
|
||||
'command',
|
||||
|
||||
// gsd-tools.cjs — the legacy Node CLI binary (bin/gsd-tools.cjs).
|
||||
// msd-tools.cjs — the legacy Node CLI binary (bin/msd-tools.cjs).
|
||||
// Docs reference it as a path component in shell examples, not as a slash command.
|
||||
// Example: node "$HOME/.claude/gsd-core/bin/gsd-tools.cjs" state validate
|
||||
// Example: node "$HOME/.claude/msd-core/bin/msd-tools.cjs" state validate
|
||||
'tools',
|
||||
|
||||
// Hook scripts — internal runtime hooks, not user-invocable slash commands.
|
||||
// hooks/gsd-statusline.js — session statusline hook
|
||||
// hooks/gsd-context-monitor.js — context-window monitor hook
|
||||
// hooks/gsd-update-banner.js — update-available banner hook
|
||||
// hooks/gsd-graphify-update.sh — knowledge-graph auto-update PostToolUse hook (#3347)
|
||||
// These appear in docs as file-path references (e.g. "gsd-statusline.js reads
|
||||
// hooks/msd-statusline.js — session statusline hook
|
||||
// hooks/msd-context-monitor.js — context-window monitor hook
|
||||
// hooks/msd-update-banner.js — update-available banner hook
|
||||
// hooks/msd-graphify-update.sh — knowledge-graph auto-update PostToolUse hook (#3347)
|
||||
// These appear in docs as file-path references (e.g. "msd-statusline.js reads
|
||||
// the cache"), not as command invocations.
|
||||
'statusline',
|
||||
'context-monitor',
|
||||
'update-banner',
|
||||
'graphify-update',
|
||||
|
||||
// gsd-update-check.json — background update-check CACHE FILE, not a slash command.
|
||||
// ARCHITECTURE.md references "~/.cache/gsd/gsd-update-check.json" as a path;
|
||||
// the regex captures "/gsd-update-check" from the path component.
|
||||
// msd-update-check.json — background update-check CACHE FILE, not a slash command.
|
||||
// ARCHITECTURE.md references "~/.cache/msd/msd-update-check.json" as a path;
|
||||
// the regex captures "/msd-update-check" from the path component.
|
||||
'update-check',
|
||||
|
||||
// Internal agent names referenced in ARCHITECTURE.md tables of agents.
|
||||
// These are spawned agents (gsd-planner, etc.), not user-typable slash commands.
|
||||
// These are spawned agents (msd-planner, etc.), not user-typable slash commands.
|
||||
'planner',
|
||||
|
||||
// Malformed token from SDK init reference: "/gsd-init-" appears as a truncated
|
||||
// prefix in CLI-TOOLS.md describing the gsd-sdk init command family
|
||||
// (e.g., "gsd-sdk query init.phase-op 12"). The regex captures "/gsd-init-"
|
||||
// Malformed token from SDK init reference: "/msd-init-" appears as a truncated
|
||||
// prefix in CLI-TOOLS.md describing the msd-sdk init command family
|
||||
// (e.g., "msd-sdk query init.phase-op 12"). The regex captures "/msd-init-"
|
||||
// without a following slug — this is a documentation formatting artifact, not
|
||||
// a real command token.
|
||||
'init-',
|
||||
@@ -110,15 +110,15 @@ const INTERNAL_COMPONENT_SLUGS = new Set([
|
||||
// This is not a user-typable slash command.
|
||||
'build',
|
||||
|
||||
// ~/gsd-workspaces/ — filesystem directory path used by /gsd-workspace.
|
||||
// Docs reference "~/gsd-workspaces/<name>" as the default workspace directory
|
||||
// in shell examples and option tables (e.g. "--path /target (default: ~/gsd-workspaces/<name>)").
|
||||
// The regex captures "/gsd-workspaces" from the path component. The LIVE slash
|
||||
// command is "/gsd-workspace" (singular) — not "/gsd-workspaces" (plural).
|
||||
// ~/msd-workspaces/ — filesystem directory path used by /msd-workspace.
|
||||
// Docs reference "~/msd-workspaces/<name>" as the default workspace directory
|
||||
// in shell examples and option tables (e.g. "--path /target (default: ~/msd-workspaces/<name>)").
|
||||
// The regex captures "/msd-workspaces" from the path component. The LIVE slash
|
||||
// command is "/msd-workspace" (singular) — not "/msd-workspaces" (plural).
|
||||
'workspaces',
|
||||
|
||||
// Portuguese translation of "command" — pt-BR/ARCHITECTURE.md uses "/gsd-comando"
|
||||
// as the localized equivalent of the "/gsd-command-name" English placeholder
|
||||
// Portuguese translation of "command" — pt-BR/ARCHITECTURE.md uses "/msd-comando"
|
||||
// as the localized equivalent of the "/msd-command-name" English placeholder
|
||||
// in an architecture flow diagram. Not a registered command.
|
||||
'comando',
|
||||
|
||||
@@ -127,43 +127,43 @@ const INTERNAL_COMPONENT_SLUGS = new Set([
|
||||
// the URL path. Not a user-typable slash command in this product.
|
||||
'opencode',
|
||||
|
||||
// gsd-sdk — the @opengsd/gsd-sdk npm package and `gsd-sdk query` CLI binary.
|
||||
// msd-sdk — the @opengsd/gsd-sdk npm package and `msd-sdk query` CLI binary.
|
||||
// Docs reference it as a package name (e.g. `@opengsd/gsd-sdk`) and CLI tool
|
||||
// (e.g. `gsd-sdk query init phase-op 12`). The regex captures "/gsd-sdk" from
|
||||
// (e.g. `msd-sdk query init phase-op 12`). The regex captures "/msd-sdk" from
|
||||
// the npm scope path separator in `@opengsd/gsd-sdk`. Not a user-typable slash command.
|
||||
'sdk',
|
||||
|
||||
// Smoke-test directory path — locale docs reference "/tmp/gsd-smoke-$(date +%s)"
|
||||
// Smoke-test directory path — locale docs reference "/tmp/msd-smoke-$(date +%s)"
|
||||
// as a temporary directory path in bash code-block examples. The regex captures
|
||||
// "/gsd-smoke-" from the filesystem path. Not a slash command.
|
||||
// "/msd-smoke-" from the filesystem path. Not a slash command.
|
||||
'smoke-',
|
||||
|
||||
// Template placeholders — zh-CN/references/ui-brand.md used "/gsd-alternative-1"
|
||||
// and "/gsd-alternative-2" as unfilled placeholders in a UI template example.
|
||||
// Template placeholders — zh-CN/references/ui-brand.md used "/msd-alternative-1"
|
||||
// and "/msd-alternative-2" as unfilled placeholders in a UI template example.
|
||||
// These were never registered commands. Fixed in the source doc; kept here as
|
||||
// a belt-and-suspenders guard against the pattern returning in other locale docs.
|
||||
'alternative-1',
|
||||
'alternative-2',
|
||||
|
||||
// gsd-sync-skills — installed Claude skill directory name (also a workflow
|
||||
// under gsd-core/workflows/sync-skills.md), but NOT a registered
|
||||
// slash command (no commands/gsd/sync-skills.md). Docs reference it as a
|
||||
// filesystem path component, e.g. "~/.agents/skills/gsd-sync-skills/" in
|
||||
// msd-sync-skills — installed Claude skill directory name (also a workflow
|
||||
// under msd-core/workflows/sync-skills.md), but NOT a registered
|
||||
// slash command (no commands/msd/sync-skills.md). Docs reference it as a
|
||||
// filesystem path component, e.g. "~/.agents/skills/msd-sync-skills/" in
|
||||
// docs/discussions/grok-build-support-2026-05.md. The regex captures
|
||||
// "/gsd-sync-skills" from the path. Invoked via Skill(skill="gsd-sync-skills").
|
||||
// "/msd-sync-skills" from the path. Invoked via Skill(skill="msd-sync-skills").
|
||||
'sync-skills',
|
||||
|
||||
// gsd-test-runner — GitHub repository name: "github.com/open-gsd/gsd-test-runner".
|
||||
// msd-test-runner — GitHub repository name: "github.com/open-gsd/gsd-test-runner".
|
||||
// docs/contributing/bootstrap.md references it as a hyperlink target:
|
||||
// [gsd-test-runner](https://github.com/open-gsd/gsd-test-runner)
|
||||
// The regex captures "/gsd-test-runner" from the URL path component. This is
|
||||
// [msd-test-runner](https://github.com/open-gsd/gsd-test-runner)
|
||||
// The regex captures "/msd-test-runner" from the URL path component. This is
|
||||
// an external tool repo, not a user-typable slash command in this product.
|
||||
'test-runner',
|
||||
|
||||
// gsd-core — GitHub repository name: "open-gsd/gsd-core".
|
||||
// msd-core — GitHub repository name: "golem15com/msd-core".
|
||||
// docs/adr/22-plan-drift-guard.md references it as an issue tracker link:
|
||||
// open-gsd/gsd-core#22
|
||||
// The regex captures "/gsd-core" from the org/repo path separator. This is
|
||||
// golem15com/msd-core#22
|
||||
// The regex captures "/msd-core" from the org/repo path separator. This is
|
||||
// the canonical repo name, not a user-typable slash command in this product.
|
||||
'core',
|
||||
]);
|
||||
@@ -171,7 +171,7 @@ const INTERNAL_COMPONENT_SLUGS = new Set([
|
||||
/**
|
||||
* Strip HTML comments from content to avoid flagging commented-out examples
|
||||
* or prose that names a dead command for historical context (e.g. "previously
|
||||
* this was /gsd-old-name...").
|
||||
* this was /msd-old-name...").
|
||||
*/
|
||||
function stripHtmlComments(content) {
|
||||
// regex-free HTML-comment stripper (CodeQL: avoid incomplete-multi-character-sanitization)
|
||||
@@ -190,9 +190,9 @@ function stripHtmlComments(content) {
|
||||
/**
|
||||
* Extract the set of slash-command tokens from markdown content.
|
||||
* Three forms per command per runtime:
|
||||
* /gsd-slug — Claude / non-Gemini
|
||||
* /gsd:slug — Gemini
|
||||
* $gsd-slug — Codex
|
||||
* /msd-slug — Claude / non-Gemini
|
||||
* /msd:slug — Gemini
|
||||
* $msd-slug — Codex
|
||||
*
|
||||
* Internal component slugs (INTERNAL_COMPONENT_SLUGS) are filtered out —
|
||||
* those are file-path references or documentation placeholders, not slash
|
||||
@@ -204,8 +204,8 @@ function extractCommandTokens(content) {
|
||||
const stripped = stripHtmlComments(content);
|
||||
|
||||
function isInternal(token) {
|
||||
// Strip the /gsd- or /gsd: or $gsd- prefix to get the slug
|
||||
const slug = token.replace(/^(?:\/gsd[:-]|\$gsd-)/, '');
|
||||
// Strip the /msd- or /msd: or $msd- prefix to get the slug
|
||||
const slug = token.replace(/^(?:\/msd[:-]|\$msd-)/, '');
|
||||
// Exact match OR prefix match for 'init-' (which ends with a dash)
|
||||
if (INTERNAL_COMPONENT_SLUGS.has(slug)) return true;
|
||||
for (const s of INTERNAL_COMPONENT_SLUGS) {
|
||||
@@ -215,13 +215,13 @@ function extractCommandTokens(content) {
|
||||
}
|
||||
|
||||
// Negative lookbehind: only match tokens NOT preceded by a letter, digit,
|
||||
// `/`, `_`, or `-`. This prevents matching the `/gsd-core` substring inside
|
||||
// the org/repo path `open-gsd/gsd-core` (and similar path-embedded segments)
|
||||
// `/`, `_`, or `-`. This prevents matching the `/msd-core` substring inside
|
||||
// the org/repo path `golem15com/msd-core` (and similar path-embedded segments)
|
||||
// while still matching real invocations preceded by BOL, space, backtick, or
|
||||
// `(`. Fixes false-positive class identified in #489.
|
||||
const allSlash = (stripped.match(/(?<![A-Za-z0-9/_-])\/gsd-[a-z0-9][a-z0-9-]*/g) || []);
|
||||
const allColon = (stripped.match(/(?<![A-Za-z0-9/_-])\/gsd:[a-z0-9][a-z0-9-]*/g) || []);
|
||||
const allDollar = (stripped.match(/(?<![A-Za-z0-9/_-])\$gsd-[a-z0-9][a-z0-9-]*/g) || []);
|
||||
const allSlash = (stripped.match(/(?<![A-Za-z0-9/_-])\/msd-[a-z0-9][a-z0-9-]*/g) || []);
|
||||
const allColon = (stripped.match(/(?<![A-Za-z0-9/_-])\/msd:[a-z0-9][a-z0-9-]*/g) || []);
|
||||
const allDollar = (stripped.match(/(?<![A-Za-z0-9/_-])\$msd-[a-z0-9][a-z0-9-]*/g) || []);
|
||||
|
||||
const slash = new Set(allSlash.filter(t => !isInternal(t)));
|
||||
const colon = new Set(allColon.filter(t => !isInternal(t)));
|
||||
@@ -284,61 +284,61 @@ describe('getLiveCommandTokens() — helper contract', () => {
|
||||
assert.ok(result instanceof Set, 'getLiveCommandTokens() must return a Set');
|
||||
});
|
||||
|
||||
test('returns a non-empty set (commands/gsd/ has registered commands)', () => {
|
||||
test('returns a non-empty set (commands/msd/ has registered commands)', () => {
|
||||
const result = getLiveCommandTokens();
|
||||
assert.ok(result.size > 0, 'live registry must contain at least one token');
|
||||
});
|
||||
|
||||
test('contains /gsd-help (from commands/gsd/help.md name: gsd:help)', () => {
|
||||
test('contains /msd-help (from commands/msd/help.md name: msd:help)', () => {
|
||||
const result = getLiveCommandTokens();
|
||||
assert.ok(result.has('/gsd-help'), 'registry must contain /gsd-help');
|
||||
assert.ok(result.has('/msd-help'), 'registry must contain /msd-help');
|
||||
});
|
||||
|
||||
test('contains /gsd:help (Gemini form)', () => {
|
||||
test('contains /msd:help (Gemini form)', () => {
|
||||
const result = getLiveCommandTokens();
|
||||
assert.ok(result.has('/gsd:help'), 'registry must contain /gsd:help');
|
||||
assert.ok(result.has('/msd:help'), 'registry must contain /msd:help');
|
||||
});
|
||||
|
||||
test('contains $gsd-help (Codex form)', () => {
|
||||
test('contains $msd-help (Codex form)', () => {
|
||||
const result = getLiveCommandTokens();
|
||||
assert.ok(result.has('$gsd-help'), 'registry must contain $gsd-help');
|
||||
assert.ok(result.has('$msd-help'), 'registry must contain $msd-help');
|
||||
});
|
||||
|
||||
test('contains /gsd-plan-phase (from commands/gsd/plan-phase.md)', () => {
|
||||
test('contains /msd-plan-phase (from commands/msd/plan-phase.md)', () => {
|
||||
const result = getLiveCommandTokens();
|
||||
assert.ok(result.has('/gsd-plan-phase'), 'registry must contain /gsd-plan-phase');
|
||||
assert.ok(result.has('/msd-plan-phase'), 'registry must contain /msd-plan-phase');
|
||||
});
|
||||
|
||||
test('contains exactly 3 tokens per slug (slash, colon, dollar)', () => {
|
||||
const result = getLiveCommandTokens();
|
||||
// Every /gsd-slug should have a matching /gsd:slug and $gsd-slug
|
||||
const slashTokens = [...result].filter(t => t.startsWith('/gsd-'));
|
||||
// Every /msd-slug should have a matching /msd:slug and $msd-slug
|
||||
const slashTokens = [...result].filter(t => t.startsWith('/msd-'));
|
||||
for (const slash of slashTokens) {
|
||||
const slug = slash.slice('/gsd-'.length);
|
||||
const slug = slash.slice('/msd-'.length);
|
||||
assert.ok(
|
||||
result.has(`/gsd:${slug}`),
|
||||
`registry must contain Gemini form /gsd:${slug} for slash form ${slash}`
|
||||
result.has(`/msd:${slug}`),
|
||||
`registry must contain Gemini form /msd:${slug} for slash form ${slash}`
|
||||
);
|
||||
assert.ok(
|
||||
result.has(`$gsd-${slug}`),
|
||||
`registry must contain Codex form $gsd-${slug} for slash form ${slash}`
|
||||
result.has(`$msd-${slug}`),
|
||||
`registry must contain Codex form $msd-${slug} for slash form ${slash}`
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('does NOT contain removed /gsd-reapply-patches', () => {
|
||||
test('does NOT contain removed /msd-reapply-patches', () => {
|
||||
const result = getLiveCommandTokens();
|
||||
assert.ok(!result.has('/gsd-reapply-patches'), 'registry must NOT contain removed /gsd-reapply-patches');
|
||||
assert.ok(!result.has('/msd-reapply-patches'), 'registry must NOT contain removed /msd-reapply-patches');
|
||||
});
|
||||
|
||||
test('does NOT contain removed /gsd-code-review-fix', () => {
|
||||
test('does NOT contain removed /msd-code-review-fix', () => {
|
||||
const result = getLiveCommandTokens();
|
||||
assert.ok(!result.has('/gsd-code-review-fix'), 'registry must NOT contain removed /gsd-code-review-fix');
|
||||
assert.ok(!result.has('/msd-code-review-fix'), 'registry must NOT contain removed /msd-code-review-fix');
|
||||
});
|
||||
|
||||
test('does NOT contain removed /gsd-status', () => {
|
||||
test('does NOT contain removed /msd-status', () => {
|
||||
const result = getLiveCommandTokens();
|
||||
assert.ok(!result.has('/gsd-status'), 'registry must NOT contain removed /gsd-status');
|
||||
assert.ok(!result.has('/msd-status'), 'registry must NOT contain removed /msd-status');
|
||||
});
|
||||
|
||||
test('memoizes — returns the same Set reference on repeated calls', () => {
|
||||
@@ -351,26 +351,26 @@ describe('getLiveCommandTokens() — helper contract', () => {
|
||||
// ─── Fixture-based helper tests ───────────────────────────────────────────────
|
||||
|
||||
describe('getLiveCommandTokens() — fixture contract', () => {
|
||||
test('parses gsd:foo frontmatter and emits 3 canonical tokens', () => {
|
||||
test('parses msd:foo frontmatter and emits 3 canonical tokens', () => {
|
||||
// This test validates the parsing logic against a known-good fixture
|
||||
// by inspecting the live registry for commands/gsd/help.md (name: gsd:help).
|
||||
// Fixture file tests are done inline since the helper reads commands/gsd/ only.
|
||||
// by inspecting the live registry for commands/msd/help.md (name: msd:help).
|
||||
// Fixture file tests are done inline since the helper reads commands/msd/ only.
|
||||
// The canonical token contract:
|
||||
// name: gsd:foo → /gsd-foo, /gsd:foo, $gsd-foo
|
||||
// name: msd:foo → /msd-foo, /msd:foo, $msd-foo
|
||||
const registry = getLiveCommandTokens();
|
||||
// We know help.md has name: gsd:help
|
||||
// We know help.md has name: msd:help
|
||||
const slug = 'help';
|
||||
assert.ok(registry.has(`/gsd-${slug}`), `must have /gsd-${slug}`);
|
||||
assert.ok(registry.has(`/gsd:${slug}`), `must have /gsd:${slug}`);
|
||||
assert.ok(registry.has(`$gsd-${slug}`), `must have $gsd-${slug}`);
|
||||
assert.ok(registry.has(`/msd-${slug}`), `must have /msd-${slug}`);
|
||||
assert.ok(registry.has(`/msd:${slug}`), `must have /msd:${slug}`);
|
||||
assert.ok(registry.has(`$msd-${slug}`), `must have $msd-${slug}`);
|
||||
});
|
||||
|
||||
test('parses gsd-slug frontmatter (ns-* commands) and emits 3 tokens', () => {
|
||||
// ns-context.md has name: gsd-context (dash-style, no colon)
|
||||
test('parses msd-slug frontmatter (ns-* commands) and emits 3 tokens', () => {
|
||||
// ns-context.md has name: msd-context (dash-style, no colon)
|
||||
const registry = getLiveCommandTokens();
|
||||
assert.ok(registry.has('/gsd-context'), 'must have /gsd-context (from ns-context.md)');
|
||||
assert.ok(registry.has('/gsd:context'), 'must have /gsd:context (Gemini form)');
|
||||
assert.ok(registry.has('$gsd-context'), 'must have $gsd-context (Codex form)');
|
||||
assert.ok(registry.has('/msd-context'), 'must have /msd-context (from ns-context.md)');
|
||||
assert.ok(registry.has('/msd:context'), 'must have /msd:context (Gemini form)');
|
||||
assert.ok(registry.has('$msd-context'), 'must have $msd-context (Codex form)');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -473,74 +473,74 @@ for (const locale of LOCALES) {
|
||||
|
||||
describe('adversarial: polarity inversion catches drift deny-list misses', () => {
|
||||
test('renaming a live command without updating docs would fail this test (demonstrated via token absence)', () => {
|
||||
// If /gsd-progress were renamed to /gsd-status-new, the old /gsd-progress
|
||||
// If /msd-progress were renamed to /msd-status-new, the old /msd-progress
|
||||
// token would not appear in the live registry, and any doc referencing
|
||||
// /gsd-progress would fail. The deny-list shape would have passed silently
|
||||
// /msd-progress would fail. The deny-list shape would have passed silently
|
||||
// (it only checks for specific known-bad tokens).
|
||||
// We can't simulate an actual rename in a live test, but we can assert
|
||||
// that the registry correctly contains the live name (progress, not status):
|
||||
const registry = getLiveCommandTokens();
|
||||
assert.ok(registry.has('/gsd-progress'), '/gsd-progress must be live (not renamed to /gsd-status)');
|
||||
assert.ok(!registry.has('/gsd-status'), '/gsd-status must be absent (was deleted, replaced by /gsd-progress)');
|
||||
assert.ok(registry.has('/msd-progress'), '/msd-progress must be live (not renamed to /msd-status)');
|
||||
assert.ok(!registry.has('/msd-status'), '/msd-status must be absent (was deleted, replaced by /msd-progress)');
|
||||
});
|
||||
|
||||
test('freshly-deleted command /gsd-check-todos is absent from registry', () => {
|
||||
test('freshly-deleted command /msd-check-todos is absent from registry', () => {
|
||||
const registry = getLiveCommandTokens();
|
||||
assert.ok(!registry.has('/gsd-check-todos'), '/gsd-check-todos must not be in the live registry');
|
||||
assert.ok(!registry.has('/msd-check-todos'), '/msd-check-todos must not be in the live registry');
|
||||
});
|
||||
|
||||
test('freshly-deleted command /gsd-new-workspace is absent from registry', () => {
|
||||
test('freshly-deleted command /msd-new-workspace is absent from registry', () => {
|
||||
const registry = getLiveCommandTokens();
|
||||
assert.ok(!registry.has('/gsd-new-workspace'), '/gsd-new-workspace must not be in the live registry');
|
||||
assert.ok(!registry.has('/msd-new-workspace'), '/msd-new-workspace must not be in the live registry');
|
||||
});
|
||||
|
||||
test('freshly-deleted command /gsd-plan-milestone-gaps is absent from registry', () => {
|
||||
test('freshly-deleted command /msd-plan-milestone-gaps is absent from registry', () => {
|
||||
const registry = getLiveCommandTokens();
|
||||
assert.ok(!registry.has('/gsd-plan-milestone-gaps'), '/gsd-plan-milestone-gaps must not be in the live registry');
|
||||
assert.ok(!registry.has('/msd-plan-milestone-gaps'), '/msd-plan-milestone-gaps must not be in the live registry');
|
||||
});
|
||||
|
||||
test('freshly-deleted command /gsd-research-phase is absent from registry', () => {
|
||||
test('freshly-deleted command /msd-research-phase is absent from registry', () => {
|
||||
const registry = getLiveCommandTokens();
|
||||
assert.ok(!registry.has('/gsd-research-phase'), '/gsd-research-phase must not be in the live registry');
|
||||
assert.ok(!registry.has('/msd-research-phase'), '/msd-research-phase must not be in the live registry');
|
||||
});
|
||||
});
|
||||
|
||||
// ─── Tokenizer regression tests (#489) ───────────────────────────────────────
|
||||
|
||||
describe('extractCommandTokens() — repo-path false-positive regression (#489)', () => {
|
||||
test('open-gsd/gsd-core#22 repo path does NOT produce a /gsd-core token', () => {
|
||||
// Before the lookbehind fix, /gsd-core inside `open-gsd/gsd-core#22`
|
||||
test('golem15com/msd-core#22 repo path does NOT produce a /msd-core token', () => {
|
||||
// Before the lookbehind fix, /msd-core inside `golem15com/msd-core#22`
|
||||
// would be matched by the slash regex — a false positive.
|
||||
const { slash, colon, dollar } = extractCommandTokens(
|
||||
'see open-gsd/gsd-core#22 for details'
|
||||
'see golem15com/msd-core#22 for details'
|
||||
);
|
||||
const all = [...slash, ...colon, ...dollar];
|
||||
assert.ok(
|
||||
!all.includes('/gsd-core'),
|
||||
'repo path open-gsd/gsd-core#22 must not produce a /gsd-core token; got: ' + all.join(', ')
|
||||
!all.includes('/msd-core'),
|
||||
'repo path golem15com/msd-core#22 must not produce a /msd-core token; got: ' + all.join(', ')
|
||||
);
|
||||
assert.strictEqual(all.length, 0, 'expected zero tokens from a bare repo-path string; got: ' + all.join(', '));
|
||||
});
|
||||
|
||||
test('space-preceded /gsd-totally-not-a-real-command is still extracted (real invocation)', () => {
|
||||
test('space-preceded /msd-totally-not-a-real-command is still extracted (real invocation)', () => {
|
||||
// A genuine (but unregistered) command reference after whitespace must be
|
||||
// captured so the live-registry check can flag it as unknown.
|
||||
const { slash } = extractCommandTokens(
|
||||
'run /gsd-totally-not-a-real-command here'
|
||||
'run /msd-totally-not-a-real-command here'
|
||||
);
|
||||
assert.ok(
|
||||
slash.has('/gsd-totally-not-a-real-command'),
|
||||
slash.has('/msd-totally-not-a-real-command'),
|
||||
'invocation after whitespace must be extracted; slash set: ' + [...slash].join(', ')
|
||||
);
|
||||
});
|
||||
|
||||
test('backtick-wrapped `/gsd-plan` is still extracted (real invocation)', () => {
|
||||
test('backtick-wrapped `/msd-plan` is still extracted (real invocation)', () => {
|
||||
// Backtick-wrapped commands (common in markdown) must still be captured.
|
||||
const { slash } = extractCommandTokens(
|
||||
'use `/gsd-plan` to plan'
|
||||
'use `/msd-plan` to plan'
|
||||
);
|
||||
assert.ok(
|
||||
slash.has('/gsd-plan'),
|
||||
slash.has('/msd-plan'),
|
||||
'backtick-wrapped invocation must be extracted; slash set: ' + [...slash].join(', ')
|
||||
);
|
||||
});
|
||||
@@ -560,26 +560,26 @@ describe('extractCommandTokens() — repo-path false-positive regression (#489)'
|
||||
'use strict';
|
||||
|
||||
|
||||
process.env.GSD_TEST_MODE = '1';
|
||||
process.env.MSD_TEST_MODE = '1';
|
||||
|
||||
/**
|
||||
* Bug #2954: keep `help.md` and the live `commands/gsd/*` slash surface
|
||||
* Bug #2954: keep `help.md` and the live `commands/msd/*` slash surface
|
||||
* in lockstep. Two regression tests:
|
||||
*
|
||||
* 1. help.md must not advertise any /gsd[-:]<name> that has no shipped
|
||||
* 1. help.md must not advertise any /msd[-:]<name> that has no shipped
|
||||
* slash command. (Caught the original #2954 regression: #2824 deleted
|
||||
* 31 stubs without updating help.md.)
|
||||
*
|
||||
* 2. Every shipped /gsd[-:]<name> command must appear in help.md. (Caught
|
||||
* 2. Every shipped /msd[-:]<name> command must appear in help.md. (Caught
|
||||
* the inverse: a command lands without docs, so users never discover it.)
|
||||
*
|
||||
* The shipped slash name is parsed from frontmatter `name:` (which can be
|
||||
* either `gsd:foo` or `gsd-foo` — Claude Code surfaces both as `/gsd-foo`),
|
||||
* either `msd:foo` or `msd-foo` — Claude Code surfaces both as `/msd-foo`),
|
||||
* NOT from the filename, because some files (e.g. `ns-context.md`) ship a
|
||||
* different slash name (`gsd-context`) than their filename suggests.
|
||||
* different slash name (`msd-context`) than their filename suggests.
|
||||
*
|
||||
* Also covers `do.md`, the dispatcher invoked at runtime by
|
||||
* `/gsd:progress --do`: any `/gsd[-:]<name>` token in its routing table must
|
||||
* `/msd:progress --do`: any `/msd[-:]<name>` token in its routing table must
|
||||
* resolve to a live command, otherwise the dispatcher emits "Unknown command".
|
||||
*/
|
||||
|
||||
@@ -589,12 +589,12 @@ const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const ROOT = path.join(__dirname, '..');
|
||||
const COMMANDS_DIR = path.join(ROOT, 'commands', 'gsd');
|
||||
const COMMANDS_DIR = path.join(ROOT, 'commands', 'msd');
|
||||
// After #3039, the canonical command reference is the `--full` mode file.
|
||||
// `workflows/help.md` is now a small dispatcher; the bidirectional parity
|
||||
// invariant lives with the comprehensive reference body.
|
||||
const HELP_MD = path.join(ROOT, 'gsd-core', 'workflows', 'help', 'modes', 'full.md');
|
||||
const DO_MD = path.join(ROOT, 'gsd-core', 'workflows', 'do.md');
|
||||
const HELP_MD = path.join(ROOT, 'msd-core', 'workflows', 'help', 'modes', 'full.md');
|
||||
const DO_MD = path.join(ROOT, 'msd-core', 'workflows', 'do.md');
|
||||
|
||||
function parseFrontmatter(content) {
|
||||
const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
||||
@@ -610,9 +610,9 @@ function parseFrontmatter(content) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set of slash-base-names actually shipped under commands/gsd/.
|
||||
* A "slash-base-name" is the part after `/gsd-` — e.g. for frontmatter
|
||||
* `name: gsd:foo` or `name: gsd-foo`, the slash-base-name is `foo`.
|
||||
* Returns the set of slash-base-names actually shipped under commands/msd/.
|
||||
* A "slash-base-name" is the part after `/msd-` — e.g. for frontmatter
|
||||
* `name: msd:foo` or `name: msd-foo`, the slash-base-name is `foo`.
|
||||
*/
|
||||
function listShippedSlashBaseNames() {
|
||||
const names = new Set();
|
||||
@@ -623,8 +623,8 @@ function listShippedSlashBaseNames() {
|
||||
if (!fm || !fm.name) continue;
|
||||
const fmName = fm.name;
|
||||
let base = null;
|
||||
if (fmName.startsWith('gsd:')) base = fmName.slice(4);
|
||||
else if (fmName.startsWith('gsd-')) base = fmName.slice(4);
|
||||
if (fmName.startsWith('msd:')) base = fmName.slice(4);
|
||||
else if (fmName.startsWith('msd-')) base = fmName.slice(4);
|
||||
if (base && /^[a-z][a-z0-9-]*$/.test(base)) names.add(base);
|
||||
}
|
||||
return names;
|
||||
@@ -632,12 +632,12 @@ function listShippedSlashBaseNames() {
|
||||
|
||||
function extractSlashReferences(contents) {
|
||||
const names = new Set();
|
||||
// Negative lookbehind: must not be preceded by a letter (avoids matching npm scope
|
||||
// paths like @opengsd/gsd-core where `/gsd-` appears inside a package URL).
|
||||
// Negative lookbehind: must not be preceded by a letter or digit (avoids matching npm scope
|
||||
// paths like @golem15/msd-core where `/msd-` appears inside a package URL).
|
||||
// Negative lookahead (?![\w-]*\/): excludes filesystem path segments like
|
||||
// `/gsd-core/bin` where the captured name is followed by a `/`, which would
|
||||
// `/msd-core/bin` where the captured name is followed by a `/`, which would
|
||||
// be a directory segment rather than a slash command name.
|
||||
const tokenRe = /(?<![a-z])\/gsd[:-]([a-z][a-z0-9-]*)(?![\w-]*\/)/g;
|
||||
const tokenRe = /(?<![a-z0-9])\/msd[:-]([a-z][a-z0-9-]*)(?![\w-]*\/)/g;
|
||||
let match;
|
||||
while ((match = tokenRe.exec(contents)) !== null) {
|
||||
names.add(match[1]);
|
||||
@@ -659,8 +659,8 @@ function listShippedFlagsByCommand() {
|
||||
if (!fm || !fm.name || !fm['argument-hint']) continue;
|
||||
const fmName = fm.name;
|
||||
let base = null;
|
||||
if (fmName.startsWith('gsd:')) base = fmName.slice(4);
|
||||
else if (fmName.startsWith('gsd-')) base = fmName.slice(4);
|
||||
if (fmName.startsWith('msd:')) base = fmName.slice(4);
|
||||
else if (fmName.startsWith('msd-')) base = fmName.slice(4);
|
||||
if (!base || !/^[a-z][a-z0-9-]*$/.test(base)) continue;
|
||||
const flags = new Set();
|
||||
for (const m of fm['argument-hint'].matchAll(/--([a-z][a-z0-9-]*)/g)) {
|
||||
@@ -671,8 +671,8 @@ function listShippedFlagsByCommand() {
|
||||
return out;
|
||||
}
|
||||
|
||||
describe('Bug #2954: help.md ↔ commands/gsd/ bidirectional parity', () => {
|
||||
test('every /gsd[-:]<name> referenced in help.md is a shipped command', () => {
|
||||
describe('Bug #2954: help.md ↔ commands/msd/ bidirectional parity', () => {
|
||||
test('every /msd[-:]<name> referenced in help.md is a shipped command', () => {
|
||||
const helpContents = fs.readFileSync(HELP_MD, 'utf8');
|
||||
const referenced = extractSlashReferences(helpContents);
|
||||
const shipped = listShippedSlashBaseNames();
|
||||
@@ -680,11 +680,11 @@ describe('Bug #2954: help.md ↔ commands/gsd/ bidirectional parity', () => {
|
||||
assert.deepEqual(
|
||||
dangling,
|
||||
[],
|
||||
`help.md advertises /gsd[-:]<name> commands that are not shipped: ${dangling.join(', ')}`,
|
||||
`help.md advertises /msd[-:]<name> commands that are not shipped: ${dangling.join(', ')}`,
|
||||
);
|
||||
});
|
||||
|
||||
test('every shipped /gsd[-:]<name> command is documented in help.md', () => {
|
||||
test('every shipped /msd[-:]<name> command is documented in help.md', () => {
|
||||
const helpContents = fs.readFileSync(HELP_MD, 'utf8');
|
||||
const referenced = extractSlashReferences(helpContents);
|
||||
const shipped = listShippedSlashBaseNames();
|
||||
@@ -692,11 +692,11 @@ describe('Bug #2954: help.md ↔ commands/gsd/ bidirectional parity', () => {
|
||||
assert.deepEqual(
|
||||
undocumented,
|
||||
[],
|
||||
`commands shipped under commands/gsd/ with no /gsd[-:]<name> reference in help.md: ${undocumented.join(', ')}`,
|
||||
`commands shipped under commands/msd/ with no /msd[-:]<name> reference in help.md: ${undocumented.join(', ')}`,
|
||||
);
|
||||
});
|
||||
|
||||
test('every /gsd[-:]<name> in do.md (live dispatcher) is a shipped command', () => {
|
||||
test('every /msd[-:]<name> in do.md (live dispatcher) is a shipped command', () => {
|
||||
const doContents = fs.readFileSync(DO_MD, 'utf8');
|
||||
const referenced = extractSlashReferences(doContents);
|
||||
const shipped = listShippedSlashBaseNames();
|
||||
@@ -704,7 +704,7 @@ describe('Bug #2954: help.md ↔ commands/gsd/ bidirectional parity', () => {
|
||||
assert.deepEqual(
|
||||
dangling,
|
||||
[],
|
||||
`do.md routing table references /gsd[-:]<name> that is not shipped: ${dangling.join(', ')}`,
|
||||
`do.md routing table references /msd[-:]<name> that is not shipped: ${dangling.join(', ')}`,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -714,18 +714,18 @@ describe('Bug #2954: help.md ↔ commands/gsd/ bidirectional parity', () => {
|
||||
const gaps = [];
|
||||
for (const [command, flags] of flagsByCommand) {
|
||||
for (const flag of flags) {
|
||||
// Accept `/gsd-<command> --<flag>` (precise) OR a bare `--<flag>` token
|
||||
// Accept `/msd-<command> --<flag>` (precise) OR a bare `--<flag>` token
|
||||
// anywhere in help.md (good enough for shared flags like `--force` that
|
||||
// appear under multiple commands' descriptions).
|
||||
const preciseDash = `/gsd-${command} --${flag}`;
|
||||
const preciseColon = `/gsd:${command} --${flag}`;
|
||||
const preciseDash = `/msd-${command} --${flag}`;
|
||||
const preciseColon = `/msd:${command} --${flag}`;
|
||||
const flagToken = `--${flag}`;
|
||||
if (
|
||||
!helpContents.includes(preciseDash) &&
|
||||
!helpContents.includes(preciseColon) &&
|
||||
!helpContents.includes(flagToken)
|
||||
) {
|
||||
gaps.push(`/gsd:${command} --${flag}`);
|
||||
gaps.push(`/msd:${command} --${flag}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -749,17 +749,17 @@ describe('Bug #2954: help.md ↔ commands/gsd/ bidirectional parity', () => {
|
||||
* Bug #2950: Stale deleted command references in workflow files
|
||||
*
|
||||
* Multiple workflow files referenced command names removed in #2790
|
||||
* (gsd-add-phase, gsd-insert-phase, gsd-remove-phase, gsd-add-todo,
|
||||
* gsd-set-profile, gsd-settings-integrations, gsd-settings-advanced,
|
||||
* gsd-spike-wrap-up, gsd-sketch-wrap-up, gsd-code-review-fix).
|
||||
* (msd-add-phase, msd-insert-phase, msd-remove-phase, msd-add-todo,
|
||||
* msd-set-profile, msd-settings-integrations, msd-settings-advanced,
|
||||
* msd-spike-wrap-up, msd-sketch-wrap-up, msd-code-review-fix).
|
||||
*
|
||||
* Fix: Update every occurrence to the new consolidated forms:
|
||||
* /gsd:phase (no flag | --insert | --remove)
|
||||
* /gsd:capture
|
||||
* /gsd:config (--profile | --integrations | --advanced)
|
||||
* /gsd:spike --wrap-up
|
||||
* /gsd:sketch --wrap-up
|
||||
* /gsd:code-review --fix
|
||||
* /msd:phase (no flag | --insert | --remove)
|
||||
* /msd:capture
|
||||
* /msd:config (--profile | --integrations | --advanced)
|
||||
* /msd:spike --wrap-up
|
||||
* /msd:sketch --wrap-up
|
||||
* /msd:code-review --fix
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@@ -769,7 +769,7 @@ const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const WORKFLOWS_DIR = path.join(__dirname, '..', 'gsd-core', 'workflows');
|
||||
const WORKFLOWS_DIR = path.join(__dirname, '..', 'msd-core', 'workflows');
|
||||
|
||||
function read(filename) {
|
||||
return fs.readFileSync(path.join(WORKFLOWS_DIR, filename), 'utf-8');
|
||||
@@ -777,57 +777,57 @@ function read(filename) {
|
||||
|
||||
// Deleted command names that must not appear anywhere in the fixed files.
|
||||
const DELETED_COMMANDS = [
|
||||
'/gsd-add-phase',
|
||||
'/gsd-insert-phase',
|
||||
'/gsd-remove-phase',
|
||||
'/gsd-add-todo',
|
||||
'/gsd-set-profile',
|
||||
'/gsd-settings-integrations',
|
||||
'/gsd-settings-advanced',
|
||||
'/gsd-spike-wrap-up',
|
||||
'/gsd-sketch-wrap-up',
|
||||
'/gsd-code-review-fix',
|
||||
'/msd-add-phase',
|
||||
'/msd-insert-phase',
|
||||
'/msd-remove-phase',
|
||||
'/msd-add-todo',
|
||||
'/msd-set-profile',
|
||||
'/msd-settings-integrations',
|
||||
'/msd-settings-advanced',
|
||||
'/msd-spike-wrap-up',
|
||||
'/msd-sketch-wrap-up',
|
||||
'/msd-code-review-fix',
|
||||
];
|
||||
|
||||
// Per-file assertions: [file, deletedCmd, newForm]
|
||||
const FILE_ASSERTIONS = [
|
||||
// help.md → moved to help/modes/full.md in #3039 tiered-help refactor
|
||||
['help/modes/full.md', '/gsd-add-phase', '/gsd:phase "Add admin dashboard"'],
|
||||
['help/modes/full.md', '/gsd-insert-phase', '/gsd:phase --insert 7 "Fix critical auth bug"'],
|
||||
['help/modes/full.md', '/gsd-remove-phase', '/gsd:phase --remove 17'],
|
||||
['help/modes/full.md', '/gsd-spike-wrap-up', '/gsd:spike --wrap-up'],
|
||||
['help/modes/full.md', '/gsd-sketch-wrap-up', '/gsd:sketch --wrap-up'],
|
||||
['help/modes/full.md', '/gsd-add-todo', '/gsd:capture'],
|
||||
['help/modes/full.md', '/gsd-set-profile', '/gsd:config --profile budget'],
|
||||
['help/modes/full.md', '/msd-add-phase', '/msd:phase "Add admin dashboard"'],
|
||||
['help/modes/full.md', '/msd-insert-phase', '/msd:phase --insert 7 "Fix critical auth bug"'],
|
||||
['help/modes/full.md', '/msd-remove-phase', '/msd:phase --remove 17'],
|
||||
['help/modes/full.md', '/msd-spike-wrap-up', '/msd:spike --wrap-up'],
|
||||
['help/modes/full.md', '/msd-sketch-wrap-up', '/msd:sketch --wrap-up'],
|
||||
['help/modes/full.md', '/msd-add-todo', '/msd:capture'],
|
||||
['help/modes/full.md', '/msd-set-profile', '/msd:config --profile budget'],
|
||||
|
||||
// do.md
|
||||
['do.md', '/gsd-spike-wrap-up', '/gsd:spike --wrap-up'],
|
||||
['do.md', '/gsd-sketch-wrap-up', '/gsd:sketch --wrap-up'],
|
||||
['do.md', '/gsd-add-phase', '/gsd:phase'],
|
||||
['do.md', '/gsd-add-todo', '/gsd:capture'],
|
||||
['do.md', '/msd-spike-wrap-up', '/msd:spike --wrap-up'],
|
||||
['do.md', '/msd-sketch-wrap-up', '/msd:sketch --wrap-up'],
|
||||
['do.md', '/msd-add-phase', '/msd:phase'],
|
||||
['do.md', '/msd-add-todo', '/msd:capture'],
|
||||
|
||||
// settings.md
|
||||
['settings.md', '/gsd-code-review-fix', '/gsd:code-review --fix'],
|
||||
['settings.md', '/gsd-settings-integrations', '/gsd:config --integrations'],
|
||||
['settings.md', '/gsd-set-profile', '/gsd:config --profile'],
|
||||
['settings.md', '/gsd-settings-advanced', '/gsd:config --advanced'],
|
||||
['settings.md', '/msd-code-review-fix', '/msd:code-review --fix'],
|
||||
['settings.md', '/msd-settings-integrations', '/msd:config --integrations'],
|
||||
['settings.md', '/msd-set-profile', '/msd:config --profile'],
|
||||
['settings.md', '/msd-settings-advanced', '/msd:config --advanced'],
|
||||
|
||||
// discuss-phase.md
|
||||
['discuss-phase.md', '/gsd-spike-wrap-up', '/gsd:spike --wrap-up'],
|
||||
['discuss-phase.md', '/gsd-sketch-wrap-up', '/gsd:sketch --wrap-up'],
|
||||
['discuss-phase.md', '/msd-spike-wrap-up', '/msd:spike --wrap-up'],
|
||||
['discuss-phase.md', '/msd-sketch-wrap-up', '/msd:sketch --wrap-up'],
|
||||
|
||||
// new-project.md
|
||||
['new-project.md', '/gsd-spike-wrap-up', '/gsd:spike --wrap-up'],
|
||||
['new-project.md', '/gsd-sketch-wrap-up', '/gsd:sketch --wrap-up'],
|
||||
['new-project.md', '/msd-spike-wrap-up', '/msd:spike --wrap-up'],
|
||||
['new-project.md', '/msd-sketch-wrap-up', '/msd:sketch --wrap-up'],
|
||||
|
||||
// plan-phase.md
|
||||
['plan-phase.md', '/gsd-insert-phase', '/gsd:phase --insert'],
|
||||
['plan-phase.md', '/msd-insert-phase', '/msd:phase --insert'],
|
||||
|
||||
// spike.md
|
||||
['spike.md', '/gsd-spike-wrap-up', '/gsd:spike --wrap-up'],
|
||||
['spike.md', '/msd-spike-wrap-up', '/msd:spike --wrap-up'],
|
||||
|
||||
// sketch.md
|
||||
['sketch.md', '/gsd-sketch-wrap-up', '/gsd:sketch --wrap-up'],
|
||||
['sketch.md', '/msd-sketch-wrap-up', '/msd:sketch --wrap-up'],
|
||||
];
|
||||
|
||||
describe('bug #2950: stale deleted-command references removed from workflow files', () => {
|
||||
@@ -907,7 +907,7 @@ describe('bug #2950: stale deleted-command references removed from workflow file
|
||||
* the structural invariants survive — section-level rewording is fine.
|
||||
*
|
||||
* Acceptance criteria from issue #2840:
|
||||
* - One guide explaining issue-driven orchestration using existing GSD
|
||||
* - One guide explaining issue-driven orchestration using existing MSD
|
||||
* commands.
|
||||
* - Concrete end-to-end issue → workspace → plan/execute → verify/review
|
||||
* → PR flow.
|
||||
@@ -973,11 +973,11 @@ function parseGuide() {
|
||||
if (!fs.existsSync(GUIDE_PATH)) return null;
|
||||
const content = fs.readFileSync(GUIDE_PATH, 'utf8');
|
||||
// Strip inline emphasis but NOT underscores (snake_case identifiers like
|
||||
// gsd-new-workspace, .planning/, etc. must survive).
|
||||
// msd-new-workspace, .planning/, etc. must survive).
|
||||
const stripped = content.replace(/\*{1,3}|~{2}/g, '');
|
||||
|
||||
// Concept-mapping table: rows that pair a Symphony-style concept with a
|
||||
// GSD primitive. Test asserts on presence of each required pair, not on
|
||||
// MSD primitive. Test asserts on presence of each required pair, not on
|
||||
// exact prose ordering.
|
||||
const conceptMappingSection = extractSection(content, 'Concept mapping');
|
||||
const endToEndSection = extractSection(content, 'End-to-end flow') ||
|
||||
@@ -989,24 +989,24 @@ function parseGuide() {
|
||||
extractSection(content, 'What this guide does not do');
|
||||
|
||||
// Track which referenced commands appear at least once anywhere in the
|
||||
// guide. This prevents drift if /gsd-* command names are renamed.
|
||||
// guide. This prevents drift if /msd-* command names are renamed.
|
||||
const requiredCommands = [
|
||||
'/gsd-workspace --new',
|
||||
'/gsd-manager',
|
||||
'/gsd-autonomous',
|
||||
'/gsd-discuss-phase',
|
||||
'/gsd-plan-phase',
|
||||
'/gsd-execute-phase',
|
||||
'/gsd-verify-work',
|
||||
'/gsd-review',
|
||||
'/gsd-ship',
|
||||
'/msd-workspace --new',
|
||||
'/msd-manager',
|
||||
'/msd-autonomous',
|
||||
'/msd-discuss-phase',
|
||||
'/msd-plan-phase',
|
||||
'/msd-execute-phase',
|
||||
'/msd-verify-work',
|
||||
'/msd-review',
|
||||
'/msd-ship',
|
||||
];
|
||||
const commandsPresent = Object.fromEntries(
|
||||
requiredCommands.map((c) => [c, content.includes(c)])
|
||||
);
|
||||
|
||||
// Concept-mapping invariants — keys are concept slugs, values are the
|
||||
// GSD primitive that must appear in the same paragraph/row of the
|
||||
// MSD primitive that must appear in the same paragraph/row of the
|
||||
// concept-mapping section.
|
||||
const conceptPairs = conceptMappingSection
|
||||
? {
|
||||
@@ -1014,13 +1014,13 @@ function parseGuide() {
|
||||
statemd: /STATE\.md/.test(conceptMappingSection),
|
||||
contextmd: /CONTEXT\.md/.test(conceptMappingSection),
|
||||
planmd: /PLAN\.md/.test(conceptMappingSection),
|
||||
workspaceCommand: /\/gsd-workspace\s+--new/.test(conceptMappingSection),
|
||||
workspaceCommand: /\/msd-workspace\s+--new/.test(conceptMappingSection),
|
||||
executionCommand:
|
||||
/\/gsd-manager/.test(conceptMappingSection) ||
|
||||
/\/gsd-autonomous/.test(conceptMappingSection),
|
||||
verifyCommand: /\/gsd-verify-work/.test(conceptMappingSection),
|
||||
reviewCommand: /\/gsd-review/.test(conceptMappingSection),
|
||||
shipCommand: /\/gsd-ship/.test(conceptMappingSection),
|
||||
/\/msd-manager/.test(conceptMappingSection) ||
|
||||
/\/msd-autonomous/.test(conceptMappingSection),
|
||||
verifyCommand: /\/msd-verify-work/.test(conceptMappingSection),
|
||||
reviewCommand: /\/msd-review/.test(conceptMappingSection),
|
||||
shipCommand: /\/msd-ship/.test(conceptMappingSection),
|
||||
}
|
||||
: null;
|
||||
|
||||
@@ -1082,7 +1082,7 @@ describe('issue-driven-orchestration guide (#2840)', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('every required GSD command is referenced at least once', () => {
|
||||
test('every required MSD command is referenced at least once', () => {
|
||||
const ir = parseGuide();
|
||||
assert.ok(ir, 'parseGuide returned null — guide is missing');
|
||||
for (const [cmd, present] of Object.entries(ir.commandsPresent)) {
|
||||
@@ -1090,7 +1090,7 @@ describe('issue-driven-orchestration guide (#2840)', () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('concept mapping section exists and pairs Symphony concepts with GSD primitives', () => {
|
||||
test('concept mapping section exists and pairs Symphony concepts with MSD primitives', () => {
|
||||
const ir = parseGuide();
|
||||
assert.ok(ir, 'guide must be present');
|
||||
assert.ok(
|
||||
@@ -1102,12 +1102,12 @@ describe('issue-driven-orchestration guide (#2840)', () => {
|
||||
statemd: 'STATE.md must appear in the concept mapping',
|
||||
contextmd: 'CONTEXT.md must appear in the concept mapping',
|
||||
planmd: 'PLAN.md must appear in the concept mapping',
|
||||
workspaceCommand: '/gsd-workspace --new must appear in the concept mapping',
|
||||
workspaceCommand: '/msd-workspace --new must appear in the concept mapping',
|
||||
executionCommand:
|
||||
'/gsd-manager or /gsd-autonomous must appear in the concept mapping',
|
||||
verifyCommand: '/gsd-verify-work must appear in the concept mapping',
|
||||
reviewCommand: '/gsd-review must appear in the concept mapping',
|
||||
shipCommand: '/gsd-ship must appear in the concept mapping',
|
||||
'/msd-manager or /msd-autonomous must appear in the concept mapping',
|
||||
verifyCommand: '/msd-verify-work must appear in the concept mapping',
|
||||
reviewCommand: '/msd-review must appear in the concept mapping',
|
||||
shipCommand: '/msd-ship must appear in the concept mapping',
|
||||
};
|
||||
for (const [flag, msg] of Object.entries(expected)) {
|
||||
assert.equal(ir.conceptPairs[flag], true, msg);
|
||||
@@ -1231,7 +1231,7 @@ describe('issue-driven-orchestration guide (#2840)', () => {
|
||||
/**
|
||||
* Documentation regression test for issue #3025 — MCP token-budget guidance.
|
||||
*
|
||||
* Verifies that gsd-core/references/context-budget.md contains the
|
||||
* Verifies that msd-core/references/context-budget.md contains the
|
||||
* structural elements the issue requires:
|
||||
*
|
||||
* 1. A section explaining MCP/tool schemas as a context-budget concern
|
||||
@@ -1239,7 +1239,7 @@ describe('issue-driven-orchestration guide (#2840)', () => {
|
||||
* disabledMcpjsonServers in .claude/settings.json)
|
||||
* 3. A pre-phase audit checklist (browser/playwright, platform-specific,
|
||||
* project-specific)
|
||||
* 4. An explicit note that GSD does NOT manage MCP enablement — this is
|
||||
* 4. An explicit note that MSD does NOT manage MCP enablement — this is
|
||||
* a Claude Code harness concern (with a cross-link)
|
||||
* 5. Note the interaction with model_profile (compounding levers)
|
||||
*
|
||||
@@ -1260,7 +1260,7 @@ const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const ROOT = path.join(__dirname, '..');
|
||||
const CONTEXT_BUDGET_MD = path.join(ROOT, 'gsd-core', 'references', 'context-budget.md');
|
||||
const CONTEXT_BUDGET_MD = path.join(ROOT, 'msd-core', 'references', 'context-budget.md');
|
||||
const USER_GUIDE_MD = path.join(ROOT, 'docs', 'USER-GUIDE.md');
|
||||
|
||||
/**
|
||||
@@ -1310,14 +1310,14 @@ function parseMcpBudgetSection(section) {
|
||||
auditMentionsBrowserOrPlaywright: false,
|
||||
auditMentionsPlatformSpecific: false,
|
||||
auditMentionsCrossProject: false,
|
||||
explainsHarnessNotGsd: false,
|
||||
explainsHarnessNotMsd: false,
|
||||
mentionsModelProfileInteraction: false,
|
||||
crossLinksContextBudget: false,
|
||||
};
|
||||
}
|
||||
// CR follow-up: strip inline markdown emphasis (`**`, `*`, `~~`) and
|
||||
// backticks before phrase-matching so e.g. "GSD does **not** manage"
|
||||
// is caught by the primary `gsd does not manage` alternative below.
|
||||
// backticks before phrase-matching so e.g. "MSD does **not** manage"
|
||||
// is caught by the primary `msd does not manage` alternative below.
|
||||
// WITHOUT this, the markdown-bold breaks the contiguous match and the
|
||||
// test only passes via the fallback branch (silent dead code).
|
||||
// Underscores are intentionally NOT stripped — `model_profile` and
|
||||
@@ -1341,10 +1341,10 @@ function parseMcpBudgetSection(section) {
|
||||
const auditMentionsBrowserOrPlaywright = /\bbrowser\b|playwright/i.test(stripped);
|
||||
const auditMentionsPlatformSpecific = /platform[- ]specific|mac[- ]?tools|windows[- ]?tools|os[- ]specific/i.test(stripped);
|
||||
const auditMentionsCrossProject = /(other|different|cross[- ])\s*project|stale (project )?mcp/i.test(stripped);
|
||||
// (5) Harness vs GSD distinction — must explicitly state GSD doesn't
|
||||
// (5) Harness vs MSD distinction — must explicitly state MSD doesn't
|
||||
// own this knob and point at the harness
|
||||
const explainsHarnessNotGsd =
|
||||
/(gsd does(?:n[''’]t| not) (own|manage|control)|harness (concern|setting|controlled)|not a gsd (setting|knob))/i.test(stripped);
|
||||
const explainsHarnessNotMsd =
|
||||
/(msd does(?:n[''’]t| not) (own|manage|control)|harness (concern|setting|controlled)|not a msd (setting|knob))/i.test(stripped);
|
||||
// (6) Compounding with model_profile
|
||||
const mentionsModelProfileInteraction =
|
||||
/model[_ ]profile/i.test(stripped) &&
|
||||
@@ -1365,7 +1365,7 @@ function parseMcpBudgetSection(section) {
|
||||
auditMentionsBrowserOrPlaywright,
|
||||
auditMentionsPlatformSpecific,
|
||||
auditMentionsCrossProject,
|
||||
explainsHarnessNotGsd,
|
||||
explainsHarnessNotMsd,
|
||||
mentionsModelProfileInteraction,
|
||||
crossLinksContextBudget,
|
||||
};
|
||||
@@ -1414,11 +1414,11 @@ describe('#3025 context-budget.md: MCP token-budget section exists with required
|
||||
'audit must mention stale/cross-project MCPs from other projects');
|
||||
});
|
||||
|
||||
test('explains GSD does not own MCP enablement — harness concern (#3025 requirement 4)', () => {
|
||||
test('explains MSD does not own MCP enablement — harness concern (#3025 requirement 4)', () => {
|
||||
const section = extractSection(CONTEXT_BUDGET_MD, 'mcp');
|
||||
const parsed = parseMcpBudgetSection(section);
|
||||
assert.equal(parsed.explainsHarnessNotGsd, true,
|
||||
'section must explicitly state GSD does not manage MCP enablement (harness concern)');
|
||||
assert.equal(parsed.explainsHarnessNotMsd, true,
|
||||
'section must explicitly state MSD does not manage MCP enablement (harness concern)');
|
||||
});
|
||||
|
||||
test('notes interaction with model_profile (compounding levers) (#3025 requirement 5)', () => {
|
||||
@@ -1441,7 +1441,7 @@ describe('#3025 context-budget.md: MCP token-budget section exists with required
|
||||
auditMentionsBrowserOrPlaywright: parsed.auditMentionsBrowserOrPlaywright,
|
||||
auditMentionsPlatformSpecific: parsed.auditMentionsPlatformSpecific,
|
||||
auditMentionsCrossProject: parsed.auditMentionsCrossProject,
|
||||
explainsHarnessNotGsd: parsed.explainsHarnessNotGsd,
|
||||
explainsHarnessNotMsd: parsed.explainsHarnessNotMsd,
|
||||
mentionsModelProfileInteraction: parsed.mentionsModelProfileInteraction,
|
||||
};
|
||||
assert.deepStrictEqual(contract, {
|
||||
@@ -1454,7 +1454,7 @@ describe('#3025 context-budget.md: MCP token-budget section exists with required
|
||||
auditMentionsBrowserOrPlaywright: true,
|
||||
auditMentionsPlatformSpecific: true,
|
||||
auditMentionsCrossProject: true,
|
||||
explainsHarnessNotGsd: true,
|
||||
explainsHarnessNotMsd: true,
|
||||
mentionsModelProfileInteraction: true,
|
||||
}, 'context-budget.md MCP section contract violated');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user