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

@@ -16,9 +16,9 @@ const path = require('node:path');
const fc = require('fast-check');
// #2590: gsd-tools subprocess tests in this file spawn the real CLI; keep it in
// #2590: msd-tools subprocess tests in this file spawn the real CLI; keep it in
// test mode for the whole process.
process.env.GSD_TEST_MODE = '1';
process.env.MSD_TEST_MODE = '1';
const {
detectWorkflowBackend,
@@ -27,7 +27,7 @@ const {
WORKFLOW_TOOL_FLOOR_VERSION,
BACKEND_VALUES,
compareSemver,
} = require('../gsd-core/bin/lib/claude-orchestration.cjs');
} = require('../msd-core/bin/lib/claude-orchestration.cjs');
const {
validateCapability,
@@ -39,15 +39,15 @@ const {
stripGeneratedComment,
} = require('../scripts/gen-capability-registry.cjs');
const { runGsdTools, createTempDir, cleanup } = require('./helpers.cjs');
const { runMsdTools, createTempDir, cleanup } = require('./helpers.cjs');
const { runNode } = require('./helpers/process-seam.cjs');
const { throwIfFailed } = require('./helpers/git-fixture.cjs');
const { PROBE_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
const ROOT = path.resolve(__dirname, '..');
const CAP_PATH = path.join(ROOT, 'capabilities', 'claude-orchestration', 'capability.json');
const REGISTRY_PATH = path.join(ROOT, 'gsd-core', 'bin', 'lib', 'capability-registry.cjs');
const WORKFLOW_PATH = path.join(ROOT, 'gsd-core', 'workflows', 'execute-phase.md');
const REGISTRY_PATH = path.join(ROOT, 'msd-core', 'bin', 'lib', 'capability-registry.cjs');
const WORKFLOW_PATH = path.join(ROOT, 'msd-core', 'workflows', 'execute-phase.md');
// ─── Fixtures ─────────────────────────────────────────────────────────────────
@@ -322,7 +322,7 @@ describe('emitWorkflowScript', () => {
const parallelCount = (script.match(/parallel\s*\(/g) || []).length;
assert.ok(parallelCount >= 1, 'at least one parallel() barrier');
assert.ok(script.includes('agent('), 'agent() call per plan');
assert.ok(script.includes('gsd-executor'), 'uses gsd-executor agentType');
assert.ok(script.includes('msd-executor'), 'uses msd-executor agentType');
assert.ok(script.includes('worktree'), 'uses worktree isolation');
assert.ok(script.includes('SUMMARY.md'), 'produces SUMMARY.md (same artifact as inline path)');
@@ -506,7 +506,7 @@ describe('emitWorkflowScript — per-plan use_worktree (#2772 / #2285 finding 1)
test('[happy] use_worktree omitted (default) -> isolation: "worktree" (backward-compatible default)', () => {
const r = emitWorkflowScript(singleWaveManifest());
assert.strictEqual(r.ok, true);
assert.match(r.script, /agent\("Implement the foo module", \{ agentType: "gsd-executor", isolation: "worktree" \}\)/);
assert.match(r.script, /agent\("Implement the foo module", \{ agentType: "msd-executor", isolation: "worktree" \}\)/);
});
test('[happy] use_worktree: true explicit -> isolation: "worktree" (same as default)', () => {
@@ -515,7 +515,7 @@ describe('emitWorkflowScript — per-plan use_worktree (#2772 / #2285 finding 1)
waves: [{ id: 'w1', plans: [{ id: 'p1', brief: 'b', files_modified: ['a.cts'], use_worktree: true }] }],
});
assert.strictEqual(r.ok, true);
assert.match(r.script, /agent\("b", \{ agentType: "gsd-executor", isolation: "worktree" \}\)/);
assert.match(r.script, /agent\("b", \{ agentType: "msd-executor", isolation: "worktree" \}\)/);
});
test('[negative] use_worktree: false -> isolation OMITTED entirely for that plan', () => {
@@ -524,7 +524,7 @@ describe('emitWorkflowScript — per-plan use_worktree (#2772 / #2285 finding 1)
waves: [{ id: 'w1', plans: [{ id: 'p1', brief: 'submodule plan', files_modified: ['vendor/lib.c'], use_worktree: false }] }],
});
assert.strictEqual(r.ok, true);
assert.match(r.script, /agent\("submodule plan", \{ agentType: "gsd-executor" \}\)/);
assert.match(r.script, /agent\("submodule plan", \{ agentType: "msd-executor" \}\)/);
assert.ok(!/agent\("submodule plan"[^)]*isolation/.test(r.script), 'isolation must not appear for this plan\'s agent() call');
});
@@ -539,8 +539,8 @@ describe('emitWorkflowScript — per-plan use_worktree (#2772 / #2285 finding 1)
assert.strictEqual(r.ok, true);
// Both plans have disjoint files_modified -> coalesce into ONE parallel() stage.
assert.strictEqual(r.summary.stagesByWave[0].length, 1, 'non-overlapping plans share one stage');
assert.match(r.script, /agent\("normal plan", \{ agentType: "gsd-executor", isolation: "worktree" \}\)/);
assert.match(r.script, /agent\("submodule plan", \{ agentType: "gsd-executor" \}\)/);
assert.match(r.script, /agent\("normal plan", \{ agentType: "msd-executor", isolation: "worktree" \}\)/);
assert.match(r.script, /agent\("submodule plan", \{ agentType: "msd-executor" \}\)/);
assert.ok(!/agent\("submodule plan"[^)]*isolation/.test(r.script), 'the submodule plan must never gain isolation from being batched with a worktree plan');
});
@@ -685,23 +685,23 @@ describe('#3674 — pre-extraction characterization (golden output pins)', () =>
});
// Golden script captured verbatim from the unmodified pre-extraction
// production code (`node -e` against `gsd-core/bin/lib/claude-orchestration.cjs`
// production code (`node -e` against `msd-core/bin/lib/claude-orchestration.cjs`
// before any source under this phase was touched). Any divergence here is
// an observable behavior change in the emitted Workflow script.
const GOLDEN_SCRIPT_3674 = [
'export const meta = {',
' name: "gsd-execute-run-resolve-3674",',
' description: "GSD wave dispatch for .planning/phases/01-resolve3674",',
' name: "msd-execute-run-resolve-3674",',
' description: "MSD wave dispatch for .planning/phases/01-resolve3674",',
' phases: [',
' { title: "Wave w1", detail: "3 plan(s)" },',
' { title: "Wave w2", detail: "1 plan(s)" },',
' ],',
'}',
'',
'// GSD Workflow script — generated by the claude-orchestration capability (#1143)',
'// MSD Workflow script — generated by the claude-orchestration capability (#1143)',
'// phase: .planning/phases/01-resolve3674',
'// BETA: preview-grade; on any failure the orchestrator falls back to inline dispatch.',
'// Composes the SAME gsd-executor agent as the inline path, so artifacts (SUMMARY.md)',
'// Composes the SAME msd-executor agent as the inline path, so artifacts (SUMMARY.md)',
'// and commits are produced identically. Worktree isolation is per-plan (use_worktree)',
'// and mirrors execute-phase.md step 2.5\'s submodule gate exactly (#2772 / #2285).',
'// model: none applied — resolved to "inherit"/empty, so each agent inherits the',
@@ -714,7 +714,7 @@ describe('#3674 — pre-extraction characterization (golden output pins)', () =>
'// orchestrator can record it into WAVE_WORKTREE_MANIFEST after the run',
'// (worktree.record-agent -> worktree.cleanup-wave, the same manifest-scoped',
'// merge chain inline dispatch feeds). null = absent/unparseable/interrupted.',
'function gsdWorktreeMetadata(agentResult) {',
'function msdWorktreeMetadata(agentResult) {',
' if (typeof agentResult !== \'string\') return null;',
' const m = agentResult.match(/<worktree_metadata>([\\s\\S]*?)<\\/worktree_metadata>/);',
' if (m === null) return null;',
@@ -725,36 +725,36 @@ describe('#3674 — pre-extraction characterization (golden output pins)', () =>
' return null;',
' }',
'}',
'const gsdAgentOutcomes = [];',
'const msdAgentOutcomes = [];',
'',
'// Wave w1',
'phase("Wave w1")',
'// Stage 0',
'const gsdStage_0_0 = await parallel([',
' () => agent("Plan P1", { agentType: "gsd-executor", isolation: "worktree" }),',
' () => agent("Plan P3", { agentType: "gsd-executor", isolation: "worktree" }),',
'const msdStage_0_0 = await parallel([',
' () => agent("Plan P1", { agentType: "msd-executor", isolation: "worktree" }),',
' () => agent("Plan P3", { agentType: "msd-executor", isolation: "worktree" }),',
'])',
'gsdAgentOutcomes.push(',
' { plan: "p1", expects_worktree: true, metadata: gsdWorktreeMetadata(gsdStage_0_0[0]) },',
' { plan: "p3", expects_worktree: true, metadata: gsdWorktreeMetadata(gsdStage_0_0[1]) }',
'msdAgentOutcomes.push(',
' { plan: "p1", expects_worktree: true, metadata: msdWorktreeMetadata(msdStage_0_0[0]) },',
' { plan: "p3", expects_worktree: true, metadata: msdWorktreeMetadata(msdStage_0_0[1]) }',
')',
'// Stage 1 (sequential — files_modified overlap)',
'const gsdStage_0_1 = await parallel([',
' () => agent("Plan P2", { agentType: "gsd-executor", isolation: "worktree" }),',
'const msdStage_0_1 = await parallel([',
' () => agent("Plan P2", { agentType: "msd-executor", isolation: "worktree" }),',
'])',
'gsdAgentOutcomes.push(',
' { plan: "p2", expects_worktree: true, metadata: gsdWorktreeMetadata(gsdStage_0_1[0]) }',
'msdAgentOutcomes.push(',
' { plan: "p2", expects_worktree: true, metadata: msdWorktreeMetadata(msdStage_0_1[0]) }',
')',
'',
'// Wave w2',
'phase("Wave w2")',
'const gsdStage_1_0 = await parallel([',
' () => agent("Plan P4", { agentType: "gsd-executor", isolation: "worktree" }),',
'const msdStage_1_0 = await parallel([',
' () => agent("Plan P4", { agentType: "msd-executor", isolation: "worktree" }),',
'])',
'gsdAgentOutcomes.push(',
' { plan: "p4", expects_worktree: true, metadata: gsdWorktreeMetadata(gsdStage_1_0[0]) }',
'msdAgentOutcomes.push(',
' { plan: "p4", expects_worktree: true, metadata: msdWorktreeMetadata(msdStage_1_0[0]) }',
')',
'return gsdAgentOutcomes',
'return msdAgentOutcomes',
].join('\n');
assert.strictEqual(r.script, GOLDEN_SCRIPT_3674);
@@ -901,10 +901,10 @@ describe('inline-fallback parity', () => {
});
test('generated Workflow script preserves the inline-path contract (same agent + isolation + artifact)', () => {
// Criterion 2: the emitted Workflow composes the SAME gsd-executor agent and worktree
// Criterion 2: the emitted Workflow composes the SAME msd-executor agent and worktree
// isolation the inline path uses, and produces the same SUMMARY.md artifact.
const r = emitWorkflowScript(singleWaveManifest());
assert.ok(r.script.includes('gsd-executor'), 'same executor agent as inline dispatch');
assert.ok(r.script.includes('msd-executor'), 'same executor agent as inline dispatch');
assert.ok(r.script.includes('worktree'), 'same worktree isolation as inline dispatch');
assert.ok(r.script.includes('SUMMARY.md'), 'same SUMMARY.md artifact as inline dispatch');
});
@@ -920,9 +920,9 @@ describe('inline-fallback parity', () => {
describe('#2686 — Workflow backend model threading', () => {
const {
resolveWaveDispatch: resolveWaveDispatch2686,
} = require('../gsd-core/bin/lib/claude-orchestration.cjs');
const modelResolver2686 = require('../gsd-core/bin/lib/model-resolver.cjs');
const { runGsdTools: runTools2686, createTempProject: mkProject2686, cleanup: rm2686 } =
} = require('../msd-core/bin/lib/claude-orchestration.cjs');
const modelResolver2686 = require('../msd-core/bin/lib/model-resolver.cjs');
const { runMsdTools: runTools2686, createTempProject: mkProject2686, cleanup: rm2686 } =
require('./helpers.cjs');
const WAVES_2686 = [
@@ -972,15 +972,15 @@ describe('#2686 — Workflow backend model threading', () => {
};
test('#2686: the Workflow backend dispatches the same model the inline path would use', () => {
const dir = mkProject2686('gsd-2686-');
const dir = mkProject2686('msd-2686-');
try {
fs.writeFileSync(
path.join(dir, '.planning', 'config.json'),
JSON.stringify({ model_profile: 'balanced', model_overrides: { 'gsd-executor': 'opus' } }),
JSON.stringify({ model_profile: 'balanced', model_overrides: { 'msd-executor': 'opus' } }),
);
// The inline path reads exactly this. Deriving BOTH sides from the resolver
// (rather than hardcoding either) is what makes this a parity assertion.
const inlineModel = modelResolver2686.resolveModelInternal(dir, 'gsd-executor');
const inlineModel = modelResolver2686.resolveModelInternal(dir, 'msd-executor');
assert.equal(inlineModel, 'opus', 'precondition: the override must resolve');
const res = emit2686({ executorModel: inlineModel });
@@ -1120,11 +1120,11 @@ describe('#2686 — Workflow backend model threading', () => {
});
test('#2686: the CLI defaults the executor model from project config', () => {
const dir = mkProject2686('gsd-2686-cli-');
const dir = mkProject2686('msd-2686-cli-');
try {
fs.writeFileSync(
path.join(dir, '.planning', 'config.json'),
JSON.stringify({ model_profile: 'balanced', model_overrides: { 'gsd-executor': 'opus' } }),
JSON.stringify({ model_profile: 'balanced', model_overrides: { 'msd-executor': 'opus' } }),
);
const wavesPath = path.join(dir, 'waves.json');
fs.writeFileSync(wavesPath, JSON.stringify({ waves: WAVES_2686 }));
@@ -1211,7 +1211,7 @@ describe('#2686 — Workflow backend model threading', () => {
// 3. `resolveWaveDispatch` in src/claude-orchestration.cts composes
// `detectWorkflowBackend` + `emitWorkflowScript` into ONE decision seam,
// giving both functions a real caller outside their CLI router and outside
// tests. It is also exposed via `gsd-tools claude-orchestration
// tests. It is also exposed via `msd-tools claude-orchestration
// resolve-wave-dispatch`.
//
// These drive the real seam (no source-grep on implementation files) and
@@ -1274,7 +1274,7 @@ describe('A. resolveWaveDispatch — enabled + all gates satisfied → workflow
// reach the caller (which passes it as that input), but never as a call.
assert.ok(!/^\s*resumeFromRunId\s*\(/m.test(result.script), 'must not CALL resumeFromRunId');
assert.strictEqual(result.summary.resumeRunId, 'run-2285-1');
assert.match(result.script, /agentType: "gsd-executor", isolation: "worktree"/);
assert.match(result.script, /agentType: "msd-executor", isolation: "worktree"/);
assert.ok(result.summary && result.summary.plans === 1, 'summary.plans must reflect the manifest');
});
@@ -1440,7 +1440,7 @@ describe('C. resolveWaveDispatch composes detectWorkflowBackend + emitWorkflowSc
const wavesPath = path.join(tmp, 'waves.json');
fs.writeFileSync(wavesPath, JSON.stringify({ waves: singleWave().waves }));
const res = runGsdTools([
const res = runMsdTools([
'claude-orchestration', 'resolve-wave-dispatch',
'--waves', wavesPath,
'--run-id', 'run-2285-1',
@@ -1471,7 +1471,7 @@ describe('C. resolveWaveDispatch composes detectWorkflowBackend + emitWorkflowSc
const wavesPath = path.join(tmp, 'waves.json');
fs.writeFileSync(wavesPath, JSON.stringify({ waves: singleWave().waves }));
const res = runGsdTools([
const res = runMsdTools([
'claude-orchestration', 'resolve-wave-dispatch',
'--waves', wavesPath, '--run-id', 'run-x', '--raw',
], tmp);
@@ -1543,7 +1543,7 @@ describe('D. capability.json no longer declares a contribution at execute:wave:p
// ─── Section E: source-contract guard — execute-phase.md renders execute:wave:pre BEFORE dispatch ──
// allow-test-rule: source-text-is-the-product, see #2285 — reads gsd-core/workflows/execute-phase.md
// allow-test-rule: source-text-is-the-product, see #2285 — reads msd-core/workflows/execute-phase.md
// prose to verify the render-hooks call site + ordering. The workflow markdown IS the runtime
// contract executed by the orchestrator; there is no behavioral seam to drive this assertion
// through other than the rendered prose itself.
@@ -1561,12 +1561,12 @@ describe('E. execute-phase.md actually renders execute:wave:pre (the dead hook i
const doc = fs.readFileSync(WORKFLOW_PATH, 'utf8');
const preHooksIdx = doc.indexOf('loop render-hooks execute:wave:pre');
// Anchor on the actual per-wave dispatch call (step 3), not the generic
// `subagent_type="gsd-executor"` mention in <runtime_compatibility> near the
// `subagent_type="msd-executor"` mention in <runtime_compatibility> near the
// top of the file — that mention predates the wave loop entirely and would
// give a false "before" reading.
const agentDispatchIdx = doc.indexOf('description="Execute plan {plan_number}');
assert.ok(preHooksIdx !== -1, 'execute:wave:pre render-hooks call site must exist');
assert.ok(agentDispatchIdx !== -1, 'the gsd-executor Agent() dispatch call site (step 3) must exist');
assert.ok(agentDispatchIdx !== -1, 'the msd-executor Agent() dispatch call site (step 3) must exist');
assert.ok(
preHooksIdx < agentDispatchIdx,
`execute:wave:pre render-hooks (idx ${preHooksIdx}) must appear BEFORE the wave's Agent() dispatch (idx ${agentDispatchIdx}) — it is a pre-wave hook`,
@@ -1620,11 +1620,11 @@ describe('F. Workflow backend never forces worktree isolation on a submodule / u
test('[happy] resolveWaveDispatch (pure seam): the submodule plan\'s agent() call carries NO isolation, the normal plan\'s does', () => {
const result = resolveWaveDispatch(baseInput({ ...waveWithSubmodulePlan() }));
assert.strictEqual(result.backend, 'workflow');
assert.match(result.script, /agent\("normal plan", \{ agentType: "gsd-executor", isolation: "worktree" \}\)/);
assert.match(result.script, /agent\("normal plan", \{ agentType: "msd-executor", isolation: "worktree" \}\)/);
// #2686: the options object legitimately gained an optional `model` key, so assert
// the invariant this test exists to protect — agentType present, isolation absent —
// rather than a frozen literal that any future additive key would break.
assert.match(result.script, /agent\("submodule plan", \{ agentType: "gsd-executor"[^}]*\}\)/);
assert.match(result.script, /agent\("submodule plan", \{ agentType: "msd-executor"[^}]*\}\)/);
assert.ok(
!/agent\("submodule plan"[^)]*isolation/.test(result.script),
'the submodule-touching plan must NEVER be emitted with forced worktree isolation',
@@ -1642,7 +1642,7 @@ describe('F. Workflow backend never forces worktree isolation on a submodule / u
const wavesPath = path.join(tmp, 'waves.json');
fs.writeFileSync(wavesPath, JSON.stringify({ waves: waveWithSubmodulePlan().waves }));
const res = runGsdTools([
const res = runMsdTools([
'claude-orchestration', 'resolve-wave-dispatch',
'--waves', wavesPath,
'--run-id', 'run-2285-submodule',
@@ -1655,7 +1655,7 @@ describe('F. Workflow backend never forces worktree isolation on a submodule / u
const parsed = JSON.parse(res.output);
assert.strictEqual(parsed.backend, 'workflow');
// #2686: additive `model` key — see the note on the pure-seam test above.
assert.match(parsed.script, /agent\("submodule plan", \{ agentType: "gsd-executor"[^}]*\}\)/);
assert.match(parsed.script, /agent\("submodule plan", \{ agentType: "msd-executor"[^}]*\}\)/);
assert.ok(!/agent\("submodule plan"[^)]*isolation/.test(parsed.script));
});
@@ -1692,7 +1692,7 @@ describe('G. missing top-level `waves` key never silently exits 0 with no output
const wavesPath = path.join(tmp, 'waves.json');
fs.writeFileSync(wavesPath, JSON.stringify({ notwaves: [] }));
const res = runGsdTools([
const res = runMsdTools([
'claude-orchestration', 'resolve-wave-dispatch',
'--waves', wavesPath, '--run-id', 'run-x',
'--runtime', 'claude', '--agent-sdk-version', ABOVE_FLOOR_SDK,
@@ -1720,8 +1720,8 @@ describe('G. missing top-level `waves` key never silently exits 0 with no output
'--runtime', 'claude', '--agent-sdk-version', ABOVE_FLOOR_SDK,
'--raw',
];
const missingRes = runGsdTools(argsFor(missingKeyPath), tmp);
const nullRes = runGsdTools(argsFor(nullWavesPath), tmp);
const missingRes = runMsdTools(argsFor(missingKeyPath), tmp);
const nullRes = runMsdTools(argsFor(nullWavesPath), tmp);
assert.strictEqual(missingRes.success, true);
assert.strictEqual(nullRes.success, true);
assert.deepStrictEqual(JSON.parse(missingRes.output), JSON.parse(nullRes.output), 'a missing `waves` key must behave identically to an explicit `waves: null`');
@@ -1733,7 +1733,7 @@ describe('G. missing top-level `waves` key never silently exits 0 with no output
const wavesPath = path.join(tmp, 'waves.json');
fs.writeFileSync(wavesPath, JSON.stringify({ notwaves: [] }));
const res = runGsdTools([
const res = runMsdTools([
'claude-orchestration', 'emit-workflow',
'--waves', wavesPath, '--run-id', 'run-x',
], tmp);
@@ -1749,7 +1749,7 @@ describe('G. missing top-level `waves` key never silently exits 0 with no output
const wavesPath = path.join(tmp, 'waves.json');
fs.writeFileSync(wavesPath, 'not json at all');
const res = runGsdTools([
const res = runMsdTools([
'claude-orchestration', 'resolve-wave-dispatch',
'--waves', wavesPath, '--run-id', 'run-x', '--raw',
], tmp);
@@ -1837,14 +1837,14 @@ describe('I. docs/explanation/claude-orchestration-capability.md reflects the #4
//
// 5. nothing resolved the Agent SDK version, so gate 5 returned
// `agent_sdk_version_unknown` on every automated run
// 6. the runtime fallback was `--runtime > GSD_RUNTIME > 'unknown'`, diverging
// from the canonical `GSD_RUNTIME > config.runtime > 'claude'`, so any
// 6. the runtime fallback was `--runtime > MSD_RUNTIME > 'unknown'`, diverging
// from the canonical `MSD_RUNTIME > config.runtime > 'claude'`, so any
// invocation without --runtime reported `runtime_not_claude`
//
// The script assertions parse the emitted text as a real ES module rather than
// pattern-matching it, so a syntactically invalid script fails outright.
const TOOLS_2590 = path.join(ROOT, 'gsd-core', 'bin', 'gsd-tools.cjs');
const TOOLS_2590 = path.join(ROOT, 'msd-core', 'bin', 'msd-tools.cjs');
function emit(overrides) {
const input = Object.assign({
@@ -1883,14 +1883,14 @@ describe('#2590: emitted Workflow scripts satisfy the Workflow tool contract', (
});
// .mjs so node parses it in module context, inside a helper temp dir so
// cleanup() carries the Windows-EBUSY retry budget.
const dir = createTempDir('gsd-2590-parse-');
const dir = createTempDir('msd-2590-parse-');
t.after(() => cleanup(dir));
const f = path.join(dir, 'emitted.mjs');
fs.writeFileSync(
f,
'const gsdWorkflowScript = async () => {\n'
'const msdWorkflowScript = async () => {\n'
+ script.replace(/^export /m, '')
+ '\n};\nexport const __parsed = gsdWorkflowScript;\n',
+ '\n};\nexport const __parsed = msdWorkflowScript;\n',
);
const result = runNode(['--check', f], { timeoutMs: PROBE_TIMEOUT_MS });
throwIfFailed(result, `node --check ${f} (emitted script must parse in the tool's async-body context)`);
@@ -2004,14 +2004,14 @@ describe('#2590: emitted Workflow scripts satisfy the Workflow tool contract', (
{ id: 'b', brief: 'noiso', files_modified: ['b.ts'], use_worktree: false },
] }],
});
assert.match(script, /agent\("iso", \{ agentType: "gsd-executor", isolation: "worktree" \}\)/);
assert.match(script, /agent\("noiso", \{ agentType: "gsd-executor" \}\)/);
assert.match(script, /agent\("iso", \{ agentType: "msd-executor", isolation: "worktree" \}\)/);
assert.match(script, /agent\("noiso", \{ agentType: "msd-executor" \}\)/);
});
});
describe('#2590: the backend is reachable without hand-passed flags', () => {
function repro() {
const dir = createTempDir('gsd-2590-repro-');
const dir = createTempDir('msd-2590-repro-');
fs.mkdirSync(path.join(dir, '.planning'), { recursive: true });
fs.writeFileSync(
path.join(dir, '.planning', 'config.json'),
@@ -2031,7 +2031,7 @@ describe('#2590: the backend is reachable without hand-passed flags', () => {
'--phase-dir', '.planning/phases/01', '--raw',
...(extraArgs || []),
], { cwd: dir, timeoutMs: PROBE_TIMEOUT_MS });
throwIfFailed(result, 'gsd-tools claude-orchestration resolve-wave-dispatch');
throwIfFailed(result, 'msd-tools claude-orchestration resolve-wave-dispatch');
return JSON.parse(result.stdout);
}
@@ -2067,15 +2067,15 @@ describe('#2590: the backend is reachable without hand-passed flags', () => {
assert.equal(r.reason, 'agent_sdk_version_below_floor');
});
test('GSD_AGENT_SDK_VERSION is honored between the flag and the installed version', (t) => {
test('MSD_AGENT_SDK_VERSION is honored between the flag and the installed version', (t) => {
const dir = repro();
t.after(() => cleanup(dir));
const result = runNode([
TOOLS_2590, 'claude-orchestration', 'resolve-wave-dispatch',
'--waves', 'waves.json', '--run-id', 'execute-1',
'--phase-dir', '.planning/phases/01', '--raw',
], { cwd: dir, env: { ...process.env, GSD_AGENT_SDK_VERSION: '0.3.149' }, timeoutMs: PROBE_TIMEOUT_MS });
throwIfFailed(result, 'gsd-tools claude-orchestration resolve-wave-dispatch (GSD_AGENT_SDK_VERSION)');
], { cwd: dir, env: { ...process.env, MSD_AGENT_SDK_VERSION: '0.3.149' }, timeoutMs: PROBE_TIMEOUT_MS });
throwIfFailed(result, 'msd-tools claude-orchestration resolve-wave-dispatch (MSD_AGENT_SDK_VERSION)');
assert.equal(JSON.parse(result.stdout).backend, 'workflow');
});
});