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,7 +3,7 @@
* graphify-command-cutover.test.cjs — ADR-959 phase 4d-impl-2 equivalence tests.
*
* Verifies that the `graphify` command family, after cutover from the hardcoded
* `case 'graphify':` arm in gsd-tools.cjs to the capability registry dispatch
* `case 'graphify':` arm in msd-tools.cjs to the capability registry dispatch
* path (default → dispatchCapabilityCommand → graphify-command-router.cjs →
* routeGraphifyCommand), behaves identically to the old inline case.
*
@@ -20,29 +20,29 @@ const { describe, test, beforeEach, afterEach } = require('node:test');
const assert = require('node:assert/strict');
const path = require('node:path');
const { runGsdTools, createTempProject, cleanup } = require('./helpers.cjs');
const { runMsdTools, createTempProject, cleanup } = require('./helpers.cjs');
const {
enableGraphify,
writeGraphJson,
SAMPLE_GRAPH,
} = require('./helpers/graphify.cjs');
const registry = require('../gsd-core/bin/lib/capability-registry.cjs');
const { routeGraphifyCommand } = require('../gsd-core/bin/lib/graphify-command-router.cjs');
const registry = require('../msd-core/bin/lib/capability-registry.cjs');
const { routeGraphifyCommand } = require('../msd-core/bin/lib/graphify-command-router.cjs');
// ─── helpers ────────────────────────────────────────────────────────────────
function runJsonErrors(args, tmpDir, env = {}) {
const result = runGsdTools(args, tmpDir, { ...env, GSD_JSON_ERRORS: '1' });
const result = runMsdTools(args, tmpDir, { ...env, MSD_JSON_ERRORS: '1' });
assert.strictEqual(result.success, false,
`Expected failure with GSD_JSON_ERRORS=1 for args: ${args.join(' ')}\n` +
`Expected failure with MSD_JSON_ERRORS=1 for args: ${args.join(' ')}\n` +
`stdout: ${result.output}\nstderr: ${result.error}`);
let parsed;
try {
parsed = JSON.parse(result.error);
} catch (e) {
throw new Error(
`GSD_JSON_ERRORS=1 must emit valid JSON on stderr.\n` +
`MSD_JSON_ERRORS=1 must emit valid JSON on stderr.\n` +
`Args: ${args.join(' ')}\nstderr: ${result.error}\nparse error: ${e.message}`,
);
}
@@ -133,7 +133,7 @@ describe('graphify router: precise unit tests (recording mock)', () => {
});
assert.strictEqual(errFn.calls.length, 1, 'error must be called once');
assert.ok(
errFn.calls[0].msg.includes('Usage: gsd-tools graphify query <term>'),
errFn.calls[0].msg.includes('Usage: msd-tools graphify query <term>'),
`usage message must match exactly; got: ${errFn.calls[0].msg}`,
);
assert.strictEqual(errFn.calls[0].reason, 'usage',
@@ -241,7 +241,7 @@ describe('graphify cutover: dispatch path (default-case → capability registry)
// With graphify disabled the router returns a disabledResponse; the key
// assertion here is that the command REACHES the router at all (no
// "Unknown command: graphify" error) — proving default→registry dispatch.
const result = runGsdTools(['graphify', 'status'], tmpDir);
const result = runMsdTools(['graphify', 'status'], tmpDir);
// graphify disabled → status returns disabled response JSON (not unknown-command error)
assert.ok(result.success, `Expected success (disabled response), got error: ${result.error}`);
const isUnknownCommand = (result.error || '').includes('Unknown command: graphify');
@@ -277,7 +277,7 @@ describe('graphify cutover: subcommand behavior equivalence', () => {
});
test('status (disabled) → disabled response with disabled:true', () => {
const result = runGsdTools(['graphify', 'status'], tmpDir);
const result = runMsdTools(['graphify', 'status'], tmpDir);
assert.ok(result.success, `Expected success; error: ${result.error}`);
const parsed = JSON.parse(result.output);
assert.strictEqual(parsed.disabled, true, 'disabled graphify: disabled must be true');
@@ -285,7 +285,7 @@ describe('graphify cutover: subcommand behavior equivalence', () => {
test('status (enabled, no graph) → exists:false shape distinguishes from disabled', () => {
enableGraphify(planningDir);
const result = runGsdTools(['graphify', 'status'], tmpDir);
const result = runMsdTools(['graphify', 'status'], tmpDir);
assert.ok(result.success, `Expected success; error: ${result.error}`);
const parsed = JSON.parse(result.output);
// enabled but no graph → { exists: false } — NOT { disabled: true }
@@ -298,7 +298,7 @@ describe('graphify cutover: subcommand behavior equivalence', () => {
test('status (enabled, with graph) → exists:true with node_count/edge_count fields', () => {
enableGraphify(planningDir);
writeGraphJson(planningDir, SAMPLE_GRAPH);
const result = runGsdTools(['graphify', 'status'], tmpDir);
const result = runMsdTools(['graphify', 'status'], tmpDir);
assert.ok(result.success, `Expected success; error: ${result.error}`);
const parsed = JSON.parse(result.output);
assert.strictEqual(parsed.exists, true,
@@ -318,7 +318,7 @@ describe('graphify cutover: subcommand behavior equivalence', () => {
test('diff (enabled, no snapshot) → no_baseline:true shape (distinct from status/query/build)', () => {
enableGraphify(planningDir);
const result = runGsdTools(['graphify', 'diff'], tmpDir);
const result = runMsdTools(['graphify', 'diff'], tmpDir);
assert.ok(result.success, `Expected success; error: ${result.error}`);
const parsed = JSON.parse(result.output);
// diff with no snapshot → { no_baseline: true }
@@ -333,7 +333,7 @@ describe('graphify cutover: subcommand behavior equivalence', () => {
test('build (enabled, no graphify binary) → action:spawn_agent shape (distinct from snapshot)', () => {
enableGraphify(planningDir);
const result = runGsdTools(['graphify', 'build'], tmpDir);
const result = runMsdTools(['graphify', 'build'], tmpDir);
// graphify binary is not installed in test environments → graphifyBuild returns
// an error about missing binary, NOT action:spawn_agent. Either way, the output
// shape is from graphifyBuild (not writeSnapshot which returns {saved:true,...}).
@@ -352,7 +352,7 @@ describe('graphify cutover: subcommand behavior equivalence', () => {
enableGraphify(planningDir);
// write graph.json so writeSnapshot can read it
writeGraphJson(planningDir, SAMPLE_GRAPH);
const result = runGsdTools(['graphify', 'build', 'snapshot'], tmpDir);
const result = runMsdTools(['graphify', 'build', 'snapshot'], tmpDir);
assert.ok(result.success, `Expected success; error: ${result.error}`);
const parsed = JSON.parse(result.output);
// writeSnapshot → { saved: true, timestamp: <ISO>, node_count: N, edge_count: M }
@@ -372,7 +372,7 @@ describe('graphify cutover: subcommand behavior equivalence', () => {
test('query with term (enabled, with graph) → term field echoed in response', () => {
enableGraphify(planningDir);
writeGraphJson(planningDir, SAMPLE_GRAPH);
const result = runGsdTools(['graphify', 'query', 'AuthService'], tmpDir);
const result = runMsdTools(['graphify', 'query', 'AuthService'], tmpDir);
assert.ok(result.success, `Expected success; error: ${result.error}`);
const parsed = JSON.parse(result.output);
// graphifyQuery → { term, nodes, edges, total_nodes, total_edges, trimmed }
@@ -392,7 +392,7 @@ describe('graphify cutover: subcommand behavior equivalence', () => {
test('query with --budget flag → same term field, budget applied (NaN budget graceful)', () => {
enableGraphify(planningDir);
writeGraphJson(planningDir, SAMPLE_GRAPH);
const result = runGsdTools(['graphify', 'query', 'AuthService', '--budget', '5'], tmpDir);
const result = runMsdTools(['graphify', 'query', 'AuthService', '--budget', '5'], tmpDir);
assert.ok(result.success, `Expected success; error: ${result.error}`);
const parsed = JSON.parse(result.output);
// Must still return the query shape (term echoed), not a routing error
@@ -404,7 +404,7 @@ describe('graphify cutover: subcommand behavior equivalence', () => {
});
test('diff (disabled) → disabled response with disabled:true', () => {
const result = runGsdTools(['graphify', 'diff'], tmpDir);
const result = runMsdTools(['graphify', 'diff'], tmpDir);
assert.ok(result.success, `Expected success (disabled); error: ${result.error}`);
const parsed = JSON.parse(result.output);
assert.strictEqual(parsed.disabled, true, 'disabled diff: disabled must be true');
@@ -425,12 +425,12 @@ describe('graphify cutover: error path equivalence', () => {
});
test('unknown subcommand → non-zero exit', () => {
const result = runGsdTools(['graphify', 'bogus-sub-xyzzy'], tmpDir);
const result = runMsdTools(['graphify', 'bogus-sub-xyzzy'], tmpDir);
assert.strictEqual(result.success, false, 'unknown subcommand must fail');
});
test('unknown subcommand error message mentions expected subcommands', () => {
const result = runGsdTools(['graphify', 'bogus-sub-xyzzy'], tmpDir);
const result = runMsdTools(['graphify', 'bogus-sub-xyzzy'], tmpDir);
assert.ok(
result.error.includes('build') &&
result.error.includes('query') &&
@@ -441,12 +441,12 @@ describe('graphify cutover: error path equivalence', () => {
});
test('query with no term → non-zero exit with usage error', () => {
const result = runGsdTools(['graphify', 'query'], tmpDir);
const result = runMsdTools(['graphify', 'query'], tmpDir);
assert.strictEqual(result.success, false, 'missing term must fail');
});
test('query with no term → error message contains usage hint', () => {
const result = runGsdTools(['graphify', 'query'], tmpDir);
const result = runMsdTools(['graphify', 'query'], tmpDir);
assert.ok(
result.error.includes('Usage') || result.error.includes('graphify query'),
`missing-term error should mention usage; got: ${result.error}`,
@@ -563,7 +563,7 @@ describe('graphify cutover: registry entries correct', () => {
/**
* bug-974-graphify-budget-missing-value.test.cjs
*
* Regression guard: `gsd-tools graphify query <term> --budget` with no value
* Regression guard: `msd-tools graphify query <term> --budget` with no value
* following --budget must emit a USAGE error and exit non-zero.
*
* Bug: args[budgetIdx + 1] was undefined → parseInt(undefined, 10) → NaN.
@@ -572,7 +572,7 @@ describe('graphify cutover: registry entries correct', () => {
*
* Test categories:
* 1. BEHAVIORAL (recording mock) — direct routeGraphifyCommand call, no I/O
* 2. SUBPROCESS — end-to-end via runGsdTools
* 2. SUBPROCESS — end-to-end via runMsdTools
* 3. PROPERTY — budget arg parser: non-numeric/absent → usage error, valid int → passes
*/
@@ -580,7 +580,7 @@ const { describe, test, beforeEach, afterEach } = require('node:test');
const assert = require('node:assert/strict');
const path = require('node:path');
const { runGsdTools, createTempProject, cleanup } = require('./helpers.cjs');
const { runMsdTools, createTempProject, cleanup } = require('./helpers.cjs');
const {
enableGraphify,
writeGraphJson,
@@ -588,7 +588,7 @@ const {
} = require('./helpers/graphify.cjs');
const fc = require('./helpers/fast-check-setup.cjs');
const { routeGraphifyCommand } = require('../gsd-core/bin/lib/graphify-command-router.cjs');
const { routeGraphifyCommand } = require('../msd-core/bin/lib/graphify-command-router.cjs');
// ─── Recording-mock helpers (mirrors graphify-command-cutover.test.cjs) ────────
@@ -619,16 +619,16 @@ function makeErrorRecorder() {
}
function runJsonErrors(args, tmpDir, env = {}) {
const result = runGsdTools(args, tmpDir, { ...env, GSD_JSON_ERRORS: '1' });
const result = runMsdTools(args, tmpDir, { ...env, MSD_JSON_ERRORS: '1' });
assert.strictEqual(result.success, false,
`Expected failure with GSD_JSON_ERRORS=1 for args: ${args.join(' ')}\n` +
`Expected failure with MSD_JSON_ERRORS=1 for args: ${args.join(' ')}\n` +
`stdout: ${result.output}\nstderr: ${result.error}`);
let parsed;
try {
parsed = JSON.parse(result.error);
} catch (e) {
throw new Error(
`GSD_JSON_ERRORS=1 must emit valid JSON on stderr.\n` +
`MSD_JSON_ERRORS=1 must emit valid JSON on stderr.\n` +
`Args: ${args.join(' ')}\nstderr: ${result.error}\nparse error: ${e.message}`,
);
}
@@ -722,7 +722,7 @@ describe('bug #974: --budget missing value → usage error (unit, recording mock
});
// ─── 2. SUBPROCESS — end-to-end via runGsdTools ───────────────────────────────
// ─── 2. SUBPROCESS — end-to-end via runMsdTools ───────────────────────────────
describe('bug #974: --budget missing value → usage error (subprocess)', () => {
let tmpDir;
@@ -740,7 +740,7 @@ describe('bug #974: --budget missing value → usage error (subprocess)', () =>
});
test('subprocess: --budget last arg → non-zero exit', () => {
const result = runGsdTools(
const result = runMsdTools(
['graphify', 'query', 'AuthService', '--budget'],
tmpDir,
);
@@ -749,7 +749,7 @@ describe('bug #974: --budget missing value → usage error (subprocess)', () =>
});
test('subprocess: --budget last arg → stderr contains usage hint', () => {
const result = runGsdTools(
const result = runMsdTools(
['graphify', 'query', 'AuthService', '--budget'],
tmpDir,
);
@@ -760,7 +760,7 @@ describe('bug #974: --budget missing value → usage error (subprocess)', () =>
});
test('subprocess: --budget foo (non-numeric) → non-zero exit', () => {
const result = runGsdTools(
const result = runMsdTools(
['graphify', 'query', 'AuthService', '--budget', 'foo'],
tmpDir,
);
@@ -768,7 +768,7 @@ describe('bug #974: --budget missing value → usage error (subprocess)', () =>
`--budget with non-numeric value must exit non-zero; stderr: ${result.error}`);
});
test('subprocess: --budget last arg → GSD_JSON_ERRORS=1 → usage reason', () => {
test('subprocess: --budget last arg → MSD_JSON_ERRORS=1 → usage reason', () => {
const parsed = runJsonErrors(
['graphify', 'query', 'AuthService', '--budget'],
tmpDir,
@@ -780,7 +780,7 @@ describe('bug #974: --budget missing value → usage error (subprocess)', () =>
);
});
test('subprocess: --budget foo → GSD_JSON_ERRORS=1 → usage reason', () => {
test('subprocess: --budget foo → MSD_JSON_ERRORS=1 → usage reason', () => {
const parsed = runJsonErrors(
['graphify', 'query', 'AuthService', '--budget', 'foo'],
tmpDir,
@@ -790,7 +790,7 @@ describe('bug #974: --budget missing value → usage error (subprocess)', () =>
// Regression: valid --budget still works after the fix
test('subprocess: --budget 500 (valid) → success, term echoed', () => {
const result = runGsdTools(
const result = runMsdTools(
['graphify', 'query', 'AuthService', '--budget', '500'],
tmpDir,
);