Skip to content

feat(ci): ripr wrapper --base + policy-report projection (#182 follow-up)#231

Merged
EffortlessSteven merged 1 commit into
mainfrom
feat/ripr-base-and-policy-report-projection-182
May 12, 2026
Merged

feat(ci): ripr wrapper --base + policy-report projection (#182 follow-up)#231
EffortlessSteven merged 1 commit into
mainfrom
feat/ripr-base-and-policy-report-projection-182

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Brings cargo xtask ripr-pr and .github/workflows/ripr.yml up to the PR 1 spec that #230 partially shipped.

  • --base <ref> flag on cargo xtask ripr-pr (default origin/main). Currently forward-looking: ripr pilot operates on the working tree and has no --base flag, so the wrapper acknowledges and ignores non-default values today. The shape is stable for the eventual switch to ripr check --base <ref>.
  • target/policy/ripr-report.{md,json} projection — after ripr pilot writes its native outputs, the wrapper copies target/ripr/pilot/pilot-summary.{md,json} into target/policy/ripr-report.{md,json} so a future policy-report integration can pick it up without crawling ripr's per-mode directory layout. Each side is best-effort (a missing source is a quiet skip).
  • JSON source choice: pilot-summary.json (~13 KB), not repo-exposure.json (~53 MB on the Shipper workspace) or agent-seam-packets.json (~34 MB) — those would be too heavy as CI artifacts. Comment in ripr.rs records the choice.
  • Workflow upload glob expands from target/ripr/ to target/ripr/ + target/policy/ripr-report.*.

Test plan

  • cargo build -p xtask — clean
  • cargo test -p xtask — 19/19 passing (15 no_panic + 4 ripr, two new: project_one_skips_missing_source and args_default_base_is_origin_main)
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo fmt --all -- --check — clean
  • cargo xtask ripr-pr locally — projects 5 KB ripr-report.md + 13 KB ripr-report.json into target/policy/
  • CI green (ripr.yml fires; the projection lands in the uploaded artifact)

Followups deferred

Refs #182.

…on} projection (#182 follow-up)

Brings `cargo xtask ripr-pr` and `.github/workflows/ripr.yml` up to the
PR 1 spec that #230 partially shipped. Two surfaces change:

1. `cargo xtask ripr-pr [--base <ref>]`. Defaults to `origin/main`. The
   flag is currently forward-looking: `ripr pilot` operates on the working
   tree and has no `--base` flag, so the wrapper acknowledges and ignores
   non-default values today. The shape is stable for the eventual switch
   to `ripr check --base <ref>` once that format contract is something
   Shipper wants to consume.

2. Projection step after `ripr pilot` writes its native outputs:

      target/ripr/pilot/pilot-summary.md   ->  target/policy/ripr-report.md
      target/ripr/pilot/pilot-summary.json ->  target/policy/ripr-report.json

   So ripr's report sits alongside the other policy reports in
   `target/policy/` and a future `policy-report` integration can read it
   without crawling into ripr's per-mode directory layout. Each side is
   best-effort: a missing source is a quiet skip, not a wrapper failure.

   The JSON source is `pilot-summary.json` (~13 KB), not `repo-exposure.
   json` (~53 MB) or `agent-seam-packets.json` (~34 MB) which would be too
   heavy to republish as a CI artifact. The comment in `ripr.rs` records
   the choice.

3. `.github/workflows/ripr.yml`:
   - `cargo xtask ripr-pr --base origin/main` (explicit form for log
     legibility)
   - artifact upload glob expands from `target/ripr/` to
     `target/ripr/` + `target/policy/ripr-report.*`

Tests:

  ripr::tests::install_hint_mentions_pinned_version             (pre-existing)
  ripr::tests::install_hint_pinned_version_matches_workflow     (pre-existing)
  ripr::tests::project_one_skips_missing_source                 (new)
  ripr::tests::args_default_base_is_origin_main                 (new)

19/19 tests passing (15 no_panic + 4 ripr). Clippy and fmt clean.
@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 May 12, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 11 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c017955d-c5a1-4b99-8bbc-f52664cec8d5

📥 Commits

Reviewing files that changed from the base of the PR and between 1ee58e8 and c30d933.

📒 Files selected for processing (4)
  • .github/workflows/ripr.yml
  • CHANGELOG.md
  • xtask/src/main.rs
  • xtask/src/ripr.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ripr-base-and-policy-report-projection-182

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 and usage tips.

@factory-droid

factory-droid Bot commented May 12, 2026

Copy link
Copy Markdown

Droid finished @EffortlessSteven's task —— View job


Review Validation — PR #231

Status: Approved — no candidates emitted.

Inspected surfaces

  • xtask/src/ripr.rs: --base flag wiring, Args clap derive, project_to_policy_report() best-effort copy, project_one() skip-missing-source logic
  • xtask/src/main.rs: Command::RiprPr(args) args forwarding
  • .github/workflows/ripr.yml: upload glob expansion to target/ripr/ + target/policy/ripr-report.*
  • CHANGELOG.md: entry added

Lenses applied

  1. CLI flag contract (--base default origin/main, forward-looking acknowledgment)
  2. Best-effort copy semantics (skip on missing source, no failure on partial ripr output)
  3. Workflow artifact upload completeness (both ripr native tree and policy projection included)

Validation checks

  • cargo test -p xtask (19/19 passing) — [Reported: via PR description test plan]
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo fmt --all -- --check — clean

Why no comments

This PR touches only xtask infrastructure (CI wrapper, no publish-state or registry-truth surface). The --base flag is correctly implemented as forward-looking with advisory-only behavior today. The policy-report projection correctly uses best-effort copy with silent skip on missing source. No regression risk to shipper-core publishing logic.

Residual risk

  • CI artifact upload relies on if-no-files-found: ignore; a future ripr failure that also skips writing target/ripr/ would result in an empty artifact upload. Acceptable given advisory lane intent.

Security review

No security-relevant surface touched. This PR is purely CI/workflow infrastructure.

@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: c30d933d67

ℹ️ 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".

Comment thread xtask/src/ripr.rs
Comment on lines +110 to +113
if !src_path.exists() {
// Quiet skip — ripr may not have written this output (e.g. it
// bailed early). The CI workflow uploads target/ripr/ either way.
return Ok(());

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 Clear stale reports when ripr omits outputs

Failure mode: when ripr pilot exits before writing pilot-summary.*, this quiet skip leaves any existing target/policy/ripr-report.* in place; observed the CI workflow caches target and now uploads target/policy/ripr-report.*, so a restored or previous report can be published as the current run's evidence. Fix direction: remove the destination before returning on a missing source (and before copying) or write an explicit current-run placeholder. Validation: cargo test -p xtask project_one_skips_missing_source -- --exact plus a test that seeds a stale destination and verifies it is removed. Confidence: high.

Useful? React with 👍 / 👎.

@EffortlessSteven EffortlessSteven merged commit d5df7a2 into main May 12, 2026
24 checks passed
@EffortlessSteven EffortlessSteven deleted the feat/ripr-base-and-policy-report-projection-182 branch May 12, 2026 10:52
EffortlessSteven added a commit that referenced this pull request May 12, 2026
* feat(ci): mutation testing PR-time lane + cargo xtask mutants-pr (#182 PR 3)

Adds a label-gated PR-time mutation lane and the xtask wrapper it
invokes, keeping mutation off every PR's hot path while making it cheap
to opt in when warranted.

  cargo xtask mutants-pr --changed [--base origin/main] [--dry-run]

is a thin wrapper around `cargo-mutants` that:

  1. Refuses to run without `--changed`. Whole-workspace mutation is
     intentionally not part of the PR-time lane — that lives in the
     weekly schedule (see docs/ci/test-evidence-lanes.md).
  2. Computes `git diff <base>...HEAD --name-only -- '*.rs'`, filters
     out `tests/` and `benches/` paths (cargo-mutants only mutates
     production source).
  3. Runs `cargo mutants --no-shuffle --file <each-path>` (or `--list`
     when `--dry-run` is passed).
  4. If `cargo-mutants` is missing locally, prints install instructions
     and exits advisory-success rather than erroring. CI installs the
     tool before invoking.
  5. Surfaces `cargo mutants` non-zero exit codes — surviving mutants
     are load-bearing failures, unlike ripr's purely advisory findings.

`.github/workflows/mutation.yml` adds the `mutants-pr` job alongside
the existing `mutants-weekly` job. The PR job's gate:

  if: github.event_name == 'pull_request' && (
    contains(github.event.pull_request.labels.*.name, 'mutation') ||
    contains(github.event.pull_request.labels.*.name, 'full-ci')
  )

The weekly job's crate list stays unchanged (shipper-duration,
shipper-types, shipper-config). Expanding it to the full trust-critical
surface (shipper-core, shipper-encrypt, etc.) is too expensive for a
60-minute job and is its own future rollout step; the policy stays
about routing, not coverage scope.

  xtask/src/mutants.rs          new — 3 unit tests
  xtask/src/main.rs             `mutants-pr` subcommand wiring
  .github/workflows/mutation.yml   two-job split (mutants-weekly +
                                   mutants-pr)
  docs/ci/test-evidence-lanes.md   advisory-routed table + targeted
                                   mutation section updated
  CHANGELOG.md                  Added entry

Tests:

  mutants::tests::install_hint_mentions_cargo_install    (new)
  mutants::tests::args_defaults_are_explicit             (new)
  mutants::tests::changed_requires_the_flag              (new)

24/24 tests passing.

Refs #182 (this is the third PR in the #182 sequence: advisory lane in
#230, --base + projection in #231, badges in #232, mutation scoping
here).

* fix(xtask): wrap mutants-pr doc-comment Behaviour block in fenced code

`<REF>` inside a doc comment is parsed by rustdoc as an invalid HTML tag
under `-D rustdoc::invalid-html-tags` (implied by RUSTDOCFLAGS=-D
warnings on the CI Documentation job). Wrap the whole Behaviour block in
a ```text fence so the angle brackets are literal.
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