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:
@@ -3,16 +3,16 @@
|
||||
|
||||
/**
|
||||
* lint-hooks-runtime-build-seam.cjs — every `hooks/**` file that requires a
|
||||
* compiled runtime-library module (`gsd-core/bin/lib/*.cjs`) must also go
|
||||
* through the self-healing build seam (`gsd-core/bin/ensure-runtime-build.cjs`,
|
||||
* compiled runtime-library module (`msd-core/bin/lib/*.cjs`) must also go
|
||||
* through the self-healing build seam (`msd-core/bin/ensure-runtime-build.cjs`,
|
||||
* #2002) before that require can be reached (#3582).
|
||||
*
|
||||
* ## Why
|
||||
*
|
||||
* `gsd-core/bin/lib/*.cjs` are compiled from `src/*.cts` by `npm run
|
||||
* `msd-core/bin/lib/*.cjs` are compiled from `src/*.cts` by `npm run
|
||||
* build:lib` (ADR-457, "build-at-publish") and are gitignored. The npm
|
||||
* package builds before publishing, so the artifacts exist on that path.
|
||||
* `gsd-core/bin/gsd-tools.cjs` calls `ensureRuntimeBuild()` before requiring
|
||||
* `msd-core/bin/msd-tools.cjs` calls `ensureRuntimeBuild()` before requiring
|
||||
* its own `./lib` — but a plugin-marketplace / git-clone install that never
|
||||
* runs `npm run build:lib` materializes the raw tree with the compiled
|
||||
* `./lib` absent, and NO hook self-healed before this issue. A hook that
|
||||
@@ -28,18 +28,18 @@
|
||||
* For every `.js`/`.cjs` file under `hooks/` (excluding the generated
|
||||
* `hooks/dist/` build-output copy, which is not source): if the file's code
|
||||
* (comments stripped) contains a `require(...)` of a path that names
|
||||
* `gsd-core/bin/lib/<name>.cjs` (any relative-path spelling — `../gsd-core/…`,
|
||||
* `../../gsd-core/…`, etc. — the segment `gsd-core/bin/lib/` plus a trailing
|
||||
* `msd-core/bin/lib/<name>.cjs` (any relative-path spelling — `../msd-core/…`,
|
||||
* `../../msd-core/…`, etc. — the segment `msd-core/bin/lib/` plus a trailing
|
||||
* `.cjs` is the discriminator, not the exact prefix), the SAME file must ALSO
|
||||
* contain BOTH:
|
||||
* 1. a `require(...)` of a path naming `gsd-core/bin/ensure-runtime-build.cjs`
|
||||
* 1. a `require(...)` of a path naming `msd-core/bin/ensure-runtime-build.cjs`
|
||||
* (the seam module itself), AND
|
||||
* 2. an actual INVOCATION `ensureRuntimeBuild(` — not merely a destructuring
|
||||
* import with no call, which would import the seam but never run it.
|
||||
*
|
||||
* File-level co-occurrence, not line-by-line ordering: this repo's hooks
|
||||
* define helper functions in whatever order reads best and call them in a
|
||||
* different order at runtime (e.g. `hooks/gsd-cursor-subagent-start.js`'s
|
||||
* different order at runtime (e.g. `hooks/msd-cursor-subagent-start.js`'s
|
||||
* `resolveFallbackIsolation` is defined textually ABOVE the single
|
||||
* `ensureRuntimeBuild()` call site in `evaluateRootIsolation`, which is its
|
||||
* only caller) — a strict "seam call must appear on an earlier LINE than the
|
||||
@@ -53,17 +53,17 @@
|
||||
*
|
||||
* ## What PASSES
|
||||
*
|
||||
* - A hook that never requires `gsd-core/bin/lib/*.cjs` at all (most of
|
||||
* - A hook that never requires `msd-core/bin/lib/*.cjs` at all (most of
|
||||
* `hooks/`) — nothing to check.
|
||||
* - A hook that requires a compiled module AND requires + calls
|
||||
* `ensureRuntimeBuild()` somewhere in the same file.
|
||||
* - A prose comment that mentions `gsd-core/bin/lib/…` without a real,
|
||||
* - A prose comment that mentions `msd-core/bin/lib/…` without a real,
|
||||
* well-formed `require('....cjs')` call (comments are stripped before
|
||||
* scanning).
|
||||
*
|
||||
* ## What FAILS
|
||||
*
|
||||
* - A hook that requires a compiled `gsd-core/bin/lib/*.cjs` module but never
|
||||
* - A hook that requires a compiled `msd-core/bin/lib/*.cjs` module but never
|
||||
* requires `ensure-runtime-build.cjs`, or requires it but never calls
|
||||
* `ensureRuntimeBuild(...)`.
|
||||
*
|
||||
@@ -71,14 +71,14 @@
|
||||
*
|
||||
* - **Literal-string matching only.** `REQUIRE_RE` matches `require(...)`
|
||||
* called with a single- OR double-quoted string literal argument. A
|
||||
* concatenated/computed path (`require(base + '/gsd-core/bin/lib/x.cjs')`),
|
||||
* concatenated/computed path (`require(base + '/msd-core/bin/lib/x.cjs')`),
|
||||
* a template literal (`` require(`${dir}/x.cjs`) ``), or `createRequire(...)`
|
||||
* / `require.resolve` used indirectly all evade `isCompiledLibRequire` and
|
||||
* `isSeamRequire` — none of them appear as a literal quoted `require(...)`
|
||||
* call, so a file using one of these forms scans as "requires nothing",
|
||||
* even if it genuinely needs the seam.
|
||||
* - **`hooks/` only.** `scanRepo`'s `walk()` only descends `SCAN_ROOT`
|
||||
* (`hooks/`, minus `hooks/dist/`). A compiled `gsd-core/bin/lib/*.cjs`
|
||||
* (`hooks/`, minus `hooks/dist/`). A compiled `msd-core/bin/lib/*.cjs`
|
||||
* require sitting inside a NON-hooks helper module that a hook file then
|
||||
* requires (directly or transitively) is invisible to this scan — the scan
|
||||
* only ever reads the hook file's OWN text, never follows its require
|
||||
@@ -107,7 +107,7 @@ const EXCLUDE_DIR_NAMES = new Set(['dist']);
|
||||
// Line-based comment stripper (deliberately NOT the naive two-regex
|
||||
// `/\*[\s\S]*?\*\//g` then `//` approach other tests in this repo use for
|
||||
// simpler files): this module's own source comments legitimately spell
|
||||
// `gsd-core/bin/lib/*.cjs` (a glob) inside a `//` line, which forms a bare
|
||||
// `msd-core/bin/lib/*.cjs` (a glob) inside a `//` line, which forms a bare
|
||||
// `/*` token — a whole-text block-comment regex applied naively would read
|
||||
// that as an OPENING block comment and swallow everything up to the next
|
||||
// unrelated `*/` anywhere later in the file, silently deleting real code
|
||||
@@ -158,11 +158,11 @@ function stripComments(text) {
|
||||
const REQUIRE_RE = /require\(\s*(['"])([^'"]+)\1\s*\)/g;
|
||||
|
||||
function isCompiledLibRequire(requirePath) {
|
||||
return requirePath.includes('gsd-core/bin/lib/') && requirePath.endsWith('.cjs');
|
||||
return requirePath.includes('msd-core/bin/lib/') && requirePath.endsWith('.cjs');
|
||||
}
|
||||
|
||||
function isSeamRequire(requirePath) {
|
||||
return requirePath.endsWith('gsd-core/bin/ensure-runtime-build.cjs');
|
||||
return requirePath.endsWith('msd-core/bin/ensure-runtime-build.cjs');
|
||||
}
|
||||
|
||||
// An actual invocation, not merely a `{ ensureRuntimeBuild }` destructuring
|
||||
@@ -224,7 +224,7 @@ function scanRepo(root) {
|
||||
if (compiledLibRequires.length === 0) continue;
|
||||
if (hasSeamRequire && hasSeamCall) continue;
|
||||
const missing = [];
|
||||
if (!hasSeamRequire) missing.push('require(".../gsd-core/bin/ensure-runtime-build.cjs")');
|
||||
if (!hasSeamRequire) missing.push('require(".../msd-core/bin/ensure-runtime-build.cjs")');
|
||||
if (!hasSeamCall) missing.push('a call to ensureRuntimeBuild(...)');
|
||||
violations.push({
|
||||
file: path.relative(root, full).split(path.sep).join('/'),
|
||||
@@ -248,8 +248,8 @@ function main() {
|
||||
throw new ExitError(
|
||||
1,
|
||||
`lint-hooks-runtime-build-seam: ${violations.length} hooks/ file(s) require a compiled\n` +
|
||||
`gsd-core/bin/lib/*.cjs module without also self-healing via\n` +
|
||||
`ensureRuntimeBuild() from gsd-core/bin/ensure-runtime-build.cjs first (#3582) — on a\n` +
|
||||
`msd-core/bin/lib/*.cjs module without also self-healing via\n` +
|
||||
`ensureRuntimeBuild() from msd-core/bin/ensure-runtime-build.cjs first (#3582) — on a\n` +
|
||||
`plugin-marketplace/git-clone install that never ran \`npm run build:lib\`, that\n` +
|
||||
`require crashes (or is silently misreported) instead of self-building:\n\n${detail}\n`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user