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

@@ -1,9 +1,9 @@
/**
* GSD Agent Installation Validation Tests (#1371)
* MSD Agent Installation Validation Tests (#1371)
*
* Validates that GSD detects missing or incomplete agent installations and
* Validates that MSD detects missing or incomplete agent installations and
* surfaces warnings through init commands and health checks. When agents are
* not installed, Task(subagent_type="gsd-*") silently falls back to
* not installed, Task(subagent_type="msd-*") silently falls back to
* general-purpose, losing specialized instructions.
*/
@@ -13,23 +13,23 @@ const fs = require('fs');
const os = require('os');
const path = require('path');
const { runNode } = require('./helpers/process-seam.cjs');
const { runGsdTools, createTempProject, cleanup } = require('./helpers.cjs');
const { runMsdTools, createTempProject, cleanup } = require('./helpers.cjs');
const { installerEnv } = require('./helpers/install-shared.cjs');
// #3145: class-norm timeout, not a per-suite value — see helpers/timeouts.cjs.
const { INSTALL_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
const AGENTS_DIR_NAME = 'agents';
const MODEL_PROFILES = require('../gsd-core/bin/lib/model-profiles.cjs').MODEL_PROFILES;
const MODEL_PROFILES = require('../msd-core/bin/lib/model-profiles.cjs').MODEL_PROFILES;
const EXPECTED_AGENTS = Object.keys(MODEL_PROFILES);
const ROOT = path.join(__dirname, '..');
const INSTALL_SCRIPT = path.join(ROOT, 'bin', 'install.js');
/**
* Create a fake GSD install directory structure that mirrors what the installer
* produces. gsd-tools.cjs lives at <configDir>/gsd-core/bin/gsd-tools.cjs,
* Create a fake MSD install directory structure that mirrors what the installer
* produces. msd-tools.cjs lives at <configDir>/msd-core/bin/msd-tools.cjs,
* so the agents dir is at <configDir>/agents/.
*
* We use --cwd to point at the project, and GSD_INSTALL_DIR env to override
* We use --cwd to point at the project, and MSD_INSTALL_DIR env to override
* the agents directory location for testing.
*/
function _createAgentsDir(configDir, agentNames = []) {
@@ -55,7 +55,7 @@ function createCompleteCodexAgents(configDir) {
files[`agents/${name}.toml`] = {};
}
fs.writeFileSync(
path.join(configDir, '.codex', 'gsd-file-manifest.json'),
path.join(configDir, '.codex', 'msd-file-manifest.json'),
JSON.stringify({ files }),
);
return agentsDir;
@@ -74,9 +74,9 @@ describe('init commands: agents_installed field (#1371)', () => {
cleanup(tmpDir);
});
// Point the SDK at the repo's agents/ dir (sibling of gsd-core/) via the
// GSD_AGENTS_DIR override. The SDK side of init resolves agents from
// GSD_AGENTS_DIR or the runtime config dir (~/.claude/agents for Claude); it
// Point the SDK at the repo's agents/ dir (sibling of msd-core/) via the
// MSD_AGENTS_DIR override. The SDK side of init resolves agents from
// MSD_AGENTS_DIR or the runtime config dir (~/.claude/agents for Claude); it
// does NOT walk up from cwd like the CJS-era code did. Without this override
// these tests would only pass on a dev machine with ~/.claude/agents/
// populated — which masked the divergence on Linux CI where that path is
@@ -88,21 +88,21 @@ describe('init commands: agents_installed field (#1371)', () => {
const phaseDir = path.join(tmpDir, '.planning', 'phases', '01-setup');
fs.mkdirSync(phaseDir, { recursive: true });
const result = runGsdTools('init execute-phase 1 --raw', tmpDir, { GSD_AGENTS_DIR: REPO_AGENTS_DIR });
const result = runMsdTools('init execute-phase 1 --raw', tmpDir, { MSD_AGENTS_DIR: REPO_AGENTS_DIR });
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
assert.strictEqual(typeof output.agents_installed, 'boolean',
'init execute-phase must include agents_installed field');
assert.strictEqual(output.agents_installed, true,
'agents_installed should be true when GSD_AGENTS_DIR has gsd-*.md files');
'agents_installed should be true when MSD_AGENTS_DIR has msd-*.md files');
});
test('init plan-phase includes agents_installed=true when agents exist', () => {
const phaseDir = path.join(tmpDir, '.planning', 'phases', '01-setup');
fs.mkdirSync(phaseDir, { recursive: true });
const result = runGsdTools('init plan-phase 1 --raw', tmpDir, { GSD_AGENTS_DIR: REPO_AGENTS_DIR });
const result = runMsdTools('init plan-phase 1 --raw', tmpDir, { MSD_AGENTS_DIR: REPO_AGENTS_DIR });
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
@@ -124,7 +124,7 @@ describe('init commands: agents_installed field (#1371)', () => {
const localAgentsDir = path.join(canonicalRoot, '.codex', AGENTS_DIR_NAME);
_createAgentsDir(globalHome, EXPECTED_AGENTS);
const result = runGsdTools('init plan-phase 1 --raw', tmpDir, { CODEX_HOME: globalHome });
const result = runMsdTools('init plan-phase 1 --raw', tmpDir, { CODEX_HOME: globalHome });
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
@@ -139,7 +139,7 @@ describe('init commands: agents_installed field (#1371)', () => {
const phaseDir = path.join(tmpDir, '.planning', 'phases', '01-setup');
fs.mkdirSync(phaseDir, { recursive: true });
const result = runGsdTools('init plan-phase 1 --raw', tmpDir, { CODEX_SANDBOX: 'seatbelt' });
const result = runMsdTools('init plan-phase 1 --raw', tmpDir, { CODEX_SANDBOX: 'seatbelt' });
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
@@ -154,7 +154,7 @@ describe('init commands: agents_installed field (#1371)', () => {
JSON.stringify({ runtime: 'claude' }),
);
const result = runGsdTools('init plan-phase 1 --raw', tmpDir, { CODEX_SANDBOX: 'seatbelt' });
const result = runMsdTools('init plan-phase 1 --raw', tmpDir, { CODEX_SANDBOX: 'seatbelt' });
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
@@ -165,19 +165,19 @@ describe('init commands: agents_installed field (#1371)', () => {
const phaseDir = path.join(tmpDir, '.planning', 'phases', '01-setup');
fs.mkdirSync(phaseDir, { recursive: true });
const result = runGsdTools('init plan-phase 1 --raw', tmpDir);
const result = runMsdTools('init plan-phase 1 --raw', tmpDir);
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
assert.strictEqual(output.agent_runtime, 'claude');
});
test('init honors GSD_RUNTIME over detection', () => {
test('init honors MSD_RUNTIME over detection', () => {
const phaseDir = path.join(tmpDir, '.planning', 'phases', '01-setup');
fs.mkdirSync(phaseDir, { recursive: true });
const result = runGsdTools('init plan-phase 1 --raw', tmpDir, {
GSD_RUNTIME: 'opencode',
const result = runMsdTools('init plan-phase 1 --raw', tmpDir, {
MSD_RUNTIME: 'opencode',
CODEX_SANDBOX: 'seatbelt',
});
assert.ok(result.success, `Command failed: ${result.error}`);
@@ -190,7 +190,7 @@ describe('init commands: agents_installed field (#1371)', () => {
const phaseDir = path.join(tmpDir, '.planning', 'phases', '01-setup');
fs.mkdirSync(phaseDir, { recursive: true });
const result = runGsdTools('init execute-phase 1 --raw', tmpDir);
const result = runMsdTools('init execute-phase 1 --raw', tmpDir);
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
@@ -199,7 +199,7 @@ describe('init commands: agents_installed field (#1371)', () => {
});
test('init quick includes agents_installed field', () => {
const result = runGsdTools(['init', 'quick', 'test description', '--raw'], tmpDir);
const result = runMsdTools(['init', 'quick', 'test description', '--raw'], tmpDir);
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
@@ -244,9 +244,9 @@ describe('validate health: agent installation check W010 (#1371)', () => {
});
test('health check reports healthy when agents are installed (repo layout)', () => {
// In the repo, agents/ exists as a sibling of gsd-core/, so the
// health check should find them via the gsd-tools.cjs path resolution
const result = runGsdTools('validate health --raw', tmpDir);
// In the repo, agents/ exists as a sibling of msd-core/, so the
// health check should find them via the msd-tools.cjs path resolution
const result = runMsdTools('validate health --raw', tmpDir);
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
@@ -281,7 +281,7 @@ describe('Codex project-local validation status', () => {
const localAgentsDir = path.join(fs.realpathSync(tmpDir), '.codex', AGENTS_DIR_NAME);
const env = { CODEX_HOME: globalHome };
const validateResult = runGsdTools('validate agents --raw', tmpDir, env);
const validateResult = runMsdTools('validate agents --raw', tmpDir, env);
assert.ok(validateResult.success, `validate agents failed: ${validateResult.error}`);
const validateOutput = JSON.parse(validateResult.output);
assert.strictEqual(validateOutput.agents_dir, localAgentsDir);
@@ -289,7 +289,7 @@ describe('Codex project-local validation status', () => {
assert.deepStrictEqual(validateOutput.missing, []);
assert.deepStrictEqual(validateOutput.incomplete, []);
const healthResult = runGsdTools('validate health --raw', tmpDir, env);
const healthResult = runMsdTools('validate health --raw', tmpDir, env);
assert.ok(healthResult.success, `validate health failed: ${healthResult.error}`);
const healthOutput = JSON.parse(healthResult.output);
assert.ok(!(healthOutput.warnings || []).some(warning => warning.code === 'W010'));
@@ -297,11 +297,11 @@ describe('Codex project-local validation status', () => {
test('an empty project-local Codex directory remains authoritative for validate agents and health', () => {
fs.mkdirSync(path.join(tmpDir, '.codex', AGENTS_DIR_NAME), { recursive: true });
fs.writeFileSync(path.join(tmpDir, '.codex', 'gsd-file-manifest.json'), JSON.stringify({ files: {} }));
fs.writeFileSync(path.join(tmpDir, '.codex', 'msd-file-manifest.json'), JSON.stringify({ files: {} }));
const localAgentsDir = path.join(fs.realpathSync(tmpDir), '.codex', AGENTS_DIR_NAME);
const env = { CODEX_HOME: globalHome };
const validateResult = runGsdTools('validate agents --raw', tmpDir, env);
const validateResult = runMsdTools('validate agents --raw', tmpDir, env);
assert.ok(validateResult.success, `validate agents failed: ${validateResult.error}`);
const validateOutput = JSON.parse(validateResult.output);
assert.strictEqual(validateOutput.agents_dir, localAgentsDir);
@@ -310,7 +310,7 @@ describe('Codex project-local validation status', () => {
assert.deepStrictEqual(validateOutput.incomplete, []);
assert.deepStrictEqual(validateOutput.missing, EXPECTED_AGENTS);
const healthResult = runGsdTools('validate health --raw', tmpDir, env);
const healthResult = runMsdTools('validate health --raw', tmpDir, env);
assert.ok(healthResult.success, `validate health failed: ${healthResult.error}`);
const healthOutput = JSON.parse(healthResult.output);
assert.ok((healthOutput.warnings || []).some(warning => warning.code === 'W010'));
@@ -331,8 +331,8 @@ describe('checkAgentsInstalled: Copilot .agent.md format (#1512)', () => {
});
test('agents_installed=true when agents exist as .agent.md (Copilot format)', () => {
// Simulate a Copilot install: agents are named gsd-*.agent.md, not gsd-*.md
// Use GSD_AGENTS_DIR to point at an isolated dir with ONLY .agent.md files,
// Simulate a Copilot install: agents are named msd-*.agent.md, not msd-*.md
// Use MSD_AGENTS_DIR to point at an isolated dir with ONLY .agent.md files,
// so the test does not accidentally pass via the repo's own agents/ dir.
const agentsDir = path.join(tmpDir, 'copilot-agents');
fs.mkdirSync(agentsDir, { recursive: true });
@@ -343,13 +343,13 @@ describe('checkAgentsInstalled: Copilot .agent.md format (#1512)', () => {
);
}
const result = runGsdTools('validate agents --raw', tmpDir, { GSD_AGENTS_DIR: agentsDir });
const result = runMsdTools('validate agents --raw', tmpDir, { MSD_AGENTS_DIR: agentsDir });
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
// Must report the custom dir, not the default repo agents dir
assert.strictEqual(output.agents_dir, agentsDir,
'agents_dir must be the GSD_AGENTS_DIR override, not the repo default');
'agents_dir must be the MSD_AGENTS_DIR override, not the repo default');
assert.strictEqual(output.agents_found, true,
'agents_found must be true when agents exist as .agent.md (Copilot format)');
assert.deepStrictEqual(output.missing, [],
@@ -366,7 +366,7 @@ describe('checkAgentsInstalled: Copilot .agent.md format (#1512)', () => {
`---\nname: ${firstAgent}\ndescription: Test agent\n---\nAgent content.\n`
);
const result = runGsdTools('validate agents --raw', tmpDir, { GSD_AGENTS_DIR: agentsDir });
const result = runMsdTools('validate agents --raw', tmpDir, { MSD_AGENTS_DIR: agentsDir });
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
@@ -386,7 +386,7 @@ describe('checkAgentsInstalled: Copilot .agent.md format (#1512)', () => {
);
}
const result = runGsdTools('init new-workspace --raw', tmpDir, { GSD_AGENTS_DIR: agentsDir });
const result = runMsdTools('init new-workspace --raw', tmpDir, { MSD_AGENTS_DIR: agentsDir });
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
@@ -406,7 +406,7 @@ describe('checkAgentsInstalled: Copilot .agent.md format (#1512)', () => {
);
}
const result = runGsdTools('validate agents --raw', tmpDir, { GSD_AGENTS_DIR: agentsDir });
const result = runMsdTools('validate agents --raw', tmpDir, { MSD_AGENTS_DIR: agentsDir });
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
@@ -416,7 +416,7 @@ describe('checkAgentsInstalled: Copilot .agent.md format (#1512)', () => {
'missing must be empty when all agents exist as .toml');
});
test('GSD_AGENTS_DIR env var overrides default agents directory', () => {
test('MSD_AGENTS_DIR env var overrides default agents directory', () => {
// Create a custom agents dir in a subdirectory
const customAgentsDir = path.join(tmpDir, 'custom-agents');
fs.mkdirSync(customAgentsDir, { recursive: true });
@@ -426,13 +426,13 @@ describe('checkAgentsInstalled: Copilot .agent.md format (#1512)', () => {
`---\nname: ${EXPECTED_AGENTS[0]}\ndescription: Test agent\n---\nAgent content.\n`
);
const result = runGsdTools('validate agents --raw', tmpDir, { GSD_AGENTS_DIR: customAgentsDir });
const result = runMsdTools('validate agents --raw', tmpDir, { MSD_AGENTS_DIR: customAgentsDir });
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
// The custom dir path should be reported
assert.strictEqual(output.agents_dir, customAgentsDir,
'agents_dir must reflect GSD_AGENTS_DIR override');
'agents_dir must reflect MSD_AGENTS_DIR override');
});
});
@@ -440,9 +440,9 @@ describe('checkAgentsInstalled: Copilot .agent.md format (#1512)', () => {
describe('checkAgentsInstalled: Kimi agents/subagents layout', () => {
test('Kimi install is detected by init, validate agents, and health checks', () => {
const tmpDir = createTempProject('gsd-kimi-agent-status-project-');
const tmpConfig = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-agent-status-config-'));
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-agent-status-home-'));
const tmpDir = createTempProject('msd-kimi-agent-status-project-');
const tmpConfig = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-agent-status-config-'));
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-agent-status-home-'));
const env = installerEnv({
HOME: tmpHome,
USERPROFILE: tmpHome,
@@ -469,7 +469,7 @@ describe('checkAgentsInstalled: Kimi agents/subagents layout', () => {
JSON.stringify({ runtime: 'kimi', model_profile: 'balanced' }, null, 2),
);
const initResult = runGsdTools('init new-workspace --raw', tmpDir, env);
const initResult = runMsdTools('init new-workspace --raw', tmpDir, env);
assert.ok(initResult.success, `init failed: ${initResult.error}`);
const initOutput = JSON.parse(initResult.output);
assert.strictEqual(initOutput.agent_runtime, 'kimi');
@@ -477,9 +477,9 @@ describe('checkAgentsInstalled: Kimi agents/subagents layout', () => {
assert.strictEqual(initOutput.agents_installed, true);
assert.deepStrictEqual(initOutput.missing_agents, []);
const validateResult = runGsdTools('validate agents --raw', tmpDir, {
const validateResult = runMsdTools('validate agents --raw', tmpDir, {
...env,
GSD_RUNTIME: 'kimi',
MSD_RUNTIME: 'kimi',
});
assert.ok(validateResult.success, `validate agents failed: ${validateResult.error}`);
const validateOutput = JSON.parse(validateResult.output);
@@ -487,14 +487,14 @@ describe('checkAgentsInstalled: Kimi agents/subagents layout', () => {
assert.strictEqual(validateOutput.agents_found, true);
assert.deepStrictEqual(validateOutput.missing, []);
const healthResult = runGsdTools('validate health --raw', tmpDir, {
const healthResult = runMsdTools('validate health --raw', tmpDir, {
...env,
GSD_RUNTIME: 'kimi',
MSD_RUNTIME: 'kimi',
});
assert.ok(healthResult.success, `validate health failed: ${healthResult.error}`);
const healthOutput = JSON.parse(healthResult.output);
const agentWarnings = (healthOutput.warnings || []).filter(
(warning) => warning.code === 'W010' || /GSD agents/i.test(warning.message || ''),
(warning) => warning.code === 'W010' || /MSD agents/i.test(warning.message || ''),
);
assert.deepStrictEqual(agentWarnings, []);
} finally {
@@ -519,7 +519,7 @@ describe('validate agents subcommand (#1371)', () => {
});
test('validate agents returns status with agent list', () => {
const result = runGsdTools('validate agents --raw', tmpDir);
const result = runMsdTools('validate agents --raw', tmpDir);
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
@@ -530,7 +530,7 @@ describe('validate agents subcommand (#1371)', () => {
});
test('validate agents lists all expected agent types', () => {
const result = runGsdTools('validate agents --raw', tmpDir);
const result = runMsdTools('validate agents --raw', tmpDir);
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
@@ -544,7 +544,7 @@ describe('validate agents subcommand (#1371)', () => {
// tests/agent-install-check.test.cjs's T28 already proves checkCodexSandboxPosture
// itself detects a drifted sandbox_mode. That is a UNIT row — it drives the
// helper directly. Before verify.cts wired the helper into cmdValidateAgents,
// T28 stayed green while `gsd-tools validate agents` (the actual command a
// T28 stayed green while `msd-tools validate agents` (the actual command a
// user/CI runs) never surfaced the drift at all — the ADR-3180 Decision 4(b)
// failure shape ("asserting at a helper's return, not at the consumer's
// output"). This row drives the real CLI end to end and asserts on ITS JSON,
@@ -565,17 +565,17 @@ describe('validate agents surfaces sandbox posture drift at the command (#3897 r
});
test('validateAgentsSurfacesSandboxDriftAtTheCommand_3897: `validate agents` reports the drifted agent/expected/found via sandbox_posture', () => {
// agents/gsd-executor.md (the real repo role source — checkCodexSandboxPosture
// agents/msd-executor.md (the real repo role source — checkCodexSandboxPosture
// reads it directly, it is not fixture-overridable) declares tools that derive
// workspace-write. Install a drifted TOML claiming read-only instead.
fs.writeFileSync(
path.join(agentsDir, 'gsd-executor.toml'),
'name = "gsd-executor"\ndescription = "Executes plans"\nsandbox_mode = "read-only"\n'
path.join(agentsDir, 'msd-executor.toml'),
'name = "msd-executor"\ndescription = "Executes plans"\nsandbox_mode = "read-only"\n'
+ "developer_instructions = '''\nExecute.\n'''\n",
);
const env = { GSD_AGENTS_DIR: agentsDir, GSD_RUNTIME: 'codex' };
const result = runGsdTools('validate agents --raw', tmpDir, env);
const env = { MSD_AGENTS_DIR: agentsDir, MSD_RUNTIME: 'codex' };
const result = runMsdTools('validate agents --raw', tmpDir, env);
assert.ok(result.success, `validate agents failed: ${result.error}`);
assert.strictEqual(result.exitCode, 0, 'model-posture drift is report-only, not fatal — sandbox posture must match that precedent');
@@ -585,7 +585,7 @@ describe('validate agents surfaces sandbox posture drift at the command (#3897 r
`expected \`validate agents\` output to carry a sandbox_posture key, got keys: ${Object.keys(output).join(', ')}`,
);
assert.strictEqual(output.sandbox_posture.ok, false);
const violation = output.sandbox_posture.violations.find((v) => v.agent === 'gsd-executor');
const violation = output.sandbox_posture.violations.find((v) => v.agent === 'msd-executor');
assert.ok(violation, 'the command output must name the drifted agent');
assert.strictEqual(violation.expected, 'workspace-write');
assert.strictEqual(violation.found, 'read-only');
@@ -595,14 +595,14 @@ describe('validate agents surfaces sandbox posture drift at the command (#3897 r
// ─── Bug #1058: validate agents detects manifest-backed .md/.toml pair drift ──
describe('bug #1058: validate agents detects manifest-backed .md/.toml pair drift', () => {
// All real agents/gsd-*.md files in the repo (used to populate fixtures)
// All real agents/msd-*.md files in the repo (used to populate fixtures)
const REPO_AGENTS_DIR_1058 = path.resolve(__dirname, '..', 'agents');
/**
* Copy all gsd-*.md files from the repo agents dir into destDir.
* Copy all msd-*.md files from the repo agents dir into destDir.
*/
function copyAgentMdFiles(destDir) {
const files = fs.readdirSync(REPO_AGENTS_DIR_1058).filter(f => /^gsd-.*\.md$/.test(f));
const files = fs.readdirSync(REPO_AGENTS_DIR_1058).filter(f => /^msd-.*\.md$/.test(f));
for (const file of files) {
const src = path.join(REPO_AGENTS_DIR_1058, file);
const dst = path.join(destDir, file);
@@ -611,7 +611,7 @@ describe('bug #1058: validate agents detects manifest-backed .md/.toml pair drif
}
/**
* Build a gsd-file-manifest.json whose files map includes both .md and .toml
* Build a msd-file-manifest.json whose files map includes both .md and .toml
* entries for every EXPECTED_AGENTS entry.
*/
function buildManifestBothPairs(agents) {
@@ -635,7 +635,7 @@ describe('bug #1058: validate agents detects manifest-backed .md/.toml pair drif
test('agents_found=false and incomplete non-empty when .toml files are absent but manifest expects them', () => {
// Arrange: all .md files present, manifest says both .md and .toml are expected,
// but NO .toml files are created on disk.
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-bug-1058-missing-toml-'));
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-bug-1058-missing-toml-'));
const agentsDir = path.join(tmpDir, 'agents');
fs.mkdirSync(agentsDir, { recursive: true });
@@ -644,14 +644,14 @@ describe('bug #1058: validate agents detects manifest-backed .md/.toml pair drif
// Write manifest with both .md and .toml entries but no .toml files on disk
fs.writeFileSync(
path.join(tmpDir, 'gsd-file-manifest.json'),
path.join(tmpDir, 'msd-file-manifest.json'),
JSON.stringify(buildManifestBothPairs(EXPECTED_AGENTS), null, 2),
);
// Act
const result = runGsdTools('validate agents --raw', tmpDir, {
GSD_RUNTIME: 'codex',
GSD_AGENTS_DIR: agentsDir,
const result = runMsdTools('validate agents --raw', tmpDir, {
MSD_RUNTIME: 'codex',
MSD_AGENTS_DIR: agentsDir,
});
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
@@ -683,7 +683,7 @@ describe('bug #1058: validate agents detects manifest-backed .md/.toml pair drif
test('agents_found=false and incomplete non-empty when .md files are absent but manifest expects them', () => {
// Arrange: only .toml files present on disk, manifest says both .md and .toml are expected,
// but NO .md files exist. This is the opposite-side pair-drift case.
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-bug-1058-missing-md-'));
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-bug-1058-missing-md-'));
const agentsDir = path.join(tmpDir, 'agents');
fs.mkdirSync(agentsDir, { recursive: true });
@@ -695,14 +695,14 @@ describe('bug #1058: validate agents detects manifest-backed .md/.toml pair drif
// Write manifest with both .md and .toml entries
fs.writeFileSync(
path.join(tmpDir, 'gsd-file-manifest.json'),
path.join(tmpDir, 'msd-file-manifest.json'),
JSON.stringify(buildManifestBothPairs(EXPECTED_AGENTS), null, 2),
);
// Act
const result = runGsdTools('validate agents --raw', tmpDir, {
GSD_RUNTIME: 'codex',
GSD_AGENTS_DIR: agentsDir,
const result = runMsdTools('validate agents --raw', tmpDir, {
MSD_RUNTIME: 'codex',
MSD_AGENTS_DIR: agentsDir,
});
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
@@ -725,7 +725,7 @@ describe('bug #1058: validate agents detects manifest-backed .md/.toml pair drif
test('agents_found=true and incomplete=[] when both .md and .toml files are present', () => {
// Arrange: all .md AND .toml present, manifest says both expected
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-bug-1058-complete-pair-'));
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-bug-1058-complete-pair-'));
const agentsDir = path.join(tmpDir, 'agents');
fs.mkdirSync(agentsDir, { recursive: true });
@@ -739,14 +739,14 @@ describe('bug #1058: validate agents detects manifest-backed .md/.toml pair drif
// Write manifest with both .md and .toml entries
fs.writeFileSync(
path.join(tmpDir, 'gsd-file-manifest.json'),
path.join(tmpDir, 'msd-file-manifest.json'),
JSON.stringify(buildManifestBothPairs(EXPECTED_AGENTS), null, 2),
);
// Act
const result = runGsdTools('validate agents --raw', tmpDir, {
GSD_RUNTIME: 'codex',
GSD_AGENTS_DIR: agentsDir,
const result = runMsdTools('validate agents --raw', tmpDir, {
MSD_RUNTIME: 'codex',
MSD_AGENTS_DIR: agentsDir,
});
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);
@@ -766,19 +766,19 @@ describe('bug #1058: validate agents detects manifest-backed .md/.toml pair drif
test('no spurious incomplete flags when no manifest is present (protects claude/bundled installs)', () => {
// Arrange: all .md files present, NO manifest file at all
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-bug-1058-no-manifest-'));
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-bug-1058-no-manifest-'));
const agentsDir = path.join(tmpDir, 'agents');
fs.mkdirSync(agentsDir, { recursive: true });
// Copy real .md files
copyAgentMdFiles(agentsDir);
// Explicitly do NOT write gsd-file-manifest.json
// Explicitly do NOT write msd-file-manifest.json
// Act
const result = runGsdTools('validate agents --raw', tmpDir, {
GSD_RUNTIME: 'codex',
GSD_AGENTS_DIR: agentsDir,
const result = runMsdTools('validate agents --raw', tmpDir, {
MSD_RUNTIME: 'codex',
MSD_AGENTS_DIR: agentsDir,
});
assert.ok(result.success, `Command failed: ${result.error}`);
const output = JSON.parse(result.output);