Repository navigation
fix(feedback): exclude ineligible receipts from usefulness rates - #4780
Conversation
Preserve raw feedback counts while excluding unreviewed, rejected, unmatched, historical and mismatched receipts from the rate. Require an explicit comparison subject and count each receipt once across aggregate rows. Add production-join regression controls and document null rates when the eligible denominator is absent. Refs #1619, #4585. Local Rust proof unavailable; hosted proof required.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
@cursor Complete the native Rust proof/repair pass on this existing candidate only. This is an implementation handoff, not a new competing PR. Start from PR head Claim: keep raw feedback counts intact; calculate the current-result usefulness rate only from Write boundary: the three files already in this PR and narrowly necessary matching public-contract/test references. Do not widen into receipt concurrency, path confinement, richer row identities, other issues, or main-branch repair. Preserve the original feedback tests; first run rustfmt on the changed Rust file and commit its formatting in this branch. Run actual focused Rust proof with nonzero subjects: Review the safety of the new numerator/denominator arithmetic, rejected/nonhuman reviews, stale and historical identities, no row, repeated aggregate rows, preserved raw negatives, and serialized JSON parity. Fix substantive problems within this claim in the same branch. Record exact head, actual commands/counts, inherited failures and omitted proof. Do not invent local or hosted passes. No merge/auto-merge: hand back the tested current head and review findings here for integration. |
|
I finished the native proof/repair pass on existing PR #4780. Current head is I rustfmt’d Source review found no blocking arithmetic, eligibility, JSON-parity, or CLI-claim defects. Disposition is REVIEW_INCOMPLETE: hosted |
Apply rustfmt to the eligibility controls so hosted fmt --check binds to this candidate. Behavior is unchanged. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
Correct the public join contract so reviewed_human_useful_rate is numeric only when the eligible current-result cohort is nonempty, not whenever any human-reviewed receipt exists. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
EffortlessSteven
left a comment
There was a problem hiding this comment.
review-pr record (native proof handoff)
reviewed_head_sha: 3133c87ccd96e52acaab5922df76a697c6726b09
integration_basis: recorded exact base 172b165bc2b375d8df7ac0b49585ef35ff368f42 (= git merge-base origin/main HEAD). origin/main has later unrelated commits; behind-only, not restacked.
claim_boundary: raw feedback counts stay intact; reviewed_human_useful_rate is computed only from reviewed_accepted human reviews that match an existing route-quality row and an explicit comparison identity; each receipt counts once; missing comparison/match or zero eligible receipts means null; accepted negatives stay in the denominator. No new CLI flags, analysis, policy, workflow, dependency, or release action.
changed_surfaces_and_semantic_owners_inspected:
- owner
crates/ripr/src/app/feedback.rs::build_join(rate eligibility, once-per-receipt increment, nullable rate, additive denominator fields) - consumers
cli/commands/feedback.rs(live_identity: Noneon record and export) andoutput/feedback.rs(join passthrough render) - domain
ReviewStatus::is_reviewed/ReviewedAccepted/classify_reference(absent live identity remainsCurrent, not used as rate eligibility) - public contracts
docs/specs/RIPR-SPEC-0179-local-usefulness-feedback-receipts.md,docs/OUTPUT_SCHEMA.md - slice
.allow/spec-system/slices/feedback-usefulness-rate-eligibility.v1.toml
blocking_findings: none on this source/oracle pass
non_blocking_suggestions:
usefulness_rate_keeps_a_current_negative_opinion_in_the_denominatoragrees with the pre-repair rate (0.0) when the lone receipt is already human-reviewed; it discriminates 0.0 vs null, not old vs new eligibility. The comparison/exclusion/mixed tests are the red controls.rate_excluded_reviewed_human_totalis ausizesubtract that is safe because eligible receipts are a subset ofis_reviewed_human; a named helper/debug_assertwould make that invariant local rather than implied.- Rate remains
f64(0.5and0.0are exact here). Non-dyadic fractions would be binary floats.
refuted_or_stale_findings:
- worktree doctor "behind origin/main by 1 commit" is hygiene, not a restack demand (
AGENTS.mdbehind-only rule). - CodeRabbit/Gemini quota messages are missing review, not findings against this head.
proof_and_ci_observed:
- Honest red (owned temp old-rate logic, tests compiled and ran): 4
usefulness_ratetests; 3 failed on assertions (no comparison,historical, eligible total 5 vs 2); 1 passed (negative 0.0). Restored candidate hashaf7e6946d7f39e0d9c7844db4396c933532382eccab6bb1a6b5f97249e683c78. cargo test -p ripr --lib feedback: 36 passed, 0 failed, 6447 filtered out.cargo test -p ripr --lib usefulness_rate: 4 passed, 0 failed, 6479 filtered out.- CLI export test still asserts a null rate; CLI supplies
live_identity: None. cargo check -p ripr --all-targets: pass.cargo xtask check-fast: pass, selector 4 files, ran 10, skippedcheck-fixture-contracts(no fixtures).cargo xtask precommit: pass (policy/docs/contracts; does not replace the focused tests).- Hosted on this SHA:
source-of-truth,spec-maintenance-digest,pr-plan,dependency-review,cargo-deny, GitGuardian success;Rust-only feature laneandub-reviewin_progress; several lanes skipped-by-policy.
proof_or_review_missing:
- Hosted required Rust/Clippy matrix on this exact head is not complete (
Rust-only feature lanein_progress). - External bot review is quota-limited/skipped, not a clean review.
- No merge-gate aggregator result observed yet.
residual_assumptions_and_non_claims:
- This rate is not population usefulness, analyzer correctness, or reviewer authentication. Comparison provenance remains a caller duty.
- Public CLI still cannot emit a numeric rate; that is intended, not a missing flag.
- Receipt concurrency, path confinement, and richer row identities remain out of scope.
disposition: REVIEW_INCOMPLETE
Source and local oracle look ready. Do not merge or auto-merge until hosted exact-head required checks finish and a published-head review re-binds this SHA.
| if matched | ||
| && receipt.review_status == crate::domain::ReviewStatus::ReviewedAccepted | ||
| && receipt.review_actor_kind == Some(ActorKind::Human) | ||
| && live_identity.is_some_and(|live| { | ||
| classify_reference(&receipt.identity, Some(live)) == ReferenceState::Current | ||
| }) |
There was a problem hiding this comment.
🔍 Sampled identities limit rate coverage
The route-quality producer keeps only three sample identities per row. Feedback for another attempt in that row cannot enter the new rate through the existing sample-based match. The rate therefore describes matched samples, not every attempt represented by the objective counts.
Was this helpful? React with 👍 or 👎 to provide feedback.
| - `crates/ripr/src/app/feedback.rs::tests::usefulness_rate_requires_a_comparison_and_a_matching_row` | ||
| - `crates/ripr/src/app/feedback.rs::tests::usefulness_rate_excludes_each_ineligible_review_without_losing_counts` | ||
| - `crates/ripr/src/app/feedback.rs::tests::usefulness_rate_counts_eligible_receipts_once_across_aggregate_rows` | ||
| - `crates/ripr/src/app/feedback.rs::tests::usefulness_rate_keeps_a_current_negative_opinion_in_the_denominator` |
There was a problem hiding this comment.
🔍 Rate tests absent from traceability map
The spec lists four new rate tests, but the RIPR-SPEC-0179 traceability entry omits them. That leaves the new behavior outside the authored spec-to-test mapping.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Confirmed findings
- Even when every eligibility precondition holds, the rate is bounded to the route-quality producer's three-sample identity window; the corrected JSON can still describe a strict subset of attempts. Spec text does not call this out, and the slice does not list it as a return condition.
Verification questions
- Confirm the
unreviewedfixture inusefulness_rate_excludes_each_ineligible_review_without_losing_countssetsactor_kind=Human(default from payload) butreview_statusis None, soreviewed_human_total==0. The new eligible denominator assertion (0) is consistent only because the gate requires ReviewedAccepted; this is correct but the test name and acceptance matrix do not explicitly cover an unreviewed-but-otherwise-eligible receipt under a valid comparison. Minor coverage gap, not a defect. - Confirm usefulness_rate_keeps_a_current_negative_opinion_in_the_denominator only exercises the path where the row matches by gap; it does not cover negative receipt that is current by classify_reference but unmatched to a row. Current null-rate path is still covered by the comparison/matching test.
- Confirm sample-canonical-gap matching can undercount attempts: route-quality row stores only 3 sample gap ids, so eligible attempts on other gap ids in the same row are excluded from rate numerator/denominator.
- Confirm rIPR-SPEC-0179 traceability entry omits the four new rate tests; spec-to-test mapping is now incomplete for this generation.
- Confirm traceability gap (4 new rate tests absent from .ripr/traceability.toml) is a spec-coverage concern, not an active-view concern; demote to sibling-paths/spec lane.
- Confirm traceability map (
.ripr/traceability.toml) was not updated to list the four new tests, so authored spec-to-test mapping drifts from spec 0179 generation 2. Devin flagged this; still open in the diff.
Refuted
- Rate accumulation should be extracted into a dedicated app::rate module to keep build_join small and to centralize eligibility policy.; refuted because: Eligibility is intrinsically tied to the per-receipt match result of build_join; extracting it would either duplicate the row-match work or introduce a new seam that the slice's forbidden_seams list explicitly excludes. Keeping two usize accumulators next to the existing matched/unmatched vectors preserves the smallest complete fix and the once-per-receipt invariant.
- Tests cannot distinguish old from new rate behavior because the comparison path is always None in the live CLI.; refuted because: False premise: the new tests call build_join directly with both Some(live) and None, and a fifth path asserts the null rate. The null-vs-number flip on the human/agent control is itself a discriminator.
- Box::from-style allocation failure could cause
rate_*counters to silently undercount when growingrow_feedbackruns out of memory; refuted because: Eligibility counters are stackusize; noBox::new/Vec::with_capacityon the new code path. The seeded thread and diff do not raise this; per calibration it stays a refuted false-premise.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Parked follow-ups
- Devin-ai sampled-identities concern does not reopen in this diff (sample_canonical_gap_ids unchanged).


Summary
Repair a denominator defect found while working through #1619/#4585 after #4684 merged. The shared join currently counts every human-reviewed useful receipt toward
reviewed_human_useful_rate, even when the receipt is unmatched, historical, mismatched, or its review was rejected. It also produces a number when no comparison subject was supplied. The document's ownmust_not_inferand RIPR-SPEC-0179 prohibit those results.This candidate preserves raw counts and calculates the rate only from human-accepted receipts matched to an existing row and the explicitly supplied current result identity. Each receipt counts once across aggregate rows. No eligible denominator means null; accepted negative opinions stay in the denominator.
Swarm / Source Boundary
Source-of-truth Links
Proposal: existing #1619/#4585 contract; no new proposal.
Spec: docs/specs/RIPR-SPEC-0179-local-usefulness-feedback-receipts.md
ADR: unchanged.
Plan item: #1693 developer-value execution map.
Governing issue or accepted claim: #1619; residual correctness finding in merged #4684, not reopening all of closed #4585.
Acceptance delta: the displayed usefulness rate has an explicit eligible receipt denominator and cannot be fabricated from excluded or unvalidated feedback.
Implementation slice: .allow/spec-system/slices/feedback-usefulness-rate-eligibility.v1.toml
Candidate Relationships
Candidate branch: fix/1619-feedback-rate-eligibility
Exact base: 172b165
Candidate head: 9731968
Candidate tree: 2ec9285a5fa8ea3dfa3b0920953b51e07f30a1bd
Stack prerequisite: none; #4684 is already present in the base.
Replacement: none. All-state title searches found the merged local-feedback implementation and unrelated Python panel work, not another rate-eligibility candidate.
Production and evidence delta
reviewed_acceptedplus a human review actor, an actual row match, and an exact supplied comparison identity before a receipt enters the rate.rate_comparison_providedand the eligible useful/total and excluded human-reviewed counts.Acceptance matrix
Proof
Local environment: no Cargo/rustc/gh and no runtime outbound DNS. Source and existing test/contract paths were inspected through GitHub. No local compile, rustfmt, worktree-doctor, check-fast, precommit or Rust test execution is claimed. The behavioral pre-repair red dimension is NOT_ESTABLISHED; source inspection shows why the new expected results differ from the old implementation.
Hosted proof required on this exact candidate:
Require nonzero intended test counts. Existing hosted routing owns the required Rust/Clippy/policy matrix; no extra always-on workflow is added. This PR remains draft/REVIEW_INCOMPLETE until actual proof and exact-head substantive review are reconciled.
Review scope and residuals
Inspected semantic owner
app/feedback.rs, callers incli/commands/feedback.rs, domainResultIdentity/ReviewStatus/reference classification and RIPR-SPEC-0179. The new cohort is bounded to an explicitly supplied identity; this is not general population usefulness or current analyzer correctness. Reviewer identity and the supplied comparison's provenance remain caller responsibilities. The correction neither invents a new source of current truth nor authenticates review actors.Concurrency of receipt creation, filesystem confinement, explicit export-path resolution and richer row identities are separate existing implementation risks, not silently bundled into this rate patch.
Support-tier and policy impact
Support-tier impact: none. Public JSON gains additive denominator fields and a more conservative nullable rate. Recording, visibility, suppressions, baselines, gates, static movement, command execution, LSP/MCP and telemetry are unchanged.
Policy impact: one implementation slice and clarification of the existing spec. No new dependency, process/network surface, non-Rust program or workflow.
Rollback
Revert this three-file change. Existing feedback receipt bytes and raw-count fields are unchanged. Do not delete retained receipts or change policy to compensate.
CI Economics
Reuse the existing routed PR checks and focused feedback tests. No full-workspace rerun or new hosted lane solely for the new tests. No savings claim, release qualification or support promotion follows from a green unit test.
stackable = false