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:
@@ -9,7 +9,7 @@
|
||||
// phrases like 'not found' or 'timed out'.
|
||||
|
||||
/**
|
||||
* Tests for gsd-core/bin/lib/graphify.cjs
|
||||
* Tests for msd-core/bin/lib/graphify.cjs
|
||||
*
|
||||
* Covers: tri-state gate (TEST-03 — isCapabilityActive cutover, Phase 3),
|
||||
* graceful degradation (TEST-04), subprocess helper (FOUND-04),
|
||||
@@ -35,7 +35,7 @@ const {
|
||||
// Build (Phase 3)
|
||||
graphifyBuild,
|
||||
writeSnapshot,
|
||||
} = require('../gsd-core/bin/lib/graphify.cjs');
|
||||
} = require('../msd-core/bin/lib/graphify.cjs');
|
||||
|
||||
const {
|
||||
enableGraphify,
|
||||
@@ -53,17 +53,17 @@ const {
|
||||
// happened to be surfaced in the real ~/.claude.
|
||||
//
|
||||
// Fix: before each positive-path test, point CLAUDE_CONFIG_DIR at a tmp dir
|
||||
// containing a full-profile .gsd-surface.json with graphify surfaced, and
|
||||
// clear GSD_RUNTIME / GSD_WORKSTREAM / GSD_PROJECT for hermeticity.
|
||||
// An EMPTY tmp config dir (no .gsd-surface.json) also works — the resolver
|
||||
// containing a full-profile .msd-surface.json with graphify surfaced, and
|
||||
// clear MSD_RUNTIME / MSD_WORKSTREAM / MSD_PROJECT for hermeticity.
|
||||
// An EMPTY tmp config dir (no .msd-surface.json) also works — the resolver
|
||||
// defaults to 'full' profile → all surfaced — but we write the file explicitly
|
||||
// so the fixture intent is visible and independent of default-resolution logic.
|
||||
|
||||
/** Create a tmp config dir with graphify surfaced (full profile, no disabled clusters). */
|
||||
function makeSurfacedConfigDir() {
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-graphify-surface-cfg-'));
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-graphify-surface-cfg-'));
|
||||
fs.writeFileSync(
|
||||
path.join(dir, '.gsd-surface.json'),
|
||||
path.join(dir, '.msd-surface.json'),
|
||||
JSON.stringify({ baseProfile: 'full', disabledClusters: [], explicitAdds: [], explicitRemoves: [] }, null, 2) + '\n',
|
||||
'utf8',
|
||||
);
|
||||
@@ -76,21 +76,21 @@ function makeSurfacedConfigDir() {
|
||||
*/
|
||||
function saveSurfacedEnv() {
|
||||
const saved = {
|
||||
GSD_RUNTIME: process.env.GSD_RUNTIME,
|
||||
MSD_RUNTIME: process.env.MSD_RUNTIME,
|
||||
CLAUDE_CONFIG_DIR: process.env.CLAUDE_CONFIG_DIR,
|
||||
GSD_WORKSTREAM: process.env.GSD_WORKSTREAM,
|
||||
GSD_PROJECT: process.env.GSD_PROJECT,
|
||||
MSD_WORKSTREAM: process.env.MSD_WORKSTREAM,
|
||||
MSD_PROJECT: process.env.MSD_PROJECT,
|
||||
};
|
||||
return {
|
||||
restore() {
|
||||
if (saved.GSD_RUNTIME === undefined) delete process.env.GSD_RUNTIME;
|
||||
else process.env.GSD_RUNTIME = saved.GSD_RUNTIME;
|
||||
if (saved.MSD_RUNTIME === undefined) delete process.env.MSD_RUNTIME;
|
||||
else process.env.MSD_RUNTIME = saved.MSD_RUNTIME;
|
||||
if (saved.CLAUDE_CONFIG_DIR === undefined) delete process.env.CLAUDE_CONFIG_DIR;
|
||||
else process.env.CLAUDE_CONFIG_DIR = saved.CLAUDE_CONFIG_DIR;
|
||||
if (saved.GSD_WORKSTREAM === undefined) delete process.env.GSD_WORKSTREAM;
|
||||
else process.env.GSD_WORKSTREAM = saved.GSD_WORKSTREAM;
|
||||
if (saved.GSD_PROJECT === undefined) delete process.env.GSD_PROJECT;
|
||||
else process.env.GSD_PROJECT = saved.GSD_PROJECT;
|
||||
if (saved.MSD_WORKSTREAM === undefined) delete process.env.MSD_WORKSTREAM;
|
||||
else process.env.MSD_WORKSTREAM = saved.MSD_WORKSTREAM;
|
||||
if (saved.MSD_PROJECT === undefined) delete process.env.MSD_PROJECT;
|
||||
else process.env.MSD_PROJECT = saved.MSD_PROJECT;
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -98,7 +98,7 @@ function saveSurfacedEnv() {
|
||||
// ─── status describe ─────────────────────────────────────────────────────────
|
||||
|
||||
// Require capability-state to assert gate parity in regression tests below.
|
||||
const { isCapabilityActive } = require('../gsd-core/bin/lib/capability-state.cjs');
|
||||
const { isCapabilityActive } = require('../msd-core/bin/lib/capability-state.cjs');
|
||||
|
||||
/**
|
||||
* NOT a real subprocess timeout. spawnSync is fully mocked in this test --
|
||||
@@ -201,7 +201,7 @@ describe('status', () => {
|
||||
//
|
||||
// FAIL-FIRST PROOF (what would fail against the OLD isGraphifyEnabled code):
|
||||
// Scenario: graphify installed (full profile → '*' sentinel) + config-enabled=true,
|
||||
// but graphify NOT surfaced (disabled cluster in .gsd-surface.json).
|
||||
// but graphify NOT surfaced (disabled cluster in .msd-surface.json).
|
||||
//
|
||||
// OLD gate (isGraphifyEnabled): checks ONLY graphify.enabled in config.json.
|
||||
// → graphify.enabled=true → isGraphifyEnabled=true → graphifyStatus NOT disabled → BUG.
|
||||
@@ -211,8 +211,8 @@ describe('status', () => {
|
||||
//
|
||||
// Fixture layout:
|
||||
// CLAUDE_CONFIG_DIR → tmpConfigDir/
|
||||
// .gsd-surface.json → full profile, disabledClusters:["graphify"]
|
||||
// (no .gsd-profile → defaults to 'full' → installedSkills='*' → installed=true)
|
||||
// .msd-surface.json → full profile, disabledClusters:["graphify"]
|
||||
// (no .msd-profile → defaults to 'full' → installedSkills='*' → installed=true)
|
||||
// tmpProjectDir/
|
||||
// .planning/config.json → {"graphify":{"enabled":true}}
|
||||
//
|
||||
@@ -223,18 +223,18 @@ describe('status', () => {
|
||||
let tmpConfigDir;
|
||||
let tmpProjectDir;
|
||||
let prevClaudeConfigDir;
|
||||
let prevGsdWorkstream;
|
||||
let prevGsdProject;
|
||||
let prevMsdWorkstream;
|
||||
let prevMsdProject;
|
||||
|
||||
beforeEach(() => {
|
||||
tmpConfigDir = createTempDir('gsd-graphify-surface-test-config-');
|
||||
tmpProjectDir = createTempDir('gsd-graphify-surface-test-project-');
|
||||
tmpConfigDir = createTempDir('msd-graphify-surface-test-config-');
|
||||
tmpProjectDir = createTempDir('msd-graphify-surface-test-project-');
|
||||
|
||||
// Fixture: .gsd-surface.json — full profile with graphify cluster disabled.
|
||||
// Fixture: .msd-surface.json — full profile with graphify cluster disabled.
|
||||
// The 'graphify' key in disabledClusters maps to ["graphify"] via
|
||||
// capability-registry.cjs capabilityClusters, removing the 'graphify' skill
|
||||
// stem from the surfaced set. All other skills remain surfaced.
|
||||
// No .gsd-profile written → readActiveProfile returns null → defaults to 'full'
|
||||
// No .msd-profile written → readActiveProfile returns null → defaults to 'full'
|
||||
// → resolveProfile returns '*' sentinel → installedSkills='*' → installed=true.
|
||||
const surfaceState = {
|
||||
baseProfile: 'full',
|
||||
@@ -243,7 +243,7 @@ describe('status', () => {
|
||||
explicitRemoves: [],
|
||||
};
|
||||
fs.writeFileSync(
|
||||
path.join(tmpConfigDir, '.gsd-surface.json'),
|
||||
path.join(tmpConfigDir, '.msd-surface.json'),
|
||||
JSON.stringify(surfaceState, null, 2) + '\n',
|
||||
'utf8',
|
||||
);
|
||||
@@ -263,13 +263,13 @@ describe('status', () => {
|
||||
// Save and override env vars for hermeticity.
|
||||
// CLAUDE_CONFIG_DIR controls which config dir getGlobalConfigDir('claude') resolves.
|
||||
prevClaudeConfigDir = process.env.CLAUDE_CONFIG_DIR;
|
||||
prevGsdWorkstream = process.env.GSD_WORKSTREAM;
|
||||
prevGsdProject = process.env.GSD_PROJECT;
|
||||
prevMsdWorkstream = process.env.MSD_WORKSTREAM;
|
||||
prevMsdProject = process.env.MSD_PROJECT;
|
||||
process.env.CLAUDE_CONFIG_DIR = tmpConfigDir;
|
||||
// Clear GSD_WORKSTREAM/GSD_PROJECT — ambient values redirect planningDir()
|
||||
// Clear MSD_WORKSTREAM/MSD_PROJECT — ambient values redirect planningDir()
|
||||
// causing STATE.md reads from an unrelated location (hermeticity regression #872).
|
||||
delete process.env.GSD_WORKSTREAM;
|
||||
delete process.env.GSD_PROJECT;
|
||||
delete process.env.MSD_WORKSTREAM;
|
||||
delete process.env.MSD_PROJECT;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -277,10 +277,10 @@ describe('status', () => {
|
||||
// the original env (no silent planningDir redirection from leftover vars).
|
||||
if (prevClaudeConfigDir === undefined) delete process.env.CLAUDE_CONFIG_DIR;
|
||||
else process.env.CLAUDE_CONFIG_DIR = prevClaudeConfigDir;
|
||||
if (prevGsdWorkstream === undefined) delete process.env.GSD_WORKSTREAM;
|
||||
else process.env.GSD_WORKSTREAM = prevGsdWorkstream;
|
||||
if (prevGsdProject === undefined) delete process.env.GSD_PROJECT;
|
||||
else process.env.GSD_PROJECT = prevGsdProject;
|
||||
if (prevMsdWorkstream === undefined) delete process.env.MSD_WORKSTREAM;
|
||||
else process.env.MSD_WORKSTREAM = prevMsdWorkstream;
|
||||
if (prevMsdProject === undefined) delete process.env.MSD_PROJECT;
|
||||
else process.env.MSD_PROJECT = prevMsdProject;
|
||||
|
||||
cleanup(tmpConfigDir);
|
||||
cleanup(tmpProjectDir);
|
||||
@@ -319,7 +319,7 @@ describe('status', () => {
|
||||
// This confirms the fixture itself is sound — the two tests above must see
|
||||
// divergent outcomes from the same project config, controlled only by surface state.
|
||||
test('graphifyStatus is NOT disabled when installed + SURFACED + config-enabled=true (positive control)', () => {
|
||||
// Re-write .gsd-surface.json with graphify surfaced (disabledClusters empty).
|
||||
// Re-write .msd-surface.json with graphify surfaced (disabledClusters empty).
|
||||
const surfaceStateOn = {
|
||||
baseProfile: 'full',
|
||||
disabledClusters: [],
|
||||
@@ -327,7 +327,7 @@ describe('status', () => {
|
||||
explicitRemoves: [],
|
||||
};
|
||||
fs.writeFileSync(
|
||||
path.join(tmpConfigDir, '.gsd-surface.json'),
|
||||
path.join(tmpConfigDir, '.msd-surface.json'),
|
||||
JSON.stringify(surfaceStateOn, null, 2) + '\n',
|
||||
'utf8',
|
||||
);
|
||||
@@ -355,7 +355,7 @@ describe('status', () => {
|
||||
test('returns disabled:true with enable instructions', () => {
|
||||
const result = disabledResponse();
|
||||
assert.strictEqual(result.disabled, true);
|
||||
assert.ok(result.message.includes('gsd-tools config-set graphify.enabled true'));
|
||||
assert.ok(result.message.includes('msd-tools config-set graphify.enabled true'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -375,10 +375,10 @@ describe('status', () => {
|
||||
// Set up hermetic surfaced config dir: graphify surfaced, runtime=claude.
|
||||
surfacedConfigDir = makeSurfacedConfigDir();
|
||||
savedEnv = saveSurfacedEnv();
|
||||
delete process.env.GSD_RUNTIME; // use 'claude' default
|
||||
delete process.env.MSD_RUNTIME; // use 'claude' default
|
||||
process.env.CLAUDE_CONFIG_DIR = surfacedConfigDir;
|
||||
delete process.env.GSD_WORKSTREAM;
|
||||
delete process.env.GSD_PROJECT;
|
||||
delete process.env.MSD_WORKSTREAM;
|
||||
delete process.env.MSD_PROJECT;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -768,10 +768,10 @@ describe('build', () => {
|
||||
// Set up hermetic surfaced config dir: graphify surfaced, runtime=claude.
|
||||
surfacedConfigDir = makeSurfacedConfigDir();
|
||||
savedEnv = saveSurfacedEnv();
|
||||
delete process.env.GSD_RUNTIME;
|
||||
delete process.env.MSD_RUNTIME;
|
||||
process.env.CLAUDE_CONFIG_DIR = surfacedConfigDir;
|
||||
delete process.env.GSD_WORKSTREAM;
|
||||
delete process.env.GSD_PROJECT;
|
||||
delete process.env.MSD_WORKSTREAM;
|
||||
delete process.env.MSD_PROJECT;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
Reference in New Issue
Block a user