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:
@@ -3,7 +3,7 @@
|
||||
* intel-command-cutover.test.cjs — ADR-959 phase 4d-impl-4 equivalence tests.
|
||||
*
|
||||
* Verifies that the `intel` command family, after cutover from the hardcoded
|
||||
* `case 'intel':` arm in gsd-tools.cjs to the capability registry dispatch
|
||||
* `case 'intel':` arm in msd-tools.cjs to the capability registry dispatch
|
||||
* path (default → dispatchCapabilityCommand → intel-command-router.cjs →
|
||||
* routeIntelCommand), behaves identically to the old inline case.
|
||||
*
|
||||
@@ -21,10 +21,10 @@ const assert = require('node:assert/strict');
|
||||
const path = require('node:path');
|
||||
const fs = require('node:fs');
|
||||
|
||||
const { runGsdTools, createTempProject, cleanup } = require('./helpers.cjs');
|
||||
const { runMsdTools, createTempProject, cleanup } = require('./helpers.cjs');
|
||||
|
||||
const registry = require('../gsd-core/bin/lib/capability-registry.cjs');
|
||||
const { routeIntelCommand } = require('../gsd-core/bin/lib/intel-command-router.cjs');
|
||||
const registry = require('../msd-core/bin/lib/capability-registry.cjs');
|
||||
const { routeIntelCommand } = require('../msd-core/bin/lib/intel-command-router.cjs');
|
||||
|
||||
// ─── helpers ─────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -70,16 +70,16 @@ function makeIntelMock(overrides = {}) {
|
||||
}
|
||||
|
||||
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}`,
|
||||
);
|
||||
}
|
||||
@@ -169,7 +169,7 @@ describe('intel router: unit tests via recording mocks', () => {
|
||||
_intel: makeIntelMock().mock,
|
||||
});
|
||||
assert.strictEqual(errFn.calls.length, 1, 'error must be called for missing term');
|
||||
assert.ok(errFn.calls[0].msg.includes('gsd-tools intel query <term>'),
|
||||
assert.ok(errFn.calls[0].msg.includes('msd-tools intel query <term>'),
|
||||
'usage error must mention correct usage');
|
||||
assert.strictEqual(errFn.calls[0].reason, 'usage',
|
||||
'reason must be "usage" (ERROR_REASON.USAGE)');
|
||||
@@ -347,7 +347,7 @@ describe('intel router: unit tests via recording mocks', () => {
|
||||
_intel: makeIntelMock().mock,
|
||||
});
|
||||
assert.strictEqual(errFn.calls.length, 1, 'error must be called for missing filePath');
|
||||
assert.ok(errFn.calls[0].msg.includes('gsd-tools intel patch-meta <file-path>'),
|
||||
assert.ok(errFn.calls[0].msg.includes('msd-tools intel patch-meta <file-path>'),
|
||||
'usage error must mention correct usage');
|
||||
assert.strictEqual(errFn.calls[0].reason, 'usage',
|
||||
'reason must be "usage" (ERROR_REASON.USAGE)');
|
||||
@@ -390,7 +390,7 @@ describe('intel router: unit tests via recording mocks', () => {
|
||||
_intel: makeIntelMock().mock,
|
||||
});
|
||||
assert.strictEqual(errFn.calls.length, 1, 'error must be called for missing filePath');
|
||||
assert.ok(errFn.calls[0].msg.includes('gsd-tools intel extract-exports <file-path>'),
|
||||
assert.ok(errFn.calls[0].msg.includes('msd-tools intel extract-exports <file-path>'),
|
||||
'usage error must mention correct usage');
|
||||
assert.strictEqual(errFn.calls[0].reason, 'usage',
|
||||
'reason must be "usage" (ERROR_REASON.USAGE)');
|
||||
@@ -423,7 +423,7 @@ describe('intel cutover: dispatch path (default-case → capability registry)',
|
||||
let tmpDir;
|
||||
|
||||
beforeEach(() => {
|
||||
tmpDir = createTempProject('gsd-intel-cutover-');
|
||||
tmpDir = createTempProject('msd-intel-cutover-');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -433,7 +433,7 @@ describe('intel cutover: dispatch path (default-case → capability registry)',
|
||||
test('intel subcommand does not emit "Unknown command: intel" (reaches capability router)', () => {
|
||||
// With intel.enabled absent/false the router will return a disabled payload —
|
||||
// but it must NOT fall through to the "Unknown command" error.
|
||||
const result = runGsdTools(['intel', 'status'], tmpDir);
|
||||
const result = runMsdTools(['intel', 'status'], tmpDir);
|
||||
const stderr = result.error || '';
|
||||
assert.strictEqual(
|
||||
stderr.includes('Unknown command: intel'),
|
||||
@@ -446,7 +446,7 @@ describe('intel cutover: dispatch path (default-case → capability registry)',
|
||||
});
|
||||
|
||||
test('intel status --raw dispatches correctly (no "Unknown command")', () => {
|
||||
const result = runGsdTools(['intel', 'status', '--raw'], tmpDir);
|
||||
const result = runMsdTools(['intel', 'status', '--raw'], tmpDir);
|
||||
const stderr = result.error || '';
|
||||
assert.strictEqual(
|
||||
stderr.includes('Unknown command: intel'),
|
||||
@@ -462,7 +462,7 @@ describe('intel cutover: output shape equivalence', () => {
|
||||
let tmpDir;
|
||||
|
||||
beforeEach(() => {
|
||||
tmpDir = createTempProject('gsd-intel-behavior-');
|
||||
tmpDir = createTempProject('msd-intel-behavior-');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -471,7 +471,7 @@ describe('intel cutover: output shape equivalence', () => {
|
||||
|
||||
test('intel status (disabled gate): exits 0, produces JSON payload with disabled:true', () => {
|
||||
// intel.enabled absent — disabled gate response from intel.cjs
|
||||
const result = runGsdTools(['intel', 'status'], tmpDir);
|
||||
const result = runMsdTools(['intel', 'status'], tmpDir);
|
||||
assert.ok(result.success, `intel status must exit 0. stderr: ${result.error}`);
|
||||
let parsed;
|
||||
assert.doesNotThrow(
|
||||
@@ -482,7 +482,7 @@ describe('intel cutover: output shape equivalence', () => {
|
||||
});
|
||||
|
||||
test('intel query (disabled gate): exits 0, produces JSON with disabled:true', () => {
|
||||
const result = runGsdTools(['intel', 'query', 'someterm'], tmpDir);
|
||||
const result = runMsdTools(['intel', 'query', 'someterm'], tmpDir);
|
||||
assert.ok(result.success, `intel query must exit 0 (disabled gate). stderr: ${result.error}`);
|
||||
let parsed;
|
||||
assert.doesNotThrow(
|
||||
@@ -493,7 +493,7 @@ describe('intel cutover: output shape equivalence', () => {
|
||||
});
|
||||
|
||||
test('intel status --raw (disabled gate): exits 0, produces JSON', () => {
|
||||
const result = runGsdTools(['intel', 'status', '--raw'], tmpDir);
|
||||
const result = runMsdTools(['intel', 'status', '--raw'], tmpDir);
|
||||
assert.ok(result.success, `intel status --raw must exit 0. stderr: ${result.error}`);
|
||||
let parsed;
|
||||
assert.doesNotThrow(
|
||||
@@ -517,7 +517,7 @@ describe('intel cutover: output shape equivalence', () => {
|
||||
};
|
||||
fs.writeFileSync(path.join(intelDir, 'file-roles.json'), JSON.stringify(intelData, null, 2), 'utf8');
|
||||
|
||||
const result = runGsdTools(['intel', 'status'], tmpDir);
|
||||
const result = runMsdTools(['intel', 'status'], tmpDir);
|
||||
assert.ok(result.success, `intel status must exit 0. stderr: ${result.error}`);
|
||||
let parsed;
|
||||
assert.doesNotThrow(
|
||||
@@ -551,7 +551,7 @@ describe('intel cutover: output shape equivalence', () => {
|
||||
};
|
||||
fs.writeFileSync(path.join(intelDir, 'file-roles.json'), JSON.stringify(intelData, null, 2), 'utf8');
|
||||
|
||||
const result = runGsdTools(['intel', 'status', '--raw'], tmpDir);
|
||||
const result = runMsdTools(['intel', 'status', '--raw'], tmpDir);
|
||||
assert.ok(result.success, `intel status --raw must exit 0. stderr: ${result.error}`);
|
||||
let parsed;
|
||||
assert.doesNotThrow(
|
||||
@@ -579,7 +579,7 @@ describe('intel cutover: error paths (exit non-zero + correct messages)', () =>
|
||||
let tmpDir;
|
||||
|
||||
beforeEach(() => {
|
||||
tmpDir = createTempProject('gsd-intel-err-');
|
||||
tmpDir = createTempProject('msd-intel-err-');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -587,37 +587,37 @@ describe('intel cutover: error paths (exit non-zero + correct messages)', () =>
|
||||
});
|
||||
|
||||
test('intel query (missing term): exits non-zero, emits usage message', () => {
|
||||
const result = runGsdTools(['intel', 'query'], tmpDir);
|
||||
const result = runMsdTools(['intel', 'query'], tmpDir);
|
||||
assert.strictEqual(result.success, false, 'intel query without term must exit non-zero');
|
||||
const output = result.error + result.output;
|
||||
assert.ok(
|
||||
output.includes('gsd-tools intel query <term>'),
|
||||
output.includes('msd-tools intel query <term>'),
|
||||
`Must emit usage hint for missing term. Got: ${output}`,
|
||||
);
|
||||
});
|
||||
|
||||
test('intel patch-meta (missing filePath): exits non-zero, emits usage message', () => {
|
||||
const result = runGsdTools(['intel', 'patch-meta'], tmpDir);
|
||||
const result = runMsdTools(['intel', 'patch-meta'], tmpDir);
|
||||
assert.strictEqual(result.success, false, 'intel patch-meta without filePath must exit non-zero');
|
||||
const output = result.error + result.output;
|
||||
assert.ok(
|
||||
output.includes('gsd-tools intel patch-meta <file-path>'),
|
||||
output.includes('msd-tools intel patch-meta <file-path>'),
|
||||
`Must emit usage hint for missing filePath. Got: ${output}`,
|
||||
);
|
||||
});
|
||||
|
||||
test('intel extract-exports (missing filePath): exits non-zero, emits usage message', () => {
|
||||
const result = runGsdTools(['intel', 'extract-exports'], tmpDir);
|
||||
const result = runMsdTools(['intel', 'extract-exports'], tmpDir);
|
||||
assert.strictEqual(result.success, false, 'intel extract-exports without filePath must exit non-zero');
|
||||
const output = result.error + result.output;
|
||||
assert.ok(
|
||||
output.includes('gsd-tools intel extract-exports <file-path>'),
|
||||
output.includes('msd-tools intel extract-exports <file-path>'),
|
||||
`Must emit usage hint for missing filePath. Got: ${output}`,
|
||||
);
|
||||
});
|
||||
|
||||
test('intel unknown subcommand: exits non-zero, emits "Unknown intel subcommand"', () => {
|
||||
const result = runGsdTools(['intel', 'bogussubcmd'], tmpDir);
|
||||
const result = runMsdTools(['intel', 'bogussubcmd'], tmpDir);
|
||||
assert.strictEqual(result.success, false, 'intel unknown subcommand must exit non-zero');
|
||||
const output = result.error + result.output;
|
||||
assert.ok(
|
||||
@@ -633,52 +633,52 @@ describe('intel cutover: error paths (exit non-zero + correct messages)', () =>
|
||||
});
|
||||
});
|
||||
|
||||
// ─── 5. JSON-ERRORS — GSD_JSON_ERRORS mode ───────────────────────────────────
|
||||
// ─── 5. JSON-ERRORS — MSD_JSON_ERRORS mode ───────────────────────────────────
|
||||
|
||||
describe('intel cutover: GSD_JSON_ERRORS structured error payloads', () => {
|
||||
describe('intel cutover: MSD_JSON_ERRORS structured error payloads', () => {
|
||||
let tmpDir;
|
||||
|
||||
beforeEach(() => {
|
||||
tmpDir = createTempProject('gsd-intel-jsonerr-');
|
||||
tmpDir = createTempProject('msd-intel-jsonerr-');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
cleanup(tmpDir);
|
||||
});
|
||||
|
||||
test('intel query (missing term) with GSD_JSON_ERRORS=1 emits {ok:false,reason:"usage"}', () => {
|
||||
test('intel query (missing term) with MSD_JSON_ERRORS=1 emits {ok:false,reason:"usage"}', () => {
|
||||
const parsed = runJsonErrors(['intel', 'query'], tmpDir);
|
||||
assertTypedError(parsed, 'usage', 'intel query missing term');
|
||||
assert.ok(parsed.message.includes('gsd-tools intel query <term>'),
|
||||
assert.ok(parsed.message.includes('msd-tools intel query <term>'),
|
||||
'usage message must include the usage hint');
|
||||
});
|
||||
|
||||
test('intel patch-meta (missing filePath) with GSD_JSON_ERRORS=1 emits {ok:false,reason:"usage"}', () => {
|
||||
test('intel patch-meta (missing filePath) with MSD_JSON_ERRORS=1 emits {ok:false,reason:"usage"}', () => {
|
||||
const parsed = runJsonErrors(['intel', 'patch-meta'], tmpDir);
|
||||
assertTypedError(parsed, 'usage', 'intel patch-meta missing filePath');
|
||||
assert.ok(parsed.message.includes('gsd-tools intel patch-meta <file-path>'),
|
||||
assert.ok(parsed.message.includes('msd-tools intel patch-meta <file-path>'),
|
||||
'usage message must include the usage hint');
|
||||
});
|
||||
|
||||
test('intel extract-exports (missing filePath) with GSD_JSON_ERRORS=1 emits {ok:false,reason:"usage"}', () => {
|
||||
test('intel extract-exports (missing filePath) with MSD_JSON_ERRORS=1 emits {ok:false,reason:"usage"}', () => {
|
||||
const parsed = runJsonErrors(['intel', 'extract-exports'], tmpDir);
|
||||
assertTypedError(parsed, 'usage', 'intel extract-exports missing filePath');
|
||||
assert.ok(parsed.message.includes('gsd-tools intel extract-exports <file-path>'),
|
||||
assert.ok(parsed.message.includes('msd-tools intel extract-exports <file-path>'),
|
||||
'usage message must include the usage hint');
|
||||
});
|
||||
|
||||
test('intel unknown subcommand with GSD_JSON_ERRORS=1 emits {ok:false,reason:"sdk_unknown_command"}', () => {
|
||||
test('intel unknown subcommand with MSD_JSON_ERRORS=1 emits {ok:false,reason:"sdk_unknown_command"}', () => {
|
||||
const parsed = runJsonErrors(['intel', 'notasubcmd'], tmpDir);
|
||||
assertTypedError(parsed, 'sdk_unknown_command', 'intel unknown subcommand');
|
||||
assert.ok(parsed.message.includes('Unknown intel subcommand'),
|
||||
'sdk_unknown_command message must say "Unknown intel subcommand"');
|
||||
});
|
||||
|
||||
test('intel status (disabled gate) with GSD_JSON_ERRORS=1 does NOT emit error payload (succeeds)', () => {
|
||||
test('intel status (disabled gate) with MSD_JSON_ERRORS=1 does NOT emit error payload (succeeds)', () => {
|
||||
// The disabled gate is not a CLI error — it exits 0 with a JSON payload
|
||||
const result = runGsdTools(['intel', 'status'], tmpDir, { GSD_JSON_ERRORS: '1' });
|
||||
const result = runMsdTools(['intel', 'status'], tmpDir, { MSD_JSON_ERRORS: '1' });
|
||||
assert.ok(result.success,
|
||||
`intel status disabled gate must exit 0 with GSD_JSON_ERRORS=1. stderr: ${result.error}`);
|
||||
`intel status disabled gate must exit 0 with MSD_JSON_ERRORS=1. stderr: ${result.error}`);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user