Repository navigation
feat(check): --suppression-policy TOML — path-glob finding suppression for consumers (#1441) - #1475
Conversation
…n for consumers (#1441) Adds `ripr check --suppression-policy PATH` so downstream Rust repos stop reimplementing per-finding glob filtering over ripr's own JSON output (~200 lines in perl-lsp-swarm's xtask). This is one of the two named blockers for binary-only consumer CI integration (#1439). Reuses the existing `.ripr/suppressions.toml` schema instead of forking a second policy format: - `exposure_gap` entries may now select findings by a `path` glob (`**`/`*`/`?`) over root-relative finding paths, optionally narrowed by `static_class` (validated against the seven exposure labels), as an alternative to the existing exact `finding_id` selector. - Matching runs once in the app layer after analysis; expired entries do not apply and surface as warnings, as do selectors that match nothing. - Fail-closed: an explicitly requested policy that is missing or malformed errors the run — check never emits unfiltered counts as if a policy had been applied. Surfaces (all additive; absent without the flag, so goldens are unchanged and `schema_version` stays 0.2): - JSON: `findings[].suppressed`/`suppressed_by` (suppressed findings stay visible, not hidden), `summary.suppressed_by_policy` (per-class buckets count unsuppressed findings only; buckets + suppressed = findings), and a top-level `suppression_policy` object with path/count/warnings. - Human: compact suppressed one-liners + policy warnings instead of detailed blocks. - GitHub: suppressed findings are not annotated (that is the point of the policy); JSON keeps them visible. - SARIF/badge/repo formats reject the flag with a named limitation rather than silently ignoring it; SARIF keeps its existing finding_id channel. Evidence: unit tests for the glob matcher, parser validation, application semantics, and loader fail-closed paths; render tests for JSON/human/ GitHub; app-level tests on the in-repo sample; 4 cli_smoke end-to-end tests against the built binary; docs/OUTPUT_SCHEMA.md contract section. Gates: fmt, clippy -D warnings, full test suite (2934 lib + smoke), goldens check (zero drift), and the full ci.yml xtask gate list all green. The pre-existing check-readme-state drift on main (dogfood/perl-real-repo-evals-v1) is unrelated and untouched. Scope: one production behavior (check-level policy suppression). The companion gate exception ledger (--exception-policy, #1442) is a separate slice. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HZZFGzTGBrsNzGxq1GWVu6
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (21)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7bdfd2dc48
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Findings suppressed by an explicit `--suppression-policy` (#1441) are | ||
| // not annotated: filtering PR-annotation noise on accepted surfaces is | ||
| // the purpose of the policy. The JSON surface keeps them visible. | ||
| let suppressed_ids: std::collections::BTreeSet<&str> = output |
There was a problem hiding this comment.
Surface policy warnings in GitHub output
When ripr check --format github --suppression-policy is used, this renderer consumes output.suppression only to skip suppressed findings and never emits suppression.warnings. I verified an unmatched path policy against the sample diff exits 0 with normal finding annotations and no policy warning, even though GitHub is accepted as a findings-based format and the new policy contract says expired/unmatched selectors remain visible so stale policies cannot silently look clean. Emit GitHub warning annotations for suppression.warnings, or reject the flag for this format until those warnings can be shown.
Useful? React with 👍 / 👎.
…s with expiry enforcement (#1442) (#1477) Adds `ripr gate evaluate --exception-policy PATH` so downstream Rust repos stop reimplementing ~150 lines of exception-ledger enforcement in their own compiled xtask (perl-lsp-swarm quality_gate.rs:541-681). With #1441 (merged as #1475), this closes the second of the two named blockers for binary-only consumer CI integration (#1439): the gate decision is computed by ripr's binary, configured by a small downstream policy file. Ledger: `quality-gate-exceptions` TOML matching the consumer's existing schema — header (schema_version/policy/owner/status/updated/due_review), [requirements] required_active, and [[exception]] entries with required id/kind/scope/owner/reason/final_target/evidence/removal_criteria and YYYY-MM-DD created/review_after/expires dates. deny_unknown_fields, blank required fields, malformed dates, and duplicate ids are load errors. Enforcement (ripr owns the semantics; the consumer owns only the content): - expires < today -> quality_exception_expired (blocking) - review_after <= today -> quality_exception_review_due (blocking under due_review="fail" — the default, fail-closed; warning under "warn") - required_active id not in the active set -> quality_exception_required_missing (blocking) - ledger status = "final" with any active exception -> quality_exception_final_active (blocking) Any blocking violation drives gate status "blocked" (non-zero exit). A missing or malformed ledger is a config_error — never a silently ignored input. Active exceptions and violations are reported in gate-decision JSON (top-level `exception_policy`, additive; absent without the flag so existing consumers and goldens see byte-identical output) and in a `## Exception Policy` Markdown section. Evidence: unit tests for parsing/validation/evaluation (consumer-schema round-trip, expired, review-due warn-vs-fail, required-missing, final-active, fail-closed loader); gate-level integration tests for blocked/config_error/JSON-absence; 3 cli_smoke end-to-end tests against the built binary; docs/OUTPUT_SCHEMA.md contract section; verified end-to-end on an external demo cargo repo. Gates: fmt, clippy -D warnings, full test suite (2958 lib + 113 smoke + 1208 xtask), goldens check (zero drift), and the full ci.yml xtask gate list all green. Scope: one production behavior (gate exception-ledger enforcement), the companion slice to #1441/#1475. Claude-Session: https://claude.ai/code/session_01HZZFGzTGBrsNzGxq1GWVu6 Co-authored-by: Claude <noreply@anthropic.com>
…headline entries (#3591) * docs(changelog): consolidate Unreleased headings and add the missing headline entries The Unreleased section carried duplicate Added/Fixed headings and omitted the release's headline features. Consolidate to one Added / Changed / Fixed sequence (0.10.0 convention) and add verified entries for: - ripr mcp --stdio server and startup routing (#3088, #3525, #3587) - ripr rerun changed-test targeted analysis (#1520) - the binary-first evidence/gate surface: ripr plus, pr-summary, pr-evidence, annotations, impacted-evidence (#1476/#1460/#1468/#1467/#1474) - --suppression-policy and --exception-policy policy flags (#1475/#1477) - the cache management surface: status, clear, atomic writes (#1822/#2865/#2738) - the LSP capability wave: pull diagnostics, listActionableItems, transport bounds (#1669/#3012/#2185) - analysis performance: per-file fact cache, rayon parallel parse, artifact reuse (#2039/#2322/#2250) Every cited PR verified MERGED via the GitHub API. Also corrects the stale 0.10.0 release-date line (crates.io publication 2026-06-15; GitHub release draft remains unfinalized). * docs(changelog): drop the superseded duplicate MCP entry (#3591 review) The pre-existing Added block already carried an MCP entry from the #3525 merge; keep the expanded consolidated entry (startup routing, verbose handling, review fixes) and remove the older shorter one.
Summary
ripr check --suppression-policy PATHso downstream Rust repos can suppress findings by path glob inside the ripr binary instead of reimplementing ~200 lines of glob matching over ripr's own JSON output (closes feat(check): accept --suppression-policy TOML so consumers don't reimplement per-finding glob filtering #1441; one of the two named blockers for binary-only consumer CI integration, ci: make downstream RIPR integration binary-only — do not compile consumer xtask to run static analysis #1439)..ripr/suppressions.tomlschema — no second policy format:exposure_gapentries may now select findings by apathglob (**/*/?) over root-relative finding paths, optionally narrowed bystatic_class, as an alternative to the existing exactfinding_idselector.findings[]withsuppressed: true+suppressed_by, and expired/unmatched selectors surface as warnings.Swarm / Source Boundary
This PR targets
EffortlessMetrics/ripr-swarm, the normal development trunk fortrusted same-repo
riprwork. Confirm the change belongs here:dependency, or repo-ops development for
ripr-swarmsurface
No publishing, signing, release-asset, or release-secret surfaces are touched.
Source-of-truth Links
Proposal:
Spec:
docs/OUTPUT_SCHEMA.md§suppression_policy(new contract section)ADR:
Plan item:
Active goal:
Issue: #1441 (companion: #1442; umbrella: #1439)
Scope
ripr checkoption (--suppression-policy PATH) applying consumer suppression policy to the findings-based check formats (human, json, github).Scope Classification
This PR is scoped by:
Production delta:
ripr check --suppression-policy PATH: loads a.ripr/suppressions.toml-schema file (fail-closed on missing/malformed), matchesexposure_gapentries against findings byfinding_idor newpathglob (+ optionalstatic_classnarrowing, validated against the seven exposure labels), skips expired entries with warnings, marks matches inCheckOutput.suppression, and decrements per-class summary buckets. JSON gains additivefindings[].suppressed/suppressed_by,summary.suppressed_by_policy, and a top-levelsuppression_policyobject; human renders compact suppressed one-liners; github skips annotations for suppressed findings; SARIF/badge/repo formats reject the flag with a named limitation instead of silently ignoring it.Evidence/support delta:
static_classfail-loud), application semantics (first-entry-wins, class narrowing, expired/unmatched warnings), loader fail-closed paths,Summary::decrement_exposure_classsaturation, exposure-label parity withdomain::ExposureClass.findingsstays total; unmatched-selector warnings; missing policy fails the run.cli_smokeend-to-end tests against the built binary (json, human, missing file, rejected format).docs/OUTPUT_SCHEMA.mdcontract section for the additive fields.Single acceptance criterion:
ripr check --json --suppression-policy policy/ripr-suppressions.tomland get findings markedsuppressed: truewith per-class summary counts covering unsuppressed findings only, with a missing/malformed policy failing the run — no downstream glob reimplementation needed.Non-goals:
expires/review_after/required_activeenforcement at gate time) — that is the companion issue feat(gate evaluate): accept --exception-policy TOML with expiry/review-after/required-active semantics #1442.Support-tier Impact
docs/status/SUPPORT_TIERS.mdClaim/proof notes:
docs/OUTPUT_SCHEMA.md; no tier promotion claimed.schema_versionstays0.2(fields are absent without the flag; existing goldens byte-identical).Policy Impact
Ledger or exception notes:
output/suppressions.rs), no new allow-attributes, no panic-family additions.Proof
Result, failures, or skipped proof:
check-readme-statedrift on main (dogfood/perl-real-repo-evals-v1missing from README/CAPABILITY_MATRIX) reproduces on a clean checkout and is untouched here (local-only gate; not in ci.yml).Claim Boundary
What may be claimed after this PR? What must not be claimed yet?
ripr checkcan apply a consumer suppression policy by path glob with visible, fail-closed semantics on the findings-based formats.Rollback
How can this PR be reverted safely?
path-selector validation reverts with it.Spec-Test-Code Traceability
docs/OUTPUT_SCHEMA.md§suppression_policy(contract), issue feat(check): accept --suppression-policy TOML so consumers don't reimplement per-finding glob filtering #1441 (requirements)output/suppressions.rstests,output/json/mod.rs,output/human.rs,output/github.rs,app/check.rstests,crates/ripr/tests/cli_smoke.rsoutput/suppressions.rs(selector + matcher + loader),app/check.rs(application),output/{json,human,github}(projection),cli/commands.rs+cli/help/core.rs(surface),domain/summary.rs(decrement)cargo xtask goldens checkgreenStatic Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a — no workflow, gate, or lane changes.
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Gates
cargo fmt --checkcargo check --workspace --all-targetscargo test --workspacecargo clippy --workspace --all-targets -- -D warningscargo doc --workspace --no-depscargo package -p ripr --listcargo publish -p ripr --dry-runcargo xtask check-static-languagecargo xtask check-doc-artifactscargo xtask check-support-tierscargo xtask check-no-panic-familycargo xtask check-allow-attributescargo xtask check-local-contextcargo xtask check-file-policycargo xtask check-executable-filescargo xtask check-workflowscargo xtask check-spec-formatcargo xtask check-spec-numberingcargo xtask check-fixture-contractscargo xtask check-generatedcargo xtask check-badge-diff-policycargo xtask check-generated-cleancargo xtask check-dependenciescargo xtask check-process-policycargo xtask check-network-policyExtension changes:
cd editors/vscode && npm ci(n/a)cd editors/vscode && npm run compile(n/a)cd editors/vscode && npm run package(n/a)🤖 Generated with Claude Code
https://claude.ai/code/session_01HZZFGzTGBrsNzGxq1GWVu6
Generated by Claude Code