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:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* GSD Tools Tests - Verify
|
||||
* MSD Tools Tests - Verify
|
||||
*/
|
||||
|
||||
const { test, describe, beforeEach, afterEach } = require('node:test');
|
||||
@@ -7,7 +7,7 @@ const assert = require('node:assert/strict');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const os = require('os');
|
||||
const { runGsdTools, createTempProject, createTempGitProject, cleanup } = require('./helpers.cjs');
|
||||
const { runMsdTools, createTempProject, createTempGitProject, cleanup } = require('./helpers.cjs');
|
||||
const { gitOrThrow } = require('./helpers/git-fixture.cjs');
|
||||
const { runHook } = require('./helpers/process-seam.cjs');
|
||||
|
||||
@@ -76,7 +76,7 @@ describe('validate consistency command', () => {
|
||||
fs.mkdirSync(path.join(tmpDir, '.planning', 'phases', '02-b'), { recursive: true });
|
||||
fs.mkdirSync(path.join(tmpDir, '.planning', 'phases', '03-c'), { recursive: true });
|
||||
|
||||
const result = runGsdTools('validate consistency', tmpDir);
|
||||
const result = runMsdTools('validate consistency', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -92,7 +92,7 @@ describe('validate consistency command', () => {
|
||||
fs.mkdirSync(path.join(tmpDir, '.planning', 'phases', '01-a'), { recursive: true });
|
||||
fs.mkdirSync(path.join(tmpDir, '.planning', 'phases', '02-orphan'), { recursive: true });
|
||||
|
||||
const result = runGsdTools('validate consistency', tmpDir);
|
||||
const result = runMsdTools('validate consistency', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -121,7 +121,7 @@ describe('validate consistency command', () => {
|
||||
// A real orphan (non-sentinel) that SHOULD still warn.
|
||||
fs.mkdirSync(path.join(tmpDir, '.planning', 'phases', '02-orphan'), { recursive: true });
|
||||
|
||||
const result = runGsdTools('validate consistency', tmpDir);
|
||||
const result = runMsdTools('validate consistency', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
const output = JSON.parse(result.output);
|
||||
|
||||
@@ -157,7 +157,7 @@ describe('validate consistency command', () => {
|
||||
fs.mkdirSync(path.join(tmpDir, '.planning', 'phases', '01-a'), { recursive: true });
|
||||
fs.mkdirSync(path.join(tmpDir, '.planning', 'phases', '03-c'), { recursive: true });
|
||||
|
||||
const result = runGsdTools('validate consistency', tmpDir);
|
||||
const result = runMsdTools('validate consistency', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -194,7 +194,7 @@ describe('verify plan-structure command', () => {
|
||||
const planPath = path.join(tmpDir, '.planning', 'phases', '01-test', '01-01-PLAN.md');
|
||||
fs.writeFileSync(planPath, '# No frontmatter here\n\nJust a plan without YAML.\n');
|
||||
|
||||
const result = runGsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -209,7 +209,7 @@ describe('verify plan-structure command', () => {
|
||||
const planPath = path.join(tmpDir, '.planning', 'phases', '01-test', '01-01-PLAN.md');
|
||||
fs.writeFileSync(planPath, validPlanContent());
|
||||
|
||||
const result = runGsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -245,7 +245,7 @@ describe('verify plan-structure command', () => {
|
||||
const planPath = path.join(tmpDir, '.planning', 'phases', '01-test', '01-01-PLAN.md');
|
||||
fs.writeFileSync(planPath, content);
|
||||
|
||||
const result = runGsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -282,7 +282,7 @@ describe('verify plan-structure command', () => {
|
||||
const planPath = path.join(tmpDir, '.planning', 'phases', '01-test', '01-01-PLAN.md');
|
||||
fs.writeFileSync(planPath, content);
|
||||
|
||||
const result = runGsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -296,7 +296,7 @@ describe('verify plan-structure command', () => {
|
||||
const planPath = path.join(tmpDir, '.planning', 'phases', '01-test', '01-01-PLAN.md');
|
||||
fs.writeFileSync(planPath, validPlanContent({ wave: 2, dependsOn: '[]' }));
|
||||
|
||||
const result = runGsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -341,7 +341,7 @@ describe('verify plan-structure command', () => {
|
||||
const planPath = path.join(tmpDir, '.planning', 'phases', '01-test', '01-01-PLAN.md');
|
||||
fs.writeFileSync(planPath, content);
|
||||
|
||||
const result = runGsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -352,7 +352,7 @@ describe('verify plan-structure command', () => {
|
||||
});
|
||||
|
||||
test('returns error for nonexistent file', () => {
|
||||
const result = runGsdTools('verify plan-structure .planning/phases/01-test/nonexistent.md', tmpDir);
|
||||
const result = runMsdTools('verify plan-structure .planning/phases/01-test/nonexistent.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -367,7 +367,7 @@ describe('verify plan-structure command', () => {
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// verify plan-structure — checkpoint task types (#2444)
|
||||
// A checkpoint:* task uses type-specific required fields (per
|
||||
// gsd-core/references/checkpoints.md), NOT the auto-task <action>/<verify>/<done>.
|
||||
// msd-core/references/checkpoints.md), NOT the auto-task <action>/<verify>/<done>.
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
describe('verify plan-structure — checkpoint task types (#2444)', () => {
|
||||
@@ -407,7 +407,7 @@ describe('verify plan-structure — checkpoint task types (#2444)', () => {
|
||||
function runVerify(planContent) {
|
||||
const planPath = path.join(tmpDir, '.planning', 'phases', '01-test', '01-01-PLAN.md');
|
||||
fs.writeFileSync(planPath, planContent);
|
||||
const result = runGsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
return JSON.parse(result.output);
|
||||
}
|
||||
@@ -789,7 +789,7 @@ describe('verify plan-structure — attributed child tags (#3193)', () => {
|
||||
function runVerify(planContent) {
|
||||
const planPath = path.join(tmpDir, '.planning', 'phases', '01-test', '01-01-PLAN.md');
|
||||
fs.writeFileSync(planPath, planContent);
|
||||
const result = runGsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
return JSON.parse(result.output);
|
||||
}
|
||||
@@ -1042,7 +1042,7 @@ describe('verify phase-completeness command', () => {
|
||||
fs.writeFileSync(path.join(phaseDir, '01-01-PLAN.md'), '# Plan\n');
|
||||
fs.writeFileSync(path.join(phaseDir, '01-01-SUMMARY.md'), '# Summary\n');
|
||||
|
||||
const result = runGsdTools('verify phase-completeness 01', tmpDir);
|
||||
const result = runMsdTools('verify phase-completeness 01', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1056,7 +1056,7 @@ describe('verify phase-completeness command', () => {
|
||||
const phaseDir = path.join(tmpDir, '.planning', 'phases', '01-test');
|
||||
fs.writeFileSync(path.join(phaseDir, '01-01-PLAN.md'), '# Plan\n');
|
||||
|
||||
const result = runGsdTools('verify phase-completeness 01', tmpDir);
|
||||
const result = runMsdTools('verify phase-completeness 01', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1075,7 +1075,7 @@ describe('verify phase-completeness command', () => {
|
||||
const phaseDir = path.join(tmpDir, '.planning', 'phases', '01-test');
|
||||
fs.writeFileSync(path.join(phaseDir, '01-01-SUMMARY.md'), '# Summary\n');
|
||||
|
||||
const result = runGsdTools('verify phase-completeness 01', tmpDir);
|
||||
const result = runMsdTools('verify phase-completeness 01', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1086,7 +1086,7 @@ describe('verify phase-completeness command', () => {
|
||||
});
|
||||
|
||||
test('returns error for nonexistent phase', () => {
|
||||
const result = runGsdTools('verify phase-completeness 99', tmpDir);
|
||||
const result = runMsdTools('verify phase-completeness 99', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1111,7 +1111,7 @@ describe('verify summary command', () => {
|
||||
});
|
||||
|
||||
test('returns not found for nonexistent summary', () => {
|
||||
const result = runGsdTools('verify-summary .planning/phases/01-test/nonexistent.md', tmpDir);
|
||||
const result = runMsdTools('verify-summary .planning/phases/01-test/nonexistent.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1142,7 +1142,7 @@ describe('verify summary command', () => {
|
||||
`Commit: ${hash}`,
|
||||
].join('\n'));
|
||||
|
||||
const result = runGsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
const result = runMsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1159,7 +1159,7 @@ describe('verify summary command', () => {
|
||||
'Created: `src/nonexistent.js`',
|
||||
].join('\n'));
|
||||
|
||||
const result = runGsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
const result = runMsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1179,7 +1179,7 @@ describe('verify summary command', () => {
|
||||
'All tests pass',
|
||||
].join('\n'));
|
||||
|
||||
const result = runGsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
const result = runMsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1196,7 +1196,7 @@ describe('verify summary command', () => {
|
||||
'Tests failed',
|
||||
].join('\n'));
|
||||
|
||||
const result = runGsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
const result = runMsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1213,7 +1213,7 @@ describe('verify summary command', () => {
|
||||
'Everything went well.',
|
||||
].join('\n'));
|
||||
|
||||
const result = runGsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
const result = runMsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1233,7 +1233,7 @@ describe('verify summary command', () => {
|
||||
'Some content here without a self-check heading.',
|
||||
].join('\n'));
|
||||
|
||||
const result = runGsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
const result = runMsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1251,7 +1251,7 @@ describe('verify summary command', () => {
|
||||
].join('\n'));
|
||||
|
||||
// Pass checkFileCount = 1 so only 1 file is checked
|
||||
const result = runGsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md --check-count 1', tmpDir);
|
||||
const result = runMsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md --check-count 1', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1280,7 +1280,7 @@ describe('verify summary command', () => {
|
||||
'Created: `src/real.ts`',
|
||||
].join('\n'));
|
||||
|
||||
const result = runGsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
const result = runMsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
const output = JSON.parse(result.output);
|
||||
assert.strictEqual(output.passed, true,
|
||||
@@ -1301,7 +1301,7 @@ describe('verify summary command', () => {
|
||||
'Next phase will add `shared/types.ts` for the shared schema.',
|
||||
].join('\n'));
|
||||
|
||||
const result = runGsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
const result = runMsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
const output = JSON.parse(result.output);
|
||||
assert.strictEqual(output.passed, true,
|
||||
@@ -1317,7 +1317,7 @@ describe('verify summary command', () => {
|
||||
'Created: `src/missing.ts`',
|
||||
].join('\n'));
|
||||
|
||||
const result = runGsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
const result = runMsdTools('verify-summary .planning/phases/01-test/01-01-SUMMARY.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
const output = JSON.parse(result.output);
|
||||
assert.strictEqual(output.passed, false, 'an absent claimed file must fail the verdict');
|
||||
@@ -1348,7 +1348,7 @@ describe('verify references command', () => {
|
||||
const filePath = path.join(tmpDir, '.planning', 'phases', '01-test', 'doc.md');
|
||||
fs.writeFileSync(filePath, '@src/app.js\n');
|
||||
|
||||
const result = runGsdTools('verify references .planning/phases/01-test/doc.md', tmpDir);
|
||||
const result = runMsdTools('verify references .planning/phases/01-test/doc.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1360,7 +1360,7 @@ describe('verify references command', () => {
|
||||
const filePath = path.join(tmpDir, '.planning', 'phases', '01-test', 'doc.md');
|
||||
fs.writeFileSync(filePath, '@src/missing.js\n');
|
||||
|
||||
const result = runGsdTools('verify references .planning/phases/01-test/doc.md', tmpDir);
|
||||
const result = runMsdTools('verify references .planning/phases/01-test/doc.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1376,7 +1376,7 @@ describe('verify references command', () => {
|
||||
const filePath = path.join(tmpDir, '.planning', 'phases', '01-test', 'doc.md');
|
||||
fs.writeFileSync(filePath, 'See `src/utils/helper.js` for details.\n');
|
||||
|
||||
const result = runGsdTools('verify references .planning/phases/01-test/doc.md', tmpDir);
|
||||
const result = runMsdTools('verify references .planning/phases/01-test/doc.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1389,7 +1389,7 @@ describe('verify references command', () => {
|
||||
const filePath = path.join(tmpDir, '.planning', 'phases', '01-test', 'doc.md');
|
||||
fs.writeFileSync(filePath, '`${variable}/path/file.js`\n');
|
||||
|
||||
const result = runGsdTools('verify references .planning/phases/01-test/doc.md', tmpDir);
|
||||
const result = runMsdTools('verify references .planning/phases/01-test/doc.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1412,7 +1412,7 @@ describe('verify references command', () => {
|
||||
'',
|
||||
].join('\n'));
|
||||
|
||||
const result = runGsdTools('verify references .planning/phases/01-test/doc.md', tmpDir);
|
||||
const result = runMsdTools('verify references .planning/phases/01-test/doc.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1440,7 +1440,7 @@ describe('verify references command', () => {
|
||||
const filePath = path.join(tmpDir, '.planning', 'phases', '01-test', 'doc.md');
|
||||
fs.writeFileSync(filePath, ['- `src/gone.ts:99`', '- `src/also-gone.ts:1-20`', ''].join('\n'));
|
||||
|
||||
const result = runGsdTools('verify references .planning/phases/01-test/doc.md', tmpDir);
|
||||
const result = runMsdTools('verify references .planning/phases/01-test/doc.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1450,7 +1450,7 @@ describe('verify references command', () => {
|
||||
});
|
||||
|
||||
test('returns error for nonexistent file', () => {
|
||||
const result = runGsdTools('verify references .planning/phases/01-test/nonexistent.md', tmpDir);
|
||||
const result = runMsdTools('verify references .planning/phases/01-test/nonexistent.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1476,7 +1476,7 @@ describe('verify commits command', () => {
|
||||
test('validates real commit hashes', () => {
|
||||
const hash = gitOrThrow(['rev-parse', '--short', 'HEAD'], { cwd: tmpDir, timeoutMs: GIT_TIMEOUT_MS }).trim();
|
||||
|
||||
const result = runGsdTools(`verify commits ${hash}`, tmpDir);
|
||||
const result = runMsdTools(`verify commits ${hash}`, tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1485,7 +1485,7 @@ describe('verify commits command', () => {
|
||||
});
|
||||
|
||||
test('reports invalid for fake hashes', () => {
|
||||
const result = runGsdTools('verify commits abcdef1234567', tmpDir);
|
||||
const result = runMsdTools('verify commits abcdef1234567', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1499,7 +1499,7 @@ describe('verify commits command', () => {
|
||||
test('handles mixed valid and invalid hashes', () => {
|
||||
const hash = gitOrThrow(['rev-parse', '--short', 'HEAD'], { cwd: tmpDir, timeoutMs: GIT_TIMEOUT_MS }).trim();
|
||||
|
||||
const result = runGsdTools(`verify commits ${hash} abcdef1234567`, tmpDir);
|
||||
const result = runMsdTools(`verify commits ${hash} abcdef1234567`, tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1564,7 +1564,7 @@ describe('verify artifacts command', () => {
|
||||
]);
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'app.js'), 'const x = 1;\nexport default x;\nconst y = 2;\n');
|
||||
|
||||
const result = runGsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1576,7 +1576,7 @@ describe('verify artifacts command', () => {
|
||||
'- path: "src/nonexistent.js"',
|
||||
]);
|
||||
|
||||
const result = runGsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1594,7 +1594,7 @@ describe('verify artifacts command', () => {
|
||||
]);
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'app.js'), 'const x = 1;\n');
|
||||
|
||||
const result = runGsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1612,7 +1612,7 @@ describe('verify artifacts command', () => {
|
||||
]);
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'app.js'), 'const x = 1;\n');
|
||||
|
||||
const result = runGsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1631,7 +1631,7 @@ describe('verify artifacts command', () => {
|
||||
]);
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'app.js'), 'const x = 1;\nexport const POST = () => {};\n');
|
||||
|
||||
const result = runGsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1662,7 +1662,7 @@ describe('verify artifacts command', () => {
|
||||
const planPath = path.join(tmpDir, '.planning', 'phases', '01-test', '01-01-PLAN.md');
|
||||
fs.writeFileSync(planPath, content);
|
||||
|
||||
const result = runGsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1683,7 +1683,7 @@ describe('verify artifacts command', () => {
|
||||
'- user can reset password',
|
||||
]);
|
||||
|
||||
const result = runGsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1713,7 +1713,7 @@ describe('verify artifacts command', () => {
|
||||
' contains: "hello"',
|
||||
]);
|
||||
|
||||
const result = runGsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command crashed instead of reporting: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1750,7 +1750,7 @@ describe('verify artifacts command', () => {
|
||||
' provides: "a directory of snapshots"',
|
||||
]);
|
||||
|
||||
const result = runGsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command crashed instead of reporting: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1773,7 +1773,7 @@ describe('verify artifacts command', () => {
|
||||
// `node_fs_1.default.statSync(…)`), and the process exits at the end of the case,
|
||||
// so no restore is needed beyond its lifetime.
|
||||
describe('#4685: injected I/O failures on one artifact (ADR-3574 monkeypatching)', () => {
|
||||
const LIB = path.join(__dirname, '..', 'gsd-core', 'bin', 'lib');
|
||||
const LIB = path.join(__dirname, '..', 'msd-core', 'bin', 'lib');
|
||||
|
||||
function withInjection(mode, targetPath) {
|
||||
const preload = path.join(tmpDir, `inject-${mode}.cjs`);
|
||||
@@ -1814,7 +1814,7 @@ if (${JSON.stringify(mode)} === 'enoent-read') {
|
||||
// checked nothing. platformReadSync returns null on ENOENT, so returning null
|
||||
// reproduces exactly that window.
|
||||
const target = writeFixture();
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
'verify artifacts .planning/phases/01-test/01-01-PLAN.md',
|
||||
tmpDir,
|
||||
withInjection('enoent-read', target),
|
||||
@@ -1839,7 +1839,7 @@ if (${JSON.stringify(mode)} === 'enoent-read') {
|
||||
// directory); the assertion pins that the errno reaches the operator rather
|
||||
// than a generic message, because EACCES and EIO call for different responses.
|
||||
const target = writeFixture();
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
'verify artifacts .planning/phases/01-test/01-01-PLAN.md',
|
||||
tmpDir,
|
||||
withInjection('eacces-stat', target),
|
||||
@@ -1871,7 +1871,7 @@ if (${JSON.stringify(mode)} === 'enoent-read') {
|
||||
]);
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'app.js'), 'const x = 1;\nexport default x;\n');
|
||||
|
||||
const result = runGsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify artifacts .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1936,7 +1936,7 @@ describe('verify key-links command', () => {
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'a.js'), "import { x } from './b';\n");
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'b.js'), 'exports.x = 1;\n');
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1958,7 +1958,7 @@ describe('verify key-links command', () => {
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'a.js'), 'const x = 1;\n');
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'b.js'), 'exports.targetFunc = () => {};\n');
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1978,7 +1978,7 @@ describe('verify key-links command', () => {
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'a.js'), 'const x = 1;\n');
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'b.js'), 'const y = 2;\n');
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -1995,7 +1995,7 @@ describe('verify key-links command', () => {
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'a.js'), "const b = require('./src/b.js');\n");
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'b.js'), 'module.exports = {};\n');
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -2014,7 +2014,7 @@ describe('verify key-links command', () => {
|
||||
]);
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'b.js'), 'module.exports = {};\n');
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -2037,7 +2037,7 @@ describe('verify key-links command', () => {
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'a.js'), 'a'.repeat(25) + 'b\n');
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'b.js'), 'module.exports = {};\n');
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -2065,7 +2065,7 @@ describe('verify key-links command', () => {
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'a.js'), 'function f(x) { return x; }\n');
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'b.js'), 'module.exports = {};\n');
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -2098,7 +2098,7 @@ describe('verify key-links command', () => {
|
||||
const planPath = path.join(tmpDir, '.planning', 'phases', '01-test', '01-01-PLAN.md');
|
||||
fs.writeFileSync(planPath, content);
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -2120,7 +2120,7 @@ describe('verify key-links command', () => {
|
||||
'- token is persisted',
|
||||
]);
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -2146,7 +2146,7 @@ describe('verify key-links command', () => {
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'a.js'), "import { x } from './b';\n");
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'b.js'), 'exports.x = 1;\n');
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -2158,7 +2158,7 @@ describe('verify key-links command', () => {
|
||||
// must never be readable outside the project directory. ────────────────────
|
||||
|
||||
test('from: traversal outside project is rejected — not read, per-link failure only (#3493)', () => {
|
||||
const outsideDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-3493-outside-'));
|
||||
const outsideDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-3493-outside-'));
|
||||
try {
|
||||
const outsideFile = path.join(outsideDir, 'secret.txt');
|
||||
fs.writeFileSync(outsideFile, 'top-secret-oracle-bait\n');
|
||||
@@ -2170,7 +2170,7 @@ describe('verify key-links command', () => {
|
||||
]);
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'b.js'), 'module.exports = {};\n');
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -2197,7 +2197,7 @@ describe('verify key-links command', () => {
|
||||
});
|
||||
|
||||
test('to: traversal is rejected — outside file content never read even when pattern would match it (#3493)', () => {
|
||||
const outsideDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-3493-outside-'));
|
||||
const outsideDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-3493-outside-'));
|
||||
try {
|
||||
const outsideFile = path.join(outsideDir, 'secret.txt');
|
||||
fs.writeFileSync(outsideFile, 'oracleMarkerXYZ\n');
|
||||
@@ -2212,7 +2212,7 @@ describe('verify key-links command', () => {
|
||||
// fall through to the target read — proving the oracle stays closed.
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'a.js'), 'const x = 1;\n');
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -2228,9 +2228,9 @@ describe('verify key-links command', () => {
|
||||
});
|
||||
|
||||
test('absolute from: path is rejected (#3493)', () => {
|
||||
const absoluteDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-3493-absolute-'));
|
||||
const absoluteDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-3493-absolute-'));
|
||||
try {
|
||||
const absoluteFrom = path.join(absoluteDir, 'gsd-3493-absolute-probe.txt');
|
||||
const absoluteFrom = path.join(absoluteDir, 'msd-3493-absolute-probe.txt');
|
||||
fs.writeFileSync(absoluteFrom, 'irrelevant\n');
|
||||
|
||||
writePlanWithKeyLinks(tmpDir, [
|
||||
@@ -2239,7 +2239,7 @@ describe('verify key-links command', () => {
|
||||
]);
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'b.js'), 'module.exports = {};\n');
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -2251,7 +2251,7 @@ describe('verify key-links command', () => {
|
||||
});
|
||||
|
||||
test('a symlink inside the project pointing outside it is rejected as from: (#3493)', (t) => {
|
||||
const outsideDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-3493-outside-'));
|
||||
const outsideDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-3493-outside-'));
|
||||
try {
|
||||
const outsideFile = path.join(outsideDir, 'secret.txt');
|
||||
fs.writeFileSync(outsideFile, 'top-secret-oracle-bait\n');
|
||||
@@ -2272,7 +2272,7 @@ describe('verify key-links command', () => {
|
||||
]);
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'b.js'), 'module.exports = {};\n');
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -2292,7 +2292,7 @@ describe('verify key-links command', () => {
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'a.js'), "import { x } from './b';\n");
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'b.js'), 'exports.x = 1;\n');
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -2302,7 +2302,7 @@ describe('verify key-links command', () => {
|
||||
});
|
||||
|
||||
test('a rejected first link does not abort the second, valid link (#3493 per-link failure)', () => {
|
||||
const outsideDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-3493-outside-'));
|
||||
const outsideDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-3493-outside-'));
|
||||
const outsideFile = path.join(outsideDir, 'secret.txt');
|
||||
fs.writeFileSync(outsideFile, 'irrelevant\n');
|
||||
const traversalFrom = path.relative(tmpDir, outsideFile);
|
||||
@@ -2317,7 +2317,7 @@ describe('verify key-links command', () => {
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'a.js'), "import { x } from './b';\n");
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'b.js'), 'exports.x = 1;\n');
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -2338,7 +2338,7 @@ describe('verify key-links command', () => {
|
||||
]);
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'b.js'), 'module.exports = {};\n');
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -2358,7 +2358,7 @@ describe('verify key-links command', () => {
|
||||
]);
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'a.js'), 'const x = 1;\n');
|
||||
|
||||
const result = runGsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify key-links .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
@@ -2395,7 +2395,7 @@ const { test, describe, 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');
|
||||
|
||||
// ─── helpers ──────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -2497,7 +2497,7 @@ describe('bug-967 verify key-links strict file-path contract', () => {
|
||||
fs.mkdirSync(path.join(tmpDir, 'src', 'api'), { recursive: true });
|
||||
fs.writeFileSync(path.join(tmpDir, 'src', 'api', 'feed.js'), 'module.exports = {};\n');
|
||||
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
'verify key-links .planning/phases/01-test/01-01-PLAN.md',
|
||||
tmpDir,
|
||||
);
|
||||
@@ -2522,7 +2522,7 @@ describe('bug-967 verify key-links strict file-path contract', () => {
|
||||
]);
|
||||
// Deliberately do NOT create src/missing-file.js
|
||||
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
'verify key-links .planning/phases/01-test/01-01-PLAN.md',
|
||||
tmpDir,
|
||||
);
|
||||
@@ -2562,7 +2562,7 @@ describe('bug-967 verify key-links strict file-path contract', () => {
|
||||
|
||||
// Do NOT create src/future-artifact.js on disk — it is a planned future file
|
||||
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
'verify key-links .planning/phases/01-test/01-01-PLAN.md',
|
||||
tmpDir,
|
||||
);
|
||||
@@ -2597,7 +2597,7 @@ describe('bug-967 verify key-links strict file-path contract', () => {
|
||||
|
||||
writeCompanionPlan(tmpDir, '01-02-PLAN.md', 3, ['src/later-artifact.js']);
|
||||
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
'verify key-links .planning/phases/01-test/01-01-PLAN.md',
|
||||
tmpDir,
|
||||
);
|
||||
@@ -2628,7 +2628,7 @@ describe('bug-967 verify key-links strict file-path contract', () => {
|
||||
|
||||
// No companion plan that promises src/truly-missing.js
|
||||
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
'verify key-links .planning/phases/01-test/01-01-PLAN.md',
|
||||
tmpDir,
|
||||
);
|
||||
@@ -2710,7 +2710,7 @@ describe('bug-967 verify key-links strict file-path contract', () => {
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Tests for gsd-health MILESTONES.md drift detection (#2446).
|
||||
* Tests for msd-health MILESTONES.md drift detection (#2446).
|
||||
*/
|
||||
|
||||
const { test, after } = require('node:test');
|
||||
@@ -2720,13 +2720,13 @@ const path = require('node:path');
|
||||
const os = require('node:os');
|
||||
const helpers = require('./helpers.cjs');
|
||||
|
||||
const { cmdValidateHealth } = require('../gsd-core/bin/lib/verify.cjs');
|
||||
const { cmdValidateHealth } = require('../msd-core/bin/lib/verify.cjs');
|
||||
|
||||
const _dirsToClean = [];
|
||||
after(() => { for (const d of _dirsToClean) helpers.cleanup(d); });
|
||||
|
||||
function makeTempProject(files = {}) {
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-2446-'));
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-2446-'));
|
||||
_dirsToClean.push(dir);
|
||||
fs.mkdirSync(path.join(dir, '.planning', 'milestones'), { recursive: true });
|
||||
for (const [rel, content] of Object.entries(files)) {
|
||||
@@ -2857,7 +2857,7 @@ test('--backfill alone does NOT apply an unrelated NONE-risk repair (createConfi
|
||||
test('W021 (phase_id_convention mismatch) fires independently of W026 — same fixture never also emits W026', () => {
|
||||
const dir = makeTempProject({
|
||||
'.planning/PROJECT.md': '# P\n\n## What This Is\n\nX\n\n## Core Value\n\nY\n\n## Requirements\n\nZ\n',
|
||||
'.planning/ROADMAP.md': '# Roadmap\n\n## [GSD] v2.0 — Expansion\n\n### Phase 1-01: Setup\n**Goal:** g\n',
|
||||
'.planning/ROADMAP.md': '# Roadmap\n\n## [MSD] v2.0 — Expansion\n\n### Phase 1-01: Setup\n**Goal:** g\n',
|
||||
// STATE.md status is plainly "In progress" — never "milestone complete"
|
||||
// or "archived", so W026's precondition never holds for this fixture.
|
||||
'.planning/STATE.md': '# State\n\n## Current Position\n\nPhase: 1-01\n\n**Status:** In progress\n',
|
||||
@@ -2876,7 +2876,7 @@ test('W021 (phase_id_convention mismatch) fires independently of W026 — same f
|
||||
|
||||
test('health.md mentions --backfill flag', () => {
|
||||
const healthMd = fs.readFileSync(
|
||||
path.join(__dirname, '../gsd-core/workflows/health.md'), 'utf-8'
|
||||
path.join(__dirname, '../msd-core/workflows/health.md'), 'utf-8'
|
||||
);
|
||||
assert.ok(healthMd.includes('--backfill'), 'health.md should document --backfill');
|
||||
assert.ok(healthMd.includes('W018'), 'health.md should list W018 error code');
|
||||
@@ -2904,14 +2904,14 @@ const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const os = require('node:os');
|
||||
const { createTempProject, cleanup, runGsdTools } = require('./helpers.cjs');
|
||||
const { createTempProject, cleanup, runMsdTools } = require('./helpers.cjs');
|
||||
|
||||
// Build path to built verify.cjs
|
||||
const VERIFY_CJS = path.join(__dirname, '..', 'gsd-core', 'bin', 'lib', 'verify.cjs');
|
||||
const VERIFY_CJS = path.join(__dirname, '..', 'msd-core', 'bin', 'lib', 'verify.cjs');
|
||||
|
||||
// Build paths to doc files
|
||||
const PLANNER_MD = path.join(__dirname, '..', 'agents', 'gsd-planner.md');
|
||||
const ANTIPATTERNS_MD = path.join(__dirname, '..', 'gsd-core', 'references', 'planner-antipatterns.md');
|
||||
const PLANNER_MD = path.join(__dirname, '..', 'agents', 'msd-planner.md');
|
||||
const ANTIPATTERNS_MD = path.join(__dirname, '..', 'msd-core', 'references', 'planner-antipatterns.md');
|
||||
// PLAN_MD_REF removed — was unused (doc-contract cases test PLANNER_MD and ANTIPATTERNS_MD only)
|
||||
|
||||
// ─── Fixture helpers ───────────────────────────────────────────────────────────
|
||||
@@ -3575,7 +3575,7 @@ describe('scanFileWideNegativeGateConflict — pure unit tests', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// ─── Group 2: end-to-end via runGsdTools ──────────────────────────────────────
|
||||
// ─── Group 2: end-to-end via runMsdTools ──────────────────────────────────────
|
||||
|
||||
describe('scanFileWideNegativeGateConflict — end-to-end via verify plan-structure', () => {
|
||||
let tmpDir;
|
||||
@@ -3598,7 +3598,7 @@ describe('scanFileWideNegativeGateConflict — end-to-end via verify plan-struct
|
||||
fs.mkdirSync(planDir, { recursive: true });
|
||||
fs.writeFileSync(path.join(planDir, '01-01-PLAN.md'), planContent);
|
||||
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
'verify plan-structure .planning/phases/01-test/01-01-PLAN.md',
|
||||
tmpDir,
|
||||
);
|
||||
@@ -3618,16 +3618,16 @@ describe('scanFileWideNegativeGateConflict — end-to-end via verify plan-struct
|
||||
// ─── Group 3: doc-contract ────────────────────────────────────────────────────
|
||||
|
||||
describe('doc-contract: guidance prose is in place', () => {
|
||||
// Case 20: gsd-planner.md has the new guidance
|
||||
test('case 20 — gsd-planner.md contains Region-scoped negative gates + reference', () => {
|
||||
// Case 20: msd-planner.md has the new guidance
|
||||
test('case 20 — msd-planner.md contains Region-scoped negative gates + reference', () => {
|
||||
const content = fs.readFileSync(PLANNER_MD, 'utf8');
|
||||
assert.ok(
|
||||
content.includes('Region-scoped negative gates'),
|
||||
'gsd-planner.md must include "Region-scoped negative gates"',
|
||||
'msd-planner.md must include "Region-scoped negative gates"',
|
||||
);
|
||||
assert.ok(
|
||||
content.includes('planner-antipatterns.md'),
|
||||
'gsd-planner.md must reference planner-antipatterns.md',
|
||||
'msd-planner.md must reference planner-antipatterns.md',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -3668,7 +3668,7 @@ describe('AC3: executable proof — file-wide ban vs region-scoped simultaneousl
|
||||
// Write a temp Python file with:
|
||||
// def make_page(): — no await refresh
|
||||
// async def reindex_handler(): — awaits bridge.refresh()
|
||||
const tmpFile = path.join(os.tmpdir(), `gsd-968-proof-${process.pid}.py`);
|
||||
const tmpFile = path.join(os.tmpdir(), `msd-968-proof-${process.pid}.py`);
|
||||
const pyContent = [
|
||||
'def make_page():',
|
||||
' """Synchronous factory — must not block on a refresh."""',
|
||||
@@ -3699,7 +3699,7 @@ describe('AC3: executable proof — file-wide ban vs region-scoped simultaneousl
|
||||
const makePageRegion = makePageLines.stdout.toString();
|
||||
|
||||
// Write to a temp file and grep it
|
||||
const regionFile = path.join(os.tmpdir(), `gsd-968-region-${process.pid}.py`);
|
||||
const regionFile = path.join(os.tmpdir(), `msd-968-region-${process.pid}.py`);
|
||||
fs.writeFileSync(regionFile, makePageRegion);
|
||||
try {
|
||||
const regionBan = runHook('-Eq', ['await .*refresh', regionFile], { interpreter: 'grep', timeoutMs: TEXT_TOOL_TIMEOUT_MS });
|
||||
@@ -3712,7 +3712,7 @@ describe('AC3: executable proof — file-wide ban vs region-scoped simultaneousl
|
||||
// (c) Region-scoped (reindex_handler): grep should FIND the pattern → requirement met
|
||||
const reindexLines = runHook('-n', ['6,9p', tmpFile], { interpreter: 'sed', timeoutMs: TEXT_TOOL_TIMEOUT_MS });
|
||||
const reindexRegion = reindexLines.stdout.toString();
|
||||
const reindexFile = path.join(os.tmpdir(), `gsd-968-reindex-${process.pid}.py`);
|
||||
const reindexFile = path.join(os.tmpdir(), `msd-968-reindex-${process.pid}.py`);
|
||||
fs.writeFileSync(reindexFile, reindexRegion);
|
||||
try {
|
||||
const reindexCheck = runHook('-Eq', ['await .*refresh', reindexFile], { interpreter: 'grep', timeoutMs: TEXT_TOOL_TIMEOUT_MS });
|
||||
@@ -3743,13 +3743,13 @@ describe('verifySummaryCore — reusable structured contract (#2572)', () => {
|
||||
const path = require('node:path');
|
||||
const { after } = require('node:test');
|
||||
const { cleanup } = require('./helpers.cjs');
|
||||
const { verifySummaryCore } = require('../gsd-core/bin/lib/verify.cjs');
|
||||
const { verifySummaryCore } = require('../msd-core/bin/lib/verify.cjs');
|
||||
|
||||
const dirs = [];
|
||||
after(() => { while (dirs.length) cleanup(dirs.pop()); });
|
||||
|
||||
function repo(summaryBody, extraFiles = {}) {
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-2572-'));
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-2572-'));
|
||||
dirs.push(dir);
|
||||
gitOrThrow(['init', '-q'], { cwd: dir, timeoutMs: GIT_TIMEOUT_MS });
|
||||
gitOrThrow(['config', 'user.email', 't@t.com'], { cwd: dir, timeoutMs: GIT_TIMEOUT_MS });
|
||||
@@ -3804,7 +3804,7 @@ describe('verifySummaryCore — reusable structured contract (#2572)', () => {
|
||||
// created: [src/auth/login.ts, src/auth/session.ts]
|
||||
// The prose pattern would otherwise capture the literal '[' as part of the
|
||||
// first path, producing a candidate that can never exist on disk — firing on
|
||||
// a healthy project built from GSD's own shipped template.
|
||||
// a healthy project built from MSD's own shipped template.
|
||||
|
||||
test('#2685 B1: a template-shaped frontmatter flow sequence yields no phantom "[path" candidate', () => {
|
||||
const body = [
|
||||
@@ -3986,7 +3986,7 @@ const { test, describe } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const { runGsdTools, createTempProject, cleanup } = require('./helpers.cjs');
|
||||
const { runMsdTools, createTempProject, cleanup } = require('./helpers.cjs');
|
||||
const { writeState } = require('./fixtures/index.cjs');
|
||||
|
||||
// A structurally-complete PLAN.md that passes both validators when clean.
|
||||
@@ -4032,7 +4032,7 @@ function writePlan(tmpDir, name, body, nulAt) {
|
||||
}
|
||||
|
||||
function parseResult(t, argv, tmpDir) {
|
||||
const r = runGsdTools(argv, tmpDir);
|
||||
const r = runMsdTools(argv, tmpDir);
|
||||
assert.ok(r.success, `command failed: ${r.error}`);
|
||||
return JSON.parse(r.output);
|
||||
}
|
||||
@@ -4200,7 +4200,7 @@ describe('#2701: NUL position does not matter (start and middle both rejected)',
|
||||
__foldDescribe("folded:issue-429-comment-text-gate", () => {
|
||||
// allow-test-rule: source-text-is-the-product (#3338)
|
||||
// Issue #429: the gate logic is tested behaviorally via the exported pure
|
||||
// function + runGsdTools; the discipline rule + allowlist escape hatch are
|
||||
// function + runMsdTools; the discipline rule + allowlist escape hatch are
|
||||
// asserted against the agent/reference .md whose text IS the deployed contract.
|
||||
|
||||
'use strict';
|
||||
@@ -4209,17 +4209,17 @@ const { test, describe, before, beforeEach, afterEach } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const { createTempProject, cleanup, runGsdTools } = require('./helpers.cjs');
|
||||
const { createTempProject, cleanup, runMsdTools } = require('./helpers.cjs');
|
||||
|
||||
// Build path to built verify.cjs
|
||||
const VERIFY_CJS = path.join(__dirname, '..', 'gsd-core', 'bin', 'lib', 'verify.cjs');
|
||||
const VERIFY_CJS = path.join(__dirname, '..', 'msd-core', 'bin', 'lib', 'verify.cjs');
|
||||
|
||||
// fast-check: loaded at top level so skip flags evaluate correctly
|
||||
let fc;
|
||||
try { fc = require('fast-check'); } catch { fc = null; }
|
||||
// Build path to agent/reference files
|
||||
const PLANNER_MD = path.join(__dirname, '..', 'agents', 'gsd-planner.md');
|
||||
const ANTIPATTERNS_MD = path.join(__dirname, '..', 'gsd-core', 'references', 'planner-antipatterns.md');
|
||||
const PLANNER_MD = path.join(__dirname, '..', 'agents', 'msd-planner.md');
|
||||
const ANTIPATTERNS_MD = path.join(__dirname, '..', 'msd-core', 'references', 'planner-antipatterns.md');
|
||||
|
||||
// ─── Fixtures ──────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -4756,7 +4756,7 @@ describe('scanNegativeGrepCommentEcho — pure unit tests', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// ─── Group 2: end-to-end via runGsdTools ──────────────────────────────────────
|
||||
// ─── Group 2: end-to-end via runMsdTools ──────────────────────────────────────
|
||||
|
||||
describe('scanNegativeGrepCommentEcho — end-to-end via verify plan-structure', () => {
|
||||
let tmpDir;
|
||||
@@ -4778,7 +4778,7 @@ describe('scanNegativeGrepCommentEcho — end-to-end via verify plan-structure',
|
||||
fs.mkdirSync(planDir, { recursive: true });
|
||||
fs.writeFileSync(path.join(planDir, '01-01-PLAN.md'), planContent);
|
||||
|
||||
const result = runGsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const output = JSON.parse(result.output);
|
||||
assert.strictEqual(output.valid, false, `expected valid:false, got: ${JSON.stringify(output)}`);
|
||||
assert.ok(
|
||||
@@ -4797,7 +4797,7 @@ describe('scanNegativeGrepCommentEcho — end-to-end via verify plan-structure',
|
||||
fs.mkdirSync(planDir, { recursive: true });
|
||||
fs.writeFileSync(path.join(planDir, '01-01-PLAN.md'), planContent);
|
||||
|
||||
const result = runGsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const result = runMsdTools('verify plan-structure .planning/phases/01-test/01-01-PLAN.md', tmpDir);
|
||||
const output = JSON.parse(result.output);
|
||||
assert.strictEqual(output.valid, true, `expected valid:true with allowlist, got: ${JSON.stringify(output)}`);
|
||||
});
|
||||
@@ -4806,16 +4806,16 @@ describe('scanNegativeGrepCommentEcho — end-to-end via verify plan-structure',
|
||||
// ─── Group 3: doc-contract (source-text-is-the-product) ───────────────────────
|
||||
|
||||
describe('doc-contract: agent/reference .md files carry the deployed contract text', () => {
|
||||
test('gsd-planner.md contains <comment_text_discipline> block', () => {
|
||||
test('msd-planner.md contains <comment_text_discipline> block', () => {
|
||||
const content = fs.readFileSync(PLANNER_MD, 'utf8');
|
||||
assert.ok(content.includes('<comment_text_discipline>'), 'gsd-planner.md must contain <comment_text_discipline>');
|
||||
assert.ok(content.includes('<comment_text_discipline>'), 'msd-planner.md must contain <comment_text_discipline>');
|
||||
});
|
||||
|
||||
test('gsd-planner.md contains a usage example (<!-- planner-discipline-allow: ...)', () => {
|
||||
test('msd-planner.md contains a usage example (<!-- planner-discipline-allow: ...)', () => {
|
||||
const content = fs.readFileSync(PLANNER_MD, 'utf8');
|
||||
assert.ok(
|
||||
content.includes('<!-- planner-discipline-allow:'),
|
||||
'gsd-planner.md must contain an HTML comment example of the allowlist syntax',
|
||||
'msd-planner.md must contain an HTML comment example of the allowlist syntax',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -4968,14 +4968,14 @@ describe('allowlist-syntax parity: doc marker == runtime marker', () => {
|
||||
scanNegativeGrepCommentEcho = verify.scanNegativeGrepCommentEcho;
|
||||
});
|
||||
|
||||
test('ALLOW_PREFIX appears in both gsd-planner.md and planner-antipatterns.md', () => {
|
||||
test('ALLOW_PREFIX appears in both msd-planner.md and planner-antipatterns.md', () => {
|
||||
// allow-test-rule: source-text-is-the-product (#3338)
|
||||
const ALLOW_PREFIX = '<!-- planner-discipline-allow:';
|
||||
const plannerContent = fs.readFileSync(PLANNER_MD, 'utf8');
|
||||
const antipatternContent = fs.readFileSync(ANTIPATTERNS_MD, 'utf8');
|
||||
assert.ok(
|
||||
plannerContent.includes(ALLOW_PREFIX),
|
||||
`gsd-planner.md must contain "${ALLOW_PREFIX}"`,
|
||||
`msd-planner.md must contain "${ALLOW_PREFIX}"`,
|
||||
);
|
||||
assert.ok(
|
||||
antipatternContent.includes(ALLOW_PREFIX),
|
||||
@@ -5067,7 +5067,7 @@ describe('#4024: scanQuantitativeCriteria — pure unit tests', () => {
|
||||
// from the top-level destructure. Bind both locally rather than relying
|
||||
// on file position.
|
||||
const before = require('node:test').before;
|
||||
const VERIFY_CJS_LOCAL = path.join(__dirname, '..', 'gsd-core', 'bin', 'lib', 'verify.cjs');
|
||||
const VERIFY_CJS_LOCAL = path.join(__dirname, '..', 'msd-core', 'bin', 'lib', 'verify.cjs');
|
||||
|
||||
before(() => {
|
||||
const verify = require(VERIFY_CJS_LOCAL);
|
||||
@@ -5443,7 +5443,7 @@ describe('#4024: verify plan-structure — quantitative criteria gate (e2e)', ()
|
||||
' - `grep -c \'someIdentifier\' src/some/file.ts` returns exactly 2.',
|
||||
' - All seven tests were observed FAILING before the implementation existed.',
|
||||
].join('\n'), ''));
|
||||
const result = runGsdTools(cmd, tmpDir);
|
||||
const result = runMsdTools(cmd, tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
const out = JSON.parse(result.output);
|
||||
assert.strictEqual(out.valid, false, `trap criteria must invalidate the plan, errors: ${JSON.stringify(out.errors)}`);
|
||||
@@ -5455,7 +5455,7 @@ describe('#4024: verify plan-structure — quantitative criteria gate (e2e)', ()
|
||||
' - `grep -c \'presentTok\' f == 1` passes.',
|
||||
' - Each test discriminates: it fails before the change and passes after it.',
|
||||
].join('\n'), ''));
|
||||
const result = runGsdTools(cmd, tmpDir);
|
||||
const result = runMsdTools(cmd, tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
const out = JSON.parse(result.output);
|
||||
assert.strictEqual(out.valid, true, `corrected plan must stay valid, errors: ${JSON.stringify(out.errors)}`);
|
||||
@@ -5467,7 +5467,7 @@ describe('#4024: verify plan-structure — quantitative criteria gate (e2e)', ()
|
||||
' <!-- plan-criteria-allow: R1 - count is pinned by an adjacent grep -n proof -->',
|
||||
' - `grep -c \'someIdentifier\' src/some/file.ts` returns exactly 2.',
|
||||
].join('\n'), ''));
|
||||
const result = runGsdTools(cmd, tmpDir);
|
||||
const result = runMsdTools(cmd, tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
const out = JSON.parse(result.output);
|
||||
assert.strictEqual(out.valid, true, `allow marker must restore validity, errors: ${JSON.stringify(out.errors)}`);
|
||||
|
||||
Reference in New Issue
Block a user