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:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* gsd-executor agent — MVP+TDD gate section contract
|
||||
* msd-executor agent — MVP+TDD gate section contract
|
||||
* Verifies the agent definition contains a section instructing the executor
|
||||
* to halt and report when the runtime gate trips.
|
||||
*/
|
||||
@@ -8,10 +8,10 @@ const assert = require('node:assert/strict');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const AGENT = path.join(__dirname, '..', 'agents', 'gsd-executor.md');
|
||||
const REF = path.join(__dirname, '..', 'gsd-core', 'references', 'execute-mvp-tdd.md');
|
||||
const AGENT = path.join(__dirname, '..', 'agents', 'msd-executor.md');
|
||||
const REF = path.join(__dirname, '..', 'msd-core', 'references', 'execute-mvp-tdd.md');
|
||||
|
||||
describe('gsd-executor — MVP+TDD gate section', () => {
|
||||
describe('msd-executor — MVP+TDD gate section', () => {
|
||||
const content = fs.readFileSync(AGENT, 'utf-8');
|
||||
|
||||
test('agent defines a TDD Gate section keyed on TDD_MODE alone (#4011)', () => {
|
||||
@@ -40,18 +40,18 @@ describe('gsd-executor — MVP+TDD gate section', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('gsd-executor — state.* calls use the named-only router form (#1863 regression)', () => {
|
||||
// The runtime state-command router (gsd-core/bin/lib/state-command-router.cjs)
|
||||
describe('msd-executor — state.* calls use the named-only router form (#1863 regression)', () => {
|
||||
// The runtime state-command router (msd-core/bin/lib/state-command-router.cjs)
|
||||
// parses record-metric / add-decision / add-blocker / record-session named-only
|
||||
// via parseNamedArgs. Positional values are silently dropped, so state.cjs then
|
||||
// throws its required-arg error and metrics/decisions/blockers/session continuity
|
||||
// are never recorded. Each invocation in the executor agent must therefore pass
|
||||
// the named flags the router expects (mirrors gsd-core/workflows/execute-plan.md).
|
||||
// the named flags the router expects (mirrors msd-core/workflows/execute-plan.md).
|
||||
const content = fs.readFileSync(AGENT, 'utf-8');
|
||||
|
||||
// Capture a `gsd_run query state.<cmd> ...` invocation, including backslash-continued lines.
|
||||
// Capture a `msd_run query state.<cmd> ...` invocation, including backslash-continued lines.
|
||||
function invocation(cmd) {
|
||||
const re = new RegExp(String.raw`gsd_run query state\.${cmd}\b(?:[^\r\n]*\\\r?\n)*[^\r\n]*`);
|
||||
const re = new RegExp(String.raw`msd_run query state\.${cmd}\b(?:[^\r\n]*\\\r?\n)*[^\r\n]*`);
|
||||
const m = content.match(re);
|
||||
assert.ok(m, `executor must invoke state.${cmd}`);
|
||||
return m[0];
|
||||
@@ -93,10 +93,10 @@ describe('gsd-executor — state.* calls use the named-only router form (#1863 r
|
||||
// The same named-only router backs milestone-summary.md and forensics.md; both
|
||||
// previously passed record-session positionally (`"" "stopped-at" "resume-file"`),
|
||||
// silently dropping the values. Guard them alongside the executor.
|
||||
for (const rel of ['gsd-core/workflows/milestone-summary.md', 'gsd-core/workflows/forensics.md']) {
|
||||
for (const rel of ['msd-core/workflows/milestone-summary.md', 'msd-core/workflows/forensics.md']) {
|
||||
const wf = fs.readFileSync(path.join(__dirname, '..', rel), 'utf-8');
|
||||
// eslint-disable-next-line local/no-unbounded-quantifier -- parses maintainer-authored workflow markdown, bounded prose, not adversarial input
|
||||
const m = wf.match(/gsd_run query state\.record-session\b(?:[^\r\n]*\\\r?\n)*[^\r\n]*/);
|
||||
const m = wf.match(/msd_run query state\.record-session\b(?:[^\r\n]*\\\r?\n)*[^\r\n]*/);
|
||||
assert.ok(m, `${rel} must invoke state.record-session`);
|
||||
assert.ok(m[0].includes('--stopped-at') && m[0].includes('--resume-file'),
|
||||
`${rel} record-session must use --stopped-at/--resume-file, got:\n${m[0]}`);
|
||||
@@ -115,12 +115,12 @@ describe('gsd-executor — state.* calls use the named-only router form (#1863 r
|
||||
__foldDescribe("folded:bug-3097-3099-executor-worktree-path-safety (consolidation epic #1969 B7 #1976)", () => {
|
||||
'use strict';
|
||||
// allow-test-rule: source-text-is-the-product (see #3097)
|
||||
// Reads markdown product files (gsd-executor.md, worktree-path-safety.md) to
|
||||
// Reads markdown product files (msd-executor.md, worktree-path-safety.md) to
|
||||
// verify structural protocol.
|
||||
|
||||
// Regression guards for bug #3097 and #3099.
|
||||
//
|
||||
// #3097: gsd-executor's worktree HEAD guard used `if [ -f .git ]` to detect
|
||||
// #3097: msd-executor's worktree HEAD guard used `if [ -f .git ]` to detect
|
||||
// worktree mode. After a Bash `cd` out of the worktree into the main repo,
|
||||
// `.git` is a DIRECTORY (not a file), so the test is false and the entire
|
||||
// HEAD safety block is silently skipped. Commits then land on whatever branch
|
||||
@@ -138,20 +138,20 @@ const path = require('node:path');
|
||||
|
||||
const ROOT = path.join(__dirname, '..');
|
||||
const executorSrc = fs.readFileSync(
|
||||
path.join(ROOT, 'agents', 'gsd-executor.md'), 'utf8',
|
||||
path.join(ROOT, 'agents', 'msd-executor.md'), 'utf8',
|
||||
);
|
||||
const executePhaseSrc = fs.readFileSync(
|
||||
path.join(ROOT, 'gsd-core', 'workflows', 'execute-phase.md'), 'utf8',
|
||||
path.join(ROOT, 'msd-core', 'workflows', 'execute-phase.md'), 'utf8',
|
||||
);
|
||||
|
||||
describe('bug #3097: cwd-drift sentinel in gsd-executor.md', () => {
|
||||
describe('bug #3097: cwd-drift sentinel in msd-executor.md', () => {
|
||||
test('task_commit_protocol has cwd-drift assertion step (0a)', () => {
|
||||
const protocolIdx = executorSrc.indexOf('<task_commit_protocol>');
|
||||
const protocolEnd = executorSrc.indexOf('</task_commit_protocol>');
|
||||
assert.ok(protocolIdx !== -1 && protocolEnd !== -1, 'task_commit_protocol block not found');
|
||||
const protocol = executorSrc.slice(protocolIdx, protocolEnd);
|
||||
assert.ok(
|
||||
protocol.includes('cwd') || protocol.includes('drift') || protocol.includes('gsd-spawn-toplevel'),
|
||||
protocol.includes('cwd') || protocol.includes('drift') || protocol.includes('msd-spawn-toplevel'),
|
||||
'task_commit_protocol missing cwd-drift assertion step — #3097 fix not applied',
|
||||
);
|
||||
});
|
||||
@@ -170,7 +170,7 @@ describe('bug #3097: cwd-drift sentinel in gsd-executor.md', () => {
|
||||
const protocolIdx = executorSrc.indexOf('<task_commit_protocol>');
|
||||
const protocolEnd = executorSrc.indexOf('</task_commit_protocol>');
|
||||
const protocol = executorSrc.slice(protocolIdx, protocolEnd);
|
||||
const driftIdx = protocol.search(/cwd.drift|gsd-spawn-toplevel|drift.*assertion/i);
|
||||
const driftIdx = protocol.search(/cwd.drift|msd-spawn-toplevel|drift.*assertion/i);
|
||||
const headIdx = protocol.indexOf('Pre-commit HEAD safety assertion');
|
||||
assert.ok(driftIdx !== -1, 'cwd-drift assertion not found');
|
||||
assert.ok(headIdx !== -1, 'HEAD assertion not found');
|
||||
@@ -178,7 +178,7 @@ describe('bug #3097: cwd-drift sentinel in gsd-executor.md', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('bug #3099: absolute-path safety guidance in gsd-executor.md', () => {
|
||||
describe('bug #3099: absolute-path safety guidance in msd-executor.md', () => {
|
||||
test('task_commit_protocol documents absolute-path safety', () => {
|
||||
const protocolIdx = executorSrc.indexOf('<task_commit_protocol>');
|
||||
const protocolEnd = executorSrc.indexOf('</task_commit_protocol>');
|
||||
@@ -221,16 +221,16 @@ describe('bug #3099: absolute-path safety guidance in gsd-executor.md', () => {
|
||||
|
||||
test('worktree-path-safety.md reference file exists', () => {
|
||||
assert.ok(
|
||||
fs.existsSync(path.join(ROOT, 'gsd-core', 'references', 'worktree-path-safety.md')),
|
||||
'gsd-core/references/worktree-path-safety.md does not exist',
|
||||
fs.existsSync(path.join(ROOT, 'msd-core', 'references', 'worktree-path-safety.md')),
|
||||
'msd-core/references/worktree-path-safety.md does not exist',
|
||||
);
|
||||
});
|
||||
|
||||
test('worktree-path-safety.md contains cwd-drift and absolute-path guards', () => {
|
||||
const safetySrc = fs.readFileSync(
|
||||
path.join(ROOT, 'gsd-core', 'references', 'worktree-path-safety.md'), 'utf8',
|
||||
path.join(ROOT, 'msd-core', 'references', 'worktree-path-safety.md'), 'utf8',
|
||||
);
|
||||
assert.ok(safetySrc.includes('gsd-spawn-toplevel') || safetySrc.includes('cwd-drift'),
|
||||
assert.ok(safetySrc.includes('msd-spawn-toplevel') || safetySrc.includes('cwd-drift'),
|
||||
'worktree-path-safety.md missing cwd-drift sentinel content');
|
||||
assert.ok(safetySrc.includes('WT_ROOT') || safetySrc.includes('absolute'),
|
||||
'worktree-path-safety.md missing absolute-path guard content');
|
||||
@@ -259,10 +259,10 @@ describe('bug #4254: sequential executor supplied-root pin', () => {
|
||||
// declares its own copies inside a closure, out of this describe's scope.
|
||||
const ROOT = path.join(__dirname, '..');
|
||||
const executePhaseSrc = fs.readFileSync(
|
||||
path.join(ROOT, 'gsd-core', 'workflows', 'execute-phase.md'), 'utf8',
|
||||
path.join(ROOT, 'msd-core', 'workflows', 'execute-phase.md'), 'utf8',
|
||||
);
|
||||
const safetyRefPath = path.join(ROOT, 'gsd-core', 'references', 'worktree-path-safety.md');
|
||||
const pinStepPath = path.join(ROOT, 'gsd-core', 'workflows', 'execute-phase', 'steps', 'sequential-root-pin.md');
|
||||
const safetyRefPath = path.join(ROOT, 'msd-core', 'references', 'worktree-path-safety.md');
|
||||
const pinStepPath = path.join(ROOT, 'msd-core', 'workflows', 'execute-phase', 'steps', 'sequential-root-pin.md');
|
||||
const safetySrc = fs.readFileSync(safetyRefPath, 'utf8');
|
||||
const pinStepSrc = fs.readFileSync(pinStepPath, 'utf8');
|
||||
const { createTempGitProject, cleanup } = require('./helpers.cjs');
|
||||
@@ -270,7 +270,7 @@ describe('bug #4254: sequential executor supplied-root pin', () => {
|
||||
const { gitOrThrow } = require('./helpers/git-fixture.cjs');
|
||||
const { HOOK_FANOUT_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
|
||||
|
||||
const PIN_MARKER = '# gsd:guard=supplied-root-pin';
|
||||
const PIN_MARKER = '# msd:guard=supplied-root-pin';
|
||||
|
||||
// Extract the shipped guard — the exact ```bash block that carries the
|
||||
// marker — so the tests can never pass against a stale or hand-copied body.
|
||||
@@ -325,7 +325,7 @@ describe('bug #4254: sequential executor supplied-root pin', () => {
|
||||
});
|
||||
|
||||
test('#4254: RED regression — drifted-cwd executor halts before the wrong-checkout write', () => {
|
||||
const { primary, lane } = makeOrchestratorLane('gsd-4254-drift-');
|
||||
const { primary, lane } = makeOrchestratorLane('msd-4254-drift-');
|
||||
try {
|
||||
// The orchestrator pinned its own lane; the executor's process cwd
|
||||
// resolved to the PRIMARY checkout (the issue's exact shape).
|
||||
@@ -339,7 +339,7 @@ describe('bug #4254: sequential executor supplied-root pin', () => {
|
||||
// it (the lane appends '-orchestrator-wt'), so matching it inside the
|
||||
// Actual-root line proves the right checkout is being named.
|
||||
assert.match(res.stderr, /Pinned root:[^\n]*orchestrator-wt/, 'FATAL must name the pinned root');
|
||||
const { escapeRegex } = require('../gsd-core/bin/lib/pattern.cjs');
|
||||
const { escapeRegex } = require('../msd-core/bin/lib/pattern.cjs');
|
||||
const primaryName = escapeRegex(path.basename(primary));
|
||||
assert.match(res.stderr, new RegExp(`Actual root:[^\\n]*${primaryName}`), 'FATAL must name the actual (wrong) root');
|
||||
assert.doesNotMatch(res.stderr, new RegExp(`Actual root:[^\\n]*orchestrator-wt`), 'the actual root must NOT be the pinned lane');
|
||||
@@ -354,7 +354,7 @@ describe('bug #4254: sequential executor supplied-root pin', () => {
|
||||
});
|
||||
|
||||
test('#4254: correct-cwd control — matching root permits the write', () => {
|
||||
const { primary, lane } = makeOrchestratorLane('gsd-4254-match-');
|
||||
const { primary, lane } = makeOrchestratorLane('msd-4254-match-');
|
||||
try {
|
||||
const marker = path.join(lane, 'write-marker');
|
||||
const res = runPinGuard(lane, lane, `printf 'W' > ${shellQuote(marker)}`);
|
||||
@@ -366,7 +366,7 @@ describe('bug #4254: sequential executor supplied-root pin', () => {
|
||||
});
|
||||
|
||||
test('#4254: unexpanded or empty pin fails closed (never warn-and-proceed inside a pin block)', () => {
|
||||
const { primary, lane } = makeOrchestratorLane('gsd-4254-unbound-');
|
||||
const { primary, lane } = makeOrchestratorLane('msd-4254-unbound-');
|
||||
try {
|
||||
const marker = path.join(lane, 'write-marker');
|
||||
// Unexpanded: the orchestrator never performed the build-time substitution.
|
||||
@@ -388,7 +388,7 @@ describe('bug #4254: sequential executor supplied-root pin', () => {
|
||||
});
|
||||
|
||||
test('#4254: normalization — trailing slash, symlink alias, subdirectory cwd, and unresolved temp-root spelling all match', () => {
|
||||
const { primary, lane } = makeOrchestratorLane('gsd-4254-norm-');
|
||||
const { primary, lane } = makeOrchestratorLane('msd-4254-norm-');
|
||||
try {
|
||||
const alias = `${primary}-alias`;
|
||||
fs.symlinkSync(lane, alias, 'junction');
|
||||
@@ -412,8 +412,8 @@ describe('bug #4254: sequential executor supplied-root pin', () => {
|
||||
});
|
||||
|
||||
test('#4254: boundary — registered submodule of the pinned checkout commits; unregistered and sibling checkouts halt', () => {
|
||||
const primary = createTempGitProject('gsd-4254-super-');
|
||||
const subSource = createTempGitProject('gsd-4254-subsource-');
|
||||
const primary = createTempGitProject('msd-4254-super-');
|
||||
const subSource = createTempGitProject('msd-4254-subsource-');
|
||||
try {
|
||||
gitOrThrow(['-c', 'protocol.file.allow=always', 'submodule', 'add', '-q', subSource, 'module'], { cwd: primary });
|
||||
gitOrThrow(['commit', '-qm', 'chore: register submodule'], { cwd: primary });
|
||||
@@ -442,8 +442,8 @@ describe('bug #4254: sequential executor supplied-root pin', () => {
|
||||
});
|
||||
|
||||
test('#4254: pin outside any git repo, and cwd outside any git repo, both fail closed', () => {
|
||||
const { primary, lane } = makeOrchestratorLane('gsd-4254-norepo-');
|
||||
const outside = fs.mkdtempSync(path.join(require('node:os').tmpdir(), 'gsd-4254-outside-'));
|
||||
const { primary, lane } = makeOrchestratorLane('msd-4254-norepo-');
|
||||
const outside = fs.mkdtempSync(path.join(require('node:os').tmpdir(), 'msd-4254-outside-'));
|
||||
try {
|
||||
assert.equal(runPinGuard(lane, outside).exitCode, 1, 'pin outside a repo must halt');
|
||||
assert.equal(runPinGuard(outside, lane).exitCode, 1, 'cwd outside a repo must halt');
|
||||
@@ -454,7 +454,7 @@ describe('bug #4254: sequential executor supplied-root pin', () => {
|
||||
});
|
||||
|
||||
test('#4254: shell-metacharacter pin is safely quoted — no command substitution executes', () => {
|
||||
const { primary, lane } = makeOrchestratorLane('gsd-4254-meta-');
|
||||
const { primary, lane } = makeOrchestratorLane('msd-4254-meta-');
|
||||
try {
|
||||
const tricky = path.join(primary, `q' $HOME $(touch PWNED) x`);
|
||||
fs.symlinkSync(lane, tricky, 'junction');
|
||||
@@ -469,7 +469,7 @@ describe('bug #4254: sequential executor supplied-root pin', () => {
|
||||
});
|
||||
|
||||
test('#4254: relative pin is rejected; Windows drive-letter forms pass the form gate and fail only at the git lookup', () => {
|
||||
const { primary, lane } = makeOrchestratorLane('gsd-4254-forms-');
|
||||
const { primary, lane } = makeOrchestratorLane('msd-4254-forms-');
|
||||
try {
|
||||
// Relative pins are never trustworthy across cwds — rejected outright,
|
||||
// and the FATAL says so at the form-gate stage.
|
||||
|
||||
Reference in New Issue
Block a user