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:
@@ -2,7 +2,7 @@
|
||||
* Stale-bake guard tests (#1688, follow-up to #1650).
|
||||
*
|
||||
* Regression contract: on a static-frontmatter runtime (codex/opencode/kilo), if
|
||||
* `.planning/config.json` or `~/.gsd/defaults.json` was edited AFTER the
|
||||
* `.planning/config.json` or `~/.msd/defaults.json` was edited AFTER the
|
||||
* installed agent files were baked, `warnIfStaleBake` MUST emit a single
|
||||
* stderr warning naming the config path and the remediation command. Before
|
||||
* this module existed, the same condition was silent — the sub-agent would
|
||||
@@ -30,7 +30,7 @@ const {
|
||||
resolveAgentDir,
|
||||
warnIfStaleBake,
|
||||
_resetWarnedForTests,
|
||||
} = require('../gsd-core/bin/lib/stale-bake-guard.cjs');
|
||||
} = require('../msd-core/bin/lib/stale-bake-guard.cjs');
|
||||
const { cleanup } = require('./helpers.cjs');
|
||||
|
||||
const REPO_ROOT = path.join(__dirname, '..');
|
||||
@@ -102,7 +102,7 @@ describe('stale-bake-guard.formatStaleBakeWarning (pure formatter)', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('opencode warning includes path, ISO date, runtime name, --opencode flag, and gsd update', () => {
|
||||
test('opencode warning includes path, ISO date, runtime name, --opencode flag, and msd update', () => {
|
||||
const w = formatStaleBakeWarning({
|
||||
runtime: 'opencode',
|
||||
configPath: '/home/u/proj/.planning/config.json',
|
||||
@@ -112,19 +112,19 @@ describe('stale-bake-guard.formatStaleBakeWarning (pure formatter)', () => {
|
||||
assert.match(w, /\/home\/u\/proj\/\.planning\/config\.json/);
|
||||
assert.match(w, /2023-11-14T22:13:20\.000Z/); // ISO rendering of the config mtime
|
||||
assert.match(w, /'opencode'/);
|
||||
assert.match(w, /gsd install --opencode/);
|
||||
assert.match(w, /gsd update/);
|
||||
assert.match(w, /msd install --opencode/);
|
||||
assert.match(w, /msd update/);
|
||||
});
|
||||
|
||||
test('codex warning uses --codex flag (not --opencode)', () => {
|
||||
const w = formatStaleBakeWarning({ runtime: 'codex', configPath: '/x', configMtimeMs: 1_700_000_000_000, agentMtimeMs: 1 });
|
||||
assert.match(w, /gsd install --codex/);
|
||||
assert.match(w, /msd install --codex/);
|
||||
assert.doesNotMatch(w, /--opencode/);
|
||||
});
|
||||
|
||||
test('kilo warning uses --kilo flag (not --opencode/--codex) (#2093)', () => {
|
||||
const w = formatStaleBakeWarning({ runtime: 'kilo', configPath: '/x', configMtimeMs: 1_700_000_000_000, agentMtimeMs: 1 });
|
||||
assert.match(w, /gsd install --kilo/);
|
||||
assert.match(w, /msd install --kilo/);
|
||||
assert.doesNotMatch(w, /--opencode/);
|
||||
assert.doesNotMatch(w, /--codex\b/);
|
||||
});
|
||||
@@ -196,7 +196,7 @@ describe('stale-bake-guard.warnIfStaleBake (orchestrator, fixtures)', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
_resetWarnedForTests();
|
||||
tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-stalebake-'));
|
||||
tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-stalebake-'));
|
||||
chunks = [];
|
||||
stderrStub = { write: (s) => { chunks.push(String(s)); } };
|
||||
});
|
||||
@@ -210,7 +210,7 @@ describe('stale-bake-guard.warnIfStaleBake (orchestrator, fixtures)', () => {
|
||||
fs.utimesSync(p, t, t);
|
||||
}
|
||||
|
||||
function setupProject({ runtime, configMtime, agentDir, agentMtime, agentFiles = ['gsd-executor.md'] }) {
|
||||
function setupProject({ runtime, configMtime, agentDir, agentMtime, agentFiles = ['msd-executor.md'] }) {
|
||||
fs.mkdirSync(path.join(tmpRoot, '.planning'), { recursive: true });
|
||||
const cfgPath = path.join(tmpRoot, '.planning', 'config.json');
|
||||
fs.writeFileSync(cfgPath, JSON.stringify({ runtime }));
|
||||
@@ -259,16 +259,16 @@ describe('stale-bake-guard.warnIfStaleBake (orchestrator, fixtures)', () => {
|
||||
assert.equal(chunks.length, 1);
|
||||
assert.match(chunks[0], /model config in .*config\.json changed since agents were last baked/);
|
||||
assert.match(chunks[0], /'opencode'/);
|
||||
assert.match(chunks[0], /gsd install --opencode/);
|
||||
assert.match(chunks[0], /msd install --opencode/);
|
||||
});
|
||||
|
||||
test('codex: config NEWER than agents → warning written with --codex flag', () => {
|
||||
const agentParent = path.join(tmpRoot, 'cx-home');
|
||||
const agentDir = path.join(agentParent, 'agents');
|
||||
setupProject({ runtime: 'codex', configMtime: NEWER, agentDir, agentMtime: OLDER, agentFiles: ['gsd-executor.toml'] });
|
||||
setupProject({ runtime: 'codex', configMtime: NEWER, agentDir, agentMtime: OLDER, agentFiles: ['msd-executor.toml'] });
|
||||
const wrote = warnIfStaleBake(tmpRoot, { stderr: stderrStub, homedir: () => tmpRoot, env: cxEnv(agentParent) });
|
||||
assert.equal(wrote, true);
|
||||
assert.match(chunks[0], /gsd install --codex/);
|
||||
assert.match(chunks[0], /msd install --codex/);
|
||||
});
|
||||
|
||||
// #2093: kilo bakes model: like opencode (same static-frontmatter constraint).
|
||||
@@ -281,7 +281,7 @@ describe('stale-bake-guard.warnIfStaleBake (orchestrator, fixtures)', () => {
|
||||
assert.equal(chunks.length, 1);
|
||||
assert.match(chunks[0], /model config in .*config\.json changed since agents were last baked/);
|
||||
assert.match(chunks[0], /'kilo'/);
|
||||
assert.match(chunks[0], /gsd install --kilo/);
|
||||
assert.match(chunks[0], /msd install --kilo/);
|
||||
});
|
||||
|
||||
test('kilo: config OLDER than agents → no warning (boundary limit-1)', () => {
|
||||
@@ -321,7 +321,7 @@ describe('stale-bake-guard.warnIfStaleBake (orchestrator, fixtures)', () => {
|
||||
assert.deepEqual(chunks, []);
|
||||
});
|
||||
|
||||
test('opencode: agent dir present but no gsd-* files → no warning', () => {
|
||||
test('opencode: agent dir present but no msd-* files → no warning', () => {
|
||||
const agentParent = path.join(tmpRoot, 'oc-config');
|
||||
const agentDir = path.join(agentParent, 'agents');
|
||||
setupProject({ runtime: 'opencode', configMtime: NEWER, agentDir, agentMtime: OLDER, agentFiles: ['some-other-agent.md'] });
|
||||
@@ -341,20 +341,20 @@ describe('stale-bake-guard.warnIfStaleBake (orchestrator, fixtures)', () => {
|
||||
assert.equal(chunks.length, 1);
|
||||
});
|
||||
|
||||
test('global ~/.gsd/defaults.json (in tmp homedir) NEWER than agents → warning', () => {
|
||||
test('global ~/.msd/defaults.json (in tmp homedir) NEWER than agents → warning', () => {
|
||||
const agentParent = path.join(tmpRoot, 'oc-config');
|
||||
const agentDir = path.join(agentParent, 'agents');
|
||||
fs.mkdirSync(agentDir, { recursive: true });
|
||||
const ap = path.join(agentDir, 'gsd-executor.md');
|
||||
const ap = path.join(agentDir, 'msd-executor.md');
|
||||
fs.writeFileSync(ap, '---\n---\n');
|
||||
setMtime(ap, OLDER);
|
||||
// project config older than agents, but GLOBAL config newer → warning
|
||||
fs.mkdirSync(path.join(tmpRoot, '.planning'), { recursive: true });
|
||||
fs.writeFileSync(path.join(tmpRoot, '.planning', 'config.json'), JSON.stringify({ runtime: 'opencode' }));
|
||||
setMtime(path.join(tmpRoot, '.planning', 'config.json'), OLDER - 1000);
|
||||
fs.mkdirSync(path.join(tmpRoot, '.gsd'), { recursive: true });
|
||||
fs.writeFileSync(path.join(tmpRoot, '.gsd', 'defaults.json'), JSON.stringify({}));
|
||||
setMtime(path.join(tmpRoot, '.gsd', 'defaults.json'), NEWER);
|
||||
fs.mkdirSync(path.join(tmpRoot, '.msd'), { recursive: true });
|
||||
fs.writeFileSync(path.join(tmpRoot, '.msd', 'defaults.json'), JSON.stringify({}));
|
||||
setMtime(path.join(tmpRoot, '.msd', 'defaults.json'), NEWER);
|
||||
const wrote = warnIfStaleBake(tmpRoot, { stderr: stderrStub, homedir: () => tmpRoot, env: ocEnv(agentParent) });
|
||||
assert.equal(wrote, true);
|
||||
assert.match(chunks[0], /defaults\.json/);
|
||||
@@ -434,7 +434,7 @@ describe('stale-bake-guard parity with bin/install.js bake paths', () => {
|
||||
});
|
||||
|
||||
test('opencode converter bakes a model: line when modelOverride is provided', () => {
|
||||
const sample = '---\nname: gsd-executor\ndescription: x\nmodel: sonnet\ntools: Read\n---\nbody\n';
|
||||
const sample = '---\nname: msd-executor\ndescription: x\nmodel: sonnet\ntools: Read\n---\nbody\n';
|
||||
const out = install.convertClaudeToOpencodeFrontmatter(sample, { isAgent: true, modelOverride: 'opencode-go/deepseek-v4-flash' });
|
||||
assert.ok(
|
||||
typeof out === 'string' && out.includes('model: opencode-go/deepseek-v4-flash'),
|
||||
@@ -444,7 +444,7 @@ describe('stale-bake-guard parity with bin/install.js bake paths', () => {
|
||||
|
||||
// #2093: kilo bakes model: the same way opencode does (same static-frontmatter constraint).
|
||||
test('kilo converter bakes a model: line when modelOverride is provided', () => {
|
||||
const sample = '---\nname: gsd-executor\ndescription: x\nmodel: sonnet\ntools: Read\n---\nbody\n';
|
||||
const sample = '---\nname: msd-executor\ndescription: x\nmodel: sonnet\ntools: Read\n---\nbody\n';
|
||||
const out = install.convertClaudeToKiloFrontmatter(sample, { isAgent: true, modelOverride: 'anthropic/claude-sonnet-5' });
|
||||
assert.ok(
|
||||
typeof out === 'string' && out.includes('model: anthropic/claude-sonnet-5'),
|
||||
@@ -453,34 +453,34 @@ describe('stale-bake-guard parity with bin/install.js bake paths', () => {
|
||||
});
|
||||
|
||||
test('kilo converter omits model: when no override (stale-bake fallback shape)', () => {
|
||||
const sample = '---\nname: gsd-executor\ndescription: x\nmodel: sonnet\ntools: Read\n---\nbody\n';
|
||||
const sample = '---\nname: msd-executor\ndescription: x\nmodel: sonnet\ntools: Read\n---\nbody\n';
|
||||
const out = install.convertClaudeToKiloFrontmatter(sample, { isAgent: true });
|
||||
assert.ok(typeof out === 'string', 'converter must return a string');
|
||||
assert.doesNotMatch(out, /^model:/m, 'no-override path should not emit a model: line');
|
||||
});
|
||||
|
||||
test('opencode converter omits model: when no override (stale-bake fallback shape)', () => {
|
||||
const sample = '---\nname: gsd-executor\ndescription: x\nmodel: sonnet\ntools: Read\n---\nbody\n';
|
||||
const sample = '---\nname: msd-executor\ndescription: x\nmodel: sonnet\ntools: Read\n---\nbody\n';
|
||||
const out = install.convertClaudeToOpencodeFrontmatter(sample, { isAgent: true });
|
||||
assert.ok(typeof out === 'string', 'converter must return a string');
|
||||
assert.doesNotMatch(out, /^model:/m, 'no-override path should not emit a model: line');
|
||||
});
|
||||
|
||||
test('readGsdEffectiveModelOverrides resolves codex + opencode overrides from .planning/config.json', () => {
|
||||
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-parity-'));
|
||||
// #2152: sandbox HOME so the real ~/.gsd/defaults.json cannot bleed its global
|
||||
test('readMsdEffectiveModelOverrides resolves codex + opencode overrides from .planning/config.json', () => {
|
||||
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-parity-'));
|
||||
// #2152: sandbox HOME so the real ~/.msd/defaults.json cannot bleed its global
|
||||
// model_overrides into this project-only assertion (hermeticity). Mirrors the
|
||||
// sibling subtests that pass a homedir option to warnIfStaleBake.
|
||||
const sandboxHome = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-parity-home-'));
|
||||
const sandboxHome = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-parity-home-'));
|
||||
try {
|
||||
fs.mkdirSync(path.join(tmp, '.planning'), { recursive: true });
|
||||
fs.writeFileSync(
|
||||
path.join(tmp, '.planning', 'config.json'),
|
||||
JSON.stringify({ model_overrides: { 'gsd-executor': 'opencode-go/flash', 'gsd-planner': 'openai/gpt-5' } }),
|
||||
JSON.stringify({ model_overrides: { 'msd-executor': 'opencode-go/flash', 'msd-planner': 'openai/gpt-5' } }),
|
||||
);
|
||||
const { readGsdEffectiveModelOverrides } = require(path.join(REPO_ROOT, 'gsd-core', 'bin', 'lib', 'install-model-override-resolver.cjs'));
|
||||
const resolved = readGsdEffectiveModelOverrides(tmp, { homedir: () => sandboxHome });
|
||||
assert.deepEqual(resolved, { 'gsd-executor': 'opencode-go/flash', 'gsd-planner': 'openai/gpt-5' });
|
||||
const { readMsdEffectiveModelOverrides } = require(path.join(REPO_ROOT, 'msd-core', 'bin', 'lib', 'install-model-override-resolver.cjs'));
|
||||
const resolved = readMsdEffectiveModelOverrides(tmp, { homedir: () => sandboxHome });
|
||||
assert.deepEqual(resolved, { 'msd-executor': 'opencode-go/flash', 'msd-planner': 'openai/gpt-5' });
|
||||
} finally {
|
||||
cleanup(tmp);
|
||||
cleanup(sandboxHome);
|
||||
|
||||
Reference in New Issue
Block a user