Repository navigation
feat(rerun): compare targeted evidence with full parity - #1535
Conversation
|
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: 53 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 (1)
WalkthroughTargeted 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. ChangesTargeted rerun parity
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
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
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
📒 Files selected for processing (4)
.ripr/traceability.tomlcrates/ripr/src/cli/rerun.rsdocs/OUTPUT_SCHEMA.mddocs/specs/RIPR-SPEC-0123-targeted-rerun.md
| } 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 | ||
| } | ||
|
|
There was a problem hiding this comment.
📐 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
| #[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(), | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
📐 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.
| #[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.
There was a problem hiding this comment.
💡 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".
| .filter(|targeted| !full_by_id.contains_key(&targeted.seam_id)) | ||
| .map(|targeted| TargetedRerunParityMismatch { | ||
| seam_id: targeted.seam_id.clone(), | ||
| fields: vec!["seam_id"], |
There was a problem hiding this comment.
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 Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Outcome
Extend
ripr rerun --check-parityso 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 onperf/targeted-rerun-parity-evidence.Source-of-truth Links
docs/specs/RIPR-SPEC-0123-targeted-rerun.mdperf/targeted-rerundocs/OUTPUT_SCHEMA.mdScope Classification
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-0123traceability now includesparity_names_related_test_and_missing_discriminator_drift.related_testsandmissing_discriminatorsarrays.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
ClassifiedSeaminto targeted seam receipts.parity.mismatches[]with seam IDs and mismatching fields.Verification
Passed locally on commit
d8e7f58:cargo fmtcargo 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 warningscargo check -p ripr --all-targetscargo xtask goldens checkcargo xtask fixturescargo xtask check-output-contractscargo xtask check-fixture-contractscargo xtask check-traceabilitycargo xtask check-static-languagecargo xtask check-spec-formatcargo xtask check-pr-shapecargo xtask check-prcargo-allow 0.1.10 doctor/check/worklistgit diff --checkClaim 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.