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:
@@ -16,14 +16,14 @@
|
||||
* 2. phase add / add-batch / insert reject a description containing a
|
||||
* milestone-scoping heading line before any write or directory creation.
|
||||
*
|
||||
* Behavioral only — every case drives the gsd-tools CLI seam.
|
||||
* Behavioral only — every case drives the msd-tools CLI seam.
|
||||
*/
|
||||
|
||||
const { test, describe } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { runGsdTools, createTempProject, cleanup } = require('./helpers.cjs');
|
||||
const { runMsdTools, createTempProject, cleanup } = require('./helpers.cjs');
|
||||
|
||||
const VERSIONED_ROADMAP = [
|
||||
'# Roadmap',
|
||||
@@ -111,7 +111,7 @@ function listPhaseDirs(tmpDir) {
|
||||
}
|
||||
|
||||
function runMilestoneScope(tmpDir) {
|
||||
const res = runGsdTools(['roadmap', 'milestone-scope'], tmpDir);
|
||||
const res = runMsdTools(['roadmap', 'milestone-scope'], tmpDir);
|
||||
assert.equal(res.success, true, `roadmap milestone-scope should exit 0, got: ${res.error || res.output}`);
|
||||
return JSON.parse(res.output);
|
||||
}
|
||||
@@ -120,7 +120,7 @@ function runMilestoneScope(tmpDir) {
|
||||
|
||||
describe('#3262 roadmap milestone-scope probe', () => {
|
||||
test('reports the current milestone window phase set (later milestones excluded)', () => {
|
||||
const tmp = createTempProject('gsd-3262-scope-');
|
||||
const tmp = createTempProject('msd-3262-scope-');
|
||||
try {
|
||||
writeStateMilestone(tmp, 'v1.0');
|
||||
writeRoadmap(tmp, VERSIONED_ROADMAP);
|
||||
@@ -134,7 +134,7 @@ describe('#3262 roadmap milestone-scope probe', () => {
|
||||
});
|
||||
|
||||
test('a stray milestone heading inside the window silently narrows the phase set — the signal this probe exists to expose', () => {
|
||||
const tmp = createTempProject('gsd-3262-scope-');
|
||||
const tmp = createTempProject('msd-3262-scope-');
|
||||
try {
|
||||
writeStateMilestone(tmp, 'v1.0');
|
||||
writeRoadmap(tmp, NARROWED_ROADMAP);
|
||||
@@ -149,7 +149,7 @@ describe('#3262 roadmap milestone-scope probe', () => {
|
||||
});
|
||||
|
||||
test('free-form roadmap (no versioned milestones) reports the whole-document phase set', () => {
|
||||
const tmp = createTempProject('gsd-3262-scope-');
|
||||
const tmp = createTempProject('msd-3262-scope-');
|
||||
try {
|
||||
writeRoadmap(tmp, FREEFORM_ROADMAP);
|
||||
const result = runMilestoneScope(tmp);
|
||||
@@ -161,9 +161,9 @@ describe('#3262 roadmap milestone-scope probe', () => {
|
||||
});
|
||||
|
||||
test('missing ROADMAP.md is a decodable unreadable result, not a crash', () => {
|
||||
const tmp = createTempProject('gsd-3262-scope-');
|
||||
const tmp = createTempProject('msd-3262-scope-');
|
||||
try {
|
||||
const res = runGsdTools(['roadmap', 'milestone-scope'], tmp);
|
||||
const res = runMsdTools(['roadmap', 'milestone-scope'], tmp);
|
||||
assert.equal(res.success, true);
|
||||
const parsed = JSON.parse(res.output);
|
||||
assert.equal(parsed.scope, 'unreadable');
|
||||
@@ -179,12 +179,12 @@ describe('#3262 roadmap milestone-scope probe', () => {
|
||||
|
||||
describe('#3262 phase add milestone-scope heading guard', () => {
|
||||
test('rejects a description embedding a versioned milestone heading; ROADMAP and phase dirs untouched', () => {
|
||||
const tmp = createTempProject('gsd-3262-add-');
|
||||
const tmp = createTempProject('msd-3262-add-');
|
||||
try {
|
||||
writeRoadmap(tmp, FREEFORM_ROADMAP);
|
||||
const before = readRoadmap(tmp);
|
||||
const dirsBefore = listPhaseDirs(tmp);
|
||||
const res = runGsdTools(['phase', 'add', 'Extra work\n## v2.1 Evil — 🚧\nmore text'], tmp);
|
||||
const res = runMsdTools(['phase', 'add', 'Extra work\n## v2.1 Evil — 🚧\nmore text'], tmp);
|
||||
assert.equal(res.success, false, 'phase add must reject an embedded milestone heading');
|
||||
assert.match(res.error || res.output, /v2\.1 Evil/, 'error must name the offending line');
|
||||
assert.equal(readRoadmap(tmp), before, 'ROADMAP.md must be byte-unchanged');
|
||||
@@ -195,11 +195,11 @@ describe('#3262 phase add milestone-scope heading guard', () => {
|
||||
});
|
||||
|
||||
test('rejects a description embedding a "Milestone" word heading', () => {
|
||||
const tmp = createTempProject('gsd-3262-add-');
|
||||
const tmp = createTempProject('msd-3262-add-');
|
||||
try {
|
||||
writeRoadmap(tmp, FREEFORM_ROADMAP);
|
||||
const before = readRoadmap(tmp);
|
||||
const res = runGsdTools(['phase', 'add', 'Retro\n# Milestone Two\nnotes'], tmp);
|
||||
const res = runMsdTools(['phase', 'add', 'Retro\n# Milestone Two\nnotes'], tmp);
|
||||
assert.equal(res.success, false);
|
||||
assert.equal(readRoadmap(tmp), before);
|
||||
} finally {
|
||||
@@ -208,10 +208,10 @@ describe('#3262 phase add milestone-scope heading guard', () => {
|
||||
});
|
||||
|
||||
test('ordinary single-line description still succeeds (no false rejection)', () => {
|
||||
const tmp = createTempProject('gsd-3262-add-');
|
||||
const tmp = createTempProject('msd-3262-add-');
|
||||
try {
|
||||
writeRoadmap(tmp, FREEFORM_ROADMAP);
|
||||
const res = runGsdTools(['phase', 'add', 'Authentication and sessions'], tmp);
|
||||
const res = runMsdTools(['phase', 'add', 'Authentication and sessions'], tmp);
|
||||
assert.equal(res.success, true, `ordinary add must keep working: ${res.error || ''}`);
|
||||
assert.match(readRoadmap(tmp), /### Phase 3: Authentication and sessions/);
|
||||
} finally {
|
||||
@@ -220,11 +220,11 @@ describe('#3262 phase add milestone-scope heading guard', () => {
|
||||
});
|
||||
|
||||
test('a milestone heading inside a fenced code block in the description is not a violation (parser is fence-aware)', () => {
|
||||
const tmp = createTempProject('gsd-3262-add-');
|
||||
const tmp = createTempProject('msd-3262-add-');
|
||||
try {
|
||||
writeRoadmap(tmp, FREEFORM_ROADMAP);
|
||||
const desc = 'Document auth\n\n```\n## v2.0 example heading\n```\n';
|
||||
const res = runGsdTools(['phase', 'add', desc], tmp);
|
||||
const res = runMsdTools(['phase', 'add', desc], tmp);
|
||||
assert.equal(res.success, true, `fenced example must not trip the guard: ${res.error || ''}`);
|
||||
} finally {
|
||||
cleanup(tmp);
|
||||
@@ -232,11 +232,11 @@ describe('#3262 phase add milestone-scope heading guard', () => {
|
||||
});
|
||||
|
||||
test('level-4+ headings and Phase-prefixed headings in a description are not violations', () => {
|
||||
const tmp = createTempProject('gsd-3262-add-');
|
||||
const tmp = createTempProject('msd-3262-add-');
|
||||
try {
|
||||
writeRoadmap(tmp, FREEFORM_ROADMAP);
|
||||
const desc = 'Notes\n#### Sub-notes heading\n### Phase 9: decoy reference';
|
||||
const res = runGsdTools(['phase', 'add', desc], tmp);
|
||||
const res = runMsdTools(['phase', 'add', desc], tmp);
|
||||
assert.equal(res.success, true, `level-4/Phase-prefixed headings must not trip the guard: ${res.error || ''}`);
|
||||
} finally {
|
||||
cleanup(tmp);
|
||||
@@ -246,11 +246,11 @@ describe('#3262 phase add milestone-scope heading guard', () => {
|
||||
|
||||
describe('#3262 phase insert milestone-scope heading guard', () => {
|
||||
test('rejects a description embedding a closed-marker milestone heading; ROADMAP untouched', () => {
|
||||
const tmp = createTempProject('gsd-3262-insert-');
|
||||
const tmp = createTempProject('msd-3262-insert-');
|
||||
try {
|
||||
writeRoadmap(tmp, FREEFORM_ROADMAP);
|
||||
const before = readRoadmap(tmp);
|
||||
const res = runGsdTools(['phase', 'insert', '1', 'Sneaky\n## ✅ v3.0 Done\nnotes'], tmp);
|
||||
const res = runMsdTools(['phase', 'insert', '1', 'Sneaky\n## ✅ v3.0 Done\nnotes'], tmp);
|
||||
assert.equal(res.success, false, 'phase insert must reject an embedded milestone heading');
|
||||
assert.equal(readRoadmap(tmp), before, 'ROADMAP.md must be byte-unchanged');
|
||||
} finally {
|
||||
@@ -259,10 +259,10 @@ describe('#3262 phase insert milestone-scope heading guard', () => {
|
||||
});
|
||||
|
||||
test('ordinary insert description still succeeds (no false rejection)', () => {
|
||||
const tmp = createTempProject('gsd-3262-insert-');
|
||||
const tmp = createTempProject('msd-3262-insert-');
|
||||
try {
|
||||
writeRoadmap(tmp, FREEFORM_ROADMAP);
|
||||
const res = runGsdTools(['phase', 'insert', '1', 'Decimal sub-phase'], tmp);
|
||||
const res = runMsdTools(['phase', 'insert', '1', 'Decimal sub-phase'], tmp);
|
||||
assert.equal(res.success, true, `ordinary insert must keep working: ${res.error || ''}`);
|
||||
} finally {
|
||||
cleanup(tmp);
|
||||
@@ -272,12 +272,12 @@ describe('#3262 phase insert milestone-scope heading guard', () => {
|
||||
|
||||
describe('#3262 phase add-batch milestone-scope heading guard', () => {
|
||||
test('rejects the batch when any description embeds a milestone heading; ROADMAP untouched', () => {
|
||||
const tmp = createTempProject('gsd-3262-batch-');
|
||||
const tmp = createTempProject('msd-3262-batch-');
|
||||
try {
|
||||
writeRoadmap(tmp, FREEFORM_ROADMAP);
|
||||
const before = readRoadmap(tmp);
|
||||
const descriptions = JSON.stringify(['Good phase', 'Bad\n## v2.1 Evil — 🚧']);
|
||||
const res = runGsdTools(['phase', 'add-batch', '--descriptions', descriptions], tmp);
|
||||
const res = runMsdTools(['phase', 'add-batch', '--descriptions', descriptions], tmp);
|
||||
assert.equal(res.success, false, 'add-batch must reject an embedded milestone heading');
|
||||
assert.equal(readRoadmap(tmp), before, 'ROADMAP.md must be byte-unchanged (all-or-nothing)');
|
||||
} finally {
|
||||
@@ -292,7 +292,7 @@ describe('#3262 phase add-batch milestone-scope heading guard', () => {
|
||||
* The #3262 guard is defined as a MIRROR of the parser's terminator vocabulary.
|
||||
* On a bracket-convention repo this branch teaches `computeMilestoneSectionEnd`'s
|
||||
* bracket extension a terminator the legacy vocabulary has no word for: the
|
||||
* ADR-canonical `## [GSD.09] Hidden` carries no vN.N token, no ✅/📋/🚧/🔄
|
||||
* ADR-canonical `## [MSD.09] Hidden` carries no vN.N token, no ✅/📋/🚧/🔄
|
||||
* marker, and not the word "Milestone". Unmirrored, the guard accepted exactly
|
||||
* the description that narrows the window — measured at this CLI seam: two
|
||||
* `phase add` calls, the second phase present in ROADMAP.md and absent from
|
||||
@@ -305,9 +305,9 @@ describe('#3262 phase add-batch milestone-scope heading guard', () => {
|
||||
const BRACKET_ROADMAP = [
|
||||
'# Roadmap',
|
||||
'',
|
||||
'## [GSD.02] Foundation',
|
||||
'## [MSD.02] Foundation',
|
||||
'',
|
||||
'### [GSD.02] 01: One',
|
||||
'### [MSD.02] 01: One',
|
||||
'',
|
||||
'**Goal:** one',
|
||||
'',
|
||||
@@ -316,7 +316,7 @@ const BRACKET_ROADMAP = [
|
||||
function writeBracketProject(tmpDir) {
|
||||
fs.writeFileSync(
|
||||
path.join(tmpDir, '.planning', 'config.json'),
|
||||
JSON.stringify({ project_code: 'GSD', phase_id_convention: 'bracket' }, null, 2)
|
||||
JSON.stringify({ project_code: 'MSD', phase_id_convention: 'bracket' }, null, 2)
|
||||
);
|
||||
writeStateMilestone(tmpDir, 'v2.0');
|
||||
writeRoadmap(tmpDir, BRACKET_ROADMAP);
|
||||
@@ -325,7 +325,7 @@ function writeBracketProject(tmpDir) {
|
||||
function writeLegacyTwinProject(tmpDir) {
|
||||
fs.writeFileSync(
|
||||
path.join(tmpDir, '.planning', 'config.json'),
|
||||
JSON.stringify({ project_code: 'GSD' }, null, 2)
|
||||
JSON.stringify({ project_code: 'MSD' }, null, 2)
|
||||
);
|
||||
writeStateMilestone(tmpDir, 'v2.0');
|
||||
writeRoadmap(tmpDir, BRACKET_ROADMAP);
|
||||
@@ -333,18 +333,18 @@ function writeLegacyTwinProject(tmpDir) {
|
||||
|
||||
describe('#2761 milestone-scope guard — bracket convention arm (#612)', () => {
|
||||
test('roadmap milestone-scope reports the bracket window phase set instead of an empty one', () => {
|
||||
const tmp = createTempProject('gsd-2761-scope-');
|
||||
const tmp = createTempProject('msd-2761-scope-');
|
||||
try {
|
||||
writeBracketProject(tmp);
|
||||
writeRoadmap(tmp, [
|
||||
BRACKET_ROADMAP,
|
||||
'### [GSD.02] 02: Two',
|
||||
'### [MSD.02] 02: Two',
|
||||
'',
|
||||
'**Goal:** two',
|
||||
'',
|
||||
'## [GSD.03] Later',
|
||||
'## [MSD.03] Later',
|
||||
'',
|
||||
'### [GSD.03] 01: Later one',
|
||||
'### [MSD.03] 01: Later one',
|
||||
'',
|
||||
'**Goal:** later',
|
||||
'',
|
||||
@@ -360,14 +360,14 @@ describe('#2761 milestone-scope guard — bracket convention arm (#612)', () =>
|
||||
});
|
||||
|
||||
test('phase add rejects a bracket milestone heading in the description; ROADMAP and phase dirs untouched', () => {
|
||||
const tmp = createTempProject('gsd-2761-add-');
|
||||
const tmp = createTempProject('msd-2761-add-');
|
||||
try {
|
||||
writeBracketProject(tmp);
|
||||
const before = readRoadmap(tmp);
|
||||
const dirsBefore = listPhaseDirs(tmp);
|
||||
const res = runGsdTools(['phase', 'add', 'Sneaky\n## [GSD.09] Hidden'], tmp);
|
||||
const res = runMsdTools(['phase', 'add', 'Sneaky\n## [MSD.09] Hidden'], tmp);
|
||||
assert.equal(res.success, false, 'phase add must reject a bracket milestone heading on a bracket repo');
|
||||
assert.match(res.error || res.output, /\[GSD\.09\] Hidden/, 'error must name the offending line');
|
||||
assert.match(res.error || res.output, /\[MSD\.09\] Hidden/, 'error must name the offending line');
|
||||
assert.equal(readRoadmap(tmp), before, 'ROADMAP.md must be byte-unchanged');
|
||||
assert.deepEqual(listPhaseDirs(tmp), dirsBefore, 'no phase directory may be created');
|
||||
} finally {
|
||||
@@ -376,10 +376,10 @@ describe('#2761 milestone-scope guard — bracket convention arm (#612)', () =>
|
||||
});
|
||||
|
||||
test('the same description is ACCEPTED on a non-bracket twin (opt-in only, base behaviour preserved)', () => {
|
||||
const tmp = createTempProject('gsd-2761-add-legacy-');
|
||||
const tmp = createTempProject('msd-2761-add-legacy-');
|
||||
try {
|
||||
writeLegacyTwinProject(tmp);
|
||||
const res = runGsdTools(['phase', 'add', 'Sneaky\n## [GSD.09] Hidden'], tmp);
|
||||
const res = runMsdTools(['phase', 'add', 'Sneaky\n## [MSD.09] Hidden'], tmp);
|
||||
assert.equal(res.success, true, `a project that has not opted in must be unaffected: ${res.error || ''}`);
|
||||
} finally {
|
||||
cleanup(tmp);
|
||||
@@ -387,18 +387,18 @@ describe('#2761 milestone-scope guard — bracket convention arm (#612)', () =>
|
||||
});
|
||||
|
||||
test('phase insert and add-batch reject the same shape on a bracket repo', () => {
|
||||
const tmp = createTempProject('gsd-2761-batch-');
|
||||
const tmp = createTempProject('msd-2761-batch-');
|
||||
try {
|
||||
writeBracketProject(tmp);
|
||||
const before = readRoadmap(tmp);
|
||||
const batch = runGsdTools(
|
||||
['phase', 'add-batch', '--descriptions', JSON.stringify(['Good phase', 'Bad\n## [GSD.09] Hidden'])],
|
||||
const batch = runMsdTools(
|
||||
['phase', 'add-batch', '--descriptions', JSON.stringify(['Good phase', 'Bad\n## [MSD.09] Hidden'])],
|
||||
tmp
|
||||
);
|
||||
assert.equal(batch.success, false, 'add-batch must reject the bracket shape');
|
||||
assert.equal(readRoadmap(tmp), before, 'ROADMAP.md must be byte-unchanged (all-or-nothing)');
|
||||
|
||||
const insert = runGsdTools(['phase', 'insert', '1', 'Sneaky\n## [GSD.09] Hidden'], tmp);
|
||||
const insert = runMsdTools(['phase', 'insert', '1', 'Sneaky\n## [MSD.09] Hidden'], tmp);
|
||||
assert.equal(insert.success, false, 'phase insert must reject the bracket shape');
|
||||
assert.equal(readRoadmap(tmp), before, 'ROADMAP.md must be byte-unchanged');
|
||||
} finally {
|
||||
@@ -407,17 +407,17 @@ describe('#2761 milestone-scope guard — bracket convention arm (#612)', () =>
|
||||
});
|
||||
|
||||
test('a bracket PHASE heading and a FENCED bracket milestone heading are not violations', () => {
|
||||
const tmp = createTempProject('gsd-2761-nofalse-');
|
||||
const tmp = createTempProject('msd-2761-nofalse-');
|
||||
try {
|
||||
writeBracketProject(tmp);
|
||||
const phaseHeading = runGsdTools(['phase', 'add', 'Refs\n### [GSD.02] 07: cross ref'], tmp);
|
||||
const phaseHeading = runMsdTools(['phase', 'add', 'Refs\n### [MSD.02] 07: cross ref'], tmp);
|
||||
assert.equal(
|
||||
phaseHeading.success,
|
||||
true,
|
||||
`a bracket PHASE heading never terminates a window and must not be flagged: ${phaseHeading.error || ''}`
|
||||
);
|
||||
|
||||
const fenced = runGsdTools(['phase', 'add', 'Docs\n\n```markdown\n## [GSD.09] Example\n```\n'], tmp);
|
||||
const fenced = runMsdTools(['phase', 'add', 'Docs\n\n```markdown\n## [MSD.09] Example\n```\n'], tmp);
|
||||
assert.equal(
|
||||
fenced.success,
|
||||
true,
|
||||
@@ -429,10 +429,10 @@ describe('#2761 milestone-scope guard — bracket convention arm (#612)', () =>
|
||||
});
|
||||
|
||||
test('ordinary bracket-repo descriptions still succeed (no false rejection)', () => {
|
||||
const tmp = createTempProject('gsd-2761-ok-');
|
||||
const tmp = createTempProject('msd-2761-ok-');
|
||||
try {
|
||||
writeBracketProject(tmp);
|
||||
const res = runGsdTools(['phase', 'add', 'Authentication and sessions'], tmp);
|
||||
const res = runMsdTools(['phase', 'add', 'Authentication and sessions'], tmp);
|
||||
assert.equal(res.success, true, `ordinary add must keep working on a bracket repo: ${res.error || ''}`);
|
||||
} finally {
|
||||
cleanup(tmp);
|
||||
|
||||
Reference in New Issue
Block a user