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

@@ -27,7 +27,7 @@ const { cleanup } = require('./helpers.cjs');
/** Create a temp repo with given files (keys = relative paths, values = content). */
function makeFixture(files) {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-test-'));
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-test-'));
for (const [rel, content] of Object.entries(files)) {
const abs = path.join(dir, rel);
fs.mkdirSync(path.dirname(abs), { recursive: true });
@@ -155,24 +155,24 @@ test('PR_EXCLUDED_SUITES contains install and slow; PR_FULL_SUITES excludes them
test('resolveBaseRef prefers explicit env override', () => {
const original = {
GSD_AFFECTED_BASE: process.env.GSD_AFFECTED_BASE,
MSD_AFFECTED_BASE: process.env.MSD_AFFECTED_BASE,
GITHUB_BASE_REF: process.env.GITHUB_BASE_REF,
};
try {
process.env.GSD_AFFECTED_BASE = 'origin/next';
process.env.MSD_AFFECTED_BASE = 'origin/next';
process.env.GITHUB_BASE_REF = 'main';
assert.equal(resolveBaseRef(), 'origin/next');
delete process.env.GSD_AFFECTED_BASE;
delete process.env.MSD_AFFECTED_BASE;
process.env.GITHUB_BASE_REF = 'next';
assert.equal(resolveBaseRef(), 'origin/next');
delete process.env.GSD_AFFECTED_BASE;
delete process.env.MSD_AFFECTED_BASE;
delete process.env.GITHUB_BASE_REF;
assert.equal(resolveBaseRef(), 'origin/main');
} finally {
if (original.GSD_AFFECTED_BASE === undefined) delete process.env.GSD_AFFECTED_BASE;
else process.env.GSD_AFFECTED_BASE = original.GSD_AFFECTED_BASE;
if (original.MSD_AFFECTED_BASE === undefined) delete process.env.MSD_AFFECTED_BASE;
else process.env.MSD_AFFECTED_BASE = original.MSD_AFFECTED_BASE;
if (original.GITHUB_BASE_REF === undefined) delete process.env.GITHUB_BASE_REF;
else process.env.GITHUB_BASE_REF = original.GITHUB_BASE_REF;
}
@@ -180,22 +180,22 @@ test('resolveBaseRef prefers explicit env override', () => {
// ---------------------------------------------------------------------------
// NEW: Transitive test (RED against old code)
// Fixture: tests/t.test.cjs -> ../gsd-core/bin/lib/depA.cjs -> ./depB.cjs
// Changed: gsd-core/bin/lib/depB.cjs
// Fixture: tests/t.test.cjs -> ../msd-core/bin/lib/depA.cjs -> ./depB.cjs
// Changed: msd-core/bin/lib/depB.cjs
// Expected: tests/t.test.cjs is selected
// ---------------------------------------------------------------------------
test('transitive: changing a deep dependency selects the test that depends on it', (t) => {
const dir = makeFixture({
'gsd-core/bin/lib/depB.cjs': `'use strict';\nmodule.exports = { b: 1 };\n`,
'gsd-core/bin/lib/depA.cjs': `'use strict';\nconst depB = require('./depB.cjs');\nmodule.exports = { a: depB };\n`,
'tests/t.test.cjs': `'use strict';\nconst depA = require('../gsd-core/bin/lib/depA.cjs');\n`,
'msd-core/bin/lib/depB.cjs': `'use strict';\nmodule.exports = { b: 1 };\n`,
'msd-core/bin/lib/depA.cjs': `'use strict';\nconst depB = require('./depB.cjs');\nmodule.exports = { a: depB };\n`,
'tests/t.test.cjs': `'use strict';\nconst depA = require('../msd-core/bin/lib/depA.cjs');\n`,
});
t.after(() => cleanup(dir));
const reverseIndex = buildTransitiveReverseIndex(dir, ['tests/t.test.cjs']);
const selected = pickAffectedTests(
['gsd-core/bin/lib/depB.cjs'],
['msd-core/bin/lib/depB.cjs'],
['tests/t.test.cjs'],
reverseIndex,
);
@@ -212,16 +212,16 @@ test('transitive: changing a deep dependency selects the test that depends on it
test('adversarial(a): cycle depA<->depB — changing depA selects test, no hang', (t) => {
const dir = makeFixture({
'gsd-core/bin/lib/depA.cjs': `'use strict';\nconst depB = require('./depB.cjs');\nmodule.exports = {};\n`,
'gsd-core/bin/lib/depB.cjs': `'use strict';\nconst depA = require('./depA.cjs');\nmodule.exports = {};\n`,
'tests/cycle.test.cjs': `'use strict';\nconst depA = require('../gsd-core/bin/lib/depA.cjs');\n`,
'msd-core/bin/lib/depA.cjs': `'use strict';\nconst depB = require('./depB.cjs');\nmodule.exports = {};\n`,
'msd-core/bin/lib/depB.cjs': `'use strict';\nconst depA = require('./depA.cjs');\nmodule.exports = {};\n`,
'tests/cycle.test.cjs': `'use strict';\nconst depA = require('../msd-core/bin/lib/depA.cjs');\n`,
});
t.after(() => cleanup(dir));
// Must complete without hanging
const reverseIndex = buildTransitiveReverseIndex(dir, ['tests/cycle.test.cjs']);
const selected = pickAffectedTests(
['gsd-core/bin/lib/depA.cjs'],
['msd-core/bin/lib/depA.cjs'],
['tests/cycle.test.cjs'],
reverseIndex,
);
@@ -235,7 +235,7 @@ test('adversarial(a): cycle depA<->depB — changing depA selects test, no hang'
test('adversarial(b): missing require (gone file) — null resolve, no crash', (t) => {
const dir = makeFixture({
// Requires a file that does not exist
'tests/missing.test.cjs': `'use strict';\nconst x = require('../gsd-core/bin/lib/gone.cjs');\n`,
'tests/missing.test.cjs': `'use strict';\nconst x = require('../msd-core/bin/lib/gone.cjs');\n`,
});
t.after(() => cleanup(dir));
@@ -247,7 +247,7 @@ test('adversarial(b): missing require (gone file) — null resolve, no crash', (
// Changing the missing file produces no selection (it doesn't exist, so no dependents)
const selected = pickAffectedTests(
['gsd-core/bin/lib/gone.cjs'],
['msd-core/bin/lib/gone.cjs'],
['tests/missing.test.cjs'],
reverseIndex,
);
@@ -258,14 +258,14 @@ test('adversarial(b): missing require (gone file) — null resolve, no crash', (
test('adversarial(c): .json dependency — changing data.json selects the test', (t) => {
const dir = makeFixture({
'gsd-core/bin/lib/data.json': `{"key":"value"}`,
'tests/json.test.cjs': `'use strict';\nconst data = require('../gsd-core/bin/lib/data.json');\n`,
'msd-core/bin/lib/data.json': `{"key":"value"}`,
'tests/json.test.cjs': `'use strict';\nconst data = require('../msd-core/bin/lib/data.json');\n`,
});
t.after(() => cleanup(dir));
const reverseIndex = buildTransitiveReverseIndex(dir, ['tests/json.test.cjs']);
const selected = pickAffectedTests(
['gsd-core/bin/lib/data.json'],
['msd-core/bin/lib/data.json'],
['tests/json.test.cjs'],
reverseIndex,
);
@@ -278,15 +278,15 @@ test('adversarial(c): .json dependency — changing data.json selects the test',
test('adversarial(d): re-export chain — changing depB selects the test that requires the re-exporter', (t) => {
const dir = makeFixture({
'gsd-core/bin/lib/depB.cjs': `'use strict';\nmodule.exports = { deep: true };\n`,
'gsd-core/bin/lib/reexporter.cjs': `'use strict';\nmodule.exports = require('./depB.cjs');\n`,
'tests/reexport.test.cjs': `'use strict';\nconst x = require('../gsd-core/bin/lib/reexporter.cjs');\n`,
'msd-core/bin/lib/depB.cjs': `'use strict';\nmodule.exports = { deep: true };\n`,
'msd-core/bin/lib/reexporter.cjs': `'use strict';\nmodule.exports = require('./depB.cjs');\n`,
'tests/reexport.test.cjs': `'use strict';\nconst x = require('../msd-core/bin/lib/reexporter.cjs');\n`,
});
t.after(() => cleanup(dir));
const reverseIndex = buildTransitiveReverseIndex(dir, ['tests/reexport.test.cjs']);
const selected = pickAffectedTests(
['gsd-core/bin/lib/depB.cjs'],
['msd-core/bin/lib/depB.cjs'],
['tests/reexport.test.cjs'],
reverseIndex,
);
@@ -313,7 +313,7 @@ test('adversarial(e): bare and node: specifiers are ignored', () => {
test('adversarial(f): WIDEN — changing a src file with no test dependents widens to unit/all', (t) => {
// orphan.cjs is a source file no test file requires (statically)
const dir = makeFixture({
'gsd-core/bin/lib/orphan.cjs': `'use strict';\nmodule.exports = {};\n`,
'msd-core/bin/lib/orphan.cjs': `'use strict';\nmodule.exports = {};\n`,
'tests/unrelated.test.cjs': `'use strict';\n// requires nothing\n`,
});
t.after(() => cleanup(dir));
@@ -321,7 +321,7 @@ test('adversarial(f): WIDEN — changing a src file with no test dependents wide
const reverseIndex = buildTransitiveReverseIndex(dir, ['tests/unrelated.test.cjs']);
// Verify orphan.cjs has no dependents in the index
const dependents = reverseIndex.get('gsd-core/bin/lib/orphan.cjs');
const dependents = reverseIndex.get('msd-core/bin/lib/orphan.cjs');
assert.ok(
!dependents || dependents.size === 0,
'orphan.cjs must have no transitive test dependents',
@@ -329,7 +329,7 @@ test('adversarial(f): WIDEN — changing a src file with no test dependents wide
// The widen backstop is tested via the WIDEN_SIGNAL attached to pickAffectedTests result
const selected = pickAffectedTests(
['gsd-core/bin/lib/orphan.cjs'],
['msd-core/bin/lib/orphan.cjs'],
['tests/unrelated.test.cjs'],
reverseIndex,
{ detectWiden: true },
@@ -345,7 +345,7 @@ test('adversarial(g): dynamic require in changed file with no static dependents
// dynamic.cjs uses a template literal require — not statically parseable
// No test requires dynamic.cjs statically
const dir = makeFixture({
'gsd-core/bin/lib/dynamic.cjs': `'use strict';\nconst x = 'foo';\nconst m = require(\`./\${x}\`);\nmodule.exports = {};\n`,
'msd-core/bin/lib/dynamic.cjs': `'use strict';\nconst x = 'foo';\nconst m = require(\`./\${x}\`);\nmodule.exports = {};\n`,
'tests/unrelated.test.cjs': `'use strict';\n// does not require dynamic.cjs\n`,
});
t.after(() => cleanup(dir));
@@ -353,7 +353,7 @@ test('adversarial(g): dynamic require in changed file with no static dependents
const reverseIndex = buildTransitiveReverseIndex(dir, ['tests/unrelated.test.cjs']);
const selected = pickAffectedTests(
['gsd-core/bin/lib/dynamic.cjs'],
['msd-core/bin/lib/dynamic.cjs'],
['tests/unrelated.test.cjs'],
reverseIndex,
{ detectWiden: true },
@@ -532,7 +532,7 @@ test('regression(delete-only-source): deleting a source file triggers widen, nev
// must trigger the widen backstop — gone.cjs has no static dependents because
// it was never built into the forward graph (it doesn't exist).
const dir = makeFixture({
'gsd-core/bin/lib/other.cjs': `'use strict';\nmodule.exports = {};\n`,
'msd-core/bin/lib/other.cjs': `'use strict';\nmodule.exports = {};\n`,
'tests/unrelated.test.cjs': `'use strict';\n// requires nothing from gone.cjs\n`,
});
t.after(() => cleanup(dir));
@@ -542,7 +542,7 @@ test('regression(delete-only-source): deleting a source file triggers widen, nev
const reverseIndex = buildTransitiveReverseIndex(dir, allTests);
// gone.cjs does not exist in the fixture — simulates a delete-only PR.
const changedFiles = ['gsd-core/bin/lib/gone.cjs'];
const changedFiles = ['msd-core/bin/lib/gone.cjs'];
const selected = pickAffectedTests(changedFiles, allTests, reverseIndex, { detectWiden: true });
@@ -591,8 +591,8 @@ test('regression(rename-stale-old-path): deleted old path triggers widen, protec
// dependents → widen backstop fires → mode:suites (PR_FULL_SUITES).
const dir = makeFixture({
// newname.cjs exists; oldname.cjs intentionally absent (it was renamed away)
'gsd-core/bin/lib/newname.cjs': `'use strict';\nmodule.exports = { v: 2 };\n`,
'tests/newname.test.cjs': `'use strict';\nconst x = require('../gsd-core/bin/lib/newname.cjs');\n`,
'msd-core/bin/lib/newname.cjs': `'use strict';\nmodule.exports = { v: 2 };\n`,
'tests/newname.test.cjs': `'use strict';\nconst x = require('../msd-core/bin/lib/newname.cjs');\n`,
'tests/unrelated.test.cjs': `'use strict';\n// no dependency on oldname or newname\n`,
});
t.after(() => cleanup(dir));
@@ -604,12 +604,12 @@ test('regression(rename-stale-old-path): deleted old path triggers widen, protec
// changedFiles mirrors what --no-renames git diff emits for a rename:
// Delete(old) + Add(new)
const changedFiles = [
'gsd-core/bin/lib/oldname.cjs', // deleted old path — absent from disk
'gsd-core/bin/lib/newname.cjs', // added new path — present on disk
'msd-core/bin/lib/oldname.cjs', // deleted old path — absent from disk
'msd-core/bin/lib/newname.cjs', // added new path — present on disk
];
// Assert: oldname.cjs must have zero static dependents (not in graph)
const oldDependents = reverseIndex.get('gsd-core/bin/lib/oldname.cjs');
const oldDependents = reverseIndex.get('msd-core/bin/lib/oldname.cjs');
assert.ok(
!oldDependents || oldDependents.size === 0,
`oldname.cjs must have no static dependents (absent from disk), got: ${JSON.stringify(oldDependents && [...oldDependents])}`,
@@ -702,8 +702,8 @@ test('listTestFiles: subdir test files are included and selectable by pickAffect
// tests/dispatch/, tests/observability/, tests/installer-migrations/).
const dir = makeFixture({
'tests/root.test.cjs': `'use strict';\n// root level test\n`,
'tests/dispatch/agent-dispatch.test.cjs': `'use strict';\nconst lib = require('../../gsd-core/bin/lib/dispatch.cjs');\n`,
'gsd-core/bin/lib/dispatch.cjs': `'use strict';\nmodule.exports = { dispatch: true };\n`,
'tests/dispatch/agent-dispatch.test.cjs': `'use strict';\nconst lib = require('../../msd-core/bin/lib/dispatch.cjs');\n`,
'msd-core/bin/lib/dispatch.cjs': `'use strict';\nmodule.exports = { dispatch: true };\n`,
});
t.after(() => cleanup(dir));