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:
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Worktree Base-Ref Module — unit tests
|
||||
*
|
||||
* Seam: gsd-core/bin/lib/worktree-base-ref.cjs
|
||||
* Seam: msd-core/bin/lib/worktree-base-ref.cjs
|
||||
* Interface: shortSha, readBaseRefFromSettings, applyWorktreeBaseRef,
|
||||
* resolveEffectiveBaseRef, findWorktreeCreateHook,
|
||||
* evaluateWorktreeBaseDegrade
|
||||
@@ -23,7 +23,7 @@ const { cleanup } = require('./helpers.cjs');
|
||||
const { GIT_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
|
||||
|
||||
const MODULE_PATH = path.join(
|
||||
__dirname, '..', 'gsd-core', 'bin', 'lib', 'worktree-base-ref.cjs'
|
||||
__dirname, '..', 'msd-core', 'bin', 'lib', 'worktree-base-ref.cjs'
|
||||
);
|
||||
|
||||
const {
|
||||
@@ -296,7 +296,7 @@ describe('evaluateWorktreeBaseDegrade', () => {
|
||||
assert.strictEqual(result.headSha, null);
|
||||
assert.strictEqual(result.forkRef, null);
|
||||
assert.strictEqual(result.forkSha, null);
|
||||
assert.strictEqual(called, false, 'orchestrator mode: GSD controls the fork start-point, head is honored by construction');
|
||||
assert.strictEqual(called, false, 'orchestrator mode: MSD controls the fork start-point, head is honored by construction');
|
||||
});
|
||||
|
||||
test('effectiveBaseRef="head" + harness mode (default) + diverged HEAD → no degrade, reason baseref-head, execGit never called (#4588)', () => {
|
||||
@@ -381,7 +381,7 @@ describe('evaluateWorktreeBaseDegrade', () => {
|
||||
assert.strictEqual(result.message, expectedMsg);
|
||||
assert.ok(result.message.includes('observed'), 'message must say the fork base was observed, not inferred');
|
||||
assert.ok(!result.message.includes('runtime harness'),
|
||||
'message must be mode-neutral — the observation may come from a GSD-created worktree (P4.6 review)');
|
||||
'message must be mode-neutral — the observation may come from a MSD-created worktree (P4.6 review)');
|
||||
assert.ok(result.message.includes('fresh dispatch'),
|
||||
'remedy must ask for a fresh observation — pushing cannot change a fixed measurement');
|
||||
assert.ok(result.message.includes(OBSERVED.slice(0, 8)) && result.message.includes(HEAD_SHA.slice(0, 8)),
|
||||
@@ -404,7 +404,7 @@ describe('evaluateWorktreeBaseDegrade', () => {
|
||||
assert.strictEqual(result.forkRef, 'observed');
|
||||
assert.strictEqual(result.forkSha, OBSERVED);
|
||||
// Pinned verbatim (P4.6 review, round 4) — the observed branch of buildMsgDiverged.
|
||||
const expectedMsg = `⚠ Worktree base mismatch: HEAD (${HEAD_SHA.slice(0, 8)}) differs from the observed fork base (${OBSERVED.slice(0, 8)}). Running this phase sequentially on the main working tree. Parallel worktrees return once a fresh dispatch is observed to fork from HEAD, or once HEAD is merged/pushed so the default fork base matches it, or set worktree.baseRef:"head" to fork worktrees from HEAD instead (honored by GSD-created worktrees and by the Claude Code harness; #683, #4588).`;
|
||||
const expectedMsg = `⚠ Worktree base mismatch: HEAD (${HEAD_SHA.slice(0, 8)}) differs from the observed fork base (${OBSERVED.slice(0, 8)}). Running this phase sequentially on the main working tree. Parallel worktrees return once a fresh dispatch is observed to fork from HEAD, or once HEAD is merged/pushed so the default fork base matches it, or set worktree.baseRef:"head" to fork worktrees from HEAD instead (honored by MSD-created worktrees and by the Claude Code harness; #683, #4588).`;
|
||||
assert.strictEqual(result.message, expectedMsg);
|
||||
assert.ok(result.message.includes('the observed fork base'),
|
||||
'message must phrase the fork side as an observation, not as a ref name');
|
||||
@@ -485,7 +485,7 @@ describe('evaluateWorktreeBaseDegrade', () => {
|
||||
|
||||
test('observedForkBase + head + orchestrator mode → the observation still decides (no short-circuit) (#4588)', () => {
|
||||
// An observation is stronger than either mode's belief about the fork
|
||||
// base: if GSD's own `git worktree add` somehow forked from elsewhere, the
|
||||
// base: if MSD's own `git worktree add` somehow forked from elsewhere, the
|
||||
// measurement — not the construction argument — is what the verdict reads.
|
||||
const HEAD_SHA = 'eeee1111223344abeeee1111223344abeeee1111';
|
||||
const OBSERVED = 'ffff1111223344acffff1111223344acffff1111';
|
||||
@@ -718,7 +718,7 @@ describe('evaluateWorktreeBaseDegrade', () => {
|
||||
// not read the setting; it does now (#4588), so the advice is back — with
|
||||
// the setting absent the harness really does fork from origin/HEAD, and
|
||||
// `head` is the fix for that.
|
||||
const expectedMsg = `⚠ Worktree base mismatch: HEAD (${HEAD_SHA.slice(0, 8)}) differs from origin/HEAD (${FORK_SHA.slice(0, 8)}). Running this phase sequentially on the main working tree. Parallel worktrees return once HEAD is merged/pushed so origin/HEAD matches it, or set worktree.baseRef:"head" to fork worktrees from HEAD instead (honored by GSD-created worktrees and by the Claude Code harness; #683, #4588).`;
|
||||
const expectedMsg = `⚠ Worktree base mismatch: HEAD (${HEAD_SHA.slice(0, 8)}) differs from origin/HEAD (${FORK_SHA.slice(0, 8)}). Running this phase sequentially on the main working tree. Parallel worktrees return once HEAD is merged/pushed so origin/HEAD matches it, or set worktree.baseRef:"head" to fork worktrees from HEAD instead (honored by MSD-created worktrees and by the Claude Code harness; #683, #4588).`;
|
||||
assert.strictEqual(result.message, expectedMsg);
|
||||
});
|
||||
|
||||
@@ -1426,7 +1426,7 @@ describe('cmdWorktreeBaseCheck — user/global cascade (#1013)', () => {
|
||||
test('(e positive) user/global head + phase lane + orchestrator mode → shouldDegrade:false (KEY REGRESSION #1013)', () => {
|
||||
// This is the exact bug #1013 fixed: user set worktree.baseRef:"head" in their global
|
||||
// settings, but the setting was invisible and the phase lane triggered degrade. The
|
||||
// suppress now applies only where GSD manages the fork (--mode orchestrator-worktree),
|
||||
// suppress now applies only where MSD manages the fork (--mode orchestrator-worktree),
|
||||
// which is also what keeps this cascade proof meaningful post-#3659.
|
||||
const deps = {
|
||||
execGit: makePhaseLaneExecGit(HEAD_SHA),
|
||||
@@ -1445,7 +1445,7 @@ describe('cmdWorktreeBaseCheck — user/global cascade (#1013)', () => {
|
||||
};
|
||||
const result = cmdWorktreeBaseCheck(cwd, ['--mode', 'orchestrator-worktree'], deps);
|
||||
assert.strictEqual(result.shouldDegrade, false,
|
||||
'user/global worktree.baseRef:"head" must suppress degrade on a phase lane where GSD manages the fork');
|
||||
'user/global worktree.baseRef:"head" must suppress degrade on a phase lane where MSD manages the fork');
|
||||
assert.strictEqual(result.reason, 'baseref-head');
|
||||
});
|
||||
|
||||
@@ -1514,7 +1514,7 @@ describe('cmdWorktreeBaseCheck — user/global cascade (#1013)', () => {
|
||||
const { describe: __foldDescribe } = require('node:test');
|
||||
__foldDescribe('folded:fix-1941-quick-worktree-stale-base', () => {
|
||||
|
||||
const QUICK_WORKFLOW_PATH = path.join(__dirname, '..', 'gsd-core', 'workflows', 'quick.md');
|
||||
const QUICK_WORKFLOW_PATH = path.join(__dirname, '..', 'msd-core', 'workflows', 'quick.md');
|
||||
|
||||
// ─── WorktreeCreate-hook interlock (#4588) ───────────────────────────────────
|
||||
//
|
||||
@@ -1847,8 +1847,8 @@ describe('quick: pre-dispatch worktree base re-check (#1941)', () => {
|
||||
const { describe: __foldDescribe } = require('node:test');
|
||||
__foldDescribe('folded:fix-2649-diagnose-issues-worktree-stale-base', () => {
|
||||
|
||||
const DIAGNOSE_ISSUES_PATH = path.join(__dirname, '..', 'gsd-core', 'workflows', 'diagnose-issues.md');
|
||||
const EXECUTE_PLAN_PATH = path.join(__dirname, '..', 'gsd-core', 'workflows', 'execute-plan.md');
|
||||
const DIAGNOSE_ISSUES_PATH = path.join(__dirname, '..', 'msd-core', 'workflows', 'diagnose-issues.md');
|
||||
const EXECUTE_PLAN_PATH = path.join(__dirname, '..', 'msd-core', 'workflows', 'execute-plan.md');
|
||||
|
||||
describe('diagnose-issues: pre-dispatch worktree base-check (#2649)', () => {
|
||||
test('workflow file exists', () => {
|
||||
@@ -1943,7 +1943,7 @@ describe('execute-plan Pattern A: pre-dispatch worktree base-check (#2649)', ()
|
||||
// claim that harness-isolated runtimes ignore worktree.baseRef. Pin the step
|
||||
// file itself, so a later extraction cannot quietly bring the claim back.
|
||||
const WORKTREE_BASE_CHECK_STEP_PATH = path.join(
|
||||
__dirname, '..', 'gsd-core', 'workflows', 'execute-phase', 'steps', 'worktree-base-check.md',
|
||||
__dirname, '..', 'msd-core', 'workflows', 'execute-phase', 'steps', 'worktree-base-check.md',
|
||||
);
|
||||
|
||||
describe('execute-phase worktree_base_check step prose (#4588)', () => {
|
||||
@@ -1990,7 +1990,7 @@ describe('#4734: classifyGitHead — single owner of the HEAD-resolution classes
|
||||
|
||||
test('a REAL non-git working directory degrades end-to-end (no injected seam — the #4734 fixture wording)', (t) => {
|
||||
const { createTempDir, cleanup } = require('./helpers.cjs');
|
||||
const dir = createTempDir('gsd-4734-nogit-real-');
|
||||
const dir = createTempDir('msd-4734-nogit-real-');
|
||||
t.after(() => cleanup(dir));
|
||||
const result = evaluateWorktreeBaseDegrade({ cwd: dir });
|
||||
assert.strictEqual(result.shouldDegrade, true);
|
||||
@@ -2302,7 +2302,7 @@ describe('#4588 A2: a clean prior harness worktree at the orchestrator HEAD conf
|
||||
test('end-to-end: a real repo with a clean harness worktree at HEAD passes the base-check', (t) => {
|
||||
const { createTempGitProject } = require('./helpers.cjs');
|
||||
const { gitOrThrow } = require('./helpers/git-fixture.cjs');
|
||||
const dir = createTempGitProject('gsd-4588-e2e-');
|
||||
const dir = createTempGitProject('msd-4588-e2e-');
|
||||
t.after(() => cleanup(dir));
|
||||
const wtPath = path.join(dir, '.claude', 'worktrees', 'agent-e2e');
|
||||
fs.mkdirSync(path.dirname(wtPath), { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user