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

@@ -9,11 +9,11 @@
* namedDispatch/background/subagentToolkit:'full'), so UPGRADE 1 (dispatch)
* and UPGRADE 2 (hook-bus) below are REGRESSION locks on that pre-existing
* wiring, not new capabilities. UPGRADE 3 (MCP companion) IS new: #2097 adds
* `mergeGsdMcpServerIntoSettings`, registering the GSD companion MCP server
* `mergeMsdMcpServerIntoSettings`, registering the MSD companion MCP server
* inside Augment's own settings.json `mcpServers` block (Augment hosts MCP
* there, unlike Antigravity's standalone mcp_config.json) — non-destructively
* appending GSD's own entry while preserving any other user-configured
* `mcpServers` entries. Uninstall removes only the GSD-owned `gsd` entry.
* appending MSD's own entry while preserving any other user-configured
* `mcpServers` entries. Uninstall removes only the MSD-owned `msd` entry.
*/
const { test } = require('node:test');
@@ -27,10 +27,10 @@ const { runMinimalInstall, installerEnv, INSTALL_SCRIPT } = require('./helpers/i
const { cleanup } = require('./helpers.cjs');
const { INSTALL_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
const {
mergeGsdMcpServerIntoSettings,
mergeMsdMcpServerIntoSettings,
} = require('../bin/install.js');
const { negotiateHostCapabilities } = require('../gsd-core/bin/lib/host-integration.cjs');
const { PACKAGE_NAME } = require('../gsd-core/bin/lib/package-identity.cjs');
const { negotiateHostCapabilities } = require('../msd-core/bin/lib/host-integration.cjs');
const { PACKAGE_NAME } = require('../msd-core/bin/lib/package-identity.cjs');
const AUGMENT_CAP = JSON.parse(
fs.readFileSync(path.join(__dirname, '..', 'capabilities', 'augment', 'capability.json'), 'utf8'),
@@ -63,7 +63,7 @@ test('negotiateHostCapabilities does NOT flatten dispatch for augment — namedD
// ---------------------------------------------------------------------------
for (const scope of ['global', 'local']) {
test(`augment --${scope}: settings.json contains GSD's managed hook entries (UPGRADE 2)`, (t) => {
test(`augment --${scope}: settings.json contains MSD's managed hook entries (UPGRADE 2)`, (t) => {
const { configDir, root } = runMinimalInstall({ runtime: 'augment', scope });
t.after(() => cleanup(root));
@@ -83,64 +83,64 @@ for (const scope of ['global', 'local']) {
assert.ok(Array.isArray(settings.hooks.PreToolUse) && settings.hooks.PreToolUse.length > 0,
'settings.hooks.PreToolUse must be registered');
const hasGsdCommand = (entries) => entries.some(
const hasMsdCommand = (entries) => entries.some(
(entry) => entry && Array.isArray(entry.hooks) &&
entry.hooks.some((h) => h && typeof h.command === 'string' && h.command.includes('gsd-')),
entry.hooks.some((h) => h && typeof h.command === 'string' && h.command.includes('msd-')),
);
assert.ok(hasGsdCommand(settings.hooks.SessionStart), 'SessionStart must reference a gsd- managed hook');
assert.ok(hasGsdCommand(settings.hooks.PostToolUse), 'PostToolUse must reference a gsd- managed hook');
assert.ok(hasGsdCommand(settings.hooks.PreToolUse), 'PreToolUse must reference a gsd- managed hook');
assert.ok(hasMsdCommand(settings.hooks.SessionStart), 'SessionStart must reference a msd- managed hook');
assert.ok(hasMsdCommand(settings.hooks.PostToolUse), 'PostToolUse must reference a msd- managed hook');
assert.ok(hasMsdCommand(settings.hooks.PreToolUse), 'PreToolUse must reference a msd- managed hook');
});
}
// ---------------------------------------------------------------------------
// UPGRADE 3: MCP companion config — direct-unit idempotency + preservation
// (mirrors antigravity's configureAntigravityMcpConfig unit tests exactly,
// scoped to the in-memory settings object mergeGsdMcpServerIntoSettings mutates).
// scoped to the in-memory settings object mergeMsdMcpServerIntoSettings mutates).
// ---------------------------------------------------------------------------
test('mergeGsdMcpServerIntoSettings adds mcpServers.gsd with command "npx" and args including gsd-mcp-server + PACKAGE_NAME', () => {
test('mergeMsdMcpServerIntoSettings adds mcpServers.msd with command "npx" and args including msd-mcp-server + PACKAGE_NAME', () => {
const settings = {};
mergeGsdMcpServerIntoSettings(settings);
assert.ok(settings.mcpServers && settings.mcpServers.gsd, 'mcpServers.gsd must be present');
assert.equal(settings.mcpServers.gsd.command, 'npx');
assert.deepEqual(settings.mcpServers.gsd.args, ['-y', '-p', PACKAGE_NAME, 'gsd-mcp-server']);
mergeMsdMcpServerIntoSettings(settings);
assert.ok(settings.mcpServers && settings.mcpServers.msd, 'mcpServers.msd must be present');
assert.equal(settings.mcpServers.msd.command, 'npx');
assert.deepEqual(settings.mcpServers.msd.args, ['-y', '-p', PACKAGE_NAME, 'msd-mcp-server']);
});
test('mergeGsdMcpServerIntoSettings is idempotent — a second call does not clobber an existing gsd entry', () => {
test('mergeMsdMcpServerIntoSettings is idempotent — a second call does not clobber an existing msd entry', () => {
const settings = {};
mergeGsdMcpServerIntoSettings(settings);
// Simulate a user hand-edit of the gsd entry after install.
settings.mcpServers.gsd.args.push('--custom-flag');
mergeMsdMcpServerIntoSettings(settings);
// Simulate a user hand-edit of the msd entry after install.
settings.mcpServers.msd.args.push('--custom-flag');
mergeGsdMcpServerIntoSettings(settings);
mergeMsdMcpServerIntoSettings(settings);
assert.ok(settings.mcpServers.gsd.args.includes('--custom-flag'),
"a user-owned gsd override is never clobbered (Hyrum's Law)");
assert.equal(Object.keys(settings.mcpServers).length, 1, 'exactly one mcpServers entry (gsd)');
assert.ok(settings.mcpServers.msd.args.includes('--custom-flag'),
"a user-owned msd override is never clobbered (Hyrum's Law)");
assert.equal(Object.keys(settings.mcpServers).length, 1, 'exactly one mcpServers entry (msd)');
});
test('mergeGsdMcpServerIntoSettings preserves a pre-existing unrelated mcpServers entry', () => {
test('mergeMsdMcpServerIntoSettings preserves a pre-existing unrelated mcpServers entry', () => {
const settings = {
mcpServers: {
'my-own-server': { command: 'my-tool', args: ['--flag'] },
},
};
mergeGsdMcpServerIntoSettings(settings);
mergeMsdMcpServerIntoSettings(settings);
assert.deepEqual(settings.mcpServers['my-own-server'], { command: 'my-tool', args: ['--flag'] });
assert.ok(settings.mcpServers.gsd);
assert.ok(settings.mcpServers.msd);
assert.equal(Object.keys(settings.mcpServers).length, 2, 'both entries present');
});
test('mergeGsdMcpServerIntoSettings recovers a corrupted (non-object) mcpServers field', () => {
test('mergeMsdMcpServerIntoSettings recovers a corrupted (non-object) mcpServers field', () => {
const settingsArrayCase = { mcpServers: ['not', 'an', 'object'] };
mergeGsdMcpServerIntoSettings(settingsArrayCase);
assert.ok(settingsArrayCase.mcpServers.gsd, 'array mcpServers must be recovered to an object with gsd set');
mergeMsdMcpServerIntoSettings(settingsArrayCase);
assert.ok(settingsArrayCase.mcpServers.msd, 'array mcpServers must be recovered to an object with msd set');
const settingsStringCase = { mcpServers: 'corrupted-string' };
mergeGsdMcpServerIntoSettings(settingsStringCase);
assert.ok(settingsStringCase.mcpServers.gsd, 'non-object mcpServers must be recovered to an object with gsd set');
mergeMsdMcpServerIntoSettings(settingsStringCase);
assert.ok(settingsStringCase.mcpServers.msd, 'non-object mcpServers must be recovered to an object with msd set');
});
// ---------------------------------------------------------------------------
@@ -149,7 +149,7 @@ test('mergeGsdMcpServerIntoSettings recovers a corrupted (non-object) mcpServers
// ---------------------------------------------------------------------------
for (const scope of ['global', 'local']) {
test(`augment --${scope}: settings.json registers the gsd MCP companion (UPGRADE 3)`, (t) => {
test(`augment --${scope}: settings.json registers the msd MCP companion (UPGRADE 3)`, (t) => {
const { configDir, root } = runMinimalInstall({ runtime: 'augment', scope });
t.after(() => cleanup(root));
@@ -157,14 +157,14 @@ for (const scope of ['global', 'local']) {
assert.ok(fs.existsSync(settingsPath), `${settingsPath} must exist`);
const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
assert.ok(settings.mcpServers && settings.mcpServers.gsd, 'mcpServers.gsd must be present');
assert.equal(settings.mcpServers.gsd.command, 'npx');
assert.deepEqual(settings.mcpServers.gsd.args, ['-y', '-p', PACKAGE_NAME, 'gsd-mcp-server']);
assert.ok(settings.mcpServers && settings.mcpServers.msd, 'mcpServers.msd must be present');
assert.equal(settings.mcpServers.msd.command, 'npx');
assert.deepEqual(settings.mcpServers.msd.args, ['-y', '-p', PACKAGE_NAME, 'msd-mcp-server']);
});
}
test('augment --global: reinstalling does not duplicate or clobber the gsd MCP companion entry (live-install idempotency)', (t) => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-augment-mcp-idem-'));
test('augment --global: reinstalling does not duplicate or clobber the msd MCP companion entry (live-install idempotency)', (t) => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-augment-mcp-idem-'));
t.after(() => cleanup(root));
const args = [INSTALL_SCRIPT, '--augment', '--global', '--config-dir', root];
@@ -175,22 +175,22 @@ test('augment --global: reinstalling does not duplicate or clobber the gsd MCP c
const settingsPath = path.join(root, 'settings.json');
const afterFirst = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
assert.ok(afterFirst.mcpServers.gsd);
// Simulate a user hand-edit of the gsd entry between installs.
afterFirst.mcpServers.gsd.args.push('--custom-flag');
assert.ok(afterFirst.mcpServers.msd);
// Simulate a user hand-edit of the msd entry between installs.
afterFirst.mcpServers.msd.args.push('--custom-flag');
fs.writeFileSync(settingsPath, JSON.stringify(afterFirst, null, 2) + '\n');
const second = runNode(args, { env, timeoutMs: INSTALL_TIMEOUT_MS });
assert.strictEqual(second.exitCode, 0, `second install failed: ${second.stderr}`);
const afterSecond = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
assert.equal(Object.keys(afterSecond.mcpServers).length, 1, 'reinstall must not duplicate the gsd entry');
assert.ok(afterSecond.mcpServers.gsd.args.includes('--custom-flag'),
"a user-owned gsd override is never clobbered across reinstall (Hyrum's Law)");
assert.equal(Object.keys(afterSecond.mcpServers).length, 1, 'reinstall must not duplicate the msd entry');
assert.ok(afterSecond.mcpServers.msd.args.includes('--custom-flag'),
"a user-owned msd override is never clobbered across reinstall (Hyrum's Law)");
});
test('augment --global: installing preserves a pre-existing unrelated mcpServers entry (live-install preservation)', (t) => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-augment-mcp-preserve-'));
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-augment-mcp-preserve-'));
fs.mkdirSync(root, { recursive: true });
t.after(() => cleanup(root));
@@ -211,15 +211,15 @@ test('augment --global: installing preserves a pre-existing unrelated mcpServers
const settings = JSON.parse(fs.readFileSync(path.join(root, 'settings.json'), 'utf8'));
assert.deepEqual(settings.mcpServers.other, { command: 'my-tool', args: ['--flag'] },
"the user's pre-existing mcpServers entry must be preserved");
assert.ok(settings.mcpServers.gsd, 'the gsd companion entry must also be present');
assert.ok(settings.mcpServers.msd, 'the msd companion entry must also be present');
});
// ---------------------------------------------------------------------------
// Uninstall — symmetric cleanup for the MCP companion entry.
// ---------------------------------------------------------------------------
test('augment --global uninstall removes only the GSD-owned mcpServers.gsd entry, preserving user data', (t) => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-augment-uninstall-'));
test('augment --global uninstall removes only the MSD-owned mcpServers.msd entry, preserving user data', (t) => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-augment-uninstall-'));
t.after(() => cleanup(root));
const env = installerEnv({ HOME: root, USERPROFILE: root });
@@ -227,7 +227,7 @@ test('augment --global uninstall removes only the GSD-owned mcpServers.gsd entry
const installResult = runNode(installArgs, { env, timeoutMs: INSTALL_TIMEOUT_MS });
assert.strictEqual(installResult.exitCode, 0, `install failed: ${installResult.stderr}`);
// Seed user-owned data alongside GSD's contributions, post-install.
// Seed user-owned data alongside MSD's contributions, post-install.
const settingsPath = path.join(root, 'settings.json');
const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
settings.mcpServers['my-own-server'] = { command: 'my-tool', args: [] };
@@ -238,7 +238,7 @@ test('augment --global uninstall removes only the GSD-owned mcpServers.gsd entry
assert.strictEqual(uninstallResult.exitCode, 0, `uninstall failed: ${uninstallResult.stderr}`);
const settingsAfter = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
assert.equal(settingsAfter.mcpServers && settingsAfter.mcpServers.gsd, undefined, 'gsd MCP entry removed');
assert.equal(settingsAfter.mcpServers && settingsAfter.mcpServers.msd, undefined, 'msd MCP entry removed');
assert.deepEqual(settingsAfter.mcpServers['my-own-server'], { command: 'my-tool', args: [] },
'user MCP server preserved');
});