Repository navigation
feat(prr): add --min-severity flag to audit and review - #38
Merged
Merged
Conversation
Filter deep-review findings below a severity threshold before recheck and all later phases run, so the user pays no recheck/synthesis cost for findings they've chosen to ignore. Supported on both `prr audit` and `prr review` as --min-finding-level=<critical|high|medium|low|nit>.
Matches the existing `DeepFinding.Severity` field and the rest of the codebase's vocabulary (severityRank, severityOrder). The shorter name also fits the established help-text column so the flag aligns with its peers instead of overflowing.
Mirrors the category-list pattern (ai.AllCategorySlugs): keeps the canonical severity ladder package-private and exposes read access via AllSeverities, which returns a fresh copy so external callers can't mutate the shared slice. FilterByMinSeverity now always allocates the returned slice, so the empty-min path no longer aliases the caller's input. Added an aliasing-mutation assertion so the contract is regression-tested.
Adds the active --min-severity threshold to audit.Result, review.PRReviewResult/CoreResult, and state.ReviewMeta. Headless JSON output now carries the marker, and reopening the TUI exposes it via state.LastReview.MinSeverity so the Review tab can render a "partial run" badge and offer a re-run without the filter. Pure plumbing — no TUI rendering yet. JSON uses `min_severity,omitempty` so older state files round-trip unchanged.
Adds a "PARTIAL — filtered to severity ≥ X" banner to the Review tab, mirroring the existing STALE banner's visual vocabulary. Shows up in both the findings view and the clean-PR placeholder (so a "clean" verdict produced from a filtered run no longer looks unconditionally clean). Hint line tells the user to press A for a fresh full run. Threads LastReview.MinSeverity through renderStructuredReview from all three call sites in model.go. Test coverage: empty minSeverity hides the banner; non-empty shows it with the threshold and hint; STALE + PARTIAL coexist when both apply.
andreujuanc
force-pushed
the
feat/min-finding-level
branch
from
May 28, 2026 18:25
f55fa0a to
4f5aa2c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--min-severity=<critical|high|medium|low|nit>flag onprr auditandprr review.Afor a fresh full run.Context
audit.Options.MinSeverity,review.PRReviewOptions.MinSeverity, andreview.CoreOptions.MinSeverity. Persisted onstate.ReviewMeta.MinSeverityso the marker survives TUI restart.internal/review/execute.go. Severity ladder is package-private;AllSeverities()returns a copy (mirrorsai.AllCategorySlugspattern).FilterByMinSeverityalways allocates so callers can't accidentally alias the input.nit, matchingseverityRank. Invalid values fail fast at the CLI boundary with a clear error listing valid levels.internal/state, parse + filter + aliasing contract ininternal/review, partial banner rendering ininternal/ui.