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:
@@ -19,7 +19,7 @@
|
||||
|
||||
### What is actually true (measured, not inferred)
|
||||
|
||||
**128 real `process.exit()` call sites** (143 raw, less 15 `gsd-core/bin/lib/*.cjs` sites that are
|
||||
**128 real `process.exit()` call sites** (143 raw, less 15 `msd-core/bin/lib/*.cjs` sites that are
|
||||
tsc output of the `src/*.cts` originals). They are not evenly spread:
|
||||
|
||||
| Surface | Sites | Shape |
|
||||
@@ -29,9 +29,9 @@ tsc output of the `src/*.cts` originals). They are not evenly spread:
|
||||
| `src/**/*.cts` | 15 | mixed, incl. 4 ternaries |
|
||||
| `bin/` other | 2 | |
|
||||
| `scripts/**` | **1** | |
|
||||
| `gsd-core/bin/gsd-tools.cjs` | 1 | |
|
||||
| `msd-core/bin/msd-tools.cjs` | 1 | |
|
||||
|
||||
Against that, **`process.exitCode` is assigned 88 times** — `src` 25, `scripts` 39, `gsd-core` 24,
|
||||
Against that, **`process.exitCode` is assigned 88 times** — `src` 25, `scripts` 39, `msd-core` 24,
|
||||
`hooks` **0**.
|
||||
|
||||
Two conclusions follow, and both contradict the obvious framing:
|
||||
@@ -59,7 +59,7 @@ Two conclusions follow, and both contradict the obvious framing:
|
||||
|---|---|
|
||||
| Claude Code hook harness | **deny** the tool call |
|
||||
| `scripts/{secret,base64,prompt-injection}-scan.sh` | **usage error** (bad argv) |
|
||||
| `gsd-test` (foreign repo) | **infra error** (dispatch failed) |
|
||||
| `msd-test` (foreign repo) | **infra error** (dispatch failed) |
|
||||
| `ui-safety-gate` / `api-coverage` / `assumption-delta` | **startup error** (stdin read failed) |
|
||||
|
||||
A wrapper that shells one into another — precisely what a `command-exit-zero` gate
|
||||
@@ -74,11 +74,11 @@ each documenting it only in a comment. **The convention exists; what is missing
|
||||
is bound to `stdin.on('error')` only. There is no arm for *stdin closed with zero bytes*:
|
||||
|
||||
```console
|
||||
$ printf 'Build a React component with a button' | node gsd-core/bin/lib/ui-safety-gate.cjs; echo $?
|
||||
$ printf 'Build a React component with a button' | node msd-core/bin/lib/ui-safety-gate.cjs; echo $?
|
||||
0 # control — UI found
|
||||
$ printf '' | node gsd-core/bin/lib/ui-safety-gate.cjs; echo $?
|
||||
$ printf '' | node msd-core/bin/lib/ui-safety-gate.cjs; echo $?
|
||||
1 # "no UI" — but nothing was examined
|
||||
$ printf '' | node gsd-core/bin/lib/api-coverage.cjs; echo $?
|
||||
$ printf '' | node msd-core/bin/lib/api-coverage.cjs; echo $?
|
||||
1 # "no API integration" — same
|
||||
```
|
||||
|
||||
@@ -133,15 +133,15 @@ $ printf "process.exit(0);" > scripts/_probe.cjs && npx eslint --no-cache script
|
||||
|
||||
$ npx eslint --no-cache src/io.cts # contains process.exit(1) at :253
|
||||
n/no-process-exit fired: 0
|
||||
$ npx eslint --no-cache gsd-core/bin/lib/io.cjs
|
||||
$ npx eslint --no-cache msd-core/bin/lib/io.cjs
|
||||
"File ignored because of a matching ignore pattern"
|
||||
$ npx eslint --no-cache hooks/gsd-read-guard.js
|
||||
$ npx eslint --no-cache hooks/msd-read-guard.js
|
||||
n/no-process-exit fired: 0
|
||||
```
|
||||
|
||||
Three independent reasons, all live at `next`: `'off'` for `hooks/**` (`eslint.config.mjs:582`);
|
||||
never registered on `src/**/*.cts` (that block loads only the `local` plugin); and `'error'` on
|
||||
`gsd-core/bin/**/*.cjs` (`:478`) but `gsd-core/bin/lib/io.cjs` is item **239** in the global
|
||||
`msd-core/bin/**/*.cjs` (`:478`) but `msd-core/bin/lib/io.cjs` is item **239** in the global
|
||||
`ignores` list. The most-executed exit site in the product is invisible to its own rule.
|
||||
|
||||
## Decision
|
||||
@@ -154,7 +154,7 @@ never registered on `src/**/*.cts` (that block loads only the `local` plugin); a
|
||||
|---|---|
|
||||
| `0` | **Free.** Pass — the operation ran and its verdict is affirmative. |
|
||||
| `1` | **Free.** Fail — the operation ran and its verdict is negative. |
|
||||
| `2` | **Reserved to the Claude Code hook protocol** (deny). Emittable *only* by the hook adapter. No other GSD code may produce it. |
|
||||
| `2` | **Reserved to the Claude Code hook protocol** (deny). Emittable *only* by the hook adapter. No other MSD code may produce it. |
|
||||
| `3`–`13` | **Forbidden.** Node reserves these (3 = internal JS parse error, 5 = fatal error, 9 = invalid argument, 13 = unfinished top-level await). A domain `3` is ambiguous with a Node crash. |
|
||||
| `64`–`78` | **Generic entries**, aligned to `sysexits.h` mnemonics where they fit. |
|
||||
| `80`–`125` | **Domain entries**, allocated per tool. |
|
||||
@@ -207,11 +207,11 @@ The seam is the process boundary. `src/cli-exit.cts` already sits on it and is d
|
||||
replaced:
|
||||
|
||||
- **`runMain(main)`** — drain-then-exit. Sets `process.exitCode`; stdout flushes and
|
||||
`process.on('exit')` handlers fire. Today's behavior, retyped. Serves `gsd-tools`, `scripts/`,
|
||||
`process.on('exit')` handlers fire. Today's behavior, retyped. Serves `msd-tools`, `scripts/`,
|
||||
generators — the 88 sites already doing this.
|
||||
- **`terminateNow(outcome)`** — write-then-terminate. `fs.writeSync` then immediate `process.exit`.
|
||||
Required for `hooks/`, per the constraint `eslint.config.mjs:563-582` documents correctly and per
|
||||
`hooks/gsd-write-guard.js:159-175` (pipe writes are async on Windows). **This is the only
|
||||
`hooks/msd-write-guard.js:159-175` (pipe writes are async on Windows). **This is the only
|
||||
sanctioned `process.exit` call site in the repo, and the only place `2` can be produced.**
|
||||
|
||||
Both project through the same registry lookup. A parity assertion test is mandatory — two
|
||||
@@ -224,7 +224,7 @@ terminators with independent projections would re-create this ADR's defect insid
|
||||
the projection reproduces today's integers exactly, so this is a pure refactor.
|
||||
- **The integers are policy.** `v1` pins [ADR-2980](2980-payload-carried-error-is-a-degraded-result.md)'s
|
||||
60 ratified `output({error})` sites to exit 0 byte-for-byte. `v2` applies the registry. Selected by
|
||||
`GSD_EXIT_CONTRACT=v2` / `--exit-contract=v2`; default flips at the next major.
|
||||
`MSD_EXIT_CONTRACT=v2` / `--exit-contract=v2`; default flips at the next major.
|
||||
|
||||
This is the compatibility boundary ADR-2980's "Revisit if" clause asks for verbatim.
|
||||
|
||||
@@ -362,7 +362,7 @@ and it is the property ADR-2980's declined Option 3 lacked.
|
||||
>
|
||||
> **The epic's criterion 5 ("retire the predecessor guard the new rule supersedes") does not apply
|
||||
> to `n/no-process-exit` and `local/require-registered-exit`.** #3914 originally turned
|
||||
> `n/no-process-exit` off on `gsd-core/bin/**/*.cjs` and `scripts/**/*.cjs`, on the premise that
|
||||
> `n/no-process-exit` off on `msd-core/bin/**/*.cjs` and `scripts/**/*.cjs`, on the premise that
|
||||
> `local/require-registered-exit` was a strict superset there. It is not: the two rules are
|
||||
> **complementary**, each catching constructs the other misses. Measured directly (successor vs.
|
||||
> predecessor flag counts): `process['exit'](1)` and `process?.[k]?.(1)` are successor-only (a
|
||||
@@ -392,7 +392,7 @@ and it is the property ADR-2980's declined Option 3 lacked.
|
||||
- `scripts/secret-scan.sh:238-239,330-333`; `base64-scan.sh:323-326`; `prompt-injection-scan.sh:252-255`
|
||||
- `capabilities/ai-integration/fragments/api-coverage-plan-pre.md:25,114`;
|
||||
`capabilities/assumption-delta/fragments/plan-pre.md:14` — fabricated verdicts
|
||||
- `gsd-core/workflows/execute-phase/steps/codebase-drift-gate.md:19` — the honest form, already in-tree
|
||||
- `msd-core/workflows/execute-phase/steps/codebase-drift-gate.md:19` — the honest form, already in-tree
|
||||
- `eslint.config.mjs:239,348-404,478,563-582`
|
||||
- `tests/qa/oracles.cjs:574-619`, `tests/qa/smell-baseline.json`
|
||||
- Node.js docs → *Exit codes* (1–13 reserved; 128+N signals); `sysexits(3)` — band borrowed, interface not adopted
|
||||
|
||||
Reference in New Issue
Block a user