Repository navigation
feat(feedback): record local result-bound usefulness receipts - #4684
Conversation
Add an explicit `ripr feedback record|export` CLI that writes ignored JSON receipts for useful/incorrect/unclear/expensive/intentional-no-action judgments bound to an immutable snapshot, then joins them onto existing route-quality rows. Recording changes no diagnostic, classification, baseline, suppression, gate, or gap-closure state. Closes #4585. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
|
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 reachedNext included review available in 16 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (20)
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 |
Repair-kind coincidence is not a result identity, so a receipt for one gap no longer attaches to every similarly named route-quality row. Drop the unused parent help re-export. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
Keep reason and review types in the test module so lib builds stay warning-free. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
check-no-panic-family rejects new expect/expect_err even in tests. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
Isolation-test needles no longer spell Command::new. A matching --judgment collapses onto the derived class so repeat recording stays idempotent. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
EffortlessSteven
left a comment
There was a problem hiding this comment.
review-pr (author COMMENT; GitHub cannot request changes from the author)
reviewed_head_sha: 256a44fa77abd1eb71660d7968884aa8acbed327
integration_basis: origin/main ade6998adbdd8c719a4108f43c9dfec93cb245a1
claim_boundary: #4585 / RIPR-SPEC-0179 local result-bound usefulness receipts + join onto existing route-quality rows. No editor/LSP/MCP write, no #4572 attempt retention, no #4570 reporting ownership beyond the join, no 0.11/support promotion.
changed_surfaces_and_semantic_owners_inspected:
domain::feedback identity/taxonomy/classify_reference
app::feedback record/load/join (atomic_file, path confinement, secret-pattern fail-closed)
output::feedback JSON receipt/join + policy_effects unchanged
cli::commands::feedback record/export + help/flag parity
cli command/execute/help wiring, COMMAND_HIERARCHY, OUTPUT_SCHEMA, spec 0179, slice, traceability
blocking_findings: none in source/oracle for this head
non_blocking_suggestions:
- export --out is a caller-chosen local path; ParentDir is not rejected there (record --root/--idempotency-key are confined).
- FeedbackReason::Other.judgment() still returns a dummy Unclear; validate/record require --judgment, so export uses the override.
- A receipt whose item/attempt appears in multiple route-quality samples can attach to more than one row; join does not invent a second ledger.
refuted_or_stale_findings:
- gemini-code-assist quota comment is missing review, not a finding.
- coderabbit skip-review (repo <10 stars) is missing provider review, not a clean pass.
proof_and_ci_observed:
cargo test -p ripr --lib -- feedback: 32 passed
cargo test -p ripr --test cli_help_hierarchy docs_keep_the_canonical_role_vocabulary: pass
cargo xtask precommit: pass (incl. check-no-panic-family, check-process-policy, check-network-policy, check-public-api, check-output-contracts)
hosted: Rust gates + rust-only feature lane + ub-review still in_progress on this SHA; several optional lanes skipped-by-policy
proof_or_review_missing:
exact-head required hosted merge-gate jobs not yet terminal
no independent external reviewer (quota/skip)
affected_currentness_dimensions: production implementation, test stimulus/oracle, public claim, candidate head identity
residual_assumptions_and_non_claims:
receipts are opinion, not analyzer correctness or runtime mutation results
secret-pattern notes are best-effort
recording does not mutate diagnostics/classification/baseline/suppressions/gates/gap closure
disposition: REVIEW_INCOMPLETE
Inspected the full 20-file diff against origin/main. Production layers stay split (domain JSON-free types, app record/join, output render, CLI adapter). File/line is rejected as identity. Idempotency is key+normalized payload; matching --judgment collapses onto the derived class. Join matches canonical item or attempt id only, not repair-kind coincidence. Isolation test needles no longer spell Command::new.
This COMMENT is not approval. Merge convergence waits for terminal required checks on 256a44fa77abd1eb71660d7968884aa8acbed327.
EffortlessSteven
left a comment
There was a problem hiding this comment.
review-pr published-head (author COMMENT)
reviewed_head_sha: 256a44fa77abd1eb71660d7968884aa8acbed327
integration_basis: origin/main eb3a2e9ce5affe144c99767ebe5b25ab6bac9d6b (behind-only; no restack)
claim_boundary: #4585 / RIPR-SPEC-0179 local usefulness receipts + route-quality join. No editor/LSP/MCP write, no #4572/#4570 absorption, no 0.11/support promotion.
changed_surfaces_and_semantic_owners_inspected: unchanged from the 256a44fa7 source pass (domain/app/output/cli feedback + spec/docs/help wiring)
blocking_findings: none
non_blocking_suggestions: unchanged (export --out caller path; Other.judgment dummy Unclear; multi-row join on shared sample ids)
refuted_or_stale_findings:
- gemini quota: missing provider review, not a finding
- CodeRabbit skip: missing provider review, not a pass
- ub-review cancelled: missing advisory provider, not a required-check failure
proof_and_ci_observed:
Ripr Rust Small Result: success on this SHA
Ripr Rust Small on GitHub Hosted / Rust gates: success (no failed steps; Required Rust tests completed)
Rust-only feature lane, source-of-truth, spec-maintenance-digest, cargo-deny, dependency-review, pr-plan, GitGuardian: success
skipped-by-policy: docs gate, extra rust-small runners, vscode, msrv, coverage, windows, future-clippy, droid
local: cargo test -p ripr --lib -- feedback (32); cli_help_hierarchy pin; cargo xtask precommit
proof_or_review_missing: independent bot reviewers unavailable (quota/skip/cancelled); author review-pr is the current semantic pass
affected_currentness_dimensions: exact-head CI/receipts (refreshed); production/oracle/public claim unchanged
residual_assumptions_and_non_claims: receipts are opinion, not analyzer correctness or runtime mutation results
disposition: REVIEW_READY
Head did not move. Source/oracle inspection from the prior COMMENT still binds this SHA. Hosted required merge-gate Ripr Rust Small Result is now terminal success. Zero review threads. This COMMENT is not GitHub approval; it is the published-head merge-review disposition for ordinary squash.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| fn receipt_matches_row(receipt: &FeedbackReceipt, row: &RouteQualityRow) -> bool { | ||
| if let Some(item) = &receipt.identity.canonical_item | ||
| && row | ||
| .sample_canonical_gap_ids | ||
| .iter() | ||
| .any(|candidate| candidate == item) | ||
| { | ||
| return true; | ||
| } |
There was a problem hiding this comment.
🔴 Old feedback joins unrelated repair routes
When a gap reappears under another route or snapshot, receipt_matches_row attaches its old receipt by gap ID alone. The join counts that judgment against an unrelated route's objective results.
Learn more
The route-quality producer groups attempts by repair kind and, optionally, language in ripr_swarm_attempt_ledger_repair_route_quality_grouped. The join tests only whether a canonical gap ID or attempt ID appears in a row's samples. Canonical gaps can have multiple attempts and route kinds, while the receipt also records a snapshot and optional route/attempt binding. A gap-only match does not establish that the receipt belongs to the sampled route or the analysis it describes.
Example: A receipt for gap:alpha records the add_assertion route in snapshot snap-A. A later add_missing_test attempt for the same gap appears in another route-quality row. Both rows count the old receipt as their feedback when they sample gap:alpha.
Recommended fix: Join through producer-owned attempt/result identities with route and snapshot provenance where available. Do not treat a shared gap sample as sufficient proof of route-level identity; leave ambiguous bindings unmatched.
Was this helpful? React with 👍 or 👎 to provide feedback.
| if let Some(attempt) = &receipt.identity.attempt_id | ||
| && row | ||
| .sample_attempt_ids | ||
| .iter() | ||
| .any(|candidate| candidate == attempt) | ||
| { | ||
| return true; | ||
| } | ||
| // Repair-kind / route-digest coincidence is not identity: many rows share | ||
| // a kind. Unmatched receipts stay unmatched rather than attaching to every | ||
| // similarly named route. | ||
| false |
There was a problem hiding this comment.
🟡 Feedback beyond three samples stays unmatched
For a route with more than three attempts, receipt_matches_row cannot find identities omitted from its samples. The route-quality producer caps sample IDs at three, so valid feedback is reported unmatched.
Learn more
Route-quality rows expose representative IDs, not a full list of member attempts. ripr_swarm_push_limited_unique stops collecting both sample gap and sample attempt IDs once each list has three entries. The new join uses those samples as its only membership index, so it systematically loses the association for receipts on omitted attempts.
Example: A route has four attempts on four different gaps. A receipt names the fourth attempt and gap, but the row carries only the first three sample IDs. Export places the receipt in unmatched_receipts instead of counting it in the route.
Recommended fix: Join against complete producer-owned attempt membership, or represent the inability to identify unsampled members explicitly rather than calling them unmatched.
Was this helpful? React with 👍 or 👎 to provide feedback.
| let route_quality_path = options | ||
| .route_quality | ||
| .clone() | ||
| .unwrap_or_else(|| root.join(DEFAULT_ROUTE_QUALITY)); |
There was a problem hiding this comment.
🟡 Relative route-quality path ignores root
With --root set outside the working directory, --route-quality resolves relative to the working directory. export_feedback_join then omits the selected repository's rows or joins against another file.
Learn more
The default path is built under the canonical repository root. A user-supplied relative path is passed directly to the JSON loader, which interprets it relative to the process working directory. The receipt directory still uses --root, so export can combine receipts from one repository with route-quality rows from another.
Example: Run from /tmp with --root /work/project --route-quality target/ripr/reports/route-quality.json. Receipts come from /work/project, but the route-quality input resolves under /tmp and is treated as absent there.
Recommended fix: Resolve relative route-quality paths against the canonical root, while retaining absolute paths as explicit inputs.
Was this helpful? React with 👍 or 👎 to provide feedback.
| let reason = FeedbackReason::parse(required_str(value, "reason")?)?; | ||
| let judgment = FeedbackJudgment::parse(required_str(value, "judgment")?)?; | ||
| let judgment_override = if reason == FeedbackReason::Other { | ||
| Some(judgment) | ||
| } else { | ||
| None | ||
| }; |
There was a problem hiding this comment.
🟡 Malformed receipts count as valid feedback
When a stored receipt has a mismatched reason and judgment, rendered_receipt_from_value accepts it without validating their relationship. Export counts the derived reason judgment, hiding the malformed input instead of failing closed.
Learn more
The loader parses the stored judgment but discards it for every reason except other. It also omits the domain FeedbackPayload::validate, so a receipt that fails recording's semantic checks can still enter exports. The loader's typed conversion is the read boundary for all stored receipts.
Example: A JSON receipt says reason: "useful_limitation" and judgment: "incorrect". Recording rejects that combination, but export accepts the JSON and counts it as useful.
Recommended fix: Validate the reconstructed payload and require the stored judgment to equal its derived judgment for closed reasons; validate all loaded receipt invariants before the record or join uses it.
Was this helpful? React with 👍 or 👎 to provide feedback.
| "historical_total": receipts.iter().filter(|receipt| classify_reference(&receipt.identity, live_identity) == ReferenceState::Historical).count(), | ||
| "mismatched_total": receipts.iter().filter(|receipt| classify_reference(&receipt.identity, live_identity) == ReferenceState::Mismatched).count(), |
There was a problem hiding this comment.
🟡 Historical feedback disappears from staleness counts
The public feedback export always passes no live identity, so classify_reference returns current for every receipt. Even receipts stored as historical or mismatched produce zero historical and mismatched counts.
Learn more
The CLI parse_export_options always supplies live_identity: None. classify_reference treats absence of a comparison identity as current, while the export ignores receipt.reference_state. Thus the exported historical and mismatched counters can never represent stored reference states, even when the receipt was recorded with a live comparison by an internal caller.
Example: A receipt stored with reference_state: "historical" is loaded during ripr feedback export; historical_total reports 0 because the CLI has no live comparison identity.
Recommended fix: Either use the stored state when no live identity is provided and label it as recorded-time state, or supply an authoritative current comparison identity and compute export-time currentness. Never claim zero historical records solely from an absent comparison.
Was this helpful? React with 👍 or 👎 to provide feedback.
| let reviewed_human_useful = receipts | ||
| .iter() | ||
| .filter(|receipt| { | ||
| is_reviewed_human(receipt) && receipt.judgment() == FeedbackJudgment::Useful | ||
| }) | ||
| .count(); |
There was a problem hiding this comment.
🟡 Rejected reviews count as useful approvals
When a human rejects useful feedback, reviewed_human_useful_rate still counts it as useful. is_reviewed_human accepts both reviewed statuses, so rejected judgments inflate the reported rate.
Learn more
The review vocabulary includes reviewed_accepted and reviewed_rejected. is_reviewed_human uses is_reviewed(), which includes both states. The numerator for the reviewed-human useful rate therefore treats a rejected useful submission as a useful reviewed verdict.
Example: The only receipt has reason: "useful_actionable", review_status: "reviewed_rejected", and review_actor_kind: "human". Export reports a reviewed_human_useful_rate of 1.0, even though the human rejected that feedback.
Recommended fix: Decide whether the measure is accepted usefulness or raw submissions reviewed by a human. For the former, restrict the numerator to ReviewedAccepted and expose rejected feedback separately; keep the denominator and rate name consistent with that definition.
Was this helpful? React with 👍 or 👎 to provide feedback.
| ## Implementation Mapping | ||
|
|
||
| - `crates/ripr/src/domain/feedback.rs` — typed identity, reason taxonomy, and | ||
| reference-state classification | ||
| - `crates/ripr/src/app/feedback.rs` — record, load, privacy, join | ||
| - `crates/ripr/src/output/feedback.rs` — JSON receipt and join rendering | ||
| - `crates/ripr/src/cli/commands/feedback.rs` — `ripr feedback record|export` |
There was a problem hiding this comment.
| if let Some(path) = out { | ||
| crate::atomic_file::write(&path, rendered.as_bytes(), "usefulness-feedback join")?; |
There was a problem hiding this comment.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 256a44fa77
ℹ️ 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".
| ExportFeedbackOptions { | ||
| root, | ||
| route_quality, | ||
| live_identity: None, |
There was a problem hiding this comment.
Provide a live identity before reporting reference state
When the public feedback export command is used, parse_export_options always sets live_identity to None (and the record parser does the same), so classify_reference always returns Current; consequently historical_total and mismatched_total are permanently reported as zero even after a later attempt or different snapshot. Supply a real comparison identity, or represent these counters as unavailable rather than manufacturing zero-valued evidence.
AGENTS.md reference: AGENTS.md:L237-L239
Useful? React with 👍 / 👎.
| let reviewed_human_useful = receipts | ||
| .iter() | ||
| .filter(|receipt| { | ||
| is_reviewed_human(receipt) && receipt.judgment() == FeedbackJudgment::Useful |
There was a problem hiding this comment.
Exclude human-rejected receipts from the useful numerator
When an agent records useful_actionable and a human marks it reviewed_rejected, is_reviewed_human is still true and this predicate counts the rejected judgment as useful, producing a reviewed_human_useful_rate of 1.0 for a single rejected receipt. Require ReviewedAccepted for the numerator, or report accepted and rejected review outcomes separately so the rate does not claim human endorsement that the receipt explicitly lacks.
AGENTS.md reference: AGENTS.md:L249-L252
Useful? React with 👍 / 👎.
| let judgment_override = if reason == FeedbackReason::Other { | ||
| Some(judgment) | ||
| } else { | ||
| None |
There was a problem hiding this comment.
Reject contradictory stored receipt judgments
If a stored receipt is edited or emitted by another compatible writer with a closed reason such as wrong_target but judgment: "useful", this parser validates both strings and then silently discards the stored judgment, causing export and idempotency checks to reinterpret the malformed receipt as incorrect. It similarly bypasses the domain relationships enforced by FeedbackPayload::validate; reconstruct and validate the semantic payload, including checking that a closed reason's stored judgment matches its class, so malformed receipts fail closed.
AGENTS.md reference: AGENTS.md:L210-L217
Useful? React with 👍 / 👎.
| let key = resolve_idempotency_key(&payload, options.idempotency_key.as_deref())?; | ||
| let directory = feedback_directory(&root)?; | ||
| let path = receipt_path(&directory, &key)?; | ||
| if let Some(existing) = load_receipt_file(&path)? { |
There was a problem hiding this comment.
Make the idempotency conflict check atomic
When two processes concurrently record different payloads under the same previously unused key, both can observe no receipt here and proceed to atomic_file::write; on platforms where rename replaces the destination, both return Created and the last writer silently wins instead of reporting the promised conflict. Use create-if-absent or a per-key lock, then re-read and compare after losing the creation race, and add a concurrent different-payload regression test.
Useful? React with 👍 / 👎.
Summary
Add an explicit local CLI that records result-bound usefulness feedback receipts (
useful/incorrect/unclear/expensive/intentional_no_action) and a read-only join onto existing route-quality rows.Recording is explicit: analyze, hover, and packet paths never record feedback. Identity is snapshot plus optional canonical item; file/line is rejected. The same idempotency key and payload produce one record; a different payload is a conflict. Policy artifacts, diagnostics, classification, gates, and gap closure are unchanged.
Closes #4585.
Swarm / Source Boundary
This PR targets
EffortlessMetrics/ripr-swarm, the normal development trunk for trusted same-reporiprwork. Confirm the change belongs here:ripr-swarmIf this PR moves crates.io publishing, VS Marketplace publishing, Open VSX publishing, GitHub Release assets, signing, release environments, or release secrets, close or retarget it. Those surfaces belong in
EffortlessMetrics/riprunless a dedicated release-boundary change has already been approved.Source-of-truth Links
Proposal: none (leaf of #1619)
Spec: RIPR-SPEC-0179
ADR: none
Plan item: none
Governing issue or accepted claim: #4585
Acceptance delta (one sentence): An explicit local CLI records a versioned usefulness receipt bound to an immutable snapshot and can join those receipts onto existing route-quality rows without mutating analyzer or policy state.
Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication):
cursor/local-usefulness-feedback-receipts-77d5Stack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): n/a
Accepted winner and losing candidate disposition (when decided): n/a
Open #4673 occupies RIPR-SPEC-0178 for rust-repair-trust route yield (#4570). This leaf uses RIPR-SPEC-0179 and does not absorb that claim. Open #4636 is #4572 attempt retention and is also out of scope.
Scope
One local feedback receipt/CLI/join unit. Editor, LSP, and MCP write surfaces stay later #1619 work.
Scope Classification
This PR is scoped by:
Production delta:
ripr feedback recordwritestarget/ripr/feedback/<key>.jsonwith schema0.1/ kindusefulness_feedback_receipt.ripr feedback exportjoins stored receipts onto existing route-quality rows (kindusefulness_feedback_join) without a second attempt ledger.--judgmentcollapses onto the derived reason class so reload and repeat recording stay idempotent.Evidence/support delta:
Single acceptance criterion:
Non-goals:
Support-tier Impact
docs/status/SUPPORT_TIERS.mdClaim/proof notes:
Policy Impact
Ledger or exception notes:
policy/doc-artifacts.tomland.ripr/traceability.toml. Isolation-test needles are split so the recorder stays at zeroCommand::newsites. No new process/network exceptions.Proof
Result, failures, or skipped proof:
expect/expect_errtoResult, splits process-policy needles, and normalizes matching--judgment. Focused tests andcargo xtask precommitrun against this published head. Hosted PR CI owns the required merge-gate matrix.Claim Boundary
What may be claimed after this PR? Operators can record local usefulness judgments against an immutable snapshot and join them onto existing route-quality rows. Those receipts are opinion, not analyzer correctness, runtime mutation results, or gate authority.
What must not be claimed yet? Editor/LSP/MCP write integration, attempt retention, reporting ownership, success percentages from unreviewed/stale/missing feedback, or support-tier promotion.
Rollback
Revert the PR. Local receipts under
target/ripr/feedback/remain unsupported historical data.Spec-Test-Code Traceability
crates/ripr/src/{domain,app,output,cli/commands}/feedback.rsdiscriminatorscrates/ripr/src/{domain,app,output,cli/commands}/feedback.rsStatic Language Check
killed,survived,untested,proven, andadequate.CI Economics
feedbacktests plus public CLI controlstarget/ripr/feedback/*.json, optional join JSONEngineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Gates
Hosted PR CI owns the required merge-gate matrix. Local focused tests and
precommitrun against this published head.