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

@@ -23,24 +23,24 @@ const os = require('node:os');
const cp = require('node:child_process');
const fc = require('fast-check');
const { runGsdTools, createTempProject, cleanup } = require('./helpers.cjs');
const { runMsdTools, createTempProject, cleanup } = require('./helpers.cjs');
const { LOOP_HOOK_POINT_CLI_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
const REPO_ROOT = path.resolve(__dirname, '..');
const {
renderEffortArgv,
EFFORT_ARGV,
} = require(path.join(REPO_ROOT, 'gsd-core', 'bin', 'lib', 'model-catalog.cjs'));
} = require(path.join(REPO_ROOT, 'msd-core', 'bin', 'lib', 'model-catalog.cjs'));
const {
HOST_INTEGRATION_AXES,
negotiateHostCapabilities,
degradationFor,
} = require(path.join(REPO_ROOT, 'gsd-core', 'bin', 'lib', 'host-integration.cjs'));
} = require(path.join(REPO_ROOT, 'msd-core', 'bin', 'lib', 'host-integration.cjs'));
const {
_HOST_INTEGRATION_VOCAB,
validateRuntimeBody,
} = require(path.join(REPO_ROOT, 'gsd-core', 'bin', 'lib', 'capability-validator.cjs'));
const registry = require(path.join(REPO_ROOT, 'gsd-core', 'bin', 'lib', 'capability-registry.cjs'));
} = require(path.join(REPO_ROOT, 'msd-core', 'bin', 'lib', 'capability-validator.cjs'));
const registry = require(path.join(REPO_ROOT, 'msd-core', 'bin', 'lib', 'capability-registry.cjs'));
// #2615: the host-integration capability matrix, normalized so CRLF checkouts
// (Windows autocrlf) don't break the row regexes below.
@@ -94,29 +94,29 @@ function projectWithEffort(effort) {
describe('#3534 resolve-execution reports resolved AND effective effort', () => {
function agentHome(t, agentFileBody) {
const home = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-3534-home-'));
const home = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-3534-home-'));
t.after(() => cleanup(home));
if (agentFileBody !== null) {
fs.mkdirSync(path.join(home, 'agents'), { recursive: true });
fs.writeFileSync(path.join(home, 'agents', 'gsd-executor.md'), agentFileBody);
fs.writeFileSync(path.join(home, 'agents', 'msd-executor.md'), agentFileBody);
}
return home;
}
function resolveExecution(dir, agent = 'gsd-executor', extra = [], env = {}) {
function resolveExecution(dir, agent = 'msd-executor', extra = [], env = {}) {
return JSON.parse(
runGsdTools(`query resolve-execution ${agent} ${extra.join(' ')}`, dir, env).output,
runMsdTools(`query resolve-execution ${agent} ${extra.join(' ')}`, dir, env).output,
);
}
test('10a: effective effort reads the installed frontmatter (claude)', (t) => {
const dir = projectWithEffort('high');
t.after(() => cleanup(dir));
const home = agentHome(t, '---\nname: gsd-executor\neffort: low\ndescription: x\n---\nBody.\n');
const home = agentHome(t, '---\nname: msd-executor\neffort: low\ndescription: x\n---\nBody.\n');
// #3534: pass the fixture home as the CHILD env argument — testEnvBase()
// blanks CLAUDE_CONFIG_DIR after the process.env spread, so a process.env
// mutation never reaches the child (and a dev's real ~/.claude would).
const out = resolveExecution(dir, 'gsd-executor', [], { CLAUDE_CONFIG_DIR: home });
const out = resolveExecution(dir, 'msd-executor', [], { CLAUDE_CONFIG_DIR: home });
assert.equal(out.effort, 'high', 'resolved cascade value unchanged');
assert.equal(out.effort_effective, 'low', 'the installed frontmatter value');
assert.equal(out.effort_effective_source, 'frontmatter');
@@ -129,8 +129,8 @@ describe('#3534 resolve-execution reports resolved AND effective effort', () =>
test('10a: absent frontmatter reports inherit as the effective state (the 10a repro)', (t) => {
const dir = projectWithEffort('high');
t.after(() => cleanup(dir));
const home = agentHome(t, '---\nname: gsd-executor\ndescription: x\n---\nBody.\n');
const out = resolveExecution(dir, 'gsd-executor', [], { CLAUDE_CONFIG_DIR: home });
const home = agentHome(t, '---\nname: msd-executor\ndescription: x\n---\nBody.\n');
const out = resolveExecution(dir, 'msd-executor', [], { CLAUDE_CONFIG_DIR: home });
assert.equal(out.effort, 'high');
assert.equal(out.effort_effective, 'inherit', 'absent key = follows the session');
assert.equal(out.effort_effective_source, 'frontmatter-absent');
@@ -140,7 +140,7 @@ describe('#3534 resolve-execution reports resolved AND effective effort', () =>
const dir = projectWithEffort('high');
t.after(() => cleanup(dir));
const home = agentHome(t, null);
const out = resolveExecution(dir, 'gsd-executor', [], { CLAUDE_CONFIG_DIR: home });
const out = resolveExecution(dir, 'msd-executor', [], { CLAUDE_CONFIG_DIR: home });
assert.equal(out.effort_effective, out.effort);
assert.equal(out.effort_effective_source, 'resolved');
});
@@ -152,7 +152,7 @@ describe('#3534 resolve-execution reports resolved AND effective effort', () =>
path.join(dir, '.planning', 'config.json'),
// #3531+#3534 combined: pin the AGENT — a bare effort.default no longer
// reaches a tiered agent under the merged tier ladder.
JSON.stringify({ runtime: 'codex', effort: { agent_overrides: { 'gsd-executor': 'medium' } } }, null, 2),
JSON.stringify({ runtime: 'codex', effort: { agent_overrides: { 'msd-executor': 'medium' } } }, null, 2),
);
const out = resolveExecution(dir);
assert.equal(out.effort, 'medium');
@@ -163,8 +163,8 @@ describe('#3534 resolve-execution reports resolved AND effective effort', () =>
test('10a: CRLF frontmatter is read', (t) => {
const dir = projectWithEffort('high');
t.after(() => cleanup(dir));
const home = agentHome(t, ['---', 'name: gsd-executor', 'effort: xhigh', 'description: x', '---', 'Body.', ''].join('\r\n'));
const out = resolveExecution(dir, 'gsd-executor', [], { CLAUDE_CONFIG_DIR: home });
const home = agentHome(t, ['---', 'name: msd-executor', 'effort: xhigh', 'description: x', '---', 'Body.', ''].join('\r\n'));
const out = resolveExecution(dir, 'msd-executor', [], { CLAUDE_CONFIG_DIR: home });
assert.equal(out.effort_effective, 'xhigh');
assert.equal(out.effort_effective_source, 'frontmatter');
});
@@ -173,7 +173,7 @@ describe('#3534 resolve-execution reports resolved AND effective effort', () =>
const dir = projectWithEffort('high');
t.after(() => cleanup(dir));
const home = agentHome(t, 'No frontmatter here at all.\n');
const out = resolveExecution(dir, 'gsd-executor', [], { CLAUDE_CONFIG_DIR: home });
const out = resolveExecution(dir, 'msd-executor', [], { CLAUDE_CONFIG_DIR: home });
assert.equal(out.effort_effective, out.effort);
assert.equal(out.effort_effective_source, 'resolved');
});
@@ -357,7 +357,7 @@ describe('#2481 live path — resolve-execution carries invocation-time effort',
const dir = projectWithEffort('xhigh');
t.after(() => cleanup(dir));
const r = runGsdTools('query resolve-execution gsd-planner --host claude', dir);
const r = runMsdTools('query resolve-execution msd-planner --host claude', dir);
assert.ok(r.success, `resolve-execution failed: ${r.error}`);
const out = JSON.parse(r.output);
assert.equal(out.effort, 'xhigh');
@@ -370,7 +370,7 @@ describe('#2481 live path — resolve-execution carries invocation-time effort',
const dir = projectWithEffort('xhigh');
t.after(() => cleanup(dir));
const out = JSON.parse(runGsdTools('query resolve-execution gsd-planner --host cursor', dir).output);
const out = JSON.parse(runMsdTools('query resolve-execution msd-planner --host cursor', dir).output);
assert.equal(out.effort_surface, 'none');
assert.deepEqual(out.effort_argv, []);
assert.equal(out.effort_argv_string, '');
@@ -380,7 +380,7 @@ describe('#2481 live path — resolve-execution carries invocation-time effort',
const dir = projectWithEffort('high');
t.after(() => cleanup(dir));
const r = runGsdTools('query resolve-execution gsd-planner --host not-a-real-host', dir);
const r = runMsdTools('query resolve-execution msd-planner --host not-a-real-host', dir);
assert.ok(r.success, 'an unknown host must degrade, not fail');
const out = JSON.parse(r.output);
assert.equal(out.effort_surface, 'none');
@@ -391,7 +391,7 @@ describe('#2481 live path — resolve-execution carries invocation-time effort',
const dir = projectWithEffort('high');
t.after(() => cleanup(dir));
const out = JSON.parse(runGsdTools('query resolve-execution gsd-planner', dir).output);
const out = JSON.parse(runMsdTools('query resolve-execution msd-planner', dir).output);
for (const k of ['host', 'effort_surface', 'effort_argv', 'effort_argv_string', 'effort_argv_value']) {
assert.ok(!(k in out), `--host absent must not add "${k}" to the contract`);
}
@@ -401,7 +401,7 @@ describe('#2481 live path — resolve-execution carries invocation-time effort',
const dir = projectWithEffort('high');
t.after(() => cleanup(dir));
const r = runGsdTools('query resolve-execution gsd-planner --host', dir);
const r = runMsdTools('query resolve-execution msd-planner --host', dir);
assert.ok(!r.success, 'a valueless --host must be a usage error');
});
@@ -409,7 +409,7 @@ describe('#2481 live path — resolve-execution carries invocation-time effort',
const dir = projectWithEffort('high');
t.after(() => cleanup(dir));
const r = runGsdTools('query resolve-execution gsd-planner --host "claude; touch pwned"', dir);
const r = runMsdTools('query resolve-execution msd-planner --host "claude; touch pwned"', dir);
assert.ok(r.success);
assert.deepEqual(JSON.parse(r.output).effort_argv, []);
assert.ok(!fs.existsSync(path.join(dir, 'pwned')), 'no shell interpolation of the host value');
@@ -422,10 +422,10 @@ describe('#3533 inherit renders no host argv argument', () => {
t2.after(() => cleanup(dir));
fs.writeFileSync(
path.join(dir, '.planning', 'config.json'),
JSON.stringify({ effort: { agent_overrides: { 'gsd-planner': 'inherit' } } }, null, 2),
JSON.stringify({ effort: { agent_overrides: { 'msd-planner': 'inherit' } } }, null, 2),
);
const out = JSON.parse(
runGsdTools('query resolve-execution gsd-planner --host claude', dir).output,
runMsdTools('query resolve-execution msd-planner --host claude', dir).output,
);
assert.equal(out.effort, 'inherit');
assert.deepEqual(out.effort_argv, [], 'inherit must render no argument');
@@ -439,7 +439,7 @@ describe('#2481 — the escalation surface renders argv (CLI-level, not a workfl
// for "a real caller outside src/commands.cts's CLI surface and tests". It
// proves the escalation ladder still renders a host argument; it does NOT
// prove any workflow escalates. The live workflow caller for Decision item 6
// is #2296's gsd-core/references/execute-phase-quota-recovery.md, asserted
// is #2296's msd-core/references/execute-phase-quota-recovery.md, asserted
// separately below.
test('--attempt walks the effort ladder above the configured default', (t) => {
const dir = createTempProject();
@@ -448,7 +448,7 @@ describe('#2481 — the escalation surface renders argv (CLI-level, not a workfl
path.join(dir, '.planning', 'config.json'),
JSON.stringify({
// #3531: pin the heavy tier rather than effort.default — a bare default
// no longer answers for gsd-planner (heavy) now that the config block
// no longer answers for msd-planner (heavy) now that the config block
// merges over the built-in tier ladder.
effort: { routing_tier_defaults: { heavy: 'low' } },
dynamic_routing: { enabled: true, escalate_on_failure: true, max_escalations: 3 },
@@ -456,7 +456,7 @@ describe('#2481 — the escalation surface renders argv (CLI-level, not a workfl
);
const at = (n) => JSON.parse(
runGsdTools(`query resolve-execution gsd-planner --host claude --attempt ${n}`, dir).output,
runMsdTools(`query resolve-execution msd-planner --host claude --attempt ${n}`, dir).output,
);
// attempt 0 is the un-escalated baseline; a later attempt must not be lower.
@@ -476,23 +476,23 @@ describe('#2481 — the escalation surface renders argv (CLI-level, not a workfl
test('a negative --attempt is rejected', (t) => {
const dir = projectWithEffort('high');
t.after(() => cleanup(dir));
assert.ok(!runGsdTools('query resolve-execution gsd-planner --attempt -1', dir).success);
assert.ok(!runMsdTools('query resolve-execution msd-planner --attempt -1', dir).success);
});
});
describe('#2481 — ADR-443 mechanism callers, as they actually exist', () => {
const quotaRecovery = fs.readFileSync(
path.join(REPO_ROOT, 'gsd-core', 'references', 'execute-phase-quota-recovery.md'),
path.join(REPO_ROOT, 'msd-core', 'references', 'execute-phase-quota-recovery.md'),
'utf8',
);
const executePhase = fs.readFileSync(
path.join(REPO_ROOT, 'gsd-core', 'workflows', 'execute-phase.md'),
path.join(REPO_ROOT, 'msd-core', 'workflows', 'execute-phase.md'),
'utf8',
);
test('Decision item 6 (escalation) has its live caller — from #2296, not this change', () => {
assert.match(
quotaRecovery, /resolve-execution\s+gsd-executor\s+--attempt/,
quotaRecovery, /resolve-execution\s+msd-executor\s+--attempt/,
'execute-phase-quota-recovery.md must invoke resolve-execution with --attempt (#2296)',
);
assert.ok(
@@ -505,7 +505,7 @@ describe('#2481 — ADR-443 mechanism callers, as they actually exist', () => {
* Does this text invoke `resolve-execution` with an invocation-time effort override (#2475)?
*
* BOTH argument shapes, because the CLI accepts both: `--effort <level>` and `--effort=<level>`
* (`gsd-core/bin/gsd-tools.cjs` — `a.slice('--effort='.length)`). The original matcher required
* (`msd-core/bin/msd-tools.cjs` — `a.slice('--effort='.length)`). The original matcher required
* `--effort\s`, so `--effort=low` — the terser form a workflow author is at least as likely to
* write — evaded it entirely, along with `--effort` at end-of-input. That hole mattered little
* while this guard merely SNAPSHOT a temporary gap; it matters a lot now that path (b) makes the
@@ -518,7 +518,7 @@ describe('#2481 — ADR-443 mechanism callers, as they actually exist', () => {
* The unbounded quantifier is deliberate and safe here: the corpus scanned is maintainer-authored
* workflow, reference, and agent markdown — bounded prose, not adversarial input.
*
* DIVERGENCE RISK. This predicate independently models `gsd-tools.cjs`'s own argument parser; the
* DIVERGENCE RISK. This predicate independently models `msd-tools.cjs`'s own argument parser; the
* two are not derived from one shared constant. If that parser ever accepts a THIRD spelling of
* `--effort`, this regex is the surface that must follow it — otherwise ADR-443's ratifying
* invariant silently stops holding while the guard still reports green.
@@ -530,21 +530,21 @@ describe('#2481 — ADR-443 mechanism callers, as they actually exist', () => {
// Behavioral: the predicate is called with inputs and its verdict asserted. The equals form
// fails against the pre-#2475 matcher — it is the regression this sub-change closes.
for (const [label, text] of [
['space form', 'gsd_run query resolve-execution gsd-executor --effort low\n'],
['equals form', 'gsd_run query resolve-execution gsd-executor --effort=low\n'],
['bare trailing --effort', 'gsd_run query resolve-execution gsd-executor --effort\n'],
['end of input, no newline', 'gsd_run query resolve-execution gsd-executor --effort'],
['CRLF equals form', 'gsd_run query resolve-execution gsd-executor --effort=low\r\n'],
['space form', 'msd_run query resolve-execution msd-executor --effort low\n'],
['equals form', 'msd_run query resolve-execution msd-executor --effort=low\n'],
['bare trailing --effort', 'msd_run query resolve-execution msd-executor --effort\n'],
['end of input, no newline', 'msd_run query resolve-execution msd-executor --effort'],
['CRLF equals form', 'msd_run query resolve-execution msd-executor --effort=low\r\n'],
]) {
assert.ok(hasEffortCaller(text), `must detect an item-1 caller written as: ${label}`);
}
for (const [label, text] of [
['--effortless is a different word', 'resolve-execution gsd-executor --effortless\n'],
['no effort argument at all', 'resolve-execution gsd-executor --host codex\n'],
['--effortless is a different word', 'resolve-execution msd-executor --effortless\n'],
['no effort argument at all', 'resolve-execution msd-executor --host codex\n'],
['--effort without resolve-execution', 'some-other-command --effort low\n'],
["item 6's --attempt caller", 'resolve-execution gsd-executor --attempt 1\n'],
['call and flag on different lines', 'resolve-execution\ngsd-executor --effort low\n'],
["item 6's --attempt caller", 'resolve-execution msd-executor --attempt 1\n'],
['call and flag on different lines', 'resolve-execution\nmsd-executor --effort low\n'],
['empty input', ''],
]) {
assert.ok(!hasEffortCaller(text), `must NOT fire on: ${label}`);
@@ -556,7 +556,7 @@ describe('#2481 — ADR-443 mechanism callers, as they actually exist', () => {
// step is an operator-facing CLI surface, deliberately not driven by shipped orchestration.
// So this is no longer a snapshot of a gap awaiting wiring — it is the invariant that keeps the
// ratified ADR true. A hit here is not "the ADR is stale", it is "the ADR must be amended first".
const dirs = ['gsd-core/workflows', 'gsd-core/references', 'agents', 'commands'];
const dirs = ['msd-core/workflows', 'msd-core/references', 'agents', 'commands'];
const hits = [];
const walk = (d) => {
const abs = path.join(REPO_ROOT, d);
@@ -582,7 +582,7 @@ describe('#2481 review workflow resolves effort per reviewer', () => {
test('shipped orchestration: the live claude lane genuinely receives --effort <level> in its spawned argv', () => {
// Phase 5b (#2799) moved the call out of review.md's per-lane bash and into the review-lane
// route's `effortFor()`, which folds a resolved level into that lane's argv template. A text
// grep in gsd-tools.cjs would pass even if the result were silently dropped before reaching
// grep in msd-tools.cjs would pass even if the result were silently dropped before reaching
// the spawned reviewer, or if the call were dead code. This drives the REAL `review-lane
// invoke` route end-to-end — real cp.spawnSync, a real project config, a real claude-shaped
// shim on PATH — and inspects the argv the shim actually received, which is the only way to
@@ -590,19 +590,19 @@ describe('#2481 review workflow resolves effort per reviewer', () => {
// the command name.
//
// #4255 changed WHERE the level comes from, not whether it must arrive. It used to be read
// from the `gsd-plan-checker` AGENT's execution settings via a hardcoded id, so this row
// from the `msd-plan-checker` AGENT's execution settings via a hardcoded id, so this row
// configured `effort.routing_tier_defaults` and expected that value in the reviewer's argv.
// A reviewer lane is not that agent, and the coupling is the bug. The row now configures the
// lane's OWN `review.effort.claude` and pins the decoupling in the same spawn: the execution
// routing tier is set to a DIFFERENT level, and leaking it into the reviewer is a failure.
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-2481-orchestration-e2e-'));
const projectDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-2481-orchestration-project-'));
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-2481-orchestration-e2e-'));
const projectDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-2481-orchestration-project-'));
try {
const bin = path.join(dir, 'bin');
const runDir = path.join(dir, 'run');
fs.mkdirSync(bin);
fs.mkdirSync(runDir);
fs.writeFileSync(path.join(runDir, 'gsd-review-prompt.md'), 'prompt');
fs.writeFileSync(path.join(runDir, 'msd-review-prompt.md'), 'prompt');
const seenArgv = path.join(dir, 'argv.txt');
fs.writeFileSync(
@@ -647,7 +647,7 @@ describe('#2481 review workflow resolves effort per reviewer', () => {
// Two levels, deliberately different (#4255). `review.effort.claude` is the reviewer
// lane's own key and is what must reach the shim. `effort.routing_tier_defaults` drives
// the AGENT execution axis and is pinned across every tier to a level that must NOT
// appear — before #4255 it, through gsd-plan-checker, was the only thing that could.
// appear — before #4255 it, through msd-plan-checker, was the only thing that could.
JSON.stringify({
review: { effort: { claude: 'xhigh' } },
effort: { routing_tier_defaults: { light: 'minimal', standard: 'minimal', heavy: 'minimal' } },
@@ -657,7 +657,7 @@ describe('#2481 review workflow resolves effort per reviewer', () => {
const r = cp.spawnSync(
process.execPath,
[
path.join(REPO_ROOT, 'gsd-core', 'bin', 'gsd-tools.cjs'),
path.join(REPO_ROOT, 'msd-core', 'bin', 'msd-tools.cjs'),
'review-lane', 'invoke', '--slug', 'claude',
'--run-dir', runDir, '--repo-root', REPO_ROOT, '--json',
],
@@ -695,8 +695,8 @@ describe('#2481 review workflow resolves effort per reviewer', () => {
// Stronger than the old shell-variable check: this asserts the effort actually lands in the
// argv AT THE POSITION the lane declares, which a `$VAR` substring never proved. Lanes whose
// effortChannel is not `argv` must receive nothing.
const { REVIEWER_LANES } = require('../gsd-core/bin/lib/review-lane-descriptor.cjs');
const { resolveLanePlan } = require('../gsd-core/bin/lib/review-lane-invocation.cjs');
const { REVIEWER_LANES } = require('../msd-core/bin/lib/review-lane-descriptor.cjs');
const { resolveLanePlan } = require('../msd-core/bin/lib/review-lane-invocation.cjs');
const EFFORT = ['--effort', 'high'];
for (const lane of REVIEWER_LANES.filter((l) => l.transport === 'spawn')) {
const r = resolveLanePlan({