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:
@@ -7,7 +7,7 @@ const path = require('path');
|
||||
const { cleanup, toPosixPath } = require('./helpers.cjs');
|
||||
const { makeFakeClock } = require('./helpers/clock.cjs');
|
||||
|
||||
const planningWorkspaceDirect = require('../gsd-core/bin/lib/planning-workspace.cjs');
|
||||
const planningWorkspaceDirect = require('../msd-core/bin/lib/planning-workspace.cjs');
|
||||
|
||||
const {
|
||||
createPlanningWorkspace,
|
||||
@@ -25,17 +25,17 @@ describe('planning-workspace: planningDir/planningPaths parity', () => {
|
||||
let savedWorkstream;
|
||||
|
||||
beforeEach(() => {
|
||||
savedProject = process.env.GSD_PROJECT;
|
||||
savedWorkstream = process.env.GSD_WORKSTREAM;
|
||||
delete process.env.GSD_PROJECT;
|
||||
delete process.env.GSD_WORKSTREAM;
|
||||
savedProject = process.env.MSD_PROJECT;
|
||||
savedWorkstream = process.env.MSD_WORKSTREAM;
|
||||
delete process.env.MSD_PROJECT;
|
||||
delete process.env.MSD_WORKSTREAM;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
if (savedProject !== undefined) process.env.GSD_PROJECT = savedProject;
|
||||
else delete process.env.GSD_PROJECT;
|
||||
if (savedWorkstream !== undefined) process.env.GSD_WORKSTREAM = savedWorkstream;
|
||||
else delete process.env.GSD_WORKSTREAM;
|
||||
if (savedProject !== undefined) process.env.MSD_PROJECT = savedProject;
|
||||
else delete process.env.MSD_PROJECT;
|
||||
if (savedWorkstream !== undefined) process.env.MSD_WORKSTREAM = savedWorkstream;
|
||||
else delete process.env.MSD_WORKSTREAM;
|
||||
});
|
||||
|
||||
test('matches expected path resolution', () => {
|
||||
@@ -57,13 +57,13 @@ describe('planning-workspace: planningDir/planningPaths parity', () => {
|
||||
|
||||
test('normalizes whitespace-only and padded environment scope names (#4462)', () => {
|
||||
for (const whitespace of [' ', '\t', '\n', ' \t\n ']) {
|
||||
process.env.GSD_WORKSTREAM = whitespace;
|
||||
process.env.GSD_PROJECT = whitespace;
|
||||
process.env.MSD_WORKSTREAM = whitespace;
|
||||
process.env.MSD_PROJECT = whitespace;
|
||||
assert.strictEqual(planningDir(cwd), path.join(cwd, '.planning'));
|
||||
}
|
||||
|
||||
process.env.GSD_WORKSTREAM = ' feature-x ';
|
||||
process.env.GSD_PROJECT = ' my-app ';
|
||||
process.env.MSD_WORKSTREAM = ' feature-x ';
|
||||
process.env.MSD_PROJECT = ' my-app ';
|
||||
assert.strictEqual(
|
||||
planningDir(cwd),
|
||||
path.join(cwd, '.planning', 'my-app', 'workstreams', 'feature-x'),
|
||||
@@ -87,7 +87,7 @@ describe('planning-workspace: planningDir/planningPaths parity', () => {
|
||||
}).map((chars) => chars.join(''));
|
||||
|
||||
fc.assert(fc.property(whitespace, segment, whitespace, (leading, name, trailing) => {
|
||||
process.env.GSD_WORKSTREAM = `${leading}${name}${trailing}`;
|
||||
process.env.MSD_WORKSTREAM = `${leading}${name}${trailing}`;
|
||||
assert.strictEqual(
|
||||
planningDir(cwd),
|
||||
path.join(cwd, '.planning', 'workstreams', name),
|
||||
@@ -96,7 +96,7 @@ describe('planning-workspace: planningDir/planningPaths parity', () => {
|
||||
}));
|
||||
|
||||
fc.assert(fc.property(whitespace, (value) => {
|
||||
process.env.GSD_WORKSTREAM = value;
|
||||
process.env.MSD_WORKSTREAM = value;
|
||||
assert.strictEqual(
|
||||
planningDir(cwd),
|
||||
path.join(cwd, '.planning'),
|
||||
@@ -110,18 +110,18 @@ describe('planning-workspace: session adapter precedence', () => {
|
||||
let savedSession;
|
||||
|
||||
beforeEach(() => {
|
||||
savedSession = process.env.GSD_SESSION_KEY;
|
||||
savedSession = process.env.MSD_SESSION_KEY;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
if (savedSession !== undefined) process.env.GSD_SESSION_KEY = savedSession;
|
||||
else delete process.env.GSD_SESSION_KEY;
|
||||
if (savedSession !== undefined) process.env.MSD_SESSION_KEY = savedSession;
|
||||
else delete process.env.MSD_SESSION_KEY;
|
||||
});
|
||||
|
||||
test('uses session adapter over shared adapter when session key exists', () => {
|
||||
process.env.GSD_SESSION_KEY = 'session-123';
|
||||
process.env.MSD_SESSION_KEY = 'session-123';
|
||||
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-planning-precedence-'));
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-planning-precedence-'));
|
||||
try {
|
||||
fs.mkdirSync(path.join(tmpDir, '.planning', 'workstreams', 'session-ws'), { recursive: true });
|
||||
fs.mkdirSync(path.join(tmpDir, '.planning', 'workstreams', 'shared-ws'), { recursive: true });
|
||||
@@ -151,7 +151,7 @@ describe('planning-workspace: self-heal behavior', () => {
|
||||
});
|
||||
|
||||
test('clears stale pointers when workstream directory is gone', () => {
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-planning-workspace-'));
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-planning-workspace-'));
|
||||
try {
|
||||
fs.mkdirSync(path.join(tmpDir, '.planning', 'workstreams'), { recursive: true });
|
||||
const adapter = createMemoryPointerAdapter('ghost');
|
||||
@@ -169,7 +169,7 @@ describe('planning-workspace: self-heal behavior', () => {
|
||||
|
||||
describe('planning-workspace: lock seam', () => {
|
||||
test('exports withPlanningLock and acquires/release lock', () => {
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-planning-lock-'));
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-planning-lock-'));
|
||||
try {
|
||||
const result = withPlanningLock(tmpDir, () => 'ok');
|
||||
assert.strictEqual(result, 'ok');
|
||||
@@ -180,7 +180,7 @@ describe('planning-workspace: lock seam', () => {
|
||||
});
|
||||
|
||||
test('does not retry errors thrown by locked work', () => {
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-planning-lock-work-error-'));
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-planning-lock-work-error-'));
|
||||
let attempts = 0;
|
||||
try {
|
||||
assert.throws(() => {
|
||||
@@ -203,17 +203,17 @@ describe('planning-workspace direct: functions expose matching behavior', () =>
|
||||
let savedSession;
|
||||
|
||||
beforeEach(() => {
|
||||
savedSession = process.env.GSD_SESSION_KEY;
|
||||
delete process.env.GSD_SESSION_KEY;
|
||||
savedSession = process.env.MSD_SESSION_KEY;
|
||||
delete process.env.MSD_SESSION_KEY;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
if (savedSession !== undefined) process.env.GSD_SESSION_KEY = savedSession;
|
||||
else delete process.env.GSD_SESSION_KEY;
|
||||
if (savedSession !== undefined) process.env.MSD_SESSION_KEY = savedSession;
|
||||
else delete process.env.MSD_SESSION_KEY;
|
||||
});
|
||||
|
||||
test('planning-workspace functions work consistently', () => {
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-core-compat-'));
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-core-compat-'));
|
||||
try {
|
||||
fs.mkdirSync(path.join(tmpDir, '.planning', 'workstreams', 'alpha'), { recursive: true });
|
||||
|
||||
@@ -260,7 +260,7 @@ describe('withPlanningLock PID-liveness staleness + EEXIST safety (audit M1+M2)'
|
||||
let lockPath;
|
||||
|
||||
beforeEach(() => {
|
||||
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-liveness-planning-'));
|
||||
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-liveness-planning-'));
|
||||
fs.mkdirSync(path.join(tmpDir, '.planning'), { recursive: true });
|
||||
lockPath = path.join(tmpDir, '.planning', '.lock');
|
||||
});
|
||||
@@ -440,7 +440,7 @@ const { describe, test, beforeEach, afterEach } = 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');
|
||||
|
||||
describe('bug #3739 — gap-analysis padded-prefix CONTEXT.md', () => {
|
||||
let tmpDir;
|
||||
@@ -459,7 +459,7 @@ describe('bug #3739 — gap-analysis padded-prefix CONTEXT.md', () => {
|
||||
}
|
||||
|
||||
function ensureConfig() {
|
||||
const r = runGsdTools('config-ensure-section', tmpDir);
|
||||
const r = runMsdTools('config-ensure-section', tmpDir);
|
||||
assert.ok(r.success, `config-ensure-section failed: ${r.error}`);
|
||||
}
|
||||
|
||||
@@ -483,7 +483,7 @@ describe('bug #3739 — gap-analysis padded-prefix CONTEXT.md', () => {
|
||||
]);
|
||||
writePlan('01', '# Plan\n\nImplements D-01 and D-02.\n');
|
||||
|
||||
const r = runGsdTools(['gap-analysis', '--phase-dir', phaseDir], tmpDir);
|
||||
const r = runMsdTools(['gap-analysis', '--phase-dir', phaseDir], tmpDir);
|
||||
assert.ok(r.success, `gap-analysis failed: ${r.error}`);
|
||||
const out = JSON.parse(r.output);
|
||||
|
||||
@@ -505,7 +505,7 @@ describe('bug #3739 — gap-analysis padded-prefix CONTEXT.md', () => {
|
||||
]);
|
||||
writePlan('01', '# Plan\n\nUnrelated work, no mention of any D-NN.\n');
|
||||
|
||||
const r = runGsdTools(['gap-analysis', '--phase-dir', phaseDir], tmpDir);
|
||||
const r = runMsdTools(['gap-analysis', '--phase-dir', phaseDir], tmpDir);
|
||||
assert.ok(r.success, `gap-analysis failed: ${r.error}`);
|
||||
const out = JSON.parse(r.output);
|
||||
|
||||
@@ -523,7 +523,7 @@ describe('bug #3739 — gap-analysis padded-prefix CONTEXT.md', () => {
|
||||
]);
|
||||
writePlan('01', '# Plan\n\nImplements D-05.\n');
|
||||
|
||||
const r = runGsdTools(['gap-analysis', '--phase-dir', phaseDir], tmpDir);
|
||||
const r = runMsdTools(['gap-analysis', '--phase-dir', phaseDir], tmpDir);
|
||||
assert.ok(r.success, `gap-analysis failed: ${r.error}`);
|
||||
const out = JSON.parse(r.output);
|
||||
|
||||
@@ -540,7 +540,7 @@ describe('bug #3739 — gap-analysis padded-prefix CONTEXT.md', () => {
|
||||
]);
|
||||
writePlan('01', '# Plan\n\nImplements D-03.\n');
|
||||
|
||||
const r = runGsdTools(['gap-analysis', '--phase-dir', phaseDir], tmpDir);
|
||||
const r = runMsdTools(['gap-analysis', '--phase-dir', phaseDir], tmpDir);
|
||||
assert.ok(r.success, `gap-analysis failed: ${r.error}`);
|
||||
const out = JSON.parse(r.output);
|
||||
|
||||
@@ -557,7 +557,7 @@ describe('bug #3739 — gap-analysis padded-prefix CONTEXT.md', () => {
|
||||
// return value.
|
||||
|
||||
test('findContextMdIn helper returns padded filename when present (matrix row 2)', () => {
|
||||
const { findContextMdIn } = require('../gsd-core/bin/lib/planning-workspace.cjs');
|
||||
const { findContextMdIn } = require('../msd-core/bin/lib/planning-workspace.cjs');
|
||||
// Write 01-CONTEXT.md into the phase dir (already created in beforeEach)
|
||||
fs.writeFileSync(path.join(phaseDir, '01-CONTEXT.md'), '# context\n');
|
||||
|
||||
@@ -569,7 +569,7 @@ describe('bug #3739 — gap-analysis padded-prefix CONTEXT.md', () => {
|
||||
});
|
||||
|
||||
test('findContextMdIn helper returns bare filename when only bare form exists (matrix row 1)', () => {
|
||||
const { findContextMdIn } = require('../gsd-core/bin/lib/planning-workspace.cjs');
|
||||
const { findContextMdIn } = require('../msd-core/bin/lib/planning-workspace.cjs');
|
||||
fs.writeFileSync(path.join(phaseDir, 'CONTEXT.md'), '# context\n');
|
||||
|
||||
const result = findContextMdIn(phaseDir);
|
||||
@@ -579,7 +579,7 @@ describe('bug #3739 — gap-analysis padded-prefix CONTEXT.md', () => {
|
||||
});
|
||||
|
||||
test('findContextMdIn helper returns null file when no CONTEXT.md exists (matrix row 3)', () => {
|
||||
const { findContextMdIn } = require('../gsd-core/bin/lib/planning-workspace.cjs');
|
||||
const { findContextMdIn } = require('../msd-core/bin/lib/planning-workspace.cjs');
|
||||
// phaseDir exists but is empty (no CONTEXT.md)
|
||||
const result = findContextMdIn(phaseDir);
|
||||
assert.strictEqual(result.file, null,
|
||||
@@ -591,7 +591,7 @@ describe('bug #3739 — gap-analysis padded-prefix CONTEXT.md', () => {
|
||||
// ── Test 5b: findContextMdIn accepts pre-read files array (avoids double readdirSync) ──
|
||||
|
||||
test('findContextMdIn accepts an already-read files array (avoids double readdirSync)', () => {
|
||||
const { findContextMdIn } = require('../gsd-core/bin/lib/planning-workspace.cjs');
|
||||
const { findContextMdIn } = require('../msd-core/bin/lib/planning-workspace.cjs');
|
||||
// Passing an array directly should behave identically to passing a directory path.
|
||||
assert.strictEqual(findContextMdIn(['CONTEXT.md', 'other.md']), 'CONTEXT.md',
|
||||
'bare form found in array');
|
||||
@@ -607,7 +607,7 @@ describe('bug #3739 — gap-analysis padded-prefix CONTEXT.md', () => {
|
||||
// ── Test 6: dual-file precedence — bare CONTEXT.md wins over padded form ──
|
||||
|
||||
test('findContextMdIn prefers bare CONTEXT.md over padded form (helper level)', () => {
|
||||
const { findContextMdIn } = require('../gsd-core/bin/lib/planning-workspace.cjs');
|
||||
const { findContextMdIn } = require('../msd-core/bin/lib/planning-workspace.cjs');
|
||||
// Write BOTH forms into the phase directory
|
||||
fs.writeFileSync(path.join(phaseDir, 'CONTEXT.md'), '# bare context\n');
|
||||
fs.writeFileSync(path.join(phaseDir, '01-CONTEXT.md'), '# padded context\n');
|
||||
@@ -629,7 +629,7 @@ describe('bug #3739 — gap-analysis padded-prefix CONTEXT.md', () => {
|
||||
|
||||
writePlan('01', '# Plan\n\nImplements D-BARE.\n');
|
||||
|
||||
const r = runGsdTools(['gap-analysis', '--phase-dir', phaseDir], tmpDir);
|
||||
const r = runMsdTools(['gap-analysis', '--phase-dir', phaseDir], tmpDir);
|
||||
assert.ok(r.success, `gap-analysis failed: ${r.error}`);
|
||||
const out = JSON.parse(r.output);
|
||||
|
||||
@@ -663,7 +663,7 @@ describe('bug #3739 — gap-analysis padded-prefix CONTEXT.md', () => {
|
||||
// Matrix rows 4 and 5 below are the identity pair this item exists to keep
|
||||
// distinguishable: both share `file: null`, but only row 5's `scope` differs.
|
||||
describe('bug #1883 / #4014 — findContextMdIn distinguishes unreadable from absent', () => {
|
||||
const { findContextMdIn } = require('../gsd-core/bin/lib/planning-workspace.cjs');
|
||||
const { findContextMdIn } = require('../msd-core/bin/lib/planning-workspace.cjs');
|
||||
|
||||
// Helper: build a Node-style error with a `code`, matching what fs.readdirSync throws.
|
||||
function fsError(code) {
|
||||
@@ -697,13 +697,13 @@ describe('bug #1883 / #4014 — findContextMdIn distinguishes unreadable from ab
|
||||
// genuinely does not exist must NOT become unreadable.
|
||||
test('findContextMdIn reports scope complete with a null file for an absent dir (ENOENT) (matrix row 4)', () => {
|
||||
// A path that genuinely does not exist yields ENOENT from the real OS call.
|
||||
const absent = path.join(os.tmpdir(), 'gsd-1883-does-not-exist-' + process.pid);
|
||||
const absent = path.join(os.tmpdir(), 'msd-1883-does-not-exist-' + process.pid);
|
||||
assert.deepStrictEqual(findContextMdIn(absent), { file: null, files: [], scope: 'complete' },
|
||||
'an absent dir (ENOENT) must report scope complete with a null file — Hyrum: the pre-#4014 null-on-ENOENT contract is unchanged in substance, just re-shaped');
|
||||
});
|
||||
|
||||
test('findContextMdIn finds bare CONTEXT.md (matrix row 1)', (t) => {
|
||||
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-1883-bare-'));
|
||||
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-1883-bare-'));
|
||||
t.after(() => { cleanup(tmp); });
|
||||
fs.writeFileSync(path.join(tmp, 'CONTEXT.md'), '# bare\n');
|
||||
const result = findContextMdIn(tmp);
|
||||
@@ -712,7 +712,7 @@ describe('bug #1883 / #4014 — findContextMdIn distinguishes unreadable from ab
|
||||
});
|
||||
|
||||
test('findContextMdIn finds padded NN-CONTEXT.md (matrix row 2)', (t) => {
|
||||
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-1883-padded-'));
|
||||
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-1883-padded-'));
|
||||
t.after(() => { cleanup(tmp); });
|
||||
fs.writeFileSync(path.join(tmp, '01-CONTEXT.md'), '# padded\n');
|
||||
const result = findContextMdIn(tmp);
|
||||
@@ -746,17 +746,17 @@ describe('#2142: quick task workspace path (planningPaths().quick)', () => {
|
||||
let savedWorkstream;
|
||||
|
||||
beforeEach(() => {
|
||||
savedProject = process.env.GSD_PROJECT;
|
||||
savedWorkstream = process.env.GSD_WORKSTREAM;
|
||||
delete process.env.GSD_PROJECT;
|
||||
delete process.env.GSD_WORKSTREAM;
|
||||
savedProject = process.env.MSD_PROJECT;
|
||||
savedWorkstream = process.env.MSD_WORKSTREAM;
|
||||
delete process.env.MSD_PROJECT;
|
||||
delete process.env.MSD_WORKSTREAM;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
if (savedProject !== undefined) process.env.GSD_PROJECT = savedProject;
|
||||
else delete process.env.GSD_PROJECT;
|
||||
if (savedWorkstream !== undefined) process.env.GSD_WORKSTREAM = savedWorkstream;
|
||||
else delete process.env.GSD_WORKSTREAM;
|
||||
if (savedProject !== undefined) process.env.MSD_PROJECT = savedProject;
|
||||
else delete process.env.MSD_PROJECT;
|
||||
if (savedWorkstream !== undefined) process.env.MSD_WORKSTREAM = savedWorkstream;
|
||||
else delete process.env.MSD_WORKSTREAM;
|
||||
});
|
||||
|
||||
test('exposesQuickDirectoryPath: planningPaths(cwd).quick ends with .planning/quick', () => {
|
||||
|
||||
Reference in New Issue
Block a user