Repository navigation
fix(rust): a test held in a value wrapper no longer earns exact credit (#8101) - #8621
Conversation
`assert_eq!(Some(r == Err(E::Bad)), Some(expected))` and the `Ok::<_, _>`, constructor, `Box::new`, `[..]`, `[..; n]`, `vec![..]` and `.unwrap()`/`.expect(..)`/`.clone()` spellings read exact/strong because the wrapper hid the test and `Some(false)` was no literal. A value wrapper now holds the test it wraps and the literal it wraps, so a wrapped test compared with a non-literal or `false` caps, while the same test asserted true through `Some(true)` still pins. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
… the literal is wrapped too (#8101) Review of 5f6ffed: peeling `Wrapper(matches!(..))` against a bare `true` dropped the unread-call cap the equality-macro form relied on. The operand now loses a value wrapper only together with one around the literal, and `Some(..).unwrap()` opens to what it holds. Adds rows for `Wrapper::from`, `.to_owned()` and the bare-literal wrappers; widens the changelog and spec wording. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
…-4g2cqz-some-wrappers # Conflicts: # docs/specs/RIPR-SPEC-0231-rust-oracle-kind-admission.md
…nce rule (#8101) After merging main's sequence rule (#8370), `[x == 3; 2]` against `[true; 2]` read its elements as `x == 3; 2` and `true; 2` and capped. A repeat array now yields its repeated value. Re-blesses the new fixture for main's human-output wording. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
A repeat array holds a read value only with a nonzero literal count, a wrapper pair peels only when both sides share the constructor shape (and ::new/::from only for Box/Rc/Arc), and a repeat compared with a list of a different length compares the test with non-literal names. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
A test inside a wrapper reads through it only against the same wrapper shape around a literal (turbofish ignored); otherwise it caps. Only Some and Ok unwrap, unknown-length repeats pair nothing, and a sequence element test paired with anything but true caps. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
…, array and vec! wrappers Struct literals, blocks and wrapper field/method access are filed as #8615. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
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 reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 3 minutes. View limit details
Comment |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm wrapper_contents duplicates shape detection already covered by shared_constructor_arguments for tuple-style constructors; sequence path repeats top-level-semicolon logic adjacent to sequence_elements' new repeat-value branch.
- Confirm ripr sensor failed (exit 2) per sensor-status; reviewer cannot independently verify that the new boolean-operand code paths compile and produce the asserted readings across the full corpus beyond author-reported
cargo test -p ripr --lib analysis::extract236 passed. The PR proof block claims pass; treat as advisory until independent witness runs.
Refuted
- No ripgrep hits in changed files for JS/typed-array surface; ub-active-view scope is out-of-domain for this PR.
- This PR introduces a JS worker handoff, async capture, GC, detach, or transfer boundary that the lane must gate.; refuted because: Diff is source-ub Rust analyzer edits for RIPR-SPEC-0231 #8101 with new text/peeling helpers, a new fixture, a new corpus entry, and a spec normative paragraph. No JS, no worker/thread/IPC, no transferable or async surface, and no FFI bindings are touched. Lane scope does not apply.
- Wrapper around a test asserted via bare literal (Wrapper(matches!(..)) vs true) could still read as exact if Wrapper was treated like Some/Ok via shared_constructor_arguments; refuted because: bool_literal_comparison_reading trims to operand only (no peer shape check) and unwrapped_wrapper_argument restricts to Some/Ok; Wrapper(matches!(..)) vs true hits the bare-literal path with no shaped-wrapper match, returns Capped via sides_compare_test_with_non_literal -> holds_wrapped_test; weak row confirms.
- Box::from(slice) / Box::<[u8]>::from(slice) allocation failure may be invoked by the shaped_wrapper_argument pass-through for Box::new; refuted because: Not raised by this PR diff or seeded thread; shaped_wrapper_argument never constructs a Box, only inspects source text. Calibrated out per lane instructions.
- passthrough_receiver's arity-1 check on .expect could mis-handle Option::expect-style or Result::expect-style calls with extra generic args; refuted because: split_top_level_commas returns the count of top-level commas only; generic/type args are not top-level commas at the call-arg depth. The contract documented in code matches the standard library's single-message signature.
- pointer-offset arithmetic in shaped_wrapper_argument risks OOB/UAF when inner is not a subslice of text; refuted because: value_wrapper_argument returns a str slice of the same input text via delimited_contents_at / final_group_open; shaped_wrapper_argument checks (inner.as_ptr() as usize).checked_sub(text.as_ptr() as usize) which is Some only when inner's start >= text's start; inner is a subslice so the offset is well-defined and bounds-checked.
Parked follow-ups
- Parked follow-ups in #8615 (struct literals, statement blocks, field/method access on a wrapper) are explicitly out of scope; surfaces not widened by this PR. Sibling scan confirms no helper change covers them.
- Passthrough chain (.unwrap/.expect/.clone/.to_owned) is symmetric: passthrough_receiver unwraps one operand, and the new shaped_wrapper_argument loop in bool_literal_comparison_reading iterates until stable.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Review of record, head c09beb8CI on this head: required Angles, each by an independent reviewer agent reading the exact diff (no cargo):
The Resolutions: all blocking findings fixed; optional items filed on #8615. Generated by Claude Code |
Summary
Before: on main, a boolean test held in a value wrapper still earned exact/strong credit when the wrapper's equality did not say the test held.
assert_eq!(Some(r == Err(E::Bad)), Some(false)),assert_eq!(Ok::<bool, ()>(..), Ok(expected)),assert_eq!(Wrapper(..), true),assert_eq!(Box::new(..), b),assert_eq!([matches!(..); n], [true; n]),assert_eq!([r == Err(E::Bad), x == 1], [false, true]), andSome(..).unwrap()/.expect(..)/.clone()/.to_owned()forms all readExactValue/ExactErrorVariantstrong.After: those readings cap to
RelationalCheck/weak. A wrapped test reads through its wrapper only against the same wrapper around a literal (same constructor, turbofish aside, or same nonzero repeat count), soassert_eq!(Some(x == 3), Some(true)),assert_eq!(Box::new(x == 3), Box::new(true))andassert_eq!([x == 3; 2], [true; 2])still pin, and wrapped plain values (Some(x)vsSome(3),vvsvec[1, 2]) are untouched.How:
bool_operands.rsgainswrapper_contents/value_wrapper_argument(constructor,new/frompath call,[..],[..; n],vec[..]),passthrough_receiver,unwrapped_wrapper_argument(onlySome/Ok),shaped_wrapper_argument(shape comparison;new/fromonly forBox/Rc/Arc) andholds_wrapped_test.sides_compare_test_with_non_literalpeels matched shapes, pairs sequence elements with a polarity check, and fails closed on any other wrapper holding a test. Builds on #8297 (shared constructors) and #8370 (sequence pairing).Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Spec: RIPR-SPEC-0231 rule 1 (caps may only lower a reading)
Governing issue or accepted claim: Refs #8101 (claim comment on the issue); residuals filed as #8615
Acceptance delta (one sentence): a test held in a call, array or
vec!wrapper no longer earns exact/strong credit unless the other side wrapstruethe same way.Candidate Relationships
Candidate branch:
claude/project-thread-4g2cqz-some-wrappers. Prerequisites #8297 and #8370 are merged. No replacement.Scope Classification
Non-goals: struct literals, statement blocks and field/method access on a wrapper (#8615); safe-direction underclaims listed there.
Support-tier Impact
Policy Impact
Proof
Discrimination: the regression rows in
bool_valued_operands_read_as_what_they_assertwere probed on main d314d7e, where every capped row read strong; the exact controls read strong on both.Three independent review passes ran on intermediate heads; their blocking findings are fixed in the last three commits (rows added for each).
Claim Boundary
May claim: the listed wrapper forms cap. Must not claim: all wrapped tests cap (see #8615).
Rollback
Revert the squash commit; no schema, output-contract or workflow change.
Spec-Test-Code Traceability
docs/specs/RIPR-SPEC-0231-rust-oracle-kind-admission.mdcrates/ripr/src/analysis/extract/oracles/relational_tests.rscrates/ripr/src/analysis/extract/oracles/bool_operands.rsfixtures/test_wrapped_in_some_not_exactStatic Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Generated by Claude Code