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

@@ -20,18 +20,18 @@
const { describe, test, before, after } = require('node:test');
const assert = require('node:assert/strict');
const { routePhaseCommand } = require('../gsd-core/bin/lib/phase-command-router.cjs');
const { routePhaseCommand } = require('../msd-core/bin/lib/phase-command-router.cjs');
// Force CJS path throughout: set GSD_WORKSTREAM so tryLoadSdk() is bypassed.
// Force CJS path throughout: set MSD_WORKSTREAM so tryLoadSdk() is bypassed.
// This makes unit-level assertions deterministic regardless of SDK build state.
let _prevWorkstream;
before(() => {
_prevWorkstream = process.env.GSD_WORKSTREAM;
process.env.GSD_WORKSTREAM = 'test-unit';
_prevWorkstream = process.env.MSD_WORKSTREAM;
process.env.MSD_WORKSTREAM = 'test-unit';
});
after(() => {
if (_prevWorkstream === undefined) delete process.env.GSD_WORKSTREAM;
else process.env.GSD_WORKSTREAM = _prevWorkstream;
if (_prevWorkstream === undefined) delete process.env.MSD_WORKSTREAM;
else process.env.MSD_WORKSTREAM = _prevWorkstream;
});
// ─── Helper: build a minimal phase stub ──────────────────────────────────────
@@ -432,21 +432,21 @@ describe('phase-command-router — integration: real hub + CJS phase handler', (
'use strict';
/**
* Regression tests for `gsd-tools query phase.list-plans <N>` (#1437).
* Regression tests for `msd-tools query phase.list-plans <N>` (#1437).
*
* Prior to this fix, `phase.list-plans` was not registered in the
* phase-command-router, so any invocation produced:
* "Error: Unknown phase subcommand. Available: uat-passed, next-decimal, ..."
*
* These tests exercise the full dispatch path:
* gsd-tools → phase-command-router → phase.cmdPhaseListPlans
* msd-tools → phase-command-router → phase.cmdPhaseListPlans
*/
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 { runGsdTools, createTempProject, cleanup } = require('./helpers.cjs');
const { runMsdTools, createTempProject, cleanup } = require('./helpers.cjs');
// ─── Fixture helpers ──────────────────────────────────────────────────────────
@@ -481,14 +481,14 @@ function touch(dir, ...files) {
let tmpDir;
let phaseDir;
// Consolidation #1969: the host suite forces GSD_WORKSTREAM=test-unit, which
// runGsdTools propagates into child processes and redirects the project lookup.
// Consolidation #1969: the host suite forces MSD_WORKSTREAM=test-unit, which
// runMsdTools propagates into child processes and redirects the project lookup.
// Clear it for these tests (unset when this file ran standalone); restore after.
let __savedWorkstream;
beforeEach(() => {
__savedWorkstream = process.env.GSD_WORKSTREAM;
delete process.env.GSD_WORKSTREAM;
__savedWorkstream = process.env.MSD_WORKSTREAM;
delete process.env.MSD_WORKSTREAM;
const proj = setupProject('01-feature');
tmpDir = proj.tmpDir;
phaseDir = proj.phaseDir;
@@ -496,14 +496,14 @@ beforeEach(() => {
afterEach(() => {
cleanup(tmpDir);
if (__savedWorkstream === undefined) delete process.env.GSD_WORKSTREAM;
else process.env.GSD_WORKSTREAM = __savedWorkstream;
if (__savedWorkstream === undefined) delete process.env.MSD_WORKSTREAM;
else process.env.MSD_WORKSTREAM = __savedWorkstream;
});
describe('bug-1437 — phase.list-plans is wired in gsd-tools', () => {
describe('bug-1437 — phase.list-plans is wired in msd-tools', () => {
test('command no longer returns Unknown phase subcommand error', () => {
touch(phaseDir, '01-01-PLAN.md');
const result = runGsdTools(['query', 'phase.list-plans', '1'], tmpDir);
const result = runMsdTools(['query', 'phase.list-plans', '1'], tmpDir);
// Previously this would fail with "Unknown phase subcommand"
assert.ok(result.success, `Command failed: ${result.error}\nOutput: ${result.output}`);
assert.ok(!result.error || !result.error.includes('Unknown phase subcommand'),
@@ -512,7 +512,7 @@ describe('bug-1437 — phase.list-plans is wired in gsd-tools', () => {
test('returns JSON with plan_count and plans array when plans exist', () => {
touch(phaseDir, '01-01-PLAN.md', '01-02-PLAN.md');
const result = runGsdTools(['query', 'phase.list-plans', '1', '--raw'], tmpDir);
const result = runMsdTools(['query', 'phase.list-plans', '1', '--raw'], tmpDir);
assert.ok(result.success, `Command failed: ${result.error}\nOutput: ${result.output}`);
const data = JSON.parse(result.output);
assert.equal(data.plan_count, 2, 'plan_count should be 2');
@@ -524,7 +524,7 @@ describe('bug-1437 — phase.list-plans is wired in gsd-tools', () => {
test('returns plan_count 0 and empty plans array when phase has no plan files', () => {
// Phase directory exists but has no *-PLAN.md files
touch(phaseDir, 'CONTEXT.md');
const result = runGsdTools(['query', 'phase.list-plans', '1', '--raw'], tmpDir);
const result = runMsdTools(['query', 'phase.list-plans', '1', '--raw'], tmpDir);
assert.ok(result.success, `Command failed: ${result.error}\nOutput: ${result.output}`);
const data = JSON.parse(result.output);
assert.equal(data.plan_count, 0);
@@ -534,7 +534,7 @@ describe('bug-1437 — phase.list-plans is wired in gsd-tools', () => {
test('returns has_plans false when phase number is not found', () => {
// Phase 99 does not exist in the fixture
const result = runGsdTools(['query', 'phase.list-plans', '99', '--raw'], tmpDir);
const result = runMsdTools(['query', 'phase.list-plans', '99', '--raw'], tmpDir);
assert.ok(result.success, `Command failed: ${result.error}\nOutput: ${result.output}`);
const data = JSON.parse(result.output);
assert.equal(data.has_plans, false);
@@ -543,7 +543,7 @@ describe('bug-1437 — phase.list-plans is wired in gsd-tools', () => {
test('plan paths are relative to project root and posix-style', () => {
touch(phaseDir, '01-01-PLAN.md');
const result = runGsdTools(['query', 'phase.list-plans', '1', '--raw'], tmpDir);
const result = runMsdTools(['query', 'phase.list-plans', '1', '--raw'], tmpDir);
assert.ok(result.success, `Command failed: ${result.error}\nOutput: ${result.output}`);
const data = JSON.parse(result.output);
assert.equal(data.plans.length, 1);
@@ -556,7 +556,7 @@ describe('bug-1437 — phase.list-plans is wired in gsd-tools', () => {
test('dotted form phase.list-plans (without query prefix) also works', () => {
touch(phaseDir, '01-01-PLAN.md');
const result = runGsdTools(['phase.list-plans', '1', '--raw'], tmpDir);
const result = runMsdTools(['phase.list-plans', '1', '--raw'], tmpDir);
assert.ok(result.success, `Command failed: ${result.error}\nOutput: ${result.output}`);
const data = JSON.parse(result.output);
assert.equal(data.plan_count, 1);
@@ -577,15 +577,15 @@ describe('bug-1437 — phase.list-plans is wired in gsd-tools', () => {
const { createTempDir, cleanup } = require('./helpers.cjs');
describe('phase-command-router — observability logger wiring (#2620)', () => {
test('a dispatch through the phase seam writes the opt-in audit trail when GSD_AUDIT=1', (t) => {
const tmp = createTempDir('gsd-obs-phase-');
const prevAudit = process.env.GSD_AUDIT;
test('a dispatch through the phase seam writes the opt-in audit trail when MSD_AUDIT=1', (t) => {
const tmp = createTempDir('msd-obs-phase-');
const prevAudit = process.env.MSD_AUDIT;
t.after(() => {
if (prevAudit === undefined) delete process.env.GSD_AUDIT;
else process.env.GSD_AUDIT = prevAudit;
if (prevAudit === undefined) delete process.env.MSD_AUDIT;
else process.env.MSD_AUDIT = prevAudit;
cleanup(tmp);
});
process.env.GSD_AUDIT = '1';
process.env.MSD_AUDIT = '1';
const phase = makePhase({ cmdPhaseNextDecimal: () => {} });
routePhaseCommand({
@@ -596,10 +596,10 @@ describe('bug-1437 — phase.list-plans is wired in gsd-tools', () => {
error: (m) => { throw new Error(m); },
});
const auditPath = path.join(tmp, '.planning', '.gsd-trace.jsonl');
const auditPath = path.join(tmp, '.planning', '.msd-trace.jsonl');
assert.ok(
fs.existsSync(auditPath),
'GSD_AUDIT=1 must produce .planning/.gsd-trace.jsonl — the phase router must build the Hub with a real DispatchLogger (ADR-0174 §6), not createNoOpLogger'
'MSD_AUDIT=1 must produce .planning/.msd-trace.jsonl — the phase router must build the Hub with a real DispatchLogger (ADR-0174 §6), not createNoOpLogger'
);
const lines = fs.readFileSync(auditPath, 'utf8').trim().split(/\r?\n/).filter(Boolean);
@@ -613,15 +613,15 @@ describe('bug-1437 — phase.list-plans is wired in gsd-tools', () => {
assert.ok(typeof event.timestamp === 'string' && event.timestamp.length > 0, 'event carries an ISO timestamp');
});
test('no audit trail is written when GSD_AUDIT is unset (Hub stays silent via the no-op fallback)', (t) => {
const tmp = createTempDir('gsd-obs-phase-off-');
const prevAudit = process.env.GSD_AUDIT;
test('no audit trail is written when MSD_AUDIT is unset (Hub stays silent via the no-op fallback)', (t) => {
const tmp = createTempDir('msd-obs-phase-off-');
const prevAudit = process.env.MSD_AUDIT;
t.after(() => {
if (prevAudit === undefined) delete process.env.GSD_AUDIT;
else process.env.GSD_AUDIT = prevAudit;
if (prevAudit === undefined) delete process.env.MSD_AUDIT;
else process.env.MSD_AUDIT = prevAudit;
cleanup(tmp);
});
delete process.env.GSD_AUDIT;
delete process.env.MSD_AUDIT;
const phase = makePhase({ cmdPhaseNextDecimal: () => {} });
routePhaseCommand({
@@ -633,7 +633,7 @@ describe('bug-1437 — phase.list-plans is wired in gsd-tools', () => {
});
assert.equal(
fs.existsSync(path.join(tmp, '.planning', '.gsd-trace.jsonl')),
fs.existsSync(path.join(tmp, '.planning', '.msd-trace.jsonl')),
false,
'without the opt-in signal the seam must leave no audit artifact'
);