Skip to content

fix: publishing planner no longer omits high-confidence correctness/security findings by severity alone - #63

Open
kadireren7 wants to merge 1 commit into
mainfrom
fix/publishing-severity-floor
Open

kadireren7 wants to merge 1 commit into
mainfrom
fix/publishing-severity-floor

Conversation

@kadireren7

Copy link
Copy Markdown
Owner

Summary

  • The publication planner's severity-threshold gate (config.min_severity) omitted findings outright, before ever attempting diff mapping or summary placement -- so an accepted, critic-verified, high-confidence correctness/security finding could be discarded with zero visibility purely for being nominally severity=low under the default min_severity=MEDIUM.
  • Reproduced from real production evidence on PR E2E test: intentional swapped-counts bug (do not merge) #57 (head 44b9ec0): reviewer accepted a finding (category=correctness, confidence=high, severity=low), yet review_publish_skipped_no_findings fired with omitted=1, published_inline=0.
  • Fix: a finding in one of the two specialist categories (correctness, security) with Confidence.HIGH now bypasses the severity floor and enters the normal funnel like any other eligible finding -- still subject to diff-mapping and to the existing max_inline_comments/max_summary_findings caps, so it can still legitimately end up omitted by a cap, just never by severity alone. DEFAULT_MIN_SEVERITY itself is untouched; every lower-confidence or non-specialist-category finding is filtered exactly as before -- noise controls and spam protections are unchanged.
  • Adds safe, structured per-omitted-finding logging (review_publish_finding_omitted: finding id, severity, category, omission reason only -- never title/message/reasoning/suggested_fix).

Test plan

  • New planner unit test reproducing the exact PR E2E test: intentional swapped-counts bug (do not merge) #57 finding shape, asserting it lands inline/summary-only, never omitted
  • New end-to-end dry-run integration test through the real Phase 5 pipeline, same assertion
  • Two scope-guard tests: bypass does not apply at confidence=medium, and does not apply to a non-specialist category (style) even at confidence=high
  • ruff check . clean
  • mypy . clean (643 source files)
  • Full pytest suite: 2418 passed; 26 pre-existing failures confirmed identical on the unmodified tree (DB-credential-dependent concurrency tests, missing static-analysis-tool binaries) -- unrelated to this change

🤖 Generated with Claude Code

…ecurity findings by severity alone

Production evidence for PR #57 head 44b9ec0: the reviewer accepted a
real, critic-verified finding (category=correctness, confidence=high,
severity=low) for the PR #57 swapped-counts fixture, but publication
still reported status=skipped_no_findings with omitted=1 and wrote
nothing to GitHub.

Root cause: PublicationPlanner.build_plan's severity-threshold gate
(step 1 of the funnel) omitted any finding below config.min_severity
outright, before ever attempting diff mapping or summary placement --
with the production default min_severity=MEDIUM, a real, high-confidence
finding assigned severity=LOW never even entered the mapping/summary
funnel, regardless of how strong its evidence was.

Fix: severity and confidence are orthogonal signals (severity = how bad,
confidence = how sure). A finding in one of the two specialist
categories (correctness, security) with Confidence.HIGH now bypasses the
severity floor and enters the normal funnel like any other eligible
finding -- it can still land inline (if mappable), summary-only
(otherwise), or get capped to omitted by max_inline_comments/
max_summary_findings exactly like before. This is a narrow,
category+confidence-scoped carve-out, not a change to min_severity
itself -- every other finding (lower confidence, or outside the two
specialist categories) is still governed by the configured threshold
exactly as before, so existing noise controls and spam protections are
unchanged.

Also adds structured, safe per-omitted-finding logging
(review_publish_finding_omitted: finding id, severity, category,
omission reason only -- never title/message/reasoning/suggested_fix)
so a future silent-omission gap is observable without a DB query.

Regression coverage: a planner-level fixture reproducing the exact PR
#57 finding shape, plus an end-to-end dry-run test through the real
Phase 5 pipeline, both asserting the finding lands inline or
summary-only, never omitted by severity alone. Two scope-guard tests
confirm the bypass stays narrow (still omitted at medium confidence,
still omitted for a high-confidence non-specialist category).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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