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:
@@ -25,15 +25,15 @@
|
||||
*
|
||||
* Lifecycle command checks (Cycle 2):
|
||||
* For each command name (other than 'init') in lifecycleCommands:
|
||||
* - Assert commands/gsd/<cmd>.md exists in the installed package
|
||||
* - Assert commands/msd/<cmd>.md exists in the installed package
|
||||
* - Parse the .md for a workflow @-import or inline reference
|
||||
* - Assert the referenced workflow .md exists in the installed package
|
||||
* If 'init' is in lifecycleCommands, runs `gsd-core --local --claude`
|
||||
* If 'init' is in lifecycleCommands, runs `msd-core --local --claude`
|
||||
* in fixtureDir to verify the installer is callable (INIT_FAILED on crash).
|
||||
* Non-interactive: --local --claude flags skip all prompts.
|
||||
*
|
||||
* Workflow-body checks (Cycle 3 — informational):
|
||||
* - Scans all installed gsd-core/workflows/*.md for /gsd:<known-cmd>
|
||||
* - Scans all installed msd-core/workflows/*.md for /msd:<known-cmd>
|
||||
* colon-namespace leaks (WORKFLOW_BODY_COLON_LEAK).
|
||||
* This check populates result.details with counters but does NOT return a
|
||||
* failure code by default; it is informational until enforcement is enabled.
|
||||
@@ -41,7 +41,7 @@
|
||||
* Configured-entrypoint checks (Cycle 4 — #4154):
|
||||
* For each runtime in entrypointRuntimes, runs the tarball-installed
|
||||
* installer into a throwaway HOME, then re-reads that runtime's own written
|
||||
* config files and asserts every GSD-managed script path they name resolves
|
||||
* config files and asserts every MSD-managed script path they name resolves
|
||||
* to a file (ENTRYPOINT_UNRESOLVED). Requires fixtureDir.
|
||||
*/
|
||||
|
||||
@@ -51,10 +51,10 @@ const { execFileSync, spawnSync } = require('child_process');
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const { PACKAGE_NAME } = require('../gsd-core/bin/lib/package-identity.cjs');
|
||||
const { PACKAGE_NAME } = require('../msd-core/bin/lib/package-identity.cjs');
|
||||
const { ExitError, runMain } = require('./lib/cli-exit.cjs');
|
||||
const shellCmdProjection = require('../gsd-core/bin/lib/shell-command-projection.cjs');
|
||||
const { escapeRegex } = require('../gsd-core/bin/lib/pattern.cjs');
|
||||
const shellCmdProjection = require('../msd-core/bin/lib/shell-command-projection.cjs');
|
||||
const { escapeRegex } = require('../msd-core/bin/lib/pattern.cjs');
|
||||
// 120 s proved too tight for cold-cache `npm install -g` of a 1499-file tarball:
|
||||
// spawnSync fires SIGTERM at the deadline and returns { status: null, stdout: '',
|
||||
// stderr: '' } (Node docs: status is null when a subprocess is terminated by a
|
||||
@@ -122,7 +122,7 @@ const SMOKE = Object.freeze({
|
||||
function binInvocation(binPath, args = []) {
|
||||
const lower = binPath.toLowerCase();
|
||||
// Note: .ps1 shims are intentionally NOT handled here. The bin-resolution
|
||||
// helpers (findGsdToolsBin / findInstallerBin) only ever surface a .cmd path
|
||||
// helpers (findMsdToolsBin / findInstallerBin) only ever surface a .cmd path
|
||||
// on Windows — npm does not write .ps1 shims into .bin/ by default — so a
|
||||
// .ps1 path never reaches this function in practice.
|
||||
if (lower.endsWith('.cmd') || lower.endsWith('.bat')) {
|
||||
@@ -141,7 +141,7 @@ function binInvocation(binPath, args = []) {
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Locate the lib/node_modules/@opengsd/gsd-core package root inside
|
||||
* Locate the lib/node_modules/@golem15/msd-core package root inside
|
||||
* an npm --prefix install directory.
|
||||
*/
|
||||
function pkgRoot(installPrefix) {
|
||||
@@ -180,20 +180,20 @@ function binCandidates(installPrefix, name) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Locate the installed gsd-tools binary (symlink in <prefix>/bin/).
|
||||
* Locate the installed msd-tools binary (symlink in <prefix>/bin/).
|
||||
*/
|
||||
function findGsdToolsBin(installPrefix) {
|
||||
for (const c of binCandidates(installPrefix, 'gsd-tools')) {
|
||||
function findMsdToolsBin(installPrefix) {
|
||||
for (const c of binCandidates(installPrefix, 'msd-tools')) {
|
||||
if (fs.existsSync(c)) return c;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locate the gsd-core installer binary (the symlink in <prefix>/bin/).
|
||||
* Locate the msd-core installer binary (the symlink in <prefix>/bin/).
|
||||
*/
|
||||
function findInstallerBin(installPrefix) {
|
||||
for (const c of binCandidates(installPrefix, 'gsd-core')) {
|
||||
for (const c of binCandidates(installPrefix, 'msd-core')) {
|
||||
if (fs.existsSync(c)) return c;
|
||||
}
|
||||
return null;
|
||||
@@ -205,15 +205,15 @@ function findInstallerBin(installPrefix) {
|
||||
* Structured parser — only inspects individual lines; never regexes on the
|
||||
* whole-file string. Two recognised forms (in priority order):
|
||||
*
|
||||
* 1. @-import line: `@~/.claude/gsd-core/workflows/<name>.md`
|
||||
* 2. Inline mention: any line containing `~/.claude/gsd-core/workflows/<name>.md`
|
||||
* 1. @-import line: `@~/.claude/msd-core/workflows/<name>.md`
|
||||
* 2. Inline mention: any line containing `~/.claude/msd-core/workflows/<name>.md`
|
||||
* (takes the LAST occurrence so conditional-dispatch files resolve to the
|
||||
* default / unconditional branch, e.g. discuss-phase.md)
|
||||
*
|
||||
* Returns the bare workflow filename (e.g. `"discuss-phase.md"`) or null.
|
||||
*/
|
||||
function parseWorkflowRef(mdContent) {
|
||||
const WORKFLOW_PREFIX = 'gsd-core/workflows/';
|
||||
const WORKFLOW_PREFIX = 'msd-core/workflows/';
|
||||
let atImportResult = null;
|
||||
let lastInlineResult = null;
|
||||
|
||||
@@ -248,11 +248,11 @@ function parseWorkflowRef(mdContent) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the list of known GSD command names from the installed package.
|
||||
* Read the list of known MSD command names from the installed package.
|
||||
* Returns an array of strings like `['init', 'discuss-phase', ...]`.
|
||||
*/
|
||||
function readInstalledCmdNames(pkg) {
|
||||
const commandsDir = path.join(pkg, 'commands', 'gsd');
|
||||
const commandsDir = path.join(pkg, 'commands', 'msd');
|
||||
if (!fs.existsSync(commandsDir)) return [];
|
||||
return fs.readdirSync(commandsDir)
|
||||
.filter((f) => f.endsWith('.md'))
|
||||
@@ -260,18 +260,18 @@ function readInstalledCmdNames(pkg) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Scan a single workflow .md file for /gsd:<cmd> colon-namespace leaks.
|
||||
* Scan a single workflow .md file for /msd:<cmd> colon-namespace leaks.
|
||||
*
|
||||
* Uses the word-boundary-safe regex shape from scripts/fix-slash-commands.cjs:
|
||||
* /gsd-(<cmd1>|<cmd2>|...)(?=[^a-zA-Z0-9_-]|$)/g — forward
|
||||
* We check the colon form: /gsd:<cmd> leaking in installed workflow bodies.
|
||||
* /msd-(<cmd1>|<cmd2>|...)(?=[^a-zA-Z0-9_-]|$)/g — forward
|
||||
* We check the colon form: /msd:<cmd> leaking in installed workflow bodies.
|
||||
*
|
||||
* Returns the first leaking { line, lineNumber } or null.
|
||||
*/
|
||||
function scanWorkflowColonLeak(filePath, cmdNames) {
|
||||
if (!cmdNames || cmdNames.length === 0) return null;
|
||||
const sorted = [...cmdNames].sort((a, b) => b.length - a.length);
|
||||
const pattern = new RegExp(`/gsd:(${sorted.join('|')})(?=[^a-zA-Z0-9_-]|$)`, 'g');
|
||||
const pattern = new RegExp(`/msd:(${sorted.join('|')})(?=[^a-zA-Z0-9_-]|$)`, 'g');
|
||||
|
||||
const content = fs.readFileSync(filePath, 'utf-8');
|
||||
const lines = content.split(/\r?\n/);
|
||||
@@ -290,17 +290,17 @@ function scanWorkflowColonLeak(filePath, cmdNames) {
|
||||
|
||||
/**
|
||||
* Top-level config files this scan reads. These are the surfaces that carry
|
||||
* every GSD-managed launch path for the runtimes Cycle 4 actually installs
|
||||
* every MSD-managed launch path for the runtimes Cycle 4 actually installs
|
||||
* (`entrypointRuntimes`, default claude + codex): claude registers into
|
||||
* settings.json, codex into hooks.json and config.toml.
|
||||
*
|
||||
* This is NOT an exhaustive map of where GSD writes launch paths across all
|
||||
* This is NOT an exhaustive map of where MSD writes launch paths across all
|
||||
* runtimes, and the scan is top-level only by design. Two known surfaces sit
|
||||
* outside it: Cline registers its hook at `.clinerules/hooks/PreToolUse` (a
|
||||
* subdirectory, and not one of these names — see writeClineArtifacts in
|
||||
* src/runtime-hooks-surface.cts), and Kimi's native `[[hooks]]` config.toml
|
||||
* lives under `resolveKimiHooksTomlDir()` (`~/.kimi`), a directory separate
|
||||
* from Kimi's own GSD configDir. Adding either runtime to entrypointRuntimes
|
||||
* from Kimi's own MSD configDir. Adding either runtime to entrypointRuntimes
|
||||
* requires teaching scanConfiguredEntrypoints about its surface first,
|
||||
* otherwise the scan reports zero entrypoints and silently proves nothing.
|
||||
*/
|
||||
@@ -455,18 +455,18 @@ function runSmoke({
|
||||
};
|
||||
}
|
||||
|
||||
// --- Locate the installed gsd-tools binary --------------------------------
|
||||
const actualBin = findGsdToolsBin(installPrefix);
|
||||
// --- Locate the installed msd-tools binary --------------------------------
|
||||
const actualBin = findMsdToolsBin(installPrefix);
|
||||
|
||||
if (!actualBin) {
|
||||
const searched = binCandidates(installPrefix, 'gsd-tools');
|
||||
const searched = binCandidates(installPrefix, 'msd-tools');
|
||||
return {
|
||||
code: SMOKE.BIN_NOT_CALLABLE,
|
||||
details: { ...details, searched },
|
||||
};
|
||||
}
|
||||
|
||||
// --- Invoke `gsd-tools --help` to assert the shipped binary is callable ---
|
||||
// --- Invoke `msd-tools --help` to assert the shipped binary is callable ---
|
||||
// Use effectiveNpmEnv so the installed binary sees an isolated HOME on Docker
|
||||
// hosts where HOME may be unwritable (same isolation as the npm install). (#131)
|
||||
const versionInvocation = binInvocation(actualBin, ['--help']);
|
||||
@@ -520,18 +520,18 @@ function runSmoke({
|
||||
code: SMOKE.INIT_FAILED,
|
||||
details: {
|
||||
...details,
|
||||
reason: 'gsd-core binary not found in installPrefix',
|
||||
reason: 'msd-core binary not found in installPrefix',
|
||||
installPrefix,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
// Non-interactive: --local --claude installs to .claude/ in cwd (fixtureDir).
|
||||
// GSD_TEST_MODE must be cleared — install.js skips its main() block when
|
||||
// GSD_TEST_MODE is set, which would cause the installer to exit 0 silently
|
||||
// MSD_TEST_MODE must be cleared — install.js skips its main() block when
|
||||
// MSD_TEST_MODE is set, which would cause the installer to exit 0 silently
|
||||
// without actually creating any files.
|
||||
const initEnv = { ...process.env };
|
||||
delete initEnv.GSD_TEST_MODE;
|
||||
delete initEnv.MSD_TEST_MODE;
|
||||
|
||||
const initInvocation = binInvocation(installerBin, ['--local', '--claude']);
|
||||
const initResult = spawnSync(
|
||||
@@ -563,7 +563,7 @@ function runSmoke({
|
||||
// Verify expected dirs were created
|
||||
const expectedDirs = [
|
||||
path.join(fixtureDir, '.claude', 'commands'),
|
||||
path.join(fixtureDir, '.claude', 'gsd-core'),
|
||||
path.join(fixtureDir, '.claude', 'msd-core'),
|
||||
];
|
||||
for (const dir of expectedDirs) {
|
||||
if (!fs.existsSync(dir) || !fs.statSync(dir).isDirectory()) {
|
||||
@@ -583,7 +583,7 @@ function runSmoke({
|
||||
const lifecycleResolved = [];
|
||||
|
||||
for (const cmd of commandsToCheck) {
|
||||
const cmdFilePath = path.join(pkg, 'commands', 'gsd', `${cmd}.md`);
|
||||
const cmdFilePath = path.join(pkg, 'commands', 'msd', `${cmd}.md`);
|
||||
|
||||
if (!fs.existsSync(cmdFilePath) || !fs.statSync(cmdFilePath).isFile()) {
|
||||
return {
|
||||
@@ -602,9 +602,9 @@ function runSmoke({
|
||||
|
||||
let workflowPath = null;
|
||||
if (workflowName) {
|
||||
// Workflow files live at gsd-core/workflows/<name> in the package.
|
||||
// Workflow files live at msd-core/workflows/<name> in the package.
|
||||
// Some live in subdirectories; try flat first then scan once.
|
||||
const flat = path.join(pkg, 'gsd-core', 'workflows', workflowName);
|
||||
const flat = path.join(pkg, 'msd-core', 'workflows', workflowName);
|
||||
workflowPath = fs.existsSync(flat) ? flat : null;
|
||||
|
||||
if (!workflowPath) {
|
||||
@@ -633,7 +633,7 @@ function runSmoke({
|
||||
// ─────────────────────────────────────────────────────────────────────────
|
||||
|
||||
// --- Workflow-body checks (informational — #3668 not yet fixed) ----------
|
||||
const workflowsDir = path.join(pkg, 'gsd-core', 'workflows');
|
||||
const workflowsDir = path.join(pkg, 'msd-core', 'workflows');
|
||||
const installedCmdNames = readInstalledCmdNames(pkg);
|
||||
|
||||
let workflowsScanned = 0;
|
||||
@@ -697,8 +697,8 @@ function runSmoke({
|
||||
HOME: runtimeHome,
|
||||
USERPROFILE: runtimeHome,
|
||||
// Same reason as the init check above: install.js skips its main()
|
||||
// block when GSD_TEST_MODE is set and would exit 0 writing nothing.
|
||||
GSD_TEST_MODE: '',
|
||||
// block when MSD_TEST_MODE is set and would exit 0 writing nothing.
|
||||
MSD_TEST_MODE: '',
|
||||
NO_UPDATE_NOTIFIER: '1',
|
||||
},
|
||||
timeout: CHILD_TIMEOUT_MS,
|
||||
@@ -707,7 +707,7 @@ function runSmoke({
|
||||
|
||||
if (installResult.status !== 0) {
|
||||
// #4249 (antigravity review): this is the Cycle 4 per-runtime install,
|
||||
// not Cycle 1's `gsd init` — SMOKE.INSTALL_FAILED is the code Cycle 2's
|
||||
// not Cycle 1's `msd init` — SMOKE.INSTALL_FAILED is the code Cycle 2's
|
||||
// identical spawnSync-failure check already uses for the same failure
|
||||
// class; reusing SMOKE.INIT_FAILED here conflated the two lifecycle
|
||||
// stages in the reported code.
|
||||
@@ -753,9 +753,9 @@ function cliMain() {
|
||||
const expectedVersion = process.env.SMOKE_FORCE_EXPECTED_VERSION || pkg.version;
|
||||
|
||||
// Pack the working tree into a temp directory
|
||||
const packDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-smoke-pack-'));
|
||||
const installPrefix = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-smoke-prefix-'));
|
||||
const fixtureDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-smoke-fixture-'));
|
||||
const packDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-smoke-pack-'));
|
||||
const installPrefix = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-smoke-prefix-'));
|
||||
const fixtureDir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-smoke-fixture-'));
|
||||
|
||||
let tarballPath;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user