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

@@ -1,6 +1,6 @@
#!/usr/bin/env node
/**
* Copy GSD hooks to dist for installation.
* Copy MSD hooks to dist for installation.
* Validates JavaScript syntax before copying to prevent shipping broken hooks.
* See #1107, #1109, #1125, #1161 — a duplicate const declaration shipped
* in dist and caused PostToolUse hook errors for all users.
@@ -24,73 +24,73 @@ const STAGE_DIR = path.join(HOOKS_DIR, `.dist-staging-${process.pid}`);
// Hooks to copy (pure Node.js, no bundling needed)
const HOOKS_TO_COPY = [
'gsd-check-update-worker.js',
'gsd-check-update.js',
'msd-check-update-worker.js',
'msd-check-update.js',
// SessionStart canonical-path bootstrap (#997). In a Claude Code marketplace
// plugin install, ~/.claude/gsd-core is never created, so every
// `@~/.claude/gsd-core/...` include in agents/commands/templates resolves to
// plugin install, ~/.claude/msd-core is never created, so every
// `@~/.claude/msd-core/...` include in agents/commands/templates resolves to
// nothing. This hook symlinks the canonical path's immutable subdirs to the
// plugin's bundled gsd-core/ tree; no-op in classic installs. Must ship to
// plugin's bundled msd-core/ tree; no-op in classic installs. Must ship to
// dist so the installer copies it into the target hooks/ dir.
'gsd-ensure-canonical-path.js',
// Required by gsd-check-update-worker.js at runtime — must ship alongside it
'msd-ensure-canonical-path.js',
// Required by msd-check-update-worker.js at runtime — must ship alongside it
// so require('./managed-hooks-registry.cjs') resolves in the installed hooks/ dir.
'managed-hooks-registry.cjs',
'gsd-context-monitor.js',
'msd-context-monitor.js',
// Cursor lifecycle hooks (#777 + ADR-1239/#2089): 6 managed events
'gsd-cursor-session-start.js',
'gsd-cursor-post-tool.js',
'gsd-cursor-pre-tool.js',
'gsd-cursor-stop.js',
'gsd-cursor-subagent-start.js',
'gsd-cursor-subagent-stop.js',
'msd-cursor-session-start.js',
'msd-cursor-post-tool.js',
'msd-cursor-pre-tool.js',
'msd-cursor-stop.js',
'msd-cursor-subagent-start.js',
'msd-cursor-subagent-stop.js',
// Windsurf/Cascade lifecycle hooks (ADR-1239/#2100 Stage 2): 2 blocking events
'gsd-windsurf-pre-write.js',
'gsd-windsurf-pre-command.js',
// Claude Code FileChanged hook (#770) — hot-reloads gsd config when
'msd-windsurf-pre-write.js',
'msd-windsurf-pre-command.js',
// Claude Code FileChanged hook (#770) — hot-reloads msd config when
// .planning/config.json changes mid-session. Must ship to dist so the
// installer can copy it to the target hooks/ dir and register FileChanged.
'gsd-config-reload.js',
'msd-config-reload.js',
// Agent-dispatch isolation guard (#3045): blocks an executor Agent()
// dispatch missing its harness isolation parameter when the project
// resolves to harness-worktree. Requires the sibling
// gsd-core/bin/lib/{runtime-name-policy,capability-registry}.cjs modules
// at runtime — those ship as part of the full gsd-core/ tree, not via this
// msd-core/bin/lib/{runtime-name-policy,capability-registry}.cjs modules
// at runtime — those ship as part of the full msd-core/ tree, not via this
// list.
'gsd-agent-isolation-guard.js',
'gsd-prompt-guard.js',
'gsd-read-guard.js',
'gsd-read-injection-scanner.js',
'msd-agent-isolation-guard.js',
'msd-prompt-guard.js',
'msd-read-guard.js',
'msd-read-injection-scanner.js',
// Secret-file read guard (#4221) — replaces the installer's Read(.env*) deny rules
'gsd-secret-read-guard.js',
'gsd-statusline.js',
'gsd-update-banner.js',
'gsd-workflow-guard.js',
'gsd-worktree-path-guard.js',
'msd-secret-read-guard.js',
'msd-statusline.js',
'msd-update-banner.js',
'msd-workflow-guard.js',
'msd-worktree-path-guard.js',
// Catastrophic-shrink guard for curated .planning/ artifacts (#2255, fix 3 of #973)
'gsd-write-guard.js',
'msd-write-guard.js',
// Community hooks (bash, opt-in via .planning/config.json hooks.community)
'gsd-session-state.sh',
'gsd-validate-commit.sh',
'gsd-phase-boundary.sh',
'msd-session-state.sh',
'msd-validate-commit.sh',
'msd-phase-boundary.sh',
// Portable node resolver (#3662). Managed JS hook commands under
// --portable-hooks route through it (bash <resolver> <baked-node>
// <script>) so node resolves at hook-fire time in every environment
// sharing the config root. It IS registered in MANAGED_HOOKS
// (managed-hooks-registry.cjs) for staleness tracking like every other
// shipped .sh hook, and install.js stamps its {{GSD_VERSION}} header the
// shipped .sh hook, and install.js stamps its {{MSD_VERSION}} header the
// same way (#4076 — the prior comment here claimed the opposite on both
// counts, which is why the header was missing and staleness detection was
// permanently broken for this file).
'gsd-node-runner.sh',
'msd-node-runner.sh',
// Graphify auto-update hook (#3347 / PR #3557 / #3579). Opt-in via
// .planning/config.json graphify.auto_update; off by default.
'gsd-graphify-update.sh'
'msd-graphify-update.sh'
];
// Subdirectories under hooks/ whose contents must also ship to dist. Each
// entry is copied as `hooks/<dir>/*` → `hooks/dist/<dir>/*` so detached
// helpers (e.g. hooks/lib/gsd-graphify-rebuild.sh) resolve from the hook's
// helpers (e.g. hooks/lib/msd-graphify-rebuild.sh) resolve from the hook's
// installed runtime path. See #3579.
const HOOKS_SUBDIRS_TO_COPY = ['lib'];
@@ -208,7 +208,7 @@ function build() {
// destination — readers (install.js subprocesses spawned by parallel
// install tests) can observe the dest empty or partial mid-write,
// producing flaky failures such as bug-2136 part 4 where installed .sh
// hooks lacked their "# gsd-hook-version:" header. POSIX rename(2)
// hooks lacked their "# msd-hook-version:" header. POSIX rename(2)
// makes the swap atomic so readers see either the old file or the new
// file. The staging file lives outside DIST_DIR so readdirSync(DIST_DIR)
// (in install.js and tests) never observes a transient ".tmp" sibling.