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,9 +27,9 @@ const fs = require('node:fs');
const path = require('node:path');
const { execFileSync } = require('node:child_process');
const planScan = require('../gsd-core/bin/lib/plan-scan.cjs');
const { SCOPE } = require('../gsd-core/bin/lib/planning-scope.cjs');
const coreUtils = require('../gsd-core/bin/lib/core-utils.cjs');
const planScan = require('../msd-core/bin/lib/plan-scan.cjs');
const { SCOPE } = require('../msd-core/bin/lib/planning-scope.cjs');
const coreUtils = require('../msd-core/bin/lib/core-utils.cjs');
const { createTempDir, cleanup } = require('./helpers.cjs');
const { PROBE_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
const drift = require('../scripts/lint-plan-count-drift.cjs');
@@ -226,7 +226,7 @@ const SCENARIOS = [
describe('scanPhasePlans — counting matrix (#3183 rows 1-14)', () => {
for (const scenario of SCENARIOS) {
test(`${scenario.id}: ${scenario.label}`, (t) => {
const dir = createTempDir('gsd-plan-scan-');
const dir = createTempDir('msd-plan-scan-');
t.after(() => cleanup(dir));
scenario.build(dir);
const scan = planScan(dir);
@@ -240,7 +240,7 @@ describe('scanPhasePlans — counting matrix (#3183 rows 1-14)', () => {
describe('identity guard: getPhaseFileStats output === scanPhasePlans output (row 22)', () => {
for (const scenario of SCENARIOS) {
test(`${scenario.id}: getPhaseFileStats.plans/.summaries deep-equal scanPhasePlans.planFiles/.summaryFiles`, (t) => {
const dir = createTempDir('gsd-plan-scan-identity-');
const dir = createTempDir('msd-plan-scan-identity-');
t.after(() => cleanup(dir));
scenario.build(dir);
const scan = planScan(dir);
@@ -254,7 +254,7 @@ describe('identity guard: getPhaseFileStats output === scanPhasePlans output (ro
describe('identity guard: findUnsummarizedPlans length never disagrees with summaryCount (row 23)', () => {
for (const scenario of SCENARIOS) {
test(`${scenario.id}: findUnsummarizedPlans(...).length === planFiles.length - summaryCount`, (t) => {
const dir = createTempDir('gsd-plan-scan-unsummarized-');
const dir = createTempDir('msd-plan-scan-unsummarized-');
t.after(() => cleanup(dir));
scenario.build(dir);
const scan = planScan(dir);
@@ -268,7 +268,7 @@ describe('identity guard: findUnsummarizedPlans length never disagrees with summ
describe('isPlanSuperseded — frontmatter detection edge cases', () => {
test('row18: uppercase SUPERSEDED with surrounding whitespace still detected', (t) => {
const dir = createTempDir('gsd-plan-scan-');
const dir = createTempDir('msd-plan-scan-');
t.after(() => cleanup(dir));
writeFile(dir, '01-PLAN.md', ['---', 'status: SUPERSEDED ', '---', '', '# Plan', ''].join('\n'));
writeFile(dir, '02-PLAN.md', planBody());
@@ -278,7 +278,7 @@ describe('isPlanSuperseded — frontmatter detection edge cases', () => {
});
test('row19: status: supersededX is NOT superseded (no prefix matching)', (t) => {
const dir = createTempDir('gsd-plan-scan-');
const dir = createTempDir('msd-plan-scan-');
t.after(() => cleanup(dir));
writeFile(dir, '01-PLAN.md', ['---', 'status: supersededX', '---', '', '# Plan', ''].join('\n'));
writeFile(dir, '02-PLAN.md', planBody());
@@ -288,7 +288,7 @@ describe('isPlanSuperseded — frontmatter detection edge cases', () => {
});
test('row20: CRLF line endings in a superseded plan frontmatter still detected', (t) => {
const dir = createTempDir('gsd-plan-scan-');
const dir = createTempDir('msd-plan-scan-');
t.after(() => cleanup(dir));
writeFile(dir, '01-PLAN.md', ['---', 'status: superseded', '---', '', '# Plan', ''].join('\r\n'));
writeFile(dir, '02-PLAN.md', planBody());
@@ -302,7 +302,7 @@ describe('isPlanSuperseded — frontmatter detection edge cases', () => {
describe('scope field — UNREADABLE / TRUNCATED / COMPLETE independence', () => {
test('row15: nonexistent phase dir -> scope UNREADABLE, planCount 0, getPhaseFileStats does not throw', () => {
const base = createTempDir('gsd-plan-scan-');
const base = createTempDir('msd-plan-scan-');
const missing = path.join(base, 'does-not-exist');
try {
const scan = planScan(missing);
@@ -320,7 +320,7 @@ describe('scope field — UNREADABLE / TRUNCATED / COMPLETE independence', () =>
});
test('row16: plans/ exists but readdirSync on it throws -> scope TRUNCATED, root plans still returned', (t) => {
const dir = createTempDir('gsd-plan-scan-');
const dir = createTempDir('msd-plan-scan-');
writeFile(dir, '01-PLAN.md', planBody());
const nestedDir = path.join(dir, 'plans');
fs.mkdirSync(nestedDir);
@@ -341,8 +341,8 @@ describe('scope field — UNREADABLE / TRUNCATED / COMPLETE independence', () =>
test('row17: zero plans AND dir readable -> scope COMPLETE, assertably different from row16 TRUNCATED', (t) => {
// Same zero planFiles.length as row16, but readable — must diverge in scope.
const readableEmptyDir = createTempDir('gsd-plan-scan-');
const truncatedDir = createTempDir('gsd-plan-scan-');
const readableEmptyDir = createTempDir('msd-plan-scan-');
const truncatedDir = createTempDir('msd-plan-scan-');
const nestedDir = path.join(truncatedDir, 'plans');
fs.mkdirSync(nestedDir);
const originalReaddirSync = fs.readdirSync;
@@ -386,7 +386,7 @@ describe('scope field — UNREADABLE / TRUNCATED / COMPLETE independence', () =>
// PLANNING-NOTES — inflating planCount and STATE.md's derived total_plans.
describe('#3741: the loose /PLAN/i fallback counts only a delimited PLAN token', () => {
test('REPLAN-INPUTS is not a plan — substring PLAN inside REPLAN must not count', (t) => {
const dir = createTempDir('gsd-3741-replan-');
const dir = createTempDir('msd-3741-replan-');
t.after(() => cleanup(dir));
writeFile(dir, '01-01-PLAN.md', planBody());
writeFile(dir, '01-01-REPLAN-INPUTS.md', 'Not a plan. Planning inputs document.\n');
@@ -396,7 +396,7 @@ describe('#3741: the loose /PLAN/i fallback counts only a delimited PLAN token',
});
test('PLANNING-* and *-NOTES documents are not plans', (t) => {
const dir = createTempDir('gsd-3741-notes-');
const dir = createTempDir('msd-3741-notes-');
t.after(() => cleanup(dir));
writeFile(dir, '01-01-PLAN.md', planBody());
writeFile(dir, '01-PLANNING-INPUTS.md', 'inputs\n');
@@ -410,7 +410,7 @@ describe('#3741: the loose /PLAN/i fallback counts only a delimited PLAN token',
});
test('legacy PLAN-token+numeric names still count via the anchored fallback', (t) => {
const dir = createTempDir('gsd-3741-legacy-');
const dir = createTempDir('msd-3741-legacy-');
t.after(() => cleanup(dir));
writeFile(dir, '01-PLAN-02.md', planBody());
const scan = planScan(dir);
@@ -419,9 +419,9 @@ describe('#3741: the loose /PLAN/i fallback counts only a delimited PLAN token',
});
test('legacy PLAN-token + numeric + slug names still count (#3128 shape, #3741 review)', (t) => {
const dir = createTempDir('gsd-3741-slug-');
const dir = createTempDir('msd-3741-slug-');
t.after(() => cleanup(dir));
// gsd-plan-phase writes this form; #3128 is the historical bug where
// msd-plan-phase writes this form; #3128 is the historical bug where
// dropping it made plan_count read 0. The anchor must keep it.
writeFile(dir, '3-PLAN-01-setup.md', planBody());
const scan = planScan(dir);
@@ -432,7 +432,7 @@ describe('#3741: the loose /PLAN/i fallback counts only a delimited PLAN token',
describe('case sensitivity: plan.md/Plan.md counted, summary.md/Summary.md NOT (#3183 asymmetry)', () => {
test('lowercase plan.md is counted as a plan (loose /PLAN/i fallback is case-insensitive)', (t) => {
const dir = createTempDir('gsd-plan-scan-case-');
const dir = createTempDir('msd-plan-scan-case-');
t.after(() => cleanup(dir));
writeFile(dir, 'plan.md', planBody());
const scan = planScan(dir);
@@ -444,7 +444,7 @@ describe('case sensitivity: plan.md/Plan.md counted, summary.md/Summary.md NOT (
});
test('mixed-case Plan.md is counted as a plan (loose /PLAN/i fallback is case-insensitive)', (t) => {
const dir = createTempDir('gsd-plan-scan-case-');
const dir = createTempDir('msd-plan-scan-case-');
t.after(() => cleanup(dir));
writeFile(dir, 'Plan.md', planBody());
const scan = planScan(dir);
@@ -456,7 +456,7 @@ describe('case sensitivity: plan.md/Plan.md counted, summary.md/Summary.md NOT (
});
test('lowercase summary.md is NOT counted as a summary (isRootSummaryFile is case-sensitive)', (t) => {
const dir = createTempDir('gsd-plan-scan-case-');
const dir = createTempDir('msd-plan-scan-case-');
t.after(() => cleanup(dir));
writeFile(dir, '01-PLAN.md', planBody());
writeFile(dir, 'summary.md', summaryBody());
@@ -470,7 +470,7 @@ describe('case sensitivity: plan.md/Plan.md counted, summary.md/Summary.md NOT (
});
test('mixed-case Summary.md is NOT counted as a summary (isRootSummaryFile is case-sensitive)', (t) => {
const dir = createTempDir('gsd-plan-scan-case-');
const dir = createTempDir('msd-plan-scan-case-');
t.after(() => cleanup(dir));
writeFile(dir, '01-PLAN.md', planBody());
writeFile(dir, 'Summary.md', summaryBody());
@@ -518,7 +518,7 @@ describe('summaryCandidates canonical-id form — long PLAN stem matches short S
});
test('same pairing, real directory: scanPhasePlans + validate health emit zero I001', (t) => {
const dir = createTempDir('gsd-plan-count-i001-');
const dir = createTempDir('msd-plan-count-i001-');
t.after(() => cleanup(dir));
writeFile(dir, '68-01-scaffolding-PLAN.md', frontmatterBlock({ wave: 1 }));
writeFile(dir, '68-01-SUMMARY.md', summaryBody());
@@ -635,7 +635,7 @@ describe('findRegexLiteralMdMatch — literal tokenizer (ReDoS + character-class
// of either ladder. The one real numeric limit in this module,
// MAX_REGEX_LITERAL_LEN, gets true limit-1/limit/limit+1 coverage in the
// readRegexLiteralAt test below.
const dir = createTempDir('gsd-plan-count-drift-redos-');
const dir = createTempDir('msd-plan-count-drift-redos-');
t.after(() => cleanup(dir));
const guardPath = path.join(__dirname, '..', 'scripts', 'lint-plan-count-drift.cjs');
@@ -827,7 +827,7 @@ describe('findRegexLiteralMdMatch — literal tokenizer (ReDoS + character-class
}
test('(a) a symlinked .cts INSIDE the root IS scanned, reported under its canonical real path', { skip }, (t) => {
const root = createTempDir('gsd-plan-count-drift-root-');
const root = createTempDir('msd-plan-count-drift-root-');
t.after(() => cleanup(root));
fs.mkdirSync(path.join(root, 'src'), { recursive: true });
fs.mkdirSync(path.join(root, 'vendor'), { recursive: true });
@@ -841,8 +841,8 @@ describe('findRegexLiteralMdMatch — literal tokenizer (ReDoS + character-class
});
test('(b) a symlinked .cts pointing OUTSIDE the root is NOT scanned: zero violations reported', { skip }, (t) => {
const root = createTempDir('gsd-plan-count-drift-root-');
const outside = createTempDir('gsd-plan-count-drift-outside-');
const root = createTempDir('msd-plan-count-drift-root-');
const outside = createTempDir('msd-plan-count-drift-outside-');
t.after(() => cleanup(root));
t.after(() => cleanup(outside));
fs.mkdirSync(path.join(root, 'src'), { recursive: true });
@@ -855,8 +855,8 @@ describe('findRegexLiteralMdMatch — literal tokenizer (ReDoS + character-class
});
test('(c) a directory symlink pointing OUTSIDE the root is not descended into', { skip }, (t) => {
const root = createTempDir('gsd-plan-count-drift-root-');
const outside = createTempDir('gsd-plan-count-drift-outside-');
const root = createTempDir('msd-plan-count-drift-root-');
const outside = createTempDir('msd-plan-count-drift-outside-');
t.after(() => cleanup(root));
t.after(() => cleanup(outside));
fs.mkdirSync(path.join(root, 'src'), { recursive: true });
@@ -870,7 +870,7 @@ describe('findRegexLiteralMdMatch — literal tokenizer (ReDoS + character-class
});
test('(d) a symlink CYCLE terminates rather than recursing forever, and dedupes the real file', { skip }, (t) => {
const root = createTempDir('gsd-plan-count-drift-root-');
const root = createTempDir('msd-plan-count-drift-root-');
t.after(() => cleanup(root));
const srcDir = path.join(root, 'src');
fs.mkdirSync(srcDir, { recursive: true });
@@ -882,7 +882,7 @@ describe('findRegexLiteralMdMatch — literal tokenizer (ReDoS + character-class
});
test('(e) a BROKEN symlink is skipped without throwing', { skip }, (t) => {
const root = createTempDir('gsd-plan-count-drift-root-');
const root = createTempDir('msd-plan-count-drift-root-');
t.after(() => cleanup(root));
const srcDir = path.join(root, 'src');
fs.mkdirSync(srcDir, { recursive: true });
@@ -893,7 +893,7 @@ describe('findRegexLiteralMdMatch — literal tokenizer (ReDoS + character-class
});
test('(f) two symlinks inside the root to the SAME real file yield ONE entry, not two', { skip }, (t) => {
const root = createTempDir('gsd-plan-count-drift-root-');
const root = createTempDir('msd-plan-count-drift-root-');
t.after(() => cleanup(root));
fs.mkdirSync(path.join(root, 'src'), { recursive: true });
fs.mkdirSync(path.join(root, 'vendor'), { recursive: true });