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

@@ -3,8 +3,8 @@
const { describe, test } = require('node:test');
const assert = require('node:assert/strict');
const { routeCjsCommandFamily, routeHubCommandFamily } = require('../gsd-core/bin/lib/cjs-command-router-adapter.cjs');
const { makeInvalidArgs } = require('../gsd-core/bin/lib/command-routing-hub.cjs');
const { routeCjsCommandFamily, routeHubCommandFamily } = require('../msd-core/bin/lib/cjs-command-router-adapter.cjs');
const { makeInvalidArgs } = require('../msd-core/bin/lib/command-routing-hub.cjs');
describe('cjs-command-router-adapter routeHubCommandFamily', () => {
test('routes known subcommand handler through the hub', () => {
@@ -261,9 +261,9 @@ const { describe, test, before } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('fs');
const path = require('path');
const { runGsdTools } = require('./helpers.cjs');
const { runMsdTools } = require('./helpers.cjs');
const GSD_TOOLS_SRC = path.join(__dirname, '..', 'gsd-core', 'bin', 'gsd-tools.cjs');
const MSD_TOOLS_SRC = path.join(__dirname, '..', 'msd-core', 'bin', 'msd-tools.cjs');
describe('bug #224: --pick stdout capture contract', () => {
let src;
@@ -272,11 +272,11 @@ describe('bug #224: --pick stdout capture contract', () => {
// allow-test-rule: structural-implementation-guard (see #224) — locks the
// main()-body byte-length seam contract structurally (no deterministic
// Windows repro harness yet); see block header above.
src = fs.readFileSync(GSD_TOOLS_SRC, 'utf-8');
src = fs.readFileSync(MSD_TOOLS_SRC, 'utf-8');
});
test('--pick output still succeeds for current-timestamp command', () => {
const result = runGsdTools(['current-timestamp', '--pick', 'timestamp']);
const result = runMsdTools(['current-timestamp', '--pick', 'timestamp']);
assert.strictEqual(result.success, true, result.error || 'expected command to succeed');
assert.match(result.output, /^\d{4}-\d{2}-\d{2}T/, 'expected ISO timestamp output');
});
@@ -305,23 +305,23 @@ describe('bug #224: --pick stdout capture contract', () => {
/**
* Regression tests for bug #3243.
*
* The CJS dispatcher (gsd-tools.cjs) must accept dotted canonical command
* The CJS dispatcher (msd-tools.cjs) must accept dotted canonical command
* form (e.g. `state.update`) as well as the spaced form (`state update`).
* Workflow markdown files emit `gsd-sdk query <domain>.<subcommand>` calls,
* Workflow markdown files emit `msd-sdk query <domain>.<subcommand>` calls,
* and any caller that bypasses the SDK (stale npm binary, direct shell-out,
* third-party script) would hit "Unknown command: <domain>.<subcommand>".
*
* The fix: a top-of-main() shim that splits args[0] on the first `.` when
* present and normalizes to the spaced form before the switch is reached.
*
* This test file uses runGsdTools() — never readFileSync + .includes().
* This test file uses runMsdTools() — never readFileSync + .includes().
*/
'use strict';
const { describe, test, beforeEach, afterEach } = require('node:test');
const assert = require('node:assert/strict');
const { runGsdTools, createTempProject, cleanup } = require('./helpers.cjs');
const { runMsdTools, createTempProject, cleanup } = require('./helpers.cjs');
describe('bug #3243: CJS dispatcher accepts dotted canonical command form', () => {
let tmpDir;
@@ -337,13 +337,13 @@ describe('bug #3243: CJS dispatcher accepts dotted canonical command form', () =
// ── generate-slug: no project structure needed, deterministic output ────
test('generate-slug.hello-world (dotted) produces the same slug as spaced form', () => {
const spaced = runGsdTools(['generate-slug', 'hello-world'], tmpDir);
const spaced = runMsdTools(['generate-slug', 'hello-world'], tmpDir);
assert.strictEqual(spaced.success, true, [
'control (spaced form) failed:',
spaced.error,
].join(' '));
const dotted = runGsdTools(['generate-slug.hello-world'], tmpDir);
const dotted = runMsdTools(['generate-slug.hello-world'], tmpDir);
// Before the fix this errors: "Unknown command: generate-slug.hello-world"
assert.strictEqual(dotted.success, true, [
'dotted form must not emit "Unknown command":',
@@ -354,13 +354,13 @@ describe('bug #3243: CJS dispatcher accepts dotted canonical command form', () =
});
test('current-timestamp.date (dotted) produces the same output as spaced form', () => {
const spaced = runGsdTools(['current-timestamp', 'date'], tmpDir);
const spaced = runMsdTools(['current-timestamp', 'date'], tmpDir);
assert.strictEqual(spaced.success, true, [
'control (spaced form) failed:',
spaced.error,
].join(' '));
const dotted = runGsdTools(['current-timestamp.date'], tmpDir);
const dotted = runMsdTools(['current-timestamp.date'], tmpDir);
assert.strictEqual(dotted.success, true, [
'dotted form must not emit "Unknown command":',
dotted.error,
@@ -372,7 +372,7 @@ describe('bug #3243: CJS dispatcher accepts dotted canonical command form', () =
// ── Commands with subcommands that need a project ────────────────────────
test('validate.plan (dotted) routes into validate handler, not "Unknown command"', () => {
const dotted = runGsdTools(['validate.plan'], tmpDir);
const dotted = runMsdTools(['validate.plan'], tmpDir);
// Before the fix: success=false, error contains "Unknown command: validate.plan"
// After the fix: success=false is still possible (validate needs a PLAN.md),
// but the error must NOT mention "Unknown command".
@@ -387,7 +387,7 @@ describe('bug #3243: CJS dispatcher accepts dotted canonical command form', () =
});
test('roadmap.analyze (dotted) routes into roadmap handler, not "Unknown command"', () => {
const dotted = runGsdTools(['roadmap.analyze'], tmpDir);
const dotted = runMsdTools(['roadmap.analyze'], tmpDir);
// success=true means it reached the handler (even if handler reports no ROADMAP.md).
// success=false means dispatcher rejected it — assert the error is NOT "Unknown command".
const errText = dotted.error || '';
@@ -401,7 +401,7 @@ describe('bug #3243: CJS dispatcher accepts dotted canonical command form', () =
});
test('phases.list (dotted) routes into phases handler, not "Unknown command"', () => {
const dotted = runGsdTools(['phases.list'], tmpDir);
const dotted = runMsdTools(['phases.list'], tmpDir);
const errText = dotted.error || '';
assert.ok(
!errText.includes('Unknown command: phases.list'),
@@ -415,7 +415,7 @@ describe('bug #3243: CJS dispatcher accepts dotted canonical command form', () =
// ── Multi-dot commands: split on first dot only ──────────────────────────
test('check.decision-coverage-plan (multi-dot-safe: first dot splits)', () => {
const dotted = runGsdTools(['check.decision-coverage-plan'], tmpDir);
const dotted = runMsdTools(['check.decision-coverage-plan'], tmpDir);
// "check" is not a known top-level command currently, so this will still
// fail — but the error must NOT say "Unknown command: check.decision-coverage-plan"
// (the dotted form); it should say something about "check" (the split result).
@@ -432,7 +432,7 @@ describe('bug #3243: CJS dispatcher accepts dotted canonical command form', () =
// ── Edge cases ────────────────────────────────────────────────────────────
test('command without dots is unchanged (existing behaviour preserved)', () => {
const result = runGsdTools(['generate-slug', 'no-dots-here'], tmpDir);
const result = runMsdTools(['generate-slug', 'no-dots-here'], tmpDir);
assert.strictEqual(result.success, true, [
'spaced-only invocation must still work:',
result.error,
@@ -444,7 +444,7 @@ describe('bug #3243: CJS dispatcher accepts dotted canonical command form', () =
// A leading dot in args[0] like ".hidden" has head="" (empty) after split,
// so the shim must reject it and fall through to the existing "Unknown command"
// path (not silently reroute to an empty-string command).
const result = runGsdTools(['.hidden'], tmpDir);
const result = runMsdTools(['.hidden'], tmpDir);
assert.strictEqual(result.success, false, 'leading-dot arg must not succeed');
});
@@ -453,7 +453,7 @@ describe('bug #3243: CJS dispatcher accepts dotted canonical command form', () =
test('"Unknown command" error for dotted form suggests spaced equivalent', () => {
// A genuinely unknown dotted command (e.g. "foo.bar") should include a
// "did you mean" hint pointing at the spaced form "foo bar".
const result = runGsdTools(['foo.bar'], tmpDir);
const result = runMsdTools(['foo.bar'], tmpDir);
assert.strictEqual(result.success, false, '"foo.bar" must fail');
assert.ok(
result.error.includes('foo bar'),
@@ -467,7 +467,7 @@ describe('bug #3243: CJS dispatcher accepts dotted canonical command form', () =
test('multi-dot unknown command suggestion uses first-dot split only (a.b.c → "a b.c")', () => {
// The shim splits only on the FIRST dot, so the suggestion must mirror that:
// "a.b.c" → head="a", rest="b.c" → suggest "a b.c", NOT "a b c".
const result = runGsdTools(['a.b.c'], tmpDir);
const result = runMsdTools(['a.b.c'], tmpDir);
assert.strictEqual(result.success, false, '"a.b.c" must fail');
assert.ok(
result.error.includes('a b.c'),
@@ -524,13 +524,13 @@ const { execFileSync } = require('node:child_process');
const { cleanup } = require('./helpers.cjs');
const { PROBE_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
const GSD_TOOLS = path.resolve(__dirname, '..', 'gsd-core', 'bin', 'gsd-tools.cjs');
const MSD_TOOLS = path.resolve(__dirname, '..', 'msd-core', 'bin', 'msd-tools.cjs');
function run(args, cwd) {
try {
return {
ok: true,
stdout: execFileSync(process.execPath, [GSD_TOOLS, ...args], {
stdout: execFileSync(process.execPath, [MSD_TOOLS, ...args], {
cwd,
encoding: 'utf-8',
timeout: PROBE_TIMEOUT_MS,
@@ -547,7 +547,7 @@ function run(args, cwd) {
}
function makeFixture() {
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-3631-'));
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-3631-'));
const planning = path.join(tmp, '.planning');
fs.mkdirSync(path.join(planning, 'phases'), { recursive: true });
fs.writeFileSync(
@@ -638,26 +638,26 @@ describe('bug #3631 — SDK family routers forward --raw to output()', () => {
// Regression for #2620 — the live adapter must inject a real DispatchLogger
// (ADR-0174 §6: "DispatchLogger is injected; the Hub emits DispatchEvent on
// every dispatch path"). Before the fix, routeHubCommandFamily built the Hub
// with no logger, so it fell back to createNoOpLogger and GSD_AUDIT was inert.
// with no logger, so it fell back to createNoOpLogger and MSD_AUDIT was inert.
// ────────────────────────────────────────────────────────────────────────
{
const { describe, test } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const { routeHubCommandFamily } = require('../gsd-core/bin/lib/cjs-command-router-adapter.cjs');
const { routeHubCommandFamily } = require('../msd-core/bin/lib/cjs-command-router-adapter.cjs');
const { createTempDir, cleanup } = require('./helpers.cjs');
describe('cjs-command-router-adapter — observability logger wiring (#2620)', () => {
test('a dispatch through the live adapter writes the opt-in audit trail when GSD_AUDIT=1', (t) => {
const tmp = createTempDir('gsd-obs-wire-');
const prev = process.env.GSD_AUDIT;
test('a dispatch through the live adapter writes the opt-in audit trail when MSD_AUDIT=1', (t) => {
const tmp = createTempDir('msd-obs-wire-');
const prev = process.env.MSD_AUDIT;
t.after(() => {
if (prev === undefined) delete process.env.GSD_AUDIT;
else process.env.GSD_AUDIT = prev;
if (prev === undefined) delete process.env.MSD_AUDIT;
else process.env.MSD_AUDIT = prev;
cleanup(tmp);
});
process.env.GSD_AUDIT = '1';
process.env.MSD_AUDIT = '1';
routeHubCommandFamily({
family: 'unit',
@@ -670,10 +670,10 @@ describe('bug #3631 — SDK family routers forward --raw to output()', () => {
raw: false,
});
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 adapter must build the Hub with a real DispatchLogger (ADR-0174 §6), not createNoOpLogger'
'MSD_AUDIT=1 must produce .planning/.msd-trace.jsonl — the adapter 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);
assert.ok(lines.length > 0, 'at least one dispatch event must be recorded');