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

@@ -3,10 +3,10 @@
/**
* tests/compact-content-variant-guard.test.cjs — ADR-4139, epic #4139, Phase 6 (#4406).
*
* Implements the four mechanical checks `.gsd/phase/enhance-4406-lazy-remainder/40-design.md`
* Implements the four mechanical checks `.msd/phase/enhance-4406-lazy-remainder/40-design.md`
* describes for the variant-swap shape (two independent, complete files; the gate picks which
* one gets `Read`) covering `gsd-core/workflows/<name>/{modes,steps,templates}/*.compact.md`
* and `gsd-core/templates/**\/*.compact.md`. This is a DIFFERENT shape from
* one gets `Read`) covering `msd-core/workflows/<name>/{modes,steps,templates}/*.compact.md`
* and `msd-core/templates/**\/*.compact.md`. This is a DIFFERENT shape from
* `tests/compact-content-partition-guard.test.cjs` (stream 1's spine+detail partition) — see
* `tests/helpers/compact-content-variant.cjs` for why disjointness/completeness do not apply
* here. Template consumer parity (the fifth check) lives in its own file,
@@ -67,13 +67,13 @@ describe('compact-content variant guard — real repo state (ADR-4139, Phase 6 #
describe('failing-first fixture: check 1 (registration)', () => {
test('RED — a .compact.md file exists with no canonical sibling (orphan)', () => {
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-variant-orphan-'));
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-variant-orphan-'));
try {
const workflowsDir = path.join(tmpRoot, 'gsd-core', 'workflows', 'foo', 'steps');
const workflowsDir = path.join(tmpRoot, 'msd-core', 'workflows', 'foo', 'steps');
fs.mkdirSync(workflowsDir, { recursive: true });
fs.writeFileSync(path.join(workflowsDir, 'bar.compact.md'), 'Compact content with no canonical pair.\n');
const pairs = discoverRegisteredVariants([path.join(tmpRoot, 'gsd-core', 'workflows')]);
const pairs = discoverRegisteredVariants([path.join(tmpRoot, 'msd-core', 'workflows')]);
const violations = checkRegistration(pairs);
assert.ok(violations.length > 0, 'expected at least one registration violation');
assert.ok(
@@ -86,14 +86,14 @@ describe('failing-first fixture: check 1 (registration)', () => {
});
test('GREEN — the canonical sibling is added', () => {
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-variant-orphan-ok-'));
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-variant-orphan-ok-'));
try {
const workflowsDir = path.join(tmpRoot, 'gsd-core', 'workflows', 'foo', 'steps');
const workflowsDir = path.join(tmpRoot, 'msd-core', 'workflows', 'foo', 'steps');
fs.mkdirSync(workflowsDir, { recursive: true });
fs.writeFileSync(path.join(workflowsDir, 'bar.compact.md'), 'Terser.\n');
fs.writeFileSync(path.join(workflowsDir, 'bar.md'), 'Canonical, longer content.\n');
const pairs = discoverRegisteredVariants([path.join(tmpRoot, 'gsd-core', 'workflows')]);
const pairs = discoverRegisteredVariants([path.join(tmpRoot, 'msd-core', 'workflows')]);
const violations = checkRegistration(pairs);
assert.deepStrictEqual(violations, []);
} finally {
@@ -104,9 +104,9 @@ describe('failing-first fixture: check 1 (registration)', () => {
describe('failing-first fixture: check 2 (reachability)', () => {
test('RED — a registered pair whose compact path is never named by any spine', () => {
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-variant-unreached-'));
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-variant-unreached-'));
try {
const workflowsRoot = path.join(tmpRoot, 'gsd-core', 'workflows');
const workflowsRoot = path.join(tmpRoot, 'msd-core', 'workflows');
const stepsDir = path.join(workflowsRoot, 'foo', 'steps');
fs.mkdirSync(stepsDir, { recursive: true });
fs.writeFileSync(path.join(stepsDir, 'bar.md'), 'Canonical, longer content.\n');
@@ -126,16 +126,16 @@ describe('failing-first fixture: check 2 (reachability)', () => {
});
test('GREEN — the spine names the compact path via the variant-resolution rule', () => {
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-variant-unreached-ok-'));
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-variant-unreached-ok-'));
try {
const workflowsRoot = path.join(tmpRoot, 'gsd-core', 'workflows');
const workflowsRoot = path.join(tmpRoot, 'msd-core', 'workflows');
const stepsDir = path.join(workflowsRoot, 'foo', 'steps');
fs.mkdirSync(stepsDir, { recursive: true });
fs.writeFileSync(path.join(stepsDir, 'bar.md'), 'Canonical, longer content.\n');
fs.writeFileSync(path.join(stepsDir, 'bar.compact.md'), 'Terser.\n');
fs.writeFileSync(
path.join(workflowsRoot, 'foo.md'),
'Read and execute `gsd-core/workflows/foo/steps/bar.md` (or its `gsd-core/workflows/foo/steps/bar.compact.md` variant per the shared gate).\n',
'Read and execute `msd-core/workflows/foo/steps/bar.md` (or its `msd-core/workflows/foo/steps/bar.compact.md` variant per the shared gate).\n',
);
const pairs = discoverRegisteredVariants([workflowsRoot]);
@@ -147,9 +147,9 @@ describe('failing-first fixture: check 2 (reachability)', () => {
});
test('a vendored path ending in the same filename does not grant false reachability', () => {
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-variant-unreached-prefix-'));
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-variant-unreached-prefix-'));
try {
const workflowsRoot = path.join(tmpRoot, 'gsd-core', 'workflows');
const workflowsRoot = path.join(tmpRoot, 'msd-core', 'workflows');
const stepsDir = path.join(workflowsRoot, 'foo', 'steps');
fs.mkdirSync(stepsDir, { recursive: true });
fs.writeFileSync(path.join(stepsDir, 'bar.md'), 'Canonical, longer content.\n');
@@ -173,17 +173,17 @@ describe('failing-first fixture: check 2 (reachability)', () => {
describe('failing-first fixture: check 3 (protected content preserved)', () => {
test('RED — a protected block in the canonical file is absent from the compact sibling', () => {
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-variant-protected-'));
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-variant-protected-'));
try {
const workflowsRoot = path.join(tmpRoot, 'gsd-core', 'workflows', 'foo', 'steps');
const workflowsRoot = path.join(tmpRoot, 'msd-core', 'workflows', 'foo', 'steps');
fs.mkdirSync(workflowsRoot, { recursive: true });
fs.writeFileSync(
path.join(workflowsRoot, 'bar.md'),
'Intro.\n\n<!-- gsd:protected -->\nNever weaken this exact guardrail sentence.\n\nMore filler text that is safe to shorten elsewhere in this file to pad it out longer than the compact sibling.\n',
'Intro.\n\n<!-- msd:protected -->\nNever weaken this exact guardrail sentence.\n\nMore filler text that is safe to shorten elsewhere in this file to pad it out longer than the compact sibling.\n',
);
fs.writeFileSync(path.join(workflowsRoot, 'bar.compact.md'), 'Terser intro with the guardrail dropped.\n');
const pairs = discoverRegisteredVariants([path.join(tmpRoot, 'gsd-core', 'workflows')]);
const pairs = discoverRegisteredVariants([path.join(tmpRoot, 'msd-core', 'workflows')]);
const violations = checkProtectedContentPreserved(pairs);
assert.ok(violations.length > 0, 'expected at least one protected-content violation');
assert.ok(
@@ -196,20 +196,20 @@ describe('failing-first fixture: check 3 (protected content preserved)', () => {
});
test('GREEN — the guardrail sentence is preserved verbatim in the compact sibling', () => {
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-variant-protected-ok-'));
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-variant-protected-ok-'));
try {
const workflowsRoot = path.join(tmpRoot, 'gsd-core', 'workflows', 'foo', 'steps');
const workflowsRoot = path.join(tmpRoot, 'msd-core', 'workflows', 'foo', 'steps');
fs.mkdirSync(workflowsRoot, { recursive: true });
fs.writeFileSync(
path.join(workflowsRoot, 'bar.md'),
'Intro.\n\n<!-- gsd:protected -->\nNever weaken this exact guardrail sentence.\n\nMore filler text that is safe to shorten elsewhere in this file to pad it out longer than the compact sibling.\n',
'Intro.\n\n<!-- msd:protected -->\nNever weaken this exact guardrail sentence.\n\nMore filler text that is safe to shorten elsewhere in this file to pad it out longer than the compact sibling.\n',
);
fs.writeFileSync(
path.join(workflowsRoot, 'bar.compact.md'),
'Terser intro.\n\nNever weaken this exact guardrail sentence.\n',
);
const pairs = discoverRegisteredVariants([path.join(tmpRoot, 'gsd-core', 'workflows')]);
const pairs = discoverRegisteredVariants([path.join(tmpRoot, 'msd-core', 'workflows')]);
const violations = checkProtectedContentPreserved(pairs);
assert.deepStrictEqual(violations, []);
} finally {
@@ -218,19 +218,19 @@ describe('failing-first fixture: check 3 (protected content preserved)', () => {
});
test('a canonical file with no protected blocks is a correct no-op (nothing to preserve)', () => {
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-variant-protected-none-'));
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-variant-protected-none-'));
try {
const workflowsRoot = path.join(tmpRoot, 'gsd-core', 'workflows', 'foo', 'steps');
const workflowsRoot = path.join(tmpRoot, 'msd-core', 'workflows', 'foo', 'steps');
fs.mkdirSync(workflowsRoot, { recursive: true });
fs.writeFileSync(path.join(workflowsRoot, 'bar.md'), 'Plain canonical content with no protected sentinel at all.\n');
fs.writeFileSync(path.join(workflowsRoot, 'bar.compact.md'), 'Terser.\n');
const pairs = discoverRegisteredVariants([path.join(tmpRoot, 'gsd-core', 'workflows')]);
const pairs = discoverRegisteredVariants([path.join(tmpRoot, 'msd-core', 'workflows')]);
const violations = checkProtectedContentPreserved(pairs);
assert.deepStrictEqual(
violations,
[],
'a canonical file with zero <!-- gsd:protected --> blocks has nothing to check — never a violation',
'a canonical file with zero <!-- msd:protected --> blocks has nothing to check — never a violation',
);
} finally {
cleanup(tmpRoot);
@@ -240,14 +240,14 @@ describe('failing-first fixture: check 3 (protected content preserved)', () => {
describe('failing-first fixture: check 4 (size smaller)', () => {
test('RED — a "compact" file the same size as its canonical sibling', () => {
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-variant-size-'));
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-variant-size-'));
try {
const workflowsRoot = path.join(tmpRoot, 'gsd-core', 'workflows', 'foo', 'steps');
const workflowsRoot = path.join(tmpRoot, 'msd-core', 'workflows', 'foo', 'steps');
fs.mkdirSync(workflowsRoot, { recursive: true });
fs.writeFileSync(path.join(workflowsRoot, 'bar.md'), 'x'.repeat(100));
fs.writeFileSync(path.join(workflowsRoot, 'bar.compact.md'), 'y'.repeat(100));
const pairs = discoverRegisteredVariants([path.join(tmpRoot, 'gsd-core', 'workflows')]);
const pairs = discoverRegisteredVariants([path.join(tmpRoot, 'msd-core', 'workflows')]);
const violations = checkSizeSmaller(pairs);
assert.ok(violations.length > 0, 'expected at least one size violation');
assert.ok(
@@ -260,14 +260,14 @@ describe('failing-first fixture: check 4 (size smaller)', () => {
});
test('RED — a "compact" file one byte LARGER than its canonical sibling (boundary point)', () => {
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-variant-size-over-'));
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-variant-size-over-'));
try {
const workflowsRoot = path.join(tmpRoot, 'gsd-core', 'workflows', 'foo', 'steps');
const workflowsRoot = path.join(tmpRoot, 'msd-core', 'workflows', 'foo', 'steps');
fs.mkdirSync(workflowsRoot, { recursive: true });
fs.writeFileSync(path.join(workflowsRoot, 'bar.md'), 'x'.repeat(100));
fs.writeFileSync(path.join(workflowsRoot, 'bar.compact.md'), 'y'.repeat(101));
const pairs = discoverRegisteredVariants([path.join(tmpRoot, 'gsd-core', 'workflows')]);
const pairs = discoverRegisteredVariants([path.join(tmpRoot, 'msd-core', 'workflows')]);
const violations = checkSizeSmaller(pairs);
assert.ok(violations.length > 0, 'expected at least one size violation');
} finally {
@@ -276,14 +276,14 @@ describe('failing-first fixture: check 4 (size smaller)', () => {
});
test('GREEN — a compact file exactly one byte smaller (boundary point)', () => {
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-variant-size-ok-'));
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-variant-size-ok-'));
try {
const workflowsRoot = path.join(tmpRoot, 'gsd-core', 'workflows', 'foo', 'steps');
const workflowsRoot = path.join(tmpRoot, 'msd-core', 'workflows', 'foo', 'steps');
fs.mkdirSync(workflowsRoot, { recursive: true });
fs.writeFileSync(path.join(workflowsRoot, 'bar.md'), 'x'.repeat(100));
fs.writeFileSync(path.join(workflowsRoot, 'bar.compact.md'), 'y'.repeat(99));
const pairs = discoverRegisteredVariants([path.join(tmpRoot, 'gsd-core', 'workflows')]);
const pairs = discoverRegisteredVariants([path.join(tmpRoot, 'msd-core', 'workflows')]);
const violations = checkSizeSmaller(pairs);
assert.deepStrictEqual(violations, []);
} finally {