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:
@@ -5,7 +5,7 @@
|
||||
* commit_docs guard consumes ONE shell tokenizer rather than hand-rolling a
|
||||
* second. Only the primitives BOTH guards need live here — the shell
|
||||
* tokenizer, the bare-command-name extraction, the -c payload search, and
|
||||
* the `gsd-scan-ignore:` declaration machinery.
|
||||
* the `msd-scan-ignore:` declaration machinery.
|
||||
*
|
||||
* Commit-specific logic stays in the test file and is deliberately NOT
|
||||
* moved here: `isCommitInvocation`, `hasScopedFiles`, `SYNOPSIS_TOKEN_RE`,
|
||||
@@ -14,11 +14,11 @@
|
||||
* scan and do not generalize to other guards.
|
||||
*/
|
||||
|
||||
// 443 live substitution sites are `VAR=$(gsd_run …)`. That is the majority
|
||||
// 443 live substitution sites are `VAR=$(msd_run …)`. That is the majority
|
||||
// and it is the wrong generalisation — the remaining six are neither, and
|
||||
// they are live today:
|
||||
// for REVIEW_FLAG in $(gsd_run review-lane flags) (×3)
|
||||
// ${PLAN_PRE_HOOKS_JSON:-$(gsd_run loop render-hooks …)} (×3)
|
||||
// for REVIEW_FLAG in $(msd_run review-lane flags) (×3)
|
||||
// ${PLAN_PRE_HOOKS_JSON:-$(msd_run loop render-hooks …)} (×3)
|
||||
// A parameter-expansion default glues just as hard as an assignment, and so
|
||||
// does ordinary text (`pre$(…)`) and an indexed assignment (`A[0]=$(…)`).
|
||||
// Enumerating prefixes means a new one every time the shell is used
|
||||
@@ -38,13 +38,13 @@
|
||||
// this regex rather than of the grammar and the next edit could lose it.
|
||||
// THE STRIP IS REFUSED ON A TOKEN THAT CARRIED A QUOTE, because quoting is
|
||||
// exactly what decides whether an opener is syntax or data. `printf %s
|
||||
// '$(gsd_run' query commit fixup` runs no gsd command — the opener is
|
||||
// single-quoted literal text — but quote removal leaves the token `$(gsd_run`
|
||||
// '$(msd_run' query commit fixup` runs no msd command — the opener is
|
||||
// single-quoted literal text — but quote removal leaves the token `$(msd_run`
|
||||
// and a strip would then read it as a binary, fabricating an invocation out
|
||||
// of a string. The tokenizer already knows; it just was not saying.
|
||||
//
|
||||
// RESIDUAL, named rather than implied: this closes the strip's exposure, not
|
||||
// the tokenizer's quote-blindness in general. `printf %s 'gsd_run' query
|
||||
// the tokenizer's quote-blindness in general. `printf %s 'msd_run' query
|
||||
// commit fixup` still reads as an invocation, because no markup is stripped
|
||||
// there — the token's value simply IS the binary name. That predates this
|
||||
// rule and is unchanged by it; closing it needs quote provenance carried
|
||||
@@ -54,7 +54,7 @@ const bareCommandName = (t) => {
|
||||
const mask = t.qmask || '0'.repeat(t.value.length);
|
||||
// The LAST opener whose own two characters were unquoted. Per-character,
|
||||
// not per-token: a quote elsewhere in the word protects only itself, and
|
||||
// `echo "pre"$(gsd_run …)` really does run.
|
||||
// `echo "pre"$(msd_run …)` really does run.
|
||||
for (let i = t.value.length - 2; i >= 0; i -= 1) {
|
||||
if (t.value[i] === '$' && t.value[i + 1] === '(' && mask[i] === '0' && mask[i + 1] === '0') {
|
||||
return t.value.slice(i + 2);
|
||||
@@ -69,15 +69,15 @@ const bareCommandName = (t) => {
|
||||
// parity walk counted only `"`, so a single-quoted message was transparent
|
||||
// to it in both directions), backslash escapes, and unquoted control
|
||||
// operators — which become their own tokens, so an operator glued to its
|
||||
// neighbour (`"a"&&gsd_run`) still separates. Quoted operators and quoted
|
||||
// neighbour (`"a"&&msd_run`) still separates. Quoted operators and quoted
|
||||
// whitespace stay literal, which is what keeps a command substitution inside
|
||||
// a message ("$(gsd-tools query phase-list)") from reading as a second
|
||||
// a message ("$(msd-tools query phase-list)") from reading as a second
|
||||
// invocation, with no separator lookahead needed.
|
||||
//
|
||||
// Beyond the operators, the shell consumes THREE more things before argv
|
||||
// exists, and each one previously leaked into the token list as a value —
|
||||
// so `--files >/dev/null 2>&1 || true` (a live tail shape in
|
||||
// gsd-core/references/execute-phase-requirement-revert.md) scored as scoped
|
||||
// msd-core/references/execute-phase-requirement-revert.md) scored as scoped
|
||||
// while the runtime saw files=[] and took the blanket-.planning/ default:
|
||||
// - a single `&` is a control operator like `;` (`&&` is checked first);
|
||||
// - an unquoted `#` at the START of a word begins a comment and ends the
|
||||
@@ -112,7 +112,7 @@ const tokenize = (str) => {
|
||||
// A PER-CHARACTER quote mask, parallel to `cur`: '1' where the character was
|
||||
// quoted or backslash-escaped (i.e. protected, therefore data), '0' where it
|
||||
// was bare syntax. A per-TOKEN boolean is the obvious shape and it is wrong
|
||||
// in the unaffordable direction — `echo "pre"$(gsd_run …)` executes, and a
|
||||
// in the unaffordable direction — `echo "pre"$(msd_run …)` executes, and a
|
||||
// token-wide flag suppresses the strip on it, turning a false positive into
|
||||
// a silent false negative.
|
||||
let curMask = '';
|
||||
@@ -212,7 +212,7 @@ const commentPortion = (line) => {
|
||||
//
|
||||
// IT IS ONLY A MARKER IN COMMENT POSITION. Matching the token anywhere on
|
||||
// the line let a commit MESSAGE carry it — `commit "docs: explain
|
||||
// gsd-scan-ignore: semantics"` — and silently exempt a real offender. A
|
||||
// msd-scan-ignore: semantics"` — and silently exempt a real offender. A
|
||||
// false-negative escape hatch is the one thing this file must not ship, and
|
||||
// an exemption keyed to attacker-controlled-looking text is precisely that.
|
||||
// AND IT MUST CARRY A TRACKING ISSUE. An exemption whose reason is free text
|
||||
@@ -239,10 +239,10 @@ const ISSUE_REF_RE = /#\d+|https?:\/\//;
|
||||
// declaration must not fail as a MYSTERY: left un-exempt and nothing more,
|
||||
// its author is told their commit is unscoped — a true statement about a line
|
||||
// they had already explained, which is the mangle-until-it-shuts-up loop the
|
||||
// marker exists to prevent. `# gsd-scan-ignore:` with an empty reason is the
|
||||
// marker exists to prevent. `# msd-scan-ignore:` with an empty reason is the
|
||||
// likeliest way to get this wrong and so is the case that most needs the
|
||||
// specific diagnosis; a `\S`-requiring pattern silently drops it.
|
||||
const SCAN_IGNORE_REASON_RE = /gsd-scan-ignore:(.*)$/;
|
||||
const SCAN_IGNORE_REASON_RE = /msd-scan-ignore:(.*)$/;
|
||||
const declarationReason = (portion) => {
|
||||
const m = SCAN_IGNORE_REASON_RE.exec(portion);
|
||||
return m === null ? null : m[1];
|
||||
@@ -259,7 +259,7 @@ const declarationReason = (portion) => {
|
||||
// The marker's reason, but only when the marker is in COMMENT position and
|
||||
// survives neither as an argv token. Returns null when there is no attempt.
|
||||
const declaredReasonFor = (line) => {
|
||||
if (tokenize(line).some((t) => /gsd-scan-ignore:/.test(t.value))) return null;
|
||||
if (tokenize(line).some((t) => /msd-scan-ignore:/.test(t.value))) return null;
|
||||
return declarationReason(commentPortion(line));
|
||||
};
|
||||
const isDeclared = (line) => {
|
||||
@@ -276,11 +276,11 @@ const isUntrackedDeclaration = (line) => {
|
||||
|
||||
// A shell invoked with -c runs its next argument AS A COMMAND, so the
|
||||
// invocation lives inside a quoted token and no amount of markup-stripping
|
||||
// reaches it: `bash -c "gsd_run query commit fixup"` scored zero candidates
|
||||
// reaches it: `bash -c "msd_run query commit fixup"` scored zero candidates
|
||||
// while being perfectly executable. The recursion is keyed on the INVOKER,
|
||||
// not on "a quoted token that parses as an invocation" — that wider rule
|
||||
// would flag a commit MESSAGE quoting a command, a false positive against
|
||||
// ordinary documentation. Here the outer command is bash, so a gsd commit
|
||||
// ordinary documentation. Here the outer command is bash, so a msd commit
|
||||
// message can never reach it.
|
||||
// The invoker set, widened past the four spellings the first cut guessed at.
|
||||
// `ash`, `csh`, `tcsh`, `fish` and `yash` all take -c and all run what
|
||||
@@ -293,7 +293,7 @@ const shellDashCPayloads = (str) => {
|
||||
const drain = () => {
|
||||
if (!group.length) { return; }
|
||||
// THE INVOKER MUST BE THE COMMAND, not merely present in the segment.
|
||||
// Searching anywhere made `echo bash -c "gsd_run query commit fixup"` a
|
||||
// Searching anywhere made `echo bash -c "msd_run query commit fixup"` a
|
||||
// candidate — `echo` prints the string, it does not run it — which is a
|
||||
// false positive against prose that merely quotes a command line. Only an
|
||||
// env assignment, a shell keyword, or a list/prompt marker may precede the
|
||||
|
||||
Reference in New Issue
Block a user