Files
Dragan Spiridonov 70713b0b45 feat(pr-template-check): CI enforcement for the #401 failure-modes checkbox
Replaces the honor-system PR template checkbox with a parser that fails
any PR whose body either (a) unchecks or deletes the load-bearing
failure-modes checkbox, or (b) contains dismissal phrases like
"I believe it's unlikely" without a same-paragraph tracking issue
reference. Both rules hard-fail.

Covers the 3 phrases explicitly named in #408 plus 8 additional
dismissal patterns that shipped or could ship the same class of
reasoning that caused the v3.9.1–v3.9.4 init regression series.

- scripts/check-pr-body.cjs: standalone Node parser, ESM-safe via .cjs,
  zero dependencies, exported for self-test. Skips the template's own
  checkbox paragraph when scanning for forbidden phrases — the stock
  instruction text quotes the phrase as a teaching example and would
  otherwise trip the linter on every clean PR.
- .github/workflows/pr-template-check.yml: two jobs. lint-pr-body runs
  the parser against the actual PR body (dependabot[bot] allowlisted).
  self-test runs the parser against 11 fixtures and asserts both
  exit code and a content-specific substring in the output, so a
  parser regression fails loudly instead of silently passing bad PRs.
- tests/fixtures/pr-body/: 3 valid fixtures (clean, tracked-phrase,
  tracked-edge-case), 6 invalid fixtures (unchecked, missing section,
  forbidden phrase, multi-violation, highly-unlikely, can't-see-how),
  2 historical fixtures (the actual v3.9.3 PR body which fails for
  missing section, plus a synthetic body quoting #401's postmortem
  reference which fails for forbidden phrase).

Rollout: workflow is intentionally not required at merge time on
initial landing. Maintainer should promote it to a required status
check in branch protection once it has been observed to behave
correctly on live PRs — see the header comment in
.github/workflows/pr-template-check.yml.

Verified locally with the same self-test logic the workflow will run:
11/11 fixtures pass with content-aware assertions, and a mutation
test (breaking the checkbox-state logic) correctly causes the valid
fixture to fail, proving the self-test would catch a parser regression.

Closes #408

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 08:56:09 +00:00
..