Skip to content

fix(pr-review): drop zero-count summary lines in severity pre-filter (#269)#270

Open
cbeaulieu-gt wants to merge 2 commits into
mainfrom
issue-269-zero-count-regex
Open

fix(pr-review): drop zero-count summary lines in severity pre-filter (#269)#270
cbeaulieu-gt wants to merge 2 commits into
mainfrom
issue-269-zero-count-regex

Conversation

@cbeaulieu-gt
Copy link
Copy Markdown
Member

No description provided.

…269)

Adds a third alternation to the resolution-narration pre-filter that
drops any line whose severity token is followed by ": <digits>". This
prevents `- 🔴 Critical (BLOCKING): 0` and similar findings-tally
summary lines from being miscounted as load-bearing severity hits.

Updates all three callsites (authoritative quality-gate, synthesis
fallback, shadow gate) to stay in sync per the in-file comment.
Adds a marker-case fixture using the claude-configs#564 reproducer.

Note: lib/severity-regex.sh contains only severity-token patterns
(not the pre-filter); no change needed at that file.

Fixes #269
Refs glitchwerks/claude-configs#564
@claude-action-runner
Copy link
Copy Markdown
Contributor

claude-action-runner Bot commented May 15, 2026

Claude finished @cbeaulieu-gt's task in 3m 34s —— View job


PR Review Complete

I've reviewed the incremental changes in this PR that refine the severity pre-filter regex pattern.

Summary

This PR successfully addresses issue #269 by replacing the overly broad pattern :\s*[0-9]+\s*$ with a more specific pattern \((BLOCKING|MAJOR|MEDIUM|LOW)\):\s*[0-9]+\s*$. The new pattern correctly distinguishes between:

  • Persona-emitted summary-tally lines (e.g., - 🔴 Critical (BLOCKING): 0) — should be filtered
  • Legitimate per-finding tally entries (e.g., - 🟢 Medium: 1) — should NOT be filtered

The key differentiator is the presence of the parenthesized severity-class marker, which only appears in summary lines.

Findings

🟢 Medium

Test coverage gap for MEDIUM and LOW severity classes — pr-review/tests/marker-cases/zero-count-tally-lines.md:11-15

The test case includes examples of (BLOCKING) and (MAJOR) summary lines (lines 11-13), but doesn't include explicit test cases for (MEDIUM) or (LOW) summary lines, even though the regex pattern handles all four classes. While this isn't a blocker (the pattern structure is symmetric and will handle them identically), it would make the test more comprehensive to include:

- 🟢 Medium (MEDIUM): 0
- Nit (LOW): 0

This would validate that all four severity classes are correctly filtered when they appear in the parenthesized summary format.

Nit

Minor edge case with prose content — pr-review/action.yml:403

The pattern \((BLOCKING|MAJOR|MEDIUM|LOW)\):\s*[0-9]+\s*$ could theoretically match prose that ends with text like "section (MAJOR): 42". However, this is an extremely unlikely edge case in practice given the controlled format of persona-generated reviews, and the specificity gain from requiring the parenthesized class marker far outweighs this theoretical risk.

Strengths

Excellent documentation — The inline comments at all three callsites clearly explain the pattern's purpose, the structural signature it targets, and the count-agnostic design decision

Consistency across callsites — All three grep invocations (lines 403, 492, 600) use identical patterns, maintaining the synchronization requirement noted in the comments

Count-agnostic design — Correctly filters summary lines regardless of whether the count is zero or non-zero, as both are tallies rather than individual findings

Test case documentation — The test file includes clear explanatory text distinguishing the two types of count lines

Issue traceability — Good references to #269 and the reproducer glitchwerks/claude-configs#564


Verdict: APPROVE

…op (#269)

The first attempt at the pre-filter was too broad — `:\s*[0-9]+\s*$`
dropped all colon-digit-suffix lines, including legitimate per-finding
tally entries like `- 🟢 Medium: 1`. Replace with a pattern that
requires the parenthesized `(BLOCKING|MAJOR|MEDIUM|LOW)` class marker
the persona emits as the structural signature of a summary line. Adds
non-zero-summary and finding-tally fixture lines so a future
regression in either direction is caught.

Refs #269
Refs glitchwerks/claude-configs#564
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