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

@@ -9,7 +9,7 @@
* - resolveLoopHooks pure-function with realRegistry (predicate.equals integer contract)
*
* NOTE (updated #3559): ship:pre now HAS a runnable evaluator. #2008/ADR-2008 shipped
* evaluatePredicate behind `gsd_run check predicate`, and #3559 wired ship.md's preflight
* evaluatePredicate behind `msd_run check predicate`, and #3559 wired ship.md's preflight
* onto it with a generic kind=="gate" dispatch loop, so a third-party capability's gate is
* evaluated instead of resolved-then-dropped. The check.predicate shape is still asserted
* here to pin the Hyrum's-law contract for downstream consumers. The former "prose only /
@@ -29,18 +29,18 @@ const { spawnSync } = require('node:child_process');
const { cleanup, installSpawnEnv } = require('./helpers.cjs');
const { LOOP_HOOK_POINT_CLI_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
const GSD_TOOLS = path.join(__dirname, '..', 'gsd-core', 'bin', 'gsd-tools.cjs');
const MSD_TOOLS = path.join(__dirname, '..', 'msd-core', 'bin', 'msd-tools.cjs');
const {
resolveLoopHooks,
} = require('../gsd-core/bin/lib/loop-resolver.cjs');
} = require('../msd-core/bin/lib/loop-resolver.cjs');
const realRegistry = require('../gsd-core/bin/lib/capability-registry.cjs');
const realRegistry = require('../msd-core/bin/lib/capability-registry.cjs');
// ─── Helpers ──────────────────────────────────────────────────────────────────
/**
* Run gsd-tools synchronously via spawnSync. Returns { status, stdout, stderr }.
* Run msd-tools synchronously via spawnSync. Returns { status, stdout, stderr }.
* Does NOT throw on non-zero exit — callers must assert status themselves.
*
* #4291: uses helpers.cjs's installSpawnEnv() rather than a hand-rolled env,
@@ -50,11 +50,11 @@ const realRegistry = require('../gsd-core/bin/lib/capability-registry.cjs');
* Without it, a capability genuinely installed on the host running the
* suite (e.g. beads, markdown-linting) leaked into the ship:pre registry
* and inflated the exact-count assertions below. opts.env is spread last so
* the two deliberate overlay-fixture call sites below (GSD_HOME: fixture.home)
* the two deliberate overlay-fixture call sites below (MSD_HOME: fixture.home)
* still opt in to a specific third-party capability root.
*/
function runTools(args, opts = {}) {
const result = spawnSync(process.execPath, [GSD_TOOLS, ...args], {
const result = spawnSync(process.execPath, [MSD_TOOLS, ...args], {
encoding: 'utf8',
timeout: LOOP_HOOK_POINT_CLI_TIMEOUT_MS,
cwd: opts.cwd || process.cwd(),
@@ -340,7 +340,7 @@ describe('real registry ship:pre — structural guards', () => {
// subprocess tests. This machinery shipped in #2008/ADR-2008 and was never
// wired at ship:pre; these rows pin the contract the prose depends on.
const SHIP_MD = path.join(__dirname, '..', 'gsd-core', 'workflows', 'ship.md');
const SHIP_MD = path.join(__dirname, '..', 'msd-core', 'workflows', 'ship.md');
// The repo's shared generic-gate-dispatch phrasing, used verbatim at execute:wave:post
// (execute-phase.md), execute:post (execute-phase.md) and plan:post (plan-phase.md).
@@ -357,7 +357,7 @@ const GENERIC_GATE_LOOP = /For each active entry where\s+`kind == "gate"`/;
*/
function preflightRegion() {
// allow-test-rule: source-text-is-the-product (#3559)
// gsd-core/workflows/ship.md is shipped content executed by the agent runtime — its
// msd-core/workflows/ship.md is shipped content executed by the agent runtime — its
// text is the deployed gate-dispatch contract, not an implementation detail behind it.
const src = fs.readFileSync(SHIP_MD, 'utf8');
const open = src.indexOf('<step name="preflight_checks">');
@@ -406,7 +406,7 @@ describe('ship:pre gate dispatch contract (#3559)', () => {
assert.match(
region,
/gsd_run check predicate --predicate/,
/msd_run check predicate --predicate/,
'preflight must dispatch predicate gates through the generic evaluator CLI (ADR-2008/#2008), ' +
'not re-implement each capability\'s predicate inline',
);
@@ -426,7 +426,7 @@ describe('ship:pre gate dispatch contract (#3559)', () => {
// Adversarial-review finding: asserting only that the shared loop phrase and the
// evaluator substrings CO-OCCUR somewhere in the region is too weak. A partial
// regression that keeps the loop phrase but deletes the default arm — leaving prose
// that merely name-drops `gsd_run check predicate` and the onError/blocking words —
// that merely name-drops `msd_run check predicate` and the onError/blocking words —
// would satisfy those assertions while silently reintroducing #3559. The load-bearing
// structure is a distinguishable DEFAULT branch, positioned after every named one.
const catchAll = region.search(/\*\*Every other `capId`\*\*/);
@@ -448,7 +448,7 @@ describe('ship:pre gate dispatch contract (#3559)', () => {
// The catch-all is the arm that must reach the generic evaluator; a default branch that
// does not evaluate anything is the bug wearing a different shape.
const evaluatorAt = region.search(/gsd_run check predicate --predicate/);
const evaluatorAt = region.search(/msd_run check predicate --predicate/);
assert.ok(
evaluatorAt > catchAll,
'the generic predicate evaluator must be invoked from inside the catch-all arm, not merely ' +
@@ -508,15 +508,15 @@ describe('ship:pre gate dispatch contract (#3559)', () => {
// ─── 5b. Generic evaluator contract the ship:pre dispatch now drives (#3559) ──
/**
* Build a temp GSD_HOME carrying a third-party overlay capability that declares one
* Build a temp MSD_HOME carrying a third-party overlay capability that declares one
* blocking ship:pre gate, plus a temp project with a phase artifact to evaluate against.
*
* GLOBAL scope (under GSD_HOME) is trusted without a consent record (ADR-1244 / #1459);
* GLOBAL scope (under MSD_HOME) is trusted without a consent record (ADR-1244 / #1459);
* PROJECT scope would require a consent-store entry, which is a different concern.
*/
function makeOverlayFixture(blockingOpenLine) {
const home = fs.mkdtempSync(path.join(os.tmpdir(), 'ship-pre-3559-home-'));
const capDir = path.join(home, '.gsd', 'capabilities', 'beads');
const capDir = path.join(home, '.msd', 'capabilities', 'beads');
fs.mkdirSync(capDir, { recursive: true });
fs.writeFileSync(path.join(capDir, 'capability.json'), JSON.stringify({
id: 'beads',
@@ -525,7 +525,7 @@ function makeOverlayFixture(blockingOpenLine) {
role: 'feature',
tier: 'full',
description: 'Third-party capability declaring a blocking ship:pre gate (#3559 fixture).',
engines: { gsd: '>=1.7.0' },
engines: { msd: '>=1.7.0' },
requires: [],
runtimeCompat: { supported: ['claude'], unsupported: [] },
skills: [],
@@ -567,7 +567,7 @@ const BEADS_PREDICATE = JSON.stringify({
function runCheckPredicate(fixture, predicateJson) {
return runTools(
['check', 'predicate', '--predicate', predicateJson || BEADS_PREDICATE, '--phase-dir', fixture.phaseDir, '--raw'],
{ cwd: fixture.project, env: { GSD_HOME: fixture.home } },
{ cwd: fixture.project, env: { MSD_HOME: fixture.home } },
);
}
@@ -641,7 +641,7 @@ describe('ship:pre generic gate evaluation — third-party overlay gate (#3559)'
t.after(() => { cleanup(fx.home); cleanup(fx.project); });
const result = runTools(['loop', 'render-hooks', 'ship:pre', '--raw'],
{ cwd: fx.project, env: { GSD_HOME: fx.home } });
{ cwd: fx.project, env: { MSD_HOME: fx.home } });
assert.strictEqual(result.status, 0, `render-hooks must exit 0; stderr: ${result.stderr}`);
const envelope = JSON.parse(result.stdout.trim());
@@ -676,10 +676,10 @@ describe('ship:pre generic gate evaluation — third-party overlay gate (#3559)'
// fails here instead of shipping — which is the same "hardcoded list silently misses
// members" mistake #3559 itself was.
const WORKFLOWS_DIR = path.join(__dirname, '..', 'gsd-core', 'workflows');
const WORKFLOWS_DIR = path.join(__dirname, '..', 'msd-core', 'workflows');
// A manifest-supplied query interpolated into a shell command substitution.
const SHELL_INTERPOLATED_QUERY = /gsd_run check \$\{hook\.check\.query\}/;
const SHELL_INTERPOLATED_QUERY = /msd_run check \$\{hook\.check\.query\}/;
// The charset a query must be validated against before it may be run. Stated ONCE, in the
// reference — restating it at five sites would be the drift this PR just repaired.
const VALIDATION_CHARSET = /\^\[a-z\]\[a-z0-9-\]\*\( \[a-z\]\[a-z0-9-\]\*\)\*\$/;
@@ -689,7 +689,7 @@ const VALIDATE_MANDATE = /Validate `check` before shell use/;
function workflowFilesWithShellInterpolatedQuery() {
// allow-test-rule: source-text-is-the-product (#3559)
// gsd-core/workflows/*.md are shipped content executed by the agent runtime — the text
// msd-core/workflows/*.md are shipped content executed by the agent runtime — the text
// IS the deployed dispatch contract, so the validation instruction only exists here.
return fs.readdirSync(WORKFLOWS_DIR)
.filter(name => name.endsWith('.md'))
@@ -746,7 +746,7 @@ describe('capability gate dispatch — manifest input is validated before shell
test('the reference contract states the rule for gates, not only for steps', () => {
// allow-test-rule: source-text-is-the-product (#3559)
const ref = fs.readFileSync(
path.join(__dirname, '..', 'gsd-core', 'references', 'loop-hook-dispatch.md'), 'utf8');
path.join(__dirname, '..', 'msd-core', 'references', 'loop-hook-dispatch.md'), 'utf8');
const gateSection = ref.slice(ref.indexOf('### `gate`'));
assert.notStrictEqual(gateSection.length, 0, 'the reference must carry a gate section');
@@ -762,7 +762,7 @@ describe('capability gate dispatch — manifest input is validated before shell
test('onError vocabulary matches what the registry and every manifest actually use', () => {
// allow-test-rule: source-text-is-the-product (#3559)
const ref = fs.readFileSync(
path.join(__dirname, '..', 'gsd-core', 'references', 'loop-hook-dispatch.md'), 'utf8');
path.join(__dirname, '..', 'msd-core', 'references', 'loop-hook-dispatch.md'), 'utf8');
// The reference documented skip/"fail"; the generated registry, every shipped manifest,
// and all four dispatch sites use skip/halt. "fail" was a value nothing could ever emit,