Skip to content

fix(rust): withhold gaps for owners reached without a placeable call - #9477

Closed
EffortlessSteven wants to merge 16 commits into
mainfrom
claude/project-thread-x0aino
Closed

EffortlessSteven wants to merge 16 commits into
mainfrom
claude/project-thread-x0aino

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #9442 and #9443 (under #9410). Based on main.

Swarm / Source Boundary

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

Source-of-truth Links

Governing issue or accepted claim: #9442, #9443
Acceptance delta (one sentence): The Rust corpus rows for function-value, fn-pointer, cfg_attr test, macro-generated and block_on-wrapped owners stop being false actionable.

What changed

  • New limit rust_indirect_owner_call_unresolved (RIPR-SPEC-0240, classify/indirect_owner.rs). Withholds a weak gap when a related test passes the owner as a function value, when the changed line is an item-position macro invocation, or when the owner call is the only argument of block_on / a local Future-polling helper. Limited, not credited: crediting needs the iterator chain or executor result evaluated (feat(rust): credit owners reached as function values, macro-generated or inside block_on instead of limiting them #9478).
  • #[cfg_attr(<known-true predicate>, test)] is a test in the fact normalizer, parser and owner pin. Feature/target predicates and siblings like ignore still refuse.
  • A trailing comment after the owner's tail no longer defeats the owner-return pin.
  • Cache generations 1.92 / 0.99 / 1.46, with every mirrored pin and snapshot updated.

Corpus effect

shape-hostile-cfg-attr-test → credited; shape-hostile-owner-as-path-value, -through-fn-pointer, -macro-defined-owner, shape-async-fn-block-on → limited. Their [[known_false]] entries are removed.

Proof

cargo xtask verdict-corpus check-all   # 4 corpora, ledger matches
cargo xtask precommit                  # exit 0
cargo test -p ripr                     # green

Non-goals: attribute noise (#9439), implicit trait-method reach (#9441).

Claim boundary

May claim: these forms no longer produce an actionable gap. Must not claim: ripr reads them correctly beyond the cfg_attr case.

Rollback

Revert the commit.

🤖 Generated with Claude Code

https://claude.ai/code/session_014rDKCvewzinJrP5bh5iuSY

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

@EffortlessSteven EffortlessSteven self-assigned this Oct 22, 2026
@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 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 158 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: 7889fb2a-7907-4e18-bb03-92fb243bf377
Commits

Reviewing files that changed from the base of the PR and between 72c0c4a and 40fdd46.

Files selected for processing: 38
  • changelog.d/9442-9443-indirect-owner-call-limit.md
  • crates/ripr/src/analysis/classify/indirect_owner.rs
  • crates/ripr/src/analysis/classify/mod.rs
  • crates/ripr/src/analysis/classify/owner_pin.rs
  • crates/ripr/src/analysis/facts/cfg_predicates.rs
  • crates/ripr/src/analysis/facts/cfg_predicates/tests.rs
  • crates/ripr/src/analysis/facts/test_styles.rs
  • crates/ripr/src/analysis/facts/test_styles/tests.rs
  • crates/ripr/src/analysis/language/rust/mod.rs
  • crates/ripr/src/analysis/seam_cache.rs
  • crates/ripr/src/analysis/syntax/owner_pin.rs
  • crates/ripr/src/analysis/syntax/ra.rs
  • crates/ripr/src/domain/language.rs
  • crates/ripr/src/lsp/gap_artifacts.rs
  • crates/ripr/tests/cache_clear_safety.rs
  • crates/ripr/tests/indirect_owner_limit.rs
  • crates/ripr/tests/lsp_lifecycle/gap_corpus_currentness.rs
  • crates/ripr/tests/macro_generated_tests.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/shape-async-fn-block-on.json
  • fixtures/rust-verdict-corpus/expected/rows/shape-hostile-cfg-attr-test.json
  • fixtures/rust-verdict-corpus/expected/rows/shape-hostile-macro-defined-owner.json
  • fixtures/rust-verdict-corpus/expected/rows/shape-hostile-owner-as-path-value.json
  • fixtures/rust-verdict-corpus/known-false/shape-async-fn-block-on.toml
  • fixtures/rust-verdict-corpus/known-false/shape-hostile-cfg-attr-test.toml
  • fixtures/rust-verdict-corpus/known-false/shape-hostile-macro-defined-owner.toml
  • fixtures/rust-verdict-corpus/known-false/shape-hostile-owner-as-path-value.toml
  • policy/output_contracts.txt
  • xtask/src/main.rs
  • 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.

Copy link
Copy Markdown
Member Author

Follow-up for crediting the four limited shapes: #9478. The limit's Next: guidance entry is not possible yet, because the exhaustive next_step() from the guidance work (#9449) has not landed on main. Whichever of the two merges second adds the rust_indirect_owner_call_unresolved entry; the exhaustive match will force it. The existing per-limit recommended_next_step text is already set by withhold_gap.


Generated by Claude Code

Base automatically changed from claude/project-thread-9lsalp to main October 22, 2026 05:01
@EffortlessSteven
EffortlessSteven force-pushed the claude/project-thread-x0aino branch from 60267dc to 032a74f Compare October 22, 2026 07:59
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 22, 2026 07:59
…9442, #9443)

An owner passed as a function value, generated by an item macro, or called
inside block_on / a local Future-polling helper has no call ripr can pair
with the assertion. Those read weakly_exposed; they now read static_unknown
under the new rust_indirect_owner_call_unresolved limit.

comment after the owner's tail no longer defeats the owner-return pin, so
shape-hostile-cfg-attr-test credits. Re-blessed: 5 rows (1 credited,
4 limited); no other row moved.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014rDKCvewzinJrP5bh5iuSY
Pattern bindings of the owner's name are locals; a value use counts only in a
listed test when a related test already calls the owner; ignored-test and
unrelated-binding controls; cache schema bumps; judged-panel kind mirror.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014rDKCvewzinJrP5bh5iuSY
…d boundary_gap snapshots (#9442)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014rDKCvewzinJrP5bh5iuSY
…ss the async rows (#9442)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014rDKCvewzinJrP5bh5iuSY
@EffortlessSteven
EffortlessSteven force-pushed the claude/project-thread-x0aino branch from 032a74f to 4489505 Compare October 22, 2026 09:38

Copy link
Copy Markdown
Member Author

Review of record — head 29c8ca28 (reviewed at ecec368a, repairs since are fixes and rebases listed below).

Angles, each by an independent reviewer agent: (1) correctness and edge cases, (2) tests and regressions (including mutation checks on the new predicates), (3) spec and contract.

Findings and resolutions:

  • Correctness: the function-value form withheld gaps when the owner's name was a local binding (let, for, closure parameter, match-arm pattern, typed parameter). Fixed with pattern_spans; two controls added.
  • Correctness: the form scanned tests unrelated to the finding, so an ignored test naming the owner as a value could withhold a real gap. Fixed: the form needs a related test. Control added.
  • Contract: verdict-affecting change needed cache generations. Bumped to 1.92 / 0.99 (file facts 1.46) and mirrored in the judged-panel known-limit list, the LSP currentness pin, the OUTPUT_SCHEMA examples and the boundary_gap unchanged-after-attempt snapshots (receipt hashes re-derived).
  • Policy: indirect_owner.rs added to the is_test_file consumer inventory with a reason.
  • Not fixed, non-blocking: no negative control for sees_owner, related_direct gating or generated_owner's inside_function; spec wording says "a related test's assertion" where the code takes the first related test. Tracked with the follow-up in feat(rust): credit owners reached as function values, macro-generated or inside block_on instead of limiting them #9478.
  • Not claimed: the four limited shapes are limits, not credit (feat(rust): credit owners reached as function values, macro-generated or inside block_on instead of limiting them #9478).

Rebased on main (cache bump 1.91 from the skip-list change landed first). The known_false entries this fix retires are removed, plus three stale Rust entries (#9441) that #9588 also drops. Rust corpus check passes (555 cases, ledger matches); cargo xtask precommit exit 0; cargo test -p ripr green apart from one receipt-hash mismatch fixed afterwards and re-run (first_useful_action_corpus_pins_routing_cases passes). TypeScript ledger drift is #9591's.

Still open after merge: the Next: guidance entry for the new limit, which needs #9449's exhaustive next_step().


Generated by Claude Code

… out of the ledger

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

Copy link
Copy Markdown
Member Author

Independent read of head 797184def (correctness and false-credit angle; read-only, nothing run). One finding worth a fix before merge, the rest checked and clean.

Finding: #[cfg_attr(all(), test, ignore)] (or should_panic) can now make an ignored or panic-expecting function a live test fact.

  • cfg_predicates::attribute_introduces_test (any sibling allowed) is used by the fact normalizer (syntax/ra.rs, analysis/facts/test_styles.rs path) so the function becomes a test. The unit table even pins it: ("#[cfg_attr(all(), test, ignore)]", true, false) means "introduces test: true, only test: false".
  • The owner pin guards this with attribute_introduces_only_test, so the owner-pin credit is safe. But gap_admission::is_ignored only recognizes a literal #[ignore] / #[ignore = ..]; an ignore introduced inside cfg_attr is not seen. Every other classification path that counts live tests as discriminators will now count a test that a default run never executes. Before this PR that function was not a test fact at all, so this is a new false-credit direction (the one we fail closed on).
  • Same shape for should_panic introduced by cfg_attr: expects_owner_panic reads only the literal attribute.

Fix. In the normalizer paths use attribute_introduces_only_test (the doc on attribute_introduces_test already says a sibling "may change how the test runs"), or make is_ignored / expects_owner_panic read cfg_attr-introduced siblings. Add negatives: a fixture with #[cfg_attr(all(), test, ignore)] fn t() { assert_eq!(owner(1), 2); } must stay non-credited, and the same with should_panic.

Checked and fine. Predicate evaluation only credits Ok(Some(true)); feature, target, tokio::test, test(arg), r#test, inner #[cfg_attr], and unterminated forms are all negatives in the table. The trailing-comment change in syntax/owner_pin.rs ends the tail at the masked end only when a real // or /* follows, so string literals cannot move the cut. The indirect-owner limit only withholds (static_unknown), never credits.

Not established: whether another consumer outside the two paths named above reads attribute_introduces_test; git grep on this head shows only those.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Source review of the diff at head 797184d (static read by a review worker; nothing built or run; I have not re-traced these lines myself). Disposition: COMMENT with concerns. No provider review exists (Gemini and CodeRabbit posted only quota notices) and there are no review threads.

Staleness: mergeable_state is dirty and main is 141 commits ahead of the PR base. Per the worker, origin/main already has CACHE_SCHEMA_VERSION 1.95, sharded and compact 0.102, and file facts 1.45, so the 1.92 / 0.99 / 1.46 bumps will conflict and need renumbering, and the boundary_gap snapshot hashes and the pins in OUTPUT_SCHEMA, gap_corpus_currentness.rs and rust_corpus_projection.rs need re-deriving.

Concerns (the first can create a false gap, the others hide real gaps):

  1. analysis/facts/test_styles.rs:~188 (attributes_define_test via attribute_introduces_test) with classify/gap_admission.rs:1081 (is_ignored): #[cfg_attr(all(), test, ignore)] or test, should_panic. The normalizer and parser accept any list containing test, but is_ignored matches only the literal #[ignore]/#[ignore= attribute. An ignored test then becomes an active related test with a weak assertion, giving a new weakly_exposed gap pointing at a test that never runs (before the change it was a non-test). Only the owner pin uses the stricter attribute_introduces_only_test. The "beside ignore does not credit" control in indirect_owner_limit.rs asserts only no Exposed, not that no gap appears.
  2. indirect_owner.rs:49 and :363: KNOWN_EXECUTORS = ["block_on"] matches any callee whose leaf is block_on, with no check on its definition. A workspace fn block_on(x: u32) -> u32 or any method .block_on(..) withholds the gap when the owner call is its sole argument, and the "local helper must mention Future" test is skipped for that name. The negative control renames the helper, so block_on as a non-executor is untested.
  3. indirect_owner.rs:183-213 (generated_owner): the doc says the named tests are those "that call a name the invocation spells", but the code takes any related test (.find(DirectOwnerCall).or_else(first())) and never checks that the macro defines the owner. The trigger (changed line in no function, expression starting path!(, [ or {) also covers lazy_static!, thread_local!, bitflags!, const_format! edits, and any related test then withholds the gap. The spec's "the expansion is not read" is broader than the macro-defined-owner row it was written for, and there is no negative control for a non-owner item macro.
  4. indirect_owner.rs:164-172 and :249-262: function-value detection is purely lexical on the masked body, so struct shorthand S { inc }, assert_eq!(x, inc) or a same-named const/static/enum variant counts as a value mention. When no related test calls the owner, any assertion-bearing test in the owner's file or an integration-test file qualifies, related or not, so a common owner name (value, new, total) can withhold real gaps. is_bound_locally covers let/for/closure/match-arm patterns but not shorthand or struct fields, and there is no shorthand test.

Nits: cfg_attr(not(test), test) (evaluates Some(false), refused) and cfg_attr(feature = "x", test) (None, refused) behave as claimed per the worker's read of availability_predicate in its local copy of cfg_predicates.rs (which may differ from the PR base), but the not(test) case is missing from the cfg_attr_introduces_test_only_under_a_predicate_known_true table. docs/OUTPUT_SCHEMA.md:~2294 appends rust_indirect_owner_call_unresolved. after a sentence already ending in "rust_implicit_call_unresolved.", breaking the list punctuation.

Checked and fine: the enum, as_str, known_static_limit_kind list, output_contracts line, judged-panel mirror, STATIC_LIMITS table and changelog fragment are all present; the owner-pin trailing-comment change is narrow; the corpus flips (4 limited, 1 credited) match the body; the Next: guidance is acknowledged as deferred until #9449.

Not checked: fixtures and corpus truth, whether builtin_test_attribute_holds handles the cfg_attr module, and what else changed on main beyond the cache constants.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

The read-only review finding (cfg_attr(all(), test, ignore|should_panic) becoming a live test fact) is fixed in #9845, a successor carrying these commits merged with current main (this branch conflicts with main and its session has been idle since 09:45Z). The fix routes the normalizer and parser through attribute_introduces_only_test and adds negatives, including two corpus cases. Plan: merge #9845, then close this PR as superseded.


Generated by Claude Code

# Conflicts:
#	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/lsp_lifecycle/gap_corpus_currentness.rs
#	docs/OUTPUT_SCHEMA.md
#	docs/STATIC_LIMITS.md
#	docs/roadmap/false-verdicts.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/spec-coverage.toml
#	policy/output_contracts.txt
#	xtask/src/python_judged_panel.rs
#	xtask/src/tests/rust_corpus_projection.rs

@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

  • Two cfg_attr negative tests have weaker oracle assertions than the neighboring gap controls: they pass on any non-exposed outcome, including no finding, so they may not detect the intended false-credit regression cleanly.
  • cfg_attr(all(), test, ignore) is accepted by attribute_introduces_test in the fact normalizer, while owner-pin logic requires attribute_introduces_only_test.

Verification questions

  • Confirm function-value detection treats any integration test as seeing the owner, but the finding's related-test relation is not required when no direct/helper call is listed.
  • Confirm the cfg_attr fact path is not symmetric with owner-pin credit: facts use attribute_introduces_test and admit a test sibling, whereas owner pin requires attribute_introduces_only_test.
  • Confirm the repository claims the new limit has a complete proof path, but the ripr sensor failed with exit code 2 and cargo-test is only scheduled late; unavailable test evidence should not be presented as established safety.
  • Confirm the new public integration test only checks that cfg_attr(all(), test, ignore) does not produce exposed credit, not that it remains non-crediting in every gap-admission route.
  • Confirm the cfg_attr sibling and unknown-predicate controls assert only that no finding is exposed; they do not distinguish an expected retained gap from an unrelated finding disappearance or unsupported limit.
  • Confirm the cfg_attr negative controls cover feature-gated predicates and an introduced ignore sibling, but the supplied patch does not show an explicit should_panic negative control.

Refuted

  • This change crosses a worker handoff, GC, detach, or transferable-memory boundary that could create use-after-free or ownership loss.; refuted because: The changed implementation is a Rust source analyzer with no JavaScript runtime, worker, GC, detach, or transferable-memory API in scope. Its Future-related logic only recognizes call syntax and is not an asynchronous ownership handoff.

Evidence gaps

  • Runtime evidence remains incomplete because ripr failed and cargo-test had not yet produced a receipt when this lane reviewed the packet.
  • Deterministic execution proof is unavailable in the supplied packet because cargo-test has no receipt and the ripr sensor failed.
  • Model proof intent was rejected by deterministic validation.

…past both changes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014rDKCvewzinJrP5bh5iuSY
…erations 1.99 / 1.47 in pins and snapshots (#9442)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014rDKCvewzinJrP5bh5iuSY
…d (left to #9478) (#9442)

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

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

Copy link
Copy Markdown
Member Author

Superseded — claim delivered by #9845.

PR #9845 ("fix(rust): withhold gaps for owners reached without a placeable call (successor to #9477)") landed this same claim on main as db3bf7ce67f9ddd02331381a1e3bf6fbbf9df1e8 (merged 2026-10-26T00:22:02Z), including classify/indirect_owner.rs with rust_indirect_owner_call_unresolved (RIPR-SPEC-0240) and its STATIC_LIMITS/schema/docs composition. It closed #9442 on merge; #9443 was already closed (2026-10-25T04:52:18Z).

This branch's final head 40fdd46842 had the required check Ripr Rust Small Result passing (run 40139158866) but now conflicts with main precisely because both branches carry the same change — merging here would double-land the fix, so this PR closes as superseded instead.

Residuals, for the record:

Convergence evidence: PR #9477 head 40fdd46842 = branch claude/project-thread-x0aino; superseding merge db3bf7ce67 on main; owning issues #9442 (closed by #9845), #9443 (closed), umbrella #9410 (open).

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.

fix(rust): owners reached as function values, from cfg_attr tests, or generated by macros read as unreached gaps

2 participants