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,8 +6,8 @@
* spec this module implements — it is the source of truth for behavior; this
* file is the mechanics.
*
* A "registered split" is any `gsd-core/workflows/<name>/detail/*.md` path
* paired with the spine at `gsd-core/workflows/<name>.md`. There is no
* A "registered split" is any `msd-core/workflows/<name>/detail/*.md` path
* paired with the spine at `msd-core/workflows/<name>.md`. There is no
* separate registry — a pair is registered by existing on disk
* (`discoverRegisteredSplits`). Everything else here is one of the five
* checks PARTITION-RULES.md describes, or a primitive those checks share:
@@ -38,8 +38,8 @@ const {
const { NEW_FILE_CAP, ACK_TRAILER_DELIM, normalizeAckReason } = require('./emitted-diff.cjs');
const { runGit, OUTCOME } = require('./process-seam.cjs');
/** Default scan root: `gsd-core/workflows/` at repo root. */
const DEFAULT_WORKFLOWS_DIR = path.join(__dirname, '..', '..', 'gsd-core', 'workflows');
/** Default scan root: `msd-core/workflows/` at repo root. */
const DEFAULT_WORKFLOWS_DIR = path.join(__dirname, '..', '..', 'msd-core', 'workflows');
/**
* Discover every registered spine/detail split under `workflowsDir`.
@@ -173,13 +173,13 @@ const KNOWN_BOILERPLATE_PREFIXES = [
/**
* Is `line` one of the corpus's known sanctioned cross-file duplicates: the
* canonical `gsd_run` launcher bootstrap preamble (see
* `gsd-core/workflows/_runtime-launcher.snippet.sh`,
* canonical `msd_run` launcher bootstrap preamble (see
* `msd-core/workflows/_runtime-launcher.snippet.sh`,
* `tests/runtime-launcher-parity.test.cjs`), or one of the `KNOWN_BOILERPLATE_PREFIXES`
* above?
*
* The launcher preamble's own guard mandates exactly one inlined copy in every
* workflow/detail file that calls `gsd_run` — spine and detail both call it,
* workflow/detail file that calls `msd_run` — spine and detail both call it,
* so both legitimately carry their own copy. That is sanctioned
* cross-file duplication, not something the disjointness check should ever
* flag, so it is filtered out wherever this module compares lines across a
@@ -189,17 +189,17 @@ const KNOWN_BOILERPLATE_PREFIXES = [
* @returns {boolean}
*/
function isKnownSanctionedBoilerplate(line) {
if (line.startsWith('_GSD_SHIM_NAME="gsd-tools.cjs";')) return true;
if (line.startsWith('_MSD_SHIM_NAME="msd-tools.cjs";')) return true;
return KNOWN_BOILERPLATE_PREFIXES.some((prefix) => line.startsWith(prefix));
}
const PROTECTED_START = '<!-- gsd:protected:start -->';
const PROTECTED_END = '<!-- gsd:protected:end -->';
const PROTECTED_SINGLE = '<!-- gsd:protected -->';
const PROTECTED_START = '<!-- msd:protected:start -->';
const PROTECTED_END = '<!-- msd:protected:end -->';
const PROTECTED_SINGLE = '<!-- msd:protected -->';
/**
* Extract every `<!-- gsd:protected -->` (single-line) and
* `<!-- gsd:protected:start -->`/`<!-- gsd:protected:end -->` (paired)
* Extract every `<!-- msd:protected -->` (single-line) and
* `<!-- msd:protected:start -->`/`<!-- msd:protected:end -->` (paired)
* sentinel-wrapped block from `content`.
*
* Never throws on a malformed sentinel (unclosed start, orphan end, a single
@@ -207,7 +207,7 @@ const PROTECTED_SINGLE = '<!-- gsd:protected -->';
* those are reported best-effort in `blocks` (covering whatever content is
* actually present, or an empty span) AND named explicitly in `malformed`,
* mirroring the well-formedness rules `tests/plan-phase-compact-split.test.cjs`'s
* `'every gsd:protected sentinel...'` test already enforced for the one
* `'every msd:protected sentinel...'` test already enforced for the one
* existing split. The check-4 caller decides what to do with a malformed
* sentinel; this function's job is only to describe the file accurately.
*
@@ -236,12 +236,12 @@ function extractProtectedBlocks(content) {
// A new start while one is already open: the earlier open span is
// abandoned (best-effort — it never gets a `blocks` entry) and this
// one becomes the tracked open start.
malformed.push({ line: i + 1, message: `nested/unclosed gsd:protected:start at line ${i + 1}` });
malformed.push({ line: i + 1, message: `nested/unclosed msd:protected:start at line ${i + 1}` });
}
openStart = i;
} else if (trimmed === PROTECTED_END) {
if (openStart === -1) {
malformed.push({ line: i + 1, message: `gsd:protected:end with no matching start at line ${i + 1}` });
malformed.push({ line: i + 1, message: `msd:protected:end with no matching start at line ${i + 1}` });
continue;
}
const covered = lines.slice(openStart + 1, i).map((l) => l.trim()).filter((l) => l.length > 0);
@@ -259,7 +259,7 @@ function extractProtectedBlocks(content) {
}
if (openStart !== -1) {
malformed.push({ line: openStart + 1, message: 'a gsd:protected:start sentinel was never closed' });
malformed.push({ line: openStart + 1, message: 'a msd:protected:start sentinel was never closed' });
const covered = lines.slice(openStart + 1).map((l) => l.trim()).filter((l) => l.length > 0);
blocks.push({ kind: 'paired', lines: covered, firstLine: covered[0] || '' });
}
@@ -446,7 +446,7 @@ function readBoundaryMoveTrailers({ baseRef, headRef = 'HEAD', cwd = REPO_ROOT,
* what a given PR touched — this is what keeps duplication from creeping
* back in after a split is made.
*
* The canonical `gsd_run` launcher preamble is excluded from both sides
* The canonical `msd_run` launcher preamble is excluded from both sides
* before comparing (`isKnownSanctionedBoilerplate`) — it is sanctioned
* cross-file duplication under a different guard's contract, not a
* violation of this one.
@@ -526,12 +526,12 @@ function checkRegistration(splits, workflowsDir) {
}
}
// The prose spells these out in full — e.g. `gsd-core/workflows/plan-phase/
// The prose spells these out in full — e.g. `msd-core/workflows/plan-phase/
// detail/elaboration.md` — i.e. relative to the REPO ROOT (`workflowsDir`'s
// grandparent: `workflowsDir` = `<root>/gsd-core/workflows`), not relative
// grandparent: `workflowsDir` = `<root>/msd-core/workflows`), not relative
// to `workflowsDir` itself (verified against plan-phase.md's real
// references; resolving against `workflowsDir` directly double-prefixes
// `gsd-core/workflows/` and false-positives every real reference).
// `msd-core/workflows/` and false-positives every real reference).
const repoRoot = path.join(workflowsDir, '..', '..');
const referenced = new Set(spineContent.match(DETAIL_REFERENCE_PATTERN) || []);
for (const referencedPath of referenced) {