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:
@@ -5,7 +5,7 @@
|
||||
* `.planning/state.json` best-effort publisher (#3227).
|
||||
*
|
||||
* This file owns the CLI / call-site wiring band only: it spawns the real
|
||||
* `gsd-tools` binary via `runGsdTools` for each of the 11 documented
|
||||
* `msd-tools` binary via `runMsdTools` for each of the 11 documented
|
||||
* step-boundary commands (plus the non-boundary / no-planning / idempotent /
|
||||
* error-path guard cases) and asserts state.json actually lands on disk
|
||||
* end-to-end through the real dispatch path. The spawn-free, in-process
|
||||
@@ -18,17 +18,17 @@
|
||||
* mutant, so a suite that spawns a child process per case cannot finish
|
||||
* inside the 15-minute shard cap (#2790 precedent).
|
||||
*
|
||||
* Design: .gsd/phase/feat-3227-state-contract/40-design.md
|
||||
* Test matrix: .gsd/phase/feat-3227-state-contract/50-test-matrix.md
|
||||
* Design: .msd/phase/feat-3227-state-contract/40-design.md
|
||||
* Test matrix: .msd/phase/feat-3227-state-contract/50-test-matrix.md
|
||||
*
|
||||
* Fixture provenance (CONTRIBUTING.md "Fixture provenance (#2371)"): every
|
||||
* `.planning/` document shape written by this file's fixture builders is
|
||||
* derived from the SHIPPED templates the product author wrote —
|
||||
* `gsd-core/templates/roadmap.md` (`## Phases` checkbox bullets,
|
||||
* `msd-core/templates/roadmap.md` (`## Phases` checkbox bullets,
|
||||
* `### Phase N: Name` details with `Plans:` lists, the 4-column and
|
||||
* milestone-grouped 5-column `## Progress` tables, and the
|
||||
* `Not started | In progress | Complete | Deferred` status vocabulary) and
|
||||
* `gsd-core/templates/state.md` (`## Current Position`, `Phase: X of Y
|
||||
* `msd-core/templates/state.md` (`## Current Position`, `Phase: X of Y
|
||||
* (Name)`) — never from `state-contract.cts`'s own parsing model.
|
||||
*
|
||||
* This module is a NEW leaf; the fixture builders below are local to this
|
||||
@@ -40,7 +40,7 @@
|
||||
* These same fixture helpers are also byte-duplicated (not shared) into the
|
||||
* `.unit.` sibling above, deliberately: that file is the Stryker mutation
|
||||
* shard target and must stay spawn-free and self-contained, so a `require`
|
||||
* of this integration file would drag `runGsdTools` and its subprocess seam
|
||||
* of this integration file would drag `runMsdTools` and its subprocess seam
|
||||
* into the shard. The duplication is isolation, not drift.
|
||||
*/
|
||||
|
||||
@@ -49,9 +49,9 @@ const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const { createTempProject, createTempDir, cleanup, runGsdTools } = require('./helpers.cjs');
|
||||
const { createTempProject, createTempDir, cleanup, runMsdTools } = require('./helpers.cjs');
|
||||
|
||||
const { STATE_CONTRACT_VERSION } = require('../gsd-core/bin/lib/state-contract.cjs');
|
||||
const { STATE_CONTRACT_VERSION } = require('../msd-core/bin/lib/state-contract.cjs');
|
||||
|
||||
// ─── Fixture helpers ──────────────────────────────────────────────────────────
|
||||
|
||||
@@ -160,7 +160,7 @@ const BOUNDARY_COMMANDS = [
|
||||
argv: ['state', 'milestone-switch', '--milestone', 'v2.0', '--name', 'Next'],
|
||||
setup: (tmpDir) => {
|
||||
writeState(tmpDir, [
|
||||
"gsd_state_version: '1.0'", 'milestone: v1.0', 'milestone_name: Foundation', 'status: completed',
|
||||
"msd_state_version: '1.0'", 'milestone: v1.0', 'milestone_name: Foundation', 'status: completed',
|
||||
], [
|
||||
'# Project State', '', '## Current Position', '',
|
||||
'Phase: 5 (Foundation) — COMPLETED', 'Plan: 3 of 3',
|
||||
@@ -255,7 +255,7 @@ describe('state contract — call-site wiring (integration, real CLI)', () => {
|
||||
for (const { label, argv, setup } of BOUNDARY_COMMANDS) {
|
||||
const tmpDir = createTempProject();
|
||||
setup(tmpDir);
|
||||
const result = runGsdTools(argv, tmpDir);
|
||||
const result = runMsdTools(argv, tmpDir);
|
||||
assert.strictEqual(result.success, true, `${label} fixture must genuinely succeed: ${result.error}`);
|
||||
const jsonPath = statePathOf(tmpDir);
|
||||
assert.strictEqual(fs.existsSync(jsonPath), true, `${label} must publish state.json`);
|
||||
@@ -269,7 +269,7 @@ describe('state contract — call-site wiring (integration, real CLI)', () => {
|
||||
const tmpDir = createTempProject();
|
||||
t.after(() => cleanup(tmpDir));
|
||||
fs.writeFileSync(path.join(planningDirOf(tmpDir), 'STATE.md'), '# State\n\n**Status:** Planning\n');
|
||||
runGsdTools(['state', 'get', 'status'], tmpDir);
|
||||
runMsdTools(['state', 'get', 'status'], tmpDir);
|
||||
assert.strictEqual(fs.existsSync(statePathOf(tmpDir)), false);
|
||||
});
|
||||
|
||||
@@ -279,8 +279,8 @@ describe('state contract — call-site wiring (integration, real CLI)', () => {
|
||||
const dirB = createTempDir();
|
||||
t.after(() => cleanup(dirB));
|
||||
const argv = ['state', 'begin-phase', '--phase', '1', '--name', 'X', '--plans', '1'];
|
||||
const resultA = runGsdTools(argv, dirA);
|
||||
const resultB = runGsdTools(argv, dirB);
|
||||
const resultA = runMsdTools(argv, dirA);
|
||||
const resultB = runMsdTools(argv, dirB);
|
||||
assert.strictEqual(resultA.success, resultB.success);
|
||||
assert.strictEqual(resultA.output, resultB.output);
|
||||
});
|
||||
@@ -291,12 +291,12 @@ describe('state contract — call-site wiring (integration, real CLI)', () => {
|
||||
fs.writeFileSync(path.join(planningDirOf(tmpDir), 'STATE.md'),
|
||||
'# Project State\n\n**Status:** Executing\n**Current Phase:** 1\n**Last Activity:** 2024-01-01\n');
|
||||
|
||||
const first = runGsdTools(['state', 'complete-phase', '--phase', '1'], tmpDir);
|
||||
const first = runMsdTools(['state', 'complete-phase', '--phase', '1'], tmpDir);
|
||||
assert.ok(first.success, `first complete-phase call failed: ${first.error}`);
|
||||
assert.ok(fs.existsSync(statePathOf(tmpDir)), 'first (genuine) completion must publish');
|
||||
const beforeSecondCall = readStateJsonRaw(tmpDir);
|
||||
|
||||
const second = runGsdTools(['state', 'complete-phase', '--phase', '1'], tmpDir);
|
||||
const second = runMsdTools(['state', 'complete-phase', '--phase', '1'], tmpDir);
|
||||
assert.ok(second.success, `second (idempotent) complete-phase call failed: ${second.error}`);
|
||||
const afterSecondCall = readStateJsonRaw(tmpDir);
|
||||
|
||||
@@ -307,7 +307,7 @@ describe('state contract — call-site wiring (integration, real CLI)', () => {
|
||||
const tmpDir = createTempProject();
|
||||
t.after(() => cleanup(tmpDir));
|
||||
// No STATE.md at all — complete-phase's own precondition check fails.
|
||||
const result = runGsdTools(['state', 'complete-phase', '--phase', '3'], tmpDir);
|
||||
const result = runMsdTools(['state', 'complete-phase', '--phase', '3'], tmpDir);
|
||||
assert.ok(result.success, `command should exit 0 with a JSON error envelope: ${result.error}`);
|
||||
const output = JSON.parse(result.output);
|
||||
assert.ok(output.error, 'expected a structured error envelope');
|
||||
@@ -331,20 +331,20 @@ describe('state contract — call-site wiring (integration, real CLI)', () => {
|
||||
'| 1. A | 0/1 | Not started | - |',
|
||||
'',
|
||||
]);
|
||||
// ADR-3473 §8.7 (#3872) / test-matrix row 17 (D15): `gsd_state_version`
|
||||
// ADR-3473 §8.7 (#3872) / test-matrix row 17 (D15): `msd_state_version`
|
||||
// is pre-seeded here so this fixture isolates the ONE thing it is meant
|
||||
// to prove (zero recognized Current Position labels is a genuine no-op)
|
||||
// from an UNRELATED, already-correct §8.7 behavior — a frontmatter block
|
||||
// synthesizing `gsd_state_version` for the first time on a document that
|
||||
// synthesizing `msd_state_version` for the first time on a document that
|
||||
// never had one IS a real, reportable addition (row 17/D15, pinned
|
||||
// separately by "state patch accepts JSON object input from workflows"
|
||||
// above). Omitting it here would make THIS no-op test fail for a reason
|
||||
// that has nothing to do with recognized labels.
|
||||
writeState(tmpDir, ['gsd_state_version: 1.0', 'status: planning'], [
|
||||
writeState(tmpDir, ['msd_state_version: 1.0', 'status: planning'], [
|
||||
'# Project State', '',
|
||||
'(no recognized labels here)',
|
||||
]);
|
||||
const result = runGsdTools(['state', 'planned-phase', '--phase', '3', '--name', 'Polish', '--plans', '1'], tmpDir);
|
||||
const result = runMsdTools(['state', 'planned-phase', '--phase', '3', '--name', 'Polish', '--plans', '1'], tmpDir);
|
||||
assert.ok(result.success, `planned-phase fixture must genuinely succeed: ${result.error}`);
|
||||
const output = JSON.parse(result.output);
|
||||
assert.deepStrictEqual(output.updated, [], 'expected a genuine no-op (zero recognized Current Position labels)');
|
||||
@@ -360,7 +360,7 @@ describe('state contract — call-site wiring (integration, real CLI)', () => {
|
||||
'(no recognized labels here)',
|
||||
'',
|
||||
].join('\n'));
|
||||
const result = runGsdTools(['state', 'begin-phase', '--phase', '3', '--name', 'Polish', '--plans', '1'], tmpDir);
|
||||
const result = runMsdTools(['state', 'begin-phase', '--phase', '3', '--name', 'Polish', '--plans', '1'], tmpDir);
|
||||
assert.ok(result.success, `begin-phase fixture must genuinely succeed: ${result.error}`);
|
||||
const output = JSON.parse(result.output);
|
||||
assert.deepStrictEqual(output.updated, [], 'expected a genuine no-op (zero recognized body fields)');
|
||||
@@ -396,12 +396,12 @@ describe('state contract — call-site wiring (integration, real CLI)', () => {
|
||||
'',
|
||||
]);
|
||||
|
||||
const first = runGsdTools(['state', 'advance-plan'], tmpDir);
|
||||
const first = runMsdTools(['state', 'advance-plan'], tmpDir);
|
||||
assert.ok(first.success, `first advance-plan call must genuinely succeed: ${first.error}`);
|
||||
assert.strictEqual(fs.existsSync(statePathOf(tmpDir)), true, 'first (genuine) advance must publish');
|
||||
fs.unlinkSync(statePathOf(tmpDir));
|
||||
|
||||
const second = runGsdTools(['state', 'advance-plan'], tmpDir);
|
||||
const second = runMsdTools(['state', 'advance-plan'], tmpDir);
|
||||
assert.ok(second.success, `second (no-op) advance-plan call must genuinely succeed: ${second.error}`);
|
||||
const output = JSON.parse(second.output);
|
||||
assert.deepStrictEqual(output.updated, [], 'ADR-3473 §8.7: a byte-identical second call is a genuine no-op — `updated` must reconcile to empty, not merely reflect fields the transform always names');
|
||||
@@ -436,12 +436,12 @@ describe('state contract — call-site wiring (integration, real CLI)', () => {
|
||||
fs.writeFileSync(path.join(phaseDir, '01-SUMMARY.md'), '# Summary');
|
||||
writePassedVerification(tmpDir, '01-foo', '01');
|
||||
|
||||
const first = runGsdTools(['phase', 'complete', '1'], tmpDir);
|
||||
const first = runMsdTools(['phase', 'complete', '1'], tmpDir);
|
||||
assert.ok(first.success, `first phase complete call must genuinely succeed: ${first.error}`);
|
||||
assert.strictEqual(fs.existsSync(statePathOf(tmpDir)), true, 'first (genuine) completion must publish');
|
||||
fs.unlinkSync(statePathOf(tmpDir));
|
||||
|
||||
const second = runGsdTools(['phase', 'complete', '1'], tmpDir);
|
||||
const second = runMsdTools(['phase', 'complete', '1'], tmpDir);
|
||||
assert.ok(second.success, `second (no-op) phase complete call must genuinely succeed: ${second.error}`);
|
||||
assert.strictEqual(fs.existsSync(statePathOf(tmpDir)), false, 'the second, no-op phase complete call must not publish state.json');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user