Skip to content

ci(rule-enforcement): strip markdown emphasis before deliverables grep (ADR-0136)#73

Merged
lusoris merged 1 commit intomasterfrom
fix/ci-deliverables-checker-strip-markdown
Apr 20, 2026
Merged

ci(rule-enforcement): strip markdown emphasis before deliverables grep (ADR-0136)#73
lusoris merged 1 commit intomasterfrom
fix/ci-deliverables-checker-strip-markdown

Conversation

@lusoris
Copy link
Copy Markdown
Owner

@lusoris lusoris commented Apr 20, 2026

Summary

The Deep-Dive Deliverables Checklist (ADR-0108) job greps the PR body for each label (AGENTS.md invariant note, etc.) as a literal string inside - \[x\].*${item}. The PR template itself wraps some of those labels in backticks ( - [ ] **`AGENTS.md` invariant note** —), so a PR that ticks the checklist verbatim from the template produces a body line where .md and invariant note are separated by a backtick + space — and the grep rejects it.

PR #72 tripped this exact failure on first CI. "Edit the PR body and delete backticks" is the wrong layer to fix it.

Fix

One line: strip `, *, _ from the body once before writing to the grep target, in both the parse step and the diff-verification step:

- printf '%s' "${PR_BODY:-}" > /tmp/pr_body.md
+ printf '%s' "${PR_BODY:-}" | tr -d '`*_' > /tmp/pr_body.md

None of the six deliverable labels contain any of those three characters internally, so the normalisation is loss-free for the matching path. Case-insensitivity was already enabled.

Type

  • ci — tooling / infra

Checklist

  • Commits follow Conventional Commits.
  • No C / Python changes — make lint N/A.
  • No unit tests affected (workflow-only change).

Deep-dive deliverables (ADR-0108)

  • no digest needed: trivial — single-file workflow fix; decision rationale lives in ADR-0136.
  • Decision matrixADR-0136 ## Alternatives considered weighs four options (fix bodies, reword template, normalise body via tr, rewrite parser).
  • no rebase-sensitive invariants — .github/workflows/rule-enforcement.yml is fork-only CI, /sync-upstream policy is fork-wins for .github/.
  • Reproducer / smoke-test command — pasted below under "Reproducer".
  • no CHANGELOG entry: CI-only — workflow semantics do not surface to library users.
  • no rebase impact: CI-only — see rebase-sensitive line above.

Reproducer

# Simulate the check locally against a conforming template-style body.
cat > /tmp/body.md <<'MD'
- [x] **`AGENTS.md` invariant note** — added to libvmaf/src/cuda/AGENTS.md
MD

# Before the fix: literal grep mismatches because of the backtick+space.
grep -qiE -- "- \[x\].*AGENTS.md invariant note" /tmp/body.md && echo OK || echo FAIL

# After the fix: tr-d normalises first, then the same grep passes.
tr -d '\`*_' < /tmp/body.md \
  | grep -qiE -- "- \[x\].*AGENTS.md invariant note" && echo OK || echo FAIL
# Expected before: FAIL. Expected after: OK.

Cross-check: this PR's own body exercises the checker — every tick and opt-out here should green the job.

🤖 Generated with Claude Code

…p (ADR-0136)

The ADR-0108 deep-dive checklist parser matched item labels literally
(e.g. `AGENTS.md invariant note`), but the PR template wraps some of
those labels in backticks/asterisks (e.g. `` - [ ] **`AGENTS.md`
invariant note** —``). A PR author who ticked the template verbatim
produced a body line where `.md` and `invariant note` were separated
by a backtick + space, so the literal grep rejected conforming PRs.

PR #72 tripped the exact failure on first CI — fixing the PR body
"by hand" is the wrong layer.

Fix: `tr -d '\`*_'` the body once before grepping, in both the
parse and the diff-verification steps. Stripped chars do not appear
inside any of the six deliverable labels, so the normalisation is
loss-free for the matching path. Case-insensitive matching was
already enabled.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@lusoris lusoris merged commit 95bea61 into master Apr 20, 2026
45 checks passed
@lusoris lusoris deleted the fix/ci-deliverables-checker-strip-markdown branch April 20, 2026 21:27
@github-actions github-actions Bot mentioned this pull request Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant