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

@@ -10,12 +10,12 @@
* Test-only; no production change. Drives a REAL install through
* `install()` (the same entry point every user hits) and then feeds the
* emitted tree to Phase 2's validator (`checkCodexModelPosture`,
* gsd-core/bin/lib/agent-install-check.cjs). This is the only place in the
* msd-core/bin/lib/agent-install-check.cjs). This is the only place in the
* epic where the emitter (#3241) and the validator (#3242) are exercised
* against the same bytes — every phase before this tested its own half
* against fixtures it authored (#2371).
*
* Row-to-classification map (see .gsd/phase/test-3244-codex-inherit-smoke/
* Row-to-classification map (see .msd/phase/test-3244-codex-inherit-smoke/
* 50-test-matrix.md for the full rationale):
* Row 1, 2, 3 — regression guard (passes today; would have failed pre-#3241)
* Row 4 — regression guard — the unchanged `inherit` control
@@ -33,7 +33,7 @@
* .toml model/effort to the passive posture") against a REAL emitted tree —
* `cmdEffortSync` (src/commands.cts) is driven the same way Phase 3's own
* `tests/commands.test.cjs` (describe('#3243 (ADR-2313 D7): Codex .toml
* effort sync')) drives it: `require('../gsd-core/bin/lib/commands.cjs')`,
* effort sync')) drives it: `require('../msd-core/bin/lib/commands.cjs')`,
* called as `cmdEffortSync(cwd, raw=false, {dryRun, configDir, runtime:
* 'codex'})`, with its `output()` JSON captured off fd 1 (see
* `captureOutput` below — same technique as commands.test.cjs's own helper).
@@ -44,7 +44,7 @@
'use strict';
process.env.GSD_TEST_MODE = '1';
process.env.MSD_TEST_MODE = '1';
const { test, describe, beforeEach, afterEach } = require('node:test');
const assert = require('node:assert/strict');
@@ -53,9 +53,9 @@ const path = require('node:path');
const os = require('node:os');
const { install } = require('../bin/install.js');
const { checkCodexModelPosture } = require('../gsd-core/bin/lib/agent-install-check.cjs');
const { cmdEffortSync } = require('../gsd-core/bin/lib/commands.cjs');
const { parseCodexAgentToml } = require('../gsd-core/bin/lib/codex-agent-toml.cjs');
const { checkCodexModelPosture } = require('../msd-core/bin/lib/agent-install-check.cjs');
const { cmdEffortSync } = require('../msd-core/bin/lib/commands.cjs');
const { parseCodexAgentToml } = require('../msd-core/bin/lib/codex-agent-toml.cjs');
const { cleanup, captureFdSync } = require('./helpers.cjs');
const REPO_ROOT = path.resolve(__dirname, '..');
@@ -69,23 +69,23 @@ function makeTmpDir(prefix) {
* the `runGlobalInstall` helper in tests/install-runtime-artifacts.test.cjs
* (reused pattern, not reused code — that helper is not exported). HOME is
* isolated so install.js code that calls os.homedir() never touches the
* real $HOME, and GSD_SKIP_STALE_SDK_CHECK=1 suppresses the `npm ls -g`
* real $HOME, and MSD_SKIP_STALE_SDK_CHECK=1 suppresses the `npm ls -g`
* subprocess (irrelevant to posture assertions, and a subprocess this test
* does not want to be timeout-bound on).
*/
function runCodexInstall(codexHome) {
const isolatedHome = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-3244-home-'));
const isolatedHome = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-3244-home-'));
const prevCodexHome = process.env.CODEX_HOME;
const prevCwd = process.cwd();
const prevHome = process.env.HOME;
const prevUserProfile = process.env.USERPROFILE;
const prevSkipStale = process.env.GSD_SKIP_STALE_SDK_CHECK;
const prevSkipStale = process.env.MSD_SKIP_STALE_SDK_CHECK;
process.env.CODEX_HOME = codexHome;
process.env.HOME = isolatedHome;
process.env.USERPROFILE = isolatedHome;
process.env.GSD_SKIP_STALE_SDK_CHECK = '1';
process.env.MSD_SKIP_STALE_SDK_CHECK = '1';
process.chdir(REPO_ROOT);
try {
@@ -98,8 +98,8 @@ function runCodexInstall(codexHome) {
else process.env.HOME = prevHome;
if (prevUserProfile === undefined) delete process.env.USERPROFILE;
else process.env.USERPROFILE = prevUserProfile;
if (prevSkipStale === undefined) delete process.env.GSD_SKIP_STALE_SDK_CHECK;
else process.env.GSD_SKIP_STALE_SDK_CHECK = prevSkipStale;
if (prevSkipStale === undefined) delete process.env.MSD_SKIP_STALE_SDK_CHECK;
else process.env.MSD_SKIP_STALE_SDK_CHECK = prevSkipStale;
cleanup(isolatedHome);
}
}
@@ -120,7 +120,7 @@ function readToml(codexHome, agentName) {
* Lines before the `developer_instructions = '''` marker — the header
* region generateCodexAgentToml always emits model/effort/service_tier/etc.
* into (bin/install.js's `lines` array construction). Scoping to this
* region, rather than scanning the whole file, is required: GSD agent
* region, rather than scanning the whole file, is required: MSD agent
* prompts discuss "model" constantly, so a bare substring/whole-file scan
* would false-match prose inside the developer_instructions block. Same
* convention already established in tests/install-runtime-artifacts.test.cjs
@@ -156,19 +156,19 @@ function runEffortSyncDryRun(codexHome) {
}
/**
* Runs `fn()` with `GSD_AGENTS_DIR` set to `dir`, restoring the prior value
* Runs `fn()` with `MSD_AGENTS_DIR` set to `dir`, restoring the prior value
* (or deleting it, if previously unset) in a `finally` inside this helper —
* never inside a test body, per CONTRIBUTING.md's try/finally-in-tests ban.
* Returns `fn`'s result.
*/
function withAgentsDir(dir, fn) {
const prevAgentsDir = process.env.GSD_AGENTS_DIR;
process.env.GSD_AGENTS_DIR = dir;
const prevAgentsDir = process.env.MSD_AGENTS_DIR;
process.env.MSD_AGENTS_DIR = dir;
try {
return fn();
} finally {
if (prevAgentsDir === undefined) delete process.env.GSD_AGENTS_DIR;
else process.env.GSD_AGENTS_DIR = prevAgentsDir;
if (prevAgentsDir === undefined) delete process.env.MSD_AGENTS_DIR;
else process.env.MSD_AGENTS_DIR = prevAgentsDir;
}
}
@@ -180,13 +180,13 @@ function captureStderr() {
restore() { process.stderr.write = original; },
text() { return chunks.join(''); },
noticeLines() {
return chunks.join('').split(/\r?\n/).filter((line) => line.startsWith('gsd: notice — '));
return chunks.join('').split(/\r?\n/).filter((line) => line.startsWith('msd: notice — '));
},
};
}
// ─── Rows 1, 2, 3, 5a, 6, 7: model_profile "balanced" (the default) ─────────
// This is the path that changed. `readGsdRuntimeProfileResolver` resolves a
// This is the path that changed. `readMsdRuntimeProfileResolver` resolves a
// per-tier Codex model for "balanced" (bin/install.js:1666-1682) — under
// Phase 1 (#3241) that resolved model is no longer embedded, only warned
// about via the one-time notice. `model_profile: "inherit"` (row 4, below)
@@ -199,7 +199,7 @@ describe('Row 1/2/3/5a/6/7 — codex install, model_profile: balanced (default),
let stderr;
beforeEach(() => {
tmpDir = makeTmpDir('gsd-3244-balanced-');
tmpDir = makeTmpDir('msd-3244-balanced-');
const projectDir = path.join(tmpDir, 'project');
codexHome = path.join(projectDir, '.codex');
fs.mkdirSync(codexHome, { recursive: true });
@@ -217,7 +217,7 @@ describe('Row 1/2/3/5a/6/7 — codex install, model_profile: balanced (default),
});
test('row 1: researcher/planner/checker .toml carry no model', () => {
for (const agent of ['gsd-phase-researcher', 'gsd-planner', 'gsd-plan-checker']) {
for (const agent of ['msd-phase-researcher', 'msd-planner', 'msd-plan-checker']) {
const header = headerLines(readToml(codexHome, agent));
assert.strictEqual(findKeyLine(header, 'model'), undefined,
`${agent}.toml must not pin a model under the default balanced profile\nheader:\n${header.join('\n')}`);
@@ -225,21 +225,21 @@ describe('Row 1/2/3/5a/6/7 — codex install, model_profile: balanced (default),
});
test('row 2: researcher/planner/checker .toml carry no model_reasoning_effort (#838 coupling)', () => {
for (const agent of ['gsd-phase-researcher', 'gsd-planner', 'gsd-plan-checker']) {
for (const agent of ['msd-phase-researcher', 'msd-planner', 'msd-plan-checker']) {
const header = headerLines(readToml(codexHome, agent));
assert.strictEqual(findKeyLine(header, 'model_reasoning_effort'), undefined,
`${agent}.toml must not emit model_reasoning_effort with no model pinned\nheader:\n${header.join('\n')}`);
}
});
test('row 3: exactly one "gsd: notice — " line on stderr', () => {
test('row 3: exactly one "msd: notice — " line on stderr', () => {
const notices = stderr.noticeLines();
assert.strictEqual(notices.length, 1,
`expected exactly one notice line across the whole install, got ${notices.length}\nstderr:\n${stderr.text()}`);
});
test('row 5a: gsd-planner.toml keeps name/description/sandbox_mode/developer_instructions intact', () => {
const content = readToml(codexHome, 'gsd-planner');
test('row 5a: msd-planner.toml keeps name/description/sandbox_mode/developer_instructions intact', () => {
const content = readToml(codexHome, 'msd-planner');
const header = headerLines(content);
const nameLine = findKeyLine(header, 'name');
const descLine = findKeyLine(header, 'description');
@@ -251,14 +251,14 @@ describe('Row 1/2/3/5a/6/7 — codex install, model_profile: balanced (default),
'developer_instructions block must be present and non-empty');
});
test('row 6: gsd-plan-checker.toml (light tier) still emits service_tier/model_verbosity (#774, decoupled)', () => {
const header = headerLines(readToml(codexHome, 'gsd-plan-checker'));
test('row 6: msd-plan-checker.toml (light tier) still emits service_tier/model_verbosity (#774, decoupled)', () => {
const header = headerLines(readToml(codexHome, 'msd-plan-checker'));
const serviceTierLine = findKeyLine(header, 'service_tier');
const verbosityLine = findKeyLine(header, 'model_verbosity');
assert.match(serviceTierLine || '', /=\s*"flex"$/,
`gsd-plan-checker.toml must still emit service_tier = "flex"\nheader:\n${header.join('\n')}`);
`msd-plan-checker.toml must still emit service_tier = "flex"\nheader:\n${header.join('\n')}`);
assert.match(verbosityLine || '', /=\s*"low"$/,
`gsd-plan-checker.toml must still emit model_verbosity = "low"\nheader:\n${header.join('\n')}`);
`msd-plan-checker.toml must still emit model_verbosity = "low"\nheader:\n${header.join('\n')}`);
});
test('row 7: checkCodexModelPosture reports the freshly-installed tree clean (emit -> validate)', () => {
@@ -266,7 +266,7 @@ describe('Row 1/2/3/5a/6/7 — codex install, model_profile: balanced (default),
assert.strictEqual(result.ok, true,
`Phase 2's validator must report the tree Phase 1's emitter just produced as clean\nviolations:\n${JSON.stringify(result.violations, null, 2)}`);
assert.deepStrictEqual(result.violations, []);
assert.ok(result.checked.includes('gsd-planner'), 'sanity: gsd-planner.toml must have been checked');
assert.ok(result.checked.includes('msd-planner'), 'sanity: msd-planner.toml must have been checked');
});
test('row 8: effort sync (dry-run) reports zero changes on the freshly-installed tree (emit -> repair)', () => {
@@ -281,7 +281,7 @@ describe('Row 1/2/3/5a/6/7 — codex install, model_profile: balanced (default),
});
// ─── Row 4/5b — model_profile "inherit": the unchanged control ─────────────
// readGsdRuntimeProfileResolver returns null for "inherit" (bin/install.js:
// readMsdRuntimeProfileResolver returns null for "inherit" (bin/install.js:
// 1667) — a Codex install under inherit omitted the model before #3241 too.
// This row alone would be vacuous (would pass identically pre/post-epic);
// it exists as the negative control alongside row 1's positive case.
@@ -292,7 +292,7 @@ describe('Row 4/5b — codex install, model_profile: inherit (unchanged control)
let stderr;
beforeEach(() => {
tmpDir = makeTmpDir('gsd-3244-inherit-');
tmpDir = makeTmpDir('msd-3244-inherit-');
const projectDir = path.join(tmpDir, 'project');
codexHome = path.join(projectDir, '.codex');
fs.mkdirSync(codexHome, { recursive: true });
@@ -307,17 +307,17 @@ describe('Row 4/5b — codex install, model_profile: inherit (unchanged control)
});
test('row 4: no model, no effort, and no notice — nothing was lost', () => {
const header = headerLines(readToml(codexHome, 'gsd-planner'));
const header = headerLines(readToml(codexHome, 'msd-planner'));
assert.strictEqual(findKeyLine(header, 'model'), undefined,
'gsd-planner.toml must not pin a model under model_profile: inherit');
'msd-planner.toml must not pin a model under model_profile: inherit');
assert.strictEqual(findKeyLine(header, 'model_reasoning_effort'), undefined,
'gsd-planner.toml must not emit model_reasoning_effort under model_profile: inherit');
'msd-planner.toml must not emit model_reasoning_effort under model_profile: inherit');
assert.strictEqual(stderr.noticeLines().length, 0,
`inherit must never fire the #3241 notice — nothing was lost\nstderr:\n${stderr.text()}`);
});
test('row 5b: gsd-planner.toml keeps name/description/sandbox_mode/developer_instructions intact', () => {
const content = readToml(codexHome, 'gsd-planner');
test('row 5b: msd-planner.toml keeps name/description/sandbox_mode/developer_instructions intact', () => {
const content = readToml(codexHome, 'msd-planner');
const header = headerLines(content);
const nameLine = findKeyLine(header, 'name');
const descLine = findKeyLine(header, 'description');
@@ -332,7 +332,7 @@ describe('Row 4/5b — codex install, model_profile: inherit (unchanged control)
// ─── Row 9/10 — an explicit real-Codex model_overrides pin survives ────────
// model_profile: inherit (nullifying the resolver, per row 4) plus an
// explicit model_overrides pin for gsd-planner only: model_overrides is
// explicit model_overrides pin for msd-planner only: model_overrides is
// checked before, and independently of, the runtime resolver
// (bin/install.js:4220-4237), so the pin embeds regardless of profile, while
// inherit guarantees no OTHER agent's notice fires. This isolates "does an
@@ -346,14 +346,14 @@ describe('Row 9/10 — codex install with an explicit real-Codex model_overrides
const PINNED_MODEL = 'gpt-5.6-sol';
beforeEach(() => {
tmpDir = makeTmpDir('gsd-3244-pinned-');
tmpDir = makeTmpDir('msd-3244-pinned-');
const projectDir = path.join(tmpDir, 'project');
codexHome = path.join(projectDir, '.codex');
fs.mkdirSync(codexHome, { recursive: true });
writeProjectConfig(projectDir, {
runtime: 'codex',
model_profile: 'inherit',
model_overrides: { 'gsd-planner': PINNED_MODEL },
model_overrides: { 'msd-planner': PINNED_MODEL },
});
stderr = captureStderr();
runCodexInstall(codexHome);
@@ -365,12 +365,12 @@ describe('Row 9/10 — codex install with an explicit real-Codex model_overrides
});
test('row 9: the pin is present, its coupled effort is present, and the notice does not fire', () => {
const header = headerLines(readToml(codexHome, 'gsd-planner'));
const header = headerLines(readToml(codexHome, 'msd-planner'));
const modelLine = findKeyLine(header, 'model');
const effortLine = findKeyLine(header, 'model_reasoning_effort');
assert.match(modelLine || '', new RegExp(`=\\s*"${PINNED_MODEL}"$`),
`gsd-planner.toml must pin the explicit real-Codex model\nheader:\n${header.join('\n')}`);
assert.ok(effortLine, `gsd-planner.toml must emit model_reasoning_effort alongside an explicit model pin (#838 coupling)\nheader:\n${header.join('\n')}`);
`msd-planner.toml must pin the explicit real-Codex model\nheader:\n${header.join('\n')}`);
assert.ok(effortLine, `msd-planner.toml must emit model_reasoning_effort alongside an explicit model pin (#838 coupling)\nheader:\n${header.join('\n')}`);
assert.strictEqual(stderr.noticeLines().length, 0,
`an explicit pin must never fire the #3241 "resolver model omitted" notice\nstderr:\n${stderr.text()}`);
});
@@ -383,12 +383,12 @@ describe('Row 9/10 — codex install with an explicit real-Codex model_overrides
});
test('row 11: effort sync (dry-run) reports the pinned agent skipped, not synced, and the file is byte-identical', () => {
const filePath = path.join(codexHome, 'agents', 'gsd-planner.toml');
const filePath = path.join(codexHome, 'agents', 'msd-planner.toml');
const before = fs.readFileSync(filePath, 'utf8');
const result = runEffortSyncDryRun(codexHome);
const plannerChange = result.changes.find((c) => c.agent === 'gsd-planner');
const plannerChange = result.changes.find((c) => c.agent === 'msd-planner');
assert.strictEqual(plannerChange, undefined,
`a legal pin must never be reported as a change\nchanges:\n${JSON.stringify(result.changes, null, 2)}`);
assert.strictEqual(result.synced, 0,