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 @@
|
||||
|
||||
// allow-test-rule: source-text-is-the-product — noSectionMarkerLeaksIntoEmittedArtifacts (#2930)
|
||||
// asserts on the literal bytes of an EMITTED install artifact, which IS the
|
||||
// deployed contract (a leaked `gsd:section` marker byte would ship to every user). This
|
||||
// deployed contract (a leaked `msd:section` marker byte would ship to every user). This
|
||||
// mirrors the test-matrix's own row-34/35 exemption from the "no source-grep" rule
|
||||
// (50-test-matrix.md "No source-grep" note) — the ESLint rule itself only fires on
|
||||
// readFileSync of a .cjs/.js/.ts SOURCE path, never on an installed .md artifact, so this
|
||||
@@ -26,8 +26,8 @@
|
||||
* ── The overlay technique (rows 33/36) ───────────────────────────────────
|
||||
*
|
||||
* Rows 33 and 36 need a spawned `bin/install.js` that reads a DIFFERENT
|
||||
* `gsd-core/workflows/execute-phase.md` (malformed, row 36) or a different
|
||||
* `gsd-core/bin/lib/workflow-fragments.cjs` (stubbed to identity, row 33)
|
||||
* `msd-core/workflows/execute-phase.md` (malformed, row 36) or a different
|
||||
* `msd-core/bin/lib/workflow-fragments.cjs` (stubbed to identity, row 33)
|
||||
* than this checkout's real files, without paying to copy the ~400 MB
|
||||
* repository (mostly node_modules) for every run. `buildOverlayRepo` /
|
||||
* `linkOrCopyFile` now live in `./helpers/overlay-repo.cjs` (extracted,
|
||||
@@ -55,16 +55,16 @@ const { cleanup } = require('./helpers.cjs');
|
||||
const { RUNTIME_META, runMinimalInstall, installerEnv } = require('./helpers/install-shared.cjs');
|
||||
const { buildOverlayRepo } = require('./helpers/overlay-repo.cjs');
|
||||
const { executionContextRefs } = require('../scripts/command-contract-helpers.cjs');
|
||||
const { composeWorkflow } = require('../gsd-core/bin/lib/workflow-fragments.cjs');
|
||||
const { composeWorkflow } = require('../msd-core/bin/lib/workflow-fragments.cjs');
|
||||
|
||||
const REPO_ROOT = path.join(__dirname, '..');
|
||||
// #3145: class-norm timeout, not a per-suite value — see helpers/timeouts.cjs.
|
||||
const { INSTALL_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
|
||||
const PILOT_REL = path.join('gsd-core', 'workflows', 'execute-phase.md');
|
||||
const PILOT_REL = path.join('msd-core', 'workflows', 'execute-phase.md');
|
||||
const PILOT_PATH = path.join(REPO_ROOT, PILOT_REL);
|
||||
const PLAN_PHASE_REL = path.join('gsd-core', 'workflows', 'plan-phase.md');
|
||||
const CHUNKED_PLAN_REL = path.join('gsd-core', 'workflows', 'plan-phase', 'steps', 'chunked-planning-mode.md');
|
||||
const STALL_HELPERS_REL = path.join('gsd-core', 'workflows', 'plan-phase', 'steps', 'stall-detection-helpers.md');
|
||||
const PLAN_PHASE_REL = path.join('msd-core', 'workflows', 'plan-phase.md');
|
||||
const CHUNKED_PLAN_REL = path.join('msd-core', 'workflows', 'plan-phase', 'steps', 'chunked-planning-mode.md');
|
||||
const STALL_HELPERS_REL = path.join('msd-core', 'workflows', 'plan-phase', 'steps', 'stall-detection-helpers.md');
|
||||
// plan-phase.md was the original #2930 pilot but was reverted to unmarked
|
||||
// (chore/2930 retarget: it sits 36 B under the ADR-857 Phase-6 PRE_PHASE6
|
||||
// gate and cannot absorb marker overhead) — it was a genuinely unmarked
|
||||
@@ -72,8 +72,8 @@ const STALL_HELPERS_REL = path.join('gsd-core', 'workflows', 'plan-phase', 'step
|
||||
// Phase 6.2) now marks plan-phase.md itself (6 sections, the fragmentization
|
||||
// this change ships), so it is no longer a valid "genuinely unmarked" fixture
|
||||
// either — retargeted a second time to discuss-phase.md, which carries no
|
||||
// gsd:section markers as of this change.
|
||||
const UNMARKED_REL = path.join('gsd-core', 'workflows', 'discuss-phase.md');
|
||||
// msd:section markers as of this change.
|
||||
const UNMARKED_REL = path.join('msd-core', 'workflows', 'discuss-phase.md');
|
||||
|
||||
const RUNTIMES = Object.keys(RUNTIME_META);
|
||||
|
||||
@@ -82,7 +82,7 @@ const RUNTIMES = Object.keys(RUNTIME_META);
|
||||
/** Spawn a (possibly overlaid) installScript at global scope. Does NOT
|
||||
* assert success — callers decide (row 36 expects failure). */
|
||||
function spawnGlobalInstall(installScript, runtime, extraArgs = []) {
|
||||
const root = fs.mkdtempSync(path.join(os.tmpdir(), `gsd-2930-dest-${runtime}-`));
|
||||
const root = fs.mkdtempSync(path.join(os.tmpdir(), `msd-2930-dest-${runtime}-`));
|
||||
// #3547 — same real config-home shape as runMinimalInstall: the strict
|
||||
// <root>/<globalSuffix> subdirectory, not the collapsed <root>. The size
|
||||
// comparisons below normalize each side's own root out of the text; a
|
||||
@@ -156,8 +156,8 @@ function stripRoot(text, root) {
|
||||
// embeds the install's own absolute configDir path into execute-phase.md
|
||||
// content (same fact row 33/atRefContractStillResolvesAfterComposition
|
||||
// documents for SKILL.md), and `runMinimalInstall`'s temp-dir prefix
|
||||
// (`gsd-<runtime>-<scope>-`) is a DIFFERENT length than
|
||||
// `spawnGlobalInstall`'s (`gsd-2930-dest-<runtime>-`) — so comparing RAW
|
||||
// (`msd-<runtime>-<scope>-`) is a DIFFERENT length than
|
||||
// `spawnGlobalInstall`'s (`msd-2930-dest-<runtime>-`) — so comparing RAW
|
||||
// file sizes between the two installs bakes in a root-path-length delta
|
||||
// that has nothing to do with composeWorkflow. Normalize each side's own
|
||||
// root out of the text before measuring, exactly as row 33 already does.
|
||||
@@ -170,11 +170,11 @@ test('emittedWorkflowShrinksByMarkerBytesForEveryRuntime', (t) => {
|
||||
const expectedMarkerBytes = sourceBytes - composedBytes;
|
||||
assert.ok(
|
||||
expectedMarkerBytes > 0,
|
||||
'sanity: the pilot workflow must actually carry gsd:section markers to strip',
|
||||
'sanity: the pilot workflow must actually carry msd:section markers to strip',
|
||||
);
|
||||
|
||||
const identityStubRepo = buildOverlayRepo({
|
||||
'gsd-core/bin/lib/workflow-fragments.cjs': 'module.exports = { composeWorkflow: (c) => c };\n',
|
||||
'msd-core/bin/lib/workflow-fragments.cjs': 'module.exports = { composeWorkflow: (c) => c };\n',
|
||||
});
|
||||
t.after(() => cleanup(identityStubRepo));
|
||||
|
||||
@@ -223,13 +223,13 @@ test('emittedWorkflowShrinksByMarkerBytesForEveryRuntime', (t) => {
|
||||
// this change and still run today. Proven empirically per runtime by
|
||||
// comparing two REAL installs of the SAME unmarked file: one through this
|
||||
// checkout's real composeWorkflow, one through an overlay whose
|
||||
// gsd-core/bin/lib/workflow-fragments.cjs is stubbed to plain identity — any
|
||||
// msd-core/bin/lib/workflow-fragments.cjs is stubbed to plain identity — any
|
||||
// difference is attributable ONLY to the compose wiring, never to an
|
||||
// unrelated converter (which fires identically on both sides).
|
||||
|
||||
test('unmarkedWorkflowEmitsByteIdenticalForEveryRuntime', (t) => {
|
||||
const identityStubRepo = buildOverlayRepo({
|
||||
'gsd-core/bin/lib/workflow-fragments.cjs': 'module.exports = { composeWorkflow: (c) => c };\n',
|
||||
'msd-core/bin/lib/workflow-fragments.cjs': 'module.exports = { composeWorkflow: (c) => c };\n',
|
||||
});
|
||||
t.after(() => cleanup(identityStubRepo));
|
||||
|
||||
@@ -273,7 +273,7 @@ test('unmarkedWorkflowEmitsByteIdenticalForEveryRuntime', (t) => {
|
||||
}
|
||||
});
|
||||
|
||||
// ─── Row 34: no gsd:section marker survives into any emitted artifact ─────
|
||||
// ─── Row 34: no msd:section marker survives into any emitted artifact ─────
|
||||
|
||||
test('noSectionMarkerLeaksIntoEmittedArtifacts', (t) => {
|
||||
for (const runtime of RUNTIMES) {
|
||||
@@ -283,9 +283,9 @@ test('noSectionMarkerLeaksIntoEmittedArtifacts', (t) => {
|
||||
assert.ok(fs.existsSync(emittedPath), `${runtime}: emitted execute-phase.md is missing`);
|
||||
const emittedText = fs.readFileSync(emittedPath, 'utf8');
|
||||
assert.equal(
|
||||
emittedText.includes('gsd:section'),
|
||||
emittedText.includes('msd:section'),
|
||||
false,
|
||||
`${runtime}: emitted execute-phase.md still contains a gsd:section marker token`,
|
||||
`${runtime}: emitted execute-phase.md still contains a msd:section marker token`,
|
||||
);
|
||||
|
||||
// #4570: assert against the real installed workflow bytes for every runtime,
|
||||
@@ -298,7 +298,7 @@ test('noSectionMarkerLeaksIntoEmittedArtifacts', (t) => {
|
||||
const installed = fs.readFileSync(installedPath, 'utf8');
|
||||
assert.match(installed, /PLANNER_STALL_DETECTION_ENABLED/,
|
||||
`${runtime}: ${relativePath} lost the planner stall-detection gate during conversion`);
|
||||
assert.match(installed, /gsd_stall_watch/,
|
||||
assert.match(installed, /msd_stall_watch/,
|
||||
`${runtime}: ${relativePath} lost the default-on watcher branch during conversion`);
|
||||
assert.match(installed, /runtime-native/,
|
||||
`${runtime}: ${relativePath} lost the explicit-off ordinary completion branch during conversion`);
|
||||
@@ -339,8 +339,8 @@ test('atRefContractStillResolvesAfterComposition', (t) => {
|
||||
for (const runtime of ['claude', 'opencode']) {
|
||||
const { configDir, root } = runMinimalInstall({ runtime, scope: 'global' });
|
||||
t.after(() => cleanup(root));
|
||||
const skillPath = path.join(configDir, 'skills', 'gsd-plan-phase', 'SKILL.md');
|
||||
assert.ok(fs.existsSync(skillPath), `${runtime}: installed gsd-plan-phase SKILL.md is missing`);
|
||||
const skillPath = path.join(configDir, 'skills', 'msd-plan-phase', 'SKILL.md');
|
||||
assert.ok(fs.existsSync(skillPath), `${runtime}: installed msd-plan-phase SKILL.md is missing`);
|
||||
const skillContent = fs.readFileSync(skillPath, 'utf8');
|
||||
const refs = executionContextRefs(skillContent);
|
||||
assert.ok(refs.length > 0, `${runtime}: SKILL.md has no execution_context @-refs to check`);
|
||||
@@ -355,12 +355,12 @@ test('atRefContractStillResolvesAfterComposition', (t) => {
|
||||
}
|
||||
});
|
||||
|
||||
// ─── FIX 1 (chore/2930 review): composeWorkflow is scoped to gsd-core/workflows/ ──
|
||||
// ─── FIX 1 (chore/2930 review): composeWorkflow is scoped to msd-core/workflows/ ──
|
||||
//
|
||||
// copyWithPathReplacement is the emit path for the ENTIRE gsd-core/ tree
|
||||
// (skillSrc = path.join(src, 'gsd-core'), bin/install.js:10806-10809), not
|
||||
// just gsd-core/workflows/. A non-workflow .md elsewhere under gsd-core/
|
||||
// (e.g. gsd-core/references/) that merely DOCUMENTS the marker syntax with
|
||||
// copyWithPathReplacement is the emit path for the ENTIRE msd-core/ tree
|
||||
// (skillSrc = path.join(src, 'msd-core'), bin/install.js:10806-10809), not
|
||||
// just msd-core/workflows/. A non-workflow .md elsewhere under msd-core/
|
||||
// (e.g. msd-core/references/) that merely DOCUMENTS the marker syntax with
|
||||
// an unfenced, structurally-invalid example line must never be run through
|
||||
// composeWorkflow — doing so would either throw (breaking install for an
|
||||
// unrelated file class) or silently strip/mis-parse the documentation line.
|
||||
@@ -372,12 +372,12 @@ test('atRefContractStillResolvesAfterComposition', (t) => {
|
||||
// ever touched it) in the SAME install run.
|
||||
|
||||
test('nonWorkflowMarkdownWithMarkerShapedLineIsNotComposed', (t) => {
|
||||
const markedWorkflow = '<!-- gsd:section id="a" when="always" -->\nbody\n<!-- /gsd:section -->\n';
|
||||
const markedWorkflow = '<!-- msd:section id="a" when="always" -->\nbody\n<!-- /msd:section -->\n';
|
||||
const nonWorkflowDoc =
|
||||
'# Marker syntax\n\nExample (deliberately unfenced and unclosed to prove non-composition):\n\n<!-- gsd:section id="x" when="always" -->\nnever closed on purpose\n';
|
||||
const NON_WORKFLOW_DOC_REL = path.join('gsd-core', 'references', 'context-budget.md');
|
||||
'# Marker syntax\n\nExample (deliberately unfenced and unclosed to prove non-composition):\n\n<!-- msd:section id="x" when="always" -->\nnever closed on purpose\n';
|
||||
const NON_WORKFLOW_DOC_REL = path.join('msd-core', 'references', 'context-budget.md');
|
||||
const overlayRepo = buildOverlayRepo({
|
||||
'gsd-core/workflows/execute-phase.md': markedWorkflow,
|
||||
'msd-core/workflows/execute-phase.md': markedWorkflow,
|
||||
[NON_WORKFLOW_DOC_REL.split(path.sep).join('/')]: nonWorkflowDoc,
|
||||
});
|
||||
t.after(() => cleanup(overlayRepo));
|
||||
@@ -395,7 +395,7 @@ test('nonWorkflowMarkdownWithMarkerShapedLineIsNotComposed', (t) => {
|
||||
assert.equal(
|
||||
fs.readFileSync(emittedWorkflowPath, 'utf8'),
|
||||
'body\n',
|
||||
'gsd-core/workflows/execute-phase.md must still compose (markers stripped)',
|
||||
'msd-core/workflows/execute-phase.md must still compose (markers stripped)',
|
||||
);
|
||||
|
||||
const emittedDocPath = path.join(dest.configDir, NON_WORKFLOW_DOC_REL);
|
||||
@@ -417,10 +417,10 @@ test('nonWorkflowMarkdownWithMarkerShapedLineIsNotComposed', (t) => {
|
||||
// one Phase 5 migrates must still compose to itself, byte-identical. ────────
|
||||
|
||||
test('leavesUnmarkedWorkflowEmissionByteIdentical', () => {
|
||||
const workflowsDir = path.join(REPO_ROOT, 'gsd-core', 'workflows');
|
||||
const workflowsDir = path.join(REPO_ROOT, 'msd-core', 'workflows');
|
||||
// execute-phase.md (#2932 Phase 5), plan-phase.md (#2993 Phase 6.2), and
|
||||
// the thirteen workflows #2994 (epic #1671 Phase 6.3) fragmentizes onto the
|
||||
// marker grammar are the files this repo has fragmentized with gsd:section
|
||||
// marker grammar are the files this repo has fragmentized with msd:section
|
||||
// markers — all excluded here since composeWorkflow is deliberately NOT a
|
||||
// no-op for them. This set is DELIBERATELY hardcoded rather than derived
|
||||
// from "does the file contain a marker": deriving it would make the guard
|
||||
@@ -475,8 +475,8 @@ test('leavesUnmarkedWorkflowEmissionByteIdentical', () => {
|
||||
});
|
||||
|
||||
test('malformedMarkersFailInstallWithoutPartialEmit', (t) => {
|
||||
const malformed = '<!-- gsd:section id="broken" when="always" -->\nnever closed\n';
|
||||
const overlayRepo = buildOverlayRepo({ 'gsd-core/workflows/execute-phase.md': malformed });
|
||||
const malformed = '<!-- msd:section id="broken" when="always" -->\nnever closed\n';
|
||||
const overlayRepo = buildOverlayRepo({ 'msd-core/workflows/execute-phase.md': malformed });
|
||||
t.after(() => cleanup(overlayRepo));
|
||||
|
||||
const dest = spawnGlobalInstall(path.join(overlayRepo, 'bin', 'install.js'), 'claude');
|
||||
|
||||
Reference in New Issue
Block a user