Files
msd-core/tests/emitted-drift-ack.json
Tom Boucher b12d4df03b fix(#2694): normalize CRLF before frontmatter-boundary match in code-review workflows (#2839)
* test(#2694): CRLF frontmatter boundary regression for code-review workflows

The code-review / code-review-fix workflows embed inline node -e one-liners
whose frontmatter boundary regex used a literal \n, silently returning null
on CRLF-saved SUMMARY.md / REVIEW.md / REVIEW-FIX.md artifacts and dropping
every file in that summary (acceptance: per-artifact, no warning when the
phase aggregate stays non-zero).

Adds:
- behavioral CRLF==LF boundary extraction tests (replica of the shipped
  one-liner's boundary step), proving the buggy literal-\n returns null on
  CRLF while the fixed normalize-then-match yields a byte-identical body;
- a structural-regression-guard (allow-test-rule: structural-regression-guard)
  that reads the two shipped workflow files and asserts every boundary site
  normalizes \r\n -> \n before matching, so a revert of the fix is caught.

* fix(#2694): normalize CRLF before frontmatter-boundary match in code-review workflows

The code-review and code-review-fix workflows embed nine inline node -e
one-liners that extract YAML frontmatter via a boundary regex
  content.match(/^---\n([\s\S]*?)\n---/)
The literal \n defeated any CRLF-saved artifact (\r between --- and the line
terminator), so SUMMARY.md / REVIEW.md / REVIEW-FIX.md saved with CRLF
endings silently contributed zero files (or 'unknown' status / 'invalid')
with no per-artifact warning. The Tier-3 git-diff fallback only fires when
the aggregate across all summaries is zero, so a single CRLF summary among
LF summaries produced no signal at all.

Normalize \r\n -> \n once before the existing boundary match at all nine
sites (code-review.md x3, code-review-fix.md x6). Byte-identical to the LF
path; mirrors the canonical src/frontmatter.cts extractFrontmatter intent
(CRLF == LF at the boundary); zero risk of \r leaking into field values
consumed by the inner JS or the shell grep/cut pipeline.

RED @ 94d0213 (3 failures, structural guard caught the shipped-text bug,
both linux-node22+24 lanes).GREEN pending.

* chore(#2694): acknowledge code-review workflow growth + changeset fragment

emitted-attribution (ADR-2719) reports the byte growth from the CRLF-normalize
insertion in code-review.md (+69) and code-review-fix.md (+138); both are the
intended #2694 fix. Adds the .changeset Fixed fragment (pr:0, backfilled post-PR).

* test(#2694): mixed CRLF/LF phase yields the union of both artifacts (criterion 2)

The spec-axis review flagged that acceptance criterion 2 (a phase with a mix
of CRLF-affected and unaffected artifacts no longer silently drops the CRLF
artifact's contribution) was only transitively satisfied. Adds an explicit
mixed-phase test replicating the full shipped Tier-2 extractor (boundary +
inner key_files parse) across one LF and one CRLF SUMMARY.md, asserting the
union of both — plus a RED proof showing the buggy boundary drops the CRLF
artifact silently (aggregate non-zero, so the Tier-3 eq-zero fallback never
fired). Locks the silent-partial-masking behavior the triage named as the more
serious half of the defect.

* docs(changeset): backfill #2694 PR number to 2839

* fix(#2694): make the CRLF regression test itself CRLF-lint-clean

CI lint-tests caught that the new test tripped local/no-crlf-fragile-split:
- the frontmatter boundary regex replicas (fixed + buggy) were RegExpLiterals
  with a bare \n; the rule flags frontmatter-shape regexes unconditionally.
  Build them via new RegExp(...) (byte-identical .source to the shipped literal)
  so the faithful replica is not a lint violation — the buggy replica MUST keep
  the literal \n, that is the bug it demonstrates.
- the structural guard's src.split('\n') on the readFileSync'd workflow file
  was genuinely CRLF-fragile; use /\r?\n/ per the rule's canonical fix.
- the allow-test-rule annotation gains its (#2694) tracking ref per ADR-456.

lint:ci now exit 0 (incl. lint-allow-test-rule-refs, lint-emitted-drift-ack,
lint-fix-has-regression-test: PASS).
2026-07-29 19:49:53 -04:00

21 lines
3.0 KiB
JSON

{
"version": 1,
"paths": {
"review.md": {
"reason": "#2794 / ADR-2782 Phase 1. Three deliberate additions to gsd-core/workflows/review.md: (1) an explicit `<!-- reviewer-lane: <slug> -->` marker above each of the 11 invoke_reviewers legs, which is what makes a leg machine-identifiable for the DEFECT.GENERATIVE-FIX parity assertion — the legs are prose-labelled and five NON-lane bold labels in the same step share the bold-then-fence shape a heuristic matcher would key on, so inference was not an option; (2) the ADR-2782 D4 explicit-selection contract in the detect_clis prose, without which the selector correction is unobservable (review-reviewer-selection.cts has no production caller — the workflow narrates the policy and the reviewing agent executes it, so code and prose must move together); (3) the qwen leg's stderr sidecar, the last lane still discarding stderr to /dev/null (#2494/#2605 class). Growth is prose and comments only; no lane's observable command shape changed apart from the qwen redirect."
},
"hooks/gsd-check-update-worker.js": {
"reason": "#2695: the Codex installer now delivers the complete four-file update-check hook set for every profile. gsd-check-update.js spawn()s gsd-check-update-worker.js, which require()s managed-hooks-registry.cjs — so all three are now emitted into Codex installs alongside the parent. The diff is in bin/install.js (allowlist + copy-loop + profile gate), not in the hook sources themselves, so the hooks-built attribution rule flags the emitted worker/registry paths. This ripple is the intended fix."
},
"hooks/managed-hooks-registry.cjs": {
"reason": "#2695: the Codex installer now delivers the complete four-file update-check hook set for every profile. gsd-check-update.js spawn()s gsd-check-update-worker.js, which require()s managed-hooks-registry.cjs for MANAGED_HOOKS — so the registry is now emitted into Codex installs byte-for-byte. The diff is in bin/install.js (allowlist + raw-copy fallback + profile gate), not in the registry source, so the hooks-built attribution rule flags the emitted registry path. This ripple is the intended fix."
},
"code-review.md": {
"reason": "#2694: three inline node -e frontmatter-boundary one-liners now normalize \\r\\n -> \\n before matching (content.replace(/\\r\\n/g,'\\n').match(...)), so CRLF-saved SUMMARY.md/REVIEW.md artifacts are no longer silently dropped. The growth is the inserted .replace(/\\r\\n/g,'\\n') at each of the 3 boundary sites; no observable command shape changed otherwise. This is the intended fix."
},
"code-review-fix.md": {
"reason": "#2694: six inline node -e frontmatter-boundary one-liners now normalize \\r\\n -> \\n before matching (content.replace(/\\r\\n/g,'\\n').match(...)), so CRLF-saved REVIEW.md/REVIEW-FIX.md artifacts are no longer silently dropped (status/depth/files_reviewed_list extraction). The growth is the inserted .replace(/\\r\\n/g,'\\n') at each of the 6 boundary sites; no observable command shape changed otherwise. This is the intended fix."
}
}
}