Skip to content

Read closure boundaries in Rust iterator adaptors (RIPR-SPEC-0265) - #7914

Merged
EffortlessSteven merged 13 commits into
mainfrom
claude/project-thread-a5kp6h
Oct 14, 2026
Merged

EffortlessSteven merged 13 commits into
mainfrom
claude/project-thread-a5kp6h

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Before: an edit inside a closure in an iterator adaptor was always treated as a gap. Example: xs.iter().filter(|&&x| x > 0).count(), tested by assert_eq!(count_positive(&[-1, 0, 3, 7]), 2). ripr could not map the closure binding x to the test's inputs (infection_unknown). The owner-return pin also refused any closure, so the return value read weakly_exposed. Three verdict-corpus rows were false_actionable: grid-iter-exact, grid-iter-helper and grid-iter-table.
  • After: RIPR-SPEC-0265 covers owner tails of the form P.iter().filter/map/any/all(|x| E) with an optional .count()/.collect()/.sum() after it:
    • A boundary in E on 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.
    • The owner-return pin admits the tail only when the pinned call runs the closure on a readable, non-empty literal.
    • All three rows now read ideal. Two new trap cases stay gaps: one where the boundary value is missing and one with an empty slice.

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-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-0260 comment, so the pinned sha256 and the runtime labels stay valid.

Scope

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

  • Analyzer behavior (static verdicts move)

Support-tier Impact

  • none

Policy Impact

None.

Proof

On 5f7a1fb (merge of main, renumbered to 0265):

cargo xtask precommit                                     # exit 0
cargo test -p ripr --lib classify::                      # 1145 passed
cargo test -p xtask verdict_corpus                       # 121 passed
cargo test -p xtask dx_scoreboard                        # 111 passed
cargo xtask verdict-corpus check                          # Rust 40/454 false; spec examples 118/150, floor 118; oracle 41/41, overclaim 0/41
cargo test -p ripr --test iterator_adaptor_propagation   # 6 passed

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: the x >= 0 mutant 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.md and policy/doc-artifacts.toml.

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.

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 Result runs at Draft→Ready.

Closes #6502.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PmU1fjKwzXeGTi8ya5FamB

…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
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

The 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.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: f2d9c56b-e0ef-4a3f-9710-05fd681a98d6
📥 Commits

Reviewing files that changed from the base of the PR and between 7657f09 and 5f7a1fb.

📒 Files selected for processing: 33
  • .ripr/traceability.toml
  • changelog.d/6502-rust-closure-adaptor-pins.md
  • crates/ripr/src/analysis/classifier/evidence.rs
  • crates/ripr/src/analysis/classify/activation.rs
  • crates/ripr/src/analysis/classify/boundary_pairing.rs
  • crates/ripr/src/analysis/classify/flow.rs
  • crates/ripr/src/analysis/classify/owner_pin.rs
  • crates/ripr/src/analysis/classify/owner_pin/closure_adaptor.rs
  • crates/ripr/src/analysis/classify/owner_pin/tests.rs
  • crates/ripr/src/analysis/classify/propagation_witness.rs
  • crates/ripr/tests/iterator_adaptor_propagation.rs
  • docs/specs/README.md
  • docs/specs/RIPR-SPEC-0265-rust-closures-in-iterator-adaptors.md
  • fixtures/python-verdict-corpus/spec-coverage.toml
  • fixtures/rust-verdict-corpus/cases/grid-iter-exact.json
  • fixtures/rust-verdict-corpus/cases/grid-iter-helper.json
  • fixtures/rust-verdict-corpus/cases/grid-iter-property.json
  • fixtures/rust-verdict-corpus/cases/grid-iter-table.json
  • fixtures/rust-verdict-corpus/cases/trap-iter-boundary-missing.diff
  • fixtures/rust-verdict-corpus/cases/trap-iter-boundary-missing.json
  • fixtures/rust-verdict-corpus/cases/trap-iter-empty-slice.diff
  • fixtures/rust-verdict-corpus/cases/trap-iter-empty-slice.json
  • fixtures/rust-verdict-corpus/expected/rows/grid-iter-exact.json
  • fixtures/rust-verdict-corpus/expected/rows/grid-iter-helper.json
  • fixtures/rust-verdict-corpus/expected/rows/grid-iter-table.json
  • fixtures/rust-verdict-corpus/expected/rows/trap-iter-boundary-missing.json
  • fixtures/rust-verdict-corpus/expected/rows/trap-iter-empty-slice.json
  • fixtures/rust-verdict-corpus/spec-coverage.toml
  • fixtures/rust-verdict-corpus/subjects/authored-spec0265-iter-adaptor.json
  • fixtures/rust-verdict-corpus/subjects/authored-spec0265-iter-adaptor/Cargo.toml
  • fixtures/rust-verdict-corpus/subjects/authored-spec0265-iter-adaptor/src/lib.rs.txt
  • fixtures/typescript-verdict-corpus/spec-coverage.toml
  • policy/doc-artifacts.toml

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 7a0794a1-cb81-4e57-8841-93a4215b84c0
📥 Commits

Reviewing files that changed from the base of the PR and between b2f83e5 and 7657f09.

📒 Files selected for processing: 3
  • .ripr/traceability.toml
  • crates/ripr/src/analysis/classify/owner_pin.rs
  • crates/ripr/src/analysis/classify/owner_pin/tests.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Summary by CodeRabbit

  • New Features

    • Added analysis support for Rust closures in selected iterator adaptors, including filter, map, any, and all.
    • Analysis can now use readable literal test inputs to assess whether closures run, whether boundary values are tested, and whether assertions support a result.
  • Bug Fixes

    • Improved classification of iterator-adaptor cases: empty inputs, untested boundaries, short-circuited elements, and unsupported patterns remain gaps or unresolved rather than being treated as confirmed evidence.
  • Documentation

    • Added a specification describing supported patterns, input requirements, and analysis outcomes.

Walkthrough

This 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.

Changes

Rust Iterator Adaptor Analysis

Layer / File(s) Summary
Specify and classify supported adaptor tails
docs/specs/*, .ripr/traceability.toml, policy/doc-artifacts.toml, crates/ripr/src/analysis/classify/owner_pin/closure_adaptor.rs, changelog.d/*, fixtures/python-verdict-corpus/spec-coverage.toml, fixtures/typescript-verdict-corpus/spec-coverage.toml
Adds RIPR-SPEC-0260 and defines admitted owner tails, closures, consumers, and readable inputs. Adds the adaptor-tail classifier and tests.
Admit pins when closure inputs run
crates/ripr/src/analysis/classify/owner_pin.rs, crates/ripr/src/analysis/classify/owner_pin/tests.rs
Adds an adaptor return-path gate. Assertions must retain owner-call text and provide readable input sequences, including at least one non-empty sequence.
Analyze element boundaries and assertions
crates/ripr/src/analysis/classify/activation.rs, crates/ripr/src/analysis/classify/boundary_pairing.rs
Adds element-boundary observations and assertion pairing from readable sequences. Short-circuit results are considered; unsupported or unreadable inputs do not establish the evidence.
Propagate adaptor findings
crates/ripr/src/analysis/classify/flow.rs, crates/ripr/src/analysis/classify/propagation_witness.rs, crates/ripr/tests/iterator_adaptor_propagation.rs
Admitted adaptor tails can provide predicate-flow sinks and propagation witnesses. Integration tests cover supported tails, whole-result comparisons, and excluded cases.
Update Rust verdict-corpus coverage
fixtures/rust-verdict-corpus/*
Adds specification references and authored cases, updates expected verdict rows, and raises Rust coverage thresholds.

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
Loading
Merge Risk: ⚪ Minimal · up to 7657f

The previously identified false-credit path is fixed at the reviewed head. No actionable merge-blocking issue remains after normal checks.

Security architecture risk: 🔵 Low · up to 7657f

The new analysis path remains internal and requires restricted closure shapes and readable inputs before granting stronger verdicts. No security issue was established, but the full historical comparison and broader security coverage remain incomplete.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — Within the traced path, source-controlled Rust expressions and test inputs influence classification evidence and verdict strength. The established exposure is analysis-output integrity, not a newly callable privileged interface; downstream security-sensitive uses of those verdicts were not established.

Trust Boundaries and Controls

  • observed — The permissive Adaptor expected-value branch is constrained by a separate mandatory closure-execution check. Consumer admission rejects bare lazy filter/map tails, map-count, filter-sum, and collection targets not recognized as Vec. Boundary analysis for any/all also rejects runs where another element can decide the result independently of the boundary value.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 76.79% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 112 functions across 10 files. (1 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Issue #6502 requires closure bindings to read literal slice or array inputs and requires supported filter, map, or any results to reach the owner return. The PR adds admitted iterator-adaptor an…
Out of Scope Changes check Passed The changes remain within issue #6502. The analyzer code, tests, RIPR-SPEC-0260 records, traceability entries, corpus fixtures, trap cases, coverage floors, and changelog describe or validate the iter…
Title check Passed The title clearly identifies Rust iterator-adaptor closure-boundary analysis. However, RIPR-SPEC-0265 conflicts with the raw changes and objectives, which identify RIPR-SPEC-0260.
Description check Passed The description covers most required sections, including scope, acceptance criteria, proof results, claim boundaries, rollback, traceability, and CI impact. Some non-critical details are incomplete, s…
Full details: Docstring Coverage

Explanation

Docstring coverage is 76.79% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 112 functions across 10 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit reads each slice with care,
And checks which values reach the lair.
A closure runs when inputs are there,
The boundary joins the findings’ pair.
Then tests record the trail with flair.
The rabbit hops through code once more.

Comment @coderabbitai help to get the list of available commands.

…#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
coderabbitai[bot]

This comment was marked as resolved.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 check once 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 a collect() into a non-Vec to be miscredited.; refuted because: keeps_standard_vec checks masked source for struct\|enum\|union\|type\|trait Vec plus declaring_file_rebinds with through_macro=false; declaring_file_rebinds walks Use items, including globs in a glob-aware path. Without source view in the build receipt, this is plausible but the unit test adaptor_gate_refuses_a_collect_into_a_rebound_vec covers use other::Vec; and type Vec = .... Risk: a pub use crate::foo::Vec; or use 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 Sized return) 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

Copy link
Copy Markdown
Member Author

Review of record

Head: 03a291e

Angles. Independent agent reviews of the exact heads:

  1. Soundness: false credit and lost credit, over four rounds.
  2. Tests, corpus rows and spec consistency.
  3. Merge resolution against main.

Findings and resolutions:

  • Fixed in ff20e03. map+count, collect into a set and filter+sum gave false credit. The fix is an explicit allow-list, admitted_consumer.
  • Fixed in ff20e03. The trap rows recorded the wrong labeling commit (8485a79). The spec text contradicted itself.
  • Fixed in 5f314a5. An index, .len() or .is_empty() projection of the owner result paired as exposed. The fix is whole_owner_call_operands.
  • Fixed in 5f314a5. A text-matched Vec could be a rebound name. The fix is keeps_standard_vec.
  • Fixed in 03a291e. A let-bound result over a constant-row table read as exposed through the activation fallback. Element facts now pair only through the whole owner call. The new test adaptor_element_fact_never_pairs_a_bound_projection fails when the guard is disabled.
  • Fixed in 03a291e. Two CodeRabbit findings:
    • The Vec gate had drifted between call sites. One admitted_owner_adaptor_tail now serves owner pin, activation and pairing.
    • The element boundary was recomputed for every test. It is now computed once per probe, behind an .iter() prefilter.
  • Final delta review: CLEAN. The only credit given up is conservative: helper-chain entry pairing, and unusual .iter () spacing.
  • Non-blocking. flow.rs and propagation_witness use the ungated tail but credit nothing alone.
  • github-actions verification question. The floor change from 106 to 112 was verified locally. The check reports Rust spec examples at 112/150 against floor 112.

Proof on 03a291e (local):

  • cargo fmt --check passed.
  • clippy with -D warnings passed.
  • cargo test -p ripr --lib classify::: 1107 passed.
  • --test iterator_adaptor_propagation: 4 passed.
  • cargo xtask verdict-corpus check (Rust): 42/447 false, down from 49/444 on 43e0306. false_exposed is unchanged at 3, all pre-existing.
  • cargo xtask precommit passed.

Disposition: nothing blocking. Marking Ready for the required check.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 14, 2026 08:35
@EffortlessSteven
EffortlessSteven enabled auto-merge (squash) October 14, 2026 08:35

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

Devin Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • trap-iter-boundary-missing.json records the closure change \|x\| **x > 0 -> \|&&x\| x > 0 and 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 mirror diff - 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 (not admitted_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
@EffortlessSteven
EffortlessSteven marked this pull request as draft October 14, 2026 09:30
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 14, 2026 09:30
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

Copy link
Copy Markdown
Member Author

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:

  • Self-comparing equality paired the element boundary. Cases: assert_eq!(pos(&[0]), pos(&[0])), and a let-bound copy that read exposed end to end.
    • Fixed in ef28be0. The pairing now refuses when every compared operand reaches the owner.
    • The check is expected_reaches_owner, now shared with OwnerReturnPin::admits. That move kept the old condition verbatim.
  • Two owner or helper calls on one line could reuse the first call's sequence. Example: assert_eq!(score(&[0]), score(&v)).
    • Fixed in ef28be0. Such a line now counts as unreadable in sequence_runs and in the helper-loan path.
    • The soundness re-review found one undercount: a turbofish or macro call next to a plain call. b7dc21e now counts those forms, and a call_count unit test pins it.

Other bot items:

  • The Devin changelog finding is invalid: the fragment already ends with (#6502)..
  • github-actions asked whether trap mutants should mirror the diff's minus side. They target the post-change body, the same convention as grid-iter-exact, so this is not a defect.
  • flow.rs and propagation_witness use the ungated owner_adaptor_tail. This is non-blocking: neither credits anything alone, and the pin and pairing both refuse a rebound Vec.
  • Rust floor 106→112 is backed by the check itself: Rust spec examples measure 112/150 on this head.

Non-blocking, unchanged from today's behavior. An expected value that reaches the owner through a helper function (assert_eq!(pos(&[0]), expected())) is not detected. The owner pin has the same limit today.

Final soundness review of 03a291e..ef28be0: CLEAN. The one follow-up from that review is fixed in b7dc21e.

Proof on b7dc21e (local):

  • fmt passed.
  • clippy with -D warnings passed.
  • classify::: 1108 passed.
  • iterator_adaptor_propagation: 5 passed.
  • verdict-corpus check (Rust): 42/447 false, oracle overclaim 0/37, spec examples 112/150 against floor 112.
  • cargo xtask precommit exited 0.

Disposition: nothing blocking.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven enabled auto-merge (squash) October 14, 2026 10:05
…-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
@EffortlessSteven
EffortlessSteven marked this pull request as draft October 14, 2026 11:36
auto-merge was automatically disabled October 14, 2026 11:36

Pull request was converted to draft

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 14, 2026 11:36
@EffortlessSteven
EffortlessSteven enabled auto-merge (squash) October 14, 2026 11:36

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) mod with 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-run argument_sequences returns Vec<Vec<String>>; literal_sequence and numeric parse produce owned String. The only retained &str is call_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 > LIMIT short-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
@EffortlessSteven
EffortlessSteven marked this pull request as draft October 14, 2026 12:06
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 14, 2026 13:30
@EffortlessSteven
EffortlessSteven enabled auto-merge (squash) October 14, 2026 13:30

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Prop in 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?

Copy link
Copy Markdown
Member Author

Re the github-actions review on 7657f09:

  • Floor 112→118: this is not headroom. Six cases tag six distinct RIPR-SPEC-0260 examples:

    • #1 grid-iter-exact
    • #2 grid-iter-helper
    • #3 grid-iter-table
    • #4 trap-iter-boundary-missing
    • #5 trap-iter-empty-slice
    • #6 grid-iter-property

    grid-iter-property's verdict doesn't move, but it now covers example 6. grid-iter-none tags no 0260 example. spec_example_coverage_resolves_from_the_committed_fixtures enforces floor == covered count, and verdict-corpus check reports 118/150 against floor 118.

  • RustIndex::default(): that only appears in unit tests. Production (classifier/evidence.rs) passes context.index.

  • Trap mutated_line: this was answered earlier. It follows the corpus convention (post-body line).

  • Rule-3 return-value residual: consistent with the spec, as the review itself says. No change.


Generated by Claude Code

@EffortlessSteven EffortlessSteven changed the title fix(rust): credit closures in iterator adaptors through literal-sequence inputs (#6502) Read closure boundaries in Rust iterator adaptors (RIPR-SPEC-0265) Oct 14, 2026
@EffortlessSteven
EffortlessSteven marked this pull request as draft October 14, 2026 15:21
auto-merge was automatically disabled October 14, 2026 15:21

Pull request was converted to draft

Copy link
Copy Markdown
Member Author

Review of record, delta 7657f09 → 5f7a1fb

This delta does two things.

  1. Merges main. The one conflict was the docs/specs/README.md spec table. Main added SPEC-0259/0260/0261 rows, and its 0260 is Python guarded-arm activation.
  2. Renumbers this PR's spec 0260 → 0265. 0264 is held on another branch. No other branch or main uses 0265, which I checked with git ls-tree across every remote branch.

The renumber is mechanical and touches nothing else:

  • It covers the spec file, README row, the .ripr/traceability.toml and policy/doc-artifacts.toml blocks, the three spec-coverage entries, case spec_examples, the subject id and directory, code doc comments, and test names (pre_0260 → pre_0265).
  • Main's Python 0260 entries are untouched. After the change the only RIPR-SPEC-0260 matches in the tree are main's, plus the pinned subject source and case diff below.
  • The authored subject's Cargo.toml and src/lib.rs and the trap-iter-boundary-missing.diff context keep their original 0260 comment and package name. The check pins those files by sha256, and editing them would need a relabel. Their behavior is unchanged.

Checks on this head:

Check Result
verdict-corpus check Rust 40/454 false, spec examples 118/150 against floor 118, oracle 41/41 with overclaim 0
xtask verdict_corpus 121 passed
xtask dx_scoreboard 111 passed
ripr classify:: 1145 passed
iterator_adaptor_propagation 6 passed
precommit exit 0

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

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 14, 2026 15:22
@EffortlessSteven
EffortlessSteven enabled auto-merge (squash) October 14, 2026 15:22
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 carry spec_examples RIPR-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 in expected/rows/ flips changed_since_labeling to 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 via cargo 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::Vec are answered by adapts_only_consumers + keeps_standard_vec type/enum/union/trait struct gate.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

@EffortlessSteven
EffortlessSteven merged commit 6c0f38d into main Oct 14, 2026
35 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/project-thread-a5kp6h branch October 14, 2026 16:39
EffortlessSteven pushed a commit that referenced this pull request Oct 14, 2026
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
EffortlessSteven pushed a commit that referenced this pull request Oct 14, 2026
…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
EffortlessSteven pushed a commit that referenced this pull request Oct 14, 2026
#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
EffortlessSteven added a commit that referenced this pull request Oct 14, 2026
* 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>
EffortlessSteven pushed a commit that referenced this pull request Oct 14, 2026
#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
EffortlessSteven added a commit that referenced this pull request Oct 14, 2026
…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>
EffortlessSteven added a commit that referenced this pull request Oct 14, 2026
) (#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>
EffortlessSteven added a commit that referenced this pull request Oct 14, 2026
…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>
EffortlessSteven added a commit that referenced this pull request Oct 15, 2026
#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rust: a closure predicate inside .filter(..).count() reads propagation_unknown and asks for a boundary input the test already passes

2 participants