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,19 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* `init.debug` — the dedicated init entry point for `/gsd:debug` (#3149).
|
||||
* `init.debug` — the dedicated init entry point for `/msd:debug` (#3149).
|
||||
*
|
||||
* Prerequisite for #3128 condition 1: ADR-1671 admission gate (2), "a fact the
|
||||
* init seam demonstrably computes at a real entry point"
|
||||
* (`docs/adr/1671-dynamic-context-management-platform.md:122-131`). Before this,
|
||||
* `gsd-core/workflows/debug.md` was one of the last workflows with no `cmdInit*`
|
||||
* `msd-core/workflows/debug.md` was one of the last workflows with no `cmdInit*`
|
||||
* of its own, so no debug-scoped fact could ever be computed and any `when=` atom
|
||||
* naming one would have evaluated FALSE forever — the silent-exclusion bug that
|
||||
* rule exists to prevent.
|
||||
*
|
||||
* Matrix: `.gsd/phase/feat-3149-cmdinitdebug/50-test-matrix.md` groups A-E, G3.
|
||||
* Matrix: `.msd/phase/feat-3149-cmdinitdebug/50-test-matrix.md` groups A-E, G3.
|
||||
*
|
||||
* Every test drives the REAL CLI (`runGsdTools` spawns `gsd-tools.cjs`) rather
|
||||
* Every test drives the REAL CLI (`runMsdTools` spawns `msd-tools.cjs`) rather
|
||||
* than requiring `cmdInitDebug` directly — the handler is not exported, and the
|
||||
* flag plumbing under test exists only at the `init-command-router.cjs` seam.
|
||||
* Same rationale recorded in `tests/section-manifest-init-facts.test.cjs:10-14`.
|
||||
@@ -28,7 +28,7 @@ const assert = require('node:assert/strict');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const { runGsdTools, cleanup, createTempDir, createTempProject } = require('./helpers.cjs');
|
||||
const { runMsdTools, cleanup, createTempDir, createTempProject } = require('./helpers.cjs');
|
||||
|
||||
function writeConfig(tmpDir, config, { ws = null } = {}) {
|
||||
const dir = ws
|
||||
@@ -38,9 +38,9 @@ function writeConfig(tmpDir, config, { ws = null } = {}) {
|
||||
fs.writeFileSync(path.join(dir, 'config.json'), JSON.stringify(config, null, 2));
|
||||
}
|
||||
|
||||
/** Runs a gsd-tools query and parses its JSON, asserting a clean exit first. */
|
||||
/** Runs a msd-tools query and parses its JSON, asserting a clean exit first. */
|
||||
function runJson(argv, cwd, env = {}) {
|
||||
const result = runGsdTools(argv, cwd, env);
|
||||
const result = runMsdTools(argv, cwd, env);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
return JSON.parse(result.output);
|
||||
}
|
||||
@@ -73,8 +73,8 @@ describe('init.debug resolves identically to the three calls it replaces (matrix
|
||||
test('debug_dir agrees with state.load under an active workstream (row A2)', () => {
|
||||
fs.mkdirSync(path.join(tmpDir, '.planning', 'workstreams', 'ws1'), { recursive: true });
|
||||
|
||||
const viaInit = runJson(['init', 'debug'], tmpDir, { GSD_WORKSTREAM: 'ws1' });
|
||||
const viaState = runJson(['query', 'state.load'], tmpDir, { GSD_WORKSTREAM: 'ws1' });
|
||||
const viaInit = runJson(['init', 'debug'], tmpDir, { MSD_WORKSTREAM: 'ws1' });
|
||||
const viaState = runJson(['query', 'state.load'], tmpDir, { MSD_WORKSTREAM: 'ws1' });
|
||||
|
||||
assert.equal(viaInit.debug_dir, viaState.debug_dir);
|
||||
assert.match(
|
||||
@@ -106,7 +106,7 @@ describe('init.debug resolves identically to the three calls it replaces (matrix
|
||||
|
||||
test('debugger_model matches the resolve-model query (row A5)', () => {
|
||||
const viaInit = runJson(['init', 'debug'], tmpDir);
|
||||
const viaResolve = runJson(['query', 'resolve-model', 'gsd-debugger'], tmpDir);
|
||||
const viaResolve = runJson(['query', 'resolve-model', 'msd-debugger'], tmpDir);
|
||||
|
||||
assert.equal(
|
||||
viaInit.debugger_model,
|
||||
@@ -120,7 +120,7 @@ describe('init.debug resolves identically to the three calls it replaces (matrix
|
||||
writeConfig(tmpDir, { workflow: { tdd_mode: true } });
|
||||
|
||||
const viaInit = runJson(['init', 'debug'], tmpDir);
|
||||
const viaConfigGet = runGsdTools(['query', 'config-get', 'workflow.tdd_mode', '--raw'], tmpDir);
|
||||
const viaConfigGet = runMsdTools(['query', 'config-get', 'workflow.tdd_mode', '--raw'], tmpDir);
|
||||
|
||||
assert.ok(viaConfigGet.success);
|
||||
assert.equal(viaInit.tdd_mode, true);
|
||||
@@ -131,7 +131,7 @@ describe('init.debug resolves identically to the three calls it replaces (matrix
|
||||
writeConfig(tmpDir, {});
|
||||
|
||||
const viaInit = runJson(['init', 'debug'], tmpDir);
|
||||
const viaConfigGet = runGsdTools(['query', 'config-get', 'workflow.tdd_mode', '--raw'], tmpDir);
|
||||
const viaConfigGet = runMsdTools(['query', 'config-get', 'workflow.tdd_mode', '--raw'], tmpDir);
|
||||
|
||||
assert.equal(viaInit.tdd_mode, false);
|
||||
assert.equal(String(viaInit.tdd_mode), viaConfigGet.output.trim());
|
||||
@@ -147,11 +147,11 @@ describe('init.debug resolves identically to the three calls it replaces (matrix
|
||||
writeConfig(tmpDir, { workflow: { tdd_mode: true } });
|
||||
fs.mkdirSync(path.join(tmpDir, '.planning', 'workstreams', 'ws1'), { recursive: true });
|
||||
|
||||
const viaInit = runJson(['init', 'debug'], tmpDir, { GSD_WORKSTREAM: 'ws1' });
|
||||
const viaConfigGet = runGsdTools(
|
||||
const viaInit = runJson(['init', 'debug'], tmpDir, { MSD_WORKSTREAM: 'ws1' });
|
||||
const viaConfigGet = runMsdTools(
|
||||
['query', 'config-get', 'workflow.tdd_mode', '--raw'],
|
||||
tmpDir,
|
||||
{ GSD_WORKSTREAM: 'ws1' }
|
||||
{ MSD_WORKSTREAM: 'ws1' }
|
||||
);
|
||||
|
||||
assert.equal(viaInit.tdd_mode, true, 'the root value must be inherited, not lost');
|
||||
@@ -231,7 +231,7 @@ describe('init.debug bundle shape (matrix §B)', () => {
|
||||
test('succeeds with no .planning directory (row B4)', () => {
|
||||
const bare = createTempDir('init-debug-bare-');
|
||||
try {
|
||||
const result = runGsdTools(['init', 'debug'], bare);
|
||||
const result = runMsdTools(['init', 'debug'], bare);
|
||||
assert.ok(result.success, `must not require an initialized project: ${result.error}`);
|
||||
const output = JSON.parse(result.output);
|
||||
assert.ok(output.debug_dir.endsWith('/debug'));
|
||||
@@ -253,7 +253,7 @@ describe('init.debug bundle shape (matrix §B)', () => {
|
||||
fs.mkdirSync(path.join(tmpDir, '.planning'), { recursive: true });
|
||||
fs.writeFileSync(path.join(tmpDir, '.planning', 'config.json'), body);
|
||||
|
||||
const result = runGsdTools(['init', 'debug'], tmpDir);
|
||||
const result = runMsdTools(['init', 'debug'], tmpDir);
|
||||
assert.ok(result.success, `config.json = ${body} must degrade, not crash: ${result.error}`);
|
||||
const output = JSON.parse(result.output);
|
||||
assert.equal(output.tdd_mode, false, `config.json = ${body} must resolve tdd_mode to false`);
|
||||
@@ -265,7 +265,7 @@ describe('init.debug bundle shape (matrix §B)', () => {
|
||||
fs.mkdirSync(path.join(tmpDir, '.planning'), { recursive: true });
|
||||
fs.writeFileSync(path.join(tmpDir, '.planning', 'config.json'), '');
|
||||
|
||||
const result = runGsdTools(['init', 'debug'], tmpDir);
|
||||
const result = runMsdTools(['init', 'debug'], tmpDir);
|
||||
assert.ok(result.success, `an empty config file must degrade, not crash: ${result.error}`);
|
||||
assert.equal(JSON.parse(result.output).tdd_mode, false);
|
||||
});
|
||||
@@ -316,13 +316,13 @@ describe('init.debug --diagnose forwarding and hostile argv (matrix §C)', () =>
|
||||
// unrecognized ... tokens with a non-zero exit — it is called by agents
|
||||
// that will drift again." An unrecognized flag is exactly the mandated
|
||||
// rejection, not a thing to silently absorb.
|
||||
const result = runGsdTools(['init', 'debug', '--nope'], tmpDir);
|
||||
const result = runMsdTools(['init', 'debug', '--nope'], tmpDir);
|
||||
assert.equal(result.success, false, 'an unknown flag must now fail the command');
|
||||
assert.match(result.error, /--nope/, 'the rejection must name the offending flag');
|
||||
});
|
||||
|
||||
test('rejects a flag-shaped trailing token, naming it (row C5)', () => {
|
||||
const result = runGsdTools(['init', 'debug', '--diagnose', '--weird'], tmpDir);
|
||||
const result = runMsdTools(['init', 'debug', '--diagnose', '--weird'], tmpDir);
|
||||
assert.equal(result.success, false, 'an unrecognized flag-shaped token must now fail the command');
|
||||
assert.match(result.error, /--weird/, 'the rejection must name the offending flag');
|
||||
});
|
||||
@@ -331,7 +331,7 @@ describe('init.debug --diagnose forwarding and hostile argv (matrix §C)', () =>
|
||||
const canary = path.join(tmpDir, 'PWNED');
|
||||
const hostile = `; touch ${canary}; $(touch ${canary}) \`touch ${canary}\` && touch ${canary}`;
|
||||
|
||||
const result = runGsdTools(['init', 'debug', hostile], tmpDir);
|
||||
const result = runMsdTools(['init', 'debug', hostile], tmpDir);
|
||||
|
||||
// §8.4 now rejects this as an unexpected positional argument (exit
|
||||
// non-zero) instead of silently absorbing it — that is at least as safe
|
||||
@@ -352,7 +352,7 @@ describe('init.debug --diagnose forwarding and hostile argv (matrix §C)', () =>
|
||||
const unicode = 'ünïcødé-🐛-测试';
|
||||
|
||||
for (const arg of [long, unicode]) {
|
||||
const result = runGsdTools(['init', 'debug', arg], tmpDir);
|
||||
const result = runMsdTools(['init', 'debug', arg], tmpDir);
|
||||
assert.equal(result.success, false, `argument of length ${arg.length} must now fail the command, not crash`);
|
||||
}
|
||||
});
|
||||
@@ -377,11 +377,11 @@ describe('init.debug section_manifest degradation (matrix §D)', () => {
|
||||
function withManifest(body) {
|
||||
const manifestPath = path.join(manifestDir, 'manifest.json');
|
||||
fs.writeFileSync(manifestPath, typeof body === 'string' ? body : JSON.stringify(body));
|
||||
return { GSD_SECTION_MANIFEST: manifestPath };
|
||||
return { MSD_SECTION_MANIFEST: manifestPath };
|
||||
}
|
||||
|
||||
test('section_manifest is null while debug has no manifest key (row D1)', () => {
|
||||
// Drives the SHIPPED artifact deliberately: `debug` carries no gsd:section
|
||||
// Drives the SHIPPED artifact deliberately: `debug` carries no msd:section
|
||||
// markers until #3128, so the shipped manifest has no `debug` key and the
|
||||
// field must degrade to null — which debug.md reads as "read everything".
|
||||
const output = runJson(['init', 'debug'], tmpDir);
|
||||
@@ -401,27 +401,27 @@ describe('init.debug section_manifest degradation (matrix §D)', () => {
|
||||
// name would silently return null forever and look identical to D1.
|
||||
const output = runJson(['init', 'debug'], tmpDir, withManifest({
|
||||
workflows: {
|
||||
debug: [{ id: 'probe-protocol', when: 'always', read: 'gsd-core/workflows/debug/steps/probe-protocol.md' }],
|
||||
debug: [{ id: 'probe-protocol', when: 'always', read: 'msd-core/workflows/debug/steps/probe-protocol.md' }],
|
||||
},
|
||||
}));
|
||||
|
||||
assert.notEqual(output.section_manifest, null);
|
||||
assert.equal(output.section_manifest.workflow, 'debug');
|
||||
assert.deepEqual(output.section_manifest.included, ['probe-protocol']);
|
||||
assert.deepEqual(output.section_manifest.read, ['gsd-core/workflows/debug/steps/probe-protocol.md']);
|
||||
assert.deepEqual(output.section_manifest.read, ['msd-core/workflows/debug/steps/probe-protocol.md']);
|
||||
});
|
||||
|
||||
test('a missing manifest file degrades to null (row D4)', () => {
|
||||
const missing = path.join(manifestDir, 'does-not-exist.json');
|
||||
assert.equal(fs.existsSync(missing), false, 'sanity: file must not exist');
|
||||
|
||||
const result = runGsdTools(['init', 'debug'], tmpDir, { GSD_SECTION_MANIFEST: missing });
|
||||
const result = runMsdTools(['init', 'debug'], tmpDir, { MSD_SECTION_MANIFEST: missing });
|
||||
assert.ok(result.success, `a missing manifest must not crash: ${result.error}`);
|
||||
assert.equal(JSON.parse(result.output).section_manifest, null);
|
||||
});
|
||||
|
||||
test('a malformed manifest degrades to null (row D5)', () => {
|
||||
const result = runGsdTools(['init', 'debug'], tmpDir, withManifest('{ not json'));
|
||||
const result = runMsdTools(['init', 'debug'], tmpDir, withManifest('{ not json'));
|
||||
assert.ok(result.success, `a malformed manifest must not crash: ${result.error}`);
|
||||
assert.equal(JSON.parse(result.output).section_manifest, null);
|
||||
});
|
||||
@@ -429,7 +429,7 @@ describe('init.debug section_manifest degradation (matrix §D)', () => {
|
||||
test('a pre-6.1 flat manifest shape degrades to null (row D6)', () => {
|
||||
// The pre-#2992 shape had no workflow key at all. Accepting it would
|
||||
// mis-attribute some other workflow's sections to debug.
|
||||
const result = runGsdTools(['init', 'debug'], tmpDir, withManifest({ sections: [{ id: 'x', when: 'always' }] }));
|
||||
const result = runMsdTools(['init', 'debug'], tmpDir, withManifest({ sections: [{ id: 'x', when: 'always' }] }));
|
||||
assert.ok(result.success);
|
||||
assert.equal(JSON.parse(result.output).section_manifest, null);
|
||||
});
|
||||
@@ -438,7 +438,7 @@ describe('init.debug section_manifest degradation (matrix §D)', () => {
|
||||
// ─── Group E: PlanningPaths.debug ──────────────────────────────────────────
|
||||
|
||||
describe('planningPaths exposes the debug directory (matrix §E)', () => {
|
||||
const { planningPaths } = require('../gsd-core/bin/lib/planning-workspace.cjs');
|
||||
const { planningPaths } = require('../msd-core/bin/lib/planning-workspace.cjs');
|
||||
let tmpDir;
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -473,7 +473,7 @@ describe('init.debug does not widen the applicability grammar (matrix §G)', ()
|
||||
// ADR-1671: the vocabulary is CLOSED and widening it is a coordinated
|
||||
// amendment. This PR delivers admission gate (2) only — the atom that
|
||||
// consumes it belongs to #3128, which owns the amendment.
|
||||
const { WHEN_VOCABULARY } = require('../gsd-core/bin/lib/workflow-fragments.cjs');
|
||||
const { WHEN_VOCABULARY } = require('../msd-core/bin/lib/workflow-fragments.cjs');
|
||||
assert.equal(WHEN_VOCABULARY.length, 29);
|
||||
assert.equal(WHEN_VOCABULARY.includes('flag:--diagnose'), false);
|
||||
assert.equal(WHEN_VOCABULARY.includes('flag:--runtime-probes'), false);
|
||||
|
||||
Reference in New Issue
Block a user