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:
@@ -4,7 +4,7 @@
|
||||
* Unit tests for host-integration.cjs (ADR-1239 Phase A).
|
||||
* Pure, additive, no-I/O module — no temp dirs needed.
|
||||
* Uses node:test + node:assert/strict.
|
||||
* Requires the COMPILED artifact: ../gsd-core/bin/lib/host-integration.cjs
|
||||
* Requires the COMPILED artifact: ../msd-core/bin/lib/host-integration.cjs
|
||||
*/
|
||||
|
||||
const { describe, test } = require('node:test');
|
||||
@@ -13,7 +13,7 @@ const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const fc = require('fast-check');
|
||||
|
||||
const hi = require('../gsd-core/bin/lib/host-integration.cjs');
|
||||
const hi = require('../msd-core/bin/lib/host-integration.cjs');
|
||||
const {
|
||||
PROTOCOL_VERSION,
|
||||
HOST_INTEGRATION_AXES,
|
||||
@@ -34,9 +34,9 @@ const {
|
||||
const {
|
||||
_HOST_INTEGRATION_VOCAB,
|
||||
validateCapability,
|
||||
} = require('../gsd-core/bin/lib/capability-validator.cjs');
|
||||
} = require('../msd-core/bin/lib/capability-validator.cjs');
|
||||
const { cleanup, readFileNormalized } = require('./helpers.cjs');
|
||||
const { scanFencedBlocks } = require('../gsd-core/bin/lib/markdown-sectionizer.cjs');
|
||||
const { scanFencedBlocks } = require('../msd-core/bin/lib/markdown-sectionizer.cjs');
|
||||
|
||||
const REPO_ROOT = path.resolve(__dirname, '..');
|
||||
|
||||
@@ -1500,7 +1500,7 @@ describe('#3673 dispatch.maxConcurrency — validator', () => {
|
||||
}
|
||||
|
||||
test('every shipped runtime descriptor with a maxConcurrency value passes validateCapability', () => {
|
||||
const registry = require('../gsd-core/bin/lib/capability-registry.cjs');
|
||||
const registry = require('../msd-core/bin/lib/capability-registry.cjs');
|
||||
for (const [id, cap] of Object.entries(registry.runtimes)) {
|
||||
const mc = cap && cap.runtime && cap.runtime.hostIntegration && cap.runtime.hostIntegration.dispatch
|
||||
&& cap.runtime.hostIntegration.dispatch.maxConcurrency;
|
||||
@@ -1559,7 +1559,7 @@ describe('#2584 dispatch.isolation — validator', () => {
|
||||
});
|
||||
|
||||
test('every shipped runtime descriptor with an isolation value passes validateCapability', () => {
|
||||
const registry = require('../gsd-core/bin/lib/capability-registry.cjs');
|
||||
const registry = require('../msd-core/bin/lib/capability-registry.cjs');
|
||||
for (const [id, cap] of Object.entries(registry.runtimes)) {
|
||||
const iso = cap && cap.runtime && cap.runtime.hostIntegration && cap.runtime.hostIntegration.dispatch
|
||||
&& cap.runtime.hostIntegration.dispatch.isolation;
|
||||
@@ -2096,7 +2096,7 @@ describe('#2584 orchestratorExec — validator', () => {
|
||||
// `resolveOrchestratorExec` currently takes NO `model` argument at all, so
|
||||
// codex's argv never carries `--model` regardless of any configured
|
||||
// model_overrides. THESE TESTS ARE FAILING-FIRST against today's code — do
|
||||
// not "fix" resolveOrchestratorExec or gsd-tools.cjs to make them pass here;
|
||||
// not "fix" resolveOrchestratorExec or msd-tools.cjs to make them pass here;
|
||||
// that is a separate change. See issue #3714.
|
||||
//
|
||||
// THE FIX THIS PINS (not yet implemented):
|
||||
@@ -2110,8 +2110,8 @@ describe('#2584 orchestratorExec — validator', () => {
|
||||
// 'unsafe_leading_dash_model' exactly like the existing
|
||||
// unsafe_leading_dash_prompt / unsafe_leading_dash_cwd guards.
|
||||
// 3. Policy (which model, if any, to pass) lives at the CALLER
|
||||
// (bin/gsd-tools.cjs), via:
|
||||
// resolveAgentModelOverride('gsd-executor', readGsdEffectiveModelOverrides(cwd), null)
|
||||
// (bin/msd-tools.cjs), via:
|
||||
// resolveAgentModelOverride('msd-executor', readMsdEffectiveModelOverrides(cwd), null)
|
||||
// then dropping the 'inherit' sentinel. Passing null as the runtime
|
||||
// resolver is what makes "no tier routing" structural (ADR-2313) — the
|
||||
// seam itself decides no policy.
|
||||
@@ -2291,9 +2291,9 @@ describe('#3714 resolveOrchestratorExec — modelFlag/model seam (mechanical, RE
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// #3714 — end-to-end policy: the caller (bin/gsd-tools.cjs) decides WHETHER
|
||||
// #3714 — end-to-end policy: the caller (bin/msd-tools.cjs) decides WHETHER
|
||||
// to pass a model at all, via
|
||||
// resolveAgentModelOverride('gsd-executor', readGsdEffectiveModelOverrides(cwd), null)
|
||||
// resolveAgentModelOverride('msd-executor', readMsdEffectiveModelOverrides(cwd), null)
|
||||
// then dropping the 'inherit' sentinel. Every row below is a MEASURED FACT
|
||||
// (verified by direct execution against this repo's current code) about what
|
||||
// that function returns for a given .planning/config.json shape — these
|
||||
@@ -2308,7 +2308,7 @@ describe('#3714 dispatch-isolation CLI — model policy end-to-end (RED pre-fix
|
||||
const { PROBE_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
|
||||
const { createTempProject, cleanup, TEST_HOME_SANDBOX_MARKER } = require('./helpers.cjs');
|
||||
const os = require('node:os');
|
||||
const GSD_TOOLS = path.join(REPO_ROOT, 'gsd-core', 'bin', 'gsd-tools.cjs');
|
||||
const MSD_TOOLS = path.join(REPO_ROOT, 'msd-core', 'bin', 'msd-tools.cjs');
|
||||
|
||||
function writeConfig(projectDir, config) {
|
||||
fs.writeFileSync(
|
||||
@@ -2320,7 +2320,7 @@ describe('#3714 dispatch-isolation CLI — model policy end-to-end (RED pre-fix
|
||||
// Hermeticity: `queryCodexJson` used to inherit the DEVELOPER's real
|
||||
// HOME/USERPROFILE with no override, so any row that writes no
|
||||
// `model_overrides` key at all was silently reading (and could red
|
||||
// against) the operator's own ~/.gsd/defaults.json — exactly the surface
|
||||
// against) the operator's own ~/.msd/defaults.json — exactly the surface
|
||||
// the BLOCKER regression test below needs to control precisely. Every
|
||||
// call now gets a fresh, per-call temp HOME (removed synchronously after
|
||||
// the CLI returns, since the call is a blocking spawn). USERPROFILE is
|
||||
@@ -2329,19 +2329,19 @@ describe('#3714 dispatch-isolation CLI — model policy end-to-end (RED pre-fix
|
||||
// satisfies the same passwd-less-host fallback installSpawnEnv documents.
|
||||
// `beforeSpawn`, when provided, is called with the sandbox HOME dir path
|
||||
// BEFORE the CLI spawns — the seam a caller needs to seed a GLOBAL
|
||||
// ~/.gsd/defaults.json (see writeGlobalDefaults below) for a
|
||||
// ~/.msd/defaults.json (see writeGlobalDefaults below) for a
|
||||
// global-only-pin row.
|
||||
function queryCodexJson(projectDir, extraEnv = {}, beforeSpawn = null) {
|
||||
const sandboxHomeDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-3714-home-'));
|
||||
const sandboxHomeDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-3714-home-'));
|
||||
try {
|
||||
if (typeof beforeSpawn === 'function') beforeSpawn(sandboxHomeDir);
|
||||
const r = runNode(
|
||||
[GSD_TOOLS, 'query', 'dispatch-isolation', '--json', '--cwd-target', '/tmp/wt', '--prompt', 'do the thing'],
|
||||
[MSD_TOOLS, 'query', 'dispatch-isolation', '--json', '--cwd-target', '/tmp/wt', '--prompt', 'do the thing'],
|
||||
{
|
||||
cwd: projectDir,
|
||||
env: {
|
||||
...process.env,
|
||||
GSD_RUNTIME: 'codex',
|
||||
MSD_RUNTIME: 'codex',
|
||||
HOME: sandboxHomeDir,
|
||||
USERPROFILE: sandboxHomeDir,
|
||||
[TEST_HOME_SANDBOX_MARKER]: sandboxHomeDir,
|
||||
@@ -2350,32 +2350,32 @@ describe('#3714 dispatch-isolation CLI — model policy end-to-end (RED pre-fix
|
||||
timeoutMs: PROBE_TIMEOUT_MS,
|
||||
},
|
||||
);
|
||||
throwIfFailed(r, 'gsd-tools query dispatch-isolation --json (codex, model policy)');
|
||||
throwIfFailed(r, 'msd-tools query dispatch-isolation --json (codex, model policy)');
|
||||
return { json: JSON.parse(r.stdout), stderr: r.stderr };
|
||||
} finally {
|
||||
cleanup(sandboxHomeDir);
|
||||
}
|
||||
}
|
||||
|
||||
// Writes ~/.gsd/defaults.json (the GLOBAL model_overrides store) into the
|
||||
// Writes ~/.msd/defaults.json (the GLOBAL model_overrides store) into the
|
||||
// per-call sandbox HOME so a test can exercise "global-only pin, no
|
||||
// per-project override" — the exact shape the BLOCKER describes.
|
||||
function writeGlobalDefaults(homeDir, defaults) {
|
||||
const gsdDir = path.join(homeDir, '.gsd');
|
||||
fs.mkdirSync(gsdDir, { recursive: true });
|
||||
fs.writeFileSync(path.join(gsdDir, 'defaults.json'), JSON.stringify(defaults));
|
||||
const msdDir = path.join(homeDir, '.msd');
|
||||
fs.mkdirSync(msdDir, { recursive: true });
|
||||
fs.writeFileSync(path.join(msdDir, 'defaults.json'), JSON.stringify(defaults));
|
||||
}
|
||||
|
||||
function hasModelFlag(execArgs) {
|
||||
return execArgs.includes('--model');
|
||||
}
|
||||
|
||||
// MATRIX row 1: an explicit real-Codex gsd-executor override reaches argv
|
||||
// MATRIX row 1: an explicit real-Codex msd-executor override reaches argv
|
||||
// as --model.
|
||||
test('row 1: explicit model_overrides["gsd-executor"] -> exec.args contains ["--model","gpt-5.6-terra"] at the correct position', () => {
|
||||
const dir = createTempProject('gsd-3714-row1-');
|
||||
test('row 1: explicit model_overrides["msd-executor"] -> exec.args contains ["--model","gpt-5.6-terra"] at the correct position', () => {
|
||||
const dir = createTempProject('msd-3714-row1-');
|
||||
try {
|
||||
writeConfig(dir, { model_overrides: { 'gsd-executor': 'gpt-5.6-terra' } });
|
||||
writeConfig(dir, { model_overrides: { 'msd-executor': 'gpt-5.6-terra' } });
|
||||
const { json: result } = queryCodexJson(dir);
|
||||
assert.equal(result.isolation, 'orchestrator-worktree');
|
||||
assert.deepEqual(result.exec.args, ['exec', '--model', 'gpt-5.6-terra', '--cd', '/tmp/wt', 'do the thing']);
|
||||
@@ -2388,7 +2388,7 @@ describe('#3714 dispatch-isolation CLI — model policy end-to-end (RED pre-fix
|
||||
// particular the resolve-model tier value ("sonnet") must NEVER leak onto
|
||||
// codex's argv (that is the #2310/#2311 400 ADR-2313 exists to prevent).
|
||||
test('row 2 CONTROL: no override -> exec.args contains NO --model and no "sonnet" anywhere', () => {
|
||||
const dir = createTempProject('gsd-3714-row2-');
|
||||
const dir = createTempProject('msd-3714-row2-');
|
||||
try {
|
||||
writeConfig(dir, {});
|
||||
const { json: result } = queryCodexJson(dir);
|
||||
@@ -2402,10 +2402,10 @@ describe('#3714 dispatch-isolation CLI — model policy end-to-end (RED pre-fix
|
||||
});
|
||||
|
||||
// MATRIX row 3 [CONTROL]: the 'inherit' sentinel must never reach argv.
|
||||
test('row 3 CONTROL: model_overrides["gsd-executor"] === "inherit" -> no --model (sentinel never on the wire)', () => {
|
||||
const dir = createTempProject('gsd-3714-row3-');
|
||||
test('row 3 CONTROL: model_overrides["msd-executor"] === "inherit" -> no --model (sentinel never on the wire)', () => {
|
||||
const dir = createTempProject('msd-3714-row3-');
|
||||
try {
|
||||
writeConfig(dir, { model_overrides: { 'gsd-executor': 'inherit' } });
|
||||
writeConfig(dir, { model_overrides: { 'msd-executor': 'inherit' } });
|
||||
const { json: result } = queryCodexJson(dir);
|
||||
assert.deepEqual(result.exec.args, ['exec', '--cd', '/tmp/wt', 'do the thing']);
|
||||
assert.ok(!hasModelFlag(result.exec.args));
|
||||
@@ -2416,10 +2416,10 @@ describe('#3714 dispatch-isolation CLI — model policy end-to-end (RED pre-fix
|
||||
});
|
||||
|
||||
// MATRIX row 4 [CONTROL]: an empty-string override resolves to null, same as no override.
|
||||
test('row 4 CONTROL: model_overrides["gsd-executor"] === "" -> no --model', () => {
|
||||
const dir = createTempProject('gsd-3714-row4-');
|
||||
test('row 4 CONTROL: model_overrides["msd-executor"] === "" -> no --model', () => {
|
||||
const dir = createTempProject('msd-3714-row4-');
|
||||
try {
|
||||
writeConfig(dir, { model_overrides: { 'gsd-executor': '' } });
|
||||
writeConfig(dir, { model_overrides: { 'msd-executor': '' } });
|
||||
const { json: result } = queryCodexJson(dir);
|
||||
assert.deepEqual(result.exec.args, ['exec', '--cd', '/tmp/wt', 'do the thing']);
|
||||
assert.ok(!hasModelFlag(result.exec.args));
|
||||
@@ -2433,7 +2433,7 @@ describe('#3714 dispatch-isolation CLI — model policy end-to-end (RED pre-fix
|
||||
// tier routing to codex entirely; passing `null` as the runtimeResolver
|
||||
// (per the fix design) is what makes this structural rather than incidental.
|
||||
test('row 5 CONTROL: model_profile:"balanced" only (no per-agent override) -> no --model (tier routing forbidden, ADR-2313)', () => {
|
||||
const dir = createTempProject('gsd-3714-row5-');
|
||||
const dir = createTempProject('msd-3714-row5-');
|
||||
try {
|
||||
writeConfig(dir, { runtime: 'codex', model_profile: 'balanced' });
|
||||
const { json: result } = queryCodexJson(dir);
|
||||
@@ -2445,32 +2445,32 @@ describe('#3714 dispatch-isolation CLI — model policy end-to-end (RED pre-fix
|
||||
}
|
||||
});
|
||||
|
||||
// BLOCKER regression test: a GLOBAL (~/.gsd/defaults.json) Anthropic-flavored
|
||||
// BLOCKER regression test: a GLOBAL (~/.msd/defaults.json) Anthropic-flavored
|
||||
// pin must NOT reach codex's argv, and must produce a stderr warning. Before
|
||||
// this fix, presence-only gating let this straight through to
|
||||
// `codex exec --model sonnet` — the documented #2310/#2311 400.
|
||||
test('BLOCKER: global-only model_overrides["gsd-executor"]="sonnet" -> NO --model, and a stderr warning', () => {
|
||||
const dir = createTempProject('gsd-3714-blocker-global-anthropic-');
|
||||
test('BLOCKER: global-only model_overrides["msd-executor"]="sonnet" -> NO --model, and a stderr warning', () => {
|
||||
const dir = createTempProject('msd-3714-blocker-global-anthropic-');
|
||||
try {
|
||||
writeConfig(dir, {});
|
||||
const { json: result, stderr } = queryCodexJson(dir, {}, (homeDir) => {
|
||||
writeGlobalDefaults(homeDir, { model_overrides: { 'gsd-executor': 'sonnet' } });
|
||||
writeGlobalDefaults(homeDir, { model_overrides: { 'msd-executor': 'sonnet' } });
|
||||
});
|
||||
assert.deepEqual(result.exec.args, ['exec', '--cd', '/tmp/wt', 'do the thing']);
|
||||
assert.ok(!hasModelFlag(result.exec.args));
|
||||
assert.ok(!result.exec.args.join(' ').includes('sonnet'));
|
||||
assert.match(stderr, /gsd-executor.*sonnet.*Anthropic/i);
|
||||
assert.match(stderr, /msd-executor.*sonnet.*Anthropic/i);
|
||||
} finally {
|
||||
cleanup(dir);
|
||||
}
|
||||
});
|
||||
|
||||
test('global-only model_overrides["gsd-executor"]="gpt-5.6-terra" (real Codex pin) -> IS emitted', () => {
|
||||
const dir = createTempProject('gsd-3714-global-real-');
|
||||
test('global-only model_overrides["msd-executor"]="gpt-5.6-terra" (real Codex pin) -> IS emitted', () => {
|
||||
const dir = createTempProject('msd-3714-global-real-');
|
||||
try {
|
||||
writeConfig(dir, {});
|
||||
const { json: result, stderr } = queryCodexJson(dir, {}, (homeDir) => {
|
||||
writeGlobalDefaults(homeDir, { model_overrides: { 'gsd-executor': 'gpt-5.6-terra' } });
|
||||
writeGlobalDefaults(homeDir, { model_overrides: { 'msd-executor': 'gpt-5.6-terra' } });
|
||||
});
|
||||
assert.deepEqual(result.exec.args, ['exec', '--model', 'gpt-5.6-terra', '--cd', '/tmp/wt', 'do the thing']);
|
||||
assert.equal(stderr, '');
|
||||
@@ -2480,9 +2480,9 @@ describe('#3714 dispatch-isolation CLI — model policy end-to-end (RED pre-fix
|
||||
});
|
||||
|
||||
test('whitespace-only override " " -> no --model, no warning', () => {
|
||||
const dir = createTempProject('gsd-3714-ws-');
|
||||
const dir = createTempProject('msd-3714-ws-');
|
||||
try {
|
||||
writeConfig(dir, { model_overrides: { 'gsd-executor': ' ' } });
|
||||
writeConfig(dir, { model_overrides: { 'msd-executor': ' ' } });
|
||||
const { json: result, stderr } = queryCodexJson(dir);
|
||||
assert.deepEqual(result.exec.args, ['exec', '--cd', '/tmp/wt', 'do the thing']);
|
||||
assert.equal(stderr, '');
|
||||
@@ -2493,9 +2493,9 @@ describe('#3714 dispatch-isolation CLI — model policy end-to-end (RED pre-fix
|
||||
|
||||
test('"Inherit" and " inherit " (case/whitespace-insensitive sentinel) -> no --model', () => {
|
||||
for (const value of ['Inherit', ' inherit ']) {
|
||||
const dir = createTempProject('gsd-3714-inherit-ci-');
|
||||
const dir = createTempProject('msd-3714-inherit-ci-');
|
||||
try {
|
||||
writeConfig(dir, { model_overrides: { 'gsd-executor': value } });
|
||||
writeConfig(dir, { model_overrides: { 'msd-executor': value } });
|
||||
const { json: result, stderr } = queryCodexJson(dir);
|
||||
assert.deepEqual(result.exec.args, ['exec', '--cd', '/tmp/wt', 'do the thing'], `value=${JSON.stringify(value)}`);
|
||||
assert.equal(stderr, '');
|
||||
@@ -2514,14 +2514,14 @@ describe('#3714 dispatch-isolation CLI — model policy end-to-end (RED pre-fix
|
||||
'gpt-5 | ||||