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:
@@ -2,7 +2,7 @@
|
||||
|
||||
/**
|
||||
* Shared library for the compact-content VARIANT guard (ADR-4139, epic #4139,
|
||||
* Phase 6 #4406). See `gsd-core/references/compact-content-gate.md` §"Streams
|
||||
* Phase 6 #4406). See `msd-core/references/compact-content-gate.md` §"Streams
|
||||
* 1b and 4 — variant resolution" for the operational rule this module checks;
|
||||
* this file is the mechanics, not the source of truth for behavior.
|
||||
*
|
||||
@@ -22,7 +22,7 @@
|
||||
* compact path is never named by any spine's "Read ... variant
|
||||
* resolution" call site is unwired dead weight).
|
||||
* 3. Protected content preserved — `checkProtectedContentPreserved` (a
|
||||
* `<!-- gsd:protected -->` block's lines must appear verbatim in BOTH
|
||||
* `<!-- msd:protected -->` block's lines must appear verbatim in BOTH
|
||||
* files, since nothing is "moved" in a variant pair — it is duplicated).
|
||||
* 4. Size smaller — `checkSizeSmaller`.
|
||||
* 5. Template consumer parity — NOT implemented here; it needs a real
|
||||
@@ -50,13 +50,13 @@ const { extractProtectedBlocks, normalizeNonTrivialLines } = require('./compact-
|
||||
|
||||
/** Default scan roots: everywhere a `.compact.md` sibling can legally live. */
|
||||
const DEFAULT_VARIANT_ROOTS = [
|
||||
path.join(__dirname, '..', '..', 'gsd-core', 'workflows'),
|
||||
path.join(__dirname, '..', '..', 'gsd-core', 'templates'),
|
||||
path.join(__dirname, '..', '..', 'msd-core', 'workflows'),
|
||||
path.join(__dirname, '..', '..', 'msd-core', 'templates'),
|
||||
];
|
||||
|
||||
/** Every markdown-source root a spine/fragment might name a variant path from. */
|
||||
const DEFAULT_SEARCH_ROOTS = [
|
||||
path.join(__dirname, '..', '..', 'gsd-core', 'workflows'),
|
||||
path.join(__dirname, '..', '..', 'msd-core', 'workflows'),
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -158,16 +158,16 @@ function checkRegistration(pairs) {
|
||||
* at least one markdown file under `searchRoots` (a spine's "Read ... variant
|
||||
* resolution" call site). Three needle forms, matched differently, because
|
||||
* this corpus has two live conventions for naming these paths (found by
|
||||
* walking up from the compact file itself to its nearest `gsd-core` ancestor,
|
||||
* walking up from the compact file itself to its nearest `msd-core` ancestor,
|
||||
* so this works the same way against the real repo and against a fixture
|
||||
* that builds its own `<tmp>/gsd-core/...` tree):
|
||||
* that builds its own `<tmp>/msd-core/...` tree):
|
||||
*
|
||||
* - The `gsd-core/<rest>` form (e.g. `gsd-core/workflows/autonomous/steps/
|
||||
* - The `msd-core/<rest>` form (e.g. `msd-core/workflows/autonomous/steps/
|
||||
* converge-fail-fast.md`'s own convention) is unambiguous on its own — a
|
||||
* different, longer path coincidentally ending in this exact multi-segment
|
||||
* suffix is not a realistic false positive, so a plain substring match is
|
||||
* sufficient without the "unprefixed" guard below.
|
||||
* - The `<rest>` form without the leading `gsd-core/` (e.g. `workflows/help/
|
||||
* - The `<rest>` form without the leading `msd-core/` (e.g. `workflows/help/
|
||||
* modes/full.compact.md`, `help.md`'s own dispatch-table convention) is
|
||||
* equally unambiguous for the same reason.
|
||||
* - The bare `<stem>.compact.md` form has no such guarantee — a same-named
|
||||
@@ -192,11 +192,11 @@ function checkReachability(pairs, searchRoots = DEFAULT_SEARCH_ROOTS) {
|
||||
}
|
||||
for (const pair of pairs) {
|
||||
if (!pair.canonicalExists) continue; // already reported by checkRegistration
|
||||
const gsdCoreRelative = relativeToNearestGsdCore(pair.compactPath);
|
||||
const msdCoreRelative = relativeToNearestMsdCore(pair.compactPath);
|
||||
const stem = path.basename(pair.compactPath, COMPACT_SUFFIX);
|
||||
const bareNeedle = `${stem}${COMPACT_SUFFIX}`;
|
||||
const reached = haystacks.some((text) => {
|
||||
if (gsdCoreRelative && (text.includes(`gsd-core/${gsdCoreRelative}`) || text.includes(gsdCoreRelative))) {
|
||||
if (msdCoreRelative && (text.includes(`msd-core/${msdCoreRelative}`) || text.includes(msdCoreRelative))) {
|
||||
return true;
|
||||
}
|
||||
return isUnprefixedMatch(text, bareNeedle);
|
||||
@@ -210,17 +210,17 @@ function checkReachability(pairs, searchRoots = DEFAULT_SEARCH_ROOTS) {
|
||||
|
||||
/**
|
||||
* Walk up from `filePath` to the nearest ancestor directory literally named
|
||||
* `gsd-core`, and return the path from there to `filePath` (POSIX-separated).
|
||||
* `msd-core`, and return the path from there to `filePath` (POSIX-separated).
|
||||
* Returns `null` if no such ancestor exists. Anchoring on the literal
|
||||
* `gsd-core` segment — rather than a hardcoded repo-root constant — is what
|
||||
* `msd-core` segment — rather than a hardcoded repo-root constant — is what
|
||||
* lets this match both the real repo and a fixture built under its own
|
||||
* `<tmp>/gsd-core/...` tree the same way.
|
||||
* `<tmp>/msd-core/...` tree the same way.
|
||||
* @param {string} filePath
|
||||
* @returns {string | null}
|
||||
*/
|
||||
function relativeToNearestGsdCore(filePath) {
|
||||
function relativeToNearestMsdCore(filePath) {
|
||||
const segments = filePath.split(path.sep);
|
||||
const idx = segments.lastIndexOf('gsd-core');
|
||||
const idx = segments.lastIndexOf('msd-core');
|
||||
if (idx === -1) return null;
|
||||
return segments.slice(idx + 1).join('/');
|
||||
}
|
||||
@@ -244,7 +244,7 @@ function findMarkdownFiles(dir) {
|
||||
* lines in the canonical file must also appear (verbatim, after the same
|
||||
* normalization the partition guard uses) somewhere in the compact sibling.
|
||||
* Unlike the partition guard, this is NOT a sentinel-presence check on the
|
||||
* compact file itself — the compact file need not carry `<!-- gsd:protected -->`
|
||||
* compact file itself — the compact file need not carry `<!-- msd:protected -->`
|
||||
* markers of its own, since it is not itself audited for content it might
|
||||
* shed later; it only must not have DROPPED the protected wording.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user