Skip to content

feat(rerun): compare targeted evidence with full parity - #1535

Merged
EffortlessSteven merged 2 commits into
mainfrom
perf/targeted-rerun-parity-evidence
Jul 11, 2026
Merged

EffortlessSteven merged 2 commits into
mainfrom
perf/targeted-rerun-parity-evidence

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Jul 11, 2026 •

Copy link
Copy Markdown
Member

Outcome

Extend ripr rerun --check-parity so targeted receipts retain and compare producer-owned related-test and missing-discriminator evidence against the full static pipeline. A parity mismatch remains fail-closed and now identifies the affected seam and evidence fields.

Swarm / Source Boundary

  • ripr-swarm; one review-forward PR on perf/targeted-rerun-parity-evidence.
  • No dependencies, workflow, credential, release, or support-tier changes.

Source-of-truth Links

Scope Classification

  • Adds targeted receipt evidence projection and parity diagnostics.
  • Does not add a classifier, mutation execution, test generation, or broad default rerun.

Support-tier Impact

No promotion. This remains static advisory evidence and explicitly does not claim runtime mutation behavior, correctness, coverage adequacy, or complete test quality.

Traceability

  • RIPR-SPEC-0123 traceability now includes parity_names_related_test_and_missing_discriminator_drift.
  • Targeted seams expose producer-owned related_tests and missing_discriminators arrays.

Rollback

Revert this PR to restore the previous targeted receipt shape and parity comparison. No persisted data migration is involved.

CI Economics

The normal aggregate proof is unchanged; full-pipeline parity remains explicit opt-in because it is intentionally broad and expensive.

Implementation

  • Project related-test and missing-discriminator facts from ClassifiedSeam into targeted seam receipts.
  • Compare those fields alongside canonical identity, class, file, and owner.
  • Emit parity.mismatches[] with seam IDs and mismatching fields.
  • Keep verify and receipt commands ledger-owned; no commands are synthesized from placement.

Verification

Passed locally on commit d8e7f58:

  • cargo fmt
  • cargo test -p ripr rerun --lib -- --test-threads=1 (23 passed)
  • cargo test -p ripr --test cli_smoke -- --test-threads=1 (120 passed)
  • cargo clippy -p ripr --all-targets -- -D warnings
  • cargo check -p ripr --all-targets
  • cargo xtask goldens check
  • cargo xtask fixtures
  • cargo xtask check-output-contracts
  • cargo xtask check-fixture-contracts
  • cargo xtask check-traceability
  • cargo xtask check-static-language
  • cargo xtask check-spec-format
  • cargo xtask check-pr-shape
  • cargo xtask check-pr
  • cargo-allow 0.1.10 doctor/check/worklist
  • git diff --check

Claim Boundary

This PR proves targeted and full static evidence are compared for the fields the rerun owns. It does not complete broader invalidation attribution, before/after parity across every configured input family, benchmark closeout, or the full campaign.

@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 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 53 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: 1c66e2b0-4540-4615-856f-c23d911bd358

📥 Commits

Reviewing files that changed from the base of the PR and between d8e7f58 and 6601227.

📒 Files selected for processing (1)
  • crates/ripr/tests/cli_smoke.rs

Walkthrough

Targeted rerun seams now report related-test and missing-discriminator evidence. Full-pipeline parity checks compare these fields, identify missing seams, and expose detailed mismatch fields. Tests, traceability, output documentation, and the targeted-rerun specification were updated.

Changes

Targeted rerun parity

Layer / File(s) Summary
Seam evidence reporting
crates/ripr/src/cli/rerun.rs
Targeted rerun seam output now serializes and populates related-test and missing-discriminator evidence.
Detailed parity detection
crates/ripr/src/cli/rerun.rs
Parity checks report differing fields, detect seams absent from the full pipeline, and update parity state handling with corresponding unit tests.
Parity documentation and traceability
docs/OUTPUT_SCHEMA.md, docs/specs/RIPR-SPEC-0123-targeted-rerun.md, .ripr/traceability.toml
Output examples, parity requirements, command provenance, and test traceability describe the expanded evidence.
Estimated code review effort: 3 (Moderate) ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TargetedRerun
  participant FullPipeline
  participant ParityChecker
  TargetedRerun->>ParityChecker: provide selected seam evidence
  FullPipeline->>ParityChecker: provide full-pipeline seam evidence
  ParityChecker->>ParityChecker: compare evidence and detect missing seams
  ParityChecker->>TargetedRerun: return mismatch fields and parity state
Loading

Poem

I’m a rabbit with a ledger so neat,
Related tests now hop in line complete.
Missing clues wear names bright,
Parity checks them day and night.
The rerun trail is clear and light.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: comparing targeted rerun evidence against full parity.
Description check ✅ Passed Most template sections are covered with concrete details, but the Summary/Proof/Policy Impact and checklist-style sections are absent or condensed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/targeted-rerun-parity-evidence

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/ripr/src/cli/rerun.rs`:
- Around line 736-774: Move the parity comparison logic from the CLI layer into
the appropriate app module, including parity_mismatch_fields and the
TargetedRerunSeam-related flow such as apply_full_pipeline_parity, so
cli/rerun.rs remains an argv adapter that delegates to app::*. Update callers
and visibility as needed without changing parity results.
- Around line 1444-1492: Add a test alongside
parity_names_related_test_and_missing_discriminator_drift that compares two
identical TargetedRerunSeam values, such as baseline_fields() against itself,
and assert parity_mismatch_fields returns an empty Vec. Keep the existing drift
test unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f5632122-9435-4532-b2dd-064239ae0ddc

📥 Commits

Reviewing files that changed from the base of the PR and between cffa669 and d8e7f58.

📒 Files selected for processing (4)
  • .ripr/traceability.toml
  • crates/ripr/src/cli/rerun.rs
  • docs/OUTPUT_SCHEMA.md
  • docs/specs/RIPR-SPEC-0123-targeted-rerun.md

Comment on lines +736 to +774
} else if has_mismatches {
report.state = "limited";
report.limitation = Some(TargetedRerunLimitation {
kind: "full_pipeline_parity_mismatch",
message: format!(
"{mismatches} selected seam(s) differed from the full pipeline; targeted evidence is not a successful parity result"
"{} selected seam(s) differed from the full pipeline; targeted evidence is not a successful parity result",
mismatch_count
),
});
}
Ok(())
}

fn parity_mismatch_fields(
targeted: &TargetedRerunSeam,
full: &TargetedRerunSeam,
) -> Vec<&'static str> {
let mut fields = Vec::new();
if targeted.canonical_gap_id != full.canonical_gap_id {
fields.push("canonical_gap_id");
}
if targeted.static_class != full.static_class {
fields.push("static_class");
}
if targeted.file != full.file {
fields.push("file");
}
if targeted.owner != full.owner {
fields.push("owner");
}
if targeted.related_tests != full.related_tests {
fields.push("related_tests");
}
if targeted.missing_discriminators != full.missing_discriminators {
fields.push("missing_discriminators");
}
fields
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

New parity_mismatch_fields adds real comparison logic to cli/.

Per the coding guideline, crates/ripr/src/cli/**/*.rs should be argv adapter only and all real work must go through app::*. parity_mismatch_fields is new seam-comparison business logic, not argument parsing. This extends an existing pattern in the file, but the function is newly introduced in this PR. Moving it to app::* would also require relocating TargetedRerunSeam and likely apply_full_pipeline_parity to avoid an awkward split.

As per coding guidelines: "Internal module cli/ should be argv adapter only; all real work must go through app::*."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/ripr/src/cli/rerun.rs` around lines 736 - 774, Move the parity
comparison logic from the CLI layer into the appropriate app module, including
parity_mismatch_fields and the TargetedRerunSeam-related flow such as
apply_full_pipeline_parity, so cli/rerun.rs remains an argv adapter that
delegates to app::*. Update callers and visibility as needed without changing
parity results.

Source: Coding guidelines

Comment on lines +1444 to +1492
#[test]
fn parity_names_related_test_and_missing_discriminator_drift() {
let baseline = TargetedRerunSeam {
canonical_gap_id: Some("gap:example".to_string()),
seam_id: "seam:example".to_string(),
file: "src/lib.rs".to_string(),
line: 8,
owner: "pricing::discounted_total".to_string(),
static_class: "weakly_gripped".to_string(),
related_tests: Vec::new(),
missing_discriminators: Vec::new(),
};
let targeted = TargetedRerunSeam {
related_tests: vec![TargetedRerunRelatedTest {
test_name: "discounted_total_case".to_string(),
file: "tests/pricing.rs".to_string(),
line: 12,
oracle_kind: "exact_value".to_string(),
oracle_strength: "strong".to_string(),
evidence_summary: "asserts exact total".to_string(),
relation_reason: "direct_owner_call".to_string(),
relation_confidence: "high".to_string(),
}],
missing_discriminators: vec![TargetedRerunMissingDiscriminator {
value: "amount == threshold".to_string(),
reason: "boundary value is not observed".to_string(),
}],
..baseline_fields()
};

assert_eq!(
parity_mismatch_fields(&targeted, &baseline),
vec!["related_tests", "missing_discriminators"]
);
}

fn baseline_fields() -> TargetedRerunSeam {
TargetedRerunSeam {
canonical_gap_id: Some("gap:example".to_string()),
seam_id: "seam:example".to_string(),
file: "src/lib.rs".to_string(),
line: 8,
owner: "pricing::discounted_total".to_string(),
static_class: "weakly_gripped".to_string(),
related_tests: Vec::new(),
missing_discriminators: Vec::new(),
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add a test case where all fields match.

The test covers related_tests and missing_discriminators drift but doesn't verify that parity_mismatch_fields returns an empty Vec when all fields are identical. A matching-seams case would catch a regression where the function always reports at least one mismatch.

✨ Suggested additional test
+    #[test]
+    fn parity_mismatch_fields_returns_empty_when_all_fields_match() {
+        let seam = baseline_fields();
+        assert_eq!(parity_mismatch_fields(&seam, &seam), Vec::<&str>::new());
+    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#[test]
fn parity_names_related_test_and_missing_discriminator_drift() {
let baseline = TargetedRerunSeam {
canonical_gap_id: Some("gap:example".to_string()),
seam_id: "seam:example".to_string(),
file: "src/lib.rs".to_string(),
line: 8,
owner: "pricing::discounted_total".to_string(),
static_class: "weakly_gripped".to_string(),
related_tests: Vec::new(),
missing_discriminators: Vec::new(),
};
let targeted = TargetedRerunSeam {
related_tests: vec![TargetedRerunRelatedTest {
test_name: "discounted_total_case".to_string(),
file: "tests/pricing.rs".to_string(),
line: 12,
oracle_kind: "exact_value".to_string(),
oracle_strength: "strong".to_string(),
evidence_summary: "asserts exact total".to_string(),
relation_reason: "direct_owner_call".to_string(),
relation_confidence: "high".to_string(),
}],
missing_discriminators: vec![TargetedRerunMissingDiscriminator {
value: "amount == threshold".to_string(),
reason: "boundary value is not observed".to_string(),
}],
..baseline_fields()
};
assert_eq!(
parity_mismatch_fields(&targeted, &baseline),
vec!["related_tests", "missing_discriminators"]
);
}
fn baseline_fields() -> TargetedRerunSeam {
TargetedRerunSeam {
canonical_gap_id: Some("gap:example".to_string()),
seam_id: "seam:example".to_string(),
file: "src/lib.rs".to_string(),
line: 8,
owner: "pricing::discounted_total".to_string(),
static_class: "weakly_gripped".to_string(),
related_tests: Vec::new(),
missing_discriminators: Vec::new(),
}
}
#[test]
fn parity_mismatch_fields_returns_empty_when_all_fields_match() {
let seam = baseline_fields();
assert_eq!(parity_mismatch_fields(&seam, &seam), Vec::<&str>::new());
}
#[test]
fn parity_names_related_test_and_missing_discriminator_drift() {
let baseline = TargetedRerunSeam {
canonical_gap_id: Some("gap:example".to_string()),
seam_id: "seam:example".to_string(),
file: "src/lib.rs".to_string(),
line: 8,
owner: "pricing::discounted_total".to_string(),
static_class: "weakly_gripped".to_string(),
related_tests: Vec::new(),
missing_discriminators: Vec::new(),
};
let targeted = TargetedRerunSeam {
related_tests: vec![TargetedRerunRelatedTest {
test_name: "discounted_total_case".to_string(),
file: "tests/pricing.rs".to_string(),
line: 12,
oracle_kind: "exact_value".to_string(),
oracle_strength: "strong".to_string(),
evidence_summary: "asserts exact total".to_string(),
relation_reason: "direct_owner_call".to_string(),
relation_confidence: "high".to_string(),
}],
missing_discriminators: vec![TargetedRerunMissingDiscriminator {
value: "amount == threshold".to_string(),
reason: "boundary value is not observed".to_string(),
}],
..baseline_fields()
};
assert_eq!(
parity_mismatch_fields(&targeted, &baseline),
vec!["related_tests", "missing_discriminators"]
);
}
fn baseline_fields() -> TargetedRerunSeam {
TargetedRerunSeam {
canonical_gap_id: Some("gap:example".to_string()),
seam_id: "seam:example".to_string(),
file: "src/lib.rs".to_string(),
line: 8,
owner: "pricing::discounted_total".to_string(),
static_class: "weakly_gripped".to_string(),
related_tests: Vec::new(),
missing_discriminators: Vec::new(),
}
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/ripr/src/cli/rerun.rs` around lines 1444 - 1492, Add a test alongside
parity_names_related_test_and_missing_discriminator_drift that compares two
identical TargetedRerunSeam values, such as baseline_fields() against itself,
and assert parity_mismatch_fields returns an empty Vec. Keep the existing drift
test unchanged.

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

ℹ️ 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 on lines +707 to +710
.filter(|targeted| !full_by_id.contains_key(&targeted.seam_id))
.map(|targeted| TargetedRerunParityMismatch {
seam_id: targeted.seam_id.clone(),
fields: vec!["seam_id"],

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 Do not report capped seams as parity mismatches

When --check-parity runs with a capped full inventory (for example RIPR_REPO_EXPOSURE_SEAM_LIMIT=1), selected seams that fall outside the analyzed prefix are added to parity.mismatches with fields: ["seam_id"], even though the same report is marked full_pipeline_parity_incomplete. RIPR-SPEC-0123 explicitly treats capped absence as inconclusive because the seam may simply be outside the prefix, so these mismatch entries can send follow-up agents after false parity drift; only append missing-from-full mismatches when the full inventory was complete, or report them separately as capped/unknown.

Useful? React with 👍 / 👎.

@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/ripr/src/cli/rerun.rs 93.33% 8 Missing ⚠️

📢 Thoughts on this report? Let us know!

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