Skip to content

fix(rust): withhold gaps on trait-impl methods no test names - #9595

Closed
EffortlessSteven wants to merge 2 commits into
mainfrom
claude/project-thread-9lsalp
Closed

EffortlessSteven wants to merge 2 commits into
mainfrom
claude/project-thread-9lsalp

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Fixes #9441 (under #9410). A weak gap on a method of impl Trait for Type that no related test calls by name now reads static_unknown under the new rust_implicit_trait_call_unresolved limit (RIPR-SPEC-0240). Operators, Drop, Iterator and dyn dispatch run the method without spelling it, so name-token proximity cannot support "assertion too weak". Nothing is credited.

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-0240 (new "Trait-impl methods no test names" section)
Governing issue or accepted claim: #9441
Acceptance delta (one sentence): The Rust corpus rows shape-op-add-impl, shape-drop-impl-side-effect and shape-dyn-trait-method-exact stop being false actionable.

Candidate Relationships

Candidate branch: claude/project-thread-9lsalp
Stack parent or prerequisite PR (if any): none. Independent of #9477 and #9488; the cache schema bump (1.90 to 1.91) and the StaticLimitKind list will conflict mechanically with whichever merges first.

Scope Classification

  • Analyzer change with spec, tests and corpus rows

What changed

The limit (classify/implicit_call.rs) fires when all hold: the owner id is impl Trait for Type; reach is the proximity-only reading; no related test is a direct_owner_call; some name-tied test pins a strong exact value; and no related test calls the method name except through dyn <Trait>. Narrowing came from measurement: a first version drifted 18 goldens (same-named methods on other types, rust_trait_impl_shadow and friends) and 3 true-gap corpus rows, so a call by name on a concrete type and a smoke/relational-only test keep their gap.

Corpus effect (555 cases, false verdicts 17 to 14)

  • false_actionable to abstained: shape-op-add-impl, shape-drop-impl-side-effect, shape-dyn-trait-method-exact.
  • Cost, ideal to abstained (cases accept limited): config-default-host, shape-dyn-trait-method-twin-input. They are true gaps whose name-tied test pins an exact value of a different input; telling them apart needs input-to-impl evaluation.
  • Unmoved by design: shape-op-neg-smoke, shape-partialord-swapped-fields, shape-fromstr-boundary-unpinned (no strong name-tied oracle).
  • shape-iterator-next-collect (abstained before) is unchanged.

Proof

cargo test -p ripr --test implicit_trait_call_limit   # 6 pass; the 3 withheld tests fail with the call removed
cargo xtask verdict-corpus check                       # no drift after bless
cargo xtask goldens check                              # clean apart from the offline anyhow fixture
cargo xtask precommit                                  # exit 0

Full cargo test -p ripr: only failures are the offline fallible_literal tests (need to download anyhow). Cache schema 1.90 to 1.91; first_useful_action snapshots re-hashed and a boundary_gap CHANGELOG entry added.

Claim Boundary

May claim: these trait-impl shapes no longer produce a certain gap. Must not claim: they are credited or that a test pins the method.

Static Language Check

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

Generated by Claude Code

A weak gap on a method of impl Trait for Type that no related test calls by
name reads as limited under rust_implicit_trait_call_unresolved. Operators,
Drop, Iterator and dyn dispatch run the method without spelling it
(RIPR-SPEC-0240). A call by name on a concrete type keeps its gap.

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

coderabbitai Bot commented Oct 22, 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 17 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 102 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: 51285540-a788-4711-aeb5-99a3b5b60c8b
📥 Commits

Reviewing files that changed from the base of the PR and between b98867f and 563f833.

📒 Files selected for processing: 26
  • .ripr/traceability.toml
  • changelog.d/9441-trait-impl-methods-no-test-names.md
  • crates/ripr/src/analysis/classify/implicit_call.rs
  • crates/ripr/src/analysis/classify/mod.rs
  • crates/ripr/src/analysis/language/rust/mod.rs
  • crates/ripr/src/analysis/seam_cache.rs
  • crates/ripr/src/domain/language.rs
  • crates/ripr/src/lsp/gap_artifacts.rs
  • crates/ripr/tests/implicit_trait_call_limit.rs
  • crates/ripr/tests/lsp_lifecycle/gap_corpus_currentness.rs
  • docs/OUTPUT_SCHEMA.md
  • docs/STATIC_LIMITS.md
  • docs/specs/RIPR-SPEC-0240-unknown-not-a-gap.md
  • fixtures/boundary_gap/expected/CHANGELOG.md
  • fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/after.repo-exposure.json
  • fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/agent-receipt.json
  • fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/agent-verify.json
  • fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/before.repo-exposure.json
  • fixtures/rust-verdict-corpus/expected/rows/config-default-host.json
  • fixtures/rust-verdict-corpus/expected/rows/shape-drop-impl-side-effect.json
  • fixtures/rust-verdict-corpus/expected/rows/shape-dyn-trait-method-exact.json
  • fixtures/rust-verdict-corpus/expected/rows/shape-dyn-trait-method-twin-input.json
  • fixtures/rust-verdict-corpus/expected/rows/shape-op-add-impl.json
  • policy/output_contracts.txt
  • xtask/src/python_judged_panel.rs
  • xtask/src/tests/rust_corpus_projection.rs
  • 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 the rust_implicit_trait_call_unresolved limit (RIPR-SPEC-0240) to withhold weak gaps on trait-implementation methods that lack explicit test names (such as operators, drop glue, iteration, or trait objects). It introduces the classification logic in implicit_call.rs, integrates it into the Rust analysis pipeline, bumps the cache schema version to 1.91, and updates the corresponding documentation, tests, and fixtures. Feedback on the changes highlights two key improvements: first, instantiating the RAII cleanup guard immediately after creating the temporary directory in TempRepo::create prevents directory leaks if subsequent file writes fail; second, extracting the last segment of the trait path for trait_ident ensures robust detection of trait objects when they are referred to by their short names.

Bump the sharded and compact classified-seam cache generations (0.98) beside
full 1.91, mask comments and strings and read turbofish calls when looking for
a named call, keep the gap when a related test is not in the index, match the
trait object by its last path segment, and clean the test temp dir on a
partial setup failure.

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

Copy link
Copy Markdown
Member Author

Review of record — head 563f833

Two independent read-only reviewers on d1e3ecf, plus Gemini inline comments.

Correctness / edge cases (blocking found and fixed):

  • Whole-body dyn <Trait> mention cancelled a real concrete call in a comment or string: fixed by masking comments and strings first. A concrete call plus a dyn Trait mention in the same test still withholds; documented in the spec (needs receiver typing).
  • Turbofish call (x.parse_as::<T>(..)) not read as a call: fixed, control test added.
  • Test lookup miss failed open to withhold: now keeps the gap.
  • Non-blocking, left: a local fn inside a trait-impl method inherits the impl id (cannot be called by name from a test anyway); weak_token_substring ties are by design.

Spec / contract (blocking found and fixed):

  • Sharded and compact classified-seam cache generations were not bumped: now 0.98 beside full 1.91.
  • Spec/docs said "exact value" where code checks a strong oracle: reworded. STATIC_LIMITS row order fixed.
  • Every rust_framework_oracle_unresolved site has a sibling; "1.90" has no remaining hits.

Gemini: trait path last segment and RAII guard ordering, both fixed and resolved.

Proof on this head: implicit_trait_call_limit 7 pass (3 withheld tests fail with the call removed); verdict-corpus check 14/555 false, no drift; goldens 0 drift apart from the offline anyhow fixture; cargo xtask precommit exit 0. Full cargo test -p ripr on the prior head: only offline fallible_literal tests and the cache-hash snapshot (since re-hashed) failed.

Disposition: no open blocking findings.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 22, 2026 09:45
@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!

Copy link
Copy Markdown
Member Author

Closing as superseded by #9466 (merged at 605ce3f), which already fixes #9441 under rust_implicit_call_unresolved. It moves the same three rows (shape-op-add-impl, shape-drop-impl-side-effect, shape-dyn-trait-method-exact) to abstained, and keeps the shadow-trait goldens as gaps. This PR only landed the same value under a second limit name, so merging both would leave two overlapping limits. I did not find an input class that #9595 covers and #9466 misses; #9441 should be closed by #9466's reconciliation.


Generated by Claude Code

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.

fix(rust): methods called implicitly (operators, Drop, Iterator::next, dyn dispatch) read as unreached gaps

2 participants