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

@@ -13,7 +13,7 @@ const fs = require('node:fs');
const path = require('node:path');
const { createTempDir, cleanup } = require('./helpers.cjs');
const capLedger = require('../gsd-core/bin/lib/capability-ledger.cjs');
const capLedger = require('../msd-core/bin/lib/capability-ledger.cjs');
const {
readLedger,
writeLedger,
@@ -106,7 +106,7 @@ test('writeLedger then readLedger round-trips a valid ledger', (t) => {
const ledger = makeLedger({
entries: {
'my-cap': makeEntry('my-cap', { files: ['commands/gsd/my-cap.md'] }),
'my-cap': makeEntry('my-cap', { files: ['commands/msd/my-cap.md'] }),
},
});
@@ -117,7 +117,7 @@ test('writeLedger then readLedger round-trips a valid ledger', (t) => {
assert.equal(readBack.version, '1');
assert.equal(typeof readBack.updatedAt, 'string');
assert.ok('my-cap' in readBack.entries, 'entry must survive the round-trip');
assert.deepEqual(readBack.entries['my-cap'].files, ['commands/gsd/my-cap.md']);
assert.deepEqual(readBack.entries['my-cap'].files, ['commands/msd/my-cap.md']);
});
// ---------------------------------------------------------------------------
@@ -318,7 +318,7 @@ test('finding-3: recordInstall whole-entry validation does NOT reject a valid en
assert.doesNotThrow(
() => recordInstall(dir, makeEntry('cap-ok', {
files: ['commands/gsd/cap-ok.md'],
files: ['commands/msd/cap-ok.md'],
sharedEdits: [{ file: 'settings.json', marker: 'cap-ok' }],
})),
'a fully-valid entry must still record cleanly',
@@ -416,7 +416,7 @@ test('reconcile reports orphans when a recorded file is missing on disk', (t) =>
t.after(() => cleanup(dir));
recordInstall(dir, makeEntry('cap-missing', {
files: ['commands/gsd/cap-missing.md', 'agents/gsd-cap.md'],
files: ['commands/msd/cap-missing.md', 'agents/msd-cap.md'],
}));
const result = reconcile(dir);
@@ -425,7 +425,7 @@ test('reconcile reports orphans when a recorded file is missing on disk', (t) =>
assert.equal(result.orphans[0].id, 'cap-missing');
assert.deepEqual(
result.orphans[0].missing.sort(),
['agents/gsd-cap.md', 'commands/gsd/cap-missing.md'].sort(),
['agents/msd-cap.md', 'commands/msd/cap-missing.md'].sort(),
);
});
@@ -438,12 +438,12 @@ test('reconcile returns empty orphans when all recorded files exist on disk', (t
t.after(() => cleanup(dir));
// Create the files that will be recorded.
const subdir = path.join(dir, 'commands', 'gsd');
const subdir = path.join(dir, 'commands', 'msd');
fs.mkdirSync(subdir, { recursive: true });
fs.writeFileSync(path.join(subdir, 'cap-present.md'), '# cap\n');
recordInstall(dir, makeEntry('cap-present', {
files: ['commands/gsd/cap-present.md'],
files: ['commands/msd/cap-present.md'],
}));
const result = reconcile(dir);
@@ -568,7 +568,7 @@ test('recordInstall throws on a corrupt-but-present ledger and leaves the file I
// 1. Write a valid ledger with entry "A".
const entryA = makeEntry('cap-a', {
files: ['commands/gsd/cap-a.md'],
files: ['commands/msd/cap-a.md'],
sharedEdits: [{ file: 'settings.json', marker: 'cap-a' }],
});
recordInstall(dir, entryA);
@@ -629,7 +629,7 @@ test('recordInstall on a genuinely missing ledger creates a fresh ledger and suc
// recordInstall must succeed and create a fresh ledger.
assert.doesNotThrow(
() => recordInstall(dir, makeEntry('cap-fresh', { files: ['commands/gsd/cap-fresh.md'] })),
() => recordInstall(dir, makeEntry('cap-fresh', { files: ['commands/msd/cap-fresh.md'] })),
'recordInstall must not throw for a missing ledger',
);
@@ -909,7 +909,7 @@ test('readLedger returns null when sharedEdits[] member has non-string file fiel
'bad-cap': {
id: 'bad-cap', version: '1.0.0', source: 'registry:test', integrity: 'sha256-x',
files: [],
sharedEdits: [{ file: 42, marker: 'GSD cap-bad' }], // non-string file field
sharedEdits: [{ file: 42, marker: 'MSD cap-bad' }], // non-string file field
},
},
};
@@ -929,7 +929,7 @@ test('readLedger still accepts a valid ledger with populated files[] and sharedE
entries: {
'good-cap': {
id: 'good-cap', version: '1.0.0', source: 'registry:test', integrity: 'sha256-x',
files: ['commands/gsd/good-cap.md'],
files: ['commands/msd/good-cap.md'],
// marker is a non-empty string (finding-5: relaxed — need not match the entry key)
sharedEdits: [{ file: 'settings.json', marker: 'good-cap' }],
},
@@ -1145,7 +1145,7 @@ test('readLedgerStrict: a ledger file that cannot be read (EISDIR) throws Ledger
// "reconcile skips hostile members" but readLedger rejected the ledger BEFORE the loop, so
// the per-member skip branch was never exercised — vacuous.)
test('reconcile fails closed on a hostile-files[] ledger: readLedger rejects it → parse warning, no oracle, no orphans', () => {
const dir = createTempDir('gsd-ledger-hostile-');
const dir = createTempDir('msd-ledger-hostile-');
try {
// Hand-write a ledger whose files[] contains hostile members (a non-string forces rejection).
const ledger = {
@@ -1191,7 +1191,7 @@ test('finding-1: reconcile with corrupt ledger + backup dir → backup still exi
t.after(() => cleanup(dir));
// Create a backup dir that reconcile would normally sweep.
const capRoot = path.join(dir, '.gsd', 'capabilities');
const capRoot = path.join(dir, '.msd', 'capabilities');
fs.mkdirSync(capRoot, { recursive: true });
const backupDir = path.join(capRoot, 'mycap.upgrading-999-111');
fs.mkdirSync(backupDir, { recursive: true });
@@ -1202,7 +1202,7 @@ test('finding-1: reconcile with corrupt ledger + backup dir → backup still exi
fs.writeFileSync(ledgerPath, '{ broken json ---');
// Must not throw. Use the lifecycle module which wraps reconcileCapabilities.
const lifecycle = require('../gsd-core/bin/lib/capability-lifecycle.cjs');
const lifecycle = require('../msd-core/bin/lib/capability-lifecycle.cjs');
let report;
assert.doesNotThrow(
() => { report = lifecycle.reconcileCapabilities({ runtimeDir: dir }); },
@@ -1389,7 +1389,7 @@ test('finding-6: isValidLedgerEntry is exported and validates entries correctly'
assert.equal(
isValidLedgerEntry('my-cap', {
id: 'my-cap', version: '1.0.0', source: 'registry:x', integrity: 'sha512-abc',
files: ['commands/gsd/my-cap.md'],
files: ['commands/msd/my-cap.md'],
sharedEdits: [{ file: 'settings.json', marker: 'my-cap' }],
}),
true,
@@ -1487,7 +1487,7 @@ test('root-fix-1: isValidLedgerEntry and readLedger round-trip give identical ve
// [description, id-key, entry-object, expectedValid]
['valid entry', 'good-cap', {
id: 'good-cap', version: '1.0.0', source: 'reg:x', integrity: 'sha512-abc',
files: ['commands/gsd/good-cap.md'],
files: ['commands/msd/good-cap.md'],
sharedEdits: [{ file: 'settings.json', marker: 'good-cap' }],
}, true],
['valid entry with _pending', 'p-cap', {
@@ -1659,11 +1659,11 @@ test('root-fix-4: reconcileCapabilities returns warning (no mutation) when ledge
const dir = createTempDir('ledger-rf4-symlink-reconcile-');
t.after(() => cleanup(dir));
const lifecycle = require('../gsd-core/bin/lib/capability-lifecycle.cjs');
const lifecycle = require('../msd-core/bin/lib/capability-lifecycle.cjs');
const ledgerPath = path.join(dir, LEDGER_FILE_NAME);
// Create a backup that reconcile would normally sweep.
const capRoot = path.join(dir, '.gsd', 'capabilities');
const capRoot = path.join(dir, '.msd', 'capabilities');
fs.mkdirSync(capRoot, { recursive: true });
const backupDir = path.join(capRoot, 'somecap.upgrading-111-222');
fs.mkdirSync(backupDir);
@@ -1690,7 +1690,7 @@ test('root-fix-4: installCapability blocks when ledger is a broken symlink (not
const dir = createTempDir('ledger-rf4-symlink-install-');
t.after(() => cleanup(dir));
const lifecycle = require('../gsd-core/bin/lib/capability-lifecycle.cjs');
const lifecycle = require('../msd-core/bin/lib/capability-lifecycle.cjs');
const ledgerPath = path.join(dir, LEDGER_FILE_NAME);
// Plant a dangling symlink at the ledger path.
@@ -1700,13 +1700,13 @@ test('root-fix-4: installCapability blocks when ledger is a broken symlink (not
const result = await lifecycle.installCapability('./x', {
runtimeDir: dir, hostVersion: '1.6.0',
_resolve: async (spec, opts) => {
const root = path.join(opts.gsdHome, '.gsd', 'capabilities', '.staging');
const root = path.join(opts.msdHome, '.msd', 'capabilities', '.staging');
fs.mkdirSync(root, { recursive: true });
const staged = path.join(root, 'x-symlink-test');
fs.mkdirSync(staged, { recursive: true });
fs.writeFileSync(path.join(staged, 'capability.json'), JSON.stringify({
id: 'x', role: 'feature', version: '1.0.0', title: 'x',
description: 'x', tier: 'standard', requires: [], engines: { gsd: '>=1.0.0' },
description: 'x', tier: 'standard', requires: [], engines: { msd: '>=1.0.0' },
runtimeCompat: { supported: ['*'], unsupported: [] },
skills: [], agents: [], hooks: [], config: {}, steps: [], contributions: [], gates: [],
}), 'utf8');