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

@@ -19,7 +19,7 @@ const {
dispatchCapabilityCommand,
dispatchOverlayCapabilityCommand,
defaultRequireFromInstallRoot,
} = require('../gsd-core/bin/gsd-tools.cjs');
} = require('../msd-core/bin/msd-tools.cjs');
const { cleanup } = require('./helpers.cjs');
// ─── Helpers ──────────────────────────────────────────────────────────────────
@@ -506,7 +506,7 @@ describe('dispatchCapabilityCommand — FIX 2: own-property guard on router expo
// ─── 8. Router throws — structured error handling ────────────────────────────
const { ExitError } = require('../gsd-core/bin/lib/cli-exit.cjs');
const { ExitError } = require('../msd-core/bin/lib/cli-exit.cjs');
describe('dispatchCapabilityCommand — non-ExitError from router → structured error via error()', () => {
test('router throws TypeError → injected error() called with attributed message, raw error does NOT propagate', () => {
@@ -542,7 +542,7 @@ describe('dispatchCapabilityCommand — non-ExitError from router → structured
assert.ok(msg.includes('fake.cjs'), 'message must name the module; got: ' + msg);
assert.ok(msg.includes('boom'), 'message must include original error message; got: ' + msg);
// Reason must be SDK_FAIL_FAST
const { ERROR_REASON } = require('../gsd-core/bin/lib/io.cjs');
const { ERROR_REASON } = require('../msd-core/bin/lib/io.cjs');
assert.strictEqual(reason, ERROR_REASON.SDK_FAIL_FAST, 'reason must be SDK_FAIL_FAST');
});
@@ -633,7 +633,7 @@ describe('dispatchCapabilityCommand — non-ExitError from router → structured
// ─── 10. Async router (thenable) → structured error ─────────────────────────
describe('dispatchCapabilityCommand — async router returns a Promise → structured error', () => {
const { ERROR_REASON } = require('../gsd-core/bin/lib/io.cjs');
const { ERROR_REASON } = require('../msd-core/bin/lib/io.cjs');
test('router returns Promise.resolve() → error() called with "must be synchronous" + SDK_FAIL_FAST', () => {
const errorCalls = [];
@@ -757,7 +757,7 @@ describe('dispatchCapabilityCommand — real registry behavior-preservation', ()
// This test was originally written as "commandFamilies must be empty today" but
// now asserts the structural contract instead (exported, object) since the graphify
// cutover populates it.
const realRegistry = require('../gsd-core/bin/lib/capability-registry.cjs');
const realRegistry = require('../msd-core/bin/lib/capability-registry.cjs');
assert.ok(realRegistry.commandFamilies, 'commandFamilies must be exported');
assert.strictEqual(typeof realRegistry.commandFamilies, 'object',
'commandFamilies must be an object');
@@ -769,7 +769,7 @@ describe('dispatchCapabilityCommand — real registry behavior-preservation', ()
});
test('unknown command against real registry returns false (behavior-preserving)', () => {
const realRegistry = require('../gsd-core/bin/lib/capability-registry.cjs');
const realRegistry = require('../msd-core/bin/lib/capability-registry.cjs');
const result = dispatchCapabilityCommand({
command: 'some-unknown-command-xyz',
@@ -934,13 +934,13 @@ describe('defaultRequireFromInstallRoot — install-root confinement (Phase 5)',
describe('dispatchOverlayCapabilityCommand — end-to-end (real loadRegistry, real require, real ledger)', () => {
const homes = [];
let savedGsdHome;
let savedMsdHome;
const mkhome = () => { const h = fs.mkdtempSync(path.join(os.tmpdir(), 'cap-e2e-')); homes.push(h); return h; };
function validCap(id, family) {
return {
id, role: 'feature', version: '1.0.0', title: id, description: 'e2e cap', tier: 'standard',
requires: [], engines: { gsd: '>=1.0.0' }, runtimeCompat: { supported: ['*'], unsupported: [] },
requires: [], engines: { msd: '>=1.0.0' }, runtimeCompat: { supported: ['*'], unsupported: [] },
skills: [], agents: [], hooks: [], config: {}, steps: [], contributions: [], gates: [],
commands: [{ family, module: 'router.cjs', router: 'run' }],
};
@@ -949,27 +949,27 @@ describe('dispatchOverlayCapabilityCommand — end-to-end (real loadRegistry, re
const ROUTER_BODY = "module.exports = { run: (ctx) => { require('fs').writeFileSync(require('path').join(ctx.cwd, 'RAN.txt'), String((ctx.args||[]).join(','))); } };";
function placeBundle(home, id, family, { committed }) {
const dir = path.join(home, '.gsd', 'capabilities', id);
const dir = path.join(home, '.msd', 'capabilities', id);
fs.mkdirSync(dir, { recursive: true });
fs.writeFileSync(path.join(dir, 'capability.json'), JSON.stringify(validCap(id, family)), 'utf8');
fs.writeFileSync(path.join(dir, 'router.cjs'), ROUTER_BODY, 'utf8');
if (committed) {
fs.writeFileSync(
path.join(home, '.gsd-capabilities.json'),
path.join(home, '.msd-capabilities.json'),
JSON.stringify({ version: '1', updatedAt: 'x', entries: { [id]: { id, version: '1.0.0', source: 's', integrity: '', files: [], sharedEdits: [] } } }),
'utf8',
);
}
}
test.beforeEach(() => { savedGsdHome = process.env.GSD_HOME; });
test.afterEach(() => { if (savedGsdHome === undefined) delete process.env.GSD_HOME; else process.env.GSD_HOME = savedGsdHome; });
test.beforeEach(() => { savedMsdHome = process.env.MSD_HOME; });
test.afterEach(() => { if (savedMsdHome === undefined) delete process.env.MSD_HOME; else process.env.MSD_HOME = savedMsdHome; });
test.after(() => { for (const h of homes) cleanup(h); });
test('a COMMITTED (consented) third-party command runs, from its install root', () => {
const home = mkhome();
placeBundle(home, 'e2ecap', 'e2e-cmd', { committed: true });
process.env.GSD_HOME = home; // global overlay scope = home/.gsd/capabilities
process.env.MSD_HOME = home; // global overlay scope = home/.msd/capabilities
const errs = [];
const result = dispatchOverlayCapabilityCommand({ command: 'e2e-cmd', args: ['hello'], cwd: home, raw: false, error: (m) => errs.push(m) });
assert.strictEqual(result, true, 'consented command consumed: ' + JSON.stringify(errs));
@@ -979,7 +979,7 @@ describe('dispatchOverlayCapabilityCommand — end-to-end (real loadRegistry, re
test('NEGATIVE PROOF: a dropped bundle with NO ledger entry is never dispatched / never executes', () => {
const home = mkhome();
placeBundle(home, 'evilcap', 'evil-cmd', { committed: false }); // bundle on disk, NO ledger
process.env.GSD_HOME = home;
process.env.MSD_HOME = home;
const result = dispatchOverlayCapabilityCommand({ command: 'evil-cmd', args: ['x'], cwd: home, raw: false, error: () => {} });
assert.strictEqual(result, false, 'unconsented family must fall through to Unknown');
assert.strictEqual(fs.existsSync(path.join(home, 'RAN.txt')), false, 'the dropped module must NEVER execute');