Repository navigation
Read closure boundaries in Rust iterator adaptors (RIPR-SPEC-0265) - #7914
Conversation
…nce inputs (#6502) RIPR-SPEC-0260: a boundary in a filter/map/any/all closure over an owner slice parameter reads its inputs from the elements of literal sequences the related tests pass, and an owner-return pin admits the adaptor tail only when the pinned call runs the closure on a readable, non-empty literal. Moves grid-iter-exact/helper/table to ideal; adds two trap cases. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PmU1fjKwzXeGTi8ya5FamB
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PmU1fjKwzXeGTi8ya5FamB
|
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 reachedThe included review limit has been reached and this organization has disabled usage-based review continuation. Wait for reviews to reset or ask a billing admin to change After included review limits. Next included review available in 9 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Summary by CodeRabbit
WalkthroughThis change adds a proposed specification and Rust analysis for closures in selected iterator-adaptor tails. The analyzer reads supported literal-sequence inputs, evaluates boundary evidence and assertion pairing, admits qualifying owner-return pins, and propagates findings. Tests and verdict-corpus records cover supported and excluded cases. ChangesRust Iterator Adaptor Analysis
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~60 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant Test as Test input
participant Activation as Activation analysis
participant Pairing as Boundary pairing
participant Flow as Propagation analysis
Test->>Activation: Provide readable literal-sequence inputs
Activation->>Pairing: Report observed element boundary
Pairing->>Flow: Accept matching whole-owner assertion
Flow->>Flow: Record adaptor-tail propagation witness
Merge Risk: ⚪ Minimal · up to
|
…#6502) Review of #7914 found map+count, set collects and filter+sum credited changes no test can catch. RIPR-SPEC-0260 now admits filter+count, filter/map+collect into a Vec, map+sum over arithmetic, and any/all; everything else fails closed. Trap labels record the observing commit. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PmU1fjKwzXeGTi8ya5FamB
…ll (#6502) An assertion that reads an index, len() or is_empty() of the collected result does not observe every element. Also refuse a collect when the owner's file rebinds Vec. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PmU1fjKwzXeGTi8ya5FamB
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PmU1fjKwzXeGTi8ya5FamB
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm helper chain hop rejects macro hops and caller rebinds; shadowed entry helper calls are filtered.
- Confirm floor in fixtures/rust-verdict-corpus/spec-coverage.toml moved 106 -> 112; six examples (3 grid-iter moved ideal + 2 new authored traps) plus floor headroom. The 6-pt jump assumes no other moved rows regress; verify with
cargo xtask verdict-corpus checkonce base-packet lands.
Refuted
- closure_adaptor.rs duplicates literal-sequence parsing already present in activation.rs/boundary_constant; refuted because: Repeated literal_sequence routine and collapse helper. Rejected: existing routines in activation/helper_transfer operate on call arguments resolved by the index, not on the per-run slice elements the new code names. The new vocabulary (literal_sequence, run_reaches_boundary) is shape-specific and reuses helper_transfer.caller_rebinds_parameter and rust_index.constant_table_column rather than paralleling the path.
- Vec-rebinding detection could miss a
pub use foo::Vec;glob re-export in the same file, allowing acollect()into a non-Vec to be miscredited.; refuted because:keeps_standard_vecchecks masked source forstruct\|enum\|union\|type\|trait Vecplusdeclaring_file_rebindswith through_macro=false;declaring_file_rebindswalksUseitems, including globs in a glob-aware path. Without source view in the build receipt, this is plausible but the unit testadaptor_gate_refuses_a_collect_into_a_rebound_veccoversuse other::Vec;andtype Vec = .... Risk: apub use crate::foo::Vec;oruse std::collections::*;re-export outside core/alloc could slip. Low likelihood, fail-closed path is plausible.
Parked follow-ups
- whole_owner_call_operands in boundary_pairing.rs strips a leading
!from the assert! condition but does not re-mask comments/strings; pathological comments/strings inside the operand could in principle confuse split_top_level. Tests do not cover this. Tangential to ub-active-view; surfaced as a parked source-route follow-up, not a finding here. - Adjacent helper path: Vec-rebind detection in keeps_standard_vec covers type/use/glob/struct/enum/union/trait; covered by adaptor_gate_refuses_a_collect_into_a_rebound_vec. No sibling rebind path (HashSet via turbofish, BTreeSet via turbofish, alias
_,impl Sizedreturn) was observed in the diff.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
…er call (#6502) Element facts from an adaptor closure no longer mark a let-bound local, a projection or a helper call as boundary input. One shared admitted_owner_adaptor_tail helper applies the standard-Vec gate at the owner pin, activation and same-test pairing sites. The element boundary is computed once per probe; adaptor_tail_of skips bodies without .iter(). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PmU1fjKwzXeGTi8ya5FamB
Review of recordHead: 03a291e Angles. Independent agent reviews of the exact heads:
Findings and resolutions:
Proof on 03a291e (local):
Disposition: nothing blocking. Marking Ready for the required check. Generated by Claude Code |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- trap-iter-boundary-missing.json records the closure change
\|x\| **x > 0->\|&&x\| x > 0and lists mutants against the post body (mutated_line uses&&x). The diff mutates the pre body. The runtime truth is sound (mutants of post body) but the diff line mapping could confuse an automated reviewer expecting mutated_line to mirrordiff -content. Worth tightening for cross-tool clarity.
Verification questions
- Confirm sibling scan only covered SPEC-0260 admission; other adaptors and helper classes are not broadened.
- Confirm constant_tail_witness admits the adaptor tail via
owner_adaptor_tail(notadmitted_owner_adaptor_tail); the Vec rebinding gate is therefore not enforced on the propagation edge even though it is on pin + pairing + activation. - Confirm floor 106->112 is +6 but PR claims 5 moved examples (3 grid-iter + 2 new traps) plus 1 headroom. github-actions[bot] verification question also flagged this; PR body glosses it. Need explicit re-count of cited examples to avoid silent overclaim.
- Confirm trap-iter-boundary-missing and trap-iter-empty-slice both anchor to authored-spec0260-iter-adaptor with shared Cargo.toml. If verdict-corpus scoring runs subjects serially per case this is fine, but if a single build is shared and one case's compile-fail poisons the other, both could swing. PR proof (1090 passed) does not pin a per-case cargo invocation.
Refuted
- Whole owner_call_operands parses call arguments with split_top_level on a borrowed assertion_text slice; the resulting Vec outlives the masked temp but the inner strings borrow from the assertion text, so an early return would dangle.; refuted because: split_top_level pushes 'text[start..offset].trim().to_string()' — every push is an owned String copied out of the borrowed slice, so the returned Vec owns its data and is independent of the assertion text's lifetime.
- Adds an async/await detach or Transferable boundary in Rust analyzer closure adaptor code (closure_adaptor::unconditional_closure_body rejects
await/return/async/yield/unsafe; no Spawn, tokio, async-channel, crossbeam, MessageChannel, or feature-gated concurrency is used); refuted because: diff is synchronous ripr analyzer code; closures are synchronous iterator adaptors; the reject lists are intentional and exhaustive per spec.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Element pairing refuses an equality whose expected side reaches the owner again (assert_eq!(pos(&[0]), pos(&[0])), or a let-bound copy); the check is shared with OwnerReturnPin::admits as expected_reaches_owner. A line holding more than one owner or helper call is unreadable for literal-sequence reads, so a readable call can no longer stand in for an unreadable one on the same line. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PmU1fjKwzXeGTi8ya5FamB
call_count now counts `name::<..>(` and `name!(` as calls, so a turbofish or macro call beside a plain call keeps the line unreadable instead of letting the plain call's sequence stand in for both. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PmU1fjKwzXeGTi8ya5FamB
Review of record (refreshed)Head: b7dc21e. This supersedes the review of record on 03a291e. New since 03a291e. Devin raised two red-circle findings. Both were confirmed and fixed with regression tests that fail without the fix:
Other bot items:
Non-blocking, unchanged from today's behavior. An expected value that reaches the owner through a helper function ( Final soundness review of 03a291e..ef28be0: CLEAN. The one follow-up from that review is fixed in b7dc21e. Proof on b7dc21e (local):
Disposition: nothing blocking. Generated by Claude Code |
…-a5kp6h Ports the oracle match floor 37->40 from #7932 so main's red scoreboard test passes here. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PmU1fjKwzXeGTi8ya5FamB
Pull request was converted to draft
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- ripr sensor status is 'failed' with exit code 2 and no receipt in the packet; without a receipt the diff-class evidence is incomplete even though tokmd + unsafe-review + ast-grep ran clean. Treat the live verdict corpus numbers (111/144, 44/446, 0/37) as unverified until cargo xtask verdict-corpus check on HEAD succeeds.
- PR body says 'The Rust floor goes from 105 to 111' but fixtures/rust-verdict-corpus/spec-coverage.toml still pins floor=112 with match_floor raised 37->40. The post-merge spec example count is 111 (3 grid-iter + 2 traps) and the body is off by 1; this is a docs artifact, not an architectural issue, and is owned by the spec-corpus lane.
Verification questions
- Confirm seeded github-actions question on spec-coverage floor: PR body says floor 105->111 (3 grid-iter move + 2 new traps + 1 headroom). spec-coverage.toml shows floor 112, ceiling 115, match_floor 37->40, spec registered 'in'. xtask population_tests.rs oracle_accuracy 37->40 confirms +3 oracle match. Numbering is internally consistent.
- Confirm seeded github-actions flagged: constant_tail_witness admits the adaptor tail via owner_adaptor_tail (not admitted_owner_adaptor_tail), so the Vec rebinding gate is NOT enforced on the propagation edge even though it is on pin + pairing + activation. The propagation witness therefore can complete on a rebound Vec owner.
- Confirm pR body claim 'creates no false_exposed row' is checkable from corpus rows: grid-iter-* expected rows move false_actionable->ideal with classifications ['exposed'] (single finding each); trap-iter-* rows are new authored cases; existing false_exposed count unchanged.
- Confirm closure_adaptor.rs is a 1080-line god module mixing scope parsing, allow-list policy, numeric/short-circuit evaluation, literal sequence parsing, call-text extraction, and rust-analyzer AST helpers; ownership_pin.rs imports
pub(super) modwith only 3 small re-exports visible to the rest of classify.
Refuted
- ElementRun.elements/AdaptorTail fields could hold slices into a backing String that is later mutated, leaving a stale active view; refuted because: All fields are
String(owned) and the per-runargument_sequencesreturnsVec<Vec<String>>; literal_sequence and numeric parse produce ownedString. The only retained&striscall_text: Option<&str>, taken from assertion text inside one call and not held past it. No resizable buffer or active-view surface exists in this analyzer diff. - Rule 1 same-test pairing reads only literal boundaries;
x > LIMITshort-circuits pairing even though activation may observe it. Spec says fail closed.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
…18 (#6502) Main's new cases plus this PR's six cover 118/150; the scoreboard test requires the ledger floor to equal the covered count. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PmU1fjKwzXeGTi8ya5FamB
There was a problem hiding this comment.
Confirmed findings
- fixtures/rust-verdict-corpus/spec-coverage.toml:15 — floor moved 112->118 (+6) but only 5 cases have spec_examples tagged in the diff (grid-iter-exact/-helper/-property/-table, trap-iter-boundary-missing, trap-iter-empty-slice). Either one more example is implicitly covered (and should be tagged) or the floor includes +1 headroom without a stated reason. Add a comment or tag the missing example to make the +6 explicit.
Verification questions
- Confirm cargo xtask verdict-corpus check + cargo test -p xtask verdict_corpus + cargo test -p xtask dx_scoreboard receipts are absent (ripr sensor failed, cargo-test scheduled-late); until they land, the 3 rows moving to ideal and the floor raising to 118 remain claimed rather than proven.
- Confirm evidence.rs now requires &RustIndex for establishing weak StageEvidence; all but the propagation witness call site pass RustIndex::default() while establish itself still receives the index — verify no caller is left passing a stale index.
- Confirm floor floor=118 in spec-coverage.toml is +6 vs main's 112; PR claims +5 moved examples (3 grid-iter + 2 traps). Body glosses the +1 headroom.
- Confirm trap-iter-boundary-missing.json mutated_line uses post-body |&&x| but the .diff hunk mutates the pre-body |x|**x; only the diff
+line should drive mutated_line. - Confirm floor 112->118 asserts 6 covered examples: 3 grid-iter moves + 2 traps + 1 grid-iter-property; the body glosses whether grid-iter-none contributes.
- Confirm owner_adaptor_tail at propagation_witness.rs:303 admits the tail without the keeps_standard_vec gate, so a rebound-Vec collect can produce return_value=exposed via rule 3 even when rule 1/2 keep the predicate unresolved. This is consistent with the spec text (rule 3 is a value-flow claim only) but is a residual risk worth noting for downstream consumers that join return_value and predicate verdicts.
Refuted
- The Adaptor gate's admits() returns true for any expected operand, so a pinned tail with a Vec body could be miscredited by an assert_eq comparing the owner against a Vec<&str> literal or other observable; refuted because: The ownership of admission is split: rule 2's pinned_call_runs_closure gates the pinned call to a non-empty literal sequence; rule 1's adaptor_element_view only emits an observed boundary when a run of literal elements equals the literal boundary. The admits() boolean gates whether the expected operand textually names the tail's result kind (e.g. literal 'true' or '2'), not whether the boundary element exists. A Vec<&str> expected would not pass pinned_call_runs_closure because the pinned call's argument is read as literals, and the pairing branch (whole_owner_call_operands + arguments_feed_boundary_element) refuses indices/projections. No regression test surfaced, but the layering is conservative: the weakest link is the whole_owner_call_operands filter — confirmed by test test_pairs_boundary_element in boundary_pairing.rs.
- grid-iter expected rows were updated from false_actionable to ideal without runtime evidence; refuted because: Expected rows flip outcome to 'ideal' because rule 1 reads 'exposed' (literal sequence feeds binding) and rule 2 pins the owner-return; spec acceptance examples 1-3 define this verdict set. Runtime truth is 'discriminated'.
- JS-backed memory crosses a worker, async, GC, detach, or transfer boundary in this diff; refuted because: All additions are pure Rust RAII on owned/slice references; no JavaScript, no WebAssembly, no Send/Sync-transfer or postMessage detach path. tail/adaptor data lives in borrowed &str from owner.body and test.body. closure_adaptor::argument_sequences reads by &str and returns owned String, no FFI or async handle handoff. PROPAGATION_WITNESS digests are static text.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- Doc file docs/specs/RIPR-SPEC-0260-rust-closures-in-iterator-adaptors.md is truncated mid-line at
Propin the diff head — does the rest of the file (Decisions, Acceptance Examples, Test Mapping, Implementation Mapping, Metrics) exist on disk as expected by the traceability entry?
|
Re the github-actions review on 7657f09:
Generated by Claude Code |
…-a5kp6h # Conflicts: # docs/specs/README.md
Pull request was converted to draft
|
Review of record, delta 7657f09 → 5f7a1fb This delta does two things.
The renumber is mechanical and touches nothing else:
Checks on this head:
The analyzer logic has not changed since the 6168931976 review. The latest github-actions review is answered in 6169773384 (floor +6 maps to six distinct examples), and CodeRabbit had no actionable comments on 7657f09. Findings: none blocking. Generated by Claude Code |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Authored subject retains Cargo.toml package name 'spec0260-iter-adaptor' and src/lib.rs.txt comment 'RIPR-SPEC-0260 examples 4 and 5' despite case IDs spec0265. Per seeded reply this is pinned by sha256 and editing would force relabel; behavior unchanged. Resolved, recorded only.
- crates/ripr/src/analysis/classify/activation.rs:351 — adaptor_element_view is invoked before the existing call_values / boundary_operand_parameter path; a RustIndex::default() unit test (boundary_pairing.rs:2893 pairing_in_owner_file) shows that without index the pin still proceeds but element pairing reads nothing. Acceptable for fail-closed, but a single helper exposing 'no related calls' vs 'unreadable calls' would help future lanes reason about gaps vs unknowns without re-reading activation.rs.
- ripr sensor status failed (exit_code 2) with no receipt in the packet; the live verdict numbers (Rust 42/451 false, spec 118/150 floor 118, oracle 0/37) are claimed but unverified at this lane. Treat as documentation/sensor issue, not a security regression; central broker should retry cargo xtask verdict-corpus check on HEAD.
- Floor 118 = measured 118 in
fixtures/rust-verdict-corpus/spec-coverage.toml, +6 from main's 112. Exactly 5 cases carryspec_examplesRIPR-SPEC-0265 tags (grid-iter-exact, -helper, -property, -table, trap-iter-boundary-missing, trap-iter-empty-slice — the latter two carry#4/#5, grid-iter-property carries#6, but grid-iter-table inexpected/rows/flipschanged_since_labelingto true). The +1 over named movements is re-shadowed grid-iter-property tagging a non-moving 0265 example (#6). PR body glosses this; spec example tallies are internally consistent viacargo xtask verdict-corpus check, but the body should mention that grid-iter-property tags example #6 without moving verdict.
Verification questions
- Confirm ripr sensor failed (exit 2) so no live on-disk receipts: the PR body's numbers (Rust 42/451 false, spec examples 118/150, oracle overclaim 0/37) and the floor raise 112→118 are claimed rather than verified here. cargo-test is scheduled-late; until it lands the proof is in-tree only.
- Confirm rule 3 reuses constant_tail_witness with a fallback arm rather than introducing a new witness kind; that keeps the limitation table small but couples iterator-adaptor tails to constant-tail semantics — a future rule for non-literal adaptor arguments will need to fork this arm rather than extend it.
Refuted
- A closure that captures a local (e.g. limit) could be misread, with the captured value fed as an element-boundary input and producing a false_exposed verdict.; refuted because: closure_adaptor::unconditional_closure_body rejects any closure whose body holds a path that is not the binding or an UPPER_CASE constant; closure_binding forbids move/ref/mut/typed patterns. The seed thread confirms this is gated explicitly with regression tests.
- closure_adaptor.rs introduces a resizable-buffer or active-view region that could be resized/detached/transfered between probes, producing stale length snapshots.; refuted because: No ArrayBuffer/TypedArray or backing-store region exists in this Rust analyzer. closure_adaptor.rs operates on owned Vec of literal elements from the test source text. There is no resizable region, no detach, no transfer, and no length snapshot to go stale. The lane focus does not apply to this surface.
- A sibling iterator-adaptor analyzer route outside closure_adaptor.rs would broaden credit beyond the spec.; refuted because: Single source of truth: AdaptorTail returned by owner_adaptor_tail, gated by admitted_owner_adaptor_tail at every rule site. Flow/propagation/pairing/activation all consume the same struct; no parallel adapter exists.
Parked follow-ups
- Pin/comment reviewer questions about a parked 'collect into a Vec' sibling where the file rebinds Vec via glob
pub use foo::Vecare answered by adapts_only_consumers + keeps_standard_vec type/enum/union/trait struct gate.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Main at 7c24ed9 does not compile: #7932's integer-projection and single-element-index arms return 2-tuples where #7914 (RIPR-SPEC-0265) made the operand tuple carry the call text. Both arms take None, as the rendered-scalar arm does. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U7GbrVC98fTYnLnhe3vhFM
…119 (#7598) Main does not compile after #7914 and #7932 both landed; this carries #7968's two-line fix so the branch builds, and it no-ops once #7968 merges. The combined tree covers 119/124 Rust spec examples. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
#7914 widened owner_pin's pin tuple to three elements and #7932 added two arms that still build pairs, so main at 7c24ed9 does not compile (E0308 at owner_pin.rs:2105/2119). Both arms carry None as call_text, which is fail-closed: they fire only under ReturnPathGate::Any, where call_text is never read. This hunk no-ops once #7968 lands. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LF96T8WMLipviRmdgetFpK
* fix(owner_pin): projection pins carry no adaptor call text #7914 (RIPR-SPEC-0265) added the owner call text as a third element of the assert_eq! reading; #7932's projection branches still built pairs, so main's lib does not compile. A projection operand is not the call itself, so it carries None, which an adaptor gate already refuses. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019DhTE9QaZFAYeqtp9XRAGK * changelog: fragment for #7968 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019DhTE9QaZFAYeqtp9XRAGK --------- Co-authored-by: Claude <noreply@anthropic.com>
#7914 and #7932 together left owner_pin.rs failing to compile on main (tuple arity, E0308). Same two lines as #7968; no-ops once it lands. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ajVbPgh9yZDQgaAHkZE8V
…ectation (#7952) * Read an uncompared expect_err(..) as broad_error/weak, not a mock expectation RIPR-SPEC-0227 decision 2 lists `r.expect_err(..)` beside `r.unwrap_err()`. The `expect_` mock sniff admitted it as mock_expectation / medium, which overstated the test. `.expect_err(` no longer satisfies that sniff, and an uncompared expect_err goes through the same `uncompared_unwrap_err` decision on the line scanner and the parser path. A mock's own `expect_*` call still reads as a mock expectation. Closes #7604. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LF96T8WMLipviRmdgetFpK * Keep mockall expect_err() and message text out of the expect_err reading Review on #7952: a zero-argument expect_err() is mockall's expectation for a method named err and stays a mock expectation; effect words and expect_ text inside the expect_err message no longer admit an effect observer or mock expectation (the expect_ sniffs read masked code). The multi-line lexical-fallback gap is #7955. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LF96T8WMLipviRmdgetFpK * Drop the whole expect_err message before mock and observer sniffs CodeRabbit found two more ways text in a Result::expect_err message could admit a reading: a mock-verification token ("mock.verify()") and an observer word plus "expect" ("state expect"). without_expect_err now reduces .expect_err(<message>) to .() using balanced delimiters on the masked line, and every sniff (mock verification, observer tokens, the non-macro subject fallback) reads the stripped text. A zero-argument mockall expect_err() still stays. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LF96T8WMLipviRmdgetFpK * Resume the expect_err strip after a dropped message A nested .expect_err( inside a dropped message made without_expect_err slice line[copied..start] with start < copied and panic (Graphite and CodeRabbit on #7952). The scan now resumes after the closing paren. The receiver check also picks the outer expect_err whose group closes the statement rather than the last one, so the nested case reads broad_error / weak instead of nothing. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LF96T8WMLipviRmdgetFpK * Port main's owner_pin tuple-arity repair (same change as #7968) #7914 widened owner_pin's pin tuple to three elements and #7932 added two arms that still build pairs, so main at 7c24ed9 does not compile (E0308 at owner_pin.rs:2105/2119). Both arms carry None as call_text, which is fail-closed: they fire only under ReturnPathGate::Any, where call_text is never read. This hunk no-ops once #7968 lands. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LF96T8WMLipviRmdgetFpK --------- Co-authored-by: Claude <noreply@anthropic.com>
) (#7928) * fix(oracles): a bool-compared comparison reads as what it asserts (#7598) An equality macro with one boolean-literal operand credited exact equality whatever the other operand, so assert_eq!(score(2) != 0, true), assert_eq!(r == Err(E::Bad), false) and assert_eq!(r == Ok(3) || f, true) read exact/strong, and a whole-condition comparison with a literal (ensure!((a == b) == false), assert!((matches!(r, Ok(3)) || f) == true)) did too. RIPR-SPEC-0231 rule 1 now reads a boolean-valued operand (top-level ==, !=, spaced relational, || or &&, through ! and .not()) as what it asserts: asserted false, a deciding ||, or a != or relational comparison caps at relational_check / weak; an && chain with a matches! conjunct and no pinning == reads like the same assert! chain (rule 3). A comparison asserted true and a bare bool value or call keep their exact readings. A matches! that is an operand of ^, <, >, <=, >=, a call argument (std::ops::Not::not(..), check(..)) or an if/while/match operand may be inverted or discarded, so it caps the reading like a negated pattern. New corpus case spec0231-bool-compared-inequality (runtime: x * 3 passes, x * 0 and x - 2 fail) labels the oracle relational_check / weak (example 31). Oracle accuracy 35/38 match, 0/38 overclaim; no other row moved. Rust spec-example coverage 107/145; floor raised to 107. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG * fix(oracles): cap only unread matches! operands; read bool-compared review findings Review of 27b5a4a: - A matches! that is a call argument anywhere capped the reading, so matches!(build(matches!(k, A)), Ok(Dark)), foo(matches!(..)).is_ok() and Some(true) == Some(matches!(..)) fell from exact to weak. A call argument is now unread only when the call is the whole condition (or conjunct), at any argument position and through nested calls; a closure body, a pattern scrutinee or a call whose result is read again keeps its reading. - An unread conjunct capped required siblings: ensure!(check(matches!(..)) && score == 4) now drops only that conjunct. - (ready && matches!(r, Ok(3))) == true rose from weak to exact through the chain reading; whole conditions keep the compared-pattern cap. - Turbofish and call-result callees, unspaced < and > (not a turbofish, ->, => or a shift) and a UTF-8-safe word start are recognized. - ^, & and | over a pattern or comparison cap in equality macros too (assert_eq!((r == Err(E::Bad)) ^ true, true)); over plain bools they still pin. RIPR-SPEC-0231 rule 1 states the narrowed scope. The method-call, combinator and cast spellings are filed as #7931. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG * fix(oracles): read bool-operand paths and conjunctions precisely (#7598) Second review round on the bool-compared reading: - A nested turbofish (`Vec::<Vec<u8>>`) closes its generics instead of reading as a shift, so a later comparison is still relational. - A `<` that opens the operand or follows `::` or an operator opens a path (`<T as Tr>::f(x) == y` stays exact). - A single `&` over booleans is a conjunction, not an unread operator. - An `if`/`while`/`match` keyword anywhere in the condition caps the pattern it tests, not only at the start. - In the equality-macro form the whole compared operand caps; the conjunct drop applies to boolean assertions only. - `is_inequality_assertion` agrees with the conjunct-drop reading. Spec rule 1 and the changelog fragment state the narrowed reading. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG * fix(oracles): close #7928 re-review gaps in bool-compared operands - A string or char literal before `<` is an operand, not a generic opener, in both the comma splitter and the relational scan, so `assert_eq!("x+" < s, true)` reads as the comparison it is. - A top-level single `&` in `assert_eq!(X, true)` reads as the same `&&` chain (beside a top-level comparison it stays a bitwise operand). - An equality-macro `&&` chain with no pinning `==` conjunct and a `!=` or relational conjunct caps (`assert_eq!(score(2) != 0 && flag, true)`). - A pattern inside an `if`/`while`/`match` condition anywhere in the assertion caps, not only one right after the keyword. - The `->` of a function type inside a turbofish closes no generic. - A name starting with `move` is not a `move` closure (Graphite). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG * fix(oracles): cap negated conjuncts in a bool-compared chain (#7598) Round-4 review of #7928: - In `assert_eq!(chain, true)` with no pinning `==` conjunct, a negated test (`!matches!(..)`, `!(a == b)`, `.not()`) or a conjunct compared with `false` now caps, like a `!=` or relational conjunct; a false-compared `==` conjunct no longer counts as pinning. - A leading `!` negates the whole operand only when the rest is one operand, so `!flag && matches!(r, Ok(3))` reads as its chain. - `if`/`while`/`match` caps only while its condition is still open: a guard inside an earlier `matches!(..)` and a raw `r#match` no longer cap, and a brace nested in the condition no longer hides the keyword. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG * fix(oracles): read literal-compared conjuncts through the literal (#7598) Round-5 review of #7928: - A `== true`/`!= false` wrapper no longer hides a `!=` or relational test: `assert_eq!((r != Err(E::Bad)) == true, true)` and the same conjunct in a chain cap. `X == false`/`X != true` read as `!X`. - A bool value compared with `false` pins it like `!x`, so `assert_eq!(flag && x == false, true)` keeps its exact reading. - The literal peel stops at a top-level `&&` or `||`, where `==` binds only its own operand. - Spec rule 1 states that the relation cap applies before the chain is read; the keyword doc comment matches the depth-aware check. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG * fix(oracles): a literal-compared chain operand keeps the compared-pattern cap (#7598) Round-6 review of #7928: peeling `== true`/`!= false` off an equality-macro operand exposed its `&&` chain to the rule-3 chain reading, which raised `assert_eq!((flag && matches!(r, Ok(3))) == true, true)` from weak to strong. A chain reached through a literal comparison now caps, as the same chain in a whole condition does; `true == (chain)` and `(chain).not() == false` cap too. Spec rule 1 says the literal comparison is read first, so `x != true` pins a bool value like `!x`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG * fix(oracles): cap a matches! after a binary `|` or under `as` (#7598) Devin review of #7928: - `assert!(ready | matches!(r, Err(E::Bad)))` read exact_error_variant / strong: only a `|` after the pattern was read. A single `|` before it now caps too, unless it closes a closure parameter list. - `assert_eq!(matches!(r, Err(E::Bad)) as u8 == 0, true)` read strong: a cast reads the bool as a number, so it caps. - The confirmed false promotion graduates into the RIPR-SPEC-0108 honesty corpus: fixture `bool_compared_inequality_not_exact` (`assert_eq!(score(2) != 0, true)` reads relational_check / weak) and case `rust_bool_compared_inequality_not_exact`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG * test(oracles): pin a compared chain nested as one conjunct (#7598) The compared-pattern cap already holds when the literal-compared chain is itself one conjunct of a top-level conjunction; these rows pin it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG * test(corpus): raise the oracle match pin to 42/42 after merging main (#7598) Main's merged cases lifted the last underclaim; the combined tree reads 42/42 match, 0/42 overclaim, 0/42 underclaim. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG * test(oracles): pin both assert_ne! bool-literal sides (#7598) assert_ne!(true, r == Err(..)) states the inequality; assert_ne!(r == Err(..), false) stays an inequality reading too, since the cap only lowers. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG * fix(owner_pin): port #7968's build fix; raise the Rust spec floor to 119 (#7598) Main does not compile after #7914 and #7932 both landed; this carries #7968's two-line fix so the branch builds, and it no-ops once #7968 merges. The combined tree covers 119/124 Rust spec examples. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG --------- Co-authored-by: Claude <noreply@anthropic.com>
…put (RIPR-SPEC-0246 rule 3) (#7963) * fix(typescript): read a dropped spread override against the tested input (RIPR-SPEC-0246 rule 3) `return { ...cfg, ok: true }` changed to `return { ...cfg }` read `exposed` even though the only tested input already carried `ok: true`, so both versions return an object equal to it. The corpus case jest-spec0246-ex03-spread-drops-field was a false exposed. RIPR-SPEC-0246 rule 3 reads one literal field set or dropped after a leading spread of a stable owner parameter. When owner calls are observed and none passes an object literal shown to lack the field or hold another value there, an exposed result reads weakly_exposed. With no observed call the ladder result stands. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ajVbPgh9yZDQgaAHkZE8V * changelog: cite #7963 for the spread-override fragment Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ajVbPgh9yZDQgaAHkZE8V * fix(typescript): read typed bindings, key pins and mutated inputs in the spread-override rule Review findings on RIPR-SPEC-0246 rule 3, all in the under-credit direction: - `const cfg: Settings = { ... }` now reads (a type annotation is skipped). - A `//` or `/*` inside a string no longer refuses the object read. - A strong pin on the field itself (`owner(cfg).ok`, `?.ok`, `["ok"]`) keeps credit when its input lacks the field. - An owner that writes, deletes or passes on a member of the spread parameter keeps the ladder verdict (`ts_members_written`). - A test input whose member is written later, or that a callback parameter shadows, reads as unknown instead of carrying the field. Adds discriminating unit and end-to-end cases, spec example 14 and the decision 6 limits. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ajVbPgh9yZDQgaAHkZE8V * fix(typescript): read only exact key pins and fail closed on reused inputs (RIPR-SPEC-0246 rule 3) Second review round on #7963: - A member pin is a witness only when the observed expression is exactly `owner(...).k`, `?.k` or `["k"]`, with nothing after it and no `await`; `.k ?? true` passes on both versions and kept false credit. - The call's end is found on the original text instead of the masked text, whose byte length differs on non-ASCII input (a slice panic). - A test-local input reads only when every other mention is a member read or a whole `expect`, matcher or owner argument (`ts_local_only_read`); casts, aliases, helpers, `Reflect.set` and parameters fail closed. - A rest-spread or `catch` parameter of the same name shadows the binding. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ajVbPgh9yZDQgaAHkZE8V * fix(owner_pin): port #7968 so this branch builds on current main #7914 and #7932 together left owner_pin.rs failing to compile on main (tuple arity, E0308). Same two lines as #7968; no-ops once it lands. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ajVbPgh9yZDQgaAHkZE8V * style: cargo fmt Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ajVbPgh9yZDQgaAHkZE8V * fix(typescript): accept only expect matchers and the owner's own callees as reads (RIPR-SPEC-0246 rule 3) Third review round on #7963: - A `.`-prefixed callee counts as a read only when it is a `.toX` matcher (after `.not`, `.resolves`, `.rejects`) on an `expect(...)` call; `new Defaults().apply(cfg)` and `hooks.init?.(cfg)` could write the field and kept false credit. - A qualified call counts only through the owner's module receivers, not any `x.ready(cfg)`. - The input's `const` must be its one declaration in the masked body, with every other mention after it and inside its block (a commented-out or inner-block declaration no longer reads). - A function-valued entry in the input reads as unknown. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ajVbPgh9yZDQgaAHkZE8V * fix(typescript): treat a member call on the spread input as unreadable (RIPR-SPEC-0246 rule 3) `cfg.arm()` hands `cfg` to the method as `this`, so the method can set the overridden field. The test-local read now fails on a member call (`k()`, `k?.()`, tagged template), and the owner-side write check counts one as a write. `foo. expect(x)` with a space after the dot is no longer taken for a root `expect`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ajVbPgh9yZDQgaAHkZE8V * fix(typescript): close prototype, destructuring and message gaps in the spread-override rule (RIPR-SPEC-0246 rule 3) - `__proto__: v` sets the prototype rather than a field, so the rule skips it. - A destructuring target (`[cfg.ok] = xs`) or a `for (cfg.k of xs)` loop target writes the member: the test-local read fails, and the owner check counts it as a write. - Only a known-carrying input says both versions return the same value; an unreadable input says no test is shown to tell them apart. - An entry value counts as function-like only when it is not a literal and starts with `function` or `async`, or holds an arrow. This catches `async function` and skips strings holding `=>`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ajVbPgh9yZDQgaAHkZE8V * fix(typescript): treat a destructuring for-loop target as a write (RIPR-SPEC-0246 rule 3) `for ([cfg.ok] of xs)` and `for ({ a: cfg.ok } of rows)` write the member, but the bracket close was followed by `of`, not `=`. A test could start from `{ ok: false }`, set `ok` in the loop and still read as lacking the field. `inside_destructuring_target` now accepts a loop keyword after the target, and the destructuring end-to-end case asserts its class and message. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ajVbPgh9yZDQgaAHkZE8V --------- Co-authored-by: Claude <noreply@anthropic.com>
#7966) (#7973) * fix(owner_pin): projection pins carry no adaptor call text #7914 (RIPR-SPEC-0265) added the owner call text as a third element of the assert_eq! reading; #7932's projection branches still built pairs, so main's lib does not compile. A projection operand is not the call itself, so it carries None, which an adaptor gate already refuses. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019DhTE9QaZFAYeqtp9XRAGK * changelog: fragment for #7968 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019DhTE9QaZFAYeqtp9XRAGK * fix(rust): bind exact mutable field arguments to collection observers (#7966) * fix(rust): refuse raw identifier resets and retain observer binding authority * test(rust): retain full human raw-reset refusal snapshots * fix(rust): establish projected vector value equality before observation credit * fix(rust): retain indexed type and constructor binding refusals * fix(rust): refuse unresolved projected constructor imports * fix(rust): refuse generated projected constructors and refresh witness * fix(rust): close projected constructor attribute expansion * fix(rust): bind projected declarations to the owner module * test(rust): complete expansion fixture contracts and human evidence * fix(rust): route plain test gate through cfg predicate authority --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Steven Zimmerman, CPA <steven@effortlessmetrics.com>
Summary
xs.iter().filter(|&&x| x > 0).count(), tested byassert_eq!(count_positive(&[-1, 0, 3, 7]), 2). ripr could not map the closure bindingxto the test's inputs (infection_unknown). The owner-return pin also refused any closure, so the return value readweakly_exposed. Three verdict-corpus rows werefalse_actionable: grid-iter-exact, grid-iter-helper and grid-iter-table.P.iter().filter/map/any/all(|x| E)with an optional.count()/.collect()/.sum()after it:Eon the closure binding reads its inputs from the elements of literal sequences the related tests pass. These can come from the direct call, from constant table rows or through a helper.ideal. Two new trap cases stay gaps: one where the boundary value is missing and one with an empty slice.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Spec: RIPR-SPEC-0265 (new).
Governing issue: #6502.
Acceptance delta (one sentence): the Rust verdict corpus moves 3 rows from false_actionable to ideal, adds 2 trap cases that read gap, and creates no false_exposed row.
Candidate Relationships
Candidate branch:
claude/project-thread-a5kp6h.Stack parent or prerequisite PR (if any): none.
The spec was renumbered from 0260 to 0265. Main took 0260 for Python guarded-arm activation, and another branch has claimed 0264. The authored subject's pinned source and the case diff keep their original
RIPR-SPEC-0260comment, so the pinned sha256 and the runtime labels stay valid.Scope
owner_pin/closure_adaptor.rs, which recognizes the admitted adaptor tail.owner_pin.rsgainsReturnPathGate::Adaptor.activation.rsandboundary_pairing.rsread element boundaries.propagation_witness.rsandflow.rsadd a direct-return witness for the tail.authored-spec0265-iter-adaptorwith casestrap-iter-boundary-missingandtrap-iter-empty-slice.Decision, recorded here: the pin requires a readable, non-empty literal argument, and infection reads the same literals. A credited return value therefore always comes with a resolved boundary reading on the predicate. If the boundary value is missing, the predicate is a gap, and a gap outranks credit on the line.
Scope Classification
Support-tier Impact
Policy Impact
None.
Proof
On 5f7a1fb (merge of main, renumbered to 0265):
The grid-iter-property and grid-iter-none rows do not move. Rust false_exposed stays at 3, and all three predate this PR.
The traps' runtime truth was recorded on rustc 1.95.0:
trap-iter-boundary-missing: thex >= 0mutant survives (partially discriminated).trap-iter-empty-slice: all 3 mutants survive.Unit tests cover the new gates. Twelve gate conditions were each removed in turn, and a test failed every time.
Claim Boundary
These are static verdicts for one adaptor shape. They make no runtime mutation claim. Other adaptors (fold, flat_map, find, ...), captured locals and non-literal inputs keep today's reading.
Rollback
Revert the squash commit. The three rows return to false_actionable and the floor returns to main's count.
Spec-Test-Code Traceability
RIPR-SPEC-0265 is registered in
.ripr/traceability.toml,docs/specs/README.mdandpolicy/doc-artifacts.toml.Static Language Check
killed,survived,untested,proven, andadequate.CI Economics
No workflow changes.
Engineering Check
Review of record: see the latest review-of-record comment on this PR.
Gates
The required
Ripr Rust Small Resultruns at Draft→Ready.Closes #6502.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PmU1fjKwzXeGTi8ya5FamB