Skip to content

feat(analysis): relate a test that enters a hop chain through a method forwarder (#9638) - #10628

Merged
EffortlessSteven merged 9 commits into
mainfrom
claude/missed-credit-reach-9638
Oct 26, 2026
Merged

EffortlessSteven merged 9 commits into
mainfrom
claude/missed-credit-reach-9638

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

  • A test that calls a same-impl forwarder method with a receiver (pool.grow(4) for fn grow(&mut self, ..) { self.try_grow(..) }) now relates to the owner behind it (helper_owner_call), so a discriminated boundary in try_grow reads exposed instead of no_static_path with transitive_reach_unresolved. This is the same-impl one-hop forwarder from the smallvec specimen in Missed credit: Rust forwarded-result and public-API reach (propagation_unknown, transitive_reach_unresolved) #9638; feat(analysis): pair a check helper's assertion on a forwarded method-hop result (#9329) #9642 landed the forwarded-result half.
  • Credit or unknown only. The entry must be an inherent method taking self/&self/&mut self in production source and the one workspace function of its name; hops beneath it must be direct or identity-bound self. hops; the test's only mentions must be receiver calls; no test-local binding/nested fn/foreign import shadows the name; the test must be in the owner's package. Forwarding, infection and observation are unchanged, so a forwarder that drops or transforms the owner's result stays propagation_unknown.
  • Corpus: new authored-forwarder-hop subject with four cases (positive plus swallowed result, name collision, multi-candidate owner), truth replayed with verdict-corpus relabel (0 drift).

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-0159
Governing issue or accepted claim: #9638
Acceptance delta (one sentence): a test that reaches a changed inherent owner through a unique, result-forwarding same-impl method now credits the discriminating assertion, while swallowed results, shared names and multi-candidate owners still abstain.

Candidate Relationships

Candidate branch: claude/missed-credit-reach-9638
Stack parent or prerequisite PR (if any): none (based on main c8af153)

Scope

  • helper_transfer::test_calls_method_entry and its use in the find_related_tests relation branch (related_tests.rs).
  • Authored corpus cases, RIPR-SPEC-0159 text and acceptance examples 10 and 11, changelog fragment.

Proof

  • cargo xtask precommit: exit 0. goldens check reported INCOMPLETE (known environment gap for owner_return_pin_fallible_literal; hosted CI owns it).
  • cargo xtask verdict-corpus check (Rust): 717 cases, false verdicts 0/717, contradictions 0/899, spec examples 288/288, traps credited 0/43. Only the four new rows are added; no existing row moved.
  • Focused tests: helper_wrapper_reach (41, six new forwarder_method_*), method_helper_reach (55), crate_qualified_entry_reach (12), --lib classify:: (1756). Removing the shadow check makes the shared-name and shadowed controls fail (oracle grip).
  • Baseline attribution: with only the two source files reverted to origin/main, forwarder-hop-forwarded-hit reads limited / no_static_path (a missed credit); with the change it reads credited / exposed.

Missed-credit accounting

The Rust missed-credit list (fixtures/rust-verdict-corpus/missed-credit.toml, which replaced the missed_credit_ceiling line in #10222) is 160 entries on main and 160 here. This PR does not flip any existing abstained row (the 13 transitive_reach_unresolved rows are integration/public-API shapes in other files or crates, not same-impl method forwarders), so no entry is deleted. Counting the new positive row at baseline it would have been 161, so the slice removes a missed credit of its own shape without lowering the standing list.

Remainder of #9638 (not in this PR)

  • The specimen's .unwrap_or_else(SmallVecError::handle) tail is treated as a transform and still abstains; admitting it needs a rule for a diverging handler and unit-returning forwarders whose effect is observed on state.
  • Cross-file and cross-crate public-API reach for the existing semver-*, rusqlite-* and tokens-base-six-hop-chain rows is unchanged.


Generated by Claude Code

…d forwarder (#9638)

A receiver call of a unique inherent forwarder method now relates the test to
the owner behind it as helper_owner_call, anchored to the unique indexed
workspace callee. Forwarding, shadowing, name-collision and multi-candidate
refusals are unchanged and stay fail-closed. Adds the authored
forwarder-hop corpus cases, spec text and focused regression tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
…beling observation (#9638)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 186 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 788503db-a670-481e-ad76-2e4fcfd28d43
Commits

Reviewing files that changed from the base of the PR and between e54afad and c4e3922.

Files ignored due to path filters: 1
  • fixtures/rust-verdict-corpus/spec-examples.lock is excluded by !**/*.lock
Files selected for processing: 30
  • .ripr/traceability.toml
  • changelog.d/9638-method-forwarder-reach.md
  • crates/ripr/src/analysis/classify/call_identity.rs
  • crates/ripr/src/analysis/classify/helper_transfer.rs
  • crates/ripr/src/analysis/classify/owner_pin.rs
  • crates/ripr/src/analysis/classify/related_tests.rs
  • crates/ripr/tests/helper_wrapper_reach.rs
  • docs/specs/RIPR-SPEC-0159-bounded-helper-transfer.md
  • fixtures/rust-verdict-corpus/cases/forwarder-hop-forwarded-hit.diff
  • fixtures/rust-verdict-corpus/cases/forwarder-hop-forwarded-hit.json
  • fixtures/rust-verdict-corpus/cases/forwarder-hop-multi-candidate.diff
  • fixtures/rust-verdict-corpus/cases/forwarder-hop-multi-candidate.json
  • fixtures/rust-verdict-corpus/cases/forwarder-hop-name-collision.diff
  • fixtures/rust-verdict-corpus/cases/forwarder-hop-name-collision.json
  • fixtures/rust-verdict-corpus/cases/forwarder-hop-std-named-owner-type.diff
  • fixtures/rust-verdict-corpus/cases/forwarder-hop-std-named-owner-type.json
  • fixtures/rust-verdict-corpus/cases/forwarder-hop-std-receiver-name.diff
  • fixtures/rust-verdict-corpus/cases/forwarder-hop-std-receiver-name.json
  • fixtures/rust-verdict-corpus/cases/forwarder-hop-swallowed-result.diff
  • fixtures/rust-verdict-corpus/cases/forwarder-hop-swallowed-result.json
  • fixtures/rust-verdict-corpus/expected/rows/forwarder-hop-forwarded-hit.json
  • fixtures/rust-verdict-corpus/expected/rows/forwarder-hop-multi-candidate.json
  • fixtures/rust-verdict-corpus/expected/rows/forwarder-hop-name-collision.json
  • fixtures/rust-verdict-corpus/expected/rows/forwarder-hop-std-named-owner-type.json
  • fixtures/rust-verdict-corpus/expected/rows/forwarder-hop-std-receiver-name.json
  • fixtures/rust-verdict-corpus/expected/rows/forwarder-hop-swallowed-result.json
  • fixtures/rust-verdict-corpus/subjects/authored-forwarder-hop.json
  • fixtures/rust-verdict-corpus/subjects/authored-forwarder-hop/Cargo.toml
  • fixtures/rust-verdict-corpus/subjects/authored-forwarder-hop/src/lib.rs.txt
  • fixtures/rust-verdict-corpus/subjects/authored-forwarder-hop/tests/main.rs.txt
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request implements support for resolving same-impl forwarder methods called with a receiver (e.g., pool.grow(4) forwarding to try_grow). It adds the test_calls_method_entry helper to check for these receiver calls, integrates it into the related tests classification pipeline, and includes comprehensive test cases, specification updates, and test fixtures. The review feedback suggests a low-severity improvement to also match mut self as a valid receiver type in the signature parameter checks.

…entry (#9638)

A receiver call of a unique forwarder method relates the test only when the
receiver is a value of the forwarder's own impl type, read by the owner-pin
receiver reader (constructor, struct literal or annotated let). std and
external receivers named like the forwarder (Vec::len, HashSet::insert,
String::is_empty, an iterator's next) no longer relate. Refuses a forwarder in
a cfg(test) impl, pins each production-side guard with a negative, and adds
std-receiver corpus rows.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
…w observation commit (#9638)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
…and trace the new tests (#9638)

Rewords static-language terms, records which checks come from chain
construction, lists the forwarder_method_* tests in the RIPR-SPEC-0159
behavior block and clarifies acceptance example 4.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
…d more than once (#9638)

The receiver reader resolves a bare type name, so a sibling-module type of the
same name imported into the test (alt::Pool over the real Pool) read as the
forwarder's own type. Require exactly one workspace type of that name.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh

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

Refuted

  • The new receiver parsing could cause a use-after-free or dangling lifetime because it parses source text returned from the index.; refuted because: The parsed receiver is copied into an owned String, while the source/index references are ordinary Rust borrows that cannot outlive their owners.
  • The new receiver inspection has an active-view or backing-store lifetime defect.; refuted because: The implementation only scans Rust source strings and indexes character-safe byte ranges; it does not allocate or resize a native buffer, detach or transfer a view, or retain a stale length snapshot.
  • The new receiver-type analysis may introduce a worker, async, GC, detach, or transfer-boundary lifetime hazard.; refuted because: The changed implementation is synchronous Rust text/index analysis with owned return values and no JavaScript, async, concurrency, GC, detach, or transfer APIs.
  • The method-entry route should broaden to mut self and other forwarder variants now.; refuted because: The seeded thread and spec deliberately keep by-value and typed-self receivers fail-closed, while transformed results and state-only observation are explicitly parked for separate rules.
  • The parser could perform an out-of-bounds slice or panic on malformed receiver text.; refuted because: All slices are within the original string, UTF-8 boundaries are preserved by char_indices, depth uses checked_sub, and unsupported/malformed expressions return None.
  • A method name alone can create false relation to a changed owner.; refuted because: The test must contain only receiver calls, and every receiver must resolve to the entry's own impl type; explicit std-name and name-collision controls cover this.

Parked follow-ups

  • The PR intentionally parks by-value mut self, self: &mut Self, ?/unwrap_or_else transforms, cross-file/cross-crate public-API reach, and state-observation-only forwarders.

Evidence gaps

  • Compilation and focused runtime behavior were not independently established in this lane because ripr failed and cargo-test was pending late evidence.
  • Model proof intent was rejected by deterministic validation.
  • The changed Rust tests could not be independently run because the cargo-test receipt was scheduled but absent from the supplied review packet.
  • The ripr sensor failed with exit code 2, so the new analyzer route lacks a completed automated receipt in the shared packet; the PR body reports focused and corpus commands but those receipts are not included here.

@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

  • workspace_type_name_count counts keyword-prefixed source matches rather than verified type declarations, so unrelated declarations can make an otherwise unique receiver type appear ambiguous.

Verification questions

  • Confirm the receiver parser accepts inline constructor expressions such as Pool { .. } or Pool::default(), but does not establish that the constructor path resolves to the same workspace type when names are qualified or aliased.
  • Confirm the new route relies on textual source scanning for receiver mentions and declarations, making correctness sensitive to comments, strings, macro expansion, and unusual Rust syntax not covered by the listed controls.

Refuted

  • Parsing receiver expressions from indexed source could create a stale active view or expose backing-store memory.; refuted because: All indexes are bounded against immutable source slices; results are owned Strings. The changed path has no mutable allocation, resize, detach, transfer, raw pointer, or length-cache operation.
  • Receiver inspection introduces a dangling lifetime, active-view defect, or unsafe worker/async/GC handoff.; refuted because: The implementation is synchronous Rust text analysis; receiver expressions are copied into owned Strings and no worker, asynchronous, garbage-collected, detached, or transferred object is created.
  • The prior request to admit mut self should be implemented in this PR.; refuted because: The seeded thread explicitly rejects it as deliberate fail-closed scope, with a negative control pinning by-value and typed-self refusal; the current diff does not reopen that decision.
  • By-value mut self should be admitted as a method receiver.; refuted because: The seeded thread explicitly states that by-value receivers are deliberately fail-closed and pinned by a negative control; this is a scoped design decision, not an unresolved correctness defect.

Parked follow-ups

  • The changed rule does not broaden to transformed results, by-value or typed-self receivers, trait implementations, cross-package tests, or ambiguous workspace names; these are explicit refusal/parked shapes rather than sibling-path omissions.

Evidence gaps

  • The changed route and package gate are exercised end-to-end, but sensor ripr failed and cargo-test evidence was only scheduled, leaving centralized executable confirmation incomplete at review time.
  • Model proof intent was rejected by deterministic validation.

Copy link
Copy Markdown
Member Author

Review of record at head de4a4e1.

Angles, each by an independent read-only reviewer on a committed head:

  • False credit, 9ae59bb: F1 was blocking. A std or external receiver (Vec::len, HashSet::insert, String::is_empty, iterator next) was credited to an unrelated workspace forwarder, including a false exposed. Repaired in de56938: the receiver must be established as a value of the forwarder's own impl type, and #[cfg(test)] forwarders are refused.
  • Tests, spec, corpus, 9ae59bb: several guards survived mutation. Repaired with negatives for trait-impl, no-self, evidence-source, macro-hop and two-package cases, plus traceability entries and a spec clarification on example 4.
  • False credit again, de56938: F2 was blocking. A same-named type in a sibling module (alt::Pool) was matched by bare name and credited as exposed. Repaired in de4a4e1: a receiver type counts only when exactly one workspace struct, enum, union or type alias carries that name.
  • Final delta, de4a4e1: no blocking or unsafe-direction defect. About 25 probe fixtures were all refused. The count over-counts, which fails closed.

Resolutions: Gemini's mut self nit was declined in-thread; by-value receivers stay refused and a negative pins that. The bot summary's "keyword-prefixed matches" finding is the same over-count, which only refuses more.

Proof on the head: cargo xtask precommit exit 0. helper_wrapper_reach 64, method_helper_reach 12, crate_qualified_entry_reach 41, --lib classify:: 1756 and the owner-pin suites pass. Rust verdict-corpus check: 719 cases, false verdicts 0/719, contradictions 0/901, spec examples 288/288, traps credited 0/43. Two owner_pin_execution tests fail in the review sandbox with ENOENT on a nested offline cargo run; they fail the same way on the parent.

Not established: hosted qualification, the goldens comparison for owner_return_pin_fallible_literal (environment gap), and full-suite runs. Main is currently red from two unrelated breaks (#10663, #10660). Next: merge main once they land, mark Ready, apply merge-ready on the exact head.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 26, 2026 11:40
@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!

@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

…ckage and cache type-name counts (#9638)

A root-package owner has no package prefix, so a workspace member's test
passed the in-package check. Fail closed unless the test is itself outside
every member package. The per-name type declaration counts are built once
per index instead of re-masking every file per receiver check.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh

Copy link
Copy Markdown
Member Author

Review-of-record addendum for head 7f42379 (supplements the review at de4a4e1).

Delta: Devin found two issues after the final delta review, both fixed in 7f42379.

  • Root-package owner: a workspace member's test could relate to a root-package owner, because a missing owner package prefix was read as permission for every test. This was a credit hole. Fixed fail-closed: with no owner prefix, only a test with no prefix of its own and relative paths qualifies. A new root-plus-member regression is mutation-checked, and forcing the None arm open fails it.
  • Performance: the per-name type count rescanned every indexed file for each receiver check. It is now a table built once per index. The ambiguity refusal is unchanged.

Both changes tighten credit or preserve behavior. This delta was reviewed by the implementer's mutation check, not by a fresh independent reviewer. The mut self, same-named-type and "keyword-prefixed count" items are addressed as explained earlier, and all three Devin threads have replies.

Proof at 7f42379: cargo xtask precommit exit 0; helper_wrapper_reach 65, method_helper_reach and crate_qualified_entry_reach pass; --lib classify:: 1756; Rust verdict-corpus check 719 cases, false verdicts 0/719, contradictions 0/901. Not established: hosted qualification, and the goldens comparison for owner_return_pin_fallible_literal (environment gap). Main is waiting on #10663 and #10660 before the required run can pass.


Generated by Claude Code

@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 the receiver-unestablished negative combines an external HashSet receiver, a function-returned Pool, and a rebound Pool, so it does not independently isolate the unsupported constructor-return or shadowing cases.
  • Confirm the root-package/member negative verifies that the member lacks helper_owner_call but does not assert that the member is absent from all related-test classifications; the intended relation-specific scope is nevertheless clear from the test name and implementation.
  • Confirm no broad scan proves the receiver-call route has no relevant sibling entry points or uncommon syntax variants outside the checked free-call and method-call surfaces.
  • Confirm package-boundary sibling routes appear closed for member tests, but the root-package guard is defense-in-depth rather than independently mutation-pinned.

Refuted

  • The receiver/type-count changes introduce unsafe pointer ownership, aliasing, or concurrency hazards.; refuted because: The implementation uses immutable source references, standard owned collections, and OnceLock-backed lazy initialization with no raw pointers, mutable aliasing, unsafe blocks, or custom synchronization.
  • The receiver parser or type-count cache could expose length or pointer state invalidated by later buffer mutation.; refuted because: No mutable allocation or native buffer is involved. The cache contains only owned name/count data, and each source-derived substring is copied into an owned String before use.
  • The new route crosses a worker, async, GC, detach, or transfer boundary.; refuted because: The implementation is synchronous Rust classification over immutable index data and contains no worker spawn, future, JS/GC object, detach, transfer-list, raw pointer, or thread-boundary operation.

Parked follow-ups

  • Broader by-value mut self, transformed-result, and state-only forwarder behavior is intentionally outside this rule and should remain a separate follow-up.

Evidence gaps

  • The initial ripr sensor failed and cargo-test is only scheduled-late, so current execution evidence is incomplete even though author-reported focused tests and corpus replay pass.
  • Model proof intent was rejected by deterministic validation.

@EffortlessSteven

EffortlessSteven commented Oct 26, 2026 •

Copy link
Copy Markdown
Member Author

Convergence note: required check red on run 40388346541 is an inherited stale-merge-ref artifact, not this branch's delta.

Update 20:4xZ — convergence yielded to the active lane. While the refresh was in flight, the author's automation pushed c4e39222a5 (merge of origin/main e54afad55f into 7f42379, 19:54:47Z) and re-fired its own merge-ready run 40394768398 at 20:20:34Z; the repeated label event cancelled that run and started the equivalent 40396318315 on the same head c4e39222a5 with a fresh merge ref 767aebc514 (admission passed, Rust gates in progress). Per the active-lane rule (writer push inside the 4-hour window), merge convergence stops here. Next transition for the owner or a successor: when 40396318315 completes green, re-verify git ls-remote still returns c4e39222a5, then squash-merge and reconcile #9638. The verified review of record (12:30Z addendum, findings verified at 7f42379) still covers the content: c4e39222a5 adds only main's movement.

@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 receiver recognition is textual and bounded to identifiers, inline constructors, and struct-literal-style constructors; uncommon valid receiver syntax can cause missed credit.
  • Confirm method-call entry has broad receiver-identity controls but no exhaustive sibling coverage for qualified, aliased, imported, macro-generated, or unusual constructor call shapes.
  • Confirm the workspace type-name count is intended to detect struct, enum, union, and alias declarations, but its keyword scan may be broader than actual declaration syntax.

Refuted

  • The new source parsing introduces a dangling lifetime, stale active view, or backing-store exposure.; refuted because: All analyzed data remains borrowed from immutable Rust sources or copied into owned Strings and owned collections. There is no mutable backing buffer, resize, detach, transfer, raw pointer, or length snapshot.
  • The receiver/type memoization introduces a worker handoff, detach, transfer, or concurrency lifetime hazard.; refuted because: The implementation uses a standard OnceLock holding an owned BTreeMap and performs no cross-thread handoff, detach, or transfer operation.
  • A std or external receiver sharing a forwarder method name can produce false exposed credit.; refuted because: Receiver identity must match the entry impl type; external and std receivers fail type establishment, while same-name workspace types are conservatively treated as ambiguous.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.
  • The proof set is incomplete in this lane because the ripr sensor failed and cargo-test was scheduled late; corpus and focused-test claims still require broker confirmation at the reviewed head.

@EffortlessSteven
EffortlessSteven merged commit 4033006 into main Oct 26, 2026
98 of 105 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/missed-credit-reach-9638 branch October 26, 2026 21:25

Copy link
Copy Markdown
Member Author

Merged as 4033006aea4ba554c6d6612aec773ad7a9690743 (squash, expected head c4e39222a5b68e01bb15b2e798237b55b7ed59e7). Required Ripr Rust Small Result was green on that exact head (run 40396318315). All four review threads are answered and resolved; the review of record and its addendum are above.


Generated by Claude Code

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Review of record (exact-head sweep, head c4e39222a5b68e01bb15b2e798237b55b7ed59e7)

The only earlier review on this head is the automated verification-questions notice (review 5658937002); the substantive automated review (5651005854) was submitted at a different head (de4a4e13). This is the substantive review of record for the merged head, posted post-merge as COMMENT; findings below are follow-through items, none assessed as merge-blocking.

Verified

Observed (REST reads at head c4e3922, this session):

  • Full 31-file patch read via GET /pulls/10628/files (paginated): analyzer delta in crates/ripr/src/analysis/classify/helper_transfer.rs (+151: test_calls_method_entry, receivers_are_entry_type, receiver_expression), owner_pin.rs (+84: test_receiver_named_type, workspace_type_name_count), call_identity.rs (+14: memoized type-name counts), related_tests.rs (+25/-1: the calls_method_entry gate); corpus (6 cases/rows, subject authored-forwarder-hop), spec RIPR-SPEC-0159, .ripr/traceability.toml, changelog fragment.
  • Head sources re-read at c4e3922 for the machinery the new rule leans on: mentions_only_as_receiver_call (helper_transfer.rs:1152), HelperChain hop ordering (owner-first; entry_name is the last hop's caller, so hops[..=at] is owner-to-entry as documented), package_prefix (related_tests.rs:3562, trailing-slash prefixes, so the crates/ripr vs crates/ripr-foo prefix collision cannot occur), the receiver reader (owner_pin.rs:10132 test_receiver_type, 12936 binding_type, 12876 binds_outside_let, 13573 shadow checks), and impl_self_type (helper_transfer.rs:656).
  • The diff matches the body's claimed scope (same-impl forwarder entry; credit-or-unknown; corpus plus spec examples 10/11) with one accuracy exception noted below.
  • Counted: 16 new forwarder_method_* tests in helper_wrapper_reach.rs = 16 new .ripr/traceability.toml rows. fixtures/rust-verdict-corpus/missed-credit.toml is absent from the changed-file list, matching the body's "no entry deleted" claim.
  • Check runs at head: 104 runs - 40 success, 57 skipped, 6 cancelled, 1 failure (Ripr Rust Small Result aggregate). The PR merged through the protected path; the aggregate failure is recorded as observed state, not diagnosed here.
  • Dedupe: GET /pulls/10628/reviews (10 reviews) - no substantive review of record existed on this head.

Reported (PR body, not re-run here): cargo xtask precommit exit 0; verdict-corpus check 717 cases / 0 drift; focused-test counts; the oracle-grip removal experiment on the shadow check; baseline attribution (limited/no_static_path -> credited/exposed).

Not verified (no local runs): the local checkout at F:\code\Rust\ripr-swarm is not a usable worktree (git rev-parse --show-toplevel fails; git log is stale at 36d46845b4), so no cargo/xtask command was executed in this review. The static analysis stands on the head-SHA sources listed above.

Findings

[P2] Spec and rule doc claim a parameter receiver never relates, but the reader admits a typed test parameter (inline at helper_transfer.rs:1195)

  • Failure mode: a receiver bound only as a typed test parameter (fn grow_pins(mut pool: Pool), no let, owned pattern, single-fn body) resolves through test_receiver_named_type -> test_receiver_type (owner_pin.rs:10141-10151): receiver_let_bindings returns None because binds_outside_let (owner_pin.rs:12876-12893) sees the name in the fn parameter list, and the fallthrough parameter_annotation (owner_pin.rs:10192-10228) returns the annotation, so the method-entry rule credits it. helper_transfer.rs:1194-1195 and RIPR-SPEC-0159 line 110 both state "a parameter ... never relates the test". The credited case is not obviously a false credit (the annotation names the unique workspace type; the reader's #6578 rstest parameter support is deliberate), but the enforced rule is broader than the documented one, and no test or corpus row pins the typed-parameter shape in either direction, so future reader changes can move it silently.
  • Fix direction: either correct helper_transfer.rs:1194-1195 and spec line 110 to say an owned, single-fn typed test parameter does establish identity, and pin it with a positive helper_wrapper_reach case plus a corpus row; or make this caller refuse the parameter path and pin the refusal.
  • Validation: cargo test --test helper_wrapper_reach forwarder_method and cargo xtask verdict-corpus check after either repair.
  • Confidence: High on the code path (read at head); High on the doc/spec mismatch.

[P2] workspace_type_name_count counts keyword-prefixed words, not parsed declarations (carried) (inline at owner_pin.rs:13466)

  • Failure mode: an over-count of a receiver type name (whole-word struct/enum/union/type matches in masked source, owner_pin.rs:13466-13490) makes an otherwise-unique receiver type read ambiguous, so a true positive fails closed as missed credit. Never a false credit.
  • Why here: recorded as a confirmed finding by the automated review at the earlier head de4a4e13 (review 5651005854) and as a verification question at this head (5658937002); the code is unchanged, so it stays open on the merged head.
  • Fix direction: derive the counts from the indexed syntax declarations instead of the whole-word keyword scan.
  • Validation: cargo xtask verdict-corpus check; the forwarder-hop-std-named-owner-type credit rows are the sensitive positives.
  • Confidence: Medium - no concrete over-count fixture was constructed in this review.

Note (scope accuracy, record-only): the PR body says "four cases" and "six new forwarder_method_*"; the merged diff carries six corpus cases and 16 new tests. The body also reports goldens check INCOMPLETE for owner_return_pin_fallible_literal as a known environment gap. Recorded so the merge receipt does not understate the diff; body edits are outside this review lane.

What holds up

Strongest positive: the corpus discipline. Six authored rows carry runtime-mutant truth replayed with zero drift (reported), including two credit-direction rows (forwarder-hop-forwarded-hit, and forwarder-hop-std-named-owner-type, which credits a std-colliding name only through a receiver of the owner's own type) and four abstention traps. Of the 16 new helper_wrapper_reach tests, three carry credit-direction assertions and the rest target one guard each (shadow, path/value call, cfg(test) impl/module, no-self/mut-self/typed-self, macro hop, external trait impl, unestablished/same-named receivers, cross-package, root-package member). The shadow negative's remaining receiver call pool.grow(4) passes every other method-entry guard as read, so only the shadow check refuses it - that control discriminates. The root-package fixture pins member-test refusal and root-test credit in one workspace, and the package gate rides trailing-slash prefixes, so near-miss crate names cannot slip through.

Residual risk: receiver recognition is textual (documented): spaced call syntax, a turbofish on the entry, and call texts the extractor does not capture are refused as missed credit; a foreign import shadowing the type via cross-file glob re-exports sits outside the reader's file-scoped import check. Neither direction produces false credit on the evidence read here.

Validation signal:

  • Observed: the REST reads enumerated above; check-run conclusions at the head SHA.
  • Reported: PR-body proof commands and counts (precommit, verdict-corpus 717/0, focused tests, oracle-grip removal, missed-credit accounting).
  • Not verified: any local cargo/xtask execution (no usable local worktree).

Disposition: Findings above; none blocking (post-merge review of record; both findings are P2 follow-through).

/// `let` the test binds only to that type's constructor or struct literal,
/// or an inline constructor, read by the owner-pin receiver reader. A std
/// or external receiver, a parameter, a rebound name or a foreign import of
/// the type never relates the test (`Vec::len` is not a forwarder `len`).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

[P2] Doc claims a parameter receiver never relates; the reader admits a typed test parameter

Failure mode: for fn grow_pins(mut pool: Pool) (no let, owned pattern, single-fn body), test_receiver_named_type reaches test_receiver_type (owner_pin.rs:10141): receiver_let_bindings returns None because binds_outside_let (owner_pin.rs:12876) sees the name in the fn parameter list, and parameter_annotation (owner_pin.rs:10192) returns Pool, so this rule credits. This doc line and RIPR-SPEC-0159 line 110 say a parameter never relates the test.

Why here: the sentence was written against the let-binding reading; the owner-pin reader's #6578 parameter path deliberately establishes typed parameters, and no test or corpus row pins the typed-parameter shape in either direction.

Fix direction: align this doc and spec line 110 with the reader (typed parameter establishes identity) and pin both directions with a helper_wrapper_reach case and a corpus row - or refuse the parameter path for this caller and pin the refusal.

Validation: cargo test --test helper_wrapper_reach forwarder_method; cargo xtask verdict-corpus check.

Confidence: High (both sides read at head c4e3922).

/// How many `struct`, `enum`, `union` or `type` items named `name` the
/// workspace declares, across every module and file. The per-name table is
/// built once per index (every file masked once), then looked up.
fn workspace_type_name_count(name: &str, index: &RustIndex) -> usize {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

[P2] Keyword-scan declaration count can over-count a unique type name (carried)

Failure mode: whole-word struct/enum/union/type matches in masked source count as declarations, so a non-declaration word match of a receiver type's name anywhere in the workspace makes the name ambiguous and a true positive fails closed as missed credit (never a false credit).

Why here: recorded as a confirmed finding by the automated review at head de4a4e13 (review 5651005854) and as a verification question at this head (5658937002); the code is unchanged here, so it remains open post-merge.

Fix direction: derive the counts from indexed syntax declarations instead of the whole-word keyword scan.

Validation: cargo xtask verdict-corpus check; the forwarder-hop-std-named-owner-type credit rows are the sensitive positives.

Confidence: Medium (no over-count fixture constructed in this review).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants