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

@@ -6,7 +6,7 @@
* Fixture trees leak under os.tmpdir() on the success path; on a tmpfs /tmp a full
* `npm test` exhausts the filesystem and the failure surfaces as misleading EDQUOT
* (-122) copyfile errors in whichever suite runs next. The fix bounds the run: a
* dedicated `gsd-test-run-*` root repointed via TMPDIR (so every child's
* dedicated `msd-test-run-*` root repointed via TMPDIR (so every child's
* mkdtempSync(os.tmpdir()) lands inside it), a sweep between chunks that spares the
* two reserved sandboxes, a leak-count fail-fast, and removal on exit.
*
@@ -63,7 +63,7 @@ describe('#4020 — run-tests temp root', () => {
`;
test('setupRunTempRoot creates a dedicated run temp root and repoints the env', (t) => {
const outer = createTempDir('gsd-4020-outer-');
const outer = createTempDir('msd-4020-outer-');
t.after(() => cleanup(outer));
const r = runNode(['-e', setupProbe], {
@@ -72,8 +72,8 @@ describe('#4020 — run-tests temp root', () => {
});
assert.equal(r.exitCode, 0, `probe failed: ${r.stderr.slice(-300)}`);
const out = JSON.parse(r.stdout.trim().split(/\n/).pop());
assert.ok(out.base.startsWith('gsd-test-run-'),
'the root is a gsd-test-run-* directory, so a sweep is scoped to it');
assert.ok(out.base.startsWith('msd-test-run-'),
'the root is a msd-test-run-* directory, so a sweep is scoped to it');
assert.equal(out.parent, outer,
'the root lives INSIDE the operator-provided TMPDIR, preserving the workaround');
assert.equal(out.TMPDIR, out.root, 'TMPDIR is repointed so children allocate inside the root');
@@ -83,12 +83,12 @@ describe('#4020 — run-tests temp root', () => {
});
test('setupRunTempRoot is idempotent for nested run-tests spawns', (t) => {
// Mirrors the GSD_HOME sandbox contract: a nested run-tests spawn (the harness
// Mirrors the MSD_HOME sandbox contract: a nested run-tests spawn (the harness
// regression test) inherits the root via env and must REUSE it, never mkdtemp a
// fresh root per invocation.
const probe = setupProbe.replace('const root = runner.setupRunTempRoot();',
'const first = runner.setupRunTempRoot(); const root = runner.setupRunTempRoot(); console.error(JSON.stringify({ reuse: root === first }));');
const outer = createTempDir('gsd-4020-idem-');
const outer = createTempDir('msd-4020-idem-');
t.after(() => cleanup(outer));
const r = runNode(['-e', probe], {
@@ -104,52 +104,52 @@ describe('#4020 — run-tests temp root', () => {
const runner = require('../scripts/run-tests.cjs');
assert.equal(typeof runner.sweepRunTempRoot, 'function',
'the runner must export sweepRunTempRoot for in-process verification');
const root = createTempDir('gsd-test-run-sweep-');
const root = createTempDir('msd-test-run-sweep-');
t.after(() => cleanup(root));
for (const name of ['gsd-2930-overlay-a', 'gsd-slurm-b', 'spec-section-c', 'unprefixed-d']) {
for (const name of ['msd-2930-overlay-a', 'msd-slurm-b', 'spec-section-c', 'unprefixed-d']) {
fs.mkdirSync(path.join(root, name));
}
fs.mkdirSync(path.join(root, 'gsd-test-home-keep'));
fs.writeFileSync(path.join(root, 'gsd-run-tests-events-keep'), '');
fs.mkdirSync(path.join(root, 'msd-test-home-keep'));
fs.writeFileSync(path.join(root, 'msd-run-tests-events-keep'), '');
const removed = runner.sweepRunTempRoot(root);
assert.equal(removed, 4, 'exactly the four leaked fixture entries are removed');
for (const name of ['gsd-2930-overlay-a', 'gsd-slurm-b', 'spec-section-c', 'unprefixed-d']) {
for (const name of ['msd-2930-overlay-a', 'msd-slurm-b', 'spec-section-c', 'unprefixed-d']) {
assert.ok(!fs.existsSync(path.join(root, name)), `${name} removed`);
}
assert.ok(fs.existsSync(path.join(root, 'gsd-test-home-keep')),
'the GSD_HOME sandbox survives the sweep (nested-spawn reuse contract)');
assert.ok(fs.existsSync(path.join(root, 'gsd-run-tests-events-keep')),
assert.ok(fs.existsSync(path.join(root, 'msd-test-home-keep')),
'the MSD_HOME sandbox survives the sweep (nested-spawn reuse contract)');
assert.ok(fs.existsSync(path.join(root, 'msd-run-tests-events-keep')),
'the events dir survives the sweep (timeout diagnostics)');
// #4020 CI fix: ancestors of the runner's own selected files must survive —
// the harness stages synthetic test files under the temp root and later
// chunks still need them (tests/run-tests-harness.test.cjs #3597).
for (const name of ['gsd-leak-x', 'gsd-leak-y']) fs.mkdirSync(path.join(root, name));
const protectedSwept = runner.sweepRunTempRoot(root, new Set([path.join(root, 'gsd-leak-x')]));
for (const name of ['msd-leak-x', 'msd-leak-y']) fs.mkdirSync(path.join(root, name));
const protectedSwept = runner.sweepRunTempRoot(root, new Set([path.join(root, 'msd-leak-x')]));
assert.equal(protectedSwept, 1, 'only the unprotected entry is removed');
assert.ok(fs.existsSync(path.join(root, 'gsd-leak-x')), 'the protected entry survives');
assert.ok(!fs.existsSync(path.join(root, 'gsd-leak-y')), 'the unprotected entry is removed');
assert.ok(fs.existsSync(path.join(root, 'msd-leak-x')), 'the protected entry survives');
assert.ok(!fs.existsSync(path.join(root, 'msd-leak-y')), 'the unprotected entry is removed');
});
test('the leak guard fails fast naming the leaked roots', (t) => {
const runner = require('../scripts/run-tests.cjs');
assert.equal(typeof runner.assertTempRootBounded, 'function',
'the runner must export assertTempRootBounded for in-process verification');
const root = createTempDir('gsd-test-run-guard-');
const root = createTempDir('msd-test-run-guard-');
t.after(() => cleanup(root));
// Boundary: at the limit it passes (limit-1 and limit), at limit+1 it throws.
for (let i = 0; i < 3; i++) fs.mkdirSync(path.join(root, `gsd-leak-${i}`));
for (let i = 0; i < 3; i++) fs.mkdirSync(path.join(root, `msd-leak-${i}`));
assert.doesNotThrow(() => runner.assertTempRootBounded(root, 3), 'residue at the limit passes');
assert.throws(
() => runner.assertTempRootBounded(root, 2),
(err) => /temp root leak/i.test(err.message) && err.message.includes('gsd-leak-0'),
(err) => /temp root leak/i.test(err.message) && err.message.includes('msd-leak-0'),
'one over the limit throws a message naming the leaked roots (not EDQUOT)');
});
test('the runner removes its temp root on exit', (t) => {
const sandbox = createTempDir('gsd-4020-spawn-');
const sandbox = createTempDir('msd-4020-spawn-');
t.after(() => cleanup(sandbox));
// A single trivial real test file so the runner has work to do and exits 0.
const target = path.join(__dirname, 'helpers-4020-probe.test.cjs');
@@ -173,7 +173,7 @@ describe('#4020 — run-tests temp root', () => {
// #4020 review: the harness regression test spawns run-tests INSIDE a live
// run — the nested process must reuse the outer root and leave it standing
// on ITS exit, or the outer suite mass-ENOENTs every later fixture.
const inherited = createTempDir('gsd-test-run-inherited');
const inherited = createTempDir('msd-test-run-inherited');
t.after(() => cleanup(inherited));
const target = path.join(__dirname, 'helpers-4020-probe.test.cjs');
fs.writeFileSync(target, "require('node:test').test('noop #4020 nested', () => {});\n");
@@ -195,7 +195,7 @@ describe('#4020 — run-tests temp root', () => {
// OWNER-ONLY SWEEP: the nested runner runs while the OUTER chunk's sibling
// test files may be live — it must not sweep THEIR fixtures out from under
// them (macOS CI: template.test.cjs lost its plan file to exactly that).
const sibling = path.join(inherited, 'gsd-sibling-live-fixture');
const sibling = path.join(inherited, 'msd-sibling-live-fixture');
fs.mkdirSync(sibling);
const r2 = runNode(
[RUNNER, '--files', path.basename(target)],
@@ -245,7 +245,7 @@ describe('#4020 — run-tests temp root', () => {
// selected test files are in the repo checkout), walked with the
// Windows dirname implementation whose drive-root is NOT length 1.
const selected = ['C:\\repo\\tests\\a\\b.test.cjs'];
const runTempRoot = 'C:\\Users\\ci\\AppData\\Local\\Temp\\gsd-test-run-xyz';
const runTempRoot = 'C:\\Users\\ci\\AppData\\Local\\Temp\\msd-test-run-xyz';
const protectSet = runner.computeSweepProtectSet(
selected, runTempRoot, boundedDirname(win32.dirname),
@@ -263,7 +263,7 @@ describe('#4020 — run-tests temp root', () => {
test('terminates and protects ancestors on win32 paths INSIDE runTempRoot (exact-file case)', () => {
const runner = require('../scripts/run-tests.cjs');
const win32 = require('node:path').win32;
const runTempRoot = 'C:\\Users\\ci\\AppData\\Local\\Temp\\gsd-test-run-xyz';
const runTempRoot = 'C:\\Users\\ci\\AppData\\Local\\Temp\\msd-test-run-xyz';
const selected = [`${runTempRoot}\\fixture\\nested\\c.test.cjs`];
const protectSet = runner.computeSweepProtectSet(
@@ -281,7 +281,7 @@ describe('#4020 — run-tests temp root', () => {
const runner = require('../scripts/run-tests.cjs');
const posix = require('node:path').posix;
const selected = ['/repo/tests/a/b.test.cjs'];
const runTempRoot = '/synthetic-root/gsd-test-run-xyz';
const runTempRoot = '/synthetic-root/msd-test-run-xyz';
const protectSet = runner.computeSweepProtectSet(
selected, runTempRoot, boundedDirname(posix.dirname),
@@ -298,7 +298,7 @@ describe('#4020 — run-tests temp root', () => {
test('exact-file case on posix: selected file lies directly under runTempRoot', () => {
const runner = require('../scripts/run-tests.cjs');
const posix = require('node:path').posix;
const runTempRoot = '/synthetic-root/gsd-test-run-xyz';
const runTempRoot = '/synthetic-root/msd-test-run-xyz';
const selected = [runTempRoot];
const protectSet = runner.computeSweepProtectSet(
@@ -311,7 +311,7 @@ describe('#4020 — run-tests temp root', () => {
const runner = require('../scripts/run-tests.cjs');
const path = require('node:path');
const os = require('node:os');
const runTempRoot = path.join(os.tmpdir(), 'gsd-test-run-default');
const runTempRoot = path.join(os.tmpdir(), 'msd-test-run-default');
const selected = [path.join(runTempRoot, 'fixture', 'd.test.cjs')];
const protectSet = runner.computeSweepProtectSet(selected, runTempRoot);