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

@@ -7,7 +7,7 @@
* table as the single source of truth.
*
* ADR-457 build-at-publish: source in src/verification.cts, compiled to
* gsd-core/bin/lib/verification.cjs (gitignored).
* msd-core/bin/lib/verification.cjs (gitignored).
*
* DEFECT.FRONTMATTER-SCALAR-BROAD-GREP fix: status extraction is scoped to
* the leading YAML frontmatter block only. A `status:` line in the body (e.g.
@@ -44,7 +44,7 @@ import coreUtilsMod = require('./core-utils.cjs');
// eslint-disable-next-line @typescript-eslint/no-require-imports -- planning-scope.cjs is an export= CommonJS module
import planningScopeMod = require('./planning-scope.cjs');
import { execGit } from './shell-command-projection.cjs';
import { formatGsdSlash, resolveRuntime } from './runtime-slash.cjs';
import { formatMsdSlash, resolveRuntime } from './runtime-slash.cjs';
import { isContainedIn } from './security.cjs';
const { output, error } = io;
@@ -56,7 +56,7 @@ type Scope = planningScopeMod.Scope;
// ─── Constants ────────────────────────────────────────────────────────────────
/** The set of status values that the gsd-verifier agent emits. */
/** The set of status values that the msd-verifier agent emits. */
const VERIFIER_STATUSES: ReadonlyArray<string> = ['passed', 'gaps_found', 'human_needed'];
// ─── Routing table ────────────────────────────────────────────────────────────
@@ -74,7 +74,7 @@ interface VerificationRoute {
* later import from here instead of embedding their own message strings.
*
* INTERNAL SENTINELS: 'missing' and 'unknown' are operational states constructed
* internally — the verifier (gsd-verifier.md) never emits them. The verifier only
* internally — the verifier (msd-verifier.md) never emits them. The verifier only
* emits values in VERIFIER_STATUSES (passed|gaps_found|human_needed). The guard in
* readVerificationStatus excludes 'missing' and 'unknown' from raw-status table
* lookup so they can only be reached via internal construction paths.
@@ -83,10 +83,10 @@ interface VerificationRoute {
* by substituting the phase number — it is NOT stored as a function in the table.
*
* #2617: `next_command` here holds a BARE command name (`execute-phase`), never a
* prefixed one. Every return path projects it through `formatGsdSlash` with the
* caller's runtime, so Codex sees `$gsd-execute-phase` and slash-hyphen runtimes
* see `/gsd-execute-phase`. Storing a prefixed literal is what leaked the
* hard-coded (and deprecated) `/gsd:` colon form to every runtime.
* prefixed one. Every return path projects it through `formatMsdSlash` with the
* caller's runtime, so Codex sees `$msd-execute-phase` and slash-hyphen runtimes
* see `/msd-execute-phase`. Storing a prefixed literal is what leaked the
* hard-coded (and deprecated) `/msd:` colon form to every runtime.
*/
const VERIFICATION_ROUTING_TABLE: Record<string, VerificationRoute> = {
passed: {
@@ -114,7 +114,7 @@ const VERIFICATION_ROUTING_TABLE: Record<string, VerificationRoute> = {
status: 'stale',
// #4682: staleness means covered source files changed after the verifier
// last ran — the only remedy is re-running the verifier.
// /gsd-verify-work never rewrites VERIFICATION.md, so advising it from
// /msd-verify-work never rewrites VERIFICATION.md, so advising it from
// here was an advice loop. execute-phase resumes at the verification
// gates and re-runs the verifier (its resume tree routes a stale report
// to re-verification), which regenerates VERIFICATION.md and its digest.
@@ -150,14 +150,14 @@ const VERIFICATION_ROUTING_TABLE: Record<string, VerificationRoute> = {
* Project a BARE command name (plus optional argument tail) into the surface the
* given runtime actually installs (#2617).
*
* `formatGsdSlash` owns the per-runtime shape (`$gsd-<cmd>` for shell-var
* runtimes like Codex, `/gsd-<cmd>` otherwise) and is idempotent, so passing an
* `formatMsdSlash` owns the per-runtime shape (`$msd-<cmd>` for shell-var
* runtimes like Codex, `/msd-<cmd>` otherwise) and is idempotent, so passing an
* already-prefixed string is safe. An empty command stays empty — "no next
* command" must not become a bare prefix.
*/
function projectNextCommand(bare: string, runtime: string, tail = ''): string {
if (!bare) return '';
return `${formatGsdSlash(bare, runtime) as string}${tail}`;
return `${formatMsdSlash(bare, runtime) as string}${tail}`;
}
// ─── Helpers ─────────────────────────────────────────────────────────────────
@@ -344,7 +344,7 @@ function parseFingerprintVersion(digest: string): number | null {
* bytes are hashed exactly as they sit on disk. A covered text file checked
* out with CRLF line endings (e.g. a Windows checkout without a `.gitattributes
* eol=lf` rule pinning it to LF) hashes differently than the same file on an
* LF checkout — a real cross-platform digest mismatch, not a bug, since GSD
* LF checkout — a real cross-platform digest mismatch, not a bug, since MSD
* installs into arbitrary user projects with no guaranteed line-ending policy.
*
@@ -828,8 +828,8 @@ interface ReadVerificationStatusOptions {
/**
* Runtime whose command surface `next_command` is projected into (#2617).
* Callers that have a cwd should pass `resolveRuntime(cwd)`. Defaults to
* `'claude'`, which yields the canonical `/gsd-<cmd>` hyphen form — never the
* deprecated `/gsd:` colon form this field used to hard-code.
* `'claude'`, which yields the canonical `/msd-<cmd>` hyphen form — never the
* deprecated `/msd:` colon form this field used to hard-code.
*/
runtime?: string;
/**
@@ -976,7 +976,7 @@ function readVerificationStatus(
// Phase token for the gaps_found command — deliberately convention-LESS
// even when `opts.convention` is present: the token becomes a bare COMMAND
// ARGUMENT below, and a bare bracket phase number is milestone-ambiguous
// (`02` cannot tell GSD.01-02 from GSD.02-02), so the argument keeps its
// (`02` cannot tell MSD.01-02 from MSD.02-02), so the argument keeps its
// pre-#612 shape. The convention-aware token is derived separately for
// FILE RESOLUTION only (`resolutionToken`, at the readdir below).
const baseName = path.basename(phaseDir);
@@ -985,8 +985,8 @@ function readVerificationStatus(
// #2617: the phase number becomes a COMMAND ARGUMENT, so it is appended only
// when it is unambiguously one. extractPhaseToken also returns project-code
// forms (`PROJ-07`), which are indistinguishable by shape from an ordinary
// directory name — `gsd-651-parent` yields `gsd-651` — and emitting
// `execute-phase gsd-651` is worse than emitting no argument at all. Callers
// directory name — `msd-651-parent` yields `msd-651` — and emitting
// `execute-phase msd-651` is worse than emitting no argument at all. Callers
// that already know the number (init) pass it explicitly and always get it.
const phaseArgSource = opts.phaseNumber ?? (/^\d+(\.\d+)*$/.test(derivedPhaseNumber) ? derivedPhaseNumber : '');
const phaseArg = phaseArgSource ? ` ${phaseArgSource}` : '';
@@ -1284,7 +1284,7 @@ function cmdVerificationStatus(cwd: string, phaseDirArg: string | undefined, raw
*
* Emits `{ verification_file: "<absolute path>" | "" }` (empty when no
* candidate resolves, including an unreadable directory). `raw` emits the
* bare path string (possibly empty) so `VAR=$(gsd_run query
* bare path string (possibly empty) so `VAR=$(msd_run query
* verification.resolve-file "$PHASE_DIR" --raw)` is directly assignable.
*
* @param cwd - Current working directory (used to resolve phaseDirArg).
@@ -1315,7 +1315,7 @@ function cmdVerificationResolveFile(cwd: string, phaseDirArg: string | undefined
/**
* #4623: parse the argv tokens after `verification.fingerprint <phaseDir>`
* into a covered-file list. The router hands over a raw positional slice,
* so every `--files`-style form other `gsd-tools` verbs accept (`commit
* so every `--files`-style form other `msd-tools` verbs accept (`commit
* --files a b`, `docs/CLI-TOOLS.md`) used to reach `computeCoveredDigest`
* with the literal token `--files` — or an unsplit `"a,b"` — as a covered
* path, and the whole command failed closed with "a covered file is
@@ -1395,7 +1395,7 @@ function parseFingerprintFileArgs(tokens: readonly string[]): { files: string[]
* `parseFingerprintFileArgs`: covered-input paths
* relative to the project root, bare or via `--files`.
* @param raw - Whether to emit raw (non-JSON) output: just the
* `covered_digest` string, so `VAR=$(gsd_run query
* `covered_digest` string, so `VAR=$(msd_run query
* verification.fingerprint "$PHASE_DIR" ... --raw)` is
* directly assignable. `covered_files` is unambiguous
* from the caller's own input list in that mode, so