fix(pr-review): expand severity-grep filter to cover ADDRESSED/RESOLVED suffixes (#257)#258
Conversation
…ED suffixes (#257) The grep -v '✅' pre-filter from #248 only stripped lines where ✅ and the severity token shared a line. Reviews using a two-level narration structure (### ✅ section header + per-finding lines ending in — **FIXED**) leaked through, causing the quality gate to fire on resolved findings. Expand the filter to also drop lines containing **FIXED**, **ADDRESSED**, or **RESOLVED** (bold markdown) — the persona's consistent terminal markup for resolved findings. Fixes #257
|
Claude finished @cbeaulieu-gt's task in 1m 59s —— View job PR Review CompleteI've reviewed PR #258 for the expanded severity-grep filter changes. SummaryThe PR correctly updates all three callsites to use the extended regex filter, with consistent implementation and excellent documentation. However, there is one significant issue with the regex pattern that could cause false positives. 🔴 Critical Issue: Regex Pattern Not AnchoredLocation: Lines 390, 471, 571 (all three callsites) Problem: The regex pattern According to the PR description, the persona's pattern is: The resolution suffix appears at the end of the line. However, the current regex will also match lines like: This would incorrectly filter out a legitimate open finding that happens to contain the word "FIXED" in bold elsewhere on the line. Suggested fix: # Anchor to end of line with $
grep -vE '✅|\*\*(FIXED|ADDRESSED|RESOLVED)\*\*\s*$'The Why this matters: Without the anchor, any line that mentions FIXED, ADDRESSED, or RESOLVED in discussion or code snippets will be filtered out, even if it contains a genuine open finding with a severity marker. This could cause the quality gate to incorrectly pass PRs with unresolved Critical or High-Priority findings. ✅ Strengths
📋 Test Coverage NoteAs documented in CLAUDE.md, this repo's dogfooding limitation means the PR cannot test its own changes in CI. The PR description correctly notes manual validation is required in an external consumer repo. Given the regex anchoring issue above, testing is especially important to verify the pattern doesn't filter legitimate findings. RecommendationFix the regex pattern to anchor to the end of line before merging. The rest of the implementation is solid. Suggested change at all three callsites: -BLOCKER_HITS=$(printf '%s' "$BODY" | grep -vE '✅|\*\*(FIXED|ADDRESSED|RESOLVED)\*\*' | grep -E -c "$SEVERITY_BLOCKER_RE" || true)
+BLOCKER_HITS=$(printf '%s' "$BODY" | grep -vE '✅|\*\*(FIXED|ADDRESSED|RESOLVED)\*\*\s*$' | grep -E -c "$SEVERITY_BLOCKER_RE" || true) |
Per PR #258 review feedback: the bold-wrapped resolution suffix pattern was matching anywhere on a line, which could false-positive- suppress legitimate findings that mention FIXED/ADDRESSED/RESOLVED in bold mid-sentence. Anchor the pattern with \s*$ so it only matches the persona's actual usage — a terminal — **FIXED** suffix at end-of-line.
|
Claude finished @cbeaulieu-gt's task in 1m 42s —— View job PR Review Complete ✅I've reviewed the incremental changes from this push (245777f → 9e8459b). SummaryThe author has correctly implemented the critical fix identified in the previous review. The regex pattern is now properly anchored to end-of-line at all three callsites, with excellent documentation explaining the rationale. What ChangedBefore: The Three callsites updated (lines 392, 475, 577):
All three use the identical pattern and include updated comment blocks documenting:
Review Across Dimensions✅ Code Quality
✅ Security
✅ Performance
|
|
Overriding gate check since this fixes the gate and dogfooding only happens post merge |
Bug
The
grep -v '✅'pre-filter introduced in #248 / #242 only stripped resolution-narration lines where the ✅ checkmark appeared on the same line as the severity token — e.g.:The persona also uses a two-level narration structure where the ✅ appears on a section header and resolved findings appear as separate lines ending in a bold markdown suffix:
In this structure the per-finding lines contain the severity token but not the ✅ character, so they passed through the filter unmodified and triggered the quality gate on fully-resolved PRs. This was first observed in claude-configs#490.
Fix
Expand the pre-filter from
grep -v '✅'to:The
\*\*(FIXED|ADDRESSED|RESOLVED)\*\*alternative covers all three bold-markdown resolution suffixes the persona uses consistently as terminal markup on resolved findings. A genuine open finding will never contain these bold-wrapped words.All three callsites that apply this filter are updated and kept in sync:
OPEN_BODY)Comment blocks at each callsite are also updated to document the two-style narration pattern and reference #257.
Prior fixes in this chain
grep -v '✅'pre-filter for resolution-narration lines### ✅+— **FIXED**two-level narration #257 (this PR) — extend filter to cover two-level narration structureTest plan
actionlintpasses (CI will run on this PR)### ✅section header +— **FIXED**per-finding narration structure; quality gate should reportsuccessrather thanfailureFixes #257
🤖 Generated by Claude Code on behalf of @cbeaulieu-gt