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:
Jakub Zych
2026-10-06 01:47:40 +02:00
parent fe069b2a56
commit a9a7a328e6
2763 changed files with 78465 additions and 78434 deletions

View File

@@ -1,16 +1,16 @@
/**
* GSD Workspace Tests
* MSD Workspace Tests
*
* Tests for /gsd-new-workspace, /gsd-list-workspaces, /gsd-remove-workspace
* init functions and integration with gsd-tools routing.
* Tests for /msd-new-workspace, /msd-list-workspaces, /msd-remove-workspace
* init functions and integration with msd-tools routing.
*/
const { test, describe, beforeEach, afterEach } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('fs');
const path = require('path');
const { runGsdTools, createTempProject, createTempDir, cleanup } = require('./helpers.cjs');
const { detectChildRepos } = require('../gsd-core/bin/lib/init.cjs');
const { runMsdTools, createTempProject, createTempDir, cleanup } = require('./helpers.cjs');
const { detectChildRepos } = require('../msd-core/bin/lib/init.cjs');
const { gitOrThrow } = require('./helpers/git-fixture.cjs');
// #3145: class-norm timeout, not a per-suite value — see helpers/timeouts.cjs.
const { GIT_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
@@ -21,7 +21,7 @@ describe('detectChildRepos', () => {
let tmpDir;
beforeEach(() => {
tmpDir = createTempDir('gsd-ws-test-');
tmpDir = createTempDir('msd-ws-test-');
});
afterEach(() => {
@@ -76,13 +76,13 @@ describe('detectChildRepos', () => {
});
});
// ─── cmdInitNewWorkspace via gsd-tools ──────────────────────────────────────
// ─── cmdInitNewWorkspace via msd-tools ──────────────────────────────────────
describe('init new-workspace', () => {
let tmpDir;
beforeEach(() => {
tmpDir = createTempDir('gsd-ws-test-');
tmpDir = createTempDir('msd-ws-test-');
});
afterEach(() => {
@@ -90,7 +90,7 @@ describe('init new-workspace', () => {
});
test('returns expected JSON fields', () => {
const result = runGsdTools('init new-workspace', tmpDir);
const result = runMsdTools('init new-workspace', tmpDir);
assert.ok(result.success, `init failed: ${result.error}`);
const data = JSON.parse(result.output);
assert.ok('default_workspace_base' in data);
@@ -107,26 +107,26 @@ describe('init new-workspace', () => {
fs.mkdirSync(repo);
gitOrThrow(['init'], { cwd: repo, timeoutMs: GIT_TIMEOUT_MS });
const result = runGsdTools('init new-workspace', tmpDir);
const result = runMsdTools('init new-workspace', tmpDir);
const data = JSON.parse(result.output);
assert.strictEqual(data.child_repo_count, 1);
assert.strictEqual(data.child_repos[0].name, 'my-repo');
});
test('reports no git repo when cwd is not a git repo', () => {
const result = runGsdTools('init new-workspace', tmpDir);
const result = runMsdTools('init new-workspace', tmpDir);
const data = JSON.parse(result.output);
assert.strictEqual(data.is_git_repo, false);
});
});
// ─── cmdInitListWorkspaces via gsd-tools ────────────────────────────────────
// ─── cmdInitListWorkspaces via msd-tools ────────────────────────────────────
describe('init list-workspaces', () => {
let tmpDir;
beforeEach(() => {
tmpDir = createTempDir('gsd-ws-test-');
tmpDir = createTempDir('msd-ws-test-');
});
afterEach(() => {
@@ -134,7 +134,7 @@ describe('init list-workspaces', () => {
});
test('returns empty list when no workspaces exist', () => {
const result = runGsdTools('init list-workspaces', tmpDir, { HOME: tmpDir });
const result = runMsdTools('init list-workspaces', tmpDir, { HOME: tmpDir });
assert.ok(result.success, `init failed: ${result.error}`);
const data = JSON.parse(result.output);
assert.strictEqual(data.workspace_count, 0);
@@ -142,7 +142,7 @@ describe('init list-workspaces', () => {
});
test('finds workspaces with WORKSPACE.md', () => {
const wsBase = path.join(tmpDir, 'gsd-workspaces');
const wsBase = path.join(tmpDir, 'msd-workspaces');
const ws1 = path.join(wsBase, 'feature-a');
fs.mkdirSync(path.join(ws1, '.planning'), { recursive: true });
fs.writeFileSync(path.join(ws1, 'WORKSPACE.md'), [
@@ -158,7 +158,7 @@ describe('init list-workspaces', () => {
'| hr-ui | /tmp/hr-ui | workspace/feature-a | worktree |',
].join('\n'));
const result = runGsdTools('init list-workspaces', tmpDir, { HOME: tmpDir });
const result = runMsdTools('init list-workspaces', tmpDir, { HOME: tmpDir });
const data = JSON.parse(result.output);
assert.strictEqual(data.workspace_count, 1);
assert.strictEqual(data.workspaces[0].name, 'feature-a');
@@ -167,13 +167,13 @@ describe('init list-workspaces', () => {
});
});
// ─── cmdInitRemoveWorkspace via gsd-tools ───────────────────────────────────
// ─── cmdInitRemoveWorkspace via msd-tools ───────────────────────────────────
describe('init remove-workspace', () => {
let tmpDir;
beforeEach(() => {
tmpDir = createTempDir('gsd-ws-test-');
tmpDir = createTempDir('msd-ws-test-');
});
afterEach(() => {
@@ -181,19 +181,19 @@ describe('init remove-workspace', () => {
});
test('errors when no name provided', () => {
const result = runGsdTools('init remove-workspace', tmpDir);
const result = runMsdTools('init remove-workspace', tmpDir);
assert.strictEqual(result.success, false);
assert.ok(result.error.includes('workspace name required'));
});
test('errors when workspace not found', () => {
const result = runGsdTools('init remove-workspace nonexistent', tmpDir, { HOME: tmpDir });
const result = runMsdTools('init remove-workspace nonexistent', tmpDir, { HOME: tmpDir });
assert.strictEqual(result.success, false);
assert.ok(result.error.includes('Workspace not found'));
});
test('returns workspace info for existing workspace', () => {
const wsBase = path.join(tmpDir, 'gsd-workspaces');
const wsBase = path.join(tmpDir, 'msd-workspaces');
const ws = path.join(wsBase, 'test-ws');
fs.mkdirSync(ws, { recursive: true });
fs.writeFileSync(path.join(ws, 'WORKSPACE.md'), [
@@ -209,7 +209,7 @@ describe('init remove-workspace', () => {
'| api | /tmp/api | workspace/test-ws | clone |',
].join('\n'));
const result = runGsdTools('init remove-workspace test-ws', tmpDir, { HOME: tmpDir });
const result = runMsdTools('init remove-workspace test-ws', tmpDir, { HOME: tmpDir });
assert.ok(result.success, `init failed: ${result.error}`);
const data = JSON.parse(result.output);
assert.strictEqual(data.workspace_name, 'test-ws');
@@ -223,7 +223,7 @@ describe('init remove-workspace', () => {
// coverage pattern (tests/init-manager.test.cjs).
describe('response_language wiring (#2402)', () => {
function writeWorkspace(base, name) {
const ws = path.join(base, 'gsd-workspaces', name);
const ws = path.join(base, 'msd-workspaces', name);
fs.mkdirSync(ws, { recursive: true });
fs.writeFileSync(path.join(ws, 'WORKSPACE.md'), [
`# Workspace: ${name}`,
@@ -246,7 +246,7 @@ describe('init remove-workspace', () => {
JSON.stringify({ response_language: 'Japanese' })
);
const result = runGsdTools('init remove-workspace test-ws', tmpDir, { HOME: tmpDir });
const result = runMsdTools('init remove-workspace test-ws', tmpDir, { HOME: tmpDir });
assert.ok(result.success, `init failed: ${result.error}`);
const data = JSON.parse(result.output);
assert.strictEqual(data.response_language, 'Japanese');
@@ -255,7 +255,7 @@ describe('init remove-workspace', () => {
test('output omits response_language when not configured', () => {
writeWorkspace(tmpDir, 'test-ws');
const result = runGsdTools('init remove-workspace test-ws', tmpDir, { HOME: tmpDir });
const result = runMsdTools('init remove-workspace test-ws', tmpDir, { HOME: tmpDir });
assert.ok(result.success, `init failed: ${result.error}`);
const data = JSON.parse(result.output);
assert.strictEqual(data.response_language, undefined);
@@ -270,7 +270,7 @@ describe('workspace worktree integration', () => {
let sourceRepo;
beforeEach(() => {
tmpDir = createTempDir('gsd-ws-integ-');
tmpDir = createTempDir('msd-ws-integ-');
// Create a source git repo with a commit
sourceRepo = path.join(tmpDir, 'source-repo');
fs.mkdirSync(sourceRepo);
@@ -397,7 +397,7 @@ describe('workspace command files', () => {
/**
* Extract `@`-include targets from any of the <execution_context*> blocks.
* Each line of the form `@~/.claude/gsd-core/workflows/foo.md` becomes
* Each line of the form `@~/.claude/msd-core/workflows/foo.md` becomes
* a relative target like `workflows/foo.md`. Used to assert workflow
* routing structurally instead of substring-matching prose.
*/
@@ -409,9 +409,9 @@ describe('workspace command files', () => {
for (const line of blk.split(/\r?\n/)) {
const t = line.trim();
if (!t.startsWith('@')) continue;
// Normalize away the home-prefix and the `.claude/gsd-core/` root
// Normalize away the home-prefix and the `.claude/msd-core/` root
// so the test only cares about the workflow path tail.
const rel = t.replace(/^@~?\/?(?:\.claude\/)?(?:gsd-core\/)?/, '');
const rel = t.replace(/^@~?\/?(?:\.claude\/)?(?:msd-core\/)?/, '');
targets.push(rel);
}
}
@@ -421,8 +421,8 @@ describe('workspace command files', () => {
test('consolidated workspace.md command declares correct frontmatter contract (#2790)', () => {
// Structural: parse frontmatter, then split argument-hint into the
// tokenized flag list. Each consolidated flag must appear there.
const { fm } = parseCommandFile(path.join(baseDir, 'commands/gsd/workspace.md'));
assert.equal(fm.name, 'gsd:workspace', `workspace.md frontmatter name must be "gsd:workspace"; got "${fm.name}"`);
const { fm } = parseCommandFile(path.join(baseDir, 'commands/msd/workspace.md'));
assert.equal(fm.name, 'msd:workspace', `workspace.md frontmatter name must be "msd:workspace"; got "${fm.name}"`);
assert.ok(fm['argument-hint'], 'workspace.md frontmatter must declare argument-hint');
// argument-hint can include multiple bracketed segments and free tokens,
// e.g. "[--new | --list | --remove] [name]". Pull every `--flag` token
@@ -441,7 +441,7 @@ describe('workspace command files', () => {
});
test('workspace.md @-includes the new-workspace workflow', () => {
const { body } = parseCommandFile(path.join(baseDir, 'commands/gsd/workspace.md'));
const { body } = parseCommandFile(path.join(baseDir, 'commands/msd/workspace.md'));
const targets = executionContextIncludes(body);
assert.ok(
targets.some((t) => /(^|\/)workflows\/new-workspace\.md$/.test(t)),
@@ -450,7 +450,7 @@ describe('workspace command files', () => {
});
test('workspace.md @-includes the list-workspaces workflow', () => {
const { body } = parseCommandFile(path.join(baseDir, 'commands/gsd/workspace.md'));
const { body } = parseCommandFile(path.join(baseDir, 'commands/msd/workspace.md'));
const targets = executionContextIncludes(body);
assert.ok(
targets.some((t) => /(^|\/)workflows\/list-workspaces\.md$/.test(t)),
@@ -459,7 +459,7 @@ describe('workspace command files', () => {
});
test('workspace.md @-includes the remove-workspace workflow', () => {
const { body } = parseCommandFile(path.join(baseDir, 'commands/gsd/workspace.md'));
const { body } = parseCommandFile(path.join(baseDir, 'commands/msd/workspace.md'));
const targets = executionContextIncludes(body);
assert.ok(
targets.some((t) => /(^|\/)workflows\/remove-workspace\.md$/.test(t)),
@@ -468,10 +468,10 @@ describe('workspace command files', () => {
});
test('new-workspace workflow exists', () => {
const content = fs.readFileSync(path.join(baseDir, 'gsd-core/workflows/new-workspace.md'), 'utf8');
const content = fs.readFileSync(path.join(baseDir, 'msd-core/workflows/new-workspace.md'), 'utf8');
assert.ok(
content.includes('init new-workspace') || content.includes('init.new-workspace'),
'expected init new-workspace (CJS) or gsd-sdk query init.new-workspace'
'expected init new-workspace (CJS) or msd-sdk query init.new-workspace'
);
assert.ok(content.includes('WORKSPACE.md'));
assert.ok(content.includes('git worktree add'));
@@ -479,26 +479,26 @@ describe('workspace command files', () => {
});
test('list-workspaces workflow exists', () => {
const content = fs.readFileSync(path.join(baseDir, 'gsd-core/workflows/list-workspaces.md'), 'utf8');
const content = fs.readFileSync(path.join(baseDir, 'msd-core/workflows/list-workspaces.md'), 'utf8');
assert.ok(
content.includes('init list-workspaces') || content.includes('init.list-workspaces'),
'expected init list-workspaces or gsd-sdk query init.list-workspaces'
'expected init list-workspaces or msd-sdk query init.list-workspaces'
);
});
test('remove-workspace workflow exists', () => {
const content = fs.readFileSync(path.join(baseDir, 'gsd-core/workflows/remove-workspace.md'), 'utf8');
const content = fs.readFileSync(path.join(baseDir, 'msd-core/workflows/remove-workspace.md'), 'utf8');
assert.ok(
content.includes('init remove-workspace') || content.includes('init.remove-workspace'),
'expected init remove-workspace or gsd-sdk query init.remove-workspace'
'expected init remove-workspace or msd-sdk query init.remove-workspace'
);
assert.ok(content.includes('git worktree remove'));
});
});
// ─── Routing in gsd-tools ───────────────────────────────────────────────────
// ─── Routing in msd-tools ───────────────────────────────────────────────────
describe('workspace routing in gsd-tools', () => {
describe('workspace routing in msd-tools', () => {
let tmpDir;
beforeEach(() => { tmpDir = createTempProject(); });
@@ -509,7 +509,7 @@ describe('workspace routing in gsd-tools', () => {
// covered by the functional tests above; these guard against routing deletions.
test('init new-workspace is routed correctly', () => {
const result = runGsdTools('init new-workspace test-ws', tmpDir);
const result = runMsdTools('init new-workspace test-ws', tmpDir);
const stderr = result.error || '';
assert.ok(
!stderr.includes('Unknown init workflow'),
@@ -518,14 +518,14 @@ describe('workspace routing in gsd-tools', () => {
});
test('init list-workspaces is routed correctly', () => {
const result = runGsdTools('init list-workspaces', tmpDir);
const result = runMsdTools('init list-workspaces', tmpDir);
assert.ok(result.success, `init list-workspaces should succeed: ${result.error}`);
const parsed = JSON.parse(result.output);
assert.ok(Array.isArray(parsed.workspaces), 'list-workspaces must return a workspaces array');
});
test('init remove-workspace is routed correctly', () => {
const result = runGsdTools('init remove-workspace nonexistent-ws', tmpDir);
const result = runMsdTools('init remove-workspace nonexistent-ws', tmpDir);
const stderr = result.error || '';
assert.ok(
!stderr.includes('Unknown init workflow'),