Skip to content

fix: strip inline code and unterminated HTML comments in parseClosesIssue#350

Merged
schmug merged 1 commit into
mainfrom
claude/dmarcheck-routine-MSNGD
May 21, 2026
Merged

fix: strip inline code and unterminated HTML comments in parseClosesIssue#350
schmug merged 1 commit into
mainfrom
claude/dmarcheck-routine-MSNGD

Conversation

@schmug
Copy link
Copy Markdown
Owner

@schmug schmug commented May 21, 2026

Summary

  • Strip backtick inline code spans (`Closes #N`) and triple-backtick fenced code blocks before matching Closes #N refs — eliminates false-positive refs from code examples in PR bodies.
  • Strip unterminated HTML comments (<!-- with no closing -->) to end-of-line, so a forgotten <!-- on a template line no longer poisons the ref count.
  • Fail-closed guarantee is unchanged: genuinely ambiguous bodies (multiple distinct real refs outside stripped zones) still return null.

Closes #309

Test plan

  • "Example: \Closes #999`\n\nCloses perf: MX-informed DKIM selector prioritization #42"→ returns42` (inline code stripped)
  • "```\nCloses #999\n```\n\nCloses #42" → returns 42 (fenced block stripped)
  • "<!-- Closes #999\n\nCloses #42" → returns 42 (unterminated comment stripped to EOL)
  • "Closes #42\nCloses #999" → returns null (still fail-closed on genuinely ambiguous)
  • All 1032 node-pool tests pass (npx vitest run --project node)

Deferred

  • Tilde fenced blocks (~~~) and nested backtick code spans — not referenced in the issue; out of scope per issue spec.
  • Multi-line unterminated HTML comments with real Closes refs on interior lines — remain fail-closed (degenerate case; safe over-block).

https://claude.ai/code/session_019RpMnK4fQgn6W5k6QXKckU


Generated by Claude Code

…ssue

Two over-block cases in the routine gate's Closes-ref parser caused false
escalations (#309):

1. `Closes #N` inside a backtick inline code span or fenced code block was
   treated as a real ref; now stripped before matching.
2. An unterminated `<!--` left a Closes ref visible; now stripped to
   end-of-line so the PR author's intent (comment it out) is honoured.

Fail-closed guarantee is preserved: genuinely ambiguous bodies (multiple
distinct real refs) still return null.

Closes #309

https://claude.ai/code/session_019RpMnK4fQgn6W5k6QXKckU
@schmug schmug enabled auto-merge (squash) May 21, 2026 14:14
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
dmarcheck 167bb2c May 21 2026, 02:14 PM

@schmug schmug merged commit 3753527 into main May 21, 2026
5 checks passed
@schmug schmug deleted the claude/dmarcheck-routine-MSNGD branch May 21, 2026 14:14
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.

Harden parseClosesIssue: ignore code-fenced and unterminated-comment Closes refs

2 participants