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:
@@ -4,10 +4,10 @@ const { test, describe, beforeEach, afterEach } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const { createTempGitProject, createTempDir, cleanup, runGsdTools } = require('./helpers.cjs');
|
||||
const { createTempGitProject, createTempDir, cleanup, runMsdTools } = require('./helpers.cjs');
|
||||
const { gitOrThrow } = require('./helpers/git-fixture.cjs');
|
||||
|
||||
const VERIFY_PATH = path.join(__dirname, '..', 'gsd-core', 'bin', 'lib', 'verify.cjs');
|
||||
const VERIFY_PATH = path.join(__dirname, '..', 'msd-core', 'bin', 'lib', 'verify.cjs');
|
||||
const { computeContextDrift } = require(VERIFY_PATH);
|
||||
|
||||
describe('computeContextDrift', () => {
|
||||
@@ -62,7 +62,7 @@ describe('computeContextDrift', () => {
|
||||
describe('verify context-drift CLI', () => {
|
||||
let tmp;
|
||||
beforeEach(() => {
|
||||
tmp = createTempGitProject('gsd-context-drift-cli-');
|
||||
tmp = createTempGitProject('msd-context-drift-cli-');
|
||||
});
|
||||
afterEach(() => cleanup(tmp));
|
||||
|
||||
@@ -71,19 +71,19 @@ describe('verify context-drift CLI', () => {
|
||||
}
|
||||
|
||||
test('errors with usage message on missing phase arg', () => {
|
||||
const r = runGsdTools(['verify', 'context-drift'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift'], tmp);
|
||||
assert.strictEqual(r.success, false);
|
||||
assert.match(r.error || '', /Usage: verify context-drift <phase>/);
|
||||
});
|
||||
|
||||
test('treats an empty phase arg as missing', () => {
|
||||
const r = runGsdTools(['verify', 'context-drift', ''], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', ''], tmp);
|
||||
assert.strictEqual(r.success, false);
|
||||
assert.match(r.error || '', /Usage: verify context-drift <phase>/);
|
||||
});
|
||||
|
||||
test('treats a whitespace phase arg as not found, not a usage error', () => {
|
||||
const r = runGsdTools(['verify', 'context-drift', ' '], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', ' '], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.skipped, true);
|
||||
@@ -91,7 +91,7 @@ describe('verify context-drift CLI', () => {
|
||||
});
|
||||
|
||||
test('degrades gracefully for an unresolvable phase', () => {
|
||||
const r = runGsdTools(['verify', 'context-drift', '99'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '99'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.skipped, true);
|
||||
@@ -100,7 +100,7 @@ describe('verify context-drift CLI', () => {
|
||||
});
|
||||
|
||||
test('does not interpret shell metacharacters in the phase arg', () => {
|
||||
const r = runGsdTools(['verify', 'context-drift', '1; echo pwned'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '1; echo pwned'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.skipped, true);
|
||||
@@ -108,7 +108,7 @@ describe('verify context-drift CLI', () => {
|
||||
});
|
||||
|
||||
test('does not path-traverse via a hostile phase arg', () => {
|
||||
const r = runGsdTools(['verify', 'context-drift', '../../etc'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '../../etc'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.skipped, true);
|
||||
@@ -121,7 +121,7 @@ describe('verify context-drift CLI', () => {
|
||||
// inside the sandbox as a nonexistent path and would pass for the wrong
|
||||
// reason). validatePath must reject this by real-path containment, not by
|
||||
// accidental non-existence.
|
||||
const r = runGsdTools(['verify', 'context-drift', '../../../../../../../../../../etc'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '../../../../../../../../../../etc'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.skipped, true);
|
||||
@@ -132,7 +132,7 @@ describe('verify context-drift CLI', () => {
|
||||
const dir = phaseDirPath('01-setup');
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
fs.writeFileSync(path.join(dir, '01-RESEARCH.md'), '# research\n');
|
||||
const r = runGsdTools(['verify', 'context-drift', '01-setup'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '01-setup'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.skipped, true);
|
||||
@@ -144,7 +144,7 @@ describe('verify context-drift CLI', () => {
|
||||
const dir = phaseDirPath('01-setup');
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
fs.writeFileSync(path.join(dir, '01-CONTEXT.md'), '# context\n');
|
||||
const r = runGsdTools(['verify', 'context-drift', '01-setup'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '01-setup'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.skipped, true);
|
||||
@@ -157,7 +157,7 @@ describe('verify context-drift CLI', () => {
|
||||
fs.writeFileSync(path.join(dir, '01-CONTEXT.md'), '# context\n');
|
||||
fs.writeFileSync(path.join(dir, '01-AI-SPEC.md'), '# ai spec\n');
|
||||
fs.writeFileSync(path.join(dir, '01-UI-SPEC.md'), '# ui spec\n');
|
||||
const r = runGsdTools(['verify', 'context-drift', '01-setup'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '01-setup'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.skipped, true);
|
||||
@@ -165,7 +165,7 @@ describe('verify context-drift CLI', () => {
|
||||
});
|
||||
|
||||
test('degrades to mtime comparison outside a git repo', () => {
|
||||
const plain = createTempDir('gsd-context-drift-nogit-');
|
||||
const plain = createTempDir('msd-context-drift-nogit-');
|
||||
try {
|
||||
const dir = path.join(plain, '.planning', 'phases', '01-setup');
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
@@ -179,7 +179,7 @@ describe('verify context-drift CLI', () => {
|
||||
fs.utimesSync(path.join(dir, '01-RESEARCH.md'), new Date(now - 5000), new Date(now - 5000));
|
||||
fs.writeFileSync(path.join(dir, '01-CONTEXT.md'), '# context\n');
|
||||
fs.utimesSync(path.join(dir, '01-CONTEXT.md'), new Date(now), new Date(now));
|
||||
const r = runGsdTools(['verify', 'context-drift', '01-setup'], plain);
|
||||
const r = runMsdTools(['verify', 'context-drift', '01-setup'], plain);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.skipped, false);
|
||||
@@ -199,7 +199,7 @@ describe('verify context-drift CLI', () => {
|
||||
fs.utimesSync(path.join(dir, '01-RESEARCH.md'), new Date(now - 5000), new Date(now - 5000));
|
||||
fs.writeFileSync(path.join(dir, '01-CONTEXT.md'), '# context\n');
|
||||
fs.utimesSync(path.join(dir, '01-CONTEXT.md'), new Date(now), new Date(now));
|
||||
const r = runGsdTools(['verify', 'context-drift', '01-setup'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '01-setup'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.skipped, false);
|
||||
@@ -215,7 +215,7 @@ describe('verify context-drift CLI', () => {
|
||||
fs.writeFileSync(path.join(dir, '01-RESEARCH.md'), '# research\n');
|
||||
gitOrThrow(['add', '.'], { cwd: tmp });
|
||||
gitOrThrow(['commit', '-m', 'research'], { cwd: tmp });
|
||||
const r = runGsdTools(['verify', 'context-drift', '01-setup'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '01-setup'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.skipped, false);
|
||||
@@ -231,7 +231,7 @@ describe('verify context-drift CLI', () => {
|
||||
gitOrThrow(['add', '.'], { cwd: tmp });
|
||||
gitOrThrow(['commit', '-m', 'context+research'], { cwd: tmp });
|
||||
fs.appendFileSync(path.join(dir, '01-CONTEXT.md'), 'D-02\n');
|
||||
const r = runGsdTools(['verify', 'context-drift', '01-setup'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '01-setup'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.skipped, false);
|
||||
@@ -247,7 +247,7 @@ describe('verify context-drift CLI', () => {
|
||||
gitOrThrow(['add', '.'], { cwd: tmp });
|
||||
gitOrThrow(['commit', '-m', 'phase 3: context, research, patterns'], { cwd: tmp });
|
||||
fs.appendFileSync(path.join(dir, '03-CONTEXT.md'), 'D-10\nD-11\nD-12\nD-13\n');
|
||||
const r = runGsdTools(['verify', 'context-drift', '03-feature'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '03-feature'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.skipped, false);
|
||||
@@ -266,7 +266,7 @@ describe('verify context-drift CLI', () => {
|
||||
gitOrThrow(['commit', '-m', 'research'], { cwd: tmp });
|
||||
fs.appendFileSync(path.join(dir, '03-CONTEXT.md'), 'D-99\n');
|
||||
assert.ok(!fs.existsSync(path.join(tmp, '.planning', 'config.json')));
|
||||
const r = runGsdTools(['verify', 'context-drift', '03-feature'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '03-feature'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.action, 'warn');
|
||||
@@ -283,7 +283,7 @@ describe('verify context-drift CLI', () => {
|
||||
gitOrThrow(['add', '.'], { cwd: tmp });
|
||||
gitOrThrow(['commit', '-m', 'research'], { cwd: tmp });
|
||||
fs.appendFileSync(path.join(dir, '03-CONTEXT.md'), 'D-99\n');
|
||||
const r = runGsdTools(['verify', 'context-drift', '03-feature'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '03-feature'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.action, 'warn');
|
||||
@@ -303,7 +303,7 @@ describe('verify context-drift CLI', () => {
|
||||
gitOrThrow(['add', '.'], { cwd: tmp });
|
||||
gitOrThrow(['commit', '-m', 'research'], { cwd: tmp });
|
||||
fs.appendFileSync(path.join(dir, '03-CONTEXT.md'), 'D-99\n');
|
||||
const r = runGsdTools(['verify', 'context-drift', '03-feature'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '03-feature'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.action, 'warn');
|
||||
@@ -323,7 +323,7 @@ describe('verify context-drift CLI', () => {
|
||||
gitOrThrow(['add', '.'], { cwd: tmp });
|
||||
gitOrThrow(['commit', '-m', 'research'], { cwd: tmp });
|
||||
fs.appendFileSync(path.join(dir, '03-CONTEXT.md'), 'D-99\n');
|
||||
const r = runGsdTools(['verify', 'context-drift', '03-feature'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '03-feature'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.strictEqual(data.action, 'block');
|
||||
@@ -344,7 +344,7 @@ describe('verify context-drift CLI', () => {
|
||||
fs.writeFileSync(path.join(dir, '03-RESEARCH.md'), '# research\n');
|
||||
gitOrThrow(['add', '.'], { cwd: tmp });
|
||||
gitOrThrow(['commit', '-m', 'research'], { cwd: tmp });
|
||||
const r = runGsdTools(['verify', 'context-drift', '03-feature'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '03-feature'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
const data = JSON.parse(r.output);
|
||||
assert.deepStrictEqual(data.stale_artifacts, []);
|
||||
@@ -355,7 +355,7 @@ describe('verify context-drift CLI', () => {
|
||||
const dir = phaseDirPath('01-setup');
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
fs.writeFileSync(path.join(dir, '01-CONTEXT.md'), '# context\n');
|
||||
const r = runGsdTools(['verify', 'context-drift', '01-setup', '--raw'], tmp);
|
||||
const r = runMsdTools(['verify', 'context-drift', '01-setup', '--raw'], tmp);
|
||||
assert.strictEqual(r.success, true, r.error);
|
||||
});
|
||||
|
||||
@@ -368,7 +368,7 @@ describe('verify context-drift CLI', () => {
|
||||
['verify', 'context-drift', '99'],
|
||||
];
|
||||
for (const args of cases) {
|
||||
const r = runGsdTools(args, tmp);
|
||||
const r = runMsdTools(args, tmp);
|
||||
assert.strictEqual(r.exitCode, 0, `args=${JSON.stringify(args)} exitCode=${r.exitCode}`);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user