Skip to content

feat(check): --suppression-policy TOML — path-glob finding suppression for consumers (#1441) - #1475

Merged
EffortlessSteven merged 1 commit into
mainfrom
claude/rust-repos-support-d2vw2w
Jul 5, 2026
Merged

EffortlessSteven merged 1 commit into
mainfrom
claude/rust-repos-support-d2vw2w

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Swarm / Source Boundary

This PR targets EffortlessMetrics/ripr-swarm, the normal development trunk for
trusted same-repo ripr work. Confirm the change belongs here:

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge,
    dependency, or repo-ops development for ripr-swarm
  • repair or follow-up for a same-repo swarm PR
  • swarm-only CI, runner, routing, source-of-truth, or agent-operating
    surface
  • other swarm-scoped work:

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

  • One new ripr check option (--suppression-policy PATH) applying consumer suppression policy to the findings-based check formats (human, json, github).

Scope Classification

This PR is scoped by:

  • One production behavior
  • One public contract
  • One architectural seam
  • Docs/spec/test-only evidence package
  • Other:

Production delta:

  • ripr check --suppression-policy PATH: loads a .ripr/suppressions.toml-schema file (fail-closed on missing/malformed), matches exposure_gap entries against findings by finding_id or new path glob (+ optional static_class narrowing, validated against the seven exposure labels), skips expired entries with warnings, marks matches in CheckOutput.suppression, and decrements per-class summary buckets. JSON gains additive findings[].suppressed/suppressed_by, summary.suppressed_by_policy, and a top-level suppression_policy object; 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:

  • Unit tests: glob matcher, parser validation (path selector + unknown static_class fail-loud), application semantics (first-entry-wins, class narrowing, expired/unmatched warnings), loader fail-closed paths, Summary::decrement_exposure_class saturation, exposure-label parity with domain::ExposureClass.
  • Render tests: JSON marking/stats/absence-without-policy + parseability, human compact listing + warnings, github skip.
  • App tests: sample-diff glob suppression drains buckets while findings stays total; unmatched-selector warnings; missing policy fails the run.
  • 4 cli_smoke end-to-end tests against the built binary (json, human, missing file, rejected format).
  • docs/OUTPUT_SCHEMA.md contract section for the additive fields.

Single acceptance criterion:

  • A consumer can run ripr check --json --suppression-policy policy/ripr-suppressions.toml and get findings marked suppressed: true with per-class summary counts covering unsuppressed findings only, with a missing/malformed policy failing the run — no downstream glob reimplementation needed.

Non-goals:

Support-tier Impact

  • none
  • updates docs/status/SUPPORT_TIERS.md
  • changes a README, release, docs, CLI, JSON, editor, CI, or package claim

Claim/proof notes:

  • Additive, opt-in CLI/JSON surface documented in docs/OUTPUT_SCHEMA.md; no tier promotion claimed. schema_version stays 0.2 (fields are absent without the flag; existing goldens byte-identical).

Policy Impact

  • none
  • doc artifacts
  • CI lane
  • package boundary
  • lint / Clippy
  • no-panic
  • file policy
  • generated artifact
  • dependency
  • process/network

Ledger or exception notes:

  • No new dependencies (glob matcher is ~40 lines in output/suppressions.rs), no new allow-attributes, no panic-family additions.

Proof

cargo fmt --check
cargo check --workspace --all-targets
cargo test --workspace            # 2934 lib + 112 cli_smoke + xtask 1208, all green
cargo clippy --workspace --all-targets -- -D warnings
cargo doc --workspace --no-deps
cargo xtask goldens check         # zero drift
cargo xtask fixtures              # unchanged
# full ci.yml xtask gate list     # all PASS (see commit message)
# end-to-end on an external demo cargo repo:
ripr check --base HEAD --worktree --json --suppression-policy suppressions.toml

Result, failures, or skipped proof:

  • All green. Pre-existing check-readme-state drift on main (dogfood/perl-real-repo-evals-v1 missing 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?

Rollback

How can this PR be reverted safely?

  • Single revert of this commit. The flag is opt-in and all output fields are additive-only, so no consumer contract breaks; the new path-selector validation reverts with it.

Spec-Test-Code Traceability

  • Spec: 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)
  • Tests: output/suppressions.rs tests, output/json/mod.rs, output/human.rs, output/github.rs, app/check.rs tests, crates/ripr/tests/cli_smoke.rs
  • Code: output/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)
  • Golden outputs: unchanged by design (fields absent without the flag); cargo xtask goldens check green
  • Metrics: none
  • ADR/learning: none

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.
  • Unknowns include stop reasons where applicable.

CI Economics

n/a — no workflow, gate, or lane changes.

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • No new panic, unwrap, expect, todo, or unimplemented in tests.
  • New non-Rust programming files are allowlisted with owner, surface, and reason. (n/a — none added)
  • New generated, dependency, process-spawn, or network surfaces are allowlisted with owner and reason. (n/a — none added)
  • Errors are reported with actionable context.
  • Public JSON/schema changes are documented.

Gates

  • cargo fmt --check
  • cargo check --workspace --all-targets
  • cargo test --workspace
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo doc --workspace --no-deps
  • cargo package -p ripr --list
  • cargo publish -p ripr --dry-run
  • cargo xtask check-static-language
  • cargo xtask check-doc-artifacts
  • cargo xtask check-support-tiers
  • cargo xtask check-no-panic-family
  • cargo xtask check-allow-attributes
  • cargo xtask check-local-context
  • cargo xtask check-file-policy
  • cargo xtask check-executable-files
  • cargo xtask check-workflows
  • cargo xtask check-spec-format
  • cargo xtask check-spec-numbering
  • cargo xtask check-fixture-contracts
  • cargo xtask check-generated
  • cargo xtask check-badge-diff-policy
  • cargo xtask check-generated-clean
  • cargo xtask check-dependencies
  • cargo xtask check-process-policy
  • cargo xtask check-network-policy

Extension 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

…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
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jul 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@EffortlessSteven, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b0f48b74-e7a5-47d8-8a77-c5bfe6d05a95

📥 Commits

Reviewing files that changed from the base of the PR and between 636588c and 7bdfd2d.

📒 Files selected for processing (21)
  • crates/ripr/src/app.rs
  • crates/ripr/src/app/check.rs
  • crates/ripr/src/app/check/output_builder.rs
  • crates/ripr/src/app/pr_evidence.rs
  • crates/ripr/src/app/tests/mod.rs
  • crates/ripr/src/cli/commands.rs
  • crates/ripr/src/cli/help/core.rs
  • crates/ripr/src/domain/summary.rs
  • crates/ripr/src/output/badge/tests.rs
  • crates/ripr/src/output/diff_report.rs
  • crates/ripr/src/output/github.rs
  • crates/ripr/src/output/human.rs
  • crates/ripr/src/output/json/mod.rs
  • crates/ripr/src/output/json/report.rs
  • crates/ripr/src/output/limited_check.rs
  • crates/ripr/src/output/next_step.rs
  • crates/ripr/src/output/render.rs
  • crates/ripr/src/output/sarif.rs
  • crates/ripr/src/output/suppressions.rs
  • crates/ripr/tests/cli_smoke.rs
  • docs/OUTPUT_SCHEMA.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/rust-repos-support-d2vw2w

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.25581% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/ripr/src/domain/summary.rs 73.68% 5 Missing ⚠️
crates/ripr/src/app/check.rs 96.82% 4 Missing ⚠️
crates/ripr/src/output/suppressions.rs 99.30% 2 Missing ⚠️
crates/ripr/src/cli/commands.rs 94.11% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review July 5, 2026 02:16
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven
EffortlessSteven merged commit 950062b into main Jul 5, 2026
23 of 24 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/rust-repos-support-d2vw2w branch July 5, 2026 02:16

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

EffortlessSteven added a commit that referenced this pull request Jul 5, 2026
…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>
EffortlessSteven added a commit that referenced this pull request Aug 30, 2026
…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.
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.

feat(check): accept --suppression-policy TOML so consumers don't reimplement per-finding glob filtering

2 participants