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:
@@ -23,9 +23,9 @@ const {
|
||||
STATE_MD_SECTIONS,
|
||||
sliceCurrentPositionSection,
|
||||
stateReplaceProgressPercent,
|
||||
} = require('../gsd-core/bin/lib/state-transition.cjs');
|
||||
const { stateExtractField } = require('../gsd-core/bin/lib/state-document.cjs');
|
||||
const { STATE_FIELD_SCHEMA } = require('../gsd-core/bin/lib/state-md-schema.cjs');
|
||||
} = require('../msd-core/bin/lib/state-transition.cjs');
|
||||
const { stateExtractField } = require('../msd-core/bin/lib/state-document.cjs');
|
||||
const { STATE_FIELD_SCHEMA } = require('../msd-core/bin/lib/state-md-schema.cjs');
|
||||
|
||||
const fixedClock = Object.freeze({
|
||||
today: () => '2026-06-27',
|
||||
@@ -82,7 +82,7 @@ describe('ADR-1769 substrate: field-classification table', () => {
|
||||
test('table covers every frontmatter key emitted by buildStateFrontmatter (codex Phase 1 review)', () => {
|
||||
// Verified against src/state.cts:1633-1653 (buildStateFrontmatter emit block).
|
||||
const requiredFields = [
|
||||
'gsd_state_version',
|
||||
'msd_state_version',
|
||||
'milestone',
|
||||
'milestone_name',
|
||||
'current_phase',
|
||||
@@ -134,7 +134,7 @@ describe('ADR-3473 §8.8 (#3873): the three tables are byte-identical projection
|
||||
// exact key order — key order is observable: the preservation dispatch loop
|
||||
// and `getPreserveWhenUnchangedFields` both iterate it).
|
||||
const TODAYS_FIELD_CLASSIFICATION = Object.freeze({
|
||||
gsd_state_version: { source: 'free', preservation: 'derive' },
|
||||
msd_state_version: { source: 'free', preservation: 'derive' },
|
||||
milestone: { source: 'external', preservation: 'preserve-if-placeholder' },
|
||||
milestone_name: { source: 'external', preservation: 'preserve-if-placeholder' },
|
||||
current_phase: { source: 'body', preservation: 'preserve-when-unchanged' },
|
||||
@@ -245,7 +245,7 @@ describe('ADR-3473 §8.8 (#3873): the three tables are byte-identical projection
|
||||
});
|
||||
});
|
||||
|
||||
describe('ADR-1769 substrate: STATE_MD_SECTIONS constants (aligned to gsd-core/templates/state.md)', () => {
|
||||
describe('ADR-1769 substrate: STATE_MD_SECTIONS constants (aligned to msd-core/templates/state.md)', () => {
|
||||
test('every section heading starts with "## "', () => {
|
||||
for (const [name, heading] of Object.entries(STATE_MD_SECTIONS)) {
|
||||
assert.ok(
|
||||
@@ -519,7 +519,7 @@ describe('ADR-1769 Phase 1: Current Position section mutation (first-time begin)
|
||||
// 'Status' extraction returns the first match — which is the top-level
|
||||
// **Status:** line. The Current Position Status line is a different field
|
||||
// occurrence. Extract from the section to disambiguate.
|
||||
const { tokenizeHeadings } = require('../gsd-core/bin/lib/markdown-sectionizer.cjs');
|
||||
const { tokenizeHeadings } = require('../msd-core/bin/lib/markdown-sectionizer.cjs');
|
||||
const body = result.content;
|
||||
const hs = tokenizeHeadings(body);
|
||||
const posIdx = hs.findIndex(h => h.level === 2 && /^current\s+position$/i.test(h.text));
|
||||
@@ -1535,7 +1535,7 @@ function completePhaseBody() {
|
||||
// returns { completedPhases: 3, totalPhases: 5 }.
|
||||
// ADR-2143 (epic #2143): deriveProgressFromRoadmap now resolves this table via the
|
||||
// markdown-table schema registry (TABLE_SCHEMAS.RoadmapProgress), which requires the
|
||||
// exact canonical header (gsd-core/templates/roadmap.md); the 2nd column is named
|
||||
// exact canonical header (msd-core/templates/roadmap.md); the 2nd column is named
|
||||
// "Plans Complete" to match (its cell values here are unused free text, not M/N
|
||||
// counts — no test in this file asserts totalPlans).
|
||||
const ROADMAP_3_OF_5 = [
|
||||
@@ -1885,7 +1885,7 @@ describe('ADR-1769 Phase 4: milestoneSwitch transition — milestone reset', ()
|
||||
function milestoneBody() {
|
||||
return [
|
||||
'---',
|
||||
'gsd_state_version: 1.0',
|
||||
'msd_state_version: 1.0',
|
||||
'milestone: v1.0',
|
||||
'milestone_name: Old Milestone',
|
||||
'status: executing',
|
||||
@@ -1923,9 +1923,9 @@ describe('ADR-1769 Phase 4: milestoneSwitch transition — milestone reset', ()
|
||||
assert.ok(/percent:\s*0/.test(result.content), 'percent should reset to 0');
|
||||
});
|
||||
|
||||
test('gsd_state_version is preserved across the reset', () => {
|
||||
test('msd_state_version is preserved across the reset', () => {
|
||||
const result = transitionCore(milestoneBody(), { kind: 'milestoneSwitch', version: 'v2.0', name: 'New Milestone' }, deps);
|
||||
assert.ok(/gsd_state_version:\s*"?1\.0"?/.test(result.content), 'gsd_state_version must be preserved');
|
||||
assert.ok(/msd_state_version:\s*"?1\.0"?/.test(result.content), 'msd_state_version must be preserved');
|
||||
});
|
||||
|
||||
test('Current Position section is reset to "Not started (defining requirements)"', () => {
|
||||
@@ -1956,7 +1956,7 @@ describe('ADR-1769 Phase 4: milestoneSwitch transition — milestone reset', ()
|
||||
|
||||
describe('ADR-1769 Phase 5: milestoneComplete transition — closure write', () => {
|
||||
const deps = { clock: fixedClock };
|
||||
const intent = { kind: 'milestoneComplete', version: 'v1.0', nextMilestoneCommand: '/gsd:new-milestone' };
|
||||
const intent = { kind: 'milestoneComplete', version: 'v1.0', nextMilestoneCommand: '/msd:new-milestone' };
|
||||
|
||||
function preCloseBody() {
|
||||
return [
|
||||
@@ -1975,7 +1975,7 @@ describe('ADR-1769 Phase 5: milestoneComplete transition — closure write', ()
|
||||
'',
|
||||
'## Operator Next Steps',
|
||||
'',
|
||||
'- Re-run /gsd:complete-milestone v1.0',
|
||||
'- Re-run /msd:complete-milestone v1.0',
|
||||
'',
|
||||
].join('\n');
|
||||
}
|
||||
@@ -2010,9 +2010,9 @@ describe('ADR-1769 Phase 5: milestoneComplete transition — closure write', ()
|
||||
test('Operator Next Steps is rewritten to point at the next-milestone command', () => {
|
||||
const result = transitionCore(preCloseBody(), intent, deps);
|
||||
assert.ok(/## Operator Next Steps/.test(result.content));
|
||||
assert.ok(/- Start the next milestone with \/gsd:new-milestone/.test(result.content));
|
||||
assert.ok(/- Start the next milestone with \/msd:new-milestone/.test(result.content));
|
||||
// The stale prior instruction must be gone.
|
||||
assert.ok(!/Re-run \/gsd:complete-milestone/.test(result.content),
|
||||
assert.ok(!/Re-run \/msd:complete-milestone/.test(result.content),
|
||||
'stale Operator Next Steps tail must be replaced');
|
||||
});
|
||||
|
||||
@@ -2047,7 +2047,7 @@ describe('ADR-1769 Phase 5: milestoneComplete transition — closure write', ()
|
||||
].join('\n');
|
||||
const result = transitionCore(input, intent, deps);
|
||||
assert.ok(/## Operator Next Steps/.test(result.content));
|
||||
assert.ok(/- Start the next milestone with \/gsd:new-milestone/.test(result.content));
|
||||
assert.ok(/- Start the next milestone with \/msd:new-milestone/.test(result.content));
|
||||
});
|
||||
|
||||
test('Current Position section is inserted when absent', () => {
|
||||
@@ -2150,7 +2150,7 @@ describe('ADR-1769 Phase 6: patch transition — field updates', () => {
|
||||
// ADR-3408 §8.3(b) Matrix D (#3469): patchCore strips frontmatter first,
|
||||
// matching updateCore — closes Phase 1's declared known gap (a
|
||||
// frontmatter-shaped patch key could rewrite the YAML block outside
|
||||
// FIELD_CLASSIFICATION). Test matrix: .gsd/phase/refactor-3469-one-write-seam/50-test-matrix.md
|
||||
// FIELD_CLASSIFICATION). Test matrix: .msd/phase/refactor-3469-one-write-seam/50-test-matrix.md
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
describe('ADR-3408 §8.3(b) Matrix D: patchCore strips frontmatter first (#3469)', () => {
|
||||
@@ -3117,8 +3117,8 @@ describe('#3468 matrix A: executor policy dispatch (ADR-3408 §8.1) — new/boun
|
||||
// branch. The matrix's "no branch exists" is a source-structure claim
|
||||
// (§8.1's "exactly one executor per policy") that this black-box test
|
||||
// cannot distinguish from "skipped by omission" — see report.
|
||||
test('A22: derive rows (last_updated, state_head, gsd_state_version, last_activity) are an explicit no-op', () => {
|
||||
for (const field of ['last_updated', 'state_head', 'gsd_state_version', 'last_activity']) {
|
||||
test('A22: derive rows (last_updated, state_head, msd_state_version, last_activity) are an explicit no-op', () => {
|
||||
for (const field of ['last_updated', 'state_head', 'msd_state_version', 'last_activity']) {
|
||||
assert.doesNotThrow(() => {
|
||||
const r = applyStatePreservation({
|
||||
transaction: openStateTransaction({
|
||||
@@ -3412,7 +3412,7 @@ describe('#3468 matrix C1/C2: identity across the refactor — pinned literal ou
|
||||
});
|
||||
|
||||
test('C1: derive-classified fields pass through untouched regardless of snapshot (pinned)', () => {
|
||||
for (const field of ['gsd_state_version', 'last_updated', 'last_activity', 'state_head']) {
|
||||
for (const field of ['msd_state_version', 'last_updated', 'last_activity', 'state_head']) {
|
||||
const r = applyStatePreservation({
|
||||
transaction: openStateTransaction({
|
||||
snapshot: { [field]: GOOD },
|
||||
@@ -3534,12 +3534,12 @@ describe('#3468 matrix C3: executor dispatch is a pure function of the row polic
|
||||
*
|
||||
* Prior to the fix, the template's File Template section began with
|
||||
* `# Project State` (no frontmatter), leaving the init→first-write window
|
||||
* without `gsd_state_version`, `status`, or `progress` keys.
|
||||
* without `msd_state_version`, `status`, or `progress` keys.
|
||||
*
|
||||
* Acceptance criteria:
|
||||
* 1. The template body extracted from each state.md file's File Template code
|
||||
* block must begin with `---`.
|
||||
* 2. The frontmatter must contain at minimum: `gsd_state_version` and `status`.
|
||||
* 2. The frontmatter must contain at minimum: `msd_state_version` and `status`.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@@ -3552,7 +3552,7 @@ const path = require('node:path');
|
||||
const REPO_ROOT = path.join(__dirname, '..');
|
||||
|
||||
const TEMPLATE_PATHS = [
|
||||
path.join(REPO_ROOT, 'gsd-core', 'templates', 'state.md'),
|
||||
path.join(REPO_ROOT, 'msd-core', 'templates', 'state.md'),
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -3669,14 +3669,14 @@ describe('bug #21 — STATE.md template must carry YAML frontmatter', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test(`${label} — frontmatter contains gsd_state_version`, () => {
|
||||
test(`${label} — frontmatter contains msd_state_version`, () => {
|
||||
const content = fs.readFileSync(templatePath, 'utf-8');
|
||||
const body = extractFileTemplate(content);
|
||||
const keys = parseFrontmatterKeys(body.trimStart());
|
||||
|
||||
assert.ok(
|
||||
keys.has('gsd_state_version'),
|
||||
`${label}: frontmatter must include 'gsd_state_version', found keys: ${[...keys].join(', ')}`,
|
||||
keys.has('msd_state_version'),
|
||||
`${label}: frontmatter must include 'msd_state_version', found keys: ${[...keys].join(', ')}`,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -3988,7 +3988,7 @@ describe('state transitions do not consult a progress provider (#3118)', () => {
|
||||
|
||||
const milestoneBody = [
|
||||
'---',
|
||||
'gsd_state_version: 1.0',
|
||||
'msd_state_version: 1.0',
|
||||
'milestone: v1.0',
|
||||
'milestone_name: Old Milestone',
|
||||
'status: executing',
|
||||
@@ -4031,12 +4031,12 @@ describe('state transitions do not consult a progress provider (#3118)', () => {
|
||||
'',
|
||||
'## Operator Next Steps',
|
||||
'',
|
||||
'- Re-run /gsd:complete-milestone v1.0',
|
||||
'- Re-run /msd:complete-milestone v1.0',
|
||||
'',
|
||||
].join('\n');
|
||||
assert.doesNotThrow(() => transitionCore(
|
||||
preCloseBody,
|
||||
{ kind: 'milestoneComplete', version: 'v1.0', nextMilestoneCommand: '/gsd:new-milestone' },
|
||||
{ kind: 'milestoneComplete', version: 'v1.0', nextMilestoneCommand: '/msd:new-milestone' },
|
||||
{ clock, progressProvider: exploding },
|
||||
));
|
||||
|
||||
@@ -4168,7 +4168,7 @@ describe('#3871 / #3756: preserve-always must still run on a resyncing write', (
|
||||
});
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// ADR-3473 §8.6 test matrix (.gsd/phase/feat-3871-state-transaction-snapshot/
|
||||
// ADR-3473 §8.6 test matrix (.msd/phase/feat-3871-state-transaction-snapshot/
|
||||
// 50-test-matrix.md), rows 13-27 and 36: construction failures for
|
||||
// `openStateTransaction` / `rebuildStateTransaction`, the legal-empty /
|
||||
// null-prototype / prototype-pollution snapshot boundary, the aliasing fix
|
||||
@@ -4259,7 +4259,7 @@ describe('ADR-3473 §8.6 matrix rows 18-21: construction is a typed failure, dis
|
||||
|
||||
describe('ADR-3473 §8.6 matrix rows 22-24: an empty / null-prototype / pollution-carrying snapshot is LEGAL', () => {
|
||||
// This is as load-bearing as the throws above: it is what keeps
|
||||
// /gsd-health --repair working on a broken (frontmatter-less) STATE.md —
|
||||
// /msd-health --repair working on a broken (frontmatter-less) STATE.md —
|
||||
// extractFrontmatter returns `{}` for such a document, never null, and
|
||||
// `{}` must be accepted, not rejected as "absent".
|
||||
test('emptySnapshotIsLegalAndRestoresNothing', () => {
|
||||
@@ -4502,7 +4502,7 @@ describe('ADR-3473 §8.6 matrix row 36: property — preservation never drops a
|
||||
});
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// #4129: the resync arm of `applyPreserveAlways` (rows 8-14 of .gsd/bug/
|
||||
// #4129: the resync arm of `applyPreserveAlways` (rows 8-14 of .msd/bug/
|
||||
// fix-4129-completed-phases-recompute/50-test-matrix.md). A resyncing write
|
||||
// whose scan MEASURED something now runs the declared `progress-ratchet`
|
||||
// merge instead of wholesale-replacing the curated block — the write path
|
||||
@@ -4835,7 +4835,7 @@ describe('stateReplaceProgressPercent — anchored bold form leaves prose lookal
|
||||
// §8.1's caller-side rule is Required — Phase 2); C2+ consume it. Frozen like its
|
||||
// base so a transaction cannot be mutated after construction.
|
||||
describe('C1 (ADR-4629 §8.1): StateWriteIntent type surface', () => {
|
||||
const { createStateWriteIntent } = require('../gsd-core/bin/lib/state-transition.cjs');
|
||||
const { createStateWriteIntent } = require('../msd-core/bin/lib/state-transition.cjs');
|
||||
|
||||
test('createStateWriteIntent extends a StateTransaction with assertions + declared scope', () => {
|
||||
const base = openStateTransaction({ snapshot: {} });
|
||||
|
||||
Reference in New Issue
Block a user