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

@@ -2,7 +2,7 @@
'use strict';
/**
* GSD Tools Tests - Milestone Archive Layout and Phase Filter
* MSD Tools Tests - Milestone Archive Layout and Phase Filter
*
* Covers:
* - bug #2684: milestone.complete forwards version to phases.archive
@@ -11,19 +11,19 @@
* - bug #3600: getMilestonePhaseFilter with project-code-prefixed directories
*/
process.env.GSD_TEST_MODE = '1';
process.env.MSD_TEST_MODE = '1';
const { describe, test, beforeEach, afterEach } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const { createTempProject, cleanup, runGsdTools, toPosixPath } = require('./helpers.cjs');
const { createTempProject, cleanup, runMsdTools, toPosixPath } = require('./helpers.cjs');
const { seedWorkstream } = require('./fixtures/index.cjs');
const { findTableBySchema } = require('../gsd-core/bin/lib/markdown-table.cjs');
const { buildQuickArchiveIndex } = require('../gsd-core/bin/lib/milestone.cjs');
const { findTableBySchema } = require('../msd-core/bin/lib/markdown-table.cjs');
const { buildQuickArchiveIndex } = require('../msd-core/bin/lib/milestone.cjs');
function runSdkQuery(args, cwd) {
const result = runGsdTools(args, cwd);
const result = runMsdTools(args, cwd);
if (!result.success) return { success: false, error: result.error };
try {
return { success: true, data: JSON.parse(result.output || '{}') };
@@ -149,9 +149,9 @@ describe('extractCurrentMilestone — fenced code block boundary (#2787)', () =>
].join('\n');
fs.writeFileSync(path.join(tmpDir, '.planning', 'ROADMAP.md'), roadmap);
fs.writeFileSync(path.join(tmpDir, '.planning', 'STATE.md'), '---\nmilestone: v1.1\n---\n\n# GSD State\n');
fs.writeFileSync(path.join(tmpDir, '.planning', 'STATE.md'), '---\nmilestone: v1.1\n---\n\n# MSD State\n');
const result = runGsdTools('roadmap analyze', tmpDir);
const result = runMsdTools('roadmap analyze', tmpDir);
assert.ok(result.success, `roadmap analyze should succeed: ${result.error}`);
assert.strictEqual(JSON.parse(result.output).phase_count, 4, 'All 4 phases in v1.1 should be found');
});
@@ -172,9 +172,9 @@ describe('extractCurrentMilestone — fenced code block boundary (#2787)', () =>
].join('\n');
fs.writeFileSync(path.join(tmpDir, '.planning', 'ROADMAP.md'), roadmap);
fs.writeFileSync(path.join(tmpDir, '.planning', 'STATE.md'), '---\nmilestone: v2.0\n---\n\n# GSD State\n');
fs.writeFileSync(path.join(tmpDir, '.planning', 'STATE.md'), '---\nmilestone: v2.0\n---\n\n# MSD State\n');
const result = runGsdTools('roadmap analyze', tmpDir);
const result = runMsdTools('roadmap analyze', tmpDir);
assert.ok(result.success, `roadmap analyze should succeed: ${result.error}`);
assert.strictEqual(JSON.parse(result.output).phase_count, 2, 'Both phases in v2.0 should be found');
});
@@ -196,9 +196,9 @@ describe('extractCurrentMilestone — fenced code block boundary (#2787)', () =>
].join('\n');
fs.writeFileSync(path.join(tmpDir, '.planning', 'ROADMAP.md'), roadmap);
fs.writeFileSync(path.join(tmpDir, '.planning', 'STATE.md'), '---\nmilestone: v3.0\n---\n\n# GSD State\n');
fs.writeFileSync(path.join(tmpDir, '.planning', 'STATE.md'), '---\nmilestone: v3.0\n---\n\n# MSD State\n');
const result = runGsdTools('roadmap analyze', tmpDir);
const result = runMsdTools('roadmap analyze', tmpDir);
assert.ok(result.success);
assert.strictEqual(JSON.parse(result.output).phase_count, 2, 'Both phases should be found; ```js line must not close fence');
});
@@ -219,9 +219,9 @@ describe('extractCurrentMilestone — fenced code block boundary (#2787)', () =>
].join('\n');
fs.writeFileSync(path.join(tmpDir, '.planning', 'ROADMAP.md'), roadmap);
fs.writeFileSync(path.join(tmpDir, '.planning', 'STATE.md'), '---\nmilestone: v1.1\n---\n\n# GSD State\n');
fs.writeFileSync(path.join(tmpDir, '.planning', 'STATE.md'), '---\nmilestone: v1.1\n---\n\n# MSD State\n');
const result = runGsdTools('roadmap get-phase 2', tmpDir);
const result = runMsdTools('roadmap get-phase 2', tmpDir);
assert.ok(result.success);
const output = JSON.parse(result.output);
assert.ok(output.found, 'Phase 2 should be found even after a fenced code block');
@@ -278,7 +278,7 @@ describe('#3164 — validate consistency: milestone-archive layout', () => {
test('no W006 warnings for phases that exist in .planning/milestones/v*-phases/', () => {
setupMilestoneArchiveProject(tmpDir, { milestone: 'v1.7', phases: ['64-secondary-grader-fix'], roadmapPhases: ['64'] });
const result = runGsdTools('validate consistency', tmpDir);
const result = runMsdTools('validate consistency', tmpDir);
assert.ok(result.success);
const w006 = (JSON.parse(result.output).warnings || []).filter(w => w.message.includes('Phase 64') && w.message.includes('no directory'));
@@ -288,7 +288,7 @@ describe('#3164 — validate consistency: milestone-archive layout', () => {
test('no W006 when multiple phases exist in milestone-archive layout', () => {
setupMilestoneArchiveProject(tmpDir, { milestone: 'v1.7', phases: ['48-feature-a', '51-feature-b', '64-feature-c'], roadmapPhases: ['48', '51', '64'] });
const result = runGsdTools('validate consistency', tmpDir);
const result = runMsdTools('validate consistency', tmpDir);
assert.ok(result.success);
const w006 = (JSON.parse(result.output).warnings || []).filter(w => w.message.includes('no directory'));
@@ -298,7 +298,7 @@ describe('#3164 — validate consistency: milestone-archive layout', () => {
test('prefixed archive dir names (CK-64-...) are recognized as phase 64', () => {
setupMilestoneArchiveProject(tmpDir, { milestone: 'v1.7', phases: ['CK-64-secondary-grader-fix'], roadmapPhases: ['64'] });
const result = runGsdTools('validate consistency', tmpDir);
const result = runMsdTools('validate consistency', tmpDir);
assert.ok(result.success);
const w006 = (JSON.parse(result.output).warnings || []).filter(w => w.message.includes('Phase 64') && w.message.includes('no directory'));
@@ -327,7 +327,7 @@ describe('#3164 — validate consistency: milestone-archive layout', () => {
'# Roadmap\n\n## Roadmap v1.7: Current\n\n### Phase 65: Current work\n\nGoal: test.\n',
);
const result = runGsdTools('validate consistency', tmpDir);
const result = runMsdTools('validate consistency', tmpDir);
assert.ok(result.success);
const out = JSON.parse(result.output);
@@ -370,7 +370,7 @@ describe('#3164 — validate health: milestone-archive layout', () => {
test('no W006 warnings for phases that exist in .planning/milestones/v*-phases/', () => {
setupMilestoneArchiveProject(tmpDir, { milestone: 'v1.7', phases: ['64-secondary-grader-fix'], roadmapPhases: ['64'] });
const result = runGsdTools('validate health', tmpDir);
const result = runMsdTools('validate health', tmpDir);
assert.ok(result.success);
const w006 = (JSON.parse(result.output).warnings || []).filter(w => {
@@ -390,7 +390,7 @@ describe('#3164 — find-phase: milestone-archive layout', () => {
test('find-phase 64 returns found:true for phase in .planning/milestones/v*-phases/', () => {
setupMilestoneArchiveProject(tmpDir, { milestone: 'v1.7', phases: ['64-secondary-grader-fix'], roadmapPhases: ['64'] });
const result = runGsdTools('find-phase 64', tmpDir);
const result = runMsdTools('find-phase 64', tmpDir);
assert.ok(result.success);
assert.strictEqual(JSON.parse(result.output).found, true);
});
@@ -407,7 +407,7 @@ describe('#3164 — find-phase: milestone-archive layout', () => {
fs.writeFileSync(path.join(v110, 'PLAN.md'), '# v1.10 plan\n');
fs.writeFileSync(path.join(v12, 'PLAN.md'), '# v1.2 plan\n');
const result = runGsdTools('find-phase 64', tmpDir);
const result = runMsdTools('find-phase 64', tmpDir);
assert.ok(result.success);
const out = JSON.parse(result.output);
assert.strictEqual(out.found, true);
@@ -417,7 +417,7 @@ describe('#3164 — find-phase: milestone-archive layout', () => {
test('find-phase not-found payload includes searched_directories', () => {
setupMilestoneArchiveProject(tmpDir, { milestone: 'v1.7', phases: ['64-secondary-grader-fix'], roadmapPhases: ['64'] });
const result = runGsdTools('find-phase 999', tmpDir);
const result = runMsdTools('find-phase 999', tmpDir);
assert.ok(result.success);
const out = JSON.parse(result.output);
assert.strictEqual(out.found, false);
@@ -471,7 +471,7 @@ describe('bug #3600: milestone phase filter understands project-code-prefixed di
ensurePhaseDir(tmpDir, 'CK-01-discovery');
ensurePhaseDir(tmpDir, 'CK-02-build');
const r = runGsdTools(['init', 'new-milestone'], tmpDir);
const r = runMsdTools(['init', 'new-milestone'], tmpDir);
assert.ok(r.success, `init new-milestone failed: ${r.error || r.output}`);
const payload = JSON.parse(r.output);
assert.strictEqual(payload.phase_dir_count, 2,
@@ -487,7 +487,7 @@ describe('bug #3600: milestone phase filter understands project-code-prefixed di
].join('\n'));
ensurePhaseDir(tmpDir, '01-first');
const r = runGsdTools(['init', 'new-milestone'], tmpDir);
const r = runMsdTools(['init', 'new-milestone'], tmpDir);
assert.ok(r.success);
assert.strictEqual(JSON.parse(r.output).phase_dir_count, 1);
});
@@ -502,7 +502,7 @@ describe('bug #3600: milestone phase filter understands project-code-prefixed di
].join('\n'));
ensurePhaseDir(tmpDir, 'PROJ-42');
const r = runGsdTools(['init', 'new-milestone'], tmpDir);
const r = runMsdTools(['init', 'new-milestone'], tmpDir);
assert.ok(r.success);
assert.strictEqual(JSON.parse(r.output).phase_dir_count, 1,
'PROJ-42 directory must still match Phase PROJ-42: via the custom-ID path');
@@ -520,7 +520,7 @@ describe('bug #3600: milestone phase filter understands project-code-prefixed di
ensurePhaseDir(tmpDir, 'CK-99-backlog');
ensurePhaseDir(tmpDir, 'CK-100-future');
const r = runGsdTools(['init', 'new-milestone'], tmpDir);
const r = runMsdTools(['init', 'new-milestone'], tmpDir);
assert.ok(r.success);
assert.strictEqual(JSON.parse(r.output).phase_dir_count, 1,
'only CK-01-first should match Phase 1; CK-99 and CK-100 must be excluded');
@@ -1096,7 +1096,7 @@ describe('#2142 review: README injection, symlink escape, dry-run/real-run parit
// directory OUTSIDE the planning root — must never be archived (moved) and
// its target must never be altered, for BOTH archival entry points.
function setupSymlinkEscape(t) {
const outsideDir = createTempProject('gsd-quick-escape-target-');
const outsideDir = createTempProject('msd-quick-escape-target-');
fs.writeFileSync(path.join(outsideDir, 'marker.txt'), 'do not touch\n');
const symlinkPath = path.join(tmpDir, '.planning', 'quick', '2026-10-02-escape-symlink');
fs.mkdirSync(path.dirname(symlinkPath), { recursive: true });
@@ -1239,7 +1239,7 @@ describe('#3597: milestone complete refuses to archive on a non-COMPLETE window
// window.
seedWorkstream(cwd, {
name: 'alpha',
state: '---\nmilestone: v1.0\n---\n\n# GSD State\n',
state: '---\nmilestone: v1.0\n---\n\n# MSD State\n',
active: true,
});
const alphaPhases = path.join(cwd, '.planning', 'workstreams', 'alpha', 'phases');
@@ -1297,7 +1297,7 @@ describe('#3597: milestone complete refuses to archive on a non-COMPLETE window
// real window scoping and not merely "archive everything present".
seedWorkstream(tmpDir, {
name: 'beta',
state: '---\nmilestone: v1.0\n---\n\n# GSD State\n',
state: '---\nmilestone: v1.0\n---\n\n# MSD State\n',
// #3597: a versioned `## v1.0 ...` heading is required for the window
// to resolve SCOPE.COMPLETE against the explicit `version` argument —
// a free-form roadmap (no versioned heading at all) resolves UNSCOPED