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,8 +2,8 @@
* Tests for Phase 7 (#3217, ADR-3180 §7.6 rules 3-4): a derivation whose
* scope is not COMPLETE renders no percentage at all.
*
* Design: .gsd/phase/refactor-3217-completion-ratio-scoping/40-design.md
* Test matrix: .gsd/phase/refactor-3217-completion-ratio-scoping/50-test-matrix.md
* Design: .msd/phase/refactor-3217-completion-ratio-scoping/40-design.md
* Test matrix: .msd/phase/refactor-3217-completion-ratio-scoping/50-test-matrix.md
*
* Section A asserts at each CONSUMER's observable output (ADR Decision 4c),
* never at a helper's return value — a percentage post-filtered after the
@@ -30,11 +30,11 @@ const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const { createTempDir, cleanup, runGsdTools } = require('./helpers.cjs');
const { createTempDir, cleanup, runMsdTools } = require('./helpers.cjs');
const drift = require('../scripts/lint-completion-ratio-drift.cjs');
const { clampPercent } = require('../gsd-core/bin/lib/phase-lifecycle.cjs');
const { computeProgressPercent } = require('../gsd-core/bin/lib/state-document.cjs');
const { SCOPE } = require('../gsd-core/bin/lib/planning-scope.cjs');
const { clampPercent } = require('../msd-core/bin/lib/phase-lifecycle.cjs');
const { computeProgressPercent } = require('../msd-core/bin/lib/state-document.cjs');
const { SCOPE } = require('../msd-core/bin/lib/planning-scope.cjs');
const REPO_ROOT = path.join(__dirname, '..');
@@ -127,31 +127,31 @@ function buildUnreadableFixture(cwd) {
}
function analyzeRaw(cwd) {
const result = runGsdTools(['roadmap', 'analyze', '--cwd', cwd, '--raw'], cwd);
const result = runMsdTools(['roadmap', 'analyze', '--cwd', cwd, '--raw'], cwd);
assert.strictEqual(result.success, true, result.error);
return JSON.parse(result.output);
}
function queryProgressRaw(cwd) {
const result = runGsdTools(['query', 'progress', '--cwd', cwd, '--raw'], cwd);
const result = runMsdTools(['query', 'progress', '--cwd', cwd, '--raw'], cwd);
assert.strictEqual(result.success, true, result.error);
return JSON.parse(result.output);
}
function statsRaw(cwd) {
const result = runGsdTools(['stats', '--cwd', cwd, '--raw'], cwd);
const result = runMsdTools(['stats', '--cwd', cwd, '--raw'], cwd);
assert.strictEqual(result.success, true, result.error);
return JSON.parse(result.output);
}
function stateUpdateProgressRaw(cwd) {
const result = runGsdTools(['state', 'update-progress', '--cwd', cwd, '--raw'], cwd);
const result = runMsdTools(['state', 'update-progress', '--cwd', cwd, '--raw'], cwd);
assert.strictEqual(result.success, true, result.error);
return result.output;
}
function stateJsonRaw(cwd) {
const result = runGsdTools(['state', 'json', '--cwd', cwd, '--raw'], cwd);
const result = runMsdTools(['state', 'json', '--cwd', cwd, '--raw'], cwd);
assert.strictEqual(result.success, true, result.error);
return JSON.parse(result.output);
}
@@ -162,7 +162,7 @@ function stateJsonRaw(cwd) {
describe('A. rule 4 — a non-COMPLETE scope renders no percentage, at the CLI surface', () => {
test('A1: roadmap analyze --json, COMPLETE scope -> numeric progress_percent', (t) => {
const cwd = createTempDir('gsd-3217-a1-');
const cwd = createTempDir('msd-3217-a1-');
t.after(() => cleanup(cwd));
buildCompleteFixture(cwd);
const analyzed = analyzeRaw(cwd);
@@ -176,7 +176,7 @@ describe('A. rule 4 — a non-COMPLETE scope renders no percentage, at the CLI s
});
test('A2: roadmap analyze --json, TRUNCATED scope -> progress_percent: null (never 0, never 100)', (t) => {
const cwd = createTempDir('gsd-3217-a2-');
const cwd = createTempDir('msd-3217-a2-');
t.after(() => cleanup(cwd));
buildTruncatedFixture(cwd);
const analyzed = analyzeRaw(cwd);
@@ -187,7 +187,7 @@ describe('A. rule 4 — a non-COMPLETE scope renders no percentage, at the CLI s
});
test('A3: roadmap analyze --json, UNSCOPED scope -> progress_percent: null', (t) => {
const cwd = createTempDir('gsd-3217-a3-');
const cwd = createTempDir('msd-3217-a3-');
t.after(() => cleanup(cwd));
buildUnscopedFixture(cwd);
const analyzed = analyzeRaw(cwd);
@@ -196,7 +196,7 @@ describe('A. rule 4 — a non-COMPLETE scope renders no percentage, at the CLI s
});
test('A4: roadmap analyze --json, UNREADABLE phases dir -> progress_percent: null', (t) => {
const cwd = createTempDir('gsd-3217-a4-');
const cwd = createTempDir('msd-3217-a4-');
t.after(() => cleanup(cwd));
buildUnreadableFixture(cwd);
const analyzed = analyzeRaw(cwd);
@@ -212,7 +212,7 @@ describe('A. rule 4 — a non-COMPLETE scope renders no percentage, at the CLI s
});
test('A5: query progress, non-COMPLETE scope -> percent: null, no number rendered', (t) => {
const cwd = createTempDir('gsd-3217-a5-');
const cwd = createTempDir('msd-3217-a5-');
t.after(() => cleanup(cwd));
buildTruncatedFixture(cwd);
const rendered = queryProgressRaw(cwd);
@@ -221,7 +221,7 @@ describe('A. rule 4 — a non-COMPLETE scope renders no percentage, at the CLI s
});
test('A6: stats, non-COMPLETE scope -> percent: null and plan_percent: null', (t) => {
const cwd = createTempDir('gsd-3217-a6-');
const cwd = createTempDir('msd-3217-a6-');
t.after(() => cleanup(cwd));
buildTruncatedFixture(cwd);
const stats = statsRaw(cwd);
@@ -231,7 +231,7 @@ describe('A. rule 4 — a non-COMPLETE scope renders no percentage, at the CLI s
});
test('A7: state update-progress, non-COMPLETE scope -> STATE.md Progress line untouched, no percentage written', (t) => {
const cwd = createTempDir('gsd-3217-a7-');
const cwd = createTempDir('msd-3217-a7-');
t.after(() => cleanup(cwd));
buildUnscopedFixture(cwd);
const statePath = path.join(planningDirOf(cwd), 'STATE.md');
@@ -266,7 +266,7 @@ describe('A. rule 4 — a non-COMPLETE scope renders no percentage, at the CLI s
});
test('A9: cross-surface — one non-COMPLETE fixture, none of roadmap analyze / query progress / stats renders a number', (t) => {
const cwd = createTempDir('gsd-3217-a9-');
const cwd = createTempDir('msd-3217-a9-');
t.after(() => cleanup(cwd));
buildTruncatedFixture(cwd);
@@ -285,7 +285,7 @@ describe('A. rule 4 — a non-COMPLETE scope renders no percentage, at the CLI s
});
test('A10: state json --raw, UNREADABLE phases dir -> progress.percent is ABSENT (not 0, not null-valued)', (t) => {
const cwd = createTempDir('gsd-3217-a10-');
const cwd = createTempDir('msd-3217-a10-');
t.after(() => cleanup(cwd));
buildUnreadableFixture(cwd);
@@ -301,7 +301,7 @@ describe('A. rule 4 — a non-COMPLETE scope renders no percentage, at the CLI s
});
test('A11 (finding-1 repro): one genuinely UNREADABLE-phases-dir fixture — state json / roadmap analyze / stats / query progress / state update-progress ALL withhold, none renders a number', (t) => {
const cwd = createTempDir('gsd-3217-a11-');
const cwd = createTempDir('msd-3217-a11-');
t.after(() => cleanup(cwd));
buildUnreadableFixture(cwd);
const statePath = path.join(planningDirOf(cwd), 'STATE.md');
@@ -333,7 +333,7 @@ describe('A. rule 4 — a non-COMPLETE scope renders no percentage, at the CLI s
describe('B. negative space — a REAL 0 under COMPLETE must still render', () => {
test('B1: COMPLETE scope, zero phases in a freshly-declared milestone -> 0, rendered (not withheld)', (t) => {
const cwd = createTempDir('gsd-3217-b1-');
const cwd = createTempDir('msd-3217-b1-');
t.after(() => cleanup(cwd));
writeState(cwd, { milestone: 'v1.0' });
writeRoadmap(cwd, ['## v1.0 Current 🚧', ''].join('\n'));
@@ -349,7 +349,7 @@ describe('B. negative space — a REAL 0 under COMPLETE must still render', () =
});
test('B2: COMPLETE scope, denominator 0 (plans exist in no phase) -> 0 (rule 2, unchanged)', (t) => {
const cwd = createTempDir('gsd-3217-b2-');
const cwd = createTempDir('msd-3217-b2-');
t.after(() => cleanup(cwd));
writeState(cwd, { milestone: 'v1.0' });
writeRoadmap(cwd, ['## v1.0 Current 🚧', '', '### Phase 1: Foo'].join('\n'));
@@ -363,7 +363,7 @@ describe('B. negative space — a REAL 0 under COMPLETE must still render', () =
});
test('B3: COMPLETE scope, all phases complete -> 100', (t) => {
const cwd = createTempDir('gsd-3217-b3-');
const cwd = createTempDir('msd-3217-b3-');
t.after(() => cleanup(cwd));
writeState(cwd, { milestone: 'v1.0' });
writeRoadmap(cwd, ['## v1.0 Current 🚧', '', '### Phase 1: Foo'].join('\n'));
@@ -376,7 +376,7 @@ describe('B. negative space — a REAL 0 under COMPLETE must still render', () =
});
test('B4: a free-form legacy ROADMAP is COMPLETE for windowing (§7.1) — its percentage must NOT be lost', (t) => {
const cwd = createTempDir('gsd-3217-b4-');
const cwd = createTempDir('msd-3217-b4-');
t.after(() => cleanup(cwd));
// No STATE.md, no versioned milestone headings at all — the classic
// free-form legacy shape (classifyMilestoneWindow row 3).
@@ -392,7 +392,7 @@ describe('B. negative space — a REAL 0 under COMPLETE must still render', () =
});
test('B5: boundary on the denominator under COMPLETE: 0, 1, >1', (t) => {
const cwd = createTempDir('gsd-3217-b5-');
const cwd = createTempDir('msd-3217-b5-');
t.after(() => cleanup(cwd));
writeState(cwd, { milestone: 'v1.0' });
writeRoadmap(cwd, ['## v1.0 Current 🚧', '', '### Phase 1: Foo'].join('\n'));
@@ -412,7 +412,7 @@ describe('B. negative space — a REAL 0 under COMPLETE must still render', () =
});
test('B6: null vs 0 are distinguishable by a typed consumer', (t) => {
const cwd = createTempDir('gsd-3217-b6-');
const cwd = createTempDir('msd-3217-b6-');
t.after(() => cleanup(cwd));
writeState(cwd, { milestone: 'v1.0' });
writeRoadmap(cwd, ['## v1.0 Current 🚧', ''].join('\n'));
@@ -422,7 +422,7 @@ describe('B. negative space — a REAL 0 under COMPLETE must still render', () =
assert.notStrictEqual(zeroCase.progress_percent, null);
cleanup(cwd);
const cwd2 = createTempDir('gsd-3217-b6b-');
const cwd2 = createTempDir('msd-3217-b6b-');
t.after(() => cleanup(cwd2));
buildTruncatedFixture(cwd2);
const nullCase = analyzeRaw(cwd2);
@@ -463,7 +463,7 @@ describe('C. rule 3 at roadmap analyze — progress_percent routed through listM
}
test('C1 + C3: numerator/denominator are the listMilestonePhaseDirs-scoped set only — no inflation from backlog or out-of-window dirs', (t) => {
const cwd = createTempDir('gsd-3217-c1c3-');
const cwd = createTempDir('msd-3217-c1c3-');
t.after(() => cleanup(cwd));
buildScopedFixture(cwd);
@@ -477,7 +477,7 @@ describe('C. rule 3 at roadmap analyze — progress_percent routed through listM
});
test('C2: roadmap analyze vs stats vs query progress on one fixture report the SAME percentage', (t) => {
const cwd = createTempDir('gsd-3217-c2-');
const cwd = createTempDir('msd-3217-c2-');
t.after(() => cleanup(cwd));
buildScopedFixture(cwd);
@@ -534,7 +534,7 @@ describe('D. computeProgressPercent — scope-required signature', () => {
describe('E. Tier-2 regression surface', () => {
test('E1: a consumer parsing progress_percent as always-numeric must now handle null — pins the new nullable contract', (t) => {
const cwd = createTempDir('gsd-3217-e1-');
const cwd = createTempDir('msd-3217-e1-');
t.after(() => cleanup(cwd));
buildTruncatedFixture(cwd);
const analyzed = analyzeRaw(cwd);
@@ -551,7 +551,7 @@ describe('E. Tier-2 regression surface', () => {
// Reuses that file's own fixture shape (a clean single-milestone project)
// to confirm this phase's routing change does not alter the COMPLETE
// case those pre-existing tests assert on.
const cwd = createTempDir('gsd-3217-e2-');
const cwd = createTempDir('msd-3217-e2-');
t.after(() => cleanup(cwd));
buildCompleteFixture(cwd);
const analyzed = analyzeRaw(cwd);
@@ -643,7 +643,7 @@ function appendSyncableBody(cwd, initialPercent) {
statePath,
existing + [
'',
'# GSD State',
'# MSD State',
'',
'## Configuration',
'Total Plans in Phase: 1',
@@ -655,14 +655,14 @@ function appendSyncableBody(cwd, initialPercent) {
}
function stateSyncRaw(cwd) {
const result = runGsdTools(['state', 'sync', '--cwd', cwd, '--raw'], cwd);
const result = runMsdTools(['state', 'sync', '--cwd', cwd, '--raw'], cwd);
assert.strictEqual(result.success, true, result.error);
return JSON.parse(result.output);
}
describe('F. state sync (cmdStateSync) — BLOCKER: withhold on a non-COMPLETE scope, never fabricate', () => {
test('F1: TRUNCATED window — no Progress rewrite, a skip entry appears in changes, body carries no fabricated percent', (t) => {
const cwd = createTempDir('gsd-3217-f1-');
const cwd = createTempDir('msd-3217-f1-');
t.after(() => cleanup(cwd));
buildTruncatedFixtureWithPhaseDir(cwd);
appendSyncableBody(cwd, '0%');
@@ -685,7 +685,7 @@ describe('F. state sync (cmdStateSync) — BLOCKER: withhold on a non-COMPLETE s
});
test('F2: UNSCOPED row 4 (no milestone asserted, ROADMAP has versioned headings) — same withholding', (t) => {
const cwd = createTempDir('gsd-3217-f2-');
const cwd = createTempDir('msd-3217-f2-');
t.after(() => cleanup(cwd));
buildUnscopedRow4Fixture(cwd);
appendSyncableBody(cwd, '0%');
@@ -704,7 +704,7 @@ describe('F. state sync (cmdStateSync) — BLOCKER: withhold on a non-COMPLETE s
});
test('F3: UNSCOPED row 5 (asserted version with no matching heading) — unchanged: the pre-existing #1761 guard still fires first', (t) => {
const cwd = createTempDir('gsd-3217-f3-');
const cwd = createTempDir('msd-3217-f3-');
t.after(() => cleanup(cwd));
buildUnscopedFixture(cwd);
appendSyncableBody(cwd, '0%');
@@ -721,7 +721,7 @@ describe('F. state sync (cmdStateSync) — BLOCKER: withhold on a non-COMPLETE s
});
test('F4: COMPLETE scope, genuine 0 — still WRITTEN (over-withholding guard)', (t) => {
const cwd = createTempDir('gsd-3217-f4-');
const cwd = createTempDir('msd-3217-f4-');
t.after(() => cleanup(cwd));
buildSyncCompleteZeroFixture(cwd);
appendSyncableBody(cwd, '100%');
@@ -741,7 +741,7 @@ describe('F. state sync (cmdStateSync) — BLOCKER: withhold on a non-COMPLETE s
describe('G. cross-surface — one non-COMPLETE fixture, ALL FIVE surfaces withhold (the assertion that would have caught the defect)', () => {
test('G1: state sync / state json / roadmap analyze / stats / query progress all agree on withholding', (t) => {
const cwd = createTempDir('gsd-3217-g1-');
const cwd = createTempDir('msd-3217-g1-');
t.after(() => cleanup(cwd));
buildTruncatedFixtureWithPhaseDir(cwd);
appendSyncableBody(cwd, '0%');
@@ -771,7 +771,7 @@ describe('G. cross-surface — one non-COMPLETE fixture, ALL FIVE surfaces withh
describe('H. self-consistency — after state sync, STATE.md body and frontmatter never contradict each other', () => {
test('H1: non-COMPLETE scope — body carries no fabricated percent AND frontmatter progress: carries no percent key', (t) => {
const cwd = createTempDir('gsd-3217-h1-');
const cwd = createTempDir('msd-3217-h1-');
t.after(() => cleanup(cwd));
buildTruncatedFixtureWithPhaseDir(cwd);
appendSyncableBody(cwd, '0%');
@@ -820,12 +820,12 @@ describe('H. self-consistency — after state sync, STATE.md body and frontmatte
// percentage — but only because the numerator (workstream-scoped phase dirs)
// and the window (root-scoped) were drawn from two different scoped sets
// (rule 3 violation). The fix defaults `ws` to `undefined` so it inherits the
// same ambient GSD_WORKSTREAM resolution as phasesDir.
// same ambient MSD_WORKSTREAM resolution as phasesDir.
// ═════════════════════════════════════════════════════════════════════════
describe('I. workstream scoping (#3597) — --ws <name> progress reads the WORKSTREAM roadmap, not root', () => {
test('I1: workstream with its own ROADMAP and no root ROADMAP.md -> phase_scope COMPLETE, percent numeric', (t) => {
const cwd = createTempDir('gsd-3597-i1-');
const cwd = createTempDir('msd-3597-i1-');
t.after(() => cleanup(cwd));
// No root .planning/ROADMAP.md at all — mirrors `workstream create`
@@ -846,7 +846,7 @@ describe('I. workstream scoping (#3597) — --ws <name> progress reads the WORKS
assert.ok(fs.existsSync(wsPlanningDir), 'sanity: workstream planning dir was created');
assert.ok(!fs.existsSync(path.join(planningDirOf(cwd), 'ROADMAP.md')), 'sanity: no root ROADMAP.md exists');
const result = runGsdTools(['--ws', 'alpha', 'progress', '--cwd', cwd, '--raw'], cwd);
const result = runMsdTools(['--ws', 'alpha', 'progress', '--cwd', cwd, '--raw'], cwd);
assert.strictEqual(result.success, true, result.error);
const rendered = JSON.parse(result.output);