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:
Jakub Zych
2026-10-06 01:47:40 +02:00
parent fe069b2a56
commit a9a7a328e6
2763 changed files with 78465 additions and 78434 deletions

View File

@@ -67,22 +67,22 @@ const read = (...parts) => fs.readFileSync(path.join(ROOT, ...parts), 'utf-8');
*/
const flat = (content) => content.replace(/\s+/g, ' ');
const PLAN_CHECKER = read('agents', 'gsd-plan-checker.md');
const UI_CHECKER = read('agents', 'gsd-ui-checker.md');
const PLANNER_REVISION = read('gsd-core', 'references', 'planner-revision.md');
const REVISION_LOOP = read('gsd-core', 'references', 'revision-loop.md');
const FEW_SHOT = read('gsd-core', 'references', 'few-shot-examples', 'plan-checker.md');
const PLAN_PHASE = read('gsd-core', 'workflows', 'plan-phase.md');
const QUICK_LOOP = read('gsd-core', 'workflows', 'quick', 'steps', 'plan-checker-loop.md');
const QUICK_BATCH_LOOP = read('gsd-core', 'workflows', 'quick-batch', 'steps', 'plan-checker-loop.md');
const UI_PHASE = read('gsd-core', 'workflows', 'ui-phase.md');
const DIAGNOSE = read('gsd-core', 'workflows', 'diagnose-issues.md');
const CONVERGENCE = read('gsd-core', 'workflows', 'plan-review-convergence.md');
const VERIFY_WORK = read('gsd-core', 'workflows', 'verify-work.md');
const PLANNER = read('agents', 'gsd-planner.md');
const UI_RESEARCHER = read('agents', 'gsd-ui-researcher.md');
const CONTRACTS = read('gsd-core', 'references', 'agent-contracts.md');
const REVIEW = read('gsd-core', 'workflows', 'review.md');
const PLAN_CHECKER = read('agents', 'msd-plan-checker.md');
const UI_CHECKER = read('agents', 'msd-ui-checker.md');
const PLANNER_REVISION = read('msd-core', 'references', 'planner-revision.md');
const REVISION_LOOP = read('msd-core', 'references', 'revision-loop.md');
const FEW_SHOT = read('msd-core', 'references', 'few-shot-examples', 'plan-checker.md');
const PLAN_PHASE = read('msd-core', 'workflows', 'plan-phase.md');
const QUICK_LOOP = read('msd-core', 'workflows', 'quick', 'steps', 'plan-checker-loop.md');
const QUICK_BATCH_LOOP = read('msd-core', 'workflows', 'quick-batch', 'steps', 'plan-checker-loop.md');
const UI_PHASE = read('msd-core', 'workflows', 'ui-phase.md');
const DIAGNOSE = read('msd-core', 'workflows', 'diagnose-issues.md');
const CONVERGENCE = read('msd-core', 'workflows', 'plan-review-convergence.md');
const VERIFY_WORK = read('msd-core', 'workflows', 'verify-work.md');
const PLANNER = read('agents', 'msd-planner.md');
const UI_RESEARCHER = read('agents', 'msd-ui-researcher.md');
const CONTRACTS = read('msd-core', 'references', 'agent-contracts.md');
const REVIEW = read('msd-core', 'workflows', 'review.md');
const COMMANDS = read('docs', 'COMMANDS.md');
// ── Helpers ────────────────────────────────────────────────────────
@@ -109,7 +109,7 @@ function extractConflictGate() {
/** Run the extracted gate with REVIEWS_FILE set. Returns { status, stdout, stderr }. */
function runConflictGate(reviewsFile) {
const dir = createTempDir('gsd-3771-gate-');
const dir = createTempDir('msd-3771-gate-');
try {
const script = path.join(dir, 'gate.sh');
fs.writeFileSync(script, `${extractConflictGate()}\nprintf '%s' "\${OPEN_CONFLICTS}"\n`);
@@ -144,7 +144,7 @@ function extractWriterGate() {
/** Run the writer gate against `reviewsFile` with the five conflict fields as env. Mutates the file. */
function runWriterGate(reviewsFile, fields) {
const dir = createTempDir('gsd-3916-writer-');
const dir = createTempDir('msd-3916-writer-');
try {
const script = path.join(dir, 'writer.sh');
fs.writeFileSync(script, extractWriterGate());
@@ -190,7 +190,7 @@ function extractCloseGate() {
/** Run the close gate against `reviewsFile`, closing the open `dimension`/`plan` conflict with `resolution`. */
function runCloseGate(reviewsFile, dimension, plan, resolution) {
const dir = createTempDir('gsd-3916-close-');
const dir = createTempDir('msd-3916-close-');
try {
const script = path.join(dir, 'close.sh');
fs.writeFileSync(script, extractCloseGate());
@@ -219,7 +219,7 @@ function runCloseGate(reviewsFile, dimension, plan, resolution) {
/** Write a REVIEWS.md fixture and hand its path to `fn`. */
function withReviews(body, fn, filename = '07-REVIEWS.md') {
const dir = createTempDir('gsd-3771-reviews-');
const dir = createTempDir('msd-3771-reviews-');
try {
const file = path.join(dir, filename);
fs.writeFileSync(file, body);
@@ -231,8 +231,8 @@ function withReviews(body, fn, filename = '07-REVIEWS.md') {
const OPEN = (id) => `- [ ] REVISION_CONFLICT ${id} — required_property: p | conflicts with: D-1 | alternatives: a`;
const RESOLVED = (id) => `- [x] REVISION_CONFLICT ${id} — required_property: p | resolved: adopted alternative`;
const CONFLICTS_BEGIN = '<!-- gsd:plan-revision-conflicts:begin -->';
const CONFLICTS_END = '<!-- gsd:plan-revision-conflicts:end -->';
const CONFLICTS_BEGIN = '<!-- msd:plan-revision-conflicts:begin -->';
const CONFLICTS_END = '<!-- msd:plan-revision-conflicts:end -->';
const reviewsArtifact = (conflicts = '', reviewerText = '') =>
`# Cross-AI Plan Review — Phase 7\n\n${CONFLICTS_BEGIN}\n## Plan-Revision Conflicts\n${conflicts}${CONFLICTS_END}\n\n${reviewerText}`;
@@ -306,7 +306,7 @@ describe('#3771 checker states the property and marks the example non-binding',
test('progressive-disclosure issue examples carry the same binding schema', () => {
const examplesPath = path.join(
ROOT,
'gsd-core',
'msd-core',
'references',
'plan-checker-examples.md'
);
@@ -407,19 +407,19 @@ describe('#3771 revision re-checks constraints and has a conflict path', () => {
// A marker four workflows dispatch on must be declared and emitted where the agent is
// defined, not only in the shared reference — otherwise nothing produces what they match.
test('the producing agents declare and emit REVISION_CONFLICT', () => {
for (const [name, agent] of [['gsd-planner', PLANNER], ['gsd-ui-researcher', UI_RESEARCHER]]) {
for (const [name, agent] of [['msd-planner', PLANNER], ['msd-ui-researcher', UI_RESEARCHER]]) {
assert.match(agent, /```markdown\r?\n## REVISION_CONFLICT/,
`${name} must emit the marker in-fence, or check:contract-drift reports an orphan consumer`);
}
const plannerRow = CONTRACTS.split(/\r?\n/).find((l) => l.startsWith('| gsd-planner |'));
const uiRow = CONTRACTS.split(/\r?\n/).find((l) => l.startsWith('| gsd-ui-researcher |'));
const plannerRow = CONTRACTS.split(/\r?\n/).find((l) => l.startsWith('| msd-planner |'));
const uiRow = CONTRACTS.split(/\r?\n/).find((l) => l.startsWith('| msd-ui-researcher |'));
assert.ok(plannerRow && uiRow, 'both registry rows must exist');
for (const [name, row] of [['gsd-planner', plannerRow], ['gsd-ui-researcher', uiRow]]) {
for (const [name, row] of [['msd-planner', plannerRow], ['msd-ui-researcher', uiRow]]) {
assert.match(row, /`## REVISION_CONFLICT`/, `${name}'s registry row must declare the marker`);
}
for (const consumer of ['quick/steps/plan-checker-loop.md', 'verify-work.md']) {
assert.ok(plannerRow.includes(consumer),
`gsd-planner's Consumed by must list ${consumer} — it dispatches on the marker`);
`msd-planner's Consumed by must list ${consumer} — it dispatches on the marker`);
}
});
@@ -487,7 +487,7 @@ describe('#3771 generic revision pattern carries the same separation', () => {
'the contract must state the concrete forgery sanitization prevents');
assert.match(flat(PLAN_PHASE), /Sanitize-then-insert is real shell/,
'the workflow that does the appending must run the rule, not restate it as prose (#3916)');
for (const [name, agent] of [['planner-revision', PLANNER_REVISION], ['gsd-ui-researcher', UI_RESEARCHER]]) {
for (const [name, agent] of [['planner-revision', PLANNER_REVISION], ['msd-ui-researcher', UI_RESEARCHER]]) {
assert.match(flat(agent), /\*\*Every field is one line of plain text\.\*\*/,
`${name} must forbid the shapes the writer would otherwise have to strip`);
}
@@ -611,7 +611,7 @@ describe('#3771 generic revision pattern carries the same separation', () => {
// The slot is a blocking gate's state. One content owner, or it can be forged.
test('only plan-phase may mutate the conflicts section', () => {
assert.match(flat(CONVERGENCE), /\*\*Only `\/gsd:plan-phase` mutates the contents of this slot\.\*\*/,
assert.match(flat(CONVERGENCE), /\*\*Only `\/msd:plan-phase` mutates the contents of this slot\.\*\*/,
'the section needs exactly one declared content owner');
assert.match(flat(CONVERGENCE), /review agent preserves the existing `## Plan-Revision Conflicts` block byte-for-byte/,
'the artifact writer may delimit and preserve the slot, never synthesize its state');
@@ -632,11 +632,11 @@ const ORCHESTRATORS = [
['plan-phase', PLAN_PHASE, 'iteration_count'],
['quick plan-checker-loop', QUICK_LOOP, 'iteration_count'],
// quick-batch's per-item loop was missed in the initial pass (agy/gemini-3.8-flash-high
// adversarial review, #3916 round 4) -- it hands <revision_context> to gsd-planner exactly
// adversarial review, #3916 round 4) -- it hands <revision_context> to msd-planner exactly
// like quick's single-task loop, but had none of this contract until that review caught it.
['quick-batch plan-checker-loop', QUICK_BATCH_LOOP, 'iteration_count'],
['ui-phase', UI_PHASE, 'revision_count'],
// verify-work's gap-plan revision hands <revision_context> to gsd-planner, so it inherits the
// verify-work's gap-plan revision hands <revision_context> to msd-planner, so it inherits the
// contract whether or not it states it. It was missed in the first pass (#3771 round-2 review).
['verify-work gap-plan revision', VERIFY_WORK, 'iteration_count'],
];
@@ -646,12 +646,12 @@ describe('#3771 every revision orchestrator routes conflicts instead of retrying
// its loaded context and it states only its own bindings. The other three do not import it and
// must carry the rules inline. `loadedFor` is what the runtime actually puts in front of each
// orchestrator — the honest surface to assert a shared rule against.
const importsShared = (content) => /@~\/\.claude\/gsd-core\/references\/revision-loop\.md/.test(content);
const importsShared = (content) => /@~\/\.claude\/msd-core\/references\/revision-loop\.md/.test(content);
const loadedFor = (content) => (importsShared(content) ? flat(content + '\n' + REVISION_LOOP) : flat(content));
test('plan-phase delegates the shared protocol rather than duplicating it', () => {
assert.ok(importsShared(PLAN_PHASE), 'plan-phase must @-import the reference it defers to');
assert.match(flat(PLAN_PHASE), /follow the shared Conflict Return protocol in `gsd-core\/references\/revision-loop\.md`/,
assert.match(flat(PLAN_PHASE), /follow the shared Conflict Return protocol in `msd-core\/references\/revision-loop\.md`/,
'the delegation must be explicit, or the bindings have no protocol to bind to');
});
@@ -675,7 +675,7 @@ describe('#3771 every revision orchestrator routes conflicts instead of retrying
// Four prompts state this contract; planner-revision.md is the authority they must agree
// with. Each must name where that authority is, or the next editor updates one of five.
test(`${name} names the authority its inline statement summarises`, () => {
assert.match(loaded, /Full contract:\s+`gsd-core\/references\/planner-revision\.md`|see your `## Revision Conflict`\s+section/,
assert.match(loaded, /Full contract:\s+`msd-core\/references\/planner-revision\.md`|see your `## Revision Conflict`\s+section/,
`${name} must point at the contract its prompt paraphrases`);
});
@@ -767,7 +767,7 @@ describe('#3771 every revision orchestrator routes conflicts instead of retrying
'the hard-block must require a NON-EMPTY REVIEWS_FILE, or a brand-new phase with no reviews yet can never return a conflict at all');
assert.match(flat(PLAN_PHASE), /plan-phase wrote the line, so plan-phase closes it/,
'closure must have exactly one named owner, or a line can be orphaned open');
assert.match(flat(REVISION_LOOP), /never invokes `\/gsd:plan-review-convergence`/,
assert.match(flat(REVISION_LOOP), /never invokes `\/msd:plan-review-convergence`/,
'plan-phase runs inside that loop; invoking it would be a cycle');
// A markdown table cannot be counted by any simple filter — its header and separator rows
// look like data. The recorded shape must be one the reader can match exactly.
@@ -787,8 +787,8 @@ describe('#3771 every revision orchestrator routes conflicts instead of retrying
// The counter and writer must agree on both marker and ownership boundary.
assert.match(CONVERGENCE, /in_owned && \/\^- \\\[ \\\] REVISION_CONFLICT \.\*required_property:\//,
'the gate must count the conflict line shape only while inside the owned slot');
assert.match(CONVERGENCE, /gsd:plan-revision-conflicts:begin/);
assert.match(CONVERGENCE, /gsd:plan-revision-conflicts:end/);
assert.match(CONVERGENCE, /msd:plan-revision-conflicts:begin/);
assert.match(CONVERGENCE, /msd:plan-revision-conflicts:end/);
assert.doesNotMatch(CONVERGENCE, /grep -c/,
'the superseded global scan would count raw reviewer text and must not return');
assert.match(flat(CONVERGENCE), /escalates rather than deadlocking/,
@@ -801,8 +801,8 @@ describe('#3771 every revision orchestrator routes conflicts instead of retrying
// Ordering is the whole finding: the gate placed after `state planned-phase` would write
// and announce convergence over a conflict nobody resolved.
const gateAt = CONVERGENCE.indexOf('OPEN_CONFLICTS=$(awk');
const writeAt = CONVERGENCE.indexOf('gsd_run state planned-phase');
const bannerAt = CONVERGENCE.indexOf('GSD ► CONVERGENCE COMPLETE');
const writeAt = CONVERGENCE.indexOf('msd_run state planned-phase');
const bannerAt = CONVERGENCE.indexOf('MSD ► CONVERGENCE COMPLETE');
assert.ok(gateAt > 0 && writeAt > 0 && bannerAt > 0, 'all three anchors must exist');
assert.ok(gateAt < writeAt, 'the conflict gate must precede the planned-phase state write');
assert.ok(gateAt < bannerAt, 'the conflict gate must precede the convergence banner');
@@ -919,7 +919,7 @@ describe('#3916 writer, persistence, reader and migration contracts agree', () =
assert.match(flat(REVIEW), /capture only the existing conflict entry bytes after the exact/i);
assert.match(REVIEW, /\{preserved_plan_revision_conflict_entries\}/,
'the REVIEWS.md writer template needs an explicit preservation slot');
assert.match(REVIEW, /<!-- gsd:plan-revision-conflicts:begin -->\n## Plan-Revision Conflicts\n\{preserved_plan_revision_conflict_entries\}\n<!-- gsd:plan-revision-conflicts:end -->/,
assert.match(REVIEW, /<!-- msd:plan-revision-conflicts:begin -->\n## Plan-Revision Conflicts\n\{preserved_plan_revision_conflict_entries\}\n<!-- msd:plan-revision-conflicts:end -->/,
'the first-write template must emit the canonical heading before preserved entries');
assert.match(flat(REVIEW), /restore the captured bytes at the explicit slot below/i);
});
@@ -941,7 +941,7 @@ describe('#3916 writer, persistence, reader and migration contracts agree', () =
assert.match(flat(REVISION_LOOP), /reuse the existing open line instead of appending a duplicate/i,
'identical open state needs idempotency, not a second event identity');
assert.match(flat(PLAN_PHASE), /before replanning from `--reviews`, scan `REVIEWS_PATH` for open plan-revision conflicts/i);
const initAt = PLAN_PHASE.indexOf('REVIEWS_PATH=$(_gsd_field "$INIT" reviews_path)');
const initAt = PLAN_PHASE.indexOf('REVIEWS_PATH=$(_msd_field "$INIT" reviews_path)');
const scanAt = PLAN_PHASE.indexOf('**If plans exist AND the `--reviews` flag is set:**');
assert.ok(initAt > 0 && scanAt > 0, 'both REVIEWS_PATH initialization and reviews-mode scan must exist');
assert.ok(initAt < scanAt, 'REVIEWS_PATH must be initialized before reviews-mode scans it');
@@ -982,7 +982,7 @@ describe('#3916 writer, persistence, reader and migration contracts agree', () =
});
test('the command docs include open conflicts in the exit condition', () => {
const section = COMMANDS.slice(COMMANDS.indexOf('### `/gsd-plan-review-convergence`'));
const section = COMMANDS.slice(COMMANDS.indexOf('### `/msd-plan-review-convergence`'));
assert.match(flat(section), /open `## Plan-Revision Conflicts` entries.*must also be zero/i);
});